From b0c5f09169ac31855ebf0e93772bb57b9635b380 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 28 May 2007 22:57:39 +0000 Subject: see 23479: add initial features support for modules --- Src/Modules/regex.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'Src/Modules/regex.c') diff --git a/Src/Modules/regex.c b/Src/Modules/regex.c index 44019a1b9..a3d956055 100644 --- a/Src/Modules/regex.c +++ b/Src/Modules/regex.c @@ -131,6 +131,16 @@ static struct conddef cotab[] = { CONDDEF("regex-match", CONDF_INFIX, zcond_regex_match, 0, 0, ZREGEX_EXTENDED) }; + +static struct features module_features = { + NULL, 0, + cotab, sizeof(cotab)/sizeof(*cotab), + NULL, 0, + NULL, 0, + 0 +}; + + /**/ int setup_(UNUSED(Module m)) @@ -138,19 +148,33 @@ setup_(UNUSED(Module m)) return 0; } +/**/ +int +features_(Module m, char ***features) +{ + *features = featuresarray(m->nam, &module_features); + return 0; +} + +/**/ +int +enables_(Module m, int **enables) +{ + return handlefeatures(m->nam, &module_features, enables); +} + /**/ int boot_(Module m) { - return !addconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab)); + return 0; } /**/ int cleanup_(Module m) { - deleteconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab)); - return 0; + return setfeatureenables(m->nam, &module_features, NULL); } /**/ -- cgit v1.2.3