]>
jfr.im git - irc/quakenet/newserv.git/blob - patriciasearch/ps-users.c
1 #include "patriciasearch.h"
6 void *ps_users_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
7 void ps_users_free(searchCtx
*ctx
, struct searchNode
*thenode
);
9 struct searchNode
*ps_users_parse(searchCtx
*ctx
, int argc
, char **argv
) {
10 struct searchNode
*thenode
;
12 if (!(thenode
=(struct searchNode
*)malloc(sizeof (struct searchNode
)))) {
13 parseError
= "malloc: could not allocate memory for this search.";
17 thenode
->returntype
= RETURNTYPE_INT
;
18 thenode
->localdata
= NULL
;
19 thenode
->exe
= ps_users_exe
;
20 thenode
->free
= ps_users_free
;
25 void *ps_users_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
26 patricia_node_t
*pn
= (patricia_node_t
*)theinput
;
28 return (void *)(long)(pn
->usercount
);
31 void ps_users_free(searchCtx
*ctx
, struct searchNode
*thenode
) {