authorgravatar for 3811822-hoanga@users.noreply.gitlab.comAl Hoang <3811822-hoanga@users.noreply.gitlab.com> 2021-11-19 22:04:09-06:00
committergravatar for 3811822-hoanga@users.noreply.gitlab.comAl Hoang <3811822-hoanga@users.noreply.gitlab.com> 2021-11-19 22:04:09-06:00
logbe541ca5e102614c8d86b86affcda44df828d8fb
tree023663762325aa3a3a057af89c96df1ecb0074fb
parent4ec83133e9ee9bf5de97175c27881cc6e93d17c1

haiku follow up cleanup of constants


1 files changed, 16 insertions(+), 69 deletions(-)

lib/std/c/haiku.zig+16-69
...@@ -28,12 +28,12 @@ pub extern "c" fn _kern_read_stat(fd: c_int, path_ptr: [*]u8, traverse_link: boo...@@ -28,12 +28,12 @@ pub extern "c" fn _kern_read_stat(fd: c_int, path_ptr: [*]u8, traverse_link: boo
28pub extern "c" fn _kern_get_current_team() i32;28pub extern "c" fn _kern_get_current_team() i32;
2929
30pub const sem_t = extern struct {30pub const sem_t = extern struct {
31 _magic: u32,31 type: i32,
32 _kern: extern struct {32 u: extern union {
33 _count: u32,33 named_sem_id: ?i32,
34 _flags: u32,34 unnamed_sem: ?i32,
35 },35 },
36 _padding: u32,36 padding: [2]i32,
37};37};
3838
39pub const pthread_attr_t = extern struct {39pub const pthread_attr_t = extern struct {
...@@ -51,6 +51,7 @@ pub const pthread_mutex_t = extern struct {...@@ -51,6 +51,7 @@ pub const pthread_mutex_t = extern struct {
51 owner: i32 = -1,51 owner: i32 = -1,
52 owner_count: i32 = 0,52 owner_count: i32 = 0,
53};53};
54
54pub const pthread_cond_t = extern struct {55pub const pthread_cond_t = extern struct {
55 flags: u32 = 0,56 flags: u32 = 0,
56 unused: i32 = -42,57 unused: i32 = -42,
...@@ -58,15 +59,6 @@ pub const pthread_cond_t = extern struct {...@@ -58,15 +59,6 @@ pub const pthread_cond_t = extern struct {
58 waiter_count: i32 = 0,59 waiter_count: i32 = 0,
59 lock: i32 = 0,60 lock: i32 = 0,
60};61};
61pub const pthread_rwlock_t = extern struct {
62 flags: u32 = 0,
63 owner: i32 = -1,
64 lock_sem: i32 = 0,
65 lock_count: i32 = 0,
66 reader_count: i32 = 0,
67 writer_count: i32 = 0,
68 waiters: [2]?*c_void = [_]?*c_void{ null, null },
69};
7062
71pub const EAI = enum(c_int) {63pub const EAI = enum(c_int) {
72 /// address family for hostname not supported64 /// address family for hostname not supported
...@@ -130,17 +122,6 @@ pub const mode_t = c_uint;...@@ -130,17 +122,6 @@ pub const mode_t = c_uint;
130122
131pub const socklen_t = u32;123pub const socklen_t = u32;
132124
133/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
134pub const Kevent = extern struct {
135 ident: usize,
136 filter: i16,
137 flags: u16,
138 fflags: u32,
139 data: i64,
140 udata: usize,
141 // TODO ext
142};
143
144// Modes and flags for dlopen()125// Modes and flags for dlopen()
145// include/dlfcn.h126// include/dlfcn.h
146127
...@@ -178,13 +159,11 @@ pub const dl_phdr_info = extern struct {...@@ -178,13 +159,11 @@ pub const dl_phdr_info = extern struct {
178};159};
179160
180pub const Flock = extern struct {161pub const Flock = extern struct {
162 l_type: c_short,
163 l_whence: c_short,
181 l_start: off_t,164 l_start: off_t,
182 l_len: off_t,165 l_len: off_t,
183 l_pid: pid_t,166 l_pid: pid_t,
184 l_type: i16,
185 l_whence: i16,
186 l_sysid: i32,
187 __unused: [4]u8,
188};167};
189168
190pub const msghdr = extern struct {169pub const msghdr = extern struct {
...@@ -210,29 +189,6 @@ pub const msghdr = extern struct {...@@ -210,29 +189,6 @@ pub const msghdr = extern struct {
210 msg_flags: i32,189 msg_flags: i32,
211};190};
212191
213pub const msghdr_const = extern struct {
214 /// optional address
215 msg_name: ?*const sockaddr,
216
217 /// size of address
218 msg_namelen: socklen_t,
219
220 /// scatter/gather array
221 msg_iov: [*]iovec_const,
222
223 /// # elements in msg_iov
224 msg_iovlen: i32,
225
226 /// ancillary data
227 msg_control: ?*c_void,
228
229 /// ancillary data buffer len
230 msg_controllen: socklen_t,
231
232 /// flags on received message
233 msg_flags: i32,
234};
235
236pub const off_t = i64;192pub const off_t = i64;
237pub const ino_t = u64;193pub const ino_t = u64;
238194
...@@ -1001,24 +957,15 @@ pub const IPPROTO = struct {...@@ -1001,24 +957,15 @@ pub const IPPROTO = struct {
1001};957};
1002958
1003pub const rlimit_resource = enum(c_int) {959pub const rlimit_resource = enum(c_int) {
1004 CPU = 0,960 CORE = 0,
1005 FSIZE = 1,961 CPU = 1,
1006 DATA = 2,962 DATA = 2,
1007 STACK = 3,963 FSIZE = 3,
1008 CORE = 4,964 NOFILE = 4,
1009 RSS = 5,965 STACK = 5,
1010 MEMLOCK = 6,966 AS = 6,
1011 NPROC = 7,967 NOVMON = 7,
1012 NOFILE = 8,
1013 SBSIZE = 9,
1014 VMEM = 10,
1015 NPTS = 11,
1016 SWAP = 12,
1017 KQUEUES = 13,
1018 UMTXP = 14,
1019 _,968 _,
1020
1021 pub const AS: rlimit_resource = .VMEM;
1022};969};
1023970
1024pub const rlim_t = i64;971pub const rlim_t = i64;
...@@ -1055,7 +1002,7 @@ pub const cc_t = u8;...@@ -1055,7 +1002,7 @@ pub const cc_t = u8;
1055pub const speed_t = u8;1002pub const speed_t = u8;
1056pub const tcflag_t = u32;1003pub const tcflag_t = u32;
10571004
1058pub const NCCS = 32;1005pub const NCCS = 11;
10591006
1060pub const termios = extern struct {1007pub const termios = extern struct {
1061 c_iflag: tcflag_t,1008 c_iflag: tcflag_t,