appropriate headers. Also remove some unused declarations.
+++ /dev/null
-/*
- * Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * ---
- *
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
- *
- * ---
- *
- * h.h: Simple typedef
- *
- * Known contributors to this file:
- * Steve McClure, 1998
- */
-
-#ifndef _H_H_
-#define _H_H_
-
-typedef char s_char;
-
-#endif
*/
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#ifndef _WIN32
+#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
s_char *name;
struct sockaddr_in *addr;
{
-#ifndef _WIN32
- extern u_long inet_addr();
-#endif
struct hostent *hp;
if (name == 0 || *name == 0)
struct sockaddr_in *addr;
{
struct servent *sp;
-#ifndef _WIN32
- int atoi();
-#endif
if (name == 0 || *name == 0)
return 0;
*/
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#ifndef _WIN32
#include <sys/uio.h>
void remque();
void initque();
struct qelem *makeqt();
-void free();
void
ioq_init(ioq, bsize)
* this routine doesn't free memory; this is
* left for a higher level.
*/
-static
- int
+static int
ioqtobuf(ioq, buf, cc)
register struct ioqueue *ioq;
s_char *buf;
* with one writev for example. This makes the processing
* of a full ioqueue still be quick.
*/
-static
- int
+static int
ioqtoiov(ioq, iov, max)
register struct ioqueue *ioq;
register struct iovec *iov;
* free memory, dequeue io elements
* which are no longer used.
*/
-static
- int
+static int
dequeuecc(ioq, cc)
register struct ioqueue *ioq;
register int cc;
#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#if !defined(_WIN32)
#include <unistd.h>
#endif
int expect();
-int atoi();
void sendcmd();
int
#include "ioqueue.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/time.h>
#ifndef _WIN32
#include <pwd.h>
#endif
SECURITY_ATTRIBUTES security;
void intr(void);
#endif
- extern s_char *getenv();
extern s_char empireport[];
extern s_char empirehost[];
fd_set mask;
#include <ctype.h>
#include <sys/types.h>
-#include <ctype.h>
-
-#ifdef hpux
-#include <string.h>
-#else
-#ifdef _WIN32
-#include <string.h>
-
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-#else
-#include <strings.h>
-#endif
-#endif
-
-#define MAXNOC 100
-#define WORLD_X 32
-#define WORLD_Y 16
-
-#define ETUS 60 /* Defined here.. may be overridden later,
- but things still use this define */
-typedef u_char natid; /* also change NSC_NATID in nsc.h */
#if !defined(aix) && !defined(sgi)
#ifndef ultrix /* already defined in ultrix */
typedef char s_char; /* change to signed char for aix */
typedef signed char s_char;
#endif /* !aix && !sgi */
typedef short coord; /* also change NSC_COORD in nsc.h */
-/*
- * watch it; your compiler might not like this.
- * If you think this is bogus, look at /usr/include/struct.h
- */
-#define OFFSET(stype, oset) ((int)(&(((struct stype *)0)->oset)))
-#define SETOFF(sinst, oset) ((s_char *) (sinst) + (oset))
-
-#ifndef bit
-#define bit(x) (1<<(x))
-#endif
-
-#define minutes(x) (60*(x))
-#define hours(x) (60*60*(x))
-#define days(x) (60*60*24*(x))
-
-typedef void (*voidfunc) ();
-
- /* return codes from command routines */
-#define RET_OK 0 /* command completed sucessfully */
-#define RET_FAIL 1 /* command completed unsucessfully [?] */
-#define RET_SYN 2 /* syntax error in command */
-#define RET_SYS 3 /* system error (missing file, etc) */
-
-#define MAX_DISTPATH_LEN 10 /* Has to go somewhere */
-
-/*
- * references to library functions which aren't related to any
- * particular object, and are of general interest
- */
-extern long random();
-
-extern double dmax();
-extern double dmin();
-
-extern s_char *fmt();
-extern s_char *numstr();
-extern s_char *esplur();
-extern s_char *splur();
-extern s_char *iesplur();
-extern s_char *plur();
-extern s_char *getstarg();
-extern s_char *getstring();
-
-/*
- * frequently used libc functions
- */
-
-#ifndef _WIN32
-extern s_char *malloc();
-extern s_char *calloc();
-#endif
-
-#if (!defined (aix) && !defined (sgi))
-extern s_char *ctime();
-extern s_char *strncpy();
-extern s_char *strcpy();
-#endif /* !aix && !sgi */
-
-extern time_t time();
-extern double atof();
#endif
* Steve McClure, 1998
*/
+#include <stdlib.h>
#if !defined(_WIN32)
#include <unistd.h>
#endif
makeqt(nelem)
int nelem;
{
- extern s_char *malloc();
struct qelem *table;
struct qelem *qp;
int i;
*
*/
+#include <stdlib.h>
+#include <string.h>
#include "misc.h"
void
s_char **src;
s_char **dst;
{
- extern s_char *strcpy();
- extern s_char *malloc();
register s_char *ptr;
register int i;
#include "ioqueue.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <fcntl.h>
#if !defined(_WIN32)
void doexecute();
void output();
void screen();
-void free();
int sendeof();
int termio();
void _noecho();
dopipe(p)
s_char *p;
{
- extern FILE *popen();
s_char *tag;
if (*p == '|')
#include "ioqueue.h"
#include <stdio.h>
+#include <stdlib.h>
#if !defined(_WIN32)
#include <unistd.h>
#endif
#ifdef _WIN32
-#include <malloc.h>
#include <winsock.h>
#endif
-void free();
void ioq_write();
int
int s;
struct ioqueue *ioq;
{
-#ifndef _WIN32
- extern s_char *realloc();
-#else
- extern void *realloc();
-#endif
s_char *buf;
int n;
#include "misc.h"
#include "tags.h"
+#include <stdlib.h>
#include <stdio.h>
-
-#ifdef Rel4
#include <string.h>
-#endif /* Rel4 */
-
#if !defined(_WIN32)
#include <unistd.h>
#endif
struct tagstruct *taglist;
s_char buf[4096];
-u_short tagnum;
s_char exec[8];
-
-void free();
+static unsigned short tagnum;
void
io_init()
*/
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#if defined(aix) || defined(hpux) || defined(sgi)
#include <sys/termio.h>
*/
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include "misc.h"
getsose()
{
#ifndef _WIN32
- extern s_char *getenv();
extern s_char *tgetstr();
#endif
static s_char tbuf[1024];