/[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.4 - (hide annotations) (download) (as text)
Wed Jul 31 01:09:33 2013 UTC (5 years, 11 months ago) by thommey
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -18 lines
File MIME type: text/x-csrc
apply two patches of guppy that were missing

1 simple 1.1 /*
2     * main.h
3     * include file to include most other include files
4     *
5 thommey 1.4 * $Id: main.h,v 1.3 2010/08/11 15:57:51 thommey 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 thommey 1.3 #if defined(HAVE_TCL_SETNOTIFIER) && defined(HAVE_TCL_GETTHREADDATA) && defined(HAVE_TCL_NOTIFIER_INIT)
36 simple 1.1 # 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 thommey 1.4 #if defined(__STDC__) || defined(HAS_STDARG)
57 simple 1.1 # 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 "lang.h"
87     #include "eggdrop.h"
88     #include "flags.h"
89    
90     #ifndef MAKING_MODS
91     # include "proto.h"
92     #endif
93    
94     #include "cmdt.h"
95     #include "tclegg.h"
96     #include "tclhash.h"
97     #include "chan.h"
98     #include "users.h"
99     #include "compat/compat.h"
100    
101     /* For pre Tcl7.5p1 versions */
102     #ifndef HAVE_TCL_FREE
103     # define Tcl_Free(x) n_free(x, "", 0)
104     #endif
105    
106     /* For pre7.6 Tcl versions */
107     #ifndef TCL_PATCH_LEVEL
108     # define TCL_PATCH_LEVEL Tcl_GetVar(interp, "tcl_patchLevel", TCL_GLOBAL_ONLY)
109     #endif
110    
111     #ifndef MAKING_MODS
112     extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
113     DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY,
114     DCC_CHAT_PASS, DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID,
115     DCC_TELNET_NEW, DCC_TELNET_PW, DCC_TELNET, DCC_IDENT,
116     DCC_IDENTWAIT, DCC_DNSWAIT;
117     #endif
118    
119     #define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
120 pseudo 1.2
121     #ifdef IPV6
122     # define setsnport(s, p) do { \
123     if ((s).family == AF_INET6) \
124     (s).addr.s6.sin6_port = htons((p)); \
125     else \
126     (s).addr.s4.sin_port = htons((p)); \
127     } while (0)
128     #else
129     # define setsnport(s, p) (s.addr.s4.sin_port = htons(p))
130     #endif
131    
132 simple 1.1 #define fixcolon(x) do { \
133     if ((x)[0] == ':') \
134     (x)++; \
135     else \
136     (x) = newsplit(&(x)); \
137     } while (0)
138    
139     /* This macro copies (_len - 1) bytes from _source to _target. The
140     * target string is NULL-terminated.
141     */
142     #define strncpyz(_target, _source, _len) do { \
143     strncpy((_target), (_source), (_len) - 1); \
144     (_target)[(_len) - 1] = 0; \
145     } while (0)
146    
147     #ifdef BORGCUBES
148     # define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
149     #endif /* BORGCUBES */
150    
151     #endif /* _EGG_MAIN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23