bzr branch
http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
1 |
/*
|
2 |
*/
|
|
3 |
||
4 |
#ifndef __H_DEFS__
|
|
5 |
#define __H_DEFS__
|
|
6 |
||
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
7 |
#include <limits.h> |
8 |
||
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
9 |
/** @file
|
10 |
*
|
|
11 |
*/
|
|
12 |
||
13 |
#ifdef __cplusplus
|
|
14 |
#define BEGIN_DECLS extern "C" {
|
|
15 |
#else
|
|
16 |
#define BEGIN_DECLS
|
|
17 |
#endif /*__cplusplus*/ |
|
18 |
||
19 |
||
20 |
#ifdef __cplusplus
|
|
21 |
#define END_DECLS }
|
|
22 |
#else
|
|
23 |
#define END_DECLS
|
|
24 |
#endif /* __cplusplus */ |
|
25 |
||
|
26
by Gustav Hartvigsson
* Added something to config.h.in, still not sure how it cmake works. |
26 |
BEGIN_DECLS
|
27 |
||
|
43
by Gustav Hartvigsson
* Code cleanup |
28 |
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
29 |
#ifndef FALSE
|
30 |
#define FALSE 0
|
|
31 |
#endif
|
|
32 |
||
33 |
#ifndef TRUE
|
|
34 |
#define TRUE !FALSE
|
|
35 |
#endif
|
|
36 |
||
|
43
by Gustav Hartvigsson
* Code cleanup |
37 |
/** hash type */
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
38 |
typedef long hash_t; |
39 |
||
|
43
by Gustav Hartvigsson
* Code cleanup |
40 |
/** spointer is a convinience typedef of void * */
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
41 |
typedef void* spointer; |
42 |
||
|
43
by Gustav Hartvigsson
* Code cleanup |
43 |
/** Represents different types of objects */
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
44 |
typedef enum { |
|
43
by Gustav Hartvigsson
* Code cleanup |
45 |
S_TYPE_NONE = 0, |
46 |
S_TYPE_INT, |
|
47 |
S_TYPE_CHAR, |
|
48 |
S_TYPE_SHORT, |
|
49 |
S_TYPE_BOOLEAN, |
|
50 |
S_TYPE_LONG, |
|
51 |
S_TYPE_UINT, |
|
52 |
S_TYPE_UNUSED_0, |
|
53 |
S_TYPE_UNUSED_1, |
|
54 |
S_TYPE_UNUSED_2, |
|
55 |
S_TYPE_OBJECT, |
|
56 |
S_TYPE_INVALID |
|
57 |
} SType; |
|
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
58 |
|
|
43
by Gustav Hartvigsson
* Code cleanup |
59 |
static const char * STypeName[] __attribute__((unused)) = { |
60 |
"NONE", |
|
61 |
"INT", |
|
62 |
"CHAR", |
|
63 |
"SHORT", |
|
64 |
"BOOLEAN", |
|
65 |
"LONG", |
|
66 |
"ULONG", |
|
67 |
0x0, |
|
68 |
0x0, |
|
69 |
0x0, |
|
70 |
"OBJECT", |
|
71 |
"INVALID", |
|
72 |
0x0, |
|
73 |
0x0, |
|
74 |
};
|
|
|
26
by Gustav Hartvigsson
* Added something to config.h.in, still not sure how it cmake works. |
75 |
|
76 |
/* Colour definitions for console prints */
|
|
77 |
#define RESET "\033[0m"
|
|
78 |
#define BLACK "\033[30m" /* Black */ |
|
79 |
#define RED "\033[31m" /* Red */ |
|
80 |
#define GREEN "\033[32m" /* Green */ |
|
81 |
#define YELLOW "\033[33m" /* Yellow */ |
|
82 |
#define BLUE "\033[34m" /* Blue */ |
|
83 |
#define MAGENTA "\033[35m" /* Magenta */ |
|
84 |
#define CYAN "\033[36m" /* Cyan */ |
|
85 |
#define WHITE "\033[37m" /* White */ |
|
86 |
#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */ |
|
87 |
#define BOLDRED "\033[1m\033[31m" /* Bold Red */ |
|
88 |
#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */ |
|
89 |
#define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */ |
|
90 |
#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */ |
|
91 |
#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */ |
|
92 |
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */ |
|
93 |
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */ |
|
94 |
||
|
33
by Gustav Hartvigsson
* made test_macros.h a lil' bit more portable |
95 |
|
|
26
by Gustav Hartvigsson
* Added something to config.h.in, still not sure how it cmake works. |
96 |
END_DECLS
|
97 |
||
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
98 |
#endif
|