Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitchX
GitHub Repository: BitchX/BitchX1.3
Path: blob/master/include/irc.h
1069 views
1
/*
2
* irc.h: header file for all of ircII!
3
*
4
* Written By Michael Sandrof
5
* Copyright(c) 1990
6
*
7
* See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
8
*
9
* @(#)$Id: irc.h 206 2012-06-13 12:34:32Z keaston $
10
*/
11
12
#ifndef __irc_h
13
#define __irc_h
14
#define IRCII_COMMENT "\002 Keep it to yourself!\002"
15
#define BUG_EMAIL "<[email protected]>"
16
17
#define FSET 1
18
19
#ifndef __irc_c
20
extern const char irc_version[];
21
extern const char internal_version[];
22
#endif
23
extern char *thing_ansi;
24
extern char thing_star[4];
25
26
/*
27
* Here you can set the in-line quote character, normally backslash, to
28
* whatever you want. Note that we use two backslashes since a backslash is
29
* also C's quote character. You do not need two of any other character.
30
*/
31
#define QUOTE_CHAR '\\'
32
33
#include "defs.h"
34
#include "config.h"
35
#include <stdio.h>
36
#include <ctype.h>
37
#include <sys/types.h>
38
39
#include <signal.h>
40
#include <sys/param.h>
41
42
#ifdef __EMX__
43
# ifdef __EMXPM__
44
# define AVIO_BUFFER 2048
45
# define INCL_GPI
46
# define INCL_AVIO
47
# define INCL_DOS
48
# endif
49
#define INCL_WIN /* Window Manager Functions */
50
#define INCL_BASE
51
#define INCL_VIO
52
#include <os2.h>
53
#elif defined(WINNT)
54
# include <windows.h>
55
# ifdef SOUND
56
# include <mmsystem.h>
57
# endif
58
#elif defined(GTK)
59
# include <gtk/gtk.h>
60
# include <gtk/gtkmenu.h>
61
#endif
62
63
#include <sys/socket.h>
64
#include <netinet/in.h>
65
66
#ifdef HAVE_ARPA_INET_H
67
#include <arpa/inet.h>
68
#endif
69
70
#ifdef TIME_WITH_SYS_TIME
71
#include <sys/time.h>
72
#include <time.h>
73
#else
74
# ifdef HAVE_SYS_TIME_H
75
# include <sys/time.h>
76
# else
77
# include <time.h>
78
# endif /* HAVE_SYS_TIME_H */
79
#endif /* TIME_WITH_SYS_TIME */
80
81
#ifdef HAVE_SYS_FCNTL_H
82
# include <sys/fcntl.h>
83
#else
84
#ifdef HAVE_FCNTL_H
85
#include <fcntl.h>
86
#endif /* HAVE_FCNTL_H */
87
#endif
88
89
#include <stdarg.h>
90
#include <unistd.h>
91
#ifdef __EMX__
92
#include <sys/select.h>
93
#endif
94
95
#ifdef HAVE_SYS_FILE_H
96
#include <sys/file.h>
97
#endif
98
99
#ifdef HAVE_NETDB_H
100
#include <netdb.h>
101
#endif
102
103
#ifndef AI_ADDRCONFIG
104
#define AI_ADDRCONFIG 0
105
#endif
106
107
#include "bsdglob.h"
108
109
#include "irc_std.h"
110
#include "debug.h"
111
#include "newio.h"
112
113
/* these define what characters do, inverse, underline, bold and all off */
114
#define REV_TOG '\026' /* ^V */
115
#define REV_TOG_STR "\026"
116
#define UND_TOG '\037' /* ^_ */
117
#define UND_TOG_STR "\037"
118
#define BOLD_TOG '\002' /* ^B */
119
#define BOLD_TOG_STR "\002"
120
#define ALL_OFF '\017' /* ^O */
121
#define ALL_OFF_STR "\017"
122
#define BLINK_TOG '\006' /* ^F (think flash) */
123
#define BLINK_TOG_STR "\006"
124
#define ROM_CHAR '\022' /* ^R */
125
#define ROM_CHAR_STR "\022"
126
#define ALT_TOG '\005' /* ^E (think Extended) */
127
#define ALT_TOG_STR "\005"
128
#define ND_SPACE '\023' /* ^S */
129
#define ND_SPACE_STR "\023"
130
131
#define IRCD_BUFFER_SIZE 512
132
#define BIG_BUFFER_SIZE (4 * IRCD_BUFFER_SIZE)
133
#define MAX_PROTOCOL_SIZE (IRCD_BUFFER_SIZE - 2)
134
135
#ifndef INPUT_BUFFER_SIZE
136
#define INPUT_BUFFER_SIZE (IRCD_BUFFER_SIZE - 20)
137
#endif
138
139
140
#define REFNUM_MAX 10
141
142
#ifndef RAND_MAX
143
#define RAND_MAX 2147483647
144
#endif
145
146
#define NICKNAME_LEN 30
147
#define NAME_LEN 80
148
#define REALNAME_LEN 50
149
#define PATH_LEN 1024
150
151
#ifndef MIN
152
#define MIN(a,b) ((a < b) ? (a) : (b))
153
#endif
154
155
#ifndef MAX
156
#define MAX(a,b) ((a > b) ? (a) : (b))
157
#endif
158
159
/* This section is for keeping track internally
160
* the CVS revision info of the running client.
161
* Since so many people are using CVS versions
162
* for debugging purposes it's good to know what
163
* file revisions they are running.
164
*/
165
#define CVS_REVISION(id) \
166
void id (char *buf) \
167
{ \
168
strcpy(buf, cvsrevision); \
169
}
170
171
void alias_c(char *);
172
void alist_c(char *);
173
void array_c(char *);
174
void banlist_c(char *);
175
void botlink_c(char *);
176
void cdcc_c(char *);
177
void chelp_c(char *);
178
void commands_c(char *);
179
void commands2_c(char *);
180
void cset_c(char *);
181
void ctcp_c(char *);
182
void dcc_c(char *);
183
void debug_c(char *);
184
void encrypt_c(char *);
185
void exec_c(char *);
186
void files_c(char *);
187
void flood_c(char *);
188
void fset_c(char *);
189
void functions_c(char *);
190
void funny_c(char *);
191
void hash_c(char *);
192
void help_c(char *);
193
void history_c(char *);
194
void hook_c(char *);
195
void if_c(char *);
196
void ignore_c(char *);
197
void input_c(char *);
198
void irc_c(char *);
199
void ircaux_c(char *);
200
void keys_c(char *);
201
void lastlog_c(char *);
202
void list_c(char *);
203
void log_c(char *);
204
void mail_c(char *);
205
void misc_c(char *);
206
void modules_c(char *);
207
void names_c(char *);
208
void network_c(char *);
209
void newio_c(char *);
210
void notice_c(char *);
211
void notify_c(char *);
212
void numbers_c(char *);
213
void output_c(char *);
214
void parse_c(char *);
215
void queue_c(char *);
216
void readlog_c(char *);
217
void reg_c(char *);
218
void screen_c(char *);
219
void server_c(char *);
220
void stack_c(char *);
221
void status_c(char *);
222
void struct_c(char *);
223
void tcl_public_c(char *);
224
void term_c(char *);
225
void timer_c(char *);
226
void translat_c(char *);
227
void user_c(char *);
228
void userlist_c(char *);
229
void vars_c(char *);
230
void who_c(char *);
231
void whowas_c(char *);
232
void window_c(char *);
233
void words_c(char *);
234
235
/*
236
* declared in irc.c
237
*/
238
extern int current_numeric;
239
extern char *cut_buffer;
240
extern char oper_command;
241
extern int irc_port;
242
extern int current_on_hook;
243
extern int use_flow_control;
244
extern char *joined_nick;
245
extern char *public_nick;
246
extern char empty_string[];
247
extern char zero[];
248
extern char one[];
249
extern char on[];
250
extern char off[];
251
extern char space[];
252
extern char space_plus[];
253
extern char space_minus[];
254
extern char dot[];
255
extern char star[];
256
extern char comma[];
257
extern char nickname[];
258
extern char *ircrc_file;
259
extern char *bircrc_file;
260
extern char *LocalHostName;
261
extern char hostname[];
262
extern char userhost[];
263
extern char realname[];
264
extern char username[];
265
extern char *send_umode;
266
extern char *last_notify_nick;
267
extern int away_set;
268
extern int background;
269
extern char *my_path;
270
extern char *irc_path;
271
extern char *irc_lib;
272
extern char *args_str;
273
extern char *invite_channel;
274
extern int who_mask;
275
extern char *who_name;
276
extern char *who_host;
277
extern char *who_server;
278
extern char *who_file;
279
extern char *who_nick;
280
extern char *who_real;
281
extern int dumb_mode;
282
extern int use_input;
283
extern time_t idle_time;
284
extern time_t now;
285
extern time_t start_time;
286
extern int waiting_out;
287
extern int waiting_in;
288
extern char wait_nick[];
289
extern char whois_nick[];
290
extern char lame_wait_nick[];
291
extern char **environ;
292
extern int cuprent_numeric;
293
extern int quick_startup;
294
extern char version[];
295
extern fd_set readables, writables;
296
extern int strip_ansi_in_echo;
297
extern int loading_global;
298
extern const unsigned long bitchx_numver;
299
extern const char *unknown_userhost;
300
extern char *forwardnick;
301
extern int inhibit_logging;
302
303
extern char MyHostName[];
304
extern struct sockaddr_foobar MyHostAddr;
305
extern struct sockaddr_foobar LocalHostAddr;
306
extern int cpu_saver;
307
extern struct sockaddr_foobar local_ip_address;
308
309
310
int BX_is_channel (char *);
311
void BX_irc_exit (int, char *, char *, ...);
312
void BX_beep_em (int);
313
void got_initial_version (char *);
314
void parse_notice (char *, char **);
315
void irc_quit (char, char *);
316
char get_a_char (void);
317
void load_scripts (void);
318
void clear_whowas (void);
319
void clear_variables (void);
320
void clear_fset (void);
321
void start_memdebug (void);
322
323
void dump_load_stack (int); /* XXX command.c */
324
const char * current_filename (void); /* XXX command.c */
325
int current_line (void); /* XXX command.c */
326
327
char *getenv (const char *);
328
void get_line_return (char, char *);
329
void get_line (char *, int, void (*)(char, char *));
330
void BX_io (const char *);
331
332
#ifdef NEED_OSPEED
333
/* We need this for broken linux systems. */
334
extern short ospeed;
335
#endif
336
337
void reattach_tty(char *, char *);
338
void init_socketpath(void);
339
void kill_attached_if_needed(int);
340
void setup_pid();
341
342
#ifdef CLOAKED
343
void initsetproctitle(int, char **, char **);
344
void setproctitle(const char *, ...);
345
#endif
346
347
#endif /* __irc_h */
348
349