/[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.3.2.4 - (show annotations) (download) (as text)
Wed Jan 12 13:54:00 2011 UTC (8 years, 4 months ago) by pseudo
Branch: gettext
Changes since 1.3.2.3: +3 -1 lines
File MIME type: text/x-csrc
Removed memcpy(), memset() and strftime() compatibility replacements.

1 /*
2 * main.h
3 * include file to include most other include files
4 *
5 * $Id: main.h,v 1.3.2.3 2010/11/17 13:58:37 pseudo 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) && defined(HAVE_TCL_NOTIFIER_INIT)
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 "eggdrop.h"
103 #include "flags.h"
104
105 #ifndef MAKING_MODS
106 # include "proto.h"
107 #endif
108
109 #include "cmdt.h"
110 #include "tclegg.h"
111 #include "tclhash.h"
112 #include "chan.h"
113 #include "users.h"
114 #include "compat/compat.h"
115
116 /* This header will take care of conditional gettext support (ENABLE_NLS)
117 * and will provide the required functions as dummy macros, if necessary.
118 */
119 #include "gettext.h"
120
121 /* Provide shorter names, as we'll be using these in a lot of places */
122 #define _(x) ((char *) gettext(x))
123 #define N_(x) gettext_noop(x)
124 #define P_(x, y, z) ngettext(x, y, z)
125
126 /* For pre Tcl7.5p1 versions */
127 #ifndef HAVE_TCL_FREE
128 # define Tcl_Free(x) n_free(x, "", 0)
129 #endif
130
131 /* For pre7.6 Tcl versions */
132 #ifndef TCL_PATCH_LEVEL
133 # define TCL_PATCH_LEVEL Tcl_GetVar(interp, "tcl_patchLevel", TCL_GLOBAL_ONLY)
134 #endif
135
136 #ifndef MAKING_MODS
137 extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
138 DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY,
139 DCC_CHAT_PASS, DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID,
140 DCC_TELNET_NEW, DCC_TELNET_PW, DCC_TELNET, DCC_IDENT,
141 DCC_IDENTWAIT, DCC_DNSWAIT;
142 #endif
143
144 #define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
145
146 #define egg_bzero(dest, n) memset(dest, 0, n)
147
148 #ifdef IPV6
149 # define setsnport(s, p) do { \
150 if ((s).family == AF_INET6) \
151 (s).addr.s6.sin6_port = htons((p)); \
152 else \
153 (s).addr.s4.sin_port = htons((p)); \
154 } while (0)
155 #else
156 # define setsnport(s, p) (s.addr.s4.sin_port = htons(p))
157 #endif
158
159 #define fixcolon(x) do { \
160 if ((x)[0] == ':') \
161 (x)++; \
162 else \
163 (x) = newsplit(&(x)); \
164 } while (0)
165
166 /* This macro copies (_len - 1) bytes from _source to _target. The
167 * target string is NULL-terminated.
168 */
169 #define strncpyz(_target, _source, _len) do { \
170 strncpy((_target), (_source), (_len) - 1); \
171 (_target)[(_len) - 1] = 0; \
172 } while (0)
173
174 #ifdef BORGCUBES
175 # define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
176 #endif /* BORGCUBES */
177
178 #endif /* _EGG_MAIN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23