add another bot to ignore
[fillybot.git] / shared.h
blob6026c9f8b4a30a8baa4d0715420fbed83734d30b
1 #define _GNU_SOURCE
2 #include <features.h>
3 #include <fcntl.h>
4 #include <stdio.h>
5 #include <assert.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <string.h>
9 #include <errno.h>
10 #include <poll.h>
11 #include <stdarg.h>
12 #include <openssl/ssl.h>
13 #include <openssl/rand.h>
14 #include <openssl/err.h>
16 #include "owner.h"
18 #define ALARM_TIME 240
20 static inline unsigned admin(const char *host)
22 if (!host)
23 return 0;
24 return !strcmp(host, "equestria") || !strcmp(host, "friendship.sgu.equ") || !strcmp(host, "genres.i.dont.even") || strcasestr(host, owner);
27 struct bio {
28 void (*writeline)(struct bio *b, const char *fmt, ...)
29 __attribute__ ((__format__ (__printf__, 2, 3)));
30 int (*fill)(struct bio *b);
31 int (*readline)(struct bio *b, char **line);
32 int (*poll)(struct bio *b, int timeout);
33 SSL *ssl;
34 int fd, maxlen, len, ofs;
35 char *priv;
36 long err;
39 void init_hook(struct bio *b, const char *target, const char *self, unsigned ponify);
41 void privmsg_hook(struct bio *b, const char *prefix, const char *ident, const char *host,
42 const char *const *args, unsigned nargs);
44 void command_hook(struct bio *b, const char *prefix, const char *ident, const char *host,
45 const char *command, const char *const *args, unsigned nargs);