UbixOS  2.0
types.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _SYS_TYPES_H_
30 #define _SYS_TYPES_H_
31 
32 #include <sys/_types.h>
33 #include <sys/select.h>
34 
35 #ifndef NULL
36 #define NULL 0
37 #endif
38 
40 
41 typedef char *caddr_t;
42 
43 /* unsigned integrals */
49 
50 /* unsigned integrals (deprecated) */
56 
57 typedef __int64_t quad_t;
58 
59 typedef __int64_t daddr_t; /* disk address */
60 typedef __uint32_t u_daddr_t; /* unsigned disk address */
61 
62 typedef unsigned char uInt8;
63 typedef unsigned short uInt16;
64 typedef unsigned int uInt32;
65 typedef unsigned int uInt;
66 typedef char Int8;
67 typedef short Int16;
68 typedef long Int32;
69 
70 typedef unsigned char u_char;
71 typedef unsigned short u_short;
72 typedef unsigned int u_int;
73 typedef unsigned long u_long;
74 
75 typedef int pidType;
76 
77 typedef int pid_t;
78 typedef int size_t; /* standart */
79 
80 #ifndef NOBOOL
81 #ifndef __cplusplus
82 typedef enum {FALSE=0,TRUE=1}bool;
83 #endif
84 #else
85 #ifndef __cplusplus
86 #define FALSE 0
87 #define TRUE 1
88 typedef int bool;
89 #endif
90 #endif
91 
92 #ifndef _INO_T_DECLARED
93 typedef __ino_t ino_t; /* inode number */
94 #define _INO_T_DECLARED
95 #endif
96 
97 #ifndef _INT8_T_DECLARED
98 typedef __int8_t int8_t;
99 #define _INT8_T_DECLARED
100 #endif
101 
102 #ifndef _INT16_T_DECLARED
104 #define _INT16_T_DECLARED
105 #endif
106 
107 #ifndef _INT32_T_DECLARED
109 #define _INT32_T_DECLARED
110 #endif
111 
112 #ifndef _INT64_T_DECLARED
114 #define _INT64_T_DECLARED
115 #endif
116 
118 typedef char *caddr_t;
119 typedef __int64_t off_t;
121 
122 typedef __uid_t uid_t; /* user id */
123 typedef __gid_t gid_t; /* group id */
127 
128 #ifndef _TIME_T_DECLARED
129 typedef __time_t time_t;
130 #define _TIME_T_DECLARED
131 #endif
132 
137 
138 #define __ULONG_MAX 0xffffffffUL
139 #define __USHRT_MAX 0xffff /* max value for an unsigned short */
140 
141 #define ULONG_MAX __ULONG_MAX
142 #define USHRT_MAX __USHRT_MAX
143 
144 /* select a type for digits in base B: use unsigned short if they fit */
145 #if ULONG_MAX == 0xffffffff && USHRT_MAX >= 0xffff
146 typedef unsigned short digit;
147 #else
148 typedef u_long digit;
149 #endif
150 
151 #define _QUAD_HIGHWORD 1
152 #define _QUAD_LOWWORD 0
153 
154 #define H _QUAD_HIGHWORD
155 #define L _QUAD_LOWWORD
156 
157 #define __CHAR_BIT 8
158 #define CHAR_BIT __CHAR_BIT
159 
160 #define QUAD_BITS (sizeof(quad_t) * CHAR_BIT)
161 #define LONG_BITS (sizeof(long) * CHAR_BIT)
162 #define HALF_BITS (sizeof(long) * CHAR_BIT / 2)
163 #define HHALF(x) ((x) >> HALF_BITS)
164 #define LHALF(x) ((x) & ((1 << HALF_BITS) - 1))
165 #define LHUP(x) ((x) << HALF_BITS)
166 
167 typedef unsigned int qshift_t;
168 
169 #define B (1 << HALF_BITS) /* digit base */
170 
171 /* Combine two `digits' to make a single two-digit number. */
172 #define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b))
173 
174 #ifndef _MODE_T_DECLARED
175 typedef __mode_t mode_t; /* permissions */
176 #define _MODE_T_DECLARED
177 #endif
178 
179 #endif /* END _SYS_TYPES_H */
__fflags_t
__uint32_t __fflags_t
Definition: _types.h:52
__uintfptr_t
__uint32_t __uintfptr_t
Definition: _types.h:53
u_long
unsigned long u_long
Definition: types.h:73
mode_t
__mode_t mode_t
Definition: types.h:175
__uint8_t
unsigned char __uint8_t
Definition: _types.h:34
time_t
__time_t time_t
Definition: types.h:129
uInt
unsigned int uInt
Definition: types.h:65
TRUE
Definition: types.h:82
gid_t
__gid_t gid_t
Definition: types.h:123
fflags_t
__fflags_t fflags_t
Definition: types.h:126
__uint32_t
unsigned int __uint32_t
Definition: _types.h:38
u_quad_t
__uint64_t u_quad_t
Definition: types.h:55
uInt32
unsigned int uInt32
Definition: types.h:64
__mode_t
__uint16_t __mode_t
Definition: _types.h:49
int16_t
__int16_t int16_t
Definition: types.h:103
FALSE
Definition: types.h:82
uint64_t
__uint64_t uint64_t
Definition: types.h:47
vm_offset_t
__uint32_t vm_offset_t
Definition: types.h:120
ino_t
__ino_t ino_t
Definition: types.h:93
pid_t
int pid_t
Definition: types.h:77
__ino_t
__uint32_t __ino_t
Definition: _types.h:47
u_int64_t
__uint64_t u_int64_t
Definition: types.h:54
__int64_t
long long __int64_t
Definition: _types.h:39
__blkcnt_t
__int64_t __blkcnt_t
Definition: _types.h:50
bool
bool
Definition: types.h:82
__uid_t
__uint32_t __uid_t
Definition: _types.h:50
intmax_t
int32_t intmax_t
Definition: types.h:134
quad_t
__int64_t quad_t
Definition: types.h:57
size_t
int size_t
Definition: types.h:78
u_short
unsigned short u_short
Definition: types.h:71
u_int16_t
__uint16_t u_int16_t
Definition: types.h:52
__blksize_t
__uint32_t __blksize_t
Definition: _types.h:51
uint16_t
__uint16_t uint16_t
Definition: types.h:45
__uint16_t
unsigned short __uint16_t
Definition: _types.h:36
Int8
char Int8
Definition: types.h:66
int8_t
__int8_t int8_t
Definition: types.h:98
blksize_t
__blksize_t blksize_t
Definition: types.h:125
__uint64_t
unsigned long long __uint64_t
Definition: _types.h:40
u_int8_t
__uint8_t u_int8_t
Definition: types.h:51
digit
unsigned short digit
Definition: types.h:146
u_daddr_t
__uint32_t u_daddr_t
Definition: types.h:60
uquad_t
__uint64_t uquad_t
Definition: types.h:48
__ssize_t
__int32_t __ssize_t
Definition: _types.h:47
blkcnt_t
__blkcnt_t blkcnt_t
Definition: types.h:124
uint32_t
__uint32_t uint32_t
Definition: types.h:46
int32_t
__int32_t int32_t
Definition: types.h:108
Int16
short Int16
Definition: types.h:67
_types.h
__int32_t
int __int32_t
Definition: _types.h:37
ptrdiff_t
int32_t ptrdiff_t
Definition: types.h:135
caddr_t
char * caddr_t
Definition: types.h:41
int64_t
__int64_t int64_t
Definition: types.h:113
__int8_t
char __int8_t
Definition: _types.h:33
pidType
int pidType
Definition: types.h:75
uintmax_t
uint32_t uintmax_t
Definition: types.h:133
__int16_t
short __int16_t
Definition: _types.h:35
__gid_t
__uint32_t __gid_t
Definition: _types.h:50
__time_t
__int32_t __time_t
Definition: _types.h:50
uInt16
unsigned short uInt16
Definition: types.h:63
select.h
off_t
__int64_t off_t
Definition: types.h:119
uintptr_t
uint32_t uintptr_t
Definition: types.h:136
uint8_t
__uint8_t uint8_t
Definition: types.h:44
Int32
long Int32
Definition: types.h:68
uid_t
__uid_t uid_t
Definition: types.h:122
ssize_t
__ssize_t ssize_t
Definition: types.h:117
u_int
unsigned int u_int
Definition: types.h:72
uInt8
unsigned char uInt8
Definition: types.h:62
u_char
unsigned char u_char
Definition: types.h:70
u_int32_t
__uint32_t u_int32_t
Definition: types.h:53
daddr_t
__int64_t daddr_t
Definition: types.h:59
qshift_t
unsigned int qshift_t
Definition: types.h:167
uintfptr_t
__uintfptr_t uintfptr_t
Definition: types.h:39