3
3
* include file to include most other include files
5
* $Id: main.h,v 1.19 2002/01/02 03:46:35 guppy Exp $
5
* $Id: main.h,v 1.27 2004/05/26 00:20:19 wcc Exp $
8
8
* Copyright (C) 1997 Robey Pointer
9
* Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
9
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
11
11
* This program is free software; you can redistribute it and/or
12
12
* modify it under the terms of the GNU General Public License
30
30
# include "config.h"
33
#include "lush.h" /* We seem to need this everywhere... */
35
#if (((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)) || (TCL_MAJOR_VERSION > 7))
36
# define USE_TCL_EVENTS
37
# define USE_TCL_FINDEXEC
38
# define USE_TCL_PACKAGE
39
# define USE_TCL_VARARGS
42
#if (TCL_MAJOR_VERSION >= 8)
46
#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 1)) || (TCL_MAJOR_VERSION > 8))
47
# define USE_TCL_BYTE_ARRAYS
48
# define USE_TCL_ENCODING
51
#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
53
# define EGG_CONST CONST
33
61
/* UGH! Why couldn't Tcl pick a standard? */
34
#if !defined(HAVE_PRE7_5_TCL) && defined(__STDC__)
62
#if defined(USE_TCL_VARARGS) && (defined(__STDC__) || defined(HAS_STDARG))
35
63
# ifdef HAVE_STDARG_H
36
64
# include <stdarg.h>
83
111
#ifndef MAKING_MODS
84
112
extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
85
DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY, DCC_CHAT_PASS,
86
DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID, DCC_TELNET_NEW, DCC_TELNET_PW,
87
DCC_TELNET, DCC_IDENT, DCC_IDENTWAIT, DCC_DNSWAIT;
113
DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY,
114
DCC_CHAT_PASS, DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID,
115
DCC_TELNET_NEW, DCC_TELNET_PW, DCC_TELNET, DCC_IDENT,
116
DCC_IDENTWAIT, DCC_DNSWAIT;
91
#define iptolong(a) (0xffffffff & \
92
(long) (htonl((unsigned long) a)))
93
#define fixcolon(x) do { \
97
(x) = newsplit(&(x)); \
120
#define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
121
#define fixcolon(x) do { \
125
(x) = newsplit(&(x)); \
100
128
/* This macro copies (_len - 1) bytes from _source to _target. The
101
129
* target string is NULL-terminated.
103
#define strncpyz(_target, _source, _len) do { \
104
strncpy((_target), (_source), (_len) - 1); \
105
(_target)[(_len) - 1] = 0; \
131
#define strncpyz(_target, _source, _len) do { \
132
strncpy((_target), (_source), (_len) - 1); \
133
(_target)[(_len) - 1] = 0; \
111
# define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
113
#endif /* BORGUBES */
116
#endif /* _EGG_MAIN_H */
137
# define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
138
#endif /* BORGUBES */
140
/* Use high-order bits for getting the random integer. With random()
141
* modulo would probably be sufficient but on systems lacking random(),
142
* the function will be just renamed rand().
144
#define randint(n) (unsigned long) (random() / (RAND_MAX + 1.0) * ((n) < 0 ? (-(n)) : (n)))
146
#endif /* _EGG_MAIN_H */