libsrsirc  0.0.14
Lightweight, cross-platform IRC library
defs.h
Go to the documentation of this file.
1 /* defs.h - definitions, data types, etc
2  * libsrsirc - a lightweight serious IRC lib - (C) 2012-15, Timo Buhrmester
3  * See README for contact-, COPYING for license information. */
4 
5 #ifndef LIBSRSIRC_IRC_DEFS_H
6 #define LIBSRSIRC_IRC_DEFS_H 1
7 
8 
9 #include <stdbool.h>
10 #include <stddef.h>
11 #include <stdint.h>
12 
20 #define DEF_HOST "localhost"
21 
23 #define DEF_PORT_PLAIN ((uint16_t)6667)
24 
26 #define DEF_PORT_SSL ((uint16_t)6697)
27 
29 #define DEF_NICK "srsirc"
30 
32 #define DEF_UNAME "bsnsirc"
33 
35 #define DEF_FNAME "serious business irc"
36 
38 #define DEF_CONFLAGS 0
39 
41 #define DEF_SERV_DIST "*"
42 
44 #define DEF_SERV_TYPE 0
45 
47 #define DEF_SERV_INFO "srsbsns srvc"
48 
51 #define DEF_HCTO_US 120000000ul
52 
55 #define DEF_SCTO_US 15000000ul
56 
65 #define CMAP_RFC1459 0
66 
75 #define CMAP_STRICT_RFC1459 1
76 
84 #define CMAP_ASCII 2
85 
87 #define IRCPX_HTTP 0
88 
90 #define IRCPX_SOCKS4 1 /* NOT socks4a */
91 
93 #define IRCPX_SOCKS5 2
94 
105 #define CHANMODE_CLASS_A 1
106 
116 #define CHANMODE_CLASS_B 2
117 
127 #define CHANMODE_CLASS_C 3
128 
137 #define CHANMODE_CLASS_D 4
138 
144 typedef struct irc_s irc;
145 
174 typedef char *tokarr[18];
175  //XXX why no ctx param?
200 typedef bool (*fp_con_read)(tokarr *msg, void *tag);
201  //XXX return true or false to proceed/abort?
215 typedef void (*fp_mut_nick)(char *nick, size_t nick_sz);
216 
240 typedef bool (*uhnd_fn)(irc *ctx, tokarr *msg, size_t nargs, bool pre);
241 
244 #endif /* LIBSRSIRC_IRC_DEFS_H */
bool(* fp_con_read)(tokarr *msg, void *tag)
Logon-time callback for incoming protocol messages.
Definition: defs.h:200
struct irc_s irc
IRC context; pointers to this are our IRC context handle type.
Definition: defs.h:144
bool(* uhnd_fn)(irc *ctx, tokarr *msg, size_t nargs, bool pre)
User-registered protocol command callback type.
Definition: defs.h:240
char * tokarr[18]
Field array for the parts of incoming IRC protocol messages.
Definition: defs.h:174
void(* fp_mut_nick)(char *nick, size_t nick_sz)
Logon-time callback type for nickname problems.
Definition: defs.h:215