NCBI C++ ToolKit
ncbistd.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef _NCBISTD_
2 #define _NCBISTD_
3 
4 /* $Id: ncbistd.hpp 80115 2017-11-08 12:52:45Z ivanov $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * File Name: ncbistd.h
30 *
31 * Author: Gish, Kans, Ostell, Schuler
32 *
33 * Version Creation Date: 1/1/91
34 *
35 * C Tolkit Revision: 6.11
36 *
37 * File Description:
38 * This system-independent header supposedly works "as is"
39 * with the system-dependent header files available for these
40 * system/compiler combinations:
41 *
42 * SunOS
43 * BSD UNIX
44 * SGI IRIX
45 * IBM AIX
46 * Cray UNICOS
47 * MS-DOS and Microsoft C compiler
48 * Macintosh with Apple MPW C and Symantec THINK C
49 *
50 * ==========================================================================
51 */
52 
53 /** @addtogroup CToolsBridge
54  *
55  * @{
56  */
57 
58 #if !defined(NDEBUG) && !defined(_DEBUG)
59 # define NDEBUG
60 #endif
61 
63 #ifndef _WIN32
64 # include <stdint.h>
65 #endif
67 
68 #ifndef LITTLE_ENDIAN
69 #define LITTLE_ENDIAN 1234
70 #define BIG_ENDIAN 4321
71 #define OTHER_ENDIAN 0
72 #endif
73 
74 #ifndef BYTE_ORDER
75 #ifdef IS_LITTLE_ENDIAN
76 #define BYTE_ORDER LITTLE_ENDIAN
77 #else
78 #ifdef IS_BIG_ENDIAN
79 #define BYTE_ORDER BIG_ENDIAN
80 #else
81 #define BYTE_ORDER OTHER_ENDIAN
82 #endif
83 #endif
84 #endif
85 
86 #ifndef INLINE
87 #ifdef __cplusplus
88 #define INLINE inline
89 #else
90 #define INLINE
91 #endif
92 #endif
93 
94 /*----------------------------------------------------------------------*/
95 /* Aliased Logicals, Datatypes */
96 /*----------------------------------------------------------------------*/
97 #ifndef PNTR
98 #define PNTR *
99 #endif
100 #ifndef HNDL
101 #define HNDL *
102 #endif
103 
104 #ifndef FnPtr
105 typedef int (*Nlm_FnPtr)(void);
106 #define FnPtr Nlm_FnPtr
107 #endif
108 
109 #ifndef VoidPtr
110 typedef void PNTR Nlm_VoidPtr;
111 #define VoidPtr Nlm_VoidPtr
112 #endif
113 #ifndef Pointer
114 #define Pointer Nlm_VoidPtr
115 #endif
116 
117 #ifndef Handle
118 typedef void HNDL Nlm_Handle;
119 #define Handle Nlm_Handle
120 #endif
121 
122 #ifndef Char
123 typedef char Nlm_Char, PNTR Nlm_CharPtr;
124 #define Char Nlm_Char
125 #define CharPtr Nlm_CharPtr
126 #endif
127 
128 #ifndef Uchar
129 typedef unsigned char Nlm_Uchar, PNTR Nlm_UcharPtr;
130 #define Uchar Nlm_Uchar
131 #define UcharPtr Nlm_UcharPtr
132 #endif
133 
134 #ifndef Boolean
135 typedef unsigned char Nlm_Boolean, PNTR Nlm_BoolPtr;
136 #define Boolean Nlm_Boolean
137 #define BoolPtr Nlm_BoolPtr
138 #endif
139 
140 #ifndef Byte
141 typedef unsigned char Nlm_Byte, PNTR Nlm_BytePtr;
142 #define Byte Nlm_Byte
143 #define BytePtr Nlm_BytePtr
144 #define BYTE_MAX UCHAR_MAX
145 #endif
146 
147 #ifndef Int1
148 typedef signed char Nlm_Int1, PNTR Nlm_Int1Ptr;
149 #define Int1 Nlm_Int1
150 #define Int1Ptr Nlm_Int1Ptr
151 #define INT1_MIN SCHAR_MIN
152 #define INT1_MAX SCHAR_MAX
153 #endif
154 
155 #ifndef Uint1
156 typedef unsigned char Nlm_Uint1, PNTR Nlm_Uint1Ptr;
157 #define Uint1 Nlm_Uint1
158 #define Uint1Ptr Nlm_Uint1Ptr
159 #define UINT1_MAX UCHAR_MAX
160 #endif
161 
162 #ifndef Int2
163 typedef short Nlm_Int2, PNTR Nlm_Int2Ptr;
164 #define Int2 Nlm_Int2
165 #define Int2Ptr Nlm_Int2Ptr
166 #define INT2_MIN SHRT_MIN
167 #define INT2_MAX SHRT_MAX
168 #endif
169 
170 #ifndef Uint2
171 typedef unsigned short Nlm_Uint2, PNTR Nlm_Uint2Ptr;
172 #define Uint2 Nlm_Uint2
173 #define Uint2Ptr Nlm_Uint2Ptr
174 #define UINT2_MAX USHRT_MAX
175 #endif
176 
177 #ifndef Int4
178 typedef signed int Nlm_Int4, PNTR Nlm_Int4Ptr;
179 #define Int4 Nlm_Int4
180 #define Int4Ptr Nlm_Int4Ptr
181 #define INT4_MIN (-2147483647-1)
182 #define INT4_MAX 2147483647
183 #endif
184 
185 #ifndef Uint4
186 typedef unsigned int Nlm_Uint4, PNTR Nlm_Uint4Ptr;
187 #define Uint4 Nlm_Uint4
188 #define Uint4Ptr Nlm_Uint4Ptr
189 #define UINT4_MAX 4294967295U
190 #endif
191 
192 #ifndef TIME_MAX
193 #define TIME_MAX ULONG_MAX
194 #endif
195 
196 #ifndef FloatLo
198 #define FloatLo Nlm_FloatLo
199 #define FloatLoPtr Nlm_FloatLoPtr
200 #endif
201 
202 #ifndef FloatHi
204 #define FloatHi Nlm_FloatHi
205 #define FloatHiPtr Nlm_FloatHiPtr
206 #endif
207 
208 #ifndef BigScalar
209 #define BigScalar long
210 #endif
211 
212 
213 /*----------------------------------------------------------------------*/
214 /* Misc Common Macros */
215 /*----------------------------------------------------------------------*/
216 #ifndef SIZE_MAX
217 #define SIZE_MAX MAXALLOC
218 #endif
219 
220 #ifndef PATH_MAX
221 #define PATH_MAX FILENAME_MAX
222 #endif
223 
224 #ifndef NULL
225 #define NULL ((void *)0)
226 #endif
227 
228 #ifndef NULLB
229 #define NULLB '\0'
230 #endif
231 
232 #ifndef TRUE
233 #define TRUE ((Nlm_Boolean)1)
234 #endif
235 
236 #ifndef FALSE
237 #define FALSE ((Nlm_Boolean)0)
238 #endif
239 
240 #ifndef MIN
241 #define MIN(a,b) ((a)>(b)?(b):(a))
242 #endif
243 
244 #ifndef MAX
245 #define MAX(a,b) ((a)>=(b)?(a):(b))
246 #endif
247 
248 #ifndef ABS
249 #define ABS(a) ((a)>=0?(a):-(a))
250 #endif
251 
252 #ifndef SIGN
253 #define SIGN(a) ((a)>0?1:((a)<0?-1:0))
254 #endif
255 
256 #ifndef ROUNDUP /* Round A up to the nearest multiple of B */
257 #define ROUNDUP(A,B) (((A)%(B)) != 0 ? (A)+(B)-((A)%(B)) : (A))
258 #endif
259 
260 #ifndef DIM
261 #define DIM(A) (sizeof(A)/sizeof((A)[0]))
262 #endif
263 
264 #ifndef LN2
265 #define LN2 (0.693147180559945)
266 #endif
267 #ifndef LN10
268 #define LN10 (2.302585092994046)
269 #endif
270 
271 /*----------------------------------------------------------------------*/
272 /* Misc. MS-DOS-isms */
273 /*----------------------------------------------------------------------*/
274 #ifndef NEAR
275 #define NEAR
276 #endif
277 #ifndef FAR
278 #define FAR
279 #endif
280 #ifndef CDECL
281 #define CDECL
282 #endif
283 #ifndef PASCAL
284 #define PASCAL
285 #endif
286 #ifndef EXPORT
287 #define EXPORT
288 #endif
289 #ifndef NLM_EXTERN
290 #define NLM_EXTERN
291 #endif
292 
293 #ifndef LIBCALL
294 #ifdef _WINDLL
295 #define LIBCALL FAR PASCAL EXPORT
296 #else
297 #define LIBCALL FAR PASCAL
298 #endif
299 #endif
300 
301 #ifndef LIBCALLBACK
302 #define LIBCALLBACK FAR PASCAL
303 #endif
304 
305 
306 /* @} */
307 
308 #endif /* _NCBISTD_ */
short Nlm_Int2
Definition: ncbistd.hpp:163
signed char Nlm_Int1
Definition: ncbistd.hpp:148
double Nlm_FloatHi
Definition: ncbistd.hpp:203
unsigned char * Nlm_UcharPtr
Definition: ncbistd.hpp:129
#define PNTR
Definition: ncbistd.hpp:98
void * Nlm_Handle
Definition: ncbistd.hpp:118
unsigned char Nlm_Boolean
Definition: ncbistd.hpp:135
char * Nlm_CharPtr
Definition: ncbistd.hpp:123
unsigned char * Nlm_BoolPtr
Definition: ncbistd.hpp:135
unsigned char Nlm_Uint1
Definition: ncbistd.hpp:156
unsigned short * Nlm_Uint2Ptr
Definition: ncbistd.hpp:171
unsigned short Nlm_Uint2
Definition: ncbistd.hpp:171
char Nlm_Char
Definition: ncbistd.hpp:123
float * Nlm_FloatLoPtr
Definition: ncbistd.hpp:197
unsigned int Nlm_Uint4
Definition: ncbistd.hpp:186
signed int Nlm_Int4
Definition: ncbistd.hpp:178
short * Nlm_Int2Ptr
Definition: ncbistd.hpp:163
unsigned char Nlm_Byte
Definition: ncbistd.hpp:141
signed int * Nlm_Int4Ptr
Definition: ncbistd.hpp:178
double * Nlm_FloatHiPtr
Definition: ncbistd.hpp:203
float Nlm_FloatLo
Definition: ncbistd.hpp:197
unsigned char * Nlm_Uint1Ptr
Definition: ncbistd.hpp:156
unsigned int * Nlm_Uint4Ptr
Definition: ncbistd.hpp:186
void * Nlm_VoidPtr
Definition: ncbistd.hpp:110
#define HNDL
Definition: ncbistd.hpp:101
signed char * Nlm_Int1Ptr
Definition: ncbistd.hpp:148
unsigned char * Nlm_BytePtr
Definition: ncbistd.hpp:141
unsigned char Nlm_Uchar
Definition: ncbistd.hpp:129
int(* Nlm_FnPtr)(void)
Definition: ncbistd.hpp:105
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
Modified on Wed Apr 24 14:13:41 2024 by modify_doxy.py rev. 669887