/[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.2 - (show annotations) (download) (as text)
Wed Nov 10 13:39:19 2010 UTC (8 years, 5 months ago) by pseudo
Branch: gettext
Changes since 1.3.2.1: +2 -2 lines
File MIME type: text/x-csrc
Converted remaining lang #defines in the core to english strings from core.english.lang. Gettextified most of the hardcoded strings.

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23