1#![allow(non_camel_case_types)]
7
8extern crate libc;
9use libc::{c_char, c_int, c_void, dev_t, DIR, dirent, FILENAME_MAX, ino_t, off_t, PATH_MAX, size_t, ssize_t};
10use std::mem;
11
12#[macro_export]
13macro_rules! haiku_constant {
14 ($a:tt, $b:tt, $c:tt, $d:tt) => ((($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32));
15}
16
17pub const B_OS_NAME_LENGTH : usize = 32;
19pub const B_TIMEOUT: u32 = 0x8;
20
21pub type area_id = i32;
22pub type port_id = i32;
23pub type sem_id = i32;
24pub type team_id = i32;
25pub type thread_id = i32;
26
27pub type status_t = i32;
28pub type bigtime_t = i64;
29
30
31#[repr(C)]
32pub struct area_info {
33 pub area: area_id,
34 pub name: [c_char; B_OS_NAME_LENGTH],
35 pub size: usize,
36 pub lock: u32,
37 pub protection: u32,
38 pub team: team_id,
39 pub ram_size: u32,
40 pub copy_count: u32,
41 pub in_count: u32,
42 pub out_count: u32,
43 pub address: *mut c_void
44}
45
46pub const B_NO_LOCK: u32 = 0;
47pub const B_LAZY_LOCK: u32 = 1;
48pub const B_FULL_LOCK: u32 = 2;
49pub const B_CONTIGUOUS: u32 = 3;
50pub const B_LOMEM: u32 = 4;
51pub const B_32_BIT_FULL_LOCK: u32 = 5;
52pub const B_32_BIT_CONTIGUOUS: u32 = 6;
53
54pub const B_ANY_ADDRESS: u32 = 0;
55pub const B_EXACT_ADDRESS: u32 = 1;
56pub const B_BASE_ADDRESS: u32 = 2;
57pub const B_CLONE_ADDRESS: u32 = 3;
58pub const B_ANY_KERNEL_ADDRESS: u32 = 4;
59pub const B_RANDOMIZED_ANY_ADDRESS: u32 = 6;
60pub const B_RANDOMIZED_BASE_ADDRESS: u32 = 7;
61
62pub const B_READ_AREA: u32 = 1 << 0;
63pub const B_WRITE_AREA: u32 = 1 << 1;
64pub const B_EXECUTE_AREA: u32 = 1 << 2;
65pub const B_STACK_AREA: u32 = 1 << 3;
66pub const B_CLONEABLE_AREA: u32 = 1 << 8;
67
68extern {
69 pub fn create_area(name: *const c_char, startAddress: *mut *mut c_void,
70 addressSpec: u32, size: usize,
71 lock: u32, protection: u32) -> area_id;
72 pub fn clone_area(name: *const c_char, destAddress: *mut *mut c_void,
73 addressSpec: u32, protection: u32,
74 source: area_id) -> area_id;
75 pub fn find_area(name: *const c_char) -> area_id;
76 pub fn area_for(address: *mut c_void) -> area_id;
77 pub fn delete_area(id: area_id) -> status_t;
78 pub fn resize_area(id: area_id, newSize: usize) -> status_t;
79 pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t;
80 pub fn _get_area_info(id: area_id, areaInfo: *mut area_info,
81 size: usize) -> status_t;
82 pub fn _get_next_area_info(team: team_id, cookie: *mut isize,
83 areaInfo: *mut area_info,
84 size: usize) -> status_t;
85}
86
87pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t {
88 _get_area_info(id, info, mem::size_of::<area_info>() as usize)
89}
90
91pub unsafe fn get_next_area_info(team: team_id, cookie: *mut isize, info: *mut area_info) -> status_t {
92 _get_next_area_info(team, cookie, info, mem::size_of::<area_info>() as usize)
93}
94
95#[repr(C)]
96pub struct port_info {
97 pub port: port_id,
98 pub team: team_id,
99 pub name: [c_char; B_OS_NAME_LENGTH],
100 pub capacity: i32,
101 pub queue_count: i32,
102 pub total_count: i32,
103}
104
105extern {
106 pub fn create_port(capacity: i32, name: *const c_char) -> port_id;
107 pub fn find_port(name: *const c_char) -> port_id;
108 pub fn read_port(port: port_id, code: *mut i32, buffer: *mut u8,
109 bufferSize: size_t) -> ssize_t;
110 pub fn read_port_etc(port: port_id, code: *mut i32, buffer: *mut u8,
111 bufferSize: size_t, flags: u32,
112 timeout: bigtime_t) -> ssize_t;
113 pub fn write_port(port: port_id, code: i32, buffer: *const u8,
114 bufferSize: size_t) -> status_t;
115 pub fn write_port_etc(port: port_id, code: i32, buffer: *const u8,
116 bufferSize: size_t, flags: u32,
117 timeout: bigtime_t) -> status_t;
118 pub fn close_port(port: port_id) -> status_t;
119 pub fn delete_port(port: port_id) -> status_t;
120 pub fn port_buffer_size(port: port_id) -> ssize_t;
121 pub fn port_buffer_size_etc(port: port_id, flags: u32,
122 timeout: bigtime_t) -> ssize_t;
123 pub fn port_count(port: port_id) -> ssize_t;
124 pub fn set_port_owner(port: port_id, team: team_id) -> status_t;
125
126 fn _get_port_info(port: port_id, buf: *mut port_info,
127 portInfoSize: size_t) -> status_t;
128 }
130
131pub unsafe fn get_port_info(port: port_id, buf: &mut port_info) -> status_t {
132 _get_port_info(port, buf, mem::size_of::<port_info>() as size_t)
133}
134
135#[repr(C)]
136pub enum thread_state {
137 B_THREAD_RUNNING = 1,
138 B_THREAD_READY,
139 B_THREAD_RECEIVING,
140 B_THREAD_ASLEEP,
141 B_THREAD_SUSPENDED,
142 B_THREAD_WAITING
143}
144
145#[repr(C)]
146pub struct thread_info {
147 pub thread: thread_id,
148 pub team: team_id,
149 pub name: [c_char; B_OS_NAME_LENGTH],
150 pub state: thread_state,
151 pub priority: i32,
152 pub sem: sem_id,
153 pub user_time: bigtime_t,
154 pub kernel_time: bigtime_t,
155 pub stack_base: *mut c_void,
156 pub stack_end: *mut c_void
157}
158
159pub const B_IDLE_PRIORITY: i32 = 0;
160pub const B_LOWEST_ACTIVE_PRIORITY: i32 = 1;
161pub const B_LOW_PRIORITY: i32 = 5;
162pub const B_NORMAL_PRIORITY: i32 = 10;
163pub const B_DISPLAY_PRIORITY: i32 = 15;
164pub const B_URGENT_DISPLAY_PRIORITY: i32 = 20;
165pub const B_REAL_TIME_DISPLAY_PRIORITY: i32 = 100;
166pub const B_URGENT_PRIORITY: i32 = 110;
167pub const B_REAL_TIME_PRIORITY: i32 = 120;
168
169pub const B_SYSTEM_TIMEBASE: i32 = 0;
170pub const B_FIRST_REAL_TIME_PRIORITY: i32 = B_REAL_TIME_DISPLAY_PRIORITY;
171
172extern {
173 pub fn find_thread(name: *const c_char) -> thread_id;
174 pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: size_t) -> status_t;
175 pub fn _get_next_thread_info(id: thread_id, cookie: *mut i32, info: *mut thread_info, size: size_t) -> status_t;
176}
177
178pub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t {
179 _get_thread_info(id, info, mem::size_of::<thread_info>() as size_t)
180}
181
182pub unsafe fn get_next_thread_info(id: thread_id, cookie: *mut i32, info: *mut thread_info) -> status_t {
183 _get_next_thread_info(id, cookie, info, mem::size_of::<thread_info>() as size_t)
184}
185
186pub const B_CURRENT_TEAM: team_id = 0;
187pub const B_SYSTEM_TEAM: team_id = 1;
188
189#[repr(C)]
191pub struct attr_info {
192 pub attr_type: u32,
193 pub size: off_t,
194}
195
196extern {
197 pub fn fs_read_attr(fd: c_int, attribute: *const c_char, typeCode: u32,
198 pos: off_t, buffer: *mut u8, readBytes: size_t) -> ssize_t;
199 pub fn fs_write_attr(fd: c_int, attribute: *const c_char, typeCode: u32,
200 pos: off_t, buffer: *const u8, readBytes: size_t) -> ssize_t;
201 pub fn fs_remove_attr(fd: c_int, attribute: *const c_char) -> c_int;
202 pub fn fs_stat_attr(fd: c_int, attribute: *const c_char, attrInfo: *mut attr_info) -> c_int;
203
204 pub fn fs_open_attr(path: *const c_char, attribute: *const c_char,
205 typeCode: u32, openMode: c_int) -> c_int;
206 pub fn fs_fopen_attr(fd: c_int, attribute: *const c_char, typeCode: u32,
207 openMode: c_int) -> c_int;
208 pub fn fs_close_attr(fd: c_int) -> c_int;
209
210 pub fn fs_open_attr_dir(path: *const c_char) -> *mut DIR;
211 pub fn fs_lopen_attr_dir(path: *const c_char) -> *mut DIR;
212 pub fn fs_fopen_attr_dir(fd: c_int) -> *mut DIR;
213 pub fn fs_close_attr_dir(dir: *mut DIR) -> c_int;
214 pub fn fs_read_attr_dir(dir: *mut DIR) -> *mut dirent;
215 pub fn fs_rewind_attr_dir(dir: *mut DIR);
216}
217
218pub type image_id = i32;
221#[repr(C)]
222#[derive(PartialEq)]
223pub enum image_type {
224 B_APP_IMAGE = 1,
225 B_LIBRARY_IMAGE = 2,
226 B_ADD_ON_IMAGE = 3,
227 B_SYSTEM_IMAGE = 4
228}
229
230#[repr(C)]
231pub struct image_info {
232 pub id: image_id,
233 pub image_type: image_type,
234 pub sequence: i32,
235 pub init_order: i32,
236 pub init_routine: *const c_void,
237 pub term_routine: *const c_void,
238 pub device: dev_t,
239 pub node: ino_t,
240 pub name: [c_char; PATH_MAX as usize],
241 pub text: *const c_void,
242 pub data: *const c_void,
243 pub text_size: i32,
244 pub data_size: i32,
245 pub api_version: i32,
246 pub abi: i32
247}
248
249pub const B_FLUSH_DCACHE: u32 = 0x0001;
250pub const B_FLUSH_ICACHE: u32 = 0x0004;
251pub const B_INVALIDATE_DCACHE: u32 = 0x0002;
252pub const B_INVALIDATE_ICACHE: u32 = 0x0008;
253
254pub const B_SYMBOL_TYPE_DATA: i32 = 0x1;
255pub const B_SYMBOL_TYPE_TEXT: i32 = 0x2;
256pub const B_SYMBOL_TYPE_ANY: i32 = 0x5;
257
258pub const B_INIT_BEFORE_FUNCTION_NAME: &'static str = "initialize_before";
259pub const B_INIT_AFTER_FUNCTION_NAME: &'static str = "initialize_after";
260pub const B_TERM_BEFORE_FUNCTION_NAME: &'static str = "terminate_before";
261pub const B_TERM_AFTER_FUNCTION_NAME: &'static str = "terminate_after";
262
263extern {
264 pub fn initialize_before(self_: image_id);
265 pub fn initialize_after(self_: image_id);
266 pub fn terminate_before(self_: image_id);
267 pub fn terminate_after(self_: image_id);
268}
269
270extern {
274 pub fn load_add_on(path: *const c_char) -> image_id;
276 pub fn unload_add_on(image: image_id) -> status_t;
277 pub fn clear_caches(address: *const c_void, length: size_t, flags: u32);
280 pub fn _get_image_info(image: image_id, info: *mut image_info, size: size_t) -> status_t;
281 pub fn _get_next_image_info(team: team_id, cookie: *mut i32, info: *mut image_info, size: size_t) -> status_t;
282}
283
284pub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t {
285 _get_image_info(image, info, mem::size_of::<image_info>() as size_t)
286}
287
288pub unsafe fn get_next_image_info(team: team_id, cookie: *mut i32, info: *mut image_info) -> status_t {
289 _get_next_image_info(team, cookie, info, mem::size_of::<image_info>() as size_t)
290}
291
292pub const B_AFFINE_TRANSFORM_TYPE: u32 = haiku_constant!('A','M','T','X');
294pub const B_ALIGNMENT_TYPE: u32 = haiku_constant!('A','L','G','N');
295pub const B_ANY_TYPE: u32 = haiku_constant!('A','N','Y','T');
296pub const B_ATOM_TYPE: u32 = haiku_constant!('A','T','O','M');
297pub const B_ATOM_REF_TYPE: u32 = haiku_constant!('A','T','M','R');
298pub const B_BOOL_TYPE: u32 = haiku_constant!('B','O','O','L');
299pub const B_CHAR_TYPE: u32 = haiku_constant!('C','H','A','R');
300pub const B_COLOR_8_BIT_TYPE: u32 = haiku_constant!('C','L','R','B');
301pub const B_DOUBLE_TYPE: u32 = haiku_constant!('D','B','L','E');
302pub const B_FLOAT_TYPE: u32 = haiku_constant!('F','L','O','T');
303pub const B_GRAYSCALE_8_BIT_TYPE: u32 = haiku_constant!('G','R','Y','B');
304pub const B_INT16_TYPE: u32 = haiku_constant!('S','H','R','T');
305pub const B_INT32_TYPE: u32 = haiku_constant!('L','O','N','G');
306pub const B_INT64_TYPE: u32 = haiku_constant!('L','L','N','G');
307pub const B_INT8_TYPE: u32 = haiku_constant!('B','Y','T','E');
308pub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I','C','O','N');
309pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B','M','C','G');
310pub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B','M','C','T');
311pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B','M','C','W');
312pub const B_MESSAGE_TYPE: u32 = haiku_constant!('M','S','G','G');
313pub const B_MESSENGER_TYPE: u32 = haiku_constant!('M','S','N','G');
314pub const B_MIME_TYPE: u32 = haiku_constant!('M','I','M','E');
315pub const B_MINI_ICON_TYPE: u32 = haiku_constant!('M','I','C','N');
316pub const B_MONOCHROME_1_BIT_TYPE: u32 = haiku_constant!('M','N','O','B');
317pub const B_OBJECT_TYPE: u32 = haiku_constant!('O','P','T','R');
318pub const B_OFF_T_TYPE: u32 = haiku_constant!('O','F','F','T');
319pub const B_PATTERN_TYPE: u32 = haiku_constant!('P','A','T','N');
320pub const B_POINTER_TYPE: u32 = haiku_constant!('P','N','T','R');
321pub const B_POINT_TYPE: u32 = haiku_constant!('B','P','N','T');
322pub const B_PROPERTY_INFO_TYPE: u32 = haiku_constant!('S','C','T','D');
323pub const B_RAW_TYPE: u32 = haiku_constant!('R','A','W','T');
324pub const B_RECT_TYPE: u32 = haiku_constant!('R','E','C','T');
325pub const B_REF_TYPE: u32 = haiku_constant!('R','R','E','F');
326pub const B_RGB_32_BIT_TYPE: u32 = haiku_constant!('R','G','B','B');
327pub const B_RGB_COLOR_TYPE: u32 = haiku_constant!('R','G','B','C');
328pub const B_SIZE_TYPE: u32 = haiku_constant!('S','I','Z','E');
329pub const B_SIZE_T_TYPE: u32 = haiku_constant!('S','I','Z','T');
330pub const B_SSIZE_T_TYPE: u32 = haiku_constant!('S','S','Z','T');
331pub const B_STRING_TYPE: u32 = haiku_constant!('C','S','T','R');
332pub const B_STRING_LIST_TYPE: u32 = haiku_constant!('S','T','R','L');
333pub const B_TIME_TYPE: u32 = haiku_constant!('T','I','M','E');
334pub const B_UINT16_TYPE: u32 = haiku_constant!('U','S','H','T');
335pub const B_UINT32_TYPE: u32 = haiku_constant!('U','L','N','G');
336pub const B_UINT64_TYPE: u32 = haiku_constant!('U','L','L','G');
337pub const B_UINT8_TYPE: u32 = haiku_constant!('U','B','Y','T');
338pub const B_VECTOR_ICON_TYPE: u32 = haiku_constant!('V','I','C','N');
339pub const B_XATTR_TYPE: u32 = haiku_constant!('X','A','T','R');
340pub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N','W','A','D');
341pub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M','I','M','S');
342
343pub type type_code = u32;
345
346pub const B_DEV_NAME_LENGTH: usize = 128;
348pub const B_FILE_NAME_LENGTH: usize = FILENAME_MAX as usize;
349pub const B_PATH_NAME_LENGTH: usize = PATH_MAX as usize;
350pub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1;
351pub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15;
352pub mod errors {
357 use std;
358 use libc::{EOVERFLOW, E2BIG, EFBIG, ERANGE, ENODEV, EOPNOTSUPP};
359 use ::status_t;
360
361 pub const B_GENERAL_ERROR_BASE: status_t = std::i32::MIN;
362 pub const B_OS_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x1000;
363 pub const B_APP_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x2000;
364 pub const B_INTERFACE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x3000;
365 pub const B_MEDIA_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4000;
366 pub const B_TRANSLATION_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4800;
367 pub const B_MIDI_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x5000;
368 pub const B_STORAGE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x6000;
369 pub const B_POSIX_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x7000;
370 pub const B_MAIL_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x8000;
371 pub const B_PRINT_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x9000;
372 pub const B_DEVICE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0xa000;
373 pub const B_ERRORS_END: status_t = B_GENERAL_ERROR_BASE + 0xffff;
374
375 pub const B_NO_MEMORY: status_t = B_GENERAL_ERROR_BASE + 0;
377 pub const B_IO_ERROR: status_t = B_GENERAL_ERROR_BASE + 1;
378 pub const B_PERMISSION_DENIED: status_t = B_GENERAL_ERROR_BASE + 2;
379 pub const B_BAD_INDEX: status_t = B_GENERAL_ERROR_BASE + 3;
380 pub const B_BAD_TYPE: status_t = B_GENERAL_ERROR_BASE + 4;
381 pub const B_BAD_VALUE: status_t = B_GENERAL_ERROR_BASE + 5;
382 pub const B_MISMATCHED_VALUES: status_t = B_GENERAL_ERROR_BASE + 6;
383 pub const B_NAME_NOT_FOUND: status_t = B_GENERAL_ERROR_BASE + 7;
384 pub const B_NAME_IN_USE: status_t = B_GENERAL_ERROR_BASE + 8;
385 pub const B_TIMED_OUT: status_t = B_GENERAL_ERROR_BASE + 9;
386 pub const B_INTERRUPTED: status_t = B_GENERAL_ERROR_BASE + 10;
387 pub const B_WOULD_BLOCK: status_t = B_GENERAL_ERROR_BASE + 11;
388 pub const B_CANCELED: status_t = B_GENERAL_ERROR_BASE + 12;
389 pub const B_NO_INIT: status_t = B_GENERAL_ERROR_BASE + 13;
390 pub const B_NOT_INITIALIZED: status_t = B_GENERAL_ERROR_BASE + 13;
391 pub const B_BUSY: status_t = B_GENERAL_ERROR_BASE + 14;
392 pub const B_NOT_ALLOWED: status_t = B_GENERAL_ERROR_BASE + 15;
393 pub const B_BAD_DATA: status_t = B_GENERAL_ERROR_BASE + 16;
394 pub const B_DONT_DO_THAT: status_t = B_GENERAL_ERROR_BASE + 17;
395
396 pub const B_ERROR: status_t = -1;
397 pub const B_OK: status_t = 0;
398 pub const B_NO_ERROR: status_t = 0;
399
400 pub const B_BAD_SEM_ID: status_t = B_OS_ERROR_BASE + 0;
402 pub const B_NO_MORE_SEMS: status_t = B_OS_ERROR_BASE + 1;
403
404 pub const B_BAD_THREAD_ID: status_t = B_OS_ERROR_BASE + 0x100;
405 pub const B_NO_MORE_THREADS: status_t = B_OS_ERROR_BASE + 0x101;
406 pub const B_BAD_THREAD_STATE: status_t = B_OS_ERROR_BASE + 0x012;
407 pub const B_BAD_TEAM_ID: status_t = B_OS_ERROR_BASE + 0x103;
408 pub const B_NO_MORE_TEAMS: status_t = B_OS_ERROR_BASE + 0x104;
409
410 pub const B_BAD_PORT_ID: status_t = B_OS_ERROR_BASE + 0x200;
411 pub const B_NO_MORE_PORTS: status_t = B_OS_ERROR_BASE + 0x201;
412
413 pub const B_BAD_IMAGE_ID: status_t = B_OS_ERROR_BASE + 0x300;
414 pub const B_BAD_ADDRESS: status_t = B_OS_ERROR_BASE + 0x301;
415 pub const B_NOT_AN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x302;
416 pub const B_MISSING_LIBRARY: status_t = B_OS_ERROR_BASE + 0x303;
417 pub const B_MISSING_SYMBOL: status_t = B_OS_ERROR_BASE + 0x304;
418 pub const B_UNKNOWN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x305;
419 pub const B_LEGACY_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x306;
420
421 pub const B_DEBUGGER_ALREADY_INSTALLED: status_t = B_OS_ERROR_BASE + 0x400;
422
423 pub const B_BAD_REPLY: status_t = B_APP_ERROR_BASE + 0;
425 pub const B_DUPLICATE_REPLY: status_t = B_APP_ERROR_BASE + 1;
426 pub const B_MESSAGE_TO_SELF: status_t = B_APP_ERROR_BASE + 2;
427 pub const B_BAD_HANDLER: status_t = B_APP_ERROR_BASE + 3;
428 pub const B_ALREADY_RUNNING: status_t = B_APP_ERROR_BASE + 4;
429 pub const B_LAUNCH_FAILED: status_t = B_APP_ERROR_BASE + 5;
430 pub const B_AMBIGUOUS_APP_LAUNCH: status_t = B_APP_ERROR_BASE + 6;
431 pub const B_UNKNOWN_MIME_TYPE: status_t = B_APP_ERROR_BASE + 7;
432 pub const B_BAD_SCRIPT_SYNTAX: status_t = B_APP_ERROR_BASE + 8;
433 pub const B_LAUNCH_FAILED_NO_RESOLVE_LINK: status_t = B_APP_ERROR_BASE + 9;
434 pub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10;
435 pub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11;
436 pub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12;
437 pub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13;
438 pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14;
439 pub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15;
440 pub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16;
441 pub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17;
442 pub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18;
443
444 pub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0;
446 pub const B_FILE_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 1;
447 pub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2;
448 pub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3;
449 pub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4;
450 pub const B_NOT_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 5;
451 pub const B_DIRECTORY_NOT_EMPTY: status_t = B_STORAGE_ERROR_BASE + 6;
452 pub const B_DEVICE_FULL: status_t = B_STORAGE_ERROR_BASE + 7;
453 pub const B_READ_ONLY_DEVICE: status_t = B_STORAGE_ERROR_BASE + 8;
454 pub const B_IS_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 9;
455 pub const B_NO_MORE_FDS: status_t = B_STORAGE_ERROR_BASE + 10;
456 pub const B_CROSS_DEVICE_LINK: status_t = B_STORAGE_ERROR_BASE + 11;
457 pub const B_LINK_LIMIT: status_t = B_STORAGE_ERROR_BASE + 12;
458 pub const B_BUSTED_PIPE: status_t = B_STORAGE_ERROR_BASE + 13;
459 pub const B_UNSUPPORTED: status_t = B_STORAGE_ERROR_BASE + 14;
460 pub const B_PARTITION_TOO_SMALL: status_t = B_STORAGE_ERROR_BASE + 15;
461 pub const B_PARTIAL_READ: status_t = B_STORAGE_ERROR_BASE + 16;
462 pub const B_PARTIAL_WRITE: status_t = B_STORAGE_ERROR_BASE + 17;
463
464 pub const B_BUFFER_OVERFLOW: status_t = EOVERFLOW;
466 pub const B_TOO_MANY_ARGS: status_t = E2BIG;
467 pub const B_FILE_TOO_LARGE: status_t = EFBIG;
468 pub const B_RESULT_NOT_REPRESENTABLE: status_t = ERANGE;
469 pub const B_DEVICE_NOT_FOUND: status_t = ENODEV;
470 pub const B_NOT_SUPPORTED: status_t = EOPNOTSUPP;
471
472 pub const B_STREAM_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 0;
474 pub const B_SERVER_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 1;
475 pub const B_RESOURCE_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 2;
476 pub const B_RESOURCE_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 3;
477 pub const B_BAD_SUBSCRIBER: status_t = B_MEDIA_ERROR_BASE + 4;
478 pub const B_SUBSCRIBER_NOT_ENTERED: status_t = B_MEDIA_ERROR_BASE + 5;
479 pub const B_BUFFER_NOT_AVAILABLE: status_t = B_MEDIA_ERROR_BASE + 6;
480 pub const B_LAST_BUFFER_ERROR: status_t = B_MEDIA_ERROR_BASE + 7;
481
482 pub const B_MEDIA_SYSTEM_FAILURE: status_t = B_MEDIA_ERROR_BASE + 100;
483 pub const B_MEDIA_BAD_NODE: status_t = B_MEDIA_ERROR_BASE + 101;
484 pub const B_MEDIA_NODE_BUSY: status_t = B_MEDIA_ERROR_BASE + 102;
485 pub const B_MEDIA_BAD_FORMAT: status_t = B_MEDIA_ERROR_BASE + 103;
486 pub const B_MEDIA_BAD_BUFFER: status_t = B_MEDIA_ERROR_BASE + 104;
487 pub const B_MEDIA_TOO_MANY_NODES: status_t = B_MEDIA_ERROR_BASE + 105;
488 pub const B_MEDIA_TOO_MANY_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 106;
489 pub const B_MEDIA_NODE_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 107;
490 pub const B_MEDIA_BUFFER_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 108;
491 pub const B_MEDIA_CANNOT_SEEK: status_t = B_MEDIA_ERROR_BASE + 109;
492 pub const B_MEDIA_CANNOT_CHANGE_RUN_MODE: status_t = B_MEDIA_ERROR_BASE + 110;
493 pub const B_MEDIA_APP_ALREADY_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 111;
494 pub const B_MEDIA_APP_NOT_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 112;
495 pub const B_MEDIA_CANNOT_RECLAIM_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 113;
496 pub const B_MEDIA_BUFFERS_NOT_RECLAIMED: status_t = B_MEDIA_ERROR_BASE + 114;
497 pub const B_MEDIA_TIME_SOURCE_STOPPED: status_t = B_MEDIA_ERROR_BASE + 115;
498 pub const B_MEDIA_TIME_SOURCE_BUSY: status_t = B_MEDIA_ERROR_BASE + 116;
499 pub const B_MEDIA_BAD_SOURCE: status_t = B_MEDIA_ERROR_BASE + 117;
500 pub const B_MEDIA_BAD_DESTINATION: status_t = B_MEDIA_ERROR_BASE + 118;
501 pub const B_MEDIA_ALREADY_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 119;
502 pub const B_MEDIA_NOT_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 120;
503 pub const B_MEDIA_BAD_CLIP_FORMAT: status_t = B_MEDIA_ERROR_BASE + 121;
504 pub const B_MEDIA_ADDON_FAILED: status_t = B_MEDIA_ERROR_BASE + 122;
505 pub const B_MEDIA_ADDON_DISABLED: status_t = B_MEDIA_ERROR_BASE + 123;
506 pub const B_MEDIA_CHANGE_IN_PROGRESS: status_t = B_MEDIA_ERROR_BASE + 124;
507 pub const B_MEDIA_STALE_CHANGE_COUNT: status_t = B_MEDIA_ERROR_BASE + 125;
508 pub const B_MEDIA_ADDON_RESTRICTED: status_t = B_MEDIA_ERROR_BASE + 126;
509 pub const B_MEDIA_NO_HANDLER: status_t = B_MEDIA_ERROR_BASE + 127;
510 pub const B_MEDIA_DUPLICATE_FORMAT: status_t = B_MEDIA_ERROR_BASE + 128;
511 pub const B_MEDIA_REALTIME_DISABLED: status_t = B_MEDIA_ERROR_BASE + 129;
512 pub const B_MEDIA_REALTIME_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 130;
513
514 pub const B_MAIL_NO_DAEMON: status_t = B_MAIL_ERROR_BASE + 0;
516 pub const B_MAIL_UNKNOWN_USER: status_t = B_MAIL_ERROR_BASE + 1;
517 pub const B_MAIL_WRONG_PASSWORD: status_t = B_MAIL_ERROR_BASE + 2;
518 pub const B_MAIL_UNKNOWN_HOST: status_t = B_MAIL_ERROR_BASE + 3;
519 pub const B_MAIL_ACCESS_ERROR: status_t = B_MAIL_ERROR_BASE + 4;
520 pub const B_MAIL_UNKNOWN_FIELD: status_t = B_MAIL_ERROR_BASE + 5;
521 pub const B_MAIL_NO_RECIPIENT: status_t = B_MAIL_ERROR_BASE + 6;
522 pub const B_MAIL_INVALID_MAIL: status_t = B_MAIL_ERROR_BASE + 7;
523
524 pub const B_NO_PRINT_SERVER: status_t = B_PRINT_ERROR_BASE + 0;
526
527 pub const B_DEV_INVALID_IOCTL: status_t = B_DEVICE_ERROR_BASE + 0;
529 pub const B_DEV_NO_MEMORY: status_t = B_DEVICE_ERROR_BASE + 1;
530 pub const B_DEV_BAD_DRIVE_NUM: status_t = B_DEVICE_ERROR_BASE + 2;
531 pub const B_DEV_NO_MEDIA: status_t = B_DEVICE_ERROR_BASE + 3;
532 pub const B_DEV_UNREADABLE: status_t = B_DEVICE_ERROR_BASE + 4;
533 pub const B_DEV_FORMAT_ERROR: status_t = B_DEVICE_ERROR_BASE + 5;
534 pub const B_DEV_TIMEOUT: status_t = B_DEVICE_ERROR_BASE + 6;
535 pub const B_DEV_RECALIBRATE_ERROR: status_t = B_DEVICE_ERROR_BASE + 7;
536 pub const B_DEV_SEEK_ERROR: status_t = B_DEVICE_ERROR_BASE + 8;
537 pub const B_DEV_ID_ERROR: status_t = B_DEVICE_ERROR_BASE + 9;
538 pub const B_DEV_READ_ERROR: status_t = B_DEVICE_ERROR_BASE + 10;
539 pub const B_DEV_WRITE_ERROR: status_t = B_DEVICE_ERROR_BASE + 11;
540 pub const B_DEV_NOT_READY: status_t = B_DEVICE_ERROR_BASE + 12;
541 pub const B_DEV_MEDIA_CHANGED: status_t = B_DEVICE_ERROR_BASE + 13;
542 pub const B_DEV_MEDIA_CHANGE_REQUESTED: status_t = B_DEVICE_ERROR_BASE + 14;
543 pub const B_DEV_RESOURCE_CONFLICT: status_t = B_DEVICE_ERROR_BASE + 15;
544 pub const B_DEV_CONFIGURATION_ERROR: status_t = B_DEVICE_ERROR_BASE + 16;
545 pub const B_DEV_DISABLED_BY_USER: status_t = B_DEVICE_ERROR_BASE + 17;
546 pub const B_DEV_DOOR_OPEN: status_t = B_DEVICE_ERROR_BASE + 18;
547
548 pub const B_DEV_INVALID_PIPE: status_t = B_DEVICE_ERROR_BASE + 19;
549 pub const B_DEV_CRC_ERROR: status_t = B_DEVICE_ERROR_BASE + 20;
550 pub const B_DEV_STALLED: status_t = B_DEVICE_ERROR_BASE + 21;
551 pub const B_DEV_BAD_PID: status_t = B_DEVICE_ERROR_BASE + 22;
552 pub const B_DEV_UNEXPECTED_PID: status_t = B_DEVICE_ERROR_BASE + 23;
553 pub const B_DEV_DATA_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 24;
554 pub const B_DEV_DATA_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 25;
555 pub const B_DEV_FIFO_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 26;
556 pub const B_DEV_FIFO_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 27;
557 pub const B_DEV_PENDING: status_t = B_DEVICE_ERROR_BASE + 28;
558 pub const B_DEV_MULTIPLE_ERRORS: status_t = B_DEVICE_ERROR_BASE + 29;
559 pub const B_DEV_TOO_LATE: status_t = B_DEVICE_ERROR_BASE + 30;
560
561 pub const B_TRANSLATION_BASE_ERROR: status_t = B_TRANSLATION_ERROR_BASE + 0;
563 pub const B_NO_TRANSLATOR: status_t = B_TRANSLATION_ERROR_BASE + 1;
564 pub const B_ILLEGAL_DATA: status_t = B_TRANSLATION_ERROR_BASE + 2;
565}
566