]>
jfr.im git - irc/quakenet/newserv.git/blob - newsearch/ns-realname.c
2 * REALNAME functionality
10 #include "../nick/nick.h"
12 void *realname_exe(struct searchNode
*thenode
, int type
, void *theinput
);
13 void realname_free(struct searchNode
*thenode
);
15 struct searchNode
*realname_parse(int type
, int argc
, char **argv
) {
16 struct searchNode
*thenode
;
18 if (type
!= SEARCHTYPE_NICK
) {
19 parseError
= "realname: this function is only valid for nick searches.";
23 thenode
=(struct searchNode
*)malloc(sizeof (struct searchNode
));
25 thenode
->returntype
= RETURNTYPE_STRING
;
26 thenode
->localdata
= NULL
;
27 thenode
->exe
= realname_exe
;
28 thenode
->free
= realname_free
;
33 void *realname_exe(struct searchNode
*thenode
, int type
, void *theinput
) {
34 nick
*np
= (nick
*)theinput
;
36 if (type
!= RETURNTYPE_STRING
) {
40 return np
->realname
->name
->content
;
43 void realname_free(struct searchNode
*thenode
) {