]> jfr.im git - irc/quakenet/newserv.git/blame - chanserv/newsearch/csns-qsuspended.c
LUA: port luadb to dbapi2 to drop postgres dependency
[irc/quakenet/newserv.git] / chanserv / newsearch / csns-qsuspended.c
CommitLineData
d7b09ff5
CP
1/*
2 * qsuspended functionality
3 */
4
5#include "../../newsearch/newsearch.h"
6#include "../chanserv.h"
7
8#include <stdlib.h>
9
10void *qsuspended_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
11void qsuspended_free(searchCtx *ctx, struct searchNode *thenode);
12
13struct searchNode *qsuspended_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 = qsuspended_exe;
23 thenode->free = qsuspended_free;
24
25 return thenode;
26}
27
28void *qsuspended_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
29 authname *ap = (authname *)theinput;
5c807a2a 30 reguser *rup = ap->exts[chanservaext];
d7b09ff5
CP
31 if(!rup || !UHasSuspension(rup))
32 return NULL;
33
34 return (void *)1;
35}
36
37void qsuspended_free(searchCtx *ctx, struct searchNode *thenode) {
38 free(thenode);
39}
40