#include <stdio.h>
#include <stdlib.h>
-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;
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 (void *)IPtostr(np->p_ipaddr);
}
-void ip_free(struct searchNode *thenode) {
+void ip_free(searchCtx *ctx, struct searchNode *thenode) {
free(thenode);
}