1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * libdatrie - Double-Array Trie Library
4 * Copyright (C) 2006 Theppitak Karoonboonyanan <theppitak@gmail.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * typedefs.h - general types
23 * Created : 11 Aug 2006
24 * Author : Theppitak Karoonboonyanan <theppitak@gmail.com>
32 typedef enum { FALSE = 0, TRUE = 1 } Bool;
34 # if UCHAR_MAX == 0xff
35 # ifndef UINT8_TYPEDEF
36 # define UINT8_TYPEDEF
37 typedef unsigned char uint8;
38 # endif /* UINT8_TYPEDEF */
39 # endif /* UCHAR_MAX */
41 # if SCHAR_MAX == 0x7f
44 typedef signed char int8;
45 # endif /* INT8_TYPEDEF */
46 # endif /* SCHAR_MAX */
48 # if UINT_MAX == 0xffff
49 # ifndef UINT16_TYPEDEF
50 # define UINT16_TYPEDEF
51 typedef unsigned int uint16;
52 # endif /* UINT16_TYPEDEF */
53 # endif /* UINT_MAX */
55 # if INT_MAX == 0x7fff
56 # ifndef INT16_TYPEDEF
57 # define INT16_TYPEDEF
59 # endif /* INT16_TYPEDEF */
62 # if USHRT_MAX == 0xffff
63 # ifndef UINT16_TYPEDEF
64 # define UINT16_TYPEDEF
65 typedef unsigned short uint16;
66 # endif /* UINT16_TYPEDEF */
67 # endif /* USHRT_MAX */
69 # if SHRT_MAX == 0x7fff
70 # ifndef INT16_TYPEDEF
71 # define INT16_TYPEDEF
73 # endif /* INT16_TYPEDEF */
74 # endif /* SHRT_MAX */
76 # if UINT_MAX == 0xffffffff
77 # ifndef UINT32_TYPEDEF
78 # define UINT32_TYPEDEF
79 typedef unsigned int uint32;
80 # endif /* UINT32_TYPEDEF */
81 # endif /* UINT_MAX */
83 # if INT_MAX == 0x7fffffff
84 # ifndef INT32_TYPEDEF
85 # define INT32_TYPEDEF
87 # endif /* INT32_TYPEDEF */
90 # if ULONG_MAX == 0xffffffff
91 # ifndef UINT32_TYPEDEF
92 # define UINT32_TYPEDEF
93 typedef unsigned long uint32;
94 # endif /* UINT32_TYPEDEF */
95 # endif /* ULONG_MAX */
97 # if LONG_MAX == 0x7fffffff
98 # ifndef INT32_TYPEDEF
99 # define INT32_TYPEDEF
101 # endif /* INT32_TYPEDEF */
102 # endif /* LONG_MAX */
104 # ifndef UINT8_TYPEDEF
105 # error "uint8 type is undefined!"
107 # ifndef INT8_TYPEDEF
108 # error "int8 type is undefined!"
110 # ifndef UINT16_TYPEDEF
111 # error "uint16 type is undefined!"
113 # ifndef INT16_TYPEDEF
114 # error "int16 type is undefined!"
116 # ifndef UINT32_TYPEDEF
117 # error "uint32 type is undefined!"
119 # ifndef INT32_TYPEDEF
120 # error "int32 type is undefined!"
125 typedef uint32 dword;
128 #endif /* __TYPEDEFS_H */