X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/c54295ef49e27548b5a26f6feffc194d9d9b2e45..f28b61f26dec986fb87602b5c75ad812b8297d85:/newsearch/ns-hostpct.c diff --git a/newsearch/ns-hostpct.c b/newsearch/ns-hostpct.c index d1867ac0..ca87951a 100644 --- a/newsearch/ns-hostpct.c +++ b/newsearch/ns-hostpct.c @@ -7,17 +7,12 @@ #include #include -void *hostpct_exe(struct searchNode *thenode, void *theinput); -void hostpct_free(struct searchNode *thenode); +void *hostpct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput); +void hostpct_free(searchCtx *ctx, struct searchNode *thenode); -struct searchNode *hostpct_parse(int type, int argc, char **argv) { +struct searchNode *hostpct_parse(searchCtx *ctx, int argc, char **argv) { struct searchNode *thenode; - if (type != SEARCHTYPE_CHANNEL) { - parseError = "uniquehostpct: this function is only valid for channel searches."; - return NULL; - } - if (!(thenode=(struct searchNode *)malloc(sizeof(struct searchNode)))) { /* couldn't malloc() memory for thenode, so free localdata to avoid leakage */ parseError = "malloc: could not allocate memory for this search."; @@ -32,7 +27,7 @@ struct searchNode *hostpct_parse(int type, int argc, char **argv) { return thenode; } -void *hostpct_exe(struct searchNode *thenode, void *theinput) { +void *hostpct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) { int i; unsigned int marker; unsigned int hosts=0; @@ -60,7 +55,7 @@ void *hostpct_exe(struct searchNode *thenode, void *theinput) { return (void *)(long)((hosts * 100)/cip->channel->users->totalusers); } -void hostpct_free(struct searchNode *thenode) { +void hostpct_free(searchCtx *ctx, struct searchNode *thenode) { free(thenode); }