#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;
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);
}