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 { DA_FALSE = 0, DA_TRUE = 1 } Bool;
34 # define FALSE DA_FALSE
40 # if UCHAR_MAX == 0xff
41 # ifndef UINT8_TYPEDEF
42 # define UINT8_TYPEDEF
43 typedef unsigned char uint8;
44 # endif /* UINT8_TYPEDEF */
45 # endif /* UCHAR_MAX */
47 # if SCHAR_MAX == 0x7f
50 typedef signed char int8;
51 # endif /* INT8_TYPEDEF */
52 # endif /* SCHAR_MAX */
54 # if UINT_MAX == 0xffff
55 # ifndef UINT16_TYPEDEF
56 # define UINT16_TYPEDEF
57 typedef unsigned int uint16;
58 # endif /* UINT16_TYPEDEF */
59 # endif /* UINT_MAX */
61 # if INT_MAX == 0x7fff
62 # ifndef INT16_TYPEDEF
63 # define INT16_TYPEDEF
65 # endif /* INT16_TYPEDEF */
68 # if USHRT_MAX == 0xffff
69 # ifndef UINT16_TYPEDEF
70 # define UINT16_TYPEDEF
71 typedef unsigned short uint16;
72 # endif /* UINT16_TYPEDEF */
73 # endif /* USHRT_MAX */
75 # if SHRT_MAX == 0x7fff
76 # ifndef INT16_TYPEDEF
77 # define INT16_TYPEDEF
79 # endif /* INT16_TYPEDEF */
80 # endif /* SHRT_MAX */
82 # if UINT_MAX == 0xffffffff
83 # ifndef UINT32_TYPEDEF
84 # define UINT32_TYPEDEF
85 typedef unsigned int uint32;
86 # endif /* UINT32_TYPEDEF */
87 # endif /* UINT_MAX */
89 # if INT_MAX == 0x7fffffff
90 # ifndef INT32_TYPEDEF
91 # define INT32_TYPEDEF
93 # endif /* INT32_TYPEDEF */
96 # if ULONG_MAX == 0xffffffff
97 # ifndef UINT32_TYPEDEF
98 # define UINT32_TYPEDEF
99 typedef unsigned long uint32;
100 # endif /* UINT32_TYPEDEF */
101 # endif /* ULONG_MAX */
103 # if LONG_MAX == 0x7fffffff
104 # ifndef INT32_TYPEDEF
105 # define INT32_TYPEDEF
107 # endif /* INT32_TYPEDEF */
108 # endif /* LONG_MAX */
110 # ifndef UINT8_TYPEDEF
111 # error "uint8 type is undefined!"
113 # ifndef INT8_TYPEDEF
114 # error "int8 type is undefined!"
116 # ifndef UINT16_TYPEDEF
117 # error "uint16 type is undefined!"
119 # ifndef INT16_TYPEDEF
120 # error "int16 type is undefined!"
122 # ifndef UINT32_TYPEDEF
123 # error "uint32 type is undefined!"
125 # ifndef INT32_TYPEDEF
126 # error "int32 type is undefined!"
130 #endif /* __TYPEDEFS_H */