]> arthur.barton.de Git - ngircd-alex.git/blob - src/portab/portab.h
- added prototypes for replacement functions.
[ngircd-alex.git] / src / portab / portab.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001,2002 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.10 2002/12/26 13:26:34 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
24 /* compiler features */
25
26 #ifdef __GNUC__
27 # define PUNUSED(x) __attribute__ ((unused)) x
28 # define UNUSED     __attribute__ ((unused))
29 #else
30 # define PUNUSED(x) x
31 # define UNUSED
32 #endif
33
34 #ifndef PARAMS
35 # if PROTOTYPES
36 #  define PARAMS(args) args
37 # else
38 #  define PARAMS(args) ()
39 # endif
40 #endif
41
42
43 /* keywords */
44
45 #define EXTERN extern
46 #define STATIC static
47 #define LOCAL static
48 #define CONST const
49 #define REGISTER register
50
51
52 /* datatypes */
53
54 #ifndef PROTOTYPES
55 # ifndef signed
56 #  define signed
57 # endif
58 #endif
59
60 typedef void VOID;
61 typedef void POINTER;
62
63 typedef signed int INT;
64 typedef unsigned int UINT;
65 typedef signed long LONG;
66 typedef unsigned long ULONG;
67
68 typedef signed char INT8;
69 typedef unsigned char UINT8;
70 typedef signed short INT16;
71 typedef unsigned short UINT16;
72 typedef signed long INT32;
73 typedef unsigned long UINT32;
74
75 typedef double DOUBLE;
76 typedef float FLOAT;
77
78 typedef char CHAR;
79
80 typedef UINT8 BOOLEAN;
81
82 #undef TRUE
83 #define TRUE (BOOLEAN)1
84
85 #undef FALSE
86 #define FALSE (BOOLEAN)0
87
88 #undef NULL
89 #ifdef PROTOTYPES
90 # define NULL (VOID *)0
91 #else
92 # define NULL 0L
93 #endif
94
95 #undef GLOBAL
96 #define GLOBAL
97
98
99 /* SPLint */
100
101
102 #ifdef S_SPLINT_S
103 #include "splint.h"
104 #endif
105
106
107 /* target constants  */
108
109 #ifndef TARGET_OS
110 #define TARGET_OS "unknown"
111 #endif
112
113 #ifndef TARGET_CPU
114 #define TARGET_CPU "unknown"
115 #endif
116
117 #ifndef TARGET_VENDOR
118 #define TARGET_VENDOR "unknown"
119 #endif
120
121
122 /* configure options */
123
124 #ifndef HAVE_socklen_t
125 #define socklen_t int                   /* u.a. fuer Mac OS X */
126 #endif
127
128 #if OS_UNIX_AUX
129 #define _POSIX_SOURCE                   /* muss unter A/UX definiert sein */
130 #endif
131
132 #ifndef HAVE_SNPRINTF
133 EXTERN INT snprintf( CHAR *str, size_t count, CONST CHAR *fmt, ... );
134 #endif
135
136 #ifndef HAVE_STRLCAT
137 EXTERN size_t strlcat( CHAR *dst, CONST CHAR *src, size_t size );
138 #endif
139
140 #ifndef HAVE_STRLCPY
141 EXTERN size_t strlcpy( CHAR *dst, CONST CHAR *src, size_t size );
142 #endif
143
144 #ifndef HAVE_VSNPRINTF
145 EXTERN INT vsnprintf( CHAR *str, size_t count, CONST CHAR *fmt, va_list args );
146 #endif
147
148
149 #endif
150
151
152 /* -eof- */