3 static inline char *token(char **foo
, char sep
)
5 char *line
= *foo
, *ret
;
7 while (*line
&& *line
!= sep
)
13 *foo
= *line
? line
: NULL
;
19 static inline unsigned getrand(void)
22 int fd
= open("/dev/urandom", O_RDONLY
);
24 read(fd
, &rand
, sizeof(rand
));
31 static unsigned admin(const char *host
)
33 return host
&& (!strcmp(host
, "equestria") || !strcmp(host
, "is.best.ship"));
36 #define privmsg(b, who, contents, args...) b->writeline(b, "PRIVMSG %s :" contents, who, args)
37 #define privmsgs(b, who, contents) b->writeline(b, "PRIVMSG %s :" contents, who)
38 #define action(b, who, contents, args...) b->writeline(b, "PRIVMSG %s :\001ACTION " contents "\001", who, args)
39 #define actions(b, who, contents) b->writeline(b, "PRIVMSG %s :\001ACTION " contents "\001", who)