]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-realname.c
SearchCtx should contain 'type' - this is to make life easier when defining new searc...
[irc/quakenet/newserv.git] / newsearch / ns-realname.c
index ad04ed1560625db81620e113048ea0f4d68c80a1..6dbb9117f9b56ecca176cc07739b5875bcca429f 100644 (file)
@@ -7,13 +7,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void *realname_exe(struct searchNode *thenode, int type, void *theinput);
-void realname_free(struct searchNode *thenode);
+void *realname_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
+void realname_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *realname_parse(int type, int argc, char **argv) {
+struct searchNode *realname_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (type != SEARCHTYPE_NICK) {
+  if (ctx->type != SEARCHTYPE_NICK) {
     parseError = "realname: this function is only valid for nick searches.";
     return NULL;
   }
@@ -31,17 +31,13 @@ struct searchNode *realname_parse(int type, int argc, char **argv) {
   return thenode;
 }
 
-void *realname_exe(struct searchNode *thenode, int type, void *theinput) {
+void *realname_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   nick *np = (nick *)theinput;
 
-  if (type != RETURNTYPE_STRING) {
-    return (void *)1;
-  }
-
   return np->realname->name->content;
 }
 
-void realname_free(struct searchNode *thenode) {
+void realname_free(searchCtx *ctx, struct searchNode *thenode) {
   free(thenode);
 }