]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/newsearch/csns-qlasthost.c
2 * qlasthost functionality
5 #include "../../newsearch/newsearch.h"
6 #include "../chanserv.h"
10 void *qlasthost_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
11 void qlasthost_free(searchCtx
*ctx
, struct searchNode
*thenode
);
13 struct searchNode
*qlasthost_parse(searchCtx
*ctx
, int argc
, char **argv
) {
14 struct searchNode
*thenode
;
16 if (!(thenode
=(struct searchNode
*)malloc(sizeof (struct searchNode
)))) {
17 parseError
= "malloc: could not allocate memory for this search.";
21 thenode
->returntype
= RETURNTYPE_STRING
;
22 thenode
->exe
= qlasthost_exe
;
23 thenode
->free
= qlasthost_free
;
28 void *qlasthost_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
29 authname
*ap
= (authname
*)theinput
;
30 reguser
*rup
= ap
->exts
[chanservext
];
31 if(!rup
|| !rup
->lastuserhost
)
34 return rup
->lastuserhost
->content
;
37 void qlasthost_free(searchCtx
*ctx
, struct searchNode
*thenode
) {