X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/27ce0548659b866469bb01b639aab0682a4ea667..9e5f0d797a0957172a9fd7b79f20115bc6fdcbd7:/newsearch/ns-ip.c diff --git a/newsearch/ns-ip.c b/newsearch/ns-ip.c index cfdb1ffc..5bd84e5c 100644 --- a/newsearch/ns-ip.c +++ b/newsearch/ns-ip.c @@ -7,17 +7,12 @@ #include #include -void *ip_exe(struct searchNode *thenode, int type, void *theinput); -void ip_free(struct searchNode *thenode); +void *ip_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput); +void ip_free(searchCtx *ctx, struct searchNode *thenode); -struct searchNode *ip_parse(int type, int argc, char **argv) { +struct searchNode *ip_parse(searchCtx *ctx, int argc, char **argv) { struct searchNode *thenode; - if (type != SEARCHTYPE_NICK) { - parseError = "ip: this function is only valid for nick searches."; - return NULL; - } - if (!(thenode=(struct searchNode *)malloc(sizeof (struct searchNode)))) { parseError = "malloc: could not allocate memory for this search."; return NULL; @@ -31,17 +26,13 @@ struct searchNode *ip_parse(int type, int argc, char **argv) { return thenode; } -void *ip_exe(struct searchNode *thenode, int type, void *theinput) { +void *ip_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) { nick *np = (nick *)theinput; - if (type != RETURNTYPE_STRING) { - return (void *)1; - } - - return IPtostr(np->p_ipaddr); + return (void *)IPtostr(np->ipaddress); } -void ip_free(struct searchNode *thenode) { +void ip_free(searchCtx *ctx, struct searchNode *thenode) { free(thenode); }