]>
jfr.im git - irc/quakenet/newserv.git/blob - newsearch/ns-topic.c
10 void *topic_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
11 void topic_free(searchCtx
*ctx
, struct searchNode
*thenode
);
13 struct searchNode
*topic_parse(searchCtx
*ctx
, int argc
, char **argv
) {
14 struct searchNode
*thenode
;
16 if (!(thenode
=(struct searchNode
*)malloc(sizeof(struct searchNode
)))) {
17 /* couldn't malloc() memory for thenode, so free localdata to avoid leakage */
18 parseError
= "malloc: could not allocate memory for this search.";
22 thenode
->returntype
= RETURNTYPE_STRING
;
23 thenode
->localdata
= NULL
;
24 thenode
->exe
= topic_exe
;
25 thenode
->free
= topic_free
;
30 void *topic_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
31 chanindex
*cip
= (chanindex
*)theinput
;
33 if ((cip
->channel
==NULL
) || (cip
->channel
->topic
==NULL
))
36 return cip
->channel
->topic
->content
;
39 void topic_free(searchCtx
*ctx
, struct searchNode
*thenode
) {