]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/newsearch/csns-qusername.c
2 * qusername functionality
5 #include "../../newsearch/newsearch.h"
6 #include "../chanserv.h"
10 void *qusername_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
11 void qusername_free(searchCtx
*ctx
, struct searchNode
*thenode
);
13 struct searchNode
*qusername_parse(searchCtx
*ctx
, int type
, int argc
, char **argv
) {
14 struct searchNode
*thenode
;
16 if (type
!= SEARCHTYPE_USER
) {
17 parseError
= "qusername: this function is only valid for user searches.";
21 if (!(thenode
=(struct searchNode
*)malloc(sizeof (struct searchNode
)))) {
22 parseError
= "malloc: could not allocate memory for this search.";
26 thenode
->returntype
= RETURNTYPE_STRING
;
27 thenode
->exe
= qusername_exe
;
28 thenode
->free
= qusername_free
;
33 void *qusername_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
34 authname
*ap
= (authname
*)theinput
;
35 reguser
*rup
= ap
->exts
[chanservext
];
42 void qusername_free(searchCtx
*ctx
, struct searchNode
*thenode
) {