]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-exists.c
TRUSTS: require sqlite
[irc/quakenet/newserv.git] / newsearch / ns-exists.c
index 097a52be734f4d2f769cf673caa17d5465b61c65..63d6613472144a47fed0a150ba5903e450c57a58 100644 (file)
@@ -7,17 +7,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void *exists_exe(struct searchNode *thenode, int type, 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,15 +26,16 @@ struct searchNode *exists_parse(int type, int argc, char **argv) {
   return thenode;
 }
 
-void *exists_exe(struct searchNode *thenode, int type, void *theinput) {
+void *exists_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   chanindex *cip = (chanindex *)theinput;
 
   if (cip->channel == NULL)
-    return falseval(type);
-  return trueval(type);
+    return (void *)0;
+  
+  return (void *)1;
 }
 
-void exists_free(struct searchNode *thenode) {
+void exists_free(searchCtx *ctx, struct searchNode *thenode) {
   free(thenode);
 }