rocksndiamonds-3.0.5
[rocksndiamonds.git] / src / libgame / types.h
1 /***********************************************************
2 * Artsoft Retro-Game Library                               *
3 *----------------------------------------------------------*
4 * (c) 1994-2002 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * types.h                                                  *
12 ***********************************************************/
13
14 #ifndef TYPES_H
15 #define TYPES_H
16
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <stdarg.h>
20 #include <string.h>
21 #include <sys/types.h>
22
23 typedef unsigned char boolean;
24
25 #if !defined(PLATFORM_WIN32)
26 typedef unsigned char byte;
27 #endif
28
29 #ifndef FALSE
30 #define FALSE           0
31 #define TRUE            (!FALSE)
32 #endif
33
34 #ifndef MIN
35 #define MIN(a,b)        ((a) < (b) ? (a) : (b))
36 #endif
37
38 #ifndef MAX
39 #define MAX(a,b)        ((a) > (b) ? (a) : (b))
40 #endif
41
42 #ifndef ABS
43 #define ABS(a)          ((a) < 0 ? -(a) : (a))
44 #endif
45
46 #ifndef SIGN
47 #define SIGN(a)         ((a) < 0 ? -1 : ((a)>0 ? 1 : 0))
48 #endif
49
50 #define SIZEOF_ARRAY(array, type)       (sizeof(array) / sizeof(type))
51 #define SIZEOF_ARRAY_INT(array)         SIZEOF_ARRAY(array, int)
52
53
54 struct ListNode
55 {
56   char *key;
57   void *content;
58   struct ListNode *next;
59 };
60 typedef struct ListNode ListNode;
61
62 #endif /* TYPES_H */