Function signature fixed

This commit is contained in:
Zachary
2024-10-29 08:19:25 -07:00
parent 5c79c16337
commit da0a6ff306

View File

@ -2,6 +2,7 @@ package libusb
import "core:c"
import "core:fmt"
//TODO: Make multiplatform
//TODO: Switch to sys/posix when linux support is finished
import "posix"
@ -1065,11 +1066,13 @@ Hotplug_Event :: enum c.int {
* Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
*
* Hotplug flags */
Hotplug_Flag :: enum c.int {
Hotplug_Flag_Bits :: enum c.int {
/** Arm the callback and fire it for all matching currently attached devices. */
ENUMERATE = 1,
}
Hotplug_Flag :: bit_set[Hotplug_Flag_Bits; c.int]
/** \ingroup libusb_hotplug
* Convenience macro when not using any flags */
HOTPLUG_NO_FLAGS :: 0
@ -1081,7 +1084,7 @@ Hotplug_Callback_Fn :: #type proc "c" (
ctx: Context,
device: ^Device,
event: Hotplug_Event,
user_date: rawptr,
user_data: rawptr,
) -> c.int
Callback_Handle :: distinct c.int
@ -1172,12 +1175,12 @@ foreign lib {
get_platform_descriptor :: proc(ctx: Context, dev_cap: ^Bos_Dev_Capability_Descriptor, platform_descriptor: ^^Platform_Descriptor) -> Error ---
free_platform_descriptor :: proc(platform_descriptor: ^Platform_Descriptor) ---
get_string_descriptor_ascii :: proc(dev_handle: ^Device_Handle, desc_index: u8, data: cstring, length: c.int) -> c.int ---
get_interface_association_descriptors :: proc(dev: ^Device, config_index: u8, iad_array: ^^Interface_Association_Descriptor_Array) -> Error ---
get_active_interface_association_descriptors :: proc(dev: ^Device, iad_array: ^^Interface_Association_Descriptor_Array) -> Error ---
get_interface_association_descriptors :: proc(dev: ^Device, config_index: u8, iad_array: [^][^]Interface_Association_Descriptor_Array) -> Error ---
get_active_interface_association_descriptors :: proc(dev: ^Device, iad_array: [^][^]Interface_Association_Descriptor_Array) -> Error ---
free_interface_association_descriptors :: proc(iad_array: ^Interface_Association_Descriptor_Array) -> Error ---
//----- Device hotplug event notification ----------------------------------
hotplug_register_callback :: proc(ctx: Context, events: c.int, flags: c.int, vendor_id: c.int, product_id: c.int, dev_class: c.int, cb_fn: Hotplug_Callback_Fn, callback_handle: Callback_Handle) -> Error ---
hotplug_register_callback :: proc(ctx: Context, events: c.int, flags: Hotplug_Flag, vendor_id: c.int, product_id: c.int, dev_class: c.int, cb_fn: Hotplug_Callback_Fn, callback_handle: Callback_Handle) -> Error ---
hotplug_deregister_callback :: proc(ctx: Context, hotplug_callback_handle: Callback_Handle) ---
hotplug_get_user_data :: proc(ctx: Context, hotplug_callback_handle: Callback_Handle) -> rawptr ---