]> git.pond.sub.org Git - empserver/blobdiff - src/client/misc.h
Update copyright notice.
[empserver] / src / client / misc.h
index b5f3de6be06ef853b4bd5a313a8a8f0aecc5aafe..31080cf7383161bbe711010ace095a5953958cf7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  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.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
  *     Steve McClure, 1998
  */
 
-#ifndef _MISC_H_
-#define _MISC_H_
+#ifndef MISC_H
+#define MISC_H
 
-#include <ctype.h>
-#include <sys/types.h>
-#include <ctype.h>
-
-#ifdef hpux
-#include <string.h>
-#else
+#include <stdio.h>
 #ifdef _WIN32
-#include <string.h>
-
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-#else
-#include <strings.h>
-#endif
+#include <windows.h>
 #endif
 
-#define MAXNOC         100
+struct ioqueue;
 
-#define WORLD_X                32
-#define WORLD_Y                16
+extern char empirehost[];
+extern char empireport[];
+extern int eight_bit_clean;
+extern int sock;
+extern char *SO;
+extern char *SE;
 
-#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 */
-#endif ultrix
-#else
-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))
+#ifdef _WIN32
+extern HANDLE hStdIn;
 #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 *copy();
-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();
+#ifdef _WIN32
+#define getsose() ((void)0)
+#define putso() ((void)0)
+#define putse() ((void)0)
+#define pclose _pclose
+#define popen _popen
+#else
+void getsose(void);
+void putso(void);
+void putse(void);
 #endif
-
-#if (!defined (aix) && !defined (sgi))
-extern s_char *ctime();
-extern s_char *strncpy();
-extern s_char *strcpy();
-#ifndef NeXT
-extern s_char *index();
-extern s_char *rindex();
-#endif /* NeXT */
-#endif /* !aix && !sgi*/
-
-extern time_t time();
-extern double atof();
+int recvline(int s, char *buf);
+int expect(int s, int match, char *buf);
+int tcp_connect(char *, char *);
+int login(int s, char *uname, char *cname, char *cpass, int kill_proc, int);
+void saveargv(int ac, char **src, char **dst);
+void sendcmd(int s, char *cmd, char *arg);
+void servercmd(struct ioqueue *ioq, FILE *auxfi);
+int serverio(int s, struct ioqueue *ioq);
+int termio(int fd, int sock, FILE *auxfi);
 
 #endif