/* automatically generated by rust-bindgen 0.72.1 */

pub const WIT_TYPE_U8: u32 = 0;
pub const WIT_TYPE_U16: u32 = 1;
pub const WIT_TYPE_U32: u32 = 2;
pub const WIT_TYPE_U64: u32 = 3;
pub const WIT_TYPE_S8: u32 = 4;
pub const WIT_TYPE_S16: u32 = 5;
pub const WIT_TYPE_S32: u32 = 6;
pub const WIT_TYPE_S64: u32 = 7;
pub const WIT_TYPE_BOOL: u32 = 8;
pub const WIT_TYPE_CHAR: u32 = 9;
pub const WIT_TYPE_F32: u32 = 10;
pub const WIT_TYPE_F64: u32 = 11;
pub const WIT_TYPE_STRING: u32 = 12;
pub const WIT_TYPE_ERROR_CONTEXT: u32 = 13;
pub const WIT_TYPE_RECORD: u32 = 14;
pub const WIT_TYPE_OWN: u32 = 15;
pub const WIT_TYPE_BORROW: u32 = 16;
pub const WIT_TYPE_FLAGS: u32 = 17;
pub const WIT_TYPE_TUPLE: u32 = 18;
pub const WIT_TYPE_VARIANT: u32 = 19;
pub const WIT_TYPE_ENUM: u32 = 20;
pub const WIT_TYPE_OPTION: u32 = 21;
pub const WIT_TYPE_RESULT: u32 = 22;
pub const WIT_TYPE_LIST: u32 = 23;
pub const WIT_TYPE_FIXED_LENGTH_LIST: u32 = 24;
pub const WIT_TYPE_FUTURE: u32 = 25;
pub const WIT_TYPE_STREAM: u32 = 26;
pub const WIT_TYPE_ALIAS: u32 = 27;
pub const WIT_TYPE_EMPTY: u32 = 255;
pub const WIT_CURRENT_VERSION: u32 = 2;
pub type wit_type_t = u32;
pub type wit_import_fn_t =
    ::std::option::Option<unsafe extern "C" fn(cx: *mut ::std::os::raw::c_void)>;
pub type wit_import_async_fn_t = ::std::option::Option<
    unsafe extern "C" fn(
        cx: *mut ::std::os::raw::c_void,
        abi_area: *mut ::std::os::raw::c_void,
    ) -> u32,
>;
pub type wit_import_async_lift_fn_t = ::std::option::Option<
    unsafe extern "C" fn(cx: *mut ::std::os::raw::c_void, abi_area: *mut ::std::os::raw::c_void),
>;
pub type wit_export_task_return_fn_t =
    ::std::option::Option<unsafe extern "C" fn(cx: *mut ::std::os::raw::c_void)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_import_func {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub impl_: wit_import_fn_t,
    pub async_impl: wit_import_async_fn_t,
    pub async_lift_impl: wit_import_async_lift_fn_t,
    pub nparams: usize,
    pub params: *const wit_type_t,
    pub result: wit_type_t,
    pub async_abi_area_size: usize,
    pub async_abi_area_align: usize,
}
pub type wit_import_func_t = wit_import_func;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_export_func {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub task_return: wit_export_task_return_fn_t,
    pub nparams: usize,
    pub params: *const wit_type_t,
    pub result: wit_type_t,
}
pub type wit_export_func_t = wit_export_func;
pub type wit_resource_drop_t = ::std::option::Option<unsafe extern "C" fn(arg1: u32)>;
pub type wit_resource_new_t = ::std::option::Option<unsafe extern "C" fn(arg1: usize) -> u32>;
pub type wit_resource_rep_t = ::std::option::Option<unsafe extern "C" fn(arg1: u32) -> usize>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_resource {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub drop: wit_resource_drop_t,
    pub new: wit_resource_new_t,
    pub rep: wit_resource_rep_t,
}
pub type wit_resource_t = wit_resource;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_field {
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
}
pub type wit_field_t = wit_field;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_record {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub nfields: usize,
    pub fields: *const wit_field_t,
}
pub type wit_record_t = wit_record;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_flags {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub nnames: usize,
    pub names: *mut *const ::std::os::raw::c_char,
}
pub type wit_flags_t = wit_flags;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_tuple {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ntypes: usize,
    pub types: *const wit_type_t,
}
pub type wit_tuple_t = wit_tuple;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_case {
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
}
pub type wit_case_t = wit_case;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_variant {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ncases: usize,
    pub cases: *const wit_case_t,
}
pub type wit_variant_t = wit_variant;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_enum {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub nnames: usize,
    pub names: *mut *const ::std::os::raw::c_char,
}
pub type wit_enum_t = wit_enum;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_option {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
}
pub type wit_option_t = wit_option;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_result {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ok: wit_type_t,
    pub err: wit_type_t,
}
pub type wit_result_t = wit_result;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_list {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
}
pub type wit_list_t = wit_list;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_fixed_length_list {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub size: usize,
    pub ty: wit_type_t,
}
pub type wit_fixed_length_list_t = wit_fixed_length_list;
pub type wit_lift_fn_t = ::std::option::Option<
    unsafe extern "C" fn(cx: *mut ::std::os::raw::c_void, buffer: *const ::std::os::raw::c_void),
