/[cvs]/eggdrop1.8/src/main.h
ViewVC logotype

Contents of /eggdrop1.8/src/main.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Mon Jul 26 21:11:06 2010 UTC (8 years, 9 months ago) by simple
Branch: MAIN
Branch point for: eggheads
File MIME type: text/x-csrc
Initial revision

1 /*
2 * main.h
3 * include file to include most other include files
4 *
5 * $Id: main.h,v 1.41 2010/06/29 15:52:24 thommey Exp $
6 */
7 /*
8 * Copyright (C) 1997 Robey Pointer
9 * Copyright (C) 1999 - 2010 Eggheads Development Team
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25
26 #ifndef _EGG_MAIN_H
27 #define _EGG_MAIN_H
28
29 #ifdef HAVE_CONFIG_H
30 # include "config.h"
31 #endif
32
33 #include "lush.h"
34
35 #if ((TCL_MAJOR_VERSION > 7) || ((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)))
36 # define USE_TCL_EVENTS
37 # define USE_TCL_FINDEXEC
38 # define USE_TCL_PACKAGE
39 # define USE_TCL_VARARGS
40 #endif
41
42 #if (TCL_MAJOR_VERSION >= 8)
43 # define USE_TCL_OBJ
44 #endif
45
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
49 #endif
50
51 #if defined(HAVE_TCL_SETNOTIFIER) && defined(HAVE_TCL_GETTHREADDATA)
52 # define REPLACE_NOTIFIER
53 #endif
54
55 #if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
56 # ifdef CONST
57 # define EGG_CONST CONST
58 # else
59 # define EGG_CONST
60 # endif
61 #else
62 # define EGG_CONST
63 #endif
64
65 #ifdef CONST86
66 # define TCL_CONST86 CONST86
67 #else
68 # define TCL_CONST86
69 #endif
70
71 /* UGH! Why couldn't Tcl pick a standard? */
72 #if defined(USE_TCL_VARARGS) && (defined(__STDC__) || defined(HAS_STDARG))
73 # ifdef HAVE_STDARG_H
74 # include <stdarg.h>
75 # endif
76 # define EGG_VARARGS(type, name) (type name, ...)
77 # define EGG_VARARGS_DEF(type, name) (type name, ...)
78 # define EGG_VARARGS_START(type, name, list) (va_start(list, name), name)
79 #else
80 # ifndef MAKING_DEPEND /* Allows 'make depend' to work on newer GCC versions. */
81 # include <varargs.h>
82 # define EGG_VARARGS(type, name) ()
83 # define EGG_VARARGS_DEF(type, name) (va_alist) va_dcl
84 # define EGG_VARARGS_START(type, name, list) (va_start(list), va_arg(list,type))
85 # endif
86 #endif
87
88 #include <stdio.h>
89 #include <stdlib.h>
90 #include <string.h>
91
92 #ifdef HAVE_STRINGS_H
93 # include <strings.h>
94 #endif
95
96 #ifdef HAVE_INTTYPES_H
97 # include <inttypes.h>
98 #endif
99
100 #include <sys/types.h>
101 #include "lush.h"
102 #include "lang.h"
103 #include "eggdrop.h"
104 #include "flags.h"
105
106 #ifndef MAKING_MODS
107 # include "proto.h"
108 #endif
109
110 #include "cmdt.h"
111 #include "tclegg.h"
112 #include "tclhash.h"
113 #include "chan.h"
114 #include "users.h"
115 #include "compat/compat.h"
116
117 /* For pre Tcl7.5p1 versions */
118 #ifndef HAVE_TCL_FREE
119 # define Tcl_Free(x) n_free(x, "", 0)
120 #endif
121
122 /* For pre7.6 Tcl versions */
123 #ifndef TCL_PATCH_LEVEL
124 # define TCL_PATCH_LEVEL Tcl_GetVar(interp, "tcl_patchLevel", TCL_GLOBAL_ONLY)
125 #endif
126
127 #ifndef MAKING_MODS
128 extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
129 DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY,
130 DCC_CHAT_PASS, DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID,
131 DCC_TELNET_NEW, DCC_TELNET_PW, DCC_TELNET, DCC_IDENT,
132 DCC_IDENTWAIT, DCC_DNSWAIT;
133 #endif
134
135 #define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
136 #define fixcolon(x) do { \
137 if ((x)[0] == ':') \
138 (x)++; \
139 else \
140 (x) = newsplit(&(x)); \
141 } while (0)
142
143 /* This macro copies (_len - 1) bytes from _source to _target. The
144 * target string is NULL-terminated.
145 */
146 #define strncpyz(_target, _source, _len) do { \
147 strncpy((_target), (_source), (_len) - 1); \
148 (_target)[(_len) - 1] = 0; \
149 } while (0)
150
151 #ifdef BORGCUBES
152 # define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
153 #endif /* BORGCUBES */
154
155 #endif /* _EGG_MAIN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23