include/libtu/types.h

Sat, 08 Mar 2003 15:55:01 +0100

author
tuomov
date
Sat, 08 Mar 2003 15:55:01 +0100
changeset 46
c6deeee169aa
parent 36
63cd573ffbcf
child 53
f8f9366b359c
permissions
-rw-r--r--

trunk: changeset 50
Added CONFOPTS_NOT_SET and parse_config_tokz_skip_section.

5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
1 /*
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
2 * libtu/types.h
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
3 *
36
63cd573ffbcf trunk: changeset 39
tuomov
parents: 9
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2002.
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
5 * See the included file LICENSE for details.
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
6 */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
7
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
8 #ifndef LIBTU_TYPES_H
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
9 #define LIBTU_TYPES_H
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
10
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
11 #include <sys/types.h>
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
12
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
13 #ifndef TRUE
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
14 #define TRUE 1
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
15 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
16
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
17 #ifndef FALSE
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
18 #define FALSE 0
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
19 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
20
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
21 #ifndef NULL
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
22 #define NULL ((void*)0)
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
23 #endif
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
24
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
25 #ifndef LIBTU_TYPEDEF_UXXX
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
26
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
27 /* All systems seem to define these whichever way they want to
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
28 * despite -D_*_SOURCE etc. so there is no easy way to know whether
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
29 * they can be typedef'd or not. Unless you want to go through using
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
30 * autoconf or similar methods. ==> Just stick to #define. :-(
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
31 */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
32
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
33 #ifndef uchar
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
34 #define uchar unsigned char
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
35 #endif
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
36
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
37 #ifndef ushort
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
38 #define ushort unsigned short
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
39 #endif
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
40
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
41 #ifndef uint
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
42 #define uint unsigned int
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
43 #endif
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
44
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
45 #ifndef ulong
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
46 #define ulong unsigned long
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
47 #endif
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
48
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
49 #else /* LIBTU_TYPEDEF_UXXX */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
50
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
51 #ifndef uchar
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
52 typedef unsigned char uchar;
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
53 #endif
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
54
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
55 #ifndef ushort
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
56 typedef unsigned short ushort;
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
57 #endif
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
58
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
59 #ifndef uint
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
60 typedef unsigned int uint;
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
61 #endif
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
62
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
63 #ifndef ulong
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
64 typedef unsigned long ulong;
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
65 #endif
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
66
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
67 #endif /* LIBTU_TYPEDEF_UXXX */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
68
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
69
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
70 #ifndef LIBTU_TYPEDEF_BOOL
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
71
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
72 #ifndef bool
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
73 #define bool int
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
74 #endif
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
75
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
76 #else /* LIBTU_TYPEDEF_BOOL */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
77
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
78 #ifndef bool
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
79 typedef int bool;
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
80 #endif
5
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
81
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
82 #endif /* LIBTU_TYPEDEF_BOOL */
f878a9ffa3e0 trunk: changeset 8
tuomov
parents:
diff changeset
83
8
c1994196683f trunk: changeset 11
tuomov
parents: 5
diff changeset
84 #endif /* LIBTU_TYPES_H */

mercurial