55 lines
1002 B
C
55 lines
1002 B
C
|
|
#include <logger.h>
|
|
#include <server.h>
|
|
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include <tconfig.h>
|
|
#include <massert.h>
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
int res = 0;
|
|
|
|
logger_dprintf("main start");
|
|
logger_init();
|
|
|
|
server_init(argc, argv);
|
|
server_config();
|
|
server_run();
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
|
|
int _main(int argc, char** argv) {
|
|
(void)argc;
|
|
(void)argv;
|
|
|
|
tconfig_t tconfig;
|
|
|
|
tconfig_init(&tconfig);
|
|
|
|
int intkey = 0;
|
|
char* strkey = NULL;
|
|
|
|
tconfig_bind(&tconfig, TCONF_INT, "intkey", &intkey);
|
|
tconfig_bind(&tconfig, TCONF_STR, "strkey", &strkey);
|
|
|
|
ssize_t rsize = tconfig_read(&tconfig, "helmet.conf");
|
|
|
|
printf("%ld\n", rsize);
|
|
MASSERT(rsize > 0);
|
|
|
|
int res = tconfig_parse(&tconfig);
|
|
|
|
MASSERT(res == -1);
|
|
|
|
tconfig_destroy(&tconfig);
|
|
|
|
printf("int key = %d\n", intkey);
|
|
printf("str key = %s\n", strkey);
|
|
return 0;
|
|
}
|