Added log utility and improved server
This commit is contained in:
@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user