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

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

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


Revision 1.3 - (hide annotations) (download) (as text)
Wed Aug 11 15:57:51 2010 UTC (8 years, 11 months ago) by thommey
Branch: MAIN
Branch point for: gettext
Changes since 1.2: +2 -2 lines
File MIME type: text/x-csrc
Added detection of Tcl_NotifierProcs members to ensure the notifier can be replaced. Fixes compilation against Tcl 8.2 and 8.3.

1 simple 1.1 /*
2     * main.h
3     * include file to include most other include files
4     *
5 thommey 1.3 * $Id: main.h,v 1.2 2010/08/05 18:12:05 pseudo Exp $
6 simple 1.1 */
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 thommey 1.3 #if defined(HAVE_TCL_SETNOTIFIER) && defined(HAVE_TCL_GETTHREADDATA) && defined(HAVE_TCL_NOTIFIER_INIT)
52 simple 1.1 # 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 pseudo 1.2
137     #ifdef IPV6
138     # define setsnport(s, p) do { \
139     if ((s).family == AF_INET6) \
140     (s).addr.s6.sin6_port = htons((p)); \
141     else \
142     (s).addr.s4.sin_port = htons((p)); \
143     } while (0)
144     #else
145     # define setsnport(s, p) (s.addr.s4.sin_port = htons(p))
146     #endif
147    
148 simple 1.1 #define fixcolon(x) do { \
149     if ((x)[0] == ':') \
150     (x)++; \
151     else \
152     (x) = newsplit(&(x)); \
153     } while (0)
154    
155     /* This macro copies (_len - 1) bytes from _source to _target. The
156     * target string is NULL-terminated.
157     */
158     #define strncpyz(_target, _source, _len) do { \
159     strncpy((_target), (_source), (_len) - 1); \
160     (_target)[(_len) - 1] = 0; \
161     } while (0)
162    
163     #ifdef BORGCUBES
164     # define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
165     #endif /* BORGCUBES */
166    
167     #endif /* _EGG_MAIN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23