X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/74620ebafeb4a94b61a3747e39d27a4ec7a9fe5a..8855bb48b449ed06cfd3ce528b3c0a77c37cb24b:/newsearch/ns-topic.c diff --git a/newsearch/ns-topic.c b/newsearch/ns-topic.c index 29f52938..4bb44f5c 100644 --- a/newsearch/ns-topic.c +++ b/newsearch/ns-topic.c @@ -7,17 +7,12 @@ #include #include -void *topic_exe(struct searchNode *thenode, void *theinput); -void topic_free(struct searchNode *thenode); +void *topic_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput); +void topic_free(searchCtx *ctx, struct searchNode *thenode); -struct searchNode *topic_parse(int type, int argc, char **argv) { +struct searchNode *topic_parse(searchCtx *ctx, int argc, char **argv) { struct searchNode *thenode; - if (type != SEARCHTYPE_CHANNEL) { - parseError = "topic: 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 *topic_parse(int type, int argc, char **argv) { return thenode; } -void *topic_exe(struct searchNode *thenode, void *theinput) { +void *topic_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) { chanindex *cip = (chanindex *)theinput; if ((cip->channel==NULL) || (cip->channel->topic==NULL)) @@ -41,7 +36,7 @@ void *topic_exe(struct searchNode *thenode, void *theinput) { return cip->channel->topic->content; } -void topic_free(struct searchNode *thenode) { +void topic_free(searchCtx *ctx, struct searchNode *thenode) { free(thenode); }