]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-channels.c
LUA: port luadb to dbapi2 to drop postgres dependency
[irc/quakenet/newserv.git] / newsearch / ns-channels.c
index 5f0559887d599ee3a9905fd8ee2d393b0c3d435a..1e116474f8a8c9dce171f35cebe2890bce3b2479 100644 (file)
 #include "../irc/irc_config.h"
 #include "../lib/irc_string.h"
 
-void *channels_exe(struct searchNode *thenode, void *theinput);
-void channels_free(struct searchNode *thenode);
+void *channels_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
+void channels_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *channels_parse(int type, int argc, char **argv) {
+struct searchNode *channels_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (type != SEARCHTYPE_NICK) {
-    parseError = "channels: 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;
@@ -34,12 +29,12 @@ struct searchNode *channels_parse(int type, int argc, char **argv) {
   return thenode;
 }
 
-void *channels_exe(struct searchNode *thenode, void *theinput) {
+void *channels_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   nick *np = (nick *)theinput;
 
-  return (void *)np->channels->cursi;
+  return (void *)(long)np->channels->cursi;
 }
 
-void channels_free(struct searchNode *thenode) {
+void channels_free(searchCtx *ctx, struct searchNode *thenode) {
   free(thenode);
 }