rnd-20030331-1-src
[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 <sys/types.h>
21
22 typedef unsigned char boolean;
23
24 #if !defined(PLATFORM_WIN32)
25 typedef unsigned char byte;
26 #endif
27
28 #ifndef FALSE
29 #define FALSE           0
30 #define TRUE            (!FALSE)
31 #endif
32
33 #ifndef MIN
34 #define MIN(a,b)        ((a) < (b) ? (a) : (b))
35 #endif
36
37 #ifndef MAX
38 #define MAX(a,b)        ((a) > (b) ? (a) : (b))
39 #endif
40
41 #ifndef ABS
42 #define ABS(a)          ((a) < 0 ? -(a) : (a))
43 #endif
44
45 #ifndef SIGN
46 #define SIGN(a)         ((a) < 0 ? -1 : ((a)>0 ? 1 : 0))
47 #endif
48
49 #define SIZEOF_ARRAY(array, type)       (sizeof(array) / sizeof(type))
50 #define SIZEOF_ARRAY_INT(array)         SIZEOF_ARRAY(array, int)
51
52
53 struct ListNode
54 {
55   char *key;
56   void *content;
57   struct ListNode *next;
58 };
59 typedef struct ListNode ListNode;
60
61 #endif /* TYPES_H */