]>
jfr.im git - irc/quakenet/newserv.git/blob - newsearch/ns-not.c
10 void not_free(searchCtx
*ctx
, struct searchNode
*thenode
);
11 void *not_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
13 struct searchNode
*not_parse(searchCtx
*ctx
, int argc
, char **argv
) {
14 searchNode
*thenode
, *subnode
;
17 parseError
="not: usage: not (term)";
21 /* Allocate our actual node */
22 if (!(thenode
=(searchNode
*)malloc(sizeof(searchNode
)))) {
23 parseError
= "malloc: could not allocate memory for this search.";
27 thenode
->returntype
= RETURNTYPE_BOOL
;
28 thenode
->exe
= not_exe
;
29 thenode
->free
= not_free
;
31 subnode
=ctx
->parser(ctx
, argv
[0]); /* Propogate the search type */
38 /* Our subnode needs to return a BOOL */
39 subnode
=coerceNode(ctx
, subnode
, RETURNTYPE_BOOL
);
45 thenode
->localdata
=(void *)subnode
;
50 void not_free(searchCtx
*ctx
, struct searchNode
*thenode
) {
51 struct searchNode
*subnode
;
52 subnode
=thenode
->localdata
;
54 (subnode
->free
)(ctx
, subnode
);
58 void *not_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
59 struct searchNode
*subnode
;
61 subnode
=thenode
->localdata
;
63 if ((subnode
->exe
)(ctx
, subnode
, theinput
)) {