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
|
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
30 |
/**
|
31 |
* FALSE has the absolute value of 0, it is used in as a way to represet a false
|
|
32 |
* value. A "not" value.
|
|
33 |
*/
|
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
34 |
#define FALSE 0
|
35 |
#endif
|
|
36 |
||
37 |
#ifndef TRUE
|
|
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
38 |
/** |
39 |
* TRUE represets a value that is true. A value that is "not false".
|
|
40 |
*/
|
|
41 |
#define TRUE (!FALSE)
|
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
42 |
#endif
|
43 |
||
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
44 |
/**
|
45 |
* sboolean is the standard definition of a boolean value in SSTS.
|
|
46 |
*
|
|
47 |
* @sa TRUE
|
|
48 |
* @sa FALSE
|
|
49 |
*
|
|
50 |
* @note
|
|
51 |
* This is the way it is done in GLib, so it is done here too.
|
|
52 |
*/
|
|
53 |
typedef int sboolean; |
|
54 |
||
|
43
by Gustav Hartvigsson
* Code cleanup |
55 |
/** hash type */
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
56 |
typedef long hash_t; |
57 |
||
|
43
by Gustav Hartvigsson
* Code cleanup |
58 |
/** spointer is a convinience typedef of void * */
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
59 |
typedef void* spointer; |
60 |
||
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
61 |
/** sconstponter is a convinience typedef of const void * */
|
62 |
typedef const void* sconstponter; |
|
63 |
||
64 |
/**
|
|
65 |
* Represents different types of objects.
|
|
66 |
*
|
|
67 |
* @se STypeName
|
|
68 |
*/
|
|
|
23
by Gustav Hartvigsson
* Fixed some of the build warnings. |
69 |
typedef enum { |
|
43
by Gustav Hartvigsson
* Code cleanup |
70 |
S_TYPE_NONE = 0, |
71 |
S_TYPE_INT, |
|
72 |
S_TYPE_CHAR, |
|
73 |
S_TYPE_SHORT, |
|
74 |
S_TYPE_BOOLEAN, |
|
75 |
S_TYPE_LONG, |
|
76 |
S_TYPE_UINT, |
|
77 |
S_TYPE_UNUSED_0, |
|
78 |
S_TYPE_UNUSED_1, |
|
79 |
S_TYPE_UNUSED_2, |
|
80 |
S_TYPE_OBJECT, |
|
81 |
S_TYPE_INVALID |
|
82 |
} SType; |
|
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
83 |
|
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
84 |
/** @brief
|
85 |
* The names of the SType's
|
|
86 |
*/
|
|
|
43
by Gustav Hartvigsson
* Code cleanup |
87 |
static const char * STypeName[] __attribute__((unused)) = { |
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
88 |
"NONE", |
89 |
"INT", |
|
90 |
"CHAR", |
|
91 |
"SHORT", |
|
92 |
"BOOLEAN", |
|
93 |
"LONG", |
|
94 |
"ULONG", |
|
95 |
0x0, |
|
96 |
0x0, |
|
97 |
0x0, |
|
98 |
"OBJECT", |
|
99 |
"INVALID", |
|
100 |
0x0, |
|
101 |
0x0, |
|
|
43
by Gustav Hartvigsson
* Code cleanup |
102 |
};
|
|
26
by Gustav Hartvigsson
* Added something to config.h.in, still not sure how it cmake works. |
103 |
|
|
46
by Gustav Hartvigsson
* Renamed DynamicArray to SDynamicArray. |
104 |
|
|
26
by Gustav Hartvigsson
* Added something to config.h.in, still not sure how it cmake works. |
105 |
/* Colour definitions for console prints */
|
106 |
#define RESET "\033[0m"
|
|
107 |
#define BLACK "\033[30m" /* Black */ |
|
108 |
#define RED "\033[31m" /* Red */ |
|
109 |
#define GREEN "\033[32m" /* Green */ |
|
110 |
#define YELLOW "\033[33m" /* Yellow */ |
|
111 |
#define BLUE "\033[34m" /* Blue */ |
|
112 |
#define MAGENTA "\033[35m" /* Magenta */ |
|
113 |
#define CYAN "\033[36m" /* Cyan */ |
|
114 |
#define WHITE "\033[37m" /* White */ |
|
115 |
#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */ |
|
116 |
#define BOLDRED "\033[1m\033[31m" /* Bold Red */ |
|
117 |
#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */ |
|
118 |
#define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */ |
|
119 |
#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */ |
|
120 |
#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */ |
|
121 |
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */ |
|
122 |
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */ |
|
123 |
||
|
33
by Gustav Hartvigsson
* made test_macros.h a lil' bit more portable |
124 |
|
|
26
by Gustav Hartvigsson
* Added something to config.h.in, still not sure how it cmake works. |
125 |
END_DECLS
|
126 |
||
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
127 |
#endif
|