Subversion Repositories Tewi

Rev

Rev 240 | Rev 255 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 240 Rev 253
Line 1... Line 1...
1
/* $Id: config.c 240 2024-10-03 05:54:55Z nishi $ */
1
/* $Id: config.c 253 2024-10-04 03:13:36Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "tw_config.h"
5
#include "tw_config.h"
6
#include "tw_module.h"
6
#include "tw_module.h"
Line 129... Line 129...
129
int tw_config_read(const char* path) {
129
int tw_config_read(const char* path) {
130
	char cbuf[2];
130
	char cbuf[2];
131
	int ln = 0;
131
	int ln = 0;
132
	int ifbr = 0;
132
	int ifbr = 0;
133
	int ignore = -1;
133
	int ignore = -1;
-
 
134
	int portcount;
134
	FILE* f;
135
	FILE* f;
135
	cm_log("Config", "Reading %s", path);
136
	cm_log("Config", "Reading %s", path);
136
	f = fopen(path, "r");
137
	f = fopen(path, "r");
137
	cbuf[1] = 0;
138
	cbuf[1] = 0;
138
	if(f != NULL) {
139
	if(f != NULL) {
Line 485... Line 486...
485
				free(tmp);
486
				free(tmp);
486
			}
487
			}
487
		}
488
		}
488
		free(line);
489
		free(line);
489
		fclose(f);
490
		fclose(f);
-
 
491
		for(portcount = 0; config.ports[portcount] != -1; portcount++);
-
 
492
		if(portcount == 0){
-
 
493
			return 1;
-
 
494
		}else{
490
		return stop;
495
			return stop;
-
 
496
		}
491
	} else {
497
	} else {
492
		cm_log("Config", "Could not open the file");
498
		cm_log("Config", "Could not open the file");
493
		return 1;
499
		return 1;
494
	}
500
	}
495
}
501
}