Added log utility and improved server

This commit is contained in:
elvis
2022-03-22 19:35:06 +01:00
parent b11640aff0
commit c1977248d7
7 changed files with 111 additions and 23 deletions

View File

@ -4,6 +4,7 @@
#include <ini.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#define CONFGETINT(var, config, t, q, p, base) \
@ -14,5 +15,16 @@
return 1; \
}
#define CONFGETSTR(var, config, t, q, buff) \
var = ini_get(config, t, q); \
if(var==NULL) { \
fprintf(stderr, "ERROR reading config for variable %c\n", t); \
ini_free(config); \
return 1; \
} \
buff = calloc(strlen(var)+1, sizeof(char)); \
strncpy(buff, var, strlen(var)+1); \
var = buff;
#endif /* _SERVER_STATUS */