12add0d91Sopenharmony_ci// This module contains bindings to the native Haiku API. The Haiku API
22add0d91Sopenharmony_ci// originates from BeOS, and it was the original way to perform low level
32add0d91Sopenharmony_ci// system and IO operations. The POSIX API was in that era was like a
42add0d91Sopenharmony_ci// compatibility layer. In current Haiku development, both the POSIX API and
52add0d91Sopenharmony_ci// the Haiku API are considered to be co-equal status. However, they are not
62add0d91Sopenharmony_ci// integrated like they are on other UNIX platforms, which means that for many
72add0d91Sopenharmony_ci// low level concepts there are two versions, like processes (POSIX) and
82add0d91Sopenharmony_ci// teams (Haiku), or pthreads and native threads.
92add0d91Sopenharmony_ci//
102add0d91Sopenharmony_ci// Both the POSIX API and the Haiku API live in libroot.so, the library that is
112add0d91Sopenharmony_ci// linked to any binary by default.
122add0d91Sopenharmony_ci//
132add0d91Sopenharmony_ci// This file follows the Haiku API for Haiku R1 beta 2. It is organized by the
142add0d91Sopenharmony_ci// C/C++ header files in which the concepts can be found, while adhering to the
152add0d91Sopenharmony_ci// style guide for this crate.
162add0d91Sopenharmony_ci
172add0d91Sopenharmony_ci// Helper macro to generate u32 constants. The Haiku API uses (non-standard)
182add0d91Sopenharmony_ci// multi-character constants (like 'UPDA' or 'MSGM') to represent 32 bit
192add0d91Sopenharmony_ci// integer constants.
202add0d91Sopenharmony_ci
212add0d91Sopenharmony_cimacro_rules! haiku_constant {
222add0d91Sopenharmony_ci    ($a:tt, $b:tt, $c:tt, $d:tt) => {
232add0d91Sopenharmony_ci        (($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32)
242add0d91Sopenharmony_ci    };
252add0d91Sopenharmony_ci}
262add0d91Sopenharmony_ci
272add0d91Sopenharmony_ci// support/SupportDefs.h
282add0d91Sopenharmony_cipub type status_t = i32;
292add0d91Sopenharmony_cipub type bigtime_t = i64;
302add0d91Sopenharmony_cipub type nanotime_t = i64;
312add0d91Sopenharmony_cipub type type_code = u32;
322add0d91Sopenharmony_cipub type perform_code = u32;
332add0d91Sopenharmony_ci
342add0d91Sopenharmony_ci// kernel/OS.h
352add0d91Sopenharmony_cipub type area_id = i32;
362add0d91Sopenharmony_cipub type port_id = i32;
372add0d91Sopenharmony_cipub type sem_id = i32;
382add0d91Sopenharmony_cipub type team_id = i32;
392add0d91Sopenharmony_cipub type thread_id = i32;
402add0d91Sopenharmony_ci
412add0d91Sopenharmony_cipub type thread_func = extern "C" fn(*mut ::c_void) -> status_t;
422add0d91Sopenharmony_ci
432add0d91Sopenharmony_ci// kernel/image.h
442add0d91Sopenharmony_cipub type image_id = i32;
452add0d91Sopenharmony_ci
462add0d91Sopenharmony_cie! {
472add0d91Sopenharmony_ci    // kernel/OS.h
482add0d91Sopenharmony_ci    pub enum thread_state {
492add0d91Sopenharmony_ci        B_THREAD_RUNNING = 1,
502add0d91Sopenharmony_ci        B_THREAD_READY,
512add0d91Sopenharmony_ci        B_THREAD_RECEIVING,
522add0d91Sopenharmony_ci        B_THREAD_ASLEEP,
532add0d91Sopenharmony_ci        B_THREAD_SUSPENDED,
542add0d91Sopenharmony_ci        B_THREAD_WAITING
552add0d91Sopenharmony_ci    }
562add0d91Sopenharmony_ci
572add0d91Sopenharmony_ci    // kernel/image.h
582add0d91Sopenharmony_ci    pub enum image_type {
592add0d91Sopenharmony_ci        B_APP_IMAGE = 1,
602add0d91Sopenharmony_ci        B_LIBRARY_IMAGE,
612add0d91Sopenharmony_ci        B_ADD_ON_IMAGE,
622add0d91Sopenharmony_ci        B_SYSTEM_IMAGE
632add0d91Sopenharmony_ci    }
642add0d91Sopenharmony_ci
652add0d91Sopenharmony_ci    // kernel/scheduler.h
662add0d91Sopenharmony_ci
672add0d91Sopenharmony_ci    pub enum be_task_flags {
682add0d91Sopenharmony_ci        B_DEFAULT_MEDIA_PRIORITY = 0x000,
692add0d91Sopenharmony_ci        B_OFFLINE_PROCESSING = 0x001,
702add0d91Sopenharmony_ci        B_STATUS_RENDERING = 0x002,
712add0d91Sopenharmony_ci        B_USER_INPUT_HANDLING = 0x004,
722add0d91Sopenharmony_ci        B_LIVE_VIDEO_MANIPULATION = 0x008,
732add0d91Sopenharmony_ci        B_VIDEO_PLAYBACK = 0x010,
742add0d91Sopenharmony_ci        B_VIDEO_RECORDING = 0x020,
752add0d91Sopenharmony_ci        B_LIVE_AUDIO_MANIPULATION = 0x040,
762add0d91Sopenharmony_ci        B_AUDIO_PLAYBACK = 0x080,
772add0d91Sopenharmony_ci        B_AUDIO_RECORDING = 0x100,
782add0d91Sopenharmony_ci        B_LIVE_3D_RENDERING = 0x200,
792add0d91Sopenharmony_ci        B_NUMBER_CRUNCHING = 0x400,
802add0d91Sopenharmony_ci        B_MIDI_PROCESSING = 0x800,
812add0d91Sopenharmony_ci    }
822add0d91Sopenharmony_ci
832add0d91Sopenharmony_ci    pub enum schduler_mode {
842add0d91Sopenharmony_ci        SCHEDULER_MODE_LOW_LATENCY,
852add0d91Sopenharmony_ci        SCHEDULER_MODE_POWER_SAVING,
862add0d91Sopenharmony_ci    }
872add0d91Sopenharmony_ci
882add0d91Sopenharmony_ci    // FindDirectory.h
892add0d91Sopenharmony_ci    pub enum path_base_directory {
902add0d91Sopenharmony_ci        B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY,
912add0d91Sopenharmony_ci        B_FIND_PATH_ADD_ONS_DIRECTORY,
922add0d91Sopenharmony_ci        B_FIND_PATH_APPS_DIRECTORY,
932add0d91Sopenharmony_ci        B_FIND_PATH_BIN_DIRECTORY,
942add0d91Sopenharmony_ci        B_FIND_PATH_BOOT_DIRECTORY,
952add0d91Sopenharmony_ci        B_FIND_PATH_CACHE_DIRECTORY,
962add0d91Sopenharmony_ci        B_FIND_PATH_DATA_DIRECTORY,
972add0d91Sopenharmony_ci        B_FIND_PATH_DEVELOP_DIRECTORY,
982add0d91Sopenharmony_ci        B_FIND_PATH_DEVELOP_LIB_DIRECTORY,
992add0d91Sopenharmony_ci        B_FIND_PATH_DOCUMENTATION_DIRECTORY,
1002add0d91Sopenharmony_ci        B_FIND_PATH_ETC_DIRECTORY,
1012add0d91Sopenharmony_ci        B_FIND_PATH_FONTS_DIRECTORY,
1022add0d91Sopenharmony_ci        B_FIND_PATH_HEADERS_DIRECTORY,
1032add0d91Sopenharmony_ci        B_FIND_PATH_LIB_DIRECTORY,
1042add0d91Sopenharmony_ci        B_FIND_PATH_LOG_DIRECTORY,
1052add0d91Sopenharmony_ci        B_FIND_PATH_MEDIA_NODES_DIRECTORY,
1062add0d91Sopenharmony_ci        B_FIND_PATH_PACKAGES_DIRECTORY,
1072add0d91Sopenharmony_ci        B_FIND_PATH_PREFERENCES_DIRECTORY,
1082add0d91Sopenharmony_ci        B_FIND_PATH_SERVERS_DIRECTORY,
1092add0d91Sopenharmony_ci        B_FIND_PATH_SETTINGS_DIRECTORY,
1102add0d91Sopenharmony_ci        B_FIND_PATH_SOUNDS_DIRECTORY,
1112add0d91Sopenharmony_ci        B_FIND_PATH_SPOOL_DIRECTORY,
1122add0d91Sopenharmony_ci        B_FIND_PATH_TRANSLATORS_DIRECTORY,
1132add0d91Sopenharmony_ci        B_FIND_PATH_VAR_DIRECTORY,
1142add0d91Sopenharmony_ci        B_FIND_PATH_IMAGE_PATH = 1000,
1152add0d91Sopenharmony_ci        B_FIND_PATH_PACKAGE_PATH,
1162add0d91Sopenharmony_ci    }
1172add0d91Sopenharmony_ci
1182add0d91Sopenharmony_ci    pub enum directory_which {
1192add0d91Sopenharmony_ci        B_DESKTOP_DIRECTORY = 0,
1202add0d91Sopenharmony_ci        B_TRASH_DIRECTORY,
1212add0d91Sopenharmony_ci        B_SYSTEM_DIRECTORY = 1000,
1222add0d91Sopenharmony_ci        B_SYSTEM_ADDONS_DIRECTORY = 1002,
1232add0d91Sopenharmony_ci        B_SYSTEM_BOOT_DIRECTORY,
1242add0d91Sopenharmony_ci        B_SYSTEM_FONTS_DIRECTORY,
1252add0d91Sopenharmony_ci        B_SYSTEM_LIB_DIRECTORY,
1262add0d91Sopenharmony_ci        B_SYSTEM_SERVERS_DIRECTORY,
1272add0d91Sopenharmony_ci        B_SYSTEM_APPS_DIRECTORY,
1282add0d91Sopenharmony_ci        B_SYSTEM_BIN_DIRECTORY,
1292add0d91Sopenharmony_ci        B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010,
1302add0d91Sopenharmony_ci        B_SYSTEM_PREFERENCES_DIRECTORY,
1312add0d91Sopenharmony_ci        B_SYSTEM_TRANSLATORS_DIRECTORY,
1322add0d91Sopenharmony_ci        B_SYSTEM_MEDIA_NODES_DIRECTORY,
1332add0d91Sopenharmony_ci        B_SYSTEM_SOUNDS_DIRECTORY,
1342add0d91Sopenharmony_ci        B_SYSTEM_DATA_DIRECTORY,
1352add0d91Sopenharmony_ci        B_SYSTEM_DEVELOP_DIRECTORY,
1362add0d91Sopenharmony_ci        B_SYSTEM_PACKAGES_DIRECTORY,
1372add0d91Sopenharmony_ci        B_SYSTEM_HEADERS_DIRECTORY,
1382add0d91Sopenharmony_ci        B_SYSTEM_ETC_DIRECTORY = 2008,
1392add0d91Sopenharmony_ci        B_SYSTEM_SETTINGS_DIRECTORY = 2010,
1402add0d91Sopenharmony_ci        B_SYSTEM_LOG_DIRECTORY = 2012,
1412add0d91Sopenharmony_ci        B_SYSTEM_SPOOL_DIRECTORY,
1422add0d91Sopenharmony_ci        B_SYSTEM_TEMP_DIRECTORY,
1432add0d91Sopenharmony_ci        B_SYSTEM_VAR_DIRECTORY,
1442add0d91Sopenharmony_ci        B_SYSTEM_CACHE_DIRECTORY = 2020,
1452add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_DIRECTORY = 2023,
1462add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
1472add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY,
1482add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_MEDIA_NODES_DIRECTORY,
1492add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_BIN_DIRECTORY,
1502add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
1512add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY,
1522add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_SOUNDS_DIRECTORY,
1532add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_DOCUMENTATION_DIRECTORY,
1542add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_LIB_DIRECTORY,
1552add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_HEADERS_DIRECTORY,
1562add0d91Sopenharmony_ci        B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY,
1572add0d91Sopenharmony_ci        B_USER_DIRECTORY = 3000,
1582add0d91Sopenharmony_ci        B_USER_CONFIG_DIRECTORY,
1592add0d91Sopenharmony_ci        B_USER_ADDONS_DIRECTORY,
1602add0d91Sopenharmony_ci        B_USER_BOOT_DIRECTORY,
1612add0d91Sopenharmony_ci        B_USER_FONTS_DIRECTORY,
1622add0d91Sopenharmony_ci        B_USER_LIB_DIRECTORY,
1632add0d91Sopenharmony_ci        B_USER_SETTINGS_DIRECTORY,
1642add0d91Sopenharmony_ci        B_USER_DESKBAR_DIRECTORY,
1652add0d91Sopenharmony_ci        B_USER_PRINTERS_DIRECTORY,
1662add0d91Sopenharmony_ci        B_USER_TRANSLATORS_DIRECTORY,
1672add0d91Sopenharmony_ci        B_USER_MEDIA_NODES_DIRECTORY,
1682add0d91Sopenharmony_ci        B_USER_SOUNDS_DIRECTORY,
1692add0d91Sopenharmony_ci        B_USER_DATA_DIRECTORY,
1702add0d91Sopenharmony_ci        B_USER_CACHE_DIRECTORY,
1712add0d91Sopenharmony_ci        B_USER_PACKAGES_DIRECTORY,
1722add0d91Sopenharmony_ci        B_USER_HEADERS_DIRECTORY,
1732add0d91Sopenharmony_ci        B_USER_NONPACKAGED_DIRECTORY,
1742add0d91Sopenharmony_ci        B_USER_NONPACKAGED_ADDONS_DIRECTORY,
1752add0d91Sopenharmony_ci        B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY,
1762add0d91Sopenharmony_ci        B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY,
1772add0d91Sopenharmony_ci        B_USER_NONPACKAGED_BIN_DIRECTORY,
1782add0d91Sopenharmony_ci        B_USER_NONPACKAGED_DATA_DIRECTORY,
1792add0d91Sopenharmony_ci        B_USER_NONPACKAGED_FONTS_DIRECTORY,
1802add0d91Sopenharmony_ci        B_USER_NONPACKAGED_SOUNDS_DIRECTORY,
1812add0d91Sopenharmony_ci        B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY,
1822add0d91Sopenharmony_ci        B_USER_NONPACKAGED_LIB_DIRECTORY,
1832add0d91Sopenharmony_ci        B_USER_NONPACKAGED_HEADERS_DIRECTORY,
1842add0d91Sopenharmony_ci        B_USER_NONPACKAGED_DEVELOP_DIRECTORY,
1852add0d91Sopenharmony_ci        B_USER_DEVELOP_DIRECTORY,
1862add0d91Sopenharmony_ci        B_USER_DOCUMENTATION_DIRECTORY,
1872add0d91Sopenharmony_ci        B_USER_SERVERS_DIRECTORY,
1882add0d91Sopenharmony_ci        B_USER_APPS_DIRECTORY,
1892add0d91Sopenharmony_ci        B_USER_BIN_DIRECTORY,
1902add0d91Sopenharmony_ci        B_USER_PREFERENCES_DIRECTORY,
1912add0d91Sopenharmony_ci        B_USER_ETC_DIRECTORY,
1922add0d91Sopenharmony_ci        B_USER_LOG_DIRECTORY,
1932add0d91Sopenharmony_ci        B_USER_SPOOL_DIRECTORY,
1942add0d91Sopenharmony_ci        B_USER_VAR_DIRECTORY,
1952add0d91Sopenharmony_ci        B_APPS_DIRECTORY = 4000,
1962add0d91Sopenharmony_ci        B_PREFERENCES_DIRECTORY,
1972add0d91Sopenharmony_ci        B_UTILITIES_DIRECTORY,
1982add0d91Sopenharmony_ci        B_PACKAGE_LINKS_DIRECTORY,
1992add0d91Sopenharmony_ci    }
2002add0d91Sopenharmony_ci}
2012add0d91Sopenharmony_ci
2022add0d91Sopenharmony_cis! {
2032add0d91Sopenharmony_ci    // kernel/OS.h
2042add0d91Sopenharmony_ci    pub struct area_info {
2052add0d91Sopenharmony_ci        pub area: area_id,
2062add0d91Sopenharmony_ci        pub name: [::c_char; B_OS_NAME_LENGTH],
2072add0d91Sopenharmony_ci        pub size: usize,
2082add0d91Sopenharmony_ci        pub lock: u32,
2092add0d91Sopenharmony_ci        pub protection: u32,
2102add0d91Sopenharmony_ci        pub team: team_id,
2112add0d91Sopenharmony_ci        pub ram_size: u32,
2122add0d91Sopenharmony_ci        pub copy_count: u32,
2132add0d91Sopenharmony_ci        pub in_count: u32,
2142add0d91Sopenharmony_ci        pub out_count: u32,
2152add0d91Sopenharmony_ci        pub address: *mut ::c_void
2162add0d91Sopenharmony_ci    }
2172add0d91Sopenharmony_ci
2182add0d91Sopenharmony_ci    pub struct port_info {
2192add0d91Sopenharmony_ci        pub port: port_id,
2202add0d91Sopenharmony_ci        pub team: team_id,
2212add0d91Sopenharmony_ci        pub name: [::c_char; B_OS_NAME_LENGTH],
2222add0d91Sopenharmony_ci        pub capacity: i32,
2232add0d91Sopenharmony_ci        pub queue_count: i32,
2242add0d91Sopenharmony_ci        pub total_count: i32,
2252add0d91Sopenharmony_ci    }
2262add0d91Sopenharmony_ci
2272add0d91Sopenharmony_ci    pub struct port_message_info {
2282add0d91Sopenharmony_ci        pub size: ::size_t,
2292add0d91Sopenharmony_ci        pub sender: ::uid_t,
2302add0d91Sopenharmony_ci        pub sender_group: ::gid_t,
2312add0d91Sopenharmony_ci        pub sender_team: ::team_id
2322add0d91Sopenharmony_ci    }
2332add0d91Sopenharmony_ci
2342add0d91Sopenharmony_ci    pub struct team_info {
2352add0d91Sopenharmony_ci        pub team: team_id,
2362add0d91Sopenharmony_ci        pub thread_count: i32,
2372add0d91Sopenharmony_ci        pub image_count: i32,
2382add0d91Sopenharmony_ci        pub area_count: i32,
2392add0d91Sopenharmony_ci        pub debugger_nub_thread: thread_id,
2402add0d91Sopenharmony_ci        pub debugger_nub_port: port_id,
2412add0d91Sopenharmony_ci        pub argc: i32,
2422add0d91Sopenharmony_ci        pub args: [::c_char; 64],
2432add0d91Sopenharmony_ci        pub uid: ::uid_t,
2442add0d91Sopenharmony_ci        pub gid: ::gid_t
2452add0d91Sopenharmony_ci    }
2462add0d91Sopenharmony_ci
2472add0d91Sopenharmony_ci    pub struct sem_info {
2482add0d91Sopenharmony_ci        pub sem: sem_id,
2492add0d91Sopenharmony_ci        pub team: team_id,
2502add0d91Sopenharmony_ci        pub name: [::c_char; B_OS_NAME_LENGTH],
2512add0d91Sopenharmony_ci        pub count: i32,
2522add0d91Sopenharmony_ci        pub latest_holder: thread_id
2532add0d91Sopenharmony_ci    }
2542add0d91Sopenharmony_ci
2552add0d91Sopenharmony_ci    pub struct team_usage_info {
2562add0d91Sopenharmony_ci        pub user_time: bigtime_t,
2572add0d91Sopenharmony_ci        pub kernel_time: bigtime_t
2582add0d91Sopenharmony_ci    }
2592add0d91Sopenharmony_ci
2602add0d91Sopenharmony_ci    pub struct thread_info {
2612add0d91Sopenharmony_ci        pub thread: thread_id,
2622add0d91Sopenharmony_ci        pub team: team_id,
2632add0d91Sopenharmony_ci        pub name: [::c_char; B_OS_NAME_LENGTH],
2642add0d91Sopenharmony_ci        pub state: thread_state,
2652add0d91Sopenharmony_ci        pub priority: i32,
2662add0d91Sopenharmony_ci        pub sem: sem_id,
2672add0d91Sopenharmony_ci        pub user_time: bigtime_t,
2682add0d91Sopenharmony_ci        pub kernel_time: bigtime_t,
2692add0d91Sopenharmony_ci        pub stack_base: *mut ::c_void,
2702add0d91Sopenharmony_ci        pub stack_end: *mut ::c_void
2712add0d91Sopenharmony_ci    }
2722add0d91Sopenharmony_ci
2732add0d91Sopenharmony_ci    pub struct cpu_info {
2742add0d91Sopenharmony_ci        pub active_time: bigtime_t,
2752add0d91Sopenharmony_ci        pub enabled: bool,
2762add0d91Sopenharmony_ci        pub current_frequency: u64
2772add0d91Sopenharmony_ci    }
2782add0d91Sopenharmony_ci
2792add0d91Sopenharmony_ci    pub struct system_info {
2802add0d91Sopenharmony_ci        pub boot_time: bigtime_t,
2812add0d91Sopenharmony_ci        pub cpu_count: u32,
2822add0d91Sopenharmony_ci        pub max_pages: u64,
2832add0d91Sopenharmony_ci        pub used_pages: u64,
2842add0d91Sopenharmony_ci        pub cached_pages: u64,
2852add0d91Sopenharmony_ci        pub block_cache_pages: u64,
2862add0d91Sopenharmony_ci        pub ignored_pages: u64,
2872add0d91Sopenharmony_ci        pub needed_memory: u64,
2882add0d91Sopenharmony_ci        pub free_memory: u64,
2892add0d91Sopenharmony_ci        pub max_swap_pages: u64,
2902add0d91Sopenharmony_ci        pub free_swap_pages: u64,
2912add0d91Sopenharmony_ci        pub page_faults: u32,
2922add0d91Sopenharmony_ci        pub max_sems: u32,
2932add0d91Sopenharmony_ci        pub used_sems: u32,
2942add0d91Sopenharmony_ci        pub max_ports: u32,
2952add0d91Sopenharmony_ci        pub used_ports: u32,
2962add0d91Sopenharmony_ci        pub max_threads: u32,
2972add0d91Sopenharmony_ci        pub used_threads: u32,
2982add0d91Sopenharmony_ci        pub max_teams: u32,
2992add0d91Sopenharmony_ci        pub used_teams: u32,
3002add0d91Sopenharmony_ci        pub kernel_name: [::c_char; B_FILE_NAME_LENGTH],
3012add0d91Sopenharmony_ci        pub kernel_build_date: [::c_char; B_OS_NAME_LENGTH],
3022add0d91Sopenharmony_ci        pub kernel_build_time: [::c_char; B_OS_NAME_LENGTH],
3032add0d91Sopenharmony_ci        pub kernel_version: i64,
3042add0d91Sopenharmony_ci        pub abi: u32
3052add0d91Sopenharmony_ci    }
3062add0d91Sopenharmony_ci
3072add0d91Sopenharmony_ci    pub struct object_wait_info {
3082add0d91Sopenharmony_ci        pub object: i32,
3092add0d91Sopenharmony_ci        pub type_: u16,
3102add0d91Sopenharmony_ci        pub events: u16
3112add0d91Sopenharmony_ci    }
3122add0d91Sopenharmony_ci
3132add0d91Sopenharmony_ci    // kernel/fs_attr.h
3142add0d91Sopenharmony_ci    pub struct attr_info {
3152add0d91Sopenharmony_ci        pub type_: u32,
3162add0d91Sopenharmony_ci        pub size: ::off_t
3172add0d91Sopenharmony_ci    }
3182add0d91Sopenharmony_ci
3192add0d91Sopenharmony_ci    // kernel/fs_index.h
3202add0d91Sopenharmony_ci    pub struct index_info {
3212add0d91Sopenharmony_ci        pub type_: u32,
3222add0d91Sopenharmony_ci        pub size: ::off_t,
3232add0d91Sopenharmony_ci        pub modification_time: ::time_t,
3242add0d91Sopenharmony_ci        pub creation_time: ::time_t,
3252add0d91Sopenharmony_ci        pub uid: ::uid_t,
3262add0d91Sopenharmony_ci        pub gid: ::gid_t
3272add0d91Sopenharmony_ci    }
3282add0d91Sopenharmony_ci
3292add0d91Sopenharmony_ci    //kernel/fs_info.h
3302add0d91Sopenharmony_ci    pub struct fs_info {
3312add0d91Sopenharmony_ci        pub dev: ::dev_t,
3322add0d91Sopenharmony_ci        pub root: ::ino_t,
3332add0d91Sopenharmony_ci        pub flags: u32,
3342add0d91Sopenharmony_ci        pub block_size: ::off_t,
3352add0d91Sopenharmony_ci        pub io_size: ::off_t,
3362add0d91Sopenharmony_ci        pub total_blocks: ::off_t,
3372add0d91Sopenharmony_ci        pub free_blocks: ::off_t,
3382add0d91Sopenharmony_ci        pub total_nodes: ::off_t,
3392add0d91Sopenharmony_ci        pub free_nodes: ::off_t,
3402add0d91Sopenharmony_ci        pub device_name: [::c_char; 128],
3412add0d91Sopenharmony_ci        pub volume_name: [::c_char; B_FILE_NAME_LENGTH],
3422add0d91Sopenharmony_ci        pub fsh_name: [::c_char; B_OS_NAME_LENGTH]
3432add0d91Sopenharmony_ci    }
3442add0d91Sopenharmony_ci
3452add0d91Sopenharmony_ci    // kernel/image.h
3462add0d91Sopenharmony_ci    pub struct image_info {
3472add0d91Sopenharmony_ci        pub id: image_id,
3482add0d91Sopenharmony_ci        pub image_type: ::c_int,
3492add0d91Sopenharmony_ci        pub sequence: i32,
3502add0d91Sopenharmony_ci        pub init_order: i32,
3512add0d91Sopenharmony_ci        pub init_routine: extern "C" fn(),
3522add0d91Sopenharmony_ci        pub term_routine: extern "C" fn(),
3532add0d91Sopenharmony_ci        pub device: ::dev_t,
3542add0d91Sopenharmony_ci        pub node: ::ino_t,
3552add0d91Sopenharmony_ci        pub name: [::c_char; ::PATH_MAX as usize],
3562add0d91Sopenharmony_ci        pub text: *mut ::c_void,
3572add0d91Sopenharmony_ci        pub data: *mut ::c_void,
3582add0d91Sopenharmony_ci        pub text_size: i32,
3592add0d91Sopenharmony_ci        pub data_size: i32,
3602add0d91Sopenharmony_ci        pub api_version: i32,
3612add0d91Sopenharmony_ci        pub abi: i32
3622add0d91Sopenharmony_ci    }
3632add0d91Sopenharmony_ci
3642add0d91Sopenharmony_ci    pub struct __c_anonymous_eax_0 {
3652add0d91Sopenharmony_ci        pub max_eax: u32,
3662add0d91Sopenharmony_ci        pub vendor_id: [::c_char; 12],
3672add0d91Sopenharmony_ci    }
3682add0d91Sopenharmony_ci
3692add0d91Sopenharmony_ci    pub struct __c_anonymous_eax_1 {
3702add0d91Sopenharmony_ci        pub stepping: u32,
3712add0d91Sopenharmony_ci        pub model: u32,
3722add0d91Sopenharmony_ci        pub family: u32,
3732add0d91Sopenharmony_ci        pub tpe: u32,
3742add0d91Sopenharmony_ci        __reserved_0: u32,
3752add0d91Sopenharmony_ci        pub extended_model: u32,
3762add0d91Sopenharmony_ci        pub extended_family: u32,
3772add0d91Sopenharmony_ci        __reserved_1: u32,
3782add0d91Sopenharmony_ci        pub brand_index: u32,
3792add0d91Sopenharmony_ci        pub clflush: u32,
3802add0d91Sopenharmony_ci        pub logical_cpus: u32,
3812add0d91Sopenharmony_ci        pub apic_id: u32,
3822add0d91Sopenharmony_ci        pub features: u32,
3832add0d91Sopenharmony_ci        pub extended_features: u32,
3842add0d91Sopenharmony_ci    }
3852add0d91Sopenharmony_ci
3862add0d91Sopenharmony_ci    pub struct __c_anonymous_eax_2 {
3872add0d91Sopenharmony_ci        pub call_num: u8,
3882add0d91Sopenharmony_ci        pub cache_descriptors: [u8; 15],
3892add0d91Sopenharmony_ci    }
3902add0d91Sopenharmony_ci
3912add0d91Sopenharmony_ci    pub struct __c_anonymous_eax_3 {
3922add0d91Sopenharmony_ci        __reserved: [u32; 2],
3932add0d91Sopenharmony_ci        pub serial_number_high: u32,
3942add0d91Sopenharmony_ci        pub serial_number_low: u32,
3952add0d91Sopenharmony_ci    }
3962add0d91Sopenharmony_ci
3972add0d91Sopenharmony_ci    pub struct __c_anonymous_regs {
3982add0d91Sopenharmony_ci        pub eax: u32,
3992add0d91Sopenharmony_ci        pub ebx: u32,
4002add0d91Sopenharmony_ci        pub edx: u32,
4012add0d91Sopenharmony_ci        pub ecx: u32,
4022add0d91Sopenharmony_ci    }
4032add0d91Sopenharmony_ci}
4042add0d91Sopenharmony_ci
4052add0d91Sopenharmony_cis_no_extra_traits! {
4062add0d91Sopenharmony_ci    #[cfg(libc_union)]
4072add0d91Sopenharmony_ci    pub union cpuid_info {
4082add0d91Sopenharmony_ci        pub eax_0: __c_anonymous_eax_0,
4092add0d91Sopenharmony_ci        pub eax_1: __c_anonymous_eax_1,
4102add0d91Sopenharmony_ci        pub eax_2: __c_anonymous_eax_2,
4112add0d91Sopenharmony_ci        pub eax_3: __c_anonymous_eax_3,
4122add0d91Sopenharmony_ci        pub as_chars: [::c_char; 16],
4132add0d91Sopenharmony_ci        pub regs: __c_anonymous_regs,
4142add0d91Sopenharmony_ci    }
4152add0d91Sopenharmony_ci}
4162add0d91Sopenharmony_ci
4172add0d91Sopenharmony_cicfg_if! {
4182add0d91Sopenharmony_ci    if #[cfg(feature = "extra_traits")] {
4192add0d91Sopenharmony_ci        #[cfg(libc_union)]
4202add0d91Sopenharmony_ci        impl PartialEq for cpuid_info {
4212add0d91Sopenharmony_ci            fn eq(&self, other: &cpuid_info) -> bool {
4222add0d91Sopenharmony_ci                unsafe {
4232add0d91Sopenharmony_ci                self.eax_0 == other.eax_0
4242add0d91Sopenharmony_ci                    || self.eax_1 == other.eax_1
4252add0d91Sopenharmony_ci                    || self.eax_2 == other.eax_2
4262add0d91Sopenharmony_ci                    || self.eax_3 == other.eax_3
4272add0d91Sopenharmony_ci                    || self.as_chars == other.as_chars
4282add0d91Sopenharmony_ci                    || self.regs == other.regs
4292add0d91Sopenharmony_ci                }
4302add0d91Sopenharmony_ci            }
4312add0d91Sopenharmony_ci        }
4322add0d91Sopenharmony_ci        #[cfg(libc_union)]
4332add0d91Sopenharmony_ci        impl Eq for cpuid_info {}
4342add0d91Sopenharmony_ci        #[cfg(libc_union)]
4352add0d91Sopenharmony_ci        impl ::fmt::Debug for cpuid_info {
4362add0d91Sopenharmony_ci            fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
4372add0d91Sopenharmony_ci                unsafe {
4382add0d91Sopenharmony_ci                f.debug_struct("cpuid_info")
4392add0d91Sopenharmony_ci                    .field("eax_0", &self.eax_0)
4402add0d91Sopenharmony_ci                    .field("eax_1", &self.eax_1)
4412add0d91Sopenharmony_ci                    .field("eax_2", &self.eax_2)
4422add0d91Sopenharmony_ci                    .field("eax_3", &self.eax_3)
4432add0d91Sopenharmony_ci                    .field("as_chars", &self.as_chars)
4442add0d91Sopenharmony_ci                    .field("regs", &self.regs)
4452add0d91Sopenharmony_ci                    .finish()
4462add0d91Sopenharmony_ci                }
4472add0d91Sopenharmony_ci            }
4482add0d91Sopenharmony_ci        }
4492add0d91Sopenharmony_ci    }
4502add0d91Sopenharmony_ci}
4512add0d91Sopenharmony_ci
4522add0d91Sopenharmony_ci// kernel/OS.h
4532add0d91Sopenharmony_cipub const B_OS_NAME_LENGTH: usize = 32;
4542add0d91Sopenharmony_cipub const B_PAGE_SIZE: usize = 4096;
4552add0d91Sopenharmony_cipub const B_INFINITE_TIMEOUT: usize = 9223372036854775807;
4562add0d91Sopenharmony_ci
4572add0d91Sopenharmony_cipub const B_RELATIVE_TIMEOUT: u32 = 0x8;
4582add0d91Sopenharmony_cipub const B_ABSOLUTE_TIMEOUT: u32 = 0x10;
4592add0d91Sopenharmony_cipub const B_TIMEOUT_REAL_TIME_BASE: u32 = 0x40;
4602add0d91Sopenharmony_cipub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 = B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE;
4612add0d91Sopenharmony_ci
4622add0d91Sopenharmony_cipub const B_NO_LOCK: u32 = 0;
4632add0d91Sopenharmony_cipub const B_LAZY_LOCK: u32 = 1;
4642add0d91Sopenharmony_cipub const B_FULL_LOCK: u32 = 2;
4652add0d91Sopenharmony_cipub const B_CONTIGUOUS: u32 = 3;
4662add0d91Sopenharmony_cipub const B_LOMEM: u32 = 4;
4672add0d91Sopenharmony_cipub const B_32_BIT_FULL_LOCK: u32 = 5;
4682add0d91Sopenharmony_cipub const B_32_BIT_CONTIGUOUS: u32 = 6;
4692add0d91Sopenharmony_ci
4702add0d91Sopenharmony_cipub const B_ANY_ADDRESS: u32 = 0;
4712add0d91Sopenharmony_cipub const B_EXACT_ADDRESS: u32 = 1;
4722add0d91Sopenharmony_cipub const B_BASE_ADDRESS: u32 = 2;
4732add0d91Sopenharmony_cipub const B_CLONE_ADDRESS: u32 = 3;
4742add0d91Sopenharmony_cipub const B_ANY_KERNEL_ADDRESS: u32 = 4;
4752add0d91Sopenharmony_cipub const B_RANDOMIZED_ANY_ADDRESS: u32 = 6;
4762add0d91Sopenharmony_cipub const B_RANDOMIZED_BASE_ADDRESS: u32 = 7;
4772add0d91Sopenharmony_ci
4782add0d91Sopenharmony_cipub const B_READ_AREA: u32 = 1 << 0;
4792add0d91Sopenharmony_cipub const B_WRITE_AREA: u32 = 1 << 1;
4802add0d91Sopenharmony_cipub const B_EXECUTE_AREA: u32 = 1 << 2;
4812add0d91Sopenharmony_cipub const B_STACK_AREA: u32 = 1 << 3;
4822add0d91Sopenharmony_cipub const B_CLONEABLE_AREA: u32 = 1 << 8;
4832add0d91Sopenharmony_ci
4842add0d91Sopenharmony_cipub const B_CAN_INTERRUPT: u32 = 0x01;
4852add0d91Sopenharmony_cipub const B_CHECK_PERMISSION: u32 = 0x04;
4862add0d91Sopenharmony_cipub const B_KILL_CAN_INTERRUPT: u32 = 0x20;
4872add0d91Sopenharmony_cipub const B_DO_NOT_RESCHEDULE: u32 = 0x02;
4882add0d91Sopenharmony_cipub const B_RELEASE_ALL: u32 = 0x08;
4892add0d91Sopenharmony_cipub const B_RELEASE_IF_WAITING_ONLY: u32 = 0x10;
4902add0d91Sopenharmony_ci
4912add0d91Sopenharmony_cipub const B_CURRENT_TEAM: team_id = 0;
4922add0d91Sopenharmony_cipub const B_SYSTEM_TEAM: team_id = 1;
4932add0d91Sopenharmony_ci
4942add0d91Sopenharmony_cipub const B_TEAM_USAGE_SELF: i32 = 0;
4952add0d91Sopenharmony_cipub const B_TEAM_USAGE_CHILDREN: i32 = -1;
4962add0d91Sopenharmony_ci
4972add0d91Sopenharmony_cipub const B_IDLE_PRIORITY: i32 = 0;
4982add0d91Sopenharmony_cipub const B_LOWEST_ACTIVE_PRIORITY: i32 = 1;
4992add0d91Sopenharmony_cipub const B_LOW_PRIORITY: i32 = 5;
5002add0d91Sopenharmony_cipub const B_NORMAL_PRIORITY: i32 = 10;
5012add0d91Sopenharmony_cipub const B_DISPLAY_PRIORITY: i32 = 15;
5022add0d91Sopenharmony_cipub const B_URGENT_DISPLAY_PRIORITY: i32 = 20;
5032add0d91Sopenharmony_cipub const B_REAL_TIME_DISPLAY_PRIORITY: i32 = 100;
5042add0d91Sopenharmony_cipub const B_URGENT_PRIORITY: i32 = 110;
5052add0d91Sopenharmony_cipub const B_REAL_TIME_PRIORITY: i32 = 120;
5062add0d91Sopenharmony_ci
5072add0d91Sopenharmony_cipub const B_SYSTEM_TIMEBASE: i32 = 0;
5082add0d91Sopenharmony_cipub const B_FIRST_REAL_TIME_PRIORITY: i32 = B_REAL_TIME_DISPLAY_PRIORITY;
5092add0d91Sopenharmony_ci
5102add0d91Sopenharmony_cipub const B_ONE_SHOT_ABSOLUTE_ALARM: u32 = 1;
5112add0d91Sopenharmony_cipub const B_ONE_SHOT_RELATIVE_ALARM: u32 = 2;
5122add0d91Sopenharmony_cipub const B_PERIODIC_ALARM: u32 = 3;
5132add0d91Sopenharmony_ci
5142add0d91Sopenharmony_cipub const B_OBJECT_TYPE_FD: u16 = 0;
5152add0d91Sopenharmony_cipub const B_OBJECT_TYPE_SEMAPHORE: u16 = 1;
5162add0d91Sopenharmony_cipub const B_OBJECT_TYPE_PORT: u16 = 2;
5172add0d91Sopenharmony_cipub const B_OBJECT_TYPE_THREAD: u16 = 3;
5182add0d91Sopenharmony_ci
5192add0d91Sopenharmony_cipub const B_EVENT_READ: u16 = 0x0001;
5202add0d91Sopenharmony_cipub const B_EVENT_WRITE: u16 = 0x0002;
5212add0d91Sopenharmony_cipub const B_EVENT_ERROR: u16 = 0x0004;
5222add0d91Sopenharmony_cipub const B_EVENT_PRIORITY_READ: u16 = 0x0008;
5232add0d91Sopenharmony_cipub const B_EVENT_PRIORITY_WRITE: u16 = 0x0010;
5242add0d91Sopenharmony_cipub const B_EVENT_HIGH_PRIORITY_READ: u16 = 0x0020;
5252add0d91Sopenharmony_cipub const B_EVENT_HIGH_PRIORITY_WRITE: u16 = 0x0040;
5262add0d91Sopenharmony_cipub const B_EVENT_DISCONNECTED: u16 = 0x0080;
5272add0d91Sopenharmony_cipub const B_EVENT_ACQUIRE_SEMAPHORE: u16 = 0x0001;
5282add0d91Sopenharmony_cipub const B_EVENT_INVALID: u16 = 0x1000;
5292add0d91Sopenharmony_ci
5302add0d91Sopenharmony_ci// kernel/fs_info.h
5312add0d91Sopenharmony_cipub const B_FS_IS_READONLY: u32 = 0x00000001;
5322add0d91Sopenharmony_cipub const B_FS_IS_REMOVABLE: u32 = 0x00000002;
5332add0d91Sopenharmony_cipub const B_FS_IS_PERSISTENT: u32 = 0x00000004;
5342add0d91Sopenharmony_cipub const B_FS_IS_SHARED: u32 = 0x00000008;
5352add0d91Sopenharmony_cipub const B_FS_HAS_MIME: u32 = 0x00010000;
5362add0d91Sopenharmony_cipub const B_FS_HAS_ATTR: u32 = 0x00020000;
5372add0d91Sopenharmony_cipub const B_FS_HAS_QUERY: u32 = 0x00040000;
5382add0d91Sopenharmony_cipub const B_FS_HAS_SELF_HEALING_LINKS: u32 = 0x00080000;
5392add0d91Sopenharmony_cipub const B_FS_HAS_ALIASES: u32 = 0x00100000;
5402add0d91Sopenharmony_cipub const B_FS_SUPPORTS_NODE_MONITORING: u32 = 0x00200000;
5412add0d91Sopenharmony_cipub const B_FS_SUPPORTS_MONITOR_CHILDREN: u32 = 0x00400000;
5422add0d91Sopenharmony_ci
5432add0d91Sopenharmony_ci// kernel/fs_query.h
5442add0d91Sopenharmony_cipub const B_LIVE_QUERY: u32 = 0x00000001;
5452add0d91Sopenharmony_cipub const B_QUERY_NON_INDEXED: u32 = 0x00000002;
5462add0d91Sopenharmony_ci
5472add0d91Sopenharmony_ci// kernel/fs_volume.h
5482add0d91Sopenharmony_cipub const B_MOUNT_READ_ONLY: u32 = 1;
5492add0d91Sopenharmony_cipub const B_MOUNT_VIRTUAL_DEVICE: u32 = 2;
5502add0d91Sopenharmony_cipub const B_FORCE_UNMOUNT: u32 = 1;
5512add0d91Sopenharmony_ci
5522add0d91Sopenharmony_ci// kernel/image.h
5532add0d91Sopenharmony_cipub const B_FLUSH_DCACHE: u32 = 0x0001;
5542add0d91Sopenharmony_cipub const B_FLUSH_ICACHE: u32 = 0x0004;
5552add0d91Sopenharmony_cipub const B_INVALIDATE_DCACHE: u32 = 0x0002;
5562add0d91Sopenharmony_cipub const B_INVALIDATE_ICACHE: u32 = 0x0008;
5572add0d91Sopenharmony_ci
5582add0d91Sopenharmony_cipub const B_SYMBOL_TYPE_DATA: i32 = 0x1;
5592add0d91Sopenharmony_cipub const B_SYMBOL_TYPE_TEXT: i32 = 0x2;
5602add0d91Sopenharmony_cipub const B_SYMBOL_TYPE_ANY: i32 = 0x5;
5612add0d91Sopenharmony_ci
5622add0d91Sopenharmony_ci// storage/StorageDefs.h
5632add0d91Sopenharmony_cipub const B_DEV_NAME_LENGTH: usize = 128;
5642add0d91Sopenharmony_cipub const B_FILE_NAME_LENGTH: usize = ::FILENAME_MAX as usize;
5652add0d91Sopenharmony_cipub const B_PATH_NAME_LENGTH: usize = ::PATH_MAX as usize;
5662add0d91Sopenharmony_cipub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1;
5672add0d91Sopenharmony_cipub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15;
5682add0d91Sopenharmony_cipub const B_MAX_SYMLINKS: usize = 16;
5692add0d91Sopenharmony_ci
5702add0d91Sopenharmony_ci// Haiku open modes in BFile are passed as u32
5712add0d91Sopenharmony_cipub const B_READ_ONLY: u32 = ::O_RDONLY as u32;
5722add0d91Sopenharmony_cipub const B_WRITE_ONLY: u32 = ::O_WRONLY as u32;
5732add0d91Sopenharmony_cipub const B_READ_WRITE: u32 = ::O_RDWR as u32;
5742add0d91Sopenharmony_ci
5752add0d91Sopenharmony_cipub const B_FAIL_IF_EXISTS: u32 = ::O_EXCL as u32;
5762add0d91Sopenharmony_cipub const B_CREATE_FILE: u32 = ::O_CREAT as u32;
5772add0d91Sopenharmony_cipub const B_ERASE_FILE: u32 = ::O_TRUNC as u32;
5782add0d91Sopenharmony_cipub const B_OPEN_AT_END: u32 = ::O_APPEND as u32;
5792add0d91Sopenharmony_ci
5802add0d91Sopenharmony_cipub const B_FILE_NODE: u32 = 0x01;
5812add0d91Sopenharmony_cipub const B_SYMLINK_NODE: u32 = 0x02;
5822add0d91Sopenharmony_cipub const B_DIRECTORY_NODE: u32 = 0x04;
5832add0d91Sopenharmony_cipub const B_ANY_NODE: u32 = 0x07;
5842add0d91Sopenharmony_ci
5852add0d91Sopenharmony_ci// support/Errors.h
5862add0d91Sopenharmony_cipub const B_GENERAL_ERROR_BASE: status_t = core::i32::MIN;
5872add0d91Sopenharmony_cipub const B_OS_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x1000;
5882add0d91Sopenharmony_cipub const B_APP_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x2000;
5892add0d91Sopenharmony_cipub const B_INTERFACE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x3000;
5902add0d91Sopenharmony_cipub const B_MEDIA_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4000;
5912add0d91Sopenharmony_cipub const B_TRANSLATION_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4800;
5922add0d91Sopenharmony_cipub const B_MIDI_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x5000;
5932add0d91Sopenharmony_cipub const B_STORAGE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x6000;
5942add0d91Sopenharmony_cipub const B_POSIX_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x7000;
5952add0d91Sopenharmony_cipub const B_MAIL_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x8000;
5962add0d91Sopenharmony_cipub const B_PRINT_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x9000;
5972add0d91Sopenharmony_cipub const B_DEVICE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0xa000;
5982add0d91Sopenharmony_cipub const B_ERRORS_END: status_t = B_GENERAL_ERROR_BASE + 0xffff;
5992add0d91Sopenharmony_ci
6002add0d91Sopenharmony_ci// General errors
6012add0d91Sopenharmony_cipub const B_NO_MEMORY: status_t = B_GENERAL_ERROR_BASE + 0;
6022add0d91Sopenharmony_cipub const B_IO_ERROR: status_t = B_GENERAL_ERROR_BASE + 1;
6032add0d91Sopenharmony_cipub const B_PERMISSION_DENIED: status_t = B_GENERAL_ERROR_BASE + 2;
6042add0d91Sopenharmony_cipub const B_BAD_INDEX: status_t = B_GENERAL_ERROR_BASE + 3;
6052add0d91Sopenharmony_cipub const B_BAD_TYPE: status_t = B_GENERAL_ERROR_BASE + 4;
6062add0d91Sopenharmony_cipub const B_BAD_VALUE: status_t = B_GENERAL_ERROR_BASE + 5;
6072add0d91Sopenharmony_cipub const B_MISMATCHED_VALUES: status_t = B_GENERAL_ERROR_BASE + 6;
6082add0d91Sopenharmony_cipub const B_NAME_NOT_FOUND: status_t = B_GENERAL_ERROR_BASE + 7;
6092add0d91Sopenharmony_cipub const B_NAME_IN_USE: status_t = B_GENERAL_ERROR_BASE + 8;
6102add0d91Sopenharmony_cipub const B_TIMED_OUT: status_t = B_GENERAL_ERROR_BASE + 9;
6112add0d91Sopenharmony_cipub const B_INTERRUPTED: status_t = B_GENERAL_ERROR_BASE + 10;
6122add0d91Sopenharmony_cipub const B_WOULD_BLOCK: status_t = B_GENERAL_ERROR_BASE + 11;
6132add0d91Sopenharmony_cipub const B_CANCELED: status_t = B_GENERAL_ERROR_BASE + 12;
6142add0d91Sopenharmony_cipub const B_NO_INIT: status_t = B_GENERAL_ERROR_BASE + 13;
6152add0d91Sopenharmony_cipub const B_NOT_INITIALIZED: status_t = B_GENERAL_ERROR_BASE + 13;
6162add0d91Sopenharmony_cipub const B_BUSY: status_t = B_GENERAL_ERROR_BASE + 14;
6172add0d91Sopenharmony_cipub const B_NOT_ALLOWED: status_t = B_GENERAL_ERROR_BASE + 15;
6182add0d91Sopenharmony_cipub const B_BAD_DATA: status_t = B_GENERAL_ERROR_BASE + 16;
6192add0d91Sopenharmony_cipub const B_DONT_DO_THAT: status_t = B_GENERAL_ERROR_BASE + 17;
6202add0d91Sopenharmony_ci
6212add0d91Sopenharmony_cipub const B_ERROR: status_t = -1;
6222add0d91Sopenharmony_cipub const B_OK: status_t = 0;
6232add0d91Sopenharmony_cipub const B_NO_ERROR: status_t = 0;
6242add0d91Sopenharmony_ci
6252add0d91Sopenharmony_ci// Kernel kit errors
6262add0d91Sopenharmony_cipub const B_BAD_SEM_ID: status_t = B_OS_ERROR_BASE + 0;
6272add0d91Sopenharmony_cipub const B_NO_MORE_SEMS: status_t = B_OS_ERROR_BASE + 1;
6282add0d91Sopenharmony_ci
6292add0d91Sopenharmony_cipub const B_BAD_THREAD_ID: status_t = B_OS_ERROR_BASE + 0x100;
6302add0d91Sopenharmony_cipub const B_NO_MORE_THREADS: status_t = B_OS_ERROR_BASE + 0x101;
6312add0d91Sopenharmony_cipub const B_BAD_THREAD_STATE: status_t = B_OS_ERROR_BASE + 0x102;
6322add0d91Sopenharmony_cipub const B_BAD_TEAM_ID: status_t = B_OS_ERROR_BASE + 0x103;
6332add0d91Sopenharmony_cipub const B_NO_MORE_TEAMS: status_t = B_OS_ERROR_BASE + 0x104;
6342add0d91Sopenharmony_ci
6352add0d91Sopenharmony_cipub const B_BAD_PORT_ID: status_t = B_OS_ERROR_BASE + 0x200;
6362add0d91Sopenharmony_cipub const B_NO_MORE_PORTS: status_t = B_OS_ERROR_BASE + 0x201;
6372add0d91Sopenharmony_ci
6382add0d91Sopenharmony_cipub const B_BAD_IMAGE_ID: status_t = B_OS_ERROR_BASE + 0x300;
6392add0d91Sopenharmony_cipub const B_BAD_ADDRESS: status_t = B_OS_ERROR_BASE + 0x301;
6402add0d91Sopenharmony_cipub const B_NOT_AN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x302;
6412add0d91Sopenharmony_cipub const B_MISSING_LIBRARY: status_t = B_OS_ERROR_BASE + 0x303;
6422add0d91Sopenharmony_cipub const B_MISSING_SYMBOL: status_t = B_OS_ERROR_BASE + 0x304;
6432add0d91Sopenharmony_cipub const B_UNKNOWN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x305;
6442add0d91Sopenharmony_cipub const B_LEGACY_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x306;
6452add0d91Sopenharmony_ci
6462add0d91Sopenharmony_cipub const B_DEBUGGER_ALREADY_INSTALLED: status_t = B_OS_ERROR_BASE + 0x400;
6472add0d91Sopenharmony_ci
6482add0d91Sopenharmony_ci// Application kit errors
6492add0d91Sopenharmony_cipub const B_BAD_REPLY: status_t = B_APP_ERROR_BASE + 0;
6502add0d91Sopenharmony_cipub const B_DUPLICATE_REPLY: status_t = B_APP_ERROR_BASE + 1;
6512add0d91Sopenharmony_cipub const B_MESSAGE_TO_SELF: status_t = B_APP_ERROR_BASE + 2;
6522add0d91Sopenharmony_cipub const B_BAD_HANDLER: status_t = B_APP_ERROR_BASE + 3;
6532add0d91Sopenharmony_cipub const B_ALREADY_RUNNING: status_t = B_APP_ERROR_BASE + 4;
6542add0d91Sopenharmony_cipub const B_LAUNCH_FAILED: status_t = B_APP_ERROR_BASE + 5;
6552add0d91Sopenharmony_cipub const B_AMBIGUOUS_APP_LAUNCH: status_t = B_APP_ERROR_BASE + 6;
6562add0d91Sopenharmony_cipub const B_UNKNOWN_MIME_TYPE: status_t = B_APP_ERROR_BASE + 7;
6572add0d91Sopenharmony_cipub const B_BAD_SCRIPT_SYNTAX: status_t = B_APP_ERROR_BASE + 8;
6582add0d91Sopenharmony_cipub const B_LAUNCH_FAILED_NO_RESOLVE_LINK: status_t = B_APP_ERROR_BASE + 9;
6592add0d91Sopenharmony_cipub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10;
6602add0d91Sopenharmony_cipub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11;
6612add0d91Sopenharmony_cipub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12;
6622add0d91Sopenharmony_cipub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13;
6632add0d91Sopenharmony_cipub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14;
6642add0d91Sopenharmony_cipub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15;
6652add0d91Sopenharmony_cipub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16;
6662add0d91Sopenharmony_cipub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17;
6672add0d91Sopenharmony_cipub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18;
6682add0d91Sopenharmony_ci
6692add0d91Sopenharmony_ci// Storage kit errors
6702add0d91Sopenharmony_cipub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0;
6712add0d91Sopenharmony_cipub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2;
6722add0d91Sopenharmony_cipub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3;
6732add0d91Sopenharmony_cipub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4;
6742add0d91Sopenharmony_cipub const B_NOT_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 5;
6752add0d91Sopenharmony_cipub const B_DIRECTORY_NOT_EMPTY: status_t = B_STORAGE_ERROR_BASE + 6;
6762add0d91Sopenharmony_cipub const B_DEVICE_FULL: status_t = B_STORAGE_ERROR_BASE + 7;
6772add0d91Sopenharmony_cipub const B_READ_ONLY_DEVICE: status_t = B_STORAGE_ERROR_BASE + 8;
6782add0d91Sopenharmony_cipub const B_IS_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 9;
6792add0d91Sopenharmony_cipub const B_NO_MORE_FDS: status_t = B_STORAGE_ERROR_BASE + 10;
6802add0d91Sopenharmony_cipub const B_CROSS_DEVICE_LINK: status_t = B_STORAGE_ERROR_BASE + 11;
6812add0d91Sopenharmony_cipub const B_LINK_LIMIT: status_t = B_STORAGE_ERROR_BASE + 12;
6822add0d91Sopenharmony_cipub const B_BUSTED_PIPE: status_t = B_STORAGE_ERROR_BASE + 13;
6832add0d91Sopenharmony_cipub const B_UNSUPPORTED: status_t = B_STORAGE_ERROR_BASE + 14;
6842add0d91Sopenharmony_cipub const B_PARTITION_TOO_SMALL: status_t = B_STORAGE_ERROR_BASE + 15;
6852add0d91Sopenharmony_cipub const B_PARTIAL_READ: status_t = B_STORAGE_ERROR_BASE + 16;
6862add0d91Sopenharmony_cipub const B_PARTIAL_WRITE: status_t = B_STORAGE_ERROR_BASE + 17;
6872add0d91Sopenharmony_ci
6882add0d91Sopenharmony_ci// Mapped posix errors
6892add0d91Sopenharmony_cipub const B_BUFFER_OVERFLOW: status_t = ::EOVERFLOW;
6902add0d91Sopenharmony_cipub const B_TOO_MANY_ARGS: status_t = ::E2BIG;
6912add0d91Sopenharmony_cipub const B_FILE_TOO_LARGE: status_t = ::EFBIG;
6922add0d91Sopenharmony_cipub const B_RESULT_NOT_REPRESENTABLE: status_t = ::ERANGE;
6932add0d91Sopenharmony_cipub const B_DEVICE_NOT_FOUND: status_t = ::ENODEV;
6942add0d91Sopenharmony_cipub const B_NOT_SUPPORTED: status_t = ::EOPNOTSUPP;
6952add0d91Sopenharmony_ci
6962add0d91Sopenharmony_ci// Media kit errors
6972add0d91Sopenharmony_cipub const B_STREAM_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 0;
6982add0d91Sopenharmony_cipub const B_SERVER_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 1;
6992add0d91Sopenharmony_cipub const B_RESOURCE_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 2;
7002add0d91Sopenharmony_cipub const B_RESOURCE_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 3;
7012add0d91Sopenharmony_cipub const B_BAD_SUBSCRIBER: status_t = B_MEDIA_ERROR_BASE + 4;
7022add0d91Sopenharmony_cipub const B_SUBSCRIBER_NOT_ENTERED: status_t = B_MEDIA_ERROR_BASE + 5;
7032add0d91Sopenharmony_cipub const B_BUFFER_NOT_AVAILABLE: status_t = B_MEDIA_ERROR_BASE + 6;
7042add0d91Sopenharmony_cipub const B_LAST_BUFFER_ERROR: status_t = B_MEDIA_ERROR_BASE + 7;
7052add0d91Sopenharmony_ci
7062add0d91Sopenharmony_cipub const B_MEDIA_SYSTEM_FAILURE: status_t = B_MEDIA_ERROR_BASE + 100;
7072add0d91Sopenharmony_cipub const B_MEDIA_BAD_NODE: status_t = B_MEDIA_ERROR_BASE + 101;
7082add0d91Sopenharmony_cipub const B_MEDIA_NODE_BUSY: status_t = B_MEDIA_ERROR_BASE + 102;
7092add0d91Sopenharmony_cipub const B_MEDIA_BAD_FORMAT: status_t = B_MEDIA_ERROR_BASE + 103;
7102add0d91Sopenharmony_cipub const B_MEDIA_BAD_BUFFER: status_t = B_MEDIA_ERROR_BASE + 104;
7112add0d91Sopenharmony_cipub const B_MEDIA_TOO_MANY_NODES: status_t = B_MEDIA_ERROR_BASE + 105;
7122add0d91Sopenharmony_cipub const B_MEDIA_TOO_MANY_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 106;
7132add0d91Sopenharmony_cipub const B_MEDIA_NODE_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 107;
7142add0d91Sopenharmony_cipub const B_MEDIA_BUFFER_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 108;
7152add0d91Sopenharmony_cipub const B_MEDIA_CANNOT_SEEK: status_t = B_MEDIA_ERROR_BASE + 109;
7162add0d91Sopenharmony_cipub const B_MEDIA_CANNOT_CHANGE_RUN_MODE: status_t = B_MEDIA_ERROR_BASE + 110;
7172add0d91Sopenharmony_cipub const B_MEDIA_APP_ALREADY_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 111;
7182add0d91Sopenharmony_cipub const B_MEDIA_APP_NOT_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 112;
7192add0d91Sopenharmony_cipub const B_MEDIA_CANNOT_RECLAIM_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 113;
7202add0d91Sopenharmony_cipub const B_MEDIA_BUFFERS_NOT_RECLAIMED: status_t = B_MEDIA_ERROR_BASE + 114;
7212add0d91Sopenharmony_cipub const B_MEDIA_TIME_SOURCE_STOPPED: status_t = B_MEDIA_ERROR_BASE + 115;
7222add0d91Sopenharmony_cipub const B_MEDIA_TIME_SOURCE_BUSY: status_t = B_MEDIA_ERROR_BASE + 116;
7232add0d91Sopenharmony_cipub const B_MEDIA_BAD_SOURCE: status_t = B_MEDIA_ERROR_BASE + 117;
7242add0d91Sopenharmony_cipub const B_MEDIA_BAD_DESTINATION: status_t = B_MEDIA_ERROR_BASE + 118;
7252add0d91Sopenharmony_cipub const B_MEDIA_ALREADY_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 119;
7262add0d91Sopenharmony_cipub const B_MEDIA_NOT_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 120;
7272add0d91Sopenharmony_cipub const B_MEDIA_BAD_CLIP_FORMAT: status_t = B_MEDIA_ERROR_BASE + 121;
7282add0d91Sopenharmony_cipub const B_MEDIA_ADDON_FAILED: status_t = B_MEDIA_ERROR_BASE + 122;
7292add0d91Sopenharmony_cipub const B_MEDIA_ADDON_DISABLED: status_t = B_MEDIA_ERROR_BASE + 123;
7302add0d91Sopenharmony_cipub const B_MEDIA_CHANGE_IN_PROGRESS: status_t = B_MEDIA_ERROR_BASE + 124;
7312add0d91Sopenharmony_cipub const B_MEDIA_STALE_CHANGE_COUNT: status_t = B_MEDIA_ERROR_BASE + 125;
7322add0d91Sopenharmony_cipub const B_MEDIA_ADDON_RESTRICTED: status_t = B_MEDIA_ERROR_BASE + 126;
7332add0d91Sopenharmony_cipub const B_MEDIA_NO_HANDLER: status_t = B_MEDIA_ERROR_BASE + 127;
7342add0d91Sopenharmony_cipub const B_MEDIA_DUPLICATE_FORMAT: status_t = B_MEDIA_ERROR_BASE + 128;
7352add0d91Sopenharmony_cipub const B_MEDIA_REALTIME_DISABLED: status_t = B_MEDIA_ERROR_BASE + 129;
7362add0d91Sopenharmony_cipub const B_MEDIA_REALTIME_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 130;
7372add0d91Sopenharmony_ci
7382add0d91Sopenharmony_ci// Mail kit errors
7392add0d91Sopenharmony_cipub const B_MAIL_NO_DAEMON: status_t = B_MAIL_ERROR_BASE + 0;
7402add0d91Sopenharmony_cipub const B_MAIL_UNKNOWN_USER: status_t = B_MAIL_ERROR_BASE + 1;
7412add0d91Sopenharmony_cipub const B_MAIL_WRONG_PASSWORD: status_t = B_MAIL_ERROR_BASE + 2;
7422add0d91Sopenharmony_cipub const B_MAIL_UNKNOWN_HOST: status_t = B_MAIL_ERROR_BASE + 3;
7432add0d91Sopenharmony_cipub const B_MAIL_ACCESS_ERROR: status_t = B_MAIL_ERROR_BASE + 4;
7442add0d91Sopenharmony_cipub const B_MAIL_UNKNOWN_FIELD: status_t = B_MAIL_ERROR_BASE + 5;
7452add0d91Sopenharmony_cipub const B_MAIL_NO_RECIPIENT: status_t = B_MAIL_ERROR_BASE + 6;
7462add0d91Sopenharmony_cipub const B_MAIL_INVALID_MAIL: status_t = B_MAIL_ERROR_BASE + 7;
7472add0d91Sopenharmony_ci
7482add0d91Sopenharmony_ci// Print kit errors
7492add0d91Sopenharmony_cipub const B_NO_PRINT_SERVER: status_t = B_PRINT_ERROR_BASE + 0;
7502add0d91Sopenharmony_ci
7512add0d91Sopenharmony_ci// Device kit errors
7522add0d91Sopenharmony_cipub const B_DEV_INVALID_IOCTL: status_t = B_DEVICE_ERROR_BASE + 0;
7532add0d91Sopenharmony_cipub const B_DEV_NO_MEMORY: status_t = B_DEVICE_ERROR_BASE + 1;
7542add0d91Sopenharmony_cipub const B_DEV_BAD_DRIVE_NUM: status_t = B_DEVICE_ERROR_BASE + 2;
7552add0d91Sopenharmony_cipub const B_DEV_NO_MEDIA: status_t = B_DEVICE_ERROR_BASE + 3;
7562add0d91Sopenharmony_cipub const B_DEV_UNREADABLE: status_t = B_DEVICE_ERROR_BASE + 4;
7572add0d91Sopenharmony_cipub const B_DEV_FORMAT_ERROR: status_t = B_DEVICE_ERROR_BASE + 5;
7582add0d91Sopenharmony_cipub const B_DEV_TIMEOUT: status_t = B_DEVICE_ERROR_BASE + 6;
7592add0d91Sopenharmony_cipub const B_DEV_RECALIBRATE_ERROR: status_t = B_DEVICE_ERROR_BASE + 7;
7602add0d91Sopenharmony_cipub const B_DEV_SEEK_ERROR: status_t = B_DEVICE_ERROR_BASE + 8;
7612add0d91Sopenharmony_cipub const B_DEV_ID_ERROR: status_t = B_DEVICE_ERROR_BASE + 9;
7622add0d91Sopenharmony_cipub const B_DEV_READ_ERROR: status_t = B_DEVICE_ERROR_BASE + 10;
7632add0d91Sopenharmony_cipub const B_DEV_WRITE_ERROR: status_t = B_DEVICE_ERROR_BASE + 11;
7642add0d91Sopenharmony_cipub const B_DEV_NOT_READY: status_t = B_DEVICE_ERROR_BASE + 12;
7652add0d91Sopenharmony_cipub const B_DEV_MEDIA_CHANGED: status_t = B_DEVICE_ERROR_BASE + 13;
7662add0d91Sopenharmony_cipub const B_DEV_MEDIA_CHANGE_REQUESTED: status_t = B_DEVICE_ERROR_BASE + 14;
7672add0d91Sopenharmony_cipub const B_DEV_RESOURCE_CONFLICT: status_t = B_DEVICE_ERROR_BASE + 15;
7682add0d91Sopenharmony_cipub const B_DEV_CONFIGURATION_ERROR: status_t = B_DEVICE_ERROR_BASE + 16;
7692add0d91Sopenharmony_cipub const B_DEV_DISABLED_BY_USER: status_t = B_DEVICE_ERROR_BASE + 17;
7702add0d91Sopenharmony_cipub const B_DEV_DOOR_OPEN: status_t = B_DEVICE_ERROR_BASE + 18;
7712add0d91Sopenharmony_ci
7722add0d91Sopenharmony_cipub const B_DEV_INVALID_PIPE: status_t = B_DEVICE_ERROR_BASE + 19;
7732add0d91Sopenharmony_cipub const B_DEV_CRC_ERROR: status_t = B_DEVICE_ERROR_BASE + 20;
7742add0d91Sopenharmony_cipub const B_DEV_STALLED: status_t = B_DEVICE_ERROR_BASE + 21;
7752add0d91Sopenharmony_cipub const B_DEV_BAD_PID: status_t = B_DEVICE_ERROR_BASE + 22;
7762add0d91Sopenharmony_cipub const B_DEV_UNEXPECTED_PID: status_t = B_DEVICE_ERROR_BASE + 23;
7772add0d91Sopenharmony_cipub const B_DEV_DATA_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 24;
7782add0d91Sopenharmony_cipub const B_DEV_DATA_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 25;
7792add0d91Sopenharmony_cipub const B_DEV_FIFO_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 26;
7802add0d91Sopenharmony_cipub const B_DEV_FIFO_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 27;
7812add0d91Sopenharmony_cipub const B_DEV_PENDING: status_t = B_DEVICE_ERROR_BASE + 28;
7822add0d91Sopenharmony_cipub const B_DEV_MULTIPLE_ERRORS: status_t = B_DEVICE_ERROR_BASE + 29;
7832add0d91Sopenharmony_cipub const B_DEV_TOO_LATE: status_t = B_DEVICE_ERROR_BASE + 30;
7842add0d91Sopenharmony_ci
7852add0d91Sopenharmony_ci// translation kit errors
7862add0d91Sopenharmony_cipub const B_TRANSLATION_BASE_ERROR: status_t = B_TRANSLATION_ERROR_BASE + 0;
7872add0d91Sopenharmony_cipub const B_NO_TRANSLATOR: status_t = B_TRANSLATION_ERROR_BASE + 1;
7882add0d91Sopenharmony_cipub const B_ILLEGAL_DATA: status_t = B_TRANSLATION_ERROR_BASE + 2;
7892add0d91Sopenharmony_ci
7902add0d91Sopenharmony_ci// support/TypeConstants.h
7912add0d91Sopenharmony_cipub const B_AFFINE_TRANSFORM_TYPE: u32 = haiku_constant!('A', 'M', 'T', 'X');
7922add0d91Sopenharmony_cipub const B_ALIGNMENT_TYPE: u32 = haiku_constant!('A', 'L', 'G', 'N');
7932add0d91Sopenharmony_cipub const B_ANY_TYPE: u32 = haiku_constant!('A', 'N', 'Y', 'T');
7942add0d91Sopenharmony_cipub const B_ATOM_TYPE: u32 = haiku_constant!('A', 'T', 'O', 'M');
7952add0d91Sopenharmony_cipub const B_ATOMREF_TYPE: u32 = haiku_constant!('A', 'T', 'M', 'R');
7962add0d91Sopenharmony_cipub const B_BOOL_TYPE: u32 = haiku_constant!('B', 'O', 'O', 'L');
7972add0d91Sopenharmony_cipub const B_CHAR_TYPE: u32 = haiku_constant!('C', 'H', 'A', 'R');
7982add0d91Sopenharmony_cipub const B_COLOR_8_BIT_TYPE: u32 = haiku_constant!('C', 'L', 'R', 'B');
7992add0d91Sopenharmony_cipub const B_DOUBLE_TYPE: u32 = haiku_constant!('D', 'B', 'L', 'E');
8002add0d91Sopenharmony_cipub const B_FLOAT_TYPE: u32 = haiku_constant!('F', 'L', 'O', 'T');
8012add0d91Sopenharmony_cipub const B_GRAYSCALE_8_BIT_TYPE: u32 = haiku_constant!('G', 'R', 'Y', 'B');
8022add0d91Sopenharmony_cipub const B_INT16_TYPE: u32 = haiku_constant!('S', 'H', 'R', 'T');
8032add0d91Sopenharmony_cipub const B_INT32_TYPE: u32 = haiku_constant!('L', 'O', 'N', 'G');
8042add0d91Sopenharmony_cipub const B_INT64_TYPE: u32 = haiku_constant!('L', 'L', 'N', 'G');
8052add0d91Sopenharmony_cipub const B_INT8_TYPE: u32 = haiku_constant!('B', 'Y', 'T', 'E');
8062add0d91Sopenharmony_cipub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I', 'C', 'O', 'N');
8072add0d91Sopenharmony_cipub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'G');
8082add0d91Sopenharmony_cipub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'T');
8092add0d91Sopenharmony_cipub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'W');
8102add0d91Sopenharmony_cipub const B_MESSAGE_TYPE: u32 = haiku_constant!('M', 'S', 'G', 'G');
8112add0d91Sopenharmony_cipub const B_MESSENGER_TYPE: u32 = haiku_constant!('M', 'S', 'N', 'G');
8122add0d91Sopenharmony_cipub const B_MIME_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'E');
8132add0d91Sopenharmony_cipub const B_MINI_ICON_TYPE: u32 = haiku_constant!('M', 'I', 'C', 'N');
8142add0d91Sopenharmony_cipub const B_MONOCHROME_1_BIT_TYPE: u32 = haiku_constant!('M', 'N', 'O', 'B');
8152add0d91Sopenharmony_cipub const B_OBJECT_TYPE: u32 = haiku_constant!('O', 'P', 'T', 'R');
8162add0d91Sopenharmony_cipub const B_OFF_T_TYPE: u32 = haiku_constant!('O', 'F', 'F', 'T');
8172add0d91Sopenharmony_cipub const B_PATTERN_TYPE: u32 = haiku_constant!('P', 'A', 'T', 'N');
8182add0d91Sopenharmony_cipub const B_POINTER_TYPE: u32 = haiku_constant!('P', 'N', 'T', 'R');
8192add0d91Sopenharmony_cipub const B_POINT_TYPE: u32 = haiku_constant!('B', 'P', 'N', 'T');
8202add0d91Sopenharmony_cipub const B_PROPERTY_INFO_TYPE: u32 = haiku_constant!('S', 'C', 'T', 'D');
8212add0d91Sopenharmony_cipub const B_RAW_TYPE: u32 = haiku_constant!('R', 'A', 'W', 'T');
8222add0d91Sopenharmony_cipub const B_RECT_TYPE: u32 = haiku_constant!('R', 'E', 'C', 'T');
8232add0d91Sopenharmony_cipub const B_REF_TYPE: u32 = haiku_constant!('R', 'R', 'E', 'F');
8242add0d91Sopenharmony_cipub const B_RGB_32_BIT_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'B');
8252add0d91Sopenharmony_cipub const B_RGB_COLOR_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'C');
8262add0d91Sopenharmony_cipub const B_SIZE_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'E');
8272add0d91Sopenharmony_cipub const B_SIZE_T_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'T');
8282add0d91Sopenharmony_cipub const B_SSIZE_T_TYPE: u32 = haiku_constant!('S', 'S', 'Z', 'T');
8292add0d91Sopenharmony_cipub const B_STRING_TYPE: u32 = haiku_constant!('C', 'S', 'T', 'R');
8302add0d91Sopenharmony_cipub const B_STRING_LIST_TYPE: u32 = haiku_constant!('S', 'T', 'R', 'L');
8312add0d91Sopenharmony_cipub const B_TIME_TYPE: u32 = haiku_constant!('T', 'I', 'M', 'E');
8322add0d91Sopenharmony_cipub const B_UINT16_TYPE: u32 = haiku_constant!('U', 'S', 'H', 'T');
8332add0d91Sopenharmony_cipub const B_UINT32_TYPE: u32 = haiku_constant!('U', 'L', 'N', 'G');
8342add0d91Sopenharmony_cipub const B_UINT64_TYPE: u32 = haiku_constant!('U', 'L', 'L', 'G');
8352add0d91Sopenharmony_cipub const B_UINT8_TYPE: u32 = haiku_constant!('U', 'B', 'Y', 'T');
8362add0d91Sopenharmony_cipub const B_VECTOR_ICON_TYPE: u32 = haiku_constant!('V', 'I', 'C', 'N');
8372add0d91Sopenharmony_cipub const B_XATTR_TYPE: u32 = haiku_constant!('X', 'A', 'T', 'R');
8382add0d91Sopenharmony_cipub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N', 'W', 'A', 'D');
8392add0d91Sopenharmony_cipub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'S');
8402add0d91Sopenharmony_cipub const B_ASCII_TYPE: u32 = haiku_constant!('T', 'E', 'X', 'T');
8412add0d91Sopenharmony_ci
8422add0d91Sopenharmony_ciextern "C" {
8432add0d91Sopenharmony_ci    // kernel/OS.h
8442add0d91Sopenharmony_ci    pub fn create_area(
8452add0d91Sopenharmony_ci        name: *const ::c_char,
8462add0d91Sopenharmony_ci        startAddress: *mut *mut ::c_void,
8472add0d91Sopenharmony_ci        addressSpec: u32,
8482add0d91Sopenharmony_ci        size: usize,
8492add0d91Sopenharmony_ci        lock: u32,
8502add0d91Sopenharmony_ci        protection: u32,
8512add0d91Sopenharmony_ci    ) -> area_id;
8522add0d91Sopenharmony_ci    pub fn clone_area(
8532add0d91Sopenharmony_ci        name: *const ::c_char,
8542add0d91Sopenharmony_ci        destAddress: *mut *mut ::c_void,
8552add0d91Sopenharmony_ci        addressSpec: u32,
8562add0d91Sopenharmony_ci        protection: u32,
8572add0d91Sopenharmony_ci        source: area_id,
8582add0d91Sopenharmony_ci    ) -> area_id;
8592add0d91Sopenharmony_ci    pub fn find_area(name: *const ::c_char) -> area_id;
8602add0d91Sopenharmony_ci    pub fn area_for(address: *mut ::c_void) -> area_id;
8612add0d91Sopenharmony_ci    pub fn delete_area(id: area_id) -> status_t;
8622add0d91Sopenharmony_ci    pub fn resize_area(id: area_id, newSize: usize) -> status_t;
8632add0d91Sopenharmony_ci    pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t;
8642add0d91Sopenharmony_ci    pub fn _get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t;
8652add0d91Sopenharmony_ci    pub fn _get_next_area_info(
8662add0d91Sopenharmony_ci        team: team_id,
8672add0d91Sopenharmony_ci        cookie: *mut isize,
8682add0d91Sopenharmony_ci        areaInfo: *mut area_info,
8692add0d91Sopenharmony_ci        size: usize,
8702add0d91Sopenharmony_ci    ) -> status_t;
8712add0d91Sopenharmony_ci
8722add0d91Sopenharmony_ci    pub fn create_port(capacity: i32, name: *const ::c_char) -> port_id;
8732add0d91Sopenharmony_ci    pub fn find_port(name: *const ::c_char) -> port_id;
8742add0d91Sopenharmony_ci    pub fn read_port(
8752add0d91Sopenharmony_ci        port: port_id,
8762add0d91Sopenharmony_ci        code: *mut i32,
8772add0d91Sopenharmony_ci        buffer: *mut ::c_void,
8782add0d91Sopenharmony_ci        bufferSize: ::size_t,
8792add0d91Sopenharmony_ci    ) -> ::ssize_t;
8802add0d91Sopenharmony_ci    pub fn read_port_etc(
8812add0d91Sopenharmony_ci        port: port_id,
8822add0d91Sopenharmony_ci        code: *mut i32,
8832add0d91Sopenharmony_ci        buffer: *mut ::c_void,
8842add0d91Sopenharmony_ci        bufferSize: ::size_t,
8852add0d91Sopenharmony_ci        flags: u32,
8862add0d91Sopenharmony_ci        timeout: bigtime_t,
8872add0d91Sopenharmony_ci    ) -> ::ssize_t;
8882add0d91Sopenharmony_ci    pub fn write_port(
8892add0d91Sopenharmony_ci        port: port_id,
8902add0d91Sopenharmony_ci        code: i32,
8912add0d91Sopenharmony_ci        buffer: *const ::c_void,
8922add0d91Sopenharmony_ci        bufferSize: ::size_t,
8932add0d91Sopenharmony_ci    ) -> status_t;
8942add0d91Sopenharmony_ci    pub fn write_port_etc(
8952add0d91Sopenharmony_ci        port: port_id,
8962add0d91Sopenharmony_ci        code: i32,
8972add0d91Sopenharmony_ci        buffer: *const ::c_void,
8982add0d91Sopenharmony_ci        bufferSize: ::size_t,
8992add0d91Sopenharmony_ci        flags: u32,
9002add0d91Sopenharmony_ci        timeout: bigtime_t,
9012add0d91Sopenharmony_ci    ) -> status_t;
9022add0d91Sopenharmony_ci    pub fn close_port(port: port_id) -> status_t;
9032add0d91Sopenharmony_ci    pub fn delete_port(port: port_id) -> status_t;
9042add0d91Sopenharmony_ci    pub fn port_buffer_size(port: port_id) -> ::ssize_t;
9052add0d91Sopenharmony_ci    pub fn port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ::ssize_t;
9062add0d91Sopenharmony_ci    pub fn port_count(port: port_id) -> ::ssize_t;
9072add0d91Sopenharmony_ci    pub fn set_port_owner(port: port_id, team: team_id) -> status_t;
9082add0d91Sopenharmony_ci
9092add0d91Sopenharmony_ci    pub fn _get_port_info(port: port_id, buf: *mut port_info, portInfoSize: ::size_t) -> status_t;
9102add0d91Sopenharmony_ci    pub fn _get_next_port_info(
9112add0d91Sopenharmony_ci        port: port_id,
9122add0d91Sopenharmony_ci        cookie: *mut i32,
9132add0d91Sopenharmony_ci        portInfo: *mut port_info,
9142add0d91Sopenharmony_ci        portInfoSize: ::size_t,
9152add0d91Sopenharmony_ci    ) -> status_t;
9162add0d91Sopenharmony_ci    pub fn _get_port_message_info_etc(
9172add0d91Sopenharmony_ci        port: port_id,
9182add0d91Sopenharmony_ci        info: *mut port_message_info,
9192add0d91Sopenharmony_ci        infoSize: ::size_t,
9202add0d91Sopenharmony_ci        flags: u32,
9212add0d91Sopenharmony_ci        timeout: bigtime_t,
9222add0d91Sopenharmony_ci    ) -> status_t;
9232add0d91Sopenharmony_ci
9242add0d91Sopenharmony_ci    pub fn create_sem(count: i32, name: *const ::c_char) -> sem_id;
9252add0d91Sopenharmony_ci    pub fn delete_sem(id: sem_id) -> status_t;
9262add0d91Sopenharmony_ci    pub fn acquire_sem(id: sem_id) -> status_t;
9272add0d91Sopenharmony_ci    pub fn acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t;
9282add0d91Sopenharmony_ci    pub fn release_sem(id: sem_id) -> status_t;
9292add0d91Sopenharmony_ci    pub fn release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t;
9302add0d91Sopenharmony_ci    pub fn switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t;
9312add0d91Sopenharmony_ci    pub fn switch_sem_etc(
9322add0d91Sopenharmony_ci        semToBeReleased: sem_id,
9332add0d91Sopenharmony_ci        id: sem_id,
9342add0d91Sopenharmony_ci        count: i32,
9352add0d91Sopenharmony_ci        flags: u32,
9362add0d91Sopenharmony_ci        timeout: bigtime_t,
9372add0d91Sopenharmony_ci    ) -> status_t;
9382add0d91Sopenharmony_ci    pub fn get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t;
9392add0d91Sopenharmony_ci    pub fn set_sem_owner(id: sem_id, team: team_id) -> status_t;
9402add0d91Sopenharmony_ci    pub fn _get_sem_info(id: sem_id, info: *mut sem_info, infoSize: ::size_t) -> status_t;
9412add0d91Sopenharmony_ci    pub fn _get_next_sem_info(
9422add0d91Sopenharmony_ci        team: team_id,
9432add0d91Sopenharmony_ci        cookie: *mut i32,
9442add0d91Sopenharmony_ci        info: *mut sem_info,
9452add0d91Sopenharmony_ci        infoSize: ::size_t,
9462add0d91Sopenharmony_ci    ) -> status_t;
9472add0d91Sopenharmony_ci
9482add0d91Sopenharmony_ci    pub fn kill_team(team: team_id) -> status_t;
9492add0d91Sopenharmony_ci    pub fn _get_team_info(team: team_id, info: *mut team_info, size: ::size_t) -> status_t;
9502add0d91Sopenharmony_ci    pub fn _get_next_team_info(cookie: *mut i32, info: *mut team_info, size: ::size_t) -> status_t;
9512add0d91Sopenharmony_ci
9522add0d91Sopenharmony_ci    pub fn spawn_thread(
9532add0d91Sopenharmony_ci        func: thread_func,
9542add0d91Sopenharmony_ci        name: *const ::c_char,
9552add0d91Sopenharmony_ci        priority: i32,
9562add0d91Sopenharmony_ci        data: *mut ::c_void,
9572add0d91Sopenharmony_ci    ) -> thread_id;
9582add0d91Sopenharmony_ci    pub fn kill_thread(thread: thread_id) -> status_t;
9592add0d91Sopenharmony_ci    pub fn resume_thread(thread: thread_id) -> status_t;
9602add0d91Sopenharmony_ci    pub fn suspend_thread(thread: thread_id) -> status_t;
9612add0d91Sopenharmony_ci
9622add0d91Sopenharmony_ci    pub fn rename_thread(thread: thread_id, newName: *const ::c_char) -> status_t;
9632add0d91Sopenharmony_ci    pub fn set_thread_priority(thread: thread_id, newPriority: i32) -> status_t;
9642add0d91Sopenharmony_ci    pub fn suggest_thread_priority(
9652add0d91Sopenharmony_ci        what: u32,
9662add0d91Sopenharmony_ci        period: i32,
9672add0d91Sopenharmony_ci        jitter: ::bigtime_t,
9682add0d91Sopenharmony_ci        length: ::bigtime_t,
9692add0d91Sopenharmony_ci    ) -> i32;
9702add0d91Sopenharmony_ci    pub fn estimate_max_scheduling_latency(th: ::thread_id) -> ::bigtime_t;
9712add0d91Sopenharmony_ci    pub fn exit_thread(status: status_t);
9722add0d91Sopenharmony_ci    pub fn wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t;
9732add0d91Sopenharmony_ci    pub fn on_exit_thread(callback: extern "C" fn(*mut ::c_void), data: *mut ::c_void) -> status_t;
9742add0d91Sopenharmony_ci
9752add0d91Sopenharmony_ci    pub fn find_thread(name: *const ::c_char) -> thread_id;
9762add0d91Sopenharmony_ci
9772add0d91Sopenharmony_ci    pub fn get_scheduler_mode() -> i32;
9782add0d91Sopenharmony_ci    pub fn set_scheduler_mode(mode: i32) -> status_t;
9792add0d91Sopenharmony_ci
9802add0d91Sopenharmony_ci    pub fn send_data(
9812add0d91Sopenharmony_ci        thread: thread_id,
9822add0d91Sopenharmony_ci        code: i32,
9832add0d91Sopenharmony_ci        buffer: *const ::c_void,
9842add0d91Sopenharmony_ci        bufferSize: ::size_t,
9852add0d91Sopenharmony_ci    ) -> status_t;
9862add0d91Sopenharmony_ci    pub fn receive_data(sender: *mut thread_id, buffer: *mut ::c_void, bufferSize: ::size_t)
9872add0d91Sopenharmony_ci        -> i32;
9882add0d91Sopenharmony_ci    pub fn has_data(thread: thread_id) -> bool;
9892add0d91Sopenharmony_ci
9902add0d91Sopenharmony_ci    pub fn snooze(amount: bigtime_t) -> status_t;
9912add0d91Sopenharmony_ci    pub fn snooze_etc(amount: bigtime_t, timeBase: ::c_int, flags: u32) -> status_t;
9922add0d91Sopenharmony_ci    pub fn snooze_until(time: bigtime_t, timeBase: ::c_int) -> status_t;
9932add0d91Sopenharmony_ci
9942add0d91Sopenharmony_ci    pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: ::size_t) -> status_t;
9952add0d91Sopenharmony_ci    pub fn _get_next_thread_info(
9962add0d91Sopenharmony_ci        team: team_id,
9972add0d91Sopenharmony_ci        cookie: *mut i32,
9982add0d91Sopenharmony_ci        info: *mut thread_info,
9992add0d91Sopenharmony_ci        size: ::size_t,
10002add0d91Sopenharmony_ci    ) -> status_t;
10012add0d91Sopenharmony_ci
10022add0d91Sopenharmony_ci    pub fn get_pthread_thread_id(thread: ::pthread_t) -> thread_id;
10032add0d91Sopenharmony_ci
10042add0d91Sopenharmony_ci    pub fn _get_team_usage_info(
10052add0d91Sopenharmony_ci        team: team_id,
10062add0d91Sopenharmony_ci        who: i32,
10072add0d91Sopenharmony_ci        info: *mut team_usage_info,
10082add0d91Sopenharmony_ci        size: ::size_t,
10092add0d91Sopenharmony_ci    ) -> status_t;
10102add0d91Sopenharmony_ci
10112add0d91Sopenharmony_ci    pub fn real_time_clock() -> ::c_ulong;
10122add0d91Sopenharmony_ci    pub fn set_real_time_clock(secsSinceJan1st1970: ::c_ulong);
10132add0d91Sopenharmony_ci    pub fn real_time_clock_usecs() -> bigtime_t;
10142add0d91Sopenharmony_ci    pub fn system_time() -> bigtime_t;
10152add0d91Sopenharmony_ci    pub fn system_time_nsecs() -> nanotime_t;
10162add0d91Sopenharmony_ci    // set_timezone() is deprecated and a no-op
10172add0d91Sopenharmony_ci
10182add0d91Sopenharmony_ci    pub fn set_alarm(when: bigtime_t, flags: u32) -> bigtime_t;
10192add0d91Sopenharmony_ci    pub fn debugger(message: *const ::c_char);
10202add0d91Sopenharmony_ci    pub fn disable_debugger(state: ::c_int) -> ::c_int;
10212add0d91Sopenharmony_ci
10222add0d91Sopenharmony_ci    pub fn get_system_info(info: *mut system_info) -> status_t;
10232add0d91Sopenharmony_ci    pub fn _get_cpu_info_etc(
10242add0d91Sopenharmony_ci        firstCPU: u32,
10252add0d91Sopenharmony_ci        cpuCount: u32,
10262add0d91Sopenharmony_ci        info: *mut cpu_info,
10272add0d91Sopenharmony_ci        size: ::size_t,
10282add0d91Sopenharmony_ci    ) -> status_t;
10292add0d91Sopenharmony_ci    pub fn is_computer_on() -> i32;
10302add0d91Sopenharmony_ci    pub fn is_computer_on_fire() -> ::c_double;
10312add0d91Sopenharmony_ci    pub fn send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int;
10322add0d91Sopenharmony_ci    pub fn set_signal_stack(base: *mut ::c_void, size: ::size_t);
10332add0d91Sopenharmony_ci
10342add0d91Sopenharmony_ci    pub fn wait_for_objects(infos: *mut object_wait_info, numInfos: ::c_int) -> ::ssize_t;
10352add0d91Sopenharmony_ci    pub fn wait_for_objects_etc(
10362add0d91Sopenharmony_ci        infos: *mut object_wait_info,
10372add0d91Sopenharmony_ci        numInfos: ::c_int,
10382add0d91Sopenharmony_ci        flags: u32,
10392add0d91Sopenharmony_ci        timeout: bigtime_t,
10402add0d91Sopenharmony_ci    ) -> ::ssize_t;
10412add0d91Sopenharmony_ci
10422add0d91Sopenharmony_ci    // kernel/fs_attr.h
10432add0d91Sopenharmony_ci    pub fn fs_read_attr(
10442add0d91Sopenharmony_ci        fd: ::c_int,
10452add0d91Sopenharmony_ci        attribute: *const ::c_char,
10462add0d91Sopenharmony_ci        type_: u32,
10472add0d91Sopenharmony_ci        pos: ::off_t,
10482add0d91Sopenharmony_ci        buffer: *mut ::c_void,
10492add0d91Sopenharmony_ci        readBytes: ::size_t,
10502add0d91Sopenharmony_ci    ) -> ::ssize_t;
10512add0d91Sopenharmony_ci    pub fn fs_write_attr(
10522add0d91Sopenharmony_ci        fd: ::c_int,
10532add0d91Sopenharmony_ci        attribute: *const ::c_char,
10542add0d91Sopenharmony_ci        type_: u32,
10552add0d91Sopenharmony_ci        pos: ::off_t,
10562add0d91Sopenharmony_ci        buffer: *const ::c_void,
10572add0d91Sopenharmony_ci        writeBytes: ::size_t,
10582add0d91Sopenharmony_ci    ) -> ::ssize_t;
10592add0d91Sopenharmony_ci    pub fn fs_remove_attr(fd: ::c_int, attribute: *const ::c_char) -> ::c_int;
10602add0d91Sopenharmony_ci    pub fn fs_stat_attr(
10612add0d91Sopenharmony_ci        fd: ::c_int,
10622add0d91Sopenharmony_ci        attribute: *const ::c_char,
10632add0d91Sopenharmony_ci        attrInfo: *mut attr_info,
10642add0d91Sopenharmony_ci    ) -> ::c_int;
10652add0d91Sopenharmony_ci
10662add0d91Sopenharmony_ci    pub fn fs_open_attr(
10672add0d91Sopenharmony_ci        path: *const ::c_char,
10682add0d91Sopenharmony_ci        attribute: *const ::c_char,
10692add0d91Sopenharmony_ci        type_: u32,
10702add0d91Sopenharmony_ci        openMode: ::c_int,
10712add0d91Sopenharmony_ci    ) -> ::c_int;
10722add0d91Sopenharmony_ci    pub fn fs_fopen_attr(
10732add0d91Sopenharmony_ci        fd: ::c_int,
10742add0d91Sopenharmony_ci        attribute: *const ::c_char,
10752add0d91Sopenharmony_ci        type_: u32,
10762add0d91Sopenharmony_ci        openMode: ::c_int,
10772add0d91Sopenharmony_ci    ) -> ::c_int;
10782add0d91Sopenharmony_ci    pub fn fs_close_attr(fd: ::c_int) -> ::c_int;
10792add0d91Sopenharmony_ci
10802add0d91Sopenharmony_ci    pub fn fs_open_attr_dir(path: *const ::c_char) -> *mut ::DIR;
10812add0d91Sopenharmony_ci    pub fn fs_lopen_attr_dir(path: *const ::c_char) -> *mut ::DIR;
10822add0d91Sopenharmony_ci    pub fn fs_fopen_attr_dir(fd: ::c_int) -> *mut ::DIR;
10832add0d91Sopenharmony_ci    pub fn fs_close_attr_dir(dir: *mut ::DIR) -> ::c_int;
10842add0d91Sopenharmony_ci    pub fn fs_read_attr_dir(dir: *mut ::DIR) -> *mut ::dirent;
10852add0d91Sopenharmony_ci    pub fn fs_rewind_attr_dir(dir: *mut ::DIR);
10862add0d91Sopenharmony_ci
10872add0d91Sopenharmony_ci    // kernel/fs_image.h
10882add0d91Sopenharmony_ci    pub fn fs_create_index(
10892add0d91Sopenharmony_ci        device: ::dev_t,
10902add0d91Sopenharmony_ci        name: *const ::c_char,
10912add0d91Sopenharmony_ci        type_: u32,
10922add0d91Sopenharmony_ci        flags: u32,
10932add0d91Sopenharmony_ci    ) -> ::c_int;
10942add0d91Sopenharmony_ci    pub fn fs_remove_index(device: ::dev_t, name: *const ::c_char) -> ::c_int;
10952add0d91Sopenharmony_ci    pub fn fs_stat_index(
10962add0d91Sopenharmony_ci        device: ::dev_t,
10972add0d91Sopenharmony_ci        name: *const ::c_char,
10982add0d91Sopenharmony_ci        indexInfo: *mut index_info,
10992add0d91Sopenharmony_ci    ) -> ::c_int;
11002add0d91Sopenharmony_ci
11012add0d91Sopenharmony_ci    pub fn fs_open_index_dir(device: ::dev_t) -> *mut ::DIR;
11022add0d91Sopenharmony_ci    pub fn fs_close_index_dir(indexDirectory: *mut ::DIR) -> ::c_int;
11032add0d91Sopenharmony_ci    pub fn fs_read_index_dir(indexDirectory: *mut ::DIR) -> *mut ::dirent;
11042add0d91Sopenharmony_ci    pub fn fs_rewind_index_dir(indexDirectory: *mut ::DIR);
11052add0d91Sopenharmony_ci
11062add0d91Sopenharmony_ci    // kernel/fs_info.h
11072add0d91Sopenharmony_ci    pub fn dev_for_path(path: *const ::c_char) -> ::dev_t;
11082add0d91Sopenharmony_ci    pub fn next_dev(pos: *mut i32) -> ::dev_t;
11092add0d91Sopenharmony_ci    pub fn fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int;
11102add0d91Sopenharmony_ci
11112add0d91Sopenharmony_ci    // kernel/fs_query.h
11122add0d91Sopenharmony_ci    pub fn fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR;
11132add0d91Sopenharmony_ci    pub fn fs_open_live_query(
11142add0d91Sopenharmony_ci        device: ::dev_t,
11152add0d91Sopenharmony_ci        query: *const ::c_char,
11162add0d91Sopenharmony_ci        flags: u32,
11172add0d91Sopenharmony_ci        port: port_id,
11182add0d91Sopenharmony_ci        token: i32,
11192add0d91Sopenharmony_ci    ) -> *mut ::DIR;
11202add0d91Sopenharmony_ci    pub fn fs_close_query(d: *mut ::DIR) -> ::c_int;
11212add0d91Sopenharmony_ci    pub fn fs_read_query(d: *mut ::DIR) -> *mut ::dirent;
11222add0d91Sopenharmony_ci    pub fn get_path_for_dirent(dent: *mut ::dirent, buf: *mut ::c_char, len: ::size_t) -> status_t;
11232add0d91Sopenharmony_ci
11242add0d91Sopenharmony_ci    // kernel/fs_volume.h
11252add0d91Sopenharmony_ci    pub fn fs_mount_volume(
11262add0d91Sopenharmony_ci        where_: *const ::c_char,
11272add0d91Sopenharmony_ci        device: *const ::c_char,
11282add0d91Sopenharmony_ci        filesystem: *const ::c_char,
11292add0d91Sopenharmony_ci        flags: u32,
11302add0d91Sopenharmony_ci        parameters: *const ::c_char,
11312add0d91Sopenharmony_ci    ) -> ::dev_t;
11322add0d91Sopenharmony_ci    pub fn fs_unmount_volume(path: *const ::c_char, flags: u32) -> status_t;
11332add0d91Sopenharmony_ci
11342add0d91Sopenharmony_ci    // kernel/image.h
11352add0d91Sopenharmony_ci    pub fn load_image(
11362add0d91Sopenharmony_ci        argc: i32,
11372add0d91Sopenharmony_ci        argv: *mut *const ::c_char,
11382add0d91Sopenharmony_ci        environ: *mut *const ::c_char,
11392add0d91Sopenharmony_ci    ) -> thread_id;
11402add0d91Sopenharmony_ci    pub fn load_add_on(path: *const ::c_char) -> image_id;
11412add0d91Sopenharmony_ci    pub fn unload_add_on(image: image_id) -> status_t;
11422add0d91Sopenharmony_ci    pub fn get_image_symbol(
11432add0d91Sopenharmony_ci        image: image_id,
11442add0d91Sopenharmony_ci        name: *const ::c_char,
11452add0d91Sopenharmony_ci        symbolType: i32,
11462add0d91Sopenharmony_ci        symbolLocation: *mut *mut ::c_void,
11472add0d91Sopenharmony_ci    ) -> status_t;
11482add0d91Sopenharmony_ci    pub fn get_nth_image_symbol(
11492add0d91Sopenharmony_ci        image: image_id,
11502add0d91Sopenharmony_ci        n: i32,
11512add0d91Sopenharmony_ci        nameBuffer: *mut ::c_char,
11522add0d91Sopenharmony_ci        nameLength: *mut i32,
11532add0d91Sopenharmony_ci        symbolType: *mut i32,
11542add0d91Sopenharmony_ci        symbolLocation: *mut *mut ::c_void,
11552add0d91Sopenharmony_ci    ) -> status_t;
11562add0d91Sopenharmony_ci    pub fn clear_caches(address: *mut ::c_void, length: ::size_t, flags: u32);
11572add0d91Sopenharmony_ci    pub fn _get_image_info(image: image_id, info: *mut image_info, size: ::size_t) -> status_t;
11582add0d91Sopenharmony_ci    pub fn _get_next_image_info(
11592add0d91Sopenharmony_ci        team: team_id,
11602add0d91Sopenharmony_ci        cookie: *mut i32,
11612add0d91Sopenharmony_ci        info: *mut image_info,
11622add0d91Sopenharmony_ci        size: ::size_t,
11632add0d91Sopenharmony_ci    ) -> status_t;
11642add0d91Sopenharmony_ci    pub fn find_path(
11652add0d91Sopenharmony_ci        codePointer: *const ::c_void,
11662add0d91Sopenharmony_ci        baseDirectory: path_base_directory,
11672add0d91Sopenharmony_ci        subPath: *const ::c_char,
11682add0d91Sopenharmony_ci        pathBuffer: *mut ::c_char,
11692add0d91Sopenharmony_ci        bufferSize: usize,
11702add0d91Sopenharmony_ci    ) -> status_t;
11712add0d91Sopenharmony_ci    pub fn find_path_etc(
11722add0d91Sopenharmony_ci        codePointer: *const ::c_void,
11732add0d91Sopenharmony_ci        dependency: *const ::c_char,
11742add0d91Sopenharmony_ci        architecture: *const ::c_char,
11752add0d91Sopenharmony_ci        baseDirectory: path_base_directory,
11762add0d91Sopenharmony_ci        subPath: *const ::c_char,
11772add0d91Sopenharmony_ci        flags: u32,
11782add0d91Sopenharmony_ci        pathBuffer: *mut ::c_char,
11792add0d91Sopenharmony_ci        bufferSize: ::size_t,
11802add0d91Sopenharmony_ci    ) -> status_t;
11812add0d91Sopenharmony_ci    pub fn find_path_for_path(
11822add0d91Sopenharmony_ci        path: *const ::c_char,
11832add0d91Sopenharmony_ci        baseDirectory: path_base_directory,
11842add0d91Sopenharmony_ci        subPath: *const ::c_char,
11852add0d91Sopenharmony_ci        pathBuffer: *mut ::c_char,
11862add0d91Sopenharmony_ci        bufferSize: ::size_t,
11872add0d91Sopenharmony_ci    ) -> status_t;
11882add0d91Sopenharmony_ci    pub fn find_path_for_path_etc(
11892add0d91Sopenharmony_ci        path: *const ::c_char,
11902add0d91Sopenharmony_ci        dependency: *const ::c_char,
11912add0d91Sopenharmony_ci        architectur: *const ::c_char,
11922add0d91Sopenharmony_ci        baseDirectory: path_base_directory,
11932add0d91Sopenharmony_ci        subPath: *const ::c_char,
11942add0d91Sopenharmony_ci        flags: u32,
11952add0d91Sopenharmony_ci        pathBuffer: *mut ::c_char,
11962add0d91Sopenharmony_ci        bufferSize: ::size_t,
11972add0d91Sopenharmony_ci    ) -> status_t;
11982add0d91Sopenharmony_ci    pub fn find_paths(
11992add0d91Sopenharmony_ci        baseDirectory: path_base_directory,
12002add0d91Sopenharmony_ci        subPath: *const ::c_char,
12012add0d91Sopenharmony_ci        _paths: *mut *mut *mut ::c_char,
12022add0d91Sopenharmony_ci        pathCount: *mut ::size_t,
12032add0d91Sopenharmony_ci    ) -> status_t;
12042add0d91Sopenharmony_ci    pub fn find_paths_etc(
12052add0d91Sopenharmony_ci        architecture: *const ::c_char,
12062add0d91Sopenharmony_ci        baseDirectory: path_base_directory,
12072add0d91Sopenharmony_ci        subPath: *const ::c_char,
12082add0d91Sopenharmony_ci        flags: u32,
12092add0d91Sopenharmony_ci        _paths: *mut *mut *mut ::c_char,
12102add0d91Sopenharmony_ci        pathCount: *mut ::size_t,
12112add0d91Sopenharmony_ci    ) -> status_t;
12122add0d91Sopenharmony_ci    pub fn find_directory(
12132add0d91Sopenharmony_ci        which: directory_which,
12142add0d91Sopenharmony_ci        volume: ::dev_t,
12152add0d91Sopenharmony_ci        createIt: bool,
12162add0d91Sopenharmony_ci        pathString: *mut ::c_char,
12172add0d91Sopenharmony_ci        length: i32,
12182add0d91Sopenharmony_ci    ) -> status_t;
12192add0d91Sopenharmony_ci}
12202add0d91Sopenharmony_ci
12212add0d91Sopenharmony_cicfg_if! {
12222add0d91Sopenharmony_ci    if #[cfg(libc_union)] {
12232add0d91Sopenharmony_ci        extern "C" {
12242add0d91Sopenharmony_ci            pub fn get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t;
12252add0d91Sopenharmony_ci        }
12262add0d91Sopenharmony_ci    }
12272add0d91Sopenharmony_ci}
12282add0d91Sopenharmony_ci
12292add0d91Sopenharmony_ci// The following functions are defined as macros in C/C++
12302add0d91Sopenharmony_ci#[inline]
12312add0d91Sopenharmony_cipub unsafe fn get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t {
12322add0d91Sopenharmony_ci    _get_cpu_info_etc(
12332add0d91Sopenharmony_ci        firstCPU,
12342add0d91Sopenharmony_ci        cpuCount,
12352add0d91Sopenharmony_ci        info,
12362add0d91Sopenharmony_ci        core::mem::size_of::<cpu_info>() as ::size_t,
12372add0d91Sopenharmony_ci    )
12382add0d91Sopenharmony_ci}
12392add0d91Sopenharmony_ci
12402add0d91Sopenharmony_ci#[inline]
12412add0d91Sopenharmony_cipub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t {
12422add0d91Sopenharmony_ci    _get_area_info(id, info, core::mem::size_of::<area_info>() as usize)
12432add0d91Sopenharmony_ci}
12442add0d91Sopenharmony_ci
12452add0d91Sopenharmony_ci#[inline]
12462add0d91Sopenharmony_cipub unsafe fn get_next_area_info(
12472add0d91Sopenharmony_ci    team: team_id,
12482add0d91Sopenharmony_ci    cookie: *mut isize,
12492add0d91Sopenharmony_ci    info: *mut area_info,
12502add0d91Sopenharmony_ci) -> status_t {
12512add0d91Sopenharmony_ci    _get_next_area_info(
12522add0d91Sopenharmony_ci        team,
12532add0d91Sopenharmony_ci        cookie,
12542add0d91Sopenharmony_ci        info,
12552add0d91Sopenharmony_ci        core::mem::size_of::<area_info>() as usize,
12562add0d91Sopenharmony_ci    )
12572add0d91Sopenharmony_ci}
12582add0d91Sopenharmony_ci
12592add0d91Sopenharmony_ci#[inline]
12602add0d91Sopenharmony_cipub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t {
12612add0d91Sopenharmony_ci    _get_port_info(port, buf, core::mem::size_of::<port_info>() as ::size_t)
12622add0d91Sopenharmony_ci}
12632add0d91Sopenharmony_ci
12642add0d91Sopenharmony_ci#[inline]
12652add0d91Sopenharmony_cipub unsafe fn get_next_port_info(
12662add0d91Sopenharmony_ci    port: port_id,
12672add0d91Sopenharmony_ci    cookie: *mut i32,
12682add0d91Sopenharmony_ci    portInfo: *mut port_info,
12692add0d91Sopenharmony_ci) -> status_t {
12702add0d91Sopenharmony_ci    _get_next_port_info(
12712add0d91Sopenharmony_ci        port,
12722add0d91Sopenharmony_ci        cookie,
12732add0d91Sopenharmony_ci        portInfo,
12742add0d91Sopenharmony_ci        core::mem::size_of::<port_info>() as ::size_t,
12752add0d91Sopenharmony_ci    )
12762add0d91Sopenharmony_ci}
12772add0d91Sopenharmony_ci
12782add0d91Sopenharmony_ci#[inline]
12792add0d91Sopenharmony_cipub unsafe fn get_port_message_info_etc(
12802add0d91Sopenharmony_ci    port: port_id,
12812add0d91Sopenharmony_ci    info: *mut port_message_info,
12822add0d91Sopenharmony_ci    flags: u32,
12832add0d91Sopenharmony_ci    timeout: bigtime_t,
12842add0d91Sopenharmony_ci) -> status_t {
12852add0d91Sopenharmony_ci    _get_port_message_info_etc(
12862add0d91Sopenharmony_ci        port,
12872add0d91Sopenharmony_ci        info,
12882add0d91Sopenharmony_ci        core::mem::size_of::<port_message_info>() as ::size_t,
12892add0d91Sopenharmony_ci        flags,
12902add0d91Sopenharmony_ci        timeout,
12912add0d91Sopenharmony_ci    )
12922add0d91Sopenharmony_ci}
12932add0d91Sopenharmony_ci
12942add0d91Sopenharmony_ci#[inline]
12952add0d91Sopenharmony_cipub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t {
12962add0d91Sopenharmony_ci    _get_sem_info(id, info, core::mem::size_of::<sem_info>() as ::size_t)
12972add0d91Sopenharmony_ci}
12982add0d91Sopenharmony_ci
12992add0d91Sopenharmony_ci#[inline]
13002add0d91Sopenharmony_cipub unsafe fn get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t {
13012add0d91Sopenharmony_ci    _get_next_sem_info(
13022add0d91Sopenharmony_ci        team,
13032add0d91Sopenharmony_ci        cookie,
13042add0d91Sopenharmony_ci        info,
13052add0d91Sopenharmony_ci        core::mem::size_of::<sem_info>() as ::size_t,
13062add0d91Sopenharmony_ci    )
13072add0d91Sopenharmony_ci}
13082add0d91Sopenharmony_ci
13092add0d91Sopenharmony_ci#[inline]
13102add0d91Sopenharmony_cipub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t {
13112add0d91Sopenharmony_ci    _get_team_info(team, info, core::mem::size_of::<team_info>() as ::size_t)
13122add0d91Sopenharmony_ci}
13132add0d91Sopenharmony_ci
13142add0d91Sopenharmony_ci#[inline]
13152add0d91Sopenharmony_cipub unsafe fn get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t {
13162add0d91Sopenharmony_ci    _get_next_team_info(cookie, info, core::mem::size_of::<team_info>() as ::size_t)
13172add0d91Sopenharmony_ci}
13182add0d91Sopenharmony_ci
13192add0d91Sopenharmony_ci#[inline]
13202add0d91Sopenharmony_cipub unsafe fn get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t {
13212add0d91Sopenharmony_ci    _get_team_usage_info(
13222add0d91Sopenharmony_ci        team,
13232add0d91Sopenharmony_ci        who,
13242add0d91Sopenharmony_ci        info,
13252add0d91Sopenharmony_ci        core::mem::size_of::<team_usage_info>() as ::size_t,
13262add0d91Sopenharmony_ci    )
13272add0d91Sopenharmony_ci}
13282add0d91Sopenharmony_ci
13292add0d91Sopenharmony_ci#[inline]
13302add0d91Sopenharmony_cipub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t {
13312add0d91Sopenharmony_ci    _get_thread_info(id, info, core::mem::size_of::<thread_info>() as ::size_t)
13322add0d91Sopenharmony_ci}
13332add0d91Sopenharmony_ci
13342add0d91Sopenharmony_ci#[inline]
13352add0d91Sopenharmony_cipub unsafe fn get_next_thread_info(
13362add0d91Sopenharmony_ci    team: team_id,
13372add0d91Sopenharmony_ci    cookie: *mut i32,
13382add0d91Sopenharmony_ci    info: *mut thread_info,
13392add0d91Sopenharmony_ci) -> status_t {
13402add0d91Sopenharmony_ci    _get_next_thread_info(
13412add0d91Sopenharmony_ci        team,
13422add0d91Sopenharmony_ci        cookie,
13432add0d91Sopenharmony_ci        info,
13442add0d91Sopenharmony_ci        core::mem::size_of::<thread_info>() as ::size_t,
13452add0d91Sopenharmony_ci    )
13462add0d91Sopenharmony_ci}
13472add0d91Sopenharmony_ci
13482add0d91Sopenharmony_ci// kernel/image.h
13492add0d91Sopenharmony_ci#[inline]
13502add0d91Sopenharmony_cipub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t {
13512add0d91Sopenharmony_ci    _get_image_info(image, info, core::mem::size_of::<image_info>() as ::size_t)
13522add0d91Sopenharmony_ci}
13532add0d91Sopenharmony_ci
13542add0d91Sopenharmony_ci#[inline]
13552add0d91Sopenharmony_cipub unsafe fn get_next_image_info(
13562add0d91Sopenharmony_ci    team: team_id,
13572add0d91Sopenharmony_ci    cookie: *mut i32,
13582add0d91Sopenharmony_ci    info: *mut image_info,
13592add0d91Sopenharmony_ci) -> status_t {
13602add0d91Sopenharmony_ci    _get_next_image_info(
13612add0d91Sopenharmony_ci        team,
13622add0d91Sopenharmony_ci        cookie,
13632add0d91Sopenharmony_ci        info,
13642add0d91Sopenharmony_ci        core::mem::size_of::<image_info>() as ::size_t,
13652add0d91Sopenharmony_ci    )
13662add0d91Sopenharmony_ci}
1367