]>
jfr.im git - irc/quakenet/newserv.git/blob - newsearch/ns-channel.c
2 * CHANNEL functionality
10 #include "../channel/channel.h"
12 void *channel_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
13 void channel_free(searchCtx
*ctx
, struct searchNode
*thenode
);
15 struct searchNode
*channel_parse(searchCtx
*ctx
, int argc
, char **argv
) {
16 struct searchNode
*thenode
;
20 parseError
= "channel: usage: channel <channel name>";
24 if (!(cp
=findchannel(argv
[0]))) {
25 parseError
= "channel: unknown channel";
29 if (!(thenode
=(struct searchNode
*)malloc(sizeof (struct searchNode
)))) {
30 parseError
= "malloc: could not allocate memory for this search.";
34 thenode
->returntype
= RETURNTYPE_BOOL
;
35 thenode
->localdata
= cp
;
36 thenode
->exe
= channel_exe
;
37 thenode
->free
= channel_free
;
42 void *channel_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
43 nick
*np
= (nick
*)theinput
;
44 channel
*cp
= thenode
->localdata
;
46 if (getnumerichandlefromchanhash(cp
->users
, np
->numeric
)) {
53 void channel_free(searchCtx
*ctx
, struct searchNode
*thenode
) {