19 lines
398 B
C
19 lines
398 B
C
#pragma once
|
|
#ifndef _SERVER_UTIL
|
|
#define _SERVER_UTIL
|
|
|
|
#include <ini.h>
|
|
#include <stdio.h>
|
|
#include <inttypes.h>
|
|
|
|
#define CONFGETINT(var, config, t, q, p, base) \
|
|
var = (int) strtol(ini_get(config, t, q), p, base); \
|
|
if(var<=0) { \
|
|
fprintf(stderr, "ERROR reading config for variable %c\n", t); \
|
|
ini_free(config); \
|
|
return 1; \
|
|
}
|
|
|
|
|
|
#endif /* _SERVER_STATUS */
|