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