X-Git-Url: http://git.pk910.de/?p=srvx.git;a=blobdiff_plain;f=src%2Fproto-common.c;h=bc37f32a13aa945940a109cba3d627f620120c43;hp=e690726116d06cbe36b2d30ef9da9fc223fb5fea;hb=fffe459760943b6ed8e0bb736c87ef424ce38fdc;hpb=c253a006e0eafc173752e7c77dd706e02073cd20 diff --git a/src/proto-common.c b/src/proto-common.c index e690726..bc37f32 100644 --- a/src/proto-common.c +++ b/src/proto-common.c @@ -577,6 +577,34 @@ call_oper_funcs(struct userNode *user) } } +static xquery_func_t *xqf_list; +static unsigned int xqf_size = 0, xqf_used = 0; + +void +reg_xquery_func(xquery_func_t handler) +{ + if (xqf_used == xqf_size) { + if (xqf_size) { + xqf_size <<= 1; + xqf_list = realloc(xqf_list, xqf_size*sizeof(xquery_func_t)); + } else { + xqf_size = 8; + xqf_list = malloc(xqf_size*sizeof(xquery_func_t)); + } + } + xqf_list[xqf_used++] = handler; +} + +static void +call_xquery_funcs(struct server *source, const char routing[], const char query[]) +{ + unsigned int n; + for (n=0; n < xqf_used; n++) + { + xqf_list[n](source, routing, query); + } +} + struct mod_chanmode * mod_chanmode_alloc(unsigned int argc) {