#ifndef _STRUCTS_H_4e4cacde_ #define _STRUCTS_H_4e4cacde_ #include #include #include "linereader.h" typedef enum { DT_UNSET = 1, DT_INT, DT_FLOAT, } DATATYPE; typedef enum { SPRV_GOOD = 1, SPRV_UNKNOWN, SPRV_ERROR, } SPRV; typedef unsigned long long int TIMEINTVL; typedef struct config CONFIG; typedef struct repo REPO; typedef struct listen LISTEN; typedef struct lep LEP; typedef struct lepfd LEPFD; typedef struct lep_ops LEP_OPS; typedef struct map MAP; typedef struct map_ops MAP_OPS; typedef struct sect_ops SECT_OPS; typedef struct config_parse_temp CONFIG_PARSE_TEMP; struct config { REPO *repos; LISTEN *listens; struct stat confstat; CONFIG_PARSE_TEMP *pt; } ; struct config_parse_temp { SECT_OPS *ops; void *sectpriv; const char *filename; LINEREADER *lr; FILE *errf; int elb; void (*err_throw)(void); } ; struct listen { LISTEN *link; unsigned int permit; #define OP_NEW 0x00000001 #define OP_FETCH 0x00000002 LEP *endpoints; MAP *mappings; } ; struct lep { LEP *link; LEP_OPS *ops; void *priv; } ; struct map { MAP *link; MAP_OPS *ops; void *priv; } ; struct lep_ops { int (*add)(CONFIG *, LISTEN *, const char *, int, const char *); void (*free)(void *); } ; #define LEP_OPS_INIT(name) { &lep_##name##_add, &lep_##name##_free } struct map_ops { int (*add)(CONFIG *, LISTEN *, const char *, int, const char *); void (*free)(void *); } ; #define MAP_OPS_INIT(name) { &map_##name##_add, &map_##name##_free } struct sect_ops { void *(*start)(const char *, CONFIG *); SPRV (*parse)(void *, const char *); void (*done)(void *); } ; #define SECT_OPS_INIT(name) { §_##name##_start, §_##name##_parse, §_##name##_done } #endif