62 lines
1007 B
C
62 lines
1007 B
C
|
|
#include <logger.h>
|
|
#include <server.h>
|
|
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include <tconfig.h>
|
|
#include <massert.h>
|
|
|
|
#include <logger.h>
|
|
#include <tconfig.h>
|
|
#include <massert.h>
|
|
|
|
|
|
|
|
int main(void) {
|
|
int res = 0;
|
|
|
|
logger_init();
|
|
logger_dprintf("main start");
|
|
|
|
util_init();
|
|
util_config();
|
|
util_run();
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
int util_init(void) {
|
|
logger_dprintf("server init");
|
|
return 0;
|
|
}
|
|
|
|
int util_config(void) {
|
|
logger_dprintf("server config");
|
|
|
|
tconfig_t tconfig;
|
|
|
|
tconfig_init(&tconfig);
|
|
|
|
char* logpath = NULL;
|
|
|
|
tconfig_bind(&tconfig, TCONF_STR, "logpath", &logpath);
|
|
ssize_t rsize = tconfig_read(&tconfig, "helmet.conf");
|
|
|
|
int res = tconfig_parse(&tconfig);
|
|
|
|
MASSERT(res == -1);
|
|
|
|
tconfig_destroy(&tconfig);
|
|
logger_dprintf("logpath = %s", logpath);
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
int util_run(void) {
|
|
logger_dprintf("server start");
|
|
return 0;
|
|
}
|