haproxy/include/common
Willy Tarreau 5b2c33683b [MEDIUM] add support for configuration keyword registration
Any module which needs configuration keywords may now dynamically
register a keyword in a given section, and associate it with a
configuration parsing function using cfg_register_keywords() from
a constructor function. This makes the configuration parser more
modular because it is not required anymore to touch cfg_parse.c.
Example :

static int parse_global_blah(char **args, int section_type, struct proxy *curpx,
                             struct proxy *defpx, char *err, int errlen)
{
	printf("parsing blah in global section\n");
	return 0;
}

static int parse_listen_blah(char **args, int section_type, struct proxy *curpx,
		      struct proxy *defpx, char *err, int errlen)
{
	printf("parsing blah in listen section\n");
	if (*args[1]) {
		snprintf(err, errlen, "missing arg for listen_blah!!!");
		return -1;
	}
	return 0;
}

static struct cfg_kw_list cfg_kws = {{ },{
	{ CFG_GLOBAL, "blah", parse_global_blah },
	{ CFG_LISTEN, "blah", parse_listen_blah },
	{ 0, NULL, NULL },
}};

__attribute__((constructor))
static void __module_init(void)
{
	cfg_register_keywords(&cfg_kws);
}
2008-07-09 19:44:58 +02:00
..
appsession.h [MAJOR] convert all expiration timers from timeval to ticks 2008-07-07 00:09:58 +02:00
base64.h [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00
cfgparse.h [MEDIUM] add support for configuration keyword registration 2008-07-09 19:44:58 +02:00
compat.h [BUILD] fix build with gcc 4.3 2008-04-21 07:35:00 +02:00
config.h [MEDIUM] implement memory pools version 2 2007-05-13 18:26:08 +02:00
debug.h [DEBUG] add a TRACE macro to facilitate runtime data extraction 2008-06-20 15:05:52 +02:00
defaults.h [MAJOR] proto_uxst rework -> SNMP support 2008-03-04 06:32:16 +01:00
eb32tree.h [MEDIUM] upgrade to ebtree v4.0 2008-05-16 19:48:20 +02:00
eb64tree.h [MEDIUM] upgrade to ebtree v4.0 2008-05-16 19:48:20 +02:00
ebpttree.h [MEDIUM] upgrade to ebtree v4.0 2008-05-16 19:48:20 +02:00
ebtree.h [BUILD] silent a warning in unlikely() with gcc 4.x 2008-07-06 15:18:50 +02:00
epoll.h [BUILD] declare epoll_* as static when using our own functions 2007-04-15 23:57:41 +02:00
errors.h [MINOR] add an options field to the listeners 2007-11-04 22:42:48 +01:00
memory.h [MAJOR] call garbage collector when doing soft stop 2007-05-14 00:39:29 +02:00
mini-clist.h [OPTIM] add branch prediction hints in list manipulations 2008-06-23 22:39:37 +02:00
rbtree.h [MINOR] imported the rbtree function from Linux kernel 2007-01-07 02:12:57 +01:00
regex.h [MAJOR] merged the 'setbe' actions to switch the backend on a regex 2006-12-17 23:15:24 +01:00
sessionhash.h [MAJOR] remove files distributed under an obscure license 2007-09-09 21:56:53 +02:00
standard.h [BUILD] silent a warning in unlikely() with gcc 4.x 2008-07-06 15:18:50 +02:00
template.h [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00
ticks.h [MAJOR] convert all expiration timers from timeval to ticks 2008-07-07 00:09:58 +02:00
time.h [MINOR] introduce now_ms, the current date in milliseconds 2008-06-29 13:47:25 +02:00
tools.h [MINOR] forgot to include common/tools.h in the archive. 2006-12-22 14:40:41 +01:00
uri_auth.h [MEDIUM] Fix memory freeing at exit, part 2 2008-06-07 11:06:14 +02:00
version.h [BUILD] centralize version and date into one file for each 2007-09-09 23:31:11 +02:00