X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/c7f7a584fd6c8ee4a0ede6e79e8ce2177ab863f0..8855bb48b449ed06cfd3ce528b3c0a77c37cb24b:/newsearch/ns-length.c?ds=sidebyside diff --git a/newsearch/ns-length.c b/newsearch/ns-length.c index dc363d54..9bb0da7c 100644 --- a/newsearch/ns-length.c +++ b/newsearch/ns-length.c @@ -9,10 +9,10 @@ #include #include -void length_free(struct searchNode *thenode); -void *length_exe(struct searchNode *thenode, void *theinput); +void length_free(searchCtx *ctx, struct searchNode *thenode); +void *length_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput); -struct searchNode *length_parse(int type, int argc, char **argv) { +struct searchNode *length_parse(searchCtx *ctx, int argc, char **argv) { struct searchNode *thenode, *childnode; if (!(thenode = (struct searchNode *)malloc(sizeof(struct searchNode)))) { @@ -31,29 +31,29 @@ struct searchNode *length_parse(int type, int argc, char **argv) { return NULL; } - childnode = search_parse(type, argv[0]); - if (!(thenode->localdata = coerceNode(childnode, RETURNTYPE_STRING))) { - length_free(thenode); + childnode = ctx->parser(ctx, argv[0]); + if (!(thenode->localdata = coerceNode(ctx, childnode, RETURNTYPE_STRING))) { + length_free(ctx, thenode); return NULL; } return thenode; } -void length_free(struct searchNode *thenode) { +void length_free(searchCtx *ctx, struct searchNode *thenode) { struct searchNode *anode; if ((anode=thenode->localdata)) - (anode->free)(anode); + (anode->free)(ctx, anode); free(thenode); } -void *length_exe(struct searchNode *thenode, void *theinput) { +void *length_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) { char *strval; struct searchNode *anode=thenode->localdata; - strval=(char *)(anode->exe)(anode, theinput); + strval=(char *)(anode->exe)(ctx, anode, theinput); return (void *)strlen(strval); }