00001
00002
00003 #ifndef CONFIG_H
00004 #define CONFIG_H
00005
00006 #include "copyright.h"
00007 #include "autoconf.h"
00008
00009 #define _GNU_SOURCE
00010
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include <sys/fcntl.h>
00014 #include <sys/types.h>
00015 #include <ctype.h>
00016 #include <string.h>
00017 #include <sys/time.h>
00018 #include <time.h>
00019 #include <unistd.h>
00020 #include <errno.h>
00021 #include <fcntl.h>
00022
00023 #ifdef STDC_HEADERS
00024 #include <stdarg.h>
00025 #else
00026 #include <varargs.h>
00027 #endif
00028
00029
00030 #include <sys/socket.h>
00031 #include <netinet/in.h>
00032 #include <netinet/tcp.h>
00033
00034 #include "debug.h"
00035
00036 typedef int dbref;
00037 typedef int FLAG;
00038 typedef int POWER;
00039 typedef char boolexp_type;
00040 typedef char IBUF[16];
00041
00042 #ifdef HAVE_SYS_RUSAGE_H
00043 #include <sys/rusage.h>
00044 #endif
00045 #if defined(HAVE_SETRLIMIT) || defined(HAVE_GETRUSAGE)
00046 #include <sys/resource.h>
00047 #endif
00048
00049 #include <event.h>
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #define CONF_FILE "netmux.conf"
00060 #define FILEDIR "files/"
00061
00062
00063 #define SIDE_EFFECT_FUNCTIONS
00064
00065 #define ENTERLEAVE_PARANOID
00066
00067
00068 #define PLAYER_NAME_LIMIT 22
00069 #define NUM_ENV_VARS 10
00070 #define MAX_ARG 100
00071 #define MAX_GLOBAL_REGS 10
00072
00073 #define HASH_FACTOR 16
00074
00075 #define PLUSHELP_COMMAND "+help"
00076 #define OUTPUT_BLOCK_SIZE 16384
00077 #define StringCopy strcpy
00078 #define StringCopyTrunc strncpy
00079
00080
00081
00082
00083 #define CHANNEL_HISTORY
00084 #define CHANNEL_HISTORY_LEN 20
00085 #define COMMAND_HISTORY_LEN 10
00086
00087
00088
00089
00090
00091
00092 #define MANDFLAGS (V_LINK|V_PARENT|V_XFLAGS|V_ZONE|V_POWERS|V_3FLAGS|V_QUOTED)
00093
00094 #define OFLAGS1 (V_GDBM|V_ATRKEY)
00095
00096 #define OFLAGS2 (V_ATRNAME|V_ATRMONEY)
00097
00098 #define OUTPUT_VERSION 1
00099 #define OUTPUT_FLAGS (MANDFLAGS)
00100
00101 #define UNLOAD_VERSION 1
00102 #define UNLOAD_OUTFLAGS (MANDFLAGS)
00103
00104
00105 #define NOT_TOKEN '!'
00106 #define AND_TOKEN '&'
00107 #define OR_TOKEN '|'
00108 #define LOOKUP_TOKEN '*'
00109 #define NUMBER_TOKEN '#'
00110 #define INDIR_TOKEN '@'
00111 #define CARRY_TOKEN '+'
00112 #define IS_TOKEN '='
00113 #define OWNER_TOKEN '$'
00114
00115
00116 #define AMATCH_CMD '$'
00117 #define AMATCH_LISTEN '^'
00118
00119
00120 #define EXIT_DELIMITER ';'
00121 #define ARG_DELIMITER '='
00122 #define ARG_LIST_DELIM ','
00123
00124
00125
00126
00127
00128
00129 #define BOUND_VAR "##"
00130 #define LISTPLACE_VAR "#@"
/* amount of object endowment, based on cost */
#define OBJECT_ENDOWMENT(cost) (((cost)/mudconf.sacfactor) +mudconf.sacadjust)
/* !!! added for recycling, return value of object */
#define OBJECT_DEPOSIT(pennies) \
(((pennies)-mudconf.sacadjust)*mudconf.sacfactor)
#define DEV_NULL "/dev/null"
00131 #define READ read
00132 #define WRITE write
00133
00134 #ifdef BRAIN_DAMAGE
00135
00136 #undef toupper
00137 #endif
00138
00139 #ifdef TEST_MALLOC
00140 extern int malloc_count;
00141
00142 #define XMALLOC(x,y) (fprintf(stderr,"Malloc: %s\n", (y)), malloc_count++, \
00143 (char *)malloc((x)))
00144 #define XFREE(x,y) (fprintf(stderr, "Free: %s\n", (y)), \
00145 ((x) ? malloc_count--, free((x)), (x)=NULL : (x)))
00146 #else
00147 #define XMALLOC(x,y) (char *)malloc((x))
00148 #define XFREE(x,y) (free((x)), (x) = NULL)
00149 #endif
00150
00151 #ifdef ENTERLEAVE_PARANOID
00152 #define ENTER_REQUIRES_LEAVESUCC
00153
00154 #define LEAVE_REQUIRES_ENTERSUCC
00155
00156 #endif
00157
00158 #define EVAL_ALL_NEWS 1
00159 #include <sys/socket.h>
00160 #ifndef HAVE_SRANDOM
00161 #define random rand
00162 #define srandom srand
00163 #endif
00164
00165 #ifndef HAVE_STRNLEN
00166 size_t strnlen(const char *s, size_t maxlen);
00167 #endif
00168 #ifndef HAVE_STRNDUP
00169 char *strndup(const char *s, size_t n);
00170 #endif
00171 #ifndef HAVE_POSIX_MEMALIGN
00172 int posix_memalign(void **memptr, size_t alignment, size_t size);
00173 #endif
00174 #ifndef HAVE_STRLCAT
00175 size_t strlcat(char *, const char *, size_t);
00176 #endif
00177 #ifndef HAVE_STRLCPY
00178 size_t strlcpy(char *, const char *, size_t);
00179 #endif
00180
00181 #endif
00182