>;
pub type wit_lower_fn_t = ::std::option::Option<
    unsafe extern "C" fn(cx: *mut ::std::os::raw::c_void, buffer: *mut ::std::os::raw::c_void),
>;
pub type wit_future_new_fn_t = ::std::option::Option<unsafe extern "C" fn() -> u64>;
pub type wit_future_read_fn_t = ::std::option::Option<
    unsafe extern "C" fn(future: u32, buffer: *mut ::std::os::raw::c_void) -> u32,
>;
pub type wit_future_write_fn_t = ::std::option::Option<
    unsafe extern "C" fn(future: u32, buffer: *const ::std::os::raw::c_void) -> u32,
>;
pub type wit_future_cancel_read_fn_t =
    ::std::option::Option<unsafe extern "C" fn(future: u32) -> u32>;
pub type wit_future_cancel_write_fn_t =
    ::std::option::Option<unsafe extern "C" fn(future: u32) -> u32>;
pub type wit_future_drop_readable_fn_t = ::std::option::Option<unsafe extern "C" fn(future: u32)>;
pub type wit_future_drop_writable_fn_t = ::std::option::Option<unsafe extern "C" fn(future: u32)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_future {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
    pub new: wit_future_new_fn_t,
    pub read: wit_future_read_fn_t,
    pub write: wit_future_write_fn_t,
    pub cancel_read: wit_future_cancel_read_fn_t,
    pub cancel_write: wit_future_cancel_write_fn_t,
    pub drop_readable: wit_future_drop_readable_fn_t,
    pub drop_writable: wit_future_drop_writable_fn_t,
    pub lift: wit_lift_fn_t,
    pub lower: wit_lower_fn_t,
    pub abi_payload_size: usize,
    pub abi_payload_align: usize,
}
pub type wit_future_t = wit_future;
pub type wit_stream_new_fn_t = ::std::option::Option<unsafe extern "C" fn() -> u64>;
pub type wit_stream_read_fn_t = ::std::option::Option<
    unsafe extern "C" fn(stream: u32, buffer: *mut ::std::os::raw::c_void, count: usize) -> u32,
>;
pub type wit_stream_write_fn_t = ::std::option::Option<
    unsafe extern "C" fn(stream: u32, buffer: *const ::std::os::raw::c_void, count: usize) -> u32,
>;
pub type wit_stream_cancel_read_fn_t =
    ::std::option::Option<unsafe extern "C" fn(stream: u32) -> u32>;
pub type wit_stream_cancel_write_fn_t =
    ::std::option::Option<unsafe extern "C" fn(stream: u32) -> u32>;
pub type wit_stream_drop_writable_fn_t = ::std::option::Option<unsafe extern "C" fn(stream: u32)>;
pub type wit_stream_drop_readable_fn_t = ::std::option::Option<unsafe extern "C" fn(stream: u32)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_stream {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
    pub new: wit_stream_new_fn_t,
    pub read: wit_stream_read_fn_t,
    pub write: wit_stream_write_fn_t,
    pub cancel_read: wit_stream_cancel_read_fn_t,
    pub cancel_write: wit_stream_cancel_write_fn_t,
    pub drop_readable: wit_stream_drop_readable_fn_t,
    pub drop_writable: wit_stream_drop_writable_fn_t,
    pub lift: wit_lift_fn_t,
    pub lower: wit_lower_fn_t,
    pub abi_payload_size: usize,
    pub abi_payload_align: usize,
}
pub type wit_stream_t = wit_stream;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit_alias {
    pub interface: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
    pub ty: wit_type_t,
}
pub type wit_alias_t = wit_alias;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wit {
    pub version: u32,
    pub num_import_funcs: usize,
    pub import_funcs: *const wit_import_func_t,
    pub num_export_funcs: usize,
    pub export_funcs: *const wit_export_func_t,
    pub num_resources: usize,
    pub resources: *const wit_resource_t,
    pub num_records: usize,
    pub records: *const wit_record_t,
    pub num_flags: usize,
    pub flags: *const wit_flags_t,
    pub num_tuples: usize,
    pub tuples: *const wit_tuple_t,
    pub num_variants: usize,
    pub variants: *const wit_variant_t,
    pub num_enums: usize,
    pub enums: *const wit_enum_t,
    pub num_options: usize,
    pub options: *const wit_option_t,
    pub num_results: usize,
    pub results: *const wit_result_t,
    pub num_lists: usize,
    pub lists: *const wit_list_t,
    pub num_fixed_length_lists: usize,
    pub fixed_length_lists: *const wit_fixed_length_list_t,
    pub num_futures: usize,
    pub futures: *const wit_future_t,
    pub num_streams: usize,
    pub streams: *const wit_stream_t,
    pub num_aliases: usize,
    pub aliases: *const wit_alias_t,
}
pub type wit_t = wit;
