ReactOS  0.4.13-dev-249-gcba1a2f
utypes.h
Go to the documentation of this file.
1 /* @(#)utypes.h 1.36 13/09/14 Copyright 1997-2013 J. Schilling */
2 /*
3  * Definitions for some user defined types
4  *
5  * Copyright (c) 1997-2013 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License"). You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  * A copy of the CDDL is also available via the Internet at
15  * http://www.opensource.org/licenses/cddl1.txt
16  *
17  * When distributing Covered Code, include this CDDL HEADER in each
18  * file and include the License file CDDL.Schily.txt from this distribution.
19  */
20 
21 #ifndef _SCHILY_UTYPES_H
22 #define _SCHILY_UTYPES_H
23 
24 #ifndef _SCHILY_MCONFIG_H
25 #include <schily/mconfig.h>
26 #endif
27 
28 /*
29  * uypes.h is based on inttypes.h
30  */
31 #ifndef _SCHILY_INTTYPES_H
32 #include <schily/inttypes.h>
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Several unsigned cardinal types
41  */
42 typedef unsigned long Ulong;
43 typedef unsigned int Uint;
44 typedef unsigned short Ushort;
45 typedef unsigned char Uchar;
46 
47 /*
48  * The IBM AIX C-compiler seems to be the only compiler on the world
49  * which does not allow to use unsigned char bit fields as a hint
50  * for packed bit fields. Define a pesical type to avoid warnings.
51  * The packed attribute is honored wit unsigned int in this case too.
52  */
53 #if defined(_AIX) && !defined(__GNUC__)
54 
55 typedef unsigned int Ucbit;
56 
57 #else
58 
59 typedef unsigned char Ucbit;
60 
61 #endif
62 
63 #ifndef CHAR_MIN
64 #define CHAR_MIN TYPE_MINVAL(char)
65 #endif
66 #ifndef CHAR_MAX
67 #define CHAR_MAX TYPE_MAXVAL(char)
68 #endif
69 #ifndef UCHAR_MAX
70 #define UCHAR_MAX TYPE_MAXVAL(unsigned char)
71 #endif
72 
73 #ifndef SHRT_MIN
74 #define SHRT_MIN TYPE_MINVAL(short)
75 #endif
76 #ifndef SHRT_MAX
77 #define SHRT_MAX TYPE_MAXVAL(short)
78 #endif
79 #ifndef USHRT_MAX
80 #define USHRT_MAX TYPE_MAXVAL(unsigned short)
81 #endif
82 
83 #ifndef INT_MIN
84 #define INT_MIN TYPE_MINVAL(int)
85 #endif
86 #ifndef INT_MAX
87 #define INT_MAX TYPE_MAXVAL(int)
88 #endif
89 #ifndef UINT_MAX
90 #define UINT_MAX TYPE_MAXVAL(unsigned int)
91 #endif
92 
93 #ifndef LONG_MIN
94 #define LONG_MIN TYPE_MINVAL(long)
95 #endif
96 #ifndef LONG_MAX
97 #define LONG_MAX TYPE_MAXVAL(long)
98 #endif
99 #ifndef ULONG_MAX
100 #define ULONG_MAX TYPE_MAXVAL(unsigned long)
101 #endif
102 
103 #define OFF_T_MIN TYPE_MINVAL(off_t)
104 #define OFF_T_MAX TYPE_MAXVAL(off_t)
105 
106 #define UID_T_MIN TYPE_MINVAL(uid_t)
107 #define UID_T_MAX TYPE_MAXVAL(uid_t)
108 
109 #define GID_T_MIN TYPE_MINVAL(gid_t)
110 #define GID_T_MAX TYPE_MAXVAL(gid_t)
111 
112 #define PID_T_MIN TYPE_MINVAL(pid_t)
113 #define PID_T_MAX TYPE_MAXVAL(pid_t)
114 
115 #define MODE_T_MIN TYPE_MINVAL(mode_t)
116 #define MODE_T_MAX TYPE_MAXVAL(mode_t)
117 
118 #define TIME_T_MIN TYPE_MINVAL(time_t)
119 #define TIME_T_MAX TYPE_MAXVAL(time_t)
120 
121 #define CADDR_T_MIN TYPE_MINVAL(caddr_t)
122 #define CADDR_T_MAX TYPE_MAXVAL(caddr_t)
123 
124 #define DADDR_T_MIN TYPE_MINVAL(daddr_t)
125 #define DADDR_T_MAX TYPE_MAXVAL(daddr_t)
126 
127 #define DEV_T_MIN TYPE_MINVAL(dev_t)
128 #define DEV_T_MAX TYPE_MAXVAL(dev_t)
129 
130 #define MAJOR_T_MIN TYPE_MINVAL(major_t)
131 #define MAJOR_T_MAX TYPE_MAXVAL(major_t)
132 
133 #define MINOR_T_MIN TYPE_MINVAL(minor_t)
134 #define MINOR_T_MAX TYPE_MAXVAL(minor_t)
135 
136 #define INO_T_MIN TYPE_MINVAL(ino_t)
137 #define INO_T_MAX TYPE_MAXVAL(ino_t)
138 
139 #define NLINK_T_MIN TYPE_MINVAL(nlink_t)
140 #define NLINK_T_MAX TYPE_MAXVAL(nlink_t)
141 
142 #define BLKSIZE_T_MIN TYPE_MINVAL(blksize_t)
143 #define BLKSIZE_T_MAX TYPE_MAXVAL(blksize_t)
144 
145 #define BLKCNT_T_MIN TYPE_MINVAL(blkcnt_t)
146 #define BLKCNT_T_MAX TYPE_MAXVAL(blkcnt_t)
147 
148 #define CLOCK_T_MIN TYPE_MINVAL(clock_t)
149 #define CLOCK_T_MAX TYPE_MAXVAL(clock_t)
150 
151 #define SOCKLEN_T_MIN TYPE_MINVAL(socklen_t)
152 #define SOCKLEN_T_MAX TYPE_MAXVAL(socklen_t)
153 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif /* _SCHILY_UTYPES_H */
unsigned char Uchar
Definition: utypes.h:45
unsigned int Uint
Definition: utypes.h:43
unsigned short Ushort
Definition: utypes.h:44
unsigned char Ucbit
Definition: utypes.h:59
unsigned long Ulong
Definition: utypes.h:42