]> jfr.im git - solanum.git/blobdiff - include/stdinc.h
Add tests for valid_temp_time
[solanum.git] / include / stdinc.h
index 43f99a044eeac479eb615fe28a7dcd1df8236a07..d620f7799a8d1163c995defef2a4474c5250c092 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- * $Id: stdinc.h 6 2005-09-10 01:02:21Z nenolod $
- *
  */
 
-#include "ratbox_lib.h"
-#include "config.h"            /* Gotta pull in the autoconf stuff */
+#include "rb_lib.h"
 #include "ircd_defs.h"  /* Needed for some reasons here -- dwr */
 
 /* AIX requires this to be the first thing in the file.  */
@@ -49,7 +46,7 @@ char *alloca ();
 #  endif
 # endif
 #endif
+
 
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
@@ -73,13 +70,28 @@ char *alloca ();
 #endif
 
 
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+# ifndef HAVE__BOOL
+#  ifdef __cplusplus
+typedef bool _Bool;
+#  else
+#   define _Bool signed char
+#  endif
+# endif
+# define bool _Bool
+# define false 0
+# define true 1
+# define __bool_true_false_are_defined 1
+#endif
+
 
 #include <stdio.h>
 #include <assert.h>
 #include <stdio.h>
 #include <time.h>
 #include <fcntl.h>
-#include <netdb.h>
 #include <stdarg.h>
 #include <signal.h>
 #include <dirent.h>
@@ -99,16 +111,11 @@ char *alloca ();
 #endif
 
 
-#include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
 
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
@@ -140,37 +147,14 @@ extern int errno;
 # define __noreturn
 #endif
 
-/* XXX must be removed in future!!! -- dwr */
+
+
 #ifdef strdupa
-#define LOCAL_COPY(s) strdupa(s) 
+#define LOCAL_COPY(s) strdupa(s)
 #else
 #if defined(__INTEL_COMPILER) || defined(__GNUC__)
 # define LOCAL_COPY(s) __extension__({ char *_s = alloca(strlen(s) + 1); strcpy(_s, s); _s; })
 #else
 # define LOCAL_COPY(s) strcpy(alloca(strlen(s) + 1), s) /* XXX Is that allowed? */
 #endif /* defined(__INTEL_COMPILER) || defined(__GNUC__) */
-
-/* LOCAL_COPY_N copies n part of string and adds one to terminate the string */\r
-#ifdef strndupa \r
-#define LOCAL_COPY_N(s, n) strndupa(s, n)\r
-#else\r
-#if defined(__INTEL_COMPILER) || defined(__GNUC__)\r
-#define LOCAL_COPY_N(s, n) __extension__({ size_t _l = strlen(s); _l = n > _l ? _l : n; char *_s = alloca(_l+1); memcpy(_s, s, _l); _s[_l] = '\0' ; _s; })\r
-#else\r
-#define LOCAL_COPY_N(s, n) xc_strlcpy(alloca(strlen(s)+1), s, n)\r
-INLINE_FUNC size_t\r
-xc_strlcpy(char *dest, const char *src, size_t size)\r
-{ \r
-        size_t ret = strlen(src);\r
-   \r
-        if (size) {\r
-                size_t len = (ret >= size) ? size-1 : ret;\r
-                memcpy(dest, src, len);\r
-                dest[len] = '\0';\r
-        }\r
-        return dest;\r
-}\r
-#endif /* defined(__INTEL_COMPILER) || defined(__GNUC__) */\r
-#endif /* strndupa */
-
 #endif /* strdupa */