]> arthur.barton.de Git - ngircd-alex.git/blob - src/portab/portab.h
Re-corrected test for CVS version.
[ngircd-alex.git] / src / portab / portab.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * Please read the file COPYING, README and AUTHORS for more information.
10  *
11  * $Id: portab.h,v 1.15 2003/03/31 19:01:02 alex Exp $
12  *
13  * Portability functions and declarations (header for libngbportab).
14  */
15
16
17 #ifndef __PORTAB__
18 #define __PORTAB__
19
20
21 #include "config.h"
22
23 #ifdef HAVE_SYS_TYPES_H
24 #include <sys/types.h>
25 #endif
26
27
28 /* compiler features */
29
30 #ifdef __GNUC__
31 # define PUNUSED(x) __attribute__ ((unused)) x
32 # define UNUSED     __attribute__ ((unused))
33 #else
34 # define PUNUSED(x) x
35 # define UNUSED
36 #endif
37
38 #ifndef PARAMS
39 # if PROTOTYPES
40 #  define PARAMS(args) args
41 # else
42 #  define PARAMS(args) ()
43 # endif
44 #endif
45
46
47 /* keywords */
48
49 #define EXTERN extern
50 #define STATIC static
51 #define LOCAL static
52 #define CONST const
53 #define REGISTER register
54
55
56 /* datatypes */
57
58 #ifndef PROTOTYPES
59 # ifndef signed
60 #  define signed
61 # endif
62 #endif
63
64 typedef void VOID;
65 typedef void POINTER;
66
67 typedef signed int INT;
68 typedef unsigned int UINT;
69 typedef signed long LONG;
70 typedef unsigned long ULONG;
71
72 typedef signed char INT8;
73 typedef unsigned char UINT8;
74 typedef signed short INT16;
75 typedef unsigned short UINT16;
76 typedef signed long INT32;
77 typedef unsigned long UINT32;
78
79 typedef double DOUBLE;
80 typedef float FLOAT;
81
82 typedef char CHAR;
83
84 typedef UINT8 BOOLEAN;
85
86 #undef TRUE
87 #define TRUE (BOOLEAN)1
88
89 #undef FALSE
90 #define FALSE (BOOLEAN)0
91
92 #undef NULL
93 #ifdef PROTOTYPES
94 # define NULL (VOID *)0
95 #else
96 # define NULL 0L
97 #endif
98
99 #undef GLOBAL
100 #define GLOBAL
101
102
103 /* SPLint */
104
105
106 #ifdef S_SPLINT_S
107 #include "splint.h"
108 #endif
109
110
111 /* target constants  */
112
113 #ifndef TARGET_OS
114 #define TARGET_OS "unknown"
115 #endif
116
117 #ifndef TARGET_CPU
118 #define TARGET_CPU "unknown"
119 #endif
120
121 #ifndef TARGET_VENDOR
122 #define TARGET_VENDOR "unknown"
123 #endif
124
125
126 /* configure options */
127
128 #ifndef HAVE_socklen_t
129 #define socklen_t int                   /* u.a. fuer Mac OS X */
130 #endif
131
132 #ifndef HAVE_SNPRINTF
133 EXTERN INT snprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, ... ));
134 #endif
135
136 #ifndef HAVE_STRLCAT
137 EXTERN size_t strlcat PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
138 #endif
139
140 #ifndef HAVE_STRLCPY
141 EXTERN size_t strlcpy PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
142 #endif
143
144 #ifndef HAVE_VSNPRINTF
145 #include <stdarg.h>
146 EXTERN INT vsnprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, va_list args ));
147 #endif
148
149 #ifndef PACKAGE_NAME
150 #define PACKAGE_NAME PACKAGE
151 #endif
152
153 #ifndef PACKAGE_VERSION
154 #define PACKAGE_VERSION VERSION
155 #endif
156
157
158 #endif
159
160
161 /* -eof- */