49 #ifndef TOR_LIB_CONF_CONFDECL_H
50 #define TOR_LIB_CONF_CONFDECL_H
59 #define BEGIN_CONF_STRUCT(name) \
60 PASTE(BEGIN_CONF_STRUCT__, CONF_CONTEXT)(name)
64 #define END_CONF_STRUCT(name) \
65 PASTE(END_CONF_STRUCT__, CONF_CONTEXT)(name)
70 #define CONF_VAR(varname, vartype, varflags, initval) \
71 PASTE(CONF_VAR__, CONF_CONTEXT)(varname, vartype, varflags, initval)
79 #define BEGIN_CONF_STRUCT__STRUCT(name) \
82 #define END_CONF_STRUCT__STRUCT(name) \
84 #define CONF_VAR__STRUCT(varname, vartype, varflags, initval) \
85 config_decl_ ## vartype varname;
93 #define BEGIN_CONF_STRUCT__TABLE(structname) \
96 typedef struct structname config_var_reference__obj; \
97 static const config_var_t structname##_vars[] = {
98 #define END_CONF_STRUCT__TABLE(structname) \
99 { .member = { .name = NULL } } \
101 #define CONF_VAR__TABLE(varname, vartype, varflags, initval) \
104 { .name = #varname, \
105 .type = CONFIG_TYPE_EXTENDED, \
106 .type_def = &vartype ## _type_defn, \
107 .offset=offsetof(config_var_reference__obj, varname), \
110 .initvalue = initval \
119 #define BEGIN_CONF_STRUCT__LL_TABLE(structname) \
122 typedef struct structname config_var_reference__obj; \
123 static const config_var_t structname##_vars[] = {
124 #define END_CONF_STRUCT__LL_TABLE(structname) \
125 { .member = { .name = NULL } } \
127 #define CONF_VAR__LL_TABLE(varname, vartype, varflags, initval) \
130 { .name = #varname, \
131 .type = CONFIG_TYPE_ ## vartype, \
132 .offset=offsetof(config_var_reference__obj, varname), \
135 .initvalue = initval \
144 #define BEGIN_CONF_STRUCT__STUB_TABLE(structname) \
145 static const config_var_t structname##_vars[] = {
146 #define END_CONF_STRUCT__STUB_TABLE(structname) \
147 { .member = { .name = NULL } } \
149 #define CONF_VAR__STUB_TABLE(varname, vartype, varflags, initval) \
152 { .name = #varname, \
153 .type = CONFIG_TYPE_IGNORE, \
156 .flags = CFLG_GROUP_DISABLED, \
171 typedef char *config_decl_FILENAME;
176 typedef int config_decl_POSINT;
177 typedef uint64_t config_decl_UINT64;
178 typedef int config_decl_INT;
179 typedef int config_decl_INTERVAL;
180 typedef int config_decl_MSEC_INTERVAL;
181 typedef uint64_t config_decl_MEMUNIT;
182 typedef double config_decl_DOUBLE;
183 typedef int config_decl_BOOL;
184 typedef int config_decl_AUTOBOOL;
185 typedef time_t config_decl_ISOTIME;
187 typedef int config_decl_CSV_INTERVAL;
190 typedef struct nonexistent_struct *config_decl_LINELIST_S;
char * config_decl_STRING
Integer definitions used throughout Tor.