Pre-Packaged Configuration Functions
In general, as in the above example, we write our own function to
implement a directive. but this is not always necessary. In the common
case of a directive that simply set a field in the directory config,
we can use one of the pre-packaged functions: ap_set_string_slot,
ap_set_string_slot_lower, ap_set_int_slot, ap_set_flag_slot,
ap_set_file_slot
to set a field, according to the type of the
field to be set. To use these fields, we need to pass the field to be set
in the data pointer, so a declaration looks like:
AP_INIT_TAKE1("MySimpleDirective", ap_set_int_slot,
(void*)APR_OFFSETOF(my_dir_cfg, myintvar), OR_ALL,
"Set something") ;
where myintvar
is an integer member of the
my_dir_cfg
struct.