Skip to content

Commit c9adbeb

Browse files
committed
remove old fields from config file. clean up code style a bit. remove unneeded variable.
1 parent e79cd49 commit c9adbeb

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

src/config.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
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

@@ -38,15 +35,9 @@
3835

3936
typedef 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;

src/config_base.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,16 @@
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

2117
ConfigInfo config;
22-
char configFile[13];
2318

2419
/**
2520
* config_init()
2621
* Initialize configuration and load either config or defaults.
2722
*/
2823
void 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)
4235
void 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)
6252
void config_save(void)
6353
{
6454
FILE *fp;
65-
fp = fopen(configFile,"w");
55+
fp = fopen(CONFIG_FILE,"w");
6656

6757
if (!fp)
6858
return;

0 commit comments

Comments
 (0)