2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23 * related information and legal notices. It is expected that any future
24 * projects/authors will amend these files as needed.
28 * misc.h: Misc client definitions
30 * Known contributors to this file:
38 #include <sys/types.h>
47 typedef unsigned char u_char;
48 typedef unsigned short u_short;
59 #define ETUS 60 /* Defined here.. may be overridden later,
60 but things still use this define */
61 typedef u_char natid; /* also change NSC_NATID in nsc.h */
62 #if !defined(aix) && !defined(sgi)
63 #ifndef ultrix /* already defined in ultrix */
64 typedef char s_char; /* change to signed char for aix */
67 typedef signed char s_char;
68 #endif /* !aix && !sgi */
69 typedef short coord; /* also change NSC_COORD in nsc.h */
71 * watch it; your compiler might not like this.
72 * If you think this is bogus, look at /usr/include/struct.h
74 #define OFFSET(stype, oset) ((int)(&(((struct stype *)0)->oset)))
75 #define SETOFF(sinst, oset) ((s_char *) (sinst) + (oset))
78 #define bit(x) (1<<(x))
81 #define minutes(x) (60*(x))
82 #define hours(x) (60*60*(x))
83 #define days(x) (60*60*24*(x))
85 typedef void (*voidfunc)();
87 /* return codes from command routines */
88 #define RET_OK 0 /* command completed sucessfully */
89 #define RET_FAIL 1 /* command completed unsucessfully [?] */
90 #define RET_SYN 2 /* syntax error in command */
91 #define RET_SYS 3 /* system error (missing file, etc) */
93 #define MAX_DISTPATH_LEN 10 /* Has to go somewhere */
96 * references to library functions which aren't related to any
97 * particular object, and are of general interest
101 extern double dmax();
102 extern double dmin();
104 extern s_char *fmt();
105 extern s_char *copy();
106 extern s_char *numstr();
107 extern s_char *esplur();
108 extern s_char *splur();
109 extern s_char *iesplur();
110 extern s_char *plur();
111 extern s_char *getstarg();
112 extern s_char *getstring();
115 * frequently used libc functions
119 extern s_char *malloc();
120 extern s_char *calloc();
123 #if (!defined (aix) && !defined (sgi))
124 extern s_char *ctime();
125 extern s_char *strncpy();
126 extern s_char *strcpy();
128 extern s_char *index();
129 extern s_char *rindex();
131 #endif /* !aix && !sgi*/
133 extern time_t time();
134 extern double atof();