Tor  0.4.4.0-alpha-dev
Macros
confmacros.h File Reference

Macro definitions for declaring configuration variables. More...

#include "orconfig.h"
#include "lib/conf/conftesting.h"

Go to the source code of this file.

Macros

#define END_OF_CONFIG_VARS   { .member = { .name = NULL } DUMMY_CONF_TEST_MEMBERS }
 
#define CONFIG_VAR_ETYPE(structtype, varname, vartype, membername, varflags, initval)
 
#define CONFIG_VAR_DEFN(structtype, varname, vartype, membername, varflags, initval)
 
#define CONFIG_VAR_OBSOLETE(varname)
 

Detailed Description

Macro definitions for declaring configuration variables.

Definition in file confmacros.h.

Macro Definition Documentation

◆ CONFIG_VAR_DEFN

#define CONFIG_VAR_DEFN (   structtype,
  varname,
  vartype,
  membername,
  varflags,
  initval 
)
Value:
{ .member = \
{ .name = varname, \
.type_def = &vartype ## _type_defn, \
.offset = offsetof(structtype, membername), \
}, \
.flags = varflags, \
.initvalue = initval \
CONF_TEST_MEMBERS(structtype, vartype, membername) \
}

As CONFIG_VAR_ETYPE, but declares a value using an extension type whose type definition is vartype_type_defn.

Definition at line 51 of file confmacros.h.

◆ CONFIG_VAR_ETYPE

#define CONFIG_VAR_ETYPE (   structtype,
  varname,
  vartype,
  membername,
  varflags,
  initval 
)
Value:
{ .member = \
{ .name = varname, \
.type = CONFIG_TYPE_ ## vartype, \
.offset = offsetof(structtype, membername), \
}, \
.flags = varflags, \
.initvalue = initval \
CONF_TEST_MEMBERS(structtype, vartype, membername) \
}

Declare a config_var_t as a member named membername of the structure structtype, whose user-visible name is varname, whose type corresponds to the config_type_t member CONFIG_TYPE_vartype, and whose initial value is intval.

Most modules that use this macro should wrap it in a local macro that sets structtype to the local configuration type.

Definition at line 35 of file confmacros.h.

◆ CONFIG_VAR_OBSOLETE

#define CONFIG_VAR_OBSOLETE (   varname)
Value:
{ .member = { .name = varname, .type = CONFIG_TYPE_OBSOLETE }, \
}
#define CFLG_GROUP_OBSOLETE
Definition: conftypes.h:214

Declare an obsolete configuration variable with a given name.

Definition at line 67 of file confmacros.h.

◆ END_OF_CONFIG_VARS

#define END_OF_CONFIG_VARS   { .member = { .name = NULL } DUMMY_CONF_TEST_MEMBERS }

Used to indicate the end of an array of configuration variables.

Definition at line 22 of file confmacros.h.