types.h

Sun, 07 Mar 2004 22:10:48 +0100

author
tuomov
date
Sun, 07 Mar 2004 22:10:48 +0100
changeset 63
5b732dd506d3
parent 58
789df543d0c3
permissions
-rw-r--r--

trunk: changeset 1360
Added scopyn.

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

mercurial