]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-authedpct.c
merge
[irc/quakenet/newserv.git] / newsearch / ns-authedpct.c
index 62357420cabfb702a4f77f7d0336f2113883771b..8558e9ad2832c57cdd20d949bbe3f39c5dd09bf0 100644 (file)
@@ -7,17 +7,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void *authedpct_exe(struct searchNode *thenode, void *theinput);
-void authedpct_free(struct searchNode *thenode);
+void *authedpct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
+void authedpct_free(searchCtx *ctx, struct searchNode *thenode);
 
-struct searchNode *authedpct_parse(int type, int argc, char **argv) {
+struct searchNode *authedpct_parse(searchCtx *ctx, int argc, char **argv) {
   struct searchNode *thenode;
 
-  if (type != SEARCHTYPE_CHANNEL) {
-    parseError = "authedpct: this function is only valid for channel searches.";
-    return NULL;
-  }
-
   if (!(thenode=(struct searchNode *)malloc(sizeof(struct searchNode)))) {
     /* couldn't malloc() memory for thenode, so free localdata to avoid leakage */
     parseError = "malloc: could not allocate memory for this search.";
@@ -32,7 +27,7 @@ struct searchNode *authedpct_parse(int type, int argc, char **argv) {
   return thenode;
 }
 
-void *authedpct_exe(struct searchNode *thenode, void *theinput) {
+void *authedpct_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
   int i;
   int j=0;
   nick *np;
@@ -55,7 +50,7 @@ void *authedpct_exe(struct searchNode *thenode, void *theinput) {
   return (void *)(long)((j * 100) / cip->channel->users->totalusers);
 }  
 
-void authedpct_free(struct searchNode *thenode) {
+void authedpct_free(searchCtx *ctx, struct searchNode *thenode) {
   free(thenode);
 }