]> jfr.im git - irc/quakenet/newserv.git/blame - proxyscan/pns-scan.c
CHANSERV: tell user when they can't attempts to auth any more, and drop max attempts...
[irc/quakenet/newserv.git] / proxyscan / pns-scan.c
CommitLineData
883d13a2
CP
1/*
2 * pscan functionality
3 */
4
5#include "../newsearch/newsearch.h"
6#include "proxyscan.h"
7
8#include <stdlib.h>
9
10void *pscan_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
11void pscan_free(searchCtx *ctx, struct searchNode *thenode);
12
13struct searchNode *pscan_parse(searchCtx *ctx, int argc, char **argv) {
14 struct searchNode *thenode;
15
16 if (!(thenode=(struct searchNode *)malloc(sizeof (struct searchNode)))) {
17 parseError = "malloc: could not allocate memory for this search.";
18 return NULL;
19 }
20
21 thenode->returntype = RETURNTYPE_BOOL;
22 thenode->exe = pscan_exe;
23 thenode->free = pscan_free;
24 thenode->localdata = (void *)0;
25
26 return thenode;
27}
28
29void *pscan_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
30 startnickscan((nick *)theinput);
31 thenode->localdata = (void *)((int)thenode->localdata + 1);
32 return (void *)1;
33}
34
35void pscan_free(searchCtx *ctx, struct searchNode *thenode) {
36 ctx->reply(senderNSExtern, "proxyscan now scanning: %d nick(s).", (int)thenode->localdata);
37 free(thenode);
38}
39