Files
helmetc/server.c
Олег Бородин 05f845a444 indent
2025-10-16 00:08:31 +02:00

51 lines
922 B
C

#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <logger.h>
#include <tconfig.h>
#include <massert.h>
int server_init(void) {
logger_dprintf("server init");
return 0;
}
#define SERVER_CONFIG_ERROR -1
int server_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");
if (rsize < 0) {
return SERVER_CONFIG_ERROR;
}
int res = tconfig_parse(&tconfig);
if (res < 0) {
return SERVER_CONFIG_ERROR;
}
tconfig_destroy(&tconfig);
logger_dprintf("logpath = %s", logpath);
return 0;
}
int server_run(void) {
logger_dprintf("server start");
return 0;
}