00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _EGG_MAIN_H
00027 #define _EGG_MAIN_H
00028
00029 #ifdef HAVE_CONFIG_H
00030 # include "config.h"
00031 #endif
00032
00033 #include "lush.h"
00034
00035 #if ((TCL_MAJOR_VERSION > 7) || ((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)))
00036 # define USE_TCL_EVENTS
00037 # define USE_TCL_FINDEXEC
00038 # define USE_TCL_PACKAGE
00039 # define USE_TCL_VARARGS
00040 #endif
00041
00042 #if (TCL_MAJOR_VERSION >= 8)
00043 # define USE_TCL_OBJ
00044 #endif
00045
00046
00047
00048
00049
00050
00051 #if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 1)) || (TCL_MAJOR_VERSION > 8))
00052 # undef USE_TCL_BYTE_ARRAYS
00053 # define USE_TCL_ENCODING
00054 #endif
00055
00056 #if defined(HAVE_TCL_SETNOTIFIER) && defined(HAVE_TCL_GETTHREADDATA) && defined(HAVE_TCL_NOTIFIER_INIT)
00057 # define REPLACE_NOTIFIER
00058 #endif
00059
00060 #if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
00061 # ifdef CONST
00062 # define EGG_CONST CONST
00063 # else
00064 # define EGG_CONST
00065 # endif
00066 #else
00067 # define EGG_CONST
00068 #endif
00069
00070 #ifdef CONST86
00071 # define TCL_CONST86 CONST86
00072 #else
00073 # define TCL_CONST86
00074 #endif
00075
00076
00077 #if defined(USE_TCL_VARARGS) && (defined(__STDC__) || defined(HAS_STDARG))
00078 # ifdef HAVE_STDARG_H
00079 # include <stdarg.h>
00080 # endif
00081 # define EGG_VARARGS(type, name) (type name, ...)
00082 # define EGG_VARARGS_DEF(type, name) (type name, ...)
00083 # define EGG_VARARGS_START(type, name, list) (va_start(list, name), name)
00084 #else
00085 # ifndef MAKING_DEPEND
00086 # include <varargs.h>
00087 # define EGG_VARARGS(type, name) ()
00088 # define EGG_VARARGS_DEF(type, name) (va_alist) va_dcl
00089 # define EGG_VARARGS_START(type, name, list) (va_start(list), va_arg(list,type))
00090 # endif
00091 #endif
00092
00093 #include <stdio.h>
00094 #include <stdlib.h>
00095 #include <string.h>
00096
00097 #ifdef HAVE_STRINGS_H
00098 # include <strings.h>
00099 #endif
00100
00101 #ifdef HAVE_INTTYPES_H
00102 # include <inttypes.h>
00103 #endif
00104
00105 #include <sys/types.h>
00106 #include "lush.h"
00107 #include "lang.h"
00108 #include "eggdrop.h"
00109 #include "flags.h"
00110
00111 #ifndef MAKING_MODS
00112 # include "proto.h"
00113 #endif
00114
00115 #include "cmdt.h"
00116 #include "tclegg.h"
00117 #include "tclhash.h"
00118 #include "chan.h"
00119 #include "users.h"
00120 #include "compat/compat.h"
00121
00122
00123 #ifndef HAVE_TCL_FREE
00124 # define Tcl_Free(x) n_free(x, "", 0)
00125 #endif
00126
00127
00128 #ifndef TCL_PATCH_LEVEL
00129 # define TCL_PATCH_LEVEL Tcl_GetVar(interp, "tcl_patchLevel", TCL_GLOBAL_ONLY)
00130 #endif
00131
00132 #ifndef MAKING_MODS
00133 extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
00134 DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY,
00135 DCC_CHAT_PASS, DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID,
00136 DCC_TELNET_NEW, DCC_TELNET_PW, DCC_TELNET, DCC_IDENT,
00137 DCC_IDENTWAIT, DCC_DNSWAIT;
00138 #endif
00139
00140 #define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
00141 #define fixcolon(x) do { \
00142 if ((x)[0] == ':') \
00143 (x)++; \
00144 else \
00145 (x) = newsplit(&(x)); \
00146 } while (0)
00147
00148
00149
00150
00151 #define strncpyz(_target, _source, _len) do { \
00152 strncpy((_target), (_source), (_len) - 1); \
00153 (_target)[(_len) - 1] = 0; \
00154 } while (0)
00155
00156 #ifdef BORGCUBES
00157 # define O_NONBLOCK 00000004
00158 #endif
00159
00160 #endif