]> git.pond.sub.org Git - empserver/blobdiff - include/misc.h
Update copyright notice
[empserver] / include / misc.h
index 704bbf1af004b7203ccc7ae6169f2f377c48f083..6169d1bfc31437ba644a19a74e43ee49044ac551 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
 #ifndef MISC_H
 #define MISC_H
 
-#include <ctype.h>
-#include <string.h>
-#include <sys/types.h>
-
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 
-#if defined(_WIN32)
-typedef long ssize_t;
-
-/* integral mismatch, due to misuse of sector short */
-#ifndef __GNUC__
-#pragma warning (disable : 4761 )
-#endif
-
-#include <io.h>
-
-#define random rand
-#define srandom srand
-
-#define strncasecmp(s1, s2, s3) _strnicmp((s1), (s2), (s3))
-#define mkdir(dir,perm) _mkdir((dir))
-
-typedef int pid_t;
-#define vsnprintf _vsnprintf
-#define snprintf _snprintf
-
+#ifdef _WIN32
+#include "w32misc.h"
 #endif /* _WIN32 */
 
-/* This is the structure we use to keep track of the global mobility
-   things, such as when the server is supposed to start/stop updating
-   mobility and the timestamp of when the game was last up.  These
-   times are in seconds. */
-struct mob_acc_globals {
-    time_t timestamp;          /* Last timestamp of when the game was up */
-    time_t starttime;          /* When we should start updating mobility again. */
-};
+#ifndef S_IRWUG
+#define S_IRWUG            S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR
+#endif
 
 #ifdef __GNUC__
 #define ATTRIBUTE(attrs) __attribute__ (attrs)
@@ -88,10 +61,6 @@ struct mob_acc_globals {
 #define RESOLVE_IPADDRESS      /* resolve ip addresses into hostnames */
 #endif
 
-typedef unsigned char natid;   /* NSC_NATID must match this */
-
-typedef short coord;
-
 #ifndef bit
 #define        bit(x)          (1<<(x))
 #endif
@@ -117,6 +86,8 @@ extern int debug;
 
 extern int oops(char *, char *, int);
 
+void exit_nomem(void) ATTRIBUTE((noreturn));
+
        /* return codes from command routines */
 #define        RET_OK          0       /* command completed sucessfully */
 #define        RET_FAIL        1       /* command completed unsucessfully [?] */