/[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.5 - (show annotations) (download) (as text)
Wed Jul 31 01:14:54 2013 UTC (5 years, 11 months ago) by thommey
Branch: gettext
Changes since 1.3.2.4: +2 -18 lines
File MIME type: text/x-csrc
apply two patches of guppy that were missing

1 /*
2 * main.h
3 * include file to include most other include files
4 *
5 * $Id: main.h,v 1.3.2.4 2011/01/12 13:54:00 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 defined(HAVE_TCL_SETNOTIFIER) && defined(HAVE_TCL_GETTHREADDATA) && defined(HAVE_TCL_NOTIFIER_INIT)
36 # define REPLACE_NOTIFIER
37 #endif
38
39 #if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
40 # ifdef CONST
41 # define EGG_CONST CONST
42 # else
43 # define EGG_CONST
44 # endif
45 #else
46 # define EGG_CONST
47 #endif
48
49 #ifdef CONST86
50 # define TCL_CONST86 CONST86
51 #else
52 # define TCL_CONST86
53 #endif
54
55 /* UGH! Why couldn't Tcl pick a standard? */
56 #if defined(__STDC__) || defined(HAS_STDARG)
57 # ifdef HAVE_STDARG_H
58 # include <stdarg.h>
59 # endif
60 # define EGG_VARARGS(type, name) (type name, ...)
61 # define EGG_VARARGS_DEF(type, name) (type name, ...)
62 # define EGG_VARARGS_START(type, name, list) (va_start(list, name), name)
63 #else
64 # ifndef MAKING_DEPEND /* Allows 'make depend' to work on newer GCC versions. */
65 # include <varargs.h>
66 # define EGG_VARARGS(type, name) ()
67 # define EGG_VARARGS_DEF(type, name) (va_alist) va_dcl
68 # define EGG_VARARGS_START(type, name, list) (va_start(list), va_arg(list,type))
69 # endif
70 #endif
71
72 #include <stdio.h>
73 #include <stdlib.h>
74 #include <string.h>
75
76 #ifdef HAVE_STRINGS_H
77 # include <strings.h>
78 #endif
79
80 #ifdef HAVE_INTTYPES_H
81 # include <inttypes.h>
82 #endif
83
84 #include <sys/types.h>
85 #include "lush.h"
86 #include "eggdrop.h"
87 #include "flags.h"
88
89 #ifndef MAKING_MODS
90 # include "proto.h"
91 #endif
92
93 #include "cmdt.h"
94 #include "tclegg.h"
95 #include "tclhash.h"
96 #include "chan.h"
97 #include "users.h"
98 #include "compat/compat.h"
99
100 /* This header will take care of conditional gettext support (ENABLE_NLS)
101 * and will provide the required functions as dummy macros, if necessary.
102 */
103 #include "gettext.h"
104
105 /* Provide shorter names, as we'll be using these in a lot of places */
106 #define _(x) ((char *) gettext(x))
107 #define N_(x) gettext_noop(x)
108 #define P_(x, y, z) ngettext(x, y, z)
109
110 /* For pre Tcl7.5p1 versions */
111 #ifndef HAVE_TCL_FREE
112 # define Tcl_Free(x) n_free(x, "", 0)
113 #endif
114
115 /* For pre7.6 Tcl versions */
116 #ifndef TCL_PATCH_LEVEL
117 # define TCL_PATCH_LEVEL Tcl_GetVar(interp, "tcl_patchLevel", TCL_GLOBAL_ONLY)
118 #endif
119
120 #ifndef MAKING_MODS
121 extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
122 DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY,
123 DCC_CHAT_PASS, DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID,
124 DCC_TELNET_NEW, DCC_TELNET_PW, DCC_TELNET, DCC_IDENT,
125 DCC_IDENTWAIT, DCC_DNSWAIT;
126 #endif
127
128 #define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
129
130 #define egg_bzero(dest, n) memset(dest, 0, n)
131
132 #ifdef IPV6
133 # define setsnport(s, p) do { \
134 if ((s).family == AF_INET6) \
135 (s).addr.s6.sin6_port = htons((p)); \
136 else \
137 (s).addr.s4.sin_port = htons((p)); \
138 } while (0)
139 #else
140 # define setsnport(s, p) (s.addr.s4.sin_port = htons(p))
141 #endif
142
143 #define fixcolon(x) do { \
144 if ((x)[0] == ':') \
145 (x)++; \
146 else \
147 (x) = newsplit(&(x)); \
148 } while (0)
149
150 /* This macro copies (_len - 1) bytes from _source to _target. The
151 * target string is NULL-terminated.
152 */
153 #define strncpyz(_target, _source, _len) do { \
154 strncpy((_target), (_source), (_len) - 1); \
155 (_target)[(_len) - 1] = 0; \
156 } while (0)
157
158 #ifdef BORGCUBES
159 # define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
160 #endif /* BORGCUBES */
161
162 #endif /* _EGG_MAIN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23