Whamcloud - gitweb
- merge 0.7rc1 from b_devel to HEAD (20030612 merge point)
[fs/lustre-release.git] / lustre / portals / include / portals / defines.h
1 /*
2 **
3 ** This files contains definitions that are used throughout the cplant code.
4 */
5
6 #ifndef CPLANT_H
7 #define CPLANT_H
8
9 #define TITLE(fname,zmig)
10
11
12 /*
13 ** TRUE and FALSE
14 */
15 #undef TRUE
16 #define TRUE            (1)
17 #undef FALSE
18 #define FALSE           (0)
19
20
21 /*
22 ** Return codes from functions
23 */
24 #undef OK
25 #define OK              (0)
26 #undef ERROR
27 #define ERROR           (-1)
28
29
30
31 /*
32 ** The GCC macro for a safe max() that works on all types arithmetic types.
33 */
34 #ifndef MAX
35 #define MAX(a, b)       (a) > (b) ? (a) : (b)
36 #endif /* MAX */
37
38 #ifndef MIN
39 #define MIN(a, b)       (a) < (b) ? (a) : (b)
40 #endif /* MIN */
41
42 /*
43 ** The rest is from the old qkdefs.h
44 */
45
46 #ifndef __linux__
47 #define __inline__
48 #endif
49
50 #ifndef NULL
51 #define NULL ((void *)0)
52 #endif
53
54 #ifndef __osf__
55 #define PRIVATE static
56 #define PUBLIC
57 #endif
58
59 #ifndef __osf__
60 typedef unsigned char           uchar;
61 #endif
62
63 typedef char                    CHAR;
64 typedef unsigned char           UCHAR;
65 typedef char                    INT8;
66 typedef unsigned char           UINT8;
67 typedef short int               INT16;
68 typedef unsigned short int      UINT16;
69 typedef int                     INT32;
70 typedef unsigned int            UINT32;
71 typedef long                    LONG32;
72 typedef unsigned long           ULONG32;
73
74 /* long may be 32 or 64, so we can't really append the size to the definition */
75 typedef long                    LONG;
76 typedef unsigned long           ULONG;
77
78 #ifdef __alpha__
79 typedef long int_t;
80 #ifndef __osf__
81 typedef unsigned long uint_t;
82 #endif
83 #endif
84
85 #ifdef __i386__
86 typedef int int_t;
87 typedef unsigned int uint_t;
88 #endif
89
90 typedef float                   FLOAT32;
91 typedef double                  FLOAT64;
92 typedef void                    VOID;
93 typedef INT32                   BOOLEAN;
94 typedef void (*FCN_PTR)(void);
95
96 #ifndef off64_t
97
98 #if defined (__alpha__) || defined (__ia64__)
99 typedef long                     off64_t;
100 #else
101 typedef long long                off64_t;
102 #endif
103
104 #endif
105
106 /*
107 ** Process related typedefs
108 */
109 typedef UINT16 PID_TYPE;  /* Type of Local process ID */
110 typedef UINT16 NID_TYPE;  /* Type of Physical node ID */
111 typedef UINT16 GID_TYPE;  /* Type of Group ID */
112 typedef UINT16 RANK_TYPE; /* Type of Logical rank/process within a group */
113
114
115
116 #endif /* CPLANT_H */