]> jfr.im git - irc/quakenet/newserv.git/blob - trusts_newsearch/tsns-istrusted.c
Merge.
[irc/quakenet/newserv.git] / trusts_newsearch / tsns-istrusted.c
1 #include "trusts_newsearch.h"
2
3 #include <stdio.h>
4 #include <stdlib.h>
5
6 void *tsns_istrusted_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
7 void tsns_istrusted_free(searchCtx *ctx, struct searchNode *thenode);
8
9 struct searchNode *tsns_istrusted_parse(searchCtx *ctx, int argc, char **argv) {
10 struct searchNode *thenode;
11
12 if (!(thenode=(struct searchNode *)malloc(sizeof (struct searchNode)))) {
13 parseError = "malloc: could not allocate memory for this search.";
14 return NULL;
15 }
16
17 thenode->returntype = RETURNTYPE_BOOL;
18 thenode->localdata = NULL;
19 thenode->exe = tsns_istrusted_exe;
20 thenode->free = tsns_istrusted_free;
21
22 return thenode;
23 }
24
25 void *tsns_istrusted_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
26 nick *np = theinput;
27
28 trusthost_t *tgh = np->exts[tgn_ext];
29
30 if (!tgh)
31 return (void *)0;
32
33 return (void *)1;
34 }
35
36 void tsns_istrusted_free(searchCtx *ctx, struct searchNode *thenode) {
37 free(thenode);
38 }