]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-exists.c
LUA: add function for channel chanop notice
[irc/quakenet/newserv.git] / newsearch / ns-exists.c
index bfcfb90778f55f9169e30e4477e476f616900300..63d6613472144a47fed0a150ba5903e450c57a58 100644 (file)
@@ -7,17 +7,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void *exists_exe(struct searchNode *thenode, void *theinput);
-void exists_free(struct searchNode *thenode);
+void *exists_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
+void exists_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *exists_parse(int type, int argc, char **argv) {
+struct searchNode *exists_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (type != SEARCHTYPE_CHANNEL) {
-    parseError = "exists: this function is only valid for channel searches.";
-    return NULL;
-  }
-
   if (!(thenode=(struct searchNode *)malloc(sizeof (struct searchNode)))) {
     parseError = "malloc: could not allocate memory for this search.";
     return NULL;
@@ -31,7 +26,7 @@ struct searchNode *exists_parse(int type, int argc, char **argv) {
   return thenode;
 }
 
-void *exists_exe(struct searchNode *thenode, void *theinput) {
+void *exists_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   chanindex *cip = (chanindex *)theinput;
 
   if (cip->channel == NULL)
@@ -40,7 +35,7 @@ void *exists_exe(struct searchNode *thenode, void *theinput) {
   return (void *)1;
 }
 
-void exists_free(struct searchNode *thenode) {
+void exists_free(searchCtx *ctx, struct searchNode *thenode) {
   free(thenode);
 }