~ubuntu-branches/ubuntu/oneiric/eggdrop/oneiric

« back to all changes in this revision

Viewing changes to src/main.h

  • Committer: Bazaar Package Importer
  • Author(s): Guilherme de S. Pastore
  • Date: 2004-06-17 09:15:28 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040617091528-64rrw1sa33lkfhmh
Tags: 1.6.16-2
* Fixed typo on README.Debian
* Fixed hyphens in manual page
* Converted debian/rules to CDBS
* Set path to binary on example config file
* Changed LANGDIR on src/eggdrop.h (Closes: #254824)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * main.h
3
3
 *   include file to include most other include files
4
4
 *
5
 
 * $Id: main.h,v 1.19 2002/01/02 03:46:35 guppy Exp $
 
5
 * $Id: main.h,v 1.27 2004/05/26 00:20:19 wcc Exp $
6
6
 */
7
7
/*
8
8
 * Copyright (C) 1997 Robey Pointer
9
 
 * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
 
9
 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
10
10
 *
11
11
 * This program is free software; you can redistribute it and/or
12
12
 * modify it under the terms of the GNU General Public License
30
30
#  include "config.h"
31
31
#endif
32
32
 
 
33
#include "lush.h" /* We seem to need this everywhere... */
 
34
 
 
35
#if (((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)) || (TCL_MAJOR_VERSION > 7))
 
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 (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
 
52
#  ifdef CONST
 
53
#    define EGG_CONST CONST
 
54
#  else
 
55
#    define EGG_CONST
 
56
#  endif
 
57
#else
 
58
#  define EGG_CONST
 
59
#endif
 
60
 
33
61
/* UGH! Why couldn't Tcl pick a standard? */
34
 
#if !defined(HAVE_PRE7_5_TCL) && defined(__STDC__)
 
62
#if defined(USE_TCL_VARARGS) && (defined(__STDC__) || defined(HAS_STDARG))
35
63
#  ifdef HAVE_STDARG_H
36
64
#    include <stdarg.h>
37
65
#  else
82
110
 
83
111
#ifndef MAKING_MODS
84
112
extern struct dcc_table DCC_CHAT, DCC_BOT, DCC_LOST, DCC_SCRIPT, DCC_BOT_NEW,
85
 
 DCC_RELAY, DCC_RELAYING, DCC_FORK_RELAY, DCC_PRE_RELAY, DCC_CHAT_PASS,
86
 
 DCC_FORK_BOT, DCC_SOCKET, DCC_TELNET_ID, DCC_TELNET_NEW, DCC_TELNET_PW,
87
 
 DCC_TELNET, DCC_IDENT, DCC_IDENTWAIT, DCC_DNSWAIT;
 
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;
88
117
 
89
118
#endif
90
119
 
91
 
#define iptolong(a)             (0xffffffff &                           \
92
 
                                 (long) (htonl((unsigned long) a)))
93
 
#define fixcolon(x)             do {                                    \
94
 
        if ((x)[0] == ':')                                              \
95
 
                (x)++;                                                  \
96
 
        else                                                            \
97
 
                (x) = newsplit(&(x));                                   \
 
120
#define iptolong(a) (0xffffffff & (long) (htonl((unsigned long) a)))
 
121
#define fixcolon(x) do {                                                \
 
122
        if ((x)[0] == ':')                                              \
 
123
          (x)++;                                                        \
 
124
        else                                                            \
 
125
          (x) = newsplit(&(x));                                         \
98
126
} while (0)
99
127
 
100
128
/* This macro copies (_len - 1) bytes from _source to _target. The
101
129
 * target string is NULL-terminated.
102
130
 */
103
 
#define strncpyz(_target, _source, _len)        do {                    \
104
 
        strncpy((_target), (_source), (_len) - 1);                      \
105
 
        (_target)[(_len) - 1] = 0;                                      \
 
131
#define strncpyz(_target, _source, _len) do {                           \
 
132
        strncpy((_target), (_source), (_len) - 1);                      \
 
133
        (_target)[(_len) - 1] = 0;                                      \
106
134
} while (0)
107
135
 
108
136
#ifdef BORGCUBES
109
 
 
110
 
/* For net.c */
111
 
#  define O_NONBLOCK    00000004    /* POSIX non-blocking I/O              */
112
 
 
113
 
#endif                          /* BORGUBES */
114
 
 
115
 
 
116
 
#endif                          /* _EGG_MAIN_H */
 
137
#  define O_NONBLOCK 00000004 /* POSIX non-blocking I/O */
 
138
#endif /* BORGUBES */
 
139
 
 
140
/* Use high-order bits for getting the random integer. With random()
 
141
 * modulo would probably be sufficient but on systems lacking random(),
 
142
 * the function will be just renamed rand().
 
143
 */
 
144
#define randint(n) (unsigned long) (random() / (RAND_MAX + 1.0) * ((n) < 0 ? (-(n)) : (n)))
 
145
 
 
146
#endif /* _EGG_MAIN_H */