File tree Expand file tree Collapse file tree 2 files changed +5
-24
lines changed Expand file tree Collapse file tree 2 files changed +5
-24
lines changed Original file line number Diff line number Diff line change 1010#ifndef CONFIG_H
1111#define CONFIG_H
1212
13- #define IO_MODE_SERIAL 0
14- #define IO_MODE_ETHERNET 1
15-
1613#define XON_THRESHOLD 46
1714#define XOFF_THRESHOLD 127
1815
3835
3936typedef struct configInfo
4037{
41- unsigned char io_mode ;
4238 unsigned char baud ;
43- unsigned char use_dhcp ;
44- unsigned long ip_address ;
45- unsigned long netmask ;
46- unsigned long gateway ;
47- unsigned long dns ;
48- unsigned char driver_ser [16 ];
49- unsigned char driver_mou [16 ];
39+ unsigned char driver_ser ;
40+ unsigned char driver_mou ;
5041 unsigned char color_foreground ;
5142 unsigned char color_background ;
5243 unsigned char color_border ;
Original file line number Diff line number Diff line change 1212#include "config.h"
1313#include "screen.h"
1414
15- #ifdef __ATARI__
16- #define CONFIG_FILE "CONFIG"
17- #else
1815#define CONFIG_FILE "config"
19- #endif
2016
2117ConfigInfo config ;
22- char configFile [13 ];
2318
2419/**
2520 * config_init()
2621 * Initialize configuration and load either config or defaults.
2722 */
2823void config_init (void )
2924{
30- memset (& configFile ,0 ,sizeof (configFile ));
31- strcpy (configFile ,CONFIG_FILE );
3225 config_init_hook ();
3326 memset (& config ,0 ,sizeof (config ));
3427 config_load ();
@@ -42,16 +35,13 @@ void config_init(void)
4235void config_load (void )
4336{
4437 FILE * fp ;
45- fp = fopen (configFile ,"r" );
38+ fp = fopen (CONFIG_FILE ,"r" );
4639
4740 if (!fp )
48- {
4941 config_set_defaults ();
50- }
5142 else
52- {
5343 fread (& config ,1 ,sizeof (config ),fp );
54- }
44+
5545 fclose (fp );
5646}
5747
@@ -62,7 +52,7 @@ void config_load(void)
6252void config_save (void )
6353{
6454 FILE * fp ;
65- fp = fopen (configFile ,"w" );
55+ fp = fopen (CONFIG_FILE ,"w" );
6656
6757 if (!fp )
6858 return ;
You can’t perform that action at this time.
0 commit comments