# mypy: disable-error-code="empty-body"
from __future__ import annotations
import ctypes
from typing import Literal, TypeAlias
from tinygrad.runtime.support.c import _IO, _IOW, _IOR, _IOWR
from tinygrad.runtime.support import c
dll = c.DLL('iokit', 'IOKit')
class struct_IONotificationPort(c.Struct): pass
IONotificationPortRef: TypeAlias = c.POINTER[struct_IONotificationPort]
IOServiceMatchingCallback: TypeAlias = c.CFUNCTYPE[None, [ctypes.c_void_p, ctypes.c_uint32]]
IOServiceInterestCallback: TypeAlias = c.CFUNCTYPE[None, [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_void_p]]
mach_port_t: TypeAlias = ctypes.c_uint32
try: kIOMainPortDefault = mach_port_t.in_dll(dll, 'kIOMainPortDefault') # type: ignore
except (ValueError,AttributeError): pass
kern_return_t: TypeAlias = ctypes.c_int32
@dll.bind(kern_return_t, mach_port_t, c.POINTER[mach_port_t])
def IOMainPort(bootstrapPort:mach_port_t, mainPort:c.POINTER[mach_port_t]) -> kern_return_t: ...
try: kIOMasterPortDefault = mach_port_t.in_dll(dll, 'kIOMasterPortDefault') # type: ignore
except (ValueError,AttributeError): pass
@dll.bind(kern_return_t, mach_port_t, c.POINTER[mach_port_t])
def IOMasterPort(bootstrapPort:mach_port_t, mainPort:c.POINTER[mach_port_t]) -> kern_return_t: ...
@dll.bind(IONotificationPortRef, mach_port_t)
def IONotificationPortCreate(mainPort:mach_port_t) -> IONotificationPortRef: ...
@dll.bind(None, IONotificationPortRef)
def IONotificationPortDestroy(notify:IONotificationPortRef) -> None: ...
class struct___CFRunLoopSource(c.Struct): pass
CFRunLoopSourceRef: TypeAlias = c.POINTER[struct___CFRunLoopSource]
@dll.bind(CFRunLoopSourceRef, IONotificationPortRef)
def IONotificationPortGetRunLoopSource(notify:IONotificationPortRef) -> CFRunLoopSourceRef: ...
@dll.bind(mach_port_t, IONotificationPortRef)
def IONotificationPortGetMachPort(notify:IONotificationPortRef) -> mach_port_t: ...
@dll.bind(kern_return_t, IONotificationPortRef)
def IONotificationPortSetImportanceReceiver(notify:IONotificationPortRef) -> kern_return_t: ...
class struct_dispatch_queue_s(c.Struct): pass
dispatch_queue_t: TypeAlias = c.POINTER[struct_dispatch_queue_s]
@dll.bind(None, IONotificationPortRef, dispatch_queue_t)
def IONotificationPortSetDispatchQueue(notify:IONotificationPortRef, queue:dispatch_queue_t) -> None: ...
@c.record
class mach_msg_header_t(c.Struct):
  SIZE = 24
  msgh_bits: int
  msgh_size: int
  msgh_remote_port: int
  msgh_local_port: int
  msgh_voucher_port: int
  msgh_id: int
mach_msg_bits_t: TypeAlias = ctypes.c_uint32
mach_msg_size_t: TypeAlias = ctypes.c_uint32
mach_port_name_t: TypeAlias = ctypes.c_uint32
mach_msg_id_t: TypeAlias = ctypes.c_int32
mach_msg_header_t.register_fields([('msgh_bits', mach_msg_bits_t, 0), ('msgh_size', mach_msg_size_t, 4), ('msgh_remote_port', mach_port_t, 8), ('msgh_local_port', mach_port_t, 12), ('msgh_voucher_port', mach_port_name_t, 16), ('msgh_id', mach_msg_id_t, 20)])
@dll.bind(None, ctypes.c_void_p, c.POINTER[mach_msg_header_t], ctypes.c_void_p)
def IODispatchCalloutFromMessage(unused:ctypes.c_void_p, msg:c.POINTER[mach_msg_header_t], reference:ctypes.c_void_p) -> None: ...
uint32_t: TypeAlias = ctypes.c_uint32
@dll.bind(kern_return_t, uint32_t, c.POINTER[mach_port_t])
def IOCreateReceivePort(msgType:uint32_t, recvPort:c.POINTER[mach_port_t]) -> kern_return_t: ...
io_object_t: TypeAlias = ctypes.c_uint32
@dll.bind(kern_return_t, io_object_t)
def IOObjectRelease(object:io_object_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_object_t)
def IOObjectRetain(object:io_object_t) -> kern_return_t: ...
io_name_t: TypeAlias = c.Array[ctypes.c_char, Literal[128]]
@dll.bind(kern_return_t, io_object_t, io_name_t)
def IOObjectGetClass(object:io_object_t, className:io_name_t) -> kern_return_t: ...
class struct___CFString(c.Struct): pass
CFStringRef: TypeAlias = c.POINTER[struct___CFString]
@dll.bind(CFStringRef, io_object_t)
def IOObjectCopyClass(object:io_object_t) -> CFStringRef: ...
@dll.bind(CFStringRef, CFStringRef)
def IOObjectCopySuperclassForClass(classname:CFStringRef) -> CFStringRef: ...
@dll.bind(CFStringRef, CFStringRef)
def IOObjectCopyBundleIdentifierForClass(classname:CFStringRef) -> CFStringRef: ...
boolean_t: TypeAlias = ctypes.c_int32
@dll.bind(boolean_t, io_object_t, io_name_t)
def IOObjectConformsTo(object:io_object_t, className:io_name_t) -> boolean_t: ...
@dll.bind(boolean_t, io_object_t, io_object_t)
def IOObjectIsEqualTo(object:io_object_t, anObject:io_object_t) -> boolean_t: ...
@dll.bind(uint32_t, io_object_t)
def IOObjectGetKernelRetainCount(object:io_object_t) -> uint32_t: ...
@dll.bind(uint32_t, io_object_t)
def IOObjectGetUserRetainCount(object:io_object_t) -> uint32_t: ...
@dll.bind(uint32_t, io_object_t)
def IOObjectGetRetainCount(object:io_object_t) -> uint32_t: ...
io_iterator_t: TypeAlias = ctypes.c_uint32
@dll.bind(io_object_t, io_iterator_t)
def IOIteratorNext(iterator:io_iterator_t) -> io_object_t: ...
@dll.bind(None, io_iterator_t)
def IOIteratorReset(iterator:io_iterator_t) -> None: ...
@dll.bind(boolean_t, io_iterator_t)
def IOIteratorIsValid(iterator:io_iterator_t) -> boolean_t: ...
io_service_t: TypeAlias = ctypes.c_uint32
class struct___CFDictionary(c.Struct): pass
CFDictionaryRef: TypeAlias = c.POINTER[struct___CFDictionary]
@dll.bind(io_service_t, mach_port_t, CFDictionaryRef)
def IOServiceGetMatchingService(mainPort:mach_port_t, matching:CFDictionaryRef) -> io_service_t: ...
@dll.bind(kern_return_t, mach_port_t, CFDictionaryRef, c.POINTER[io_iterator_t])
def IOServiceGetMatchingServices(mainPort:mach_port_t, matching:CFDictionaryRef, existing:c.POINTER[io_iterator_t]) -> kern_return_t: ...
uintptr_t: TypeAlias = ctypes.c_uint64
@dll.bind(kern_return_t, mach_port_t, io_name_t, CFDictionaryRef, mach_port_t, uintptr_t, c.POINTER[io_iterator_t])
def IOServiceAddNotification(mainPort:mach_port_t, notificationType:io_name_t, matching:CFDictionaryRef, wakePort:mach_port_t, reference:uintptr_t, notification:c.POINTER[io_iterator_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, IONotificationPortRef, io_name_t, CFDictionaryRef, IOServiceMatchingCallback, ctypes.c_void_p, c.POINTER[io_iterator_t])
def IOServiceAddMatchingNotification(notifyPort:IONotificationPortRef, notificationType:io_name_t, matching:CFDictionaryRef, callback:IOServiceMatchingCallback, refCon:ctypes.c_void_p, notification:c.POINTER[io_iterator_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, IONotificationPortRef, io_service_t, io_name_t, IOServiceInterestCallback, ctypes.c_void_p, c.POINTER[io_object_t])
def IOServiceAddInterestNotification(notifyPort:IONotificationPortRef, service:io_service_t, interestType:io_name_t, callback:IOServiceInterestCallback, refCon:ctypes.c_void_p, notification:c.POINTER[io_object_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_service_t, CFDictionaryRef, c.POINTER[boolean_t])
def IOServiceMatchPropertyTable(service:io_service_t, matching:CFDictionaryRef, matches:c.POINTER[boolean_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_service_t, c.POINTER[uint32_t])
def IOServiceGetBusyState(service:io_service_t, busyState:c.POINTER[uint32_t]) -> kern_return_t: ...
@c.record
class struct_mach_timespec(c.Struct):
  SIZE = 8
  tv_sec: int
  tv_nsec: int
mach_timespec_t: TypeAlias = struct_mach_timespec
clock_res_t: TypeAlias = ctypes.c_int32
struct_mach_timespec.register_fields([('tv_sec', ctypes.c_uint32, 0), ('tv_nsec', clock_res_t, 4)])
@dll.bind(kern_return_t, io_service_t, c.POINTER[mach_timespec_t])
def IOServiceWaitQuiet(service:io_service_t, waitTime:c.POINTER[mach_timespec_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, c.POINTER[uint32_t])
def IOKitGetBusyState(mainPort:mach_port_t, busyState:c.POINTER[uint32_t]) -> kern_return_t: ...
IOOptionBits: TypeAlias = ctypes.c_uint32
@dll.bind(kern_return_t, mach_port_t, c.POINTER[mach_timespec_t], IOOptionBits)
def IOKitWaitQuietWithOptions(mainPort:mach_port_t, waitTime:c.POINTER[mach_timespec_t], options:IOOptionBits) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, c.POINTER[mach_timespec_t])
def IOKitWaitQuiet(mainPort:mach_port_t, waitTime:c.POINTER[mach_timespec_t]) -> kern_return_t: ...
task_port_t: TypeAlias = ctypes.c_uint32
io_connect_t: TypeAlias = ctypes.c_uint32
@dll.bind(kern_return_t, io_service_t, task_port_t, uint32_t, c.POINTER[io_connect_t])
def IOServiceOpen(service:io_service_t, owningTask:task_port_t, type:uint32_t, connect:c.POINTER[io_connect_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_service_t, uint32_t)
def IOServiceRequestProbe(service:io_service_t, options:uint32_t) -> kern_return_t: ...
_anonenum0: dict[int, str] = {(kIOServiceInteractionAllowed:=1): 'kIOServiceInteractionAllowed'}
@dll.bind(kern_return_t, io_service_t, uint32_t)
def IOServiceAuthorize(service:io_service_t, options:uint32_t) -> kern_return_t: ...
@dll.bind(ctypes.c_int32, io_service_t, ctypes.c_int32)
def IOServiceOpenAsFileDescriptor(service:io_service_t, oflag:int) -> int: ...
@dll.bind(kern_return_t, io_connect_t)
def IOServiceClose(connect:io_connect_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t)
def IOConnectAddRef(connect:io_connect_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t)
def IOConnectRelease(connect:io_connect_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, c.POINTER[io_service_t])
def IOConnectGetService(connect:io_connect_t, service:c.POINTER[io_service_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, mach_port_t, uintptr_t)
def IOConnectSetNotificationPort(connect:io_connect_t, type:uint32_t, port:mach_port_t, reference:uintptr_t) -> kern_return_t: ...
mach_vm_address_t: TypeAlias = ctypes.c_uint64
mach_vm_size_t: TypeAlias = ctypes.c_uint64
@dll.bind(kern_return_t, io_connect_t, uint32_t, task_port_t, c.POINTER[mach_vm_address_t], c.POINTER[mach_vm_size_t], IOOptionBits)
def IOConnectMapMemory(connect:io_connect_t, memoryType:uint32_t, intoTask:task_port_t, atAddress:c.POINTER[mach_vm_address_t], ofSize:c.POINTER[mach_vm_size_t], options:IOOptionBits) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, task_port_t, c.POINTER[mach_vm_address_t], c.POINTER[mach_vm_size_t], IOOptionBits)
def IOConnectMapMemory64(connect:io_connect_t, memoryType:uint32_t, intoTask:task_port_t, atAddress:c.POINTER[mach_vm_address_t], ofSize:c.POINTER[mach_vm_size_t], options:IOOptionBits) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, task_port_t, mach_vm_address_t)
def IOConnectUnmapMemory(connect:io_connect_t, memoryType:uint32_t, fromTask:task_port_t, atAddress:mach_vm_address_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, task_port_t, mach_vm_address_t)
def IOConnectUnmapMemory64(connect:io_connect_t, memoryType:uint32_t, fromTask:task_port_t, atAddress:mach_vm_address_t) -> kern_return_t: ...
CFTypeRef: TypeAlias = ctypes.c_void_p
@dll.bind(kern_return_t, io_connect_t, CFTypeRef)
def IOConnectSetCFProperties(connect:io_connect_t, properties:CFTypeRef) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, CFStringRef, CFTypeRef)
def IOConnectSetCFProperty(connect:io_connect_t, propertyName:CFStringRef, property:CFTypeRef) -> kern_return_t: ...
uint64_t: TypeAlias = ctypes.c_uint64
size_t: TypeAlias = ctypes.c_uint64
@dll.bind(kern_return_t, mach_port_t, uint32_t, c.POINTER[uint64_t], uint32_t, ctypes.c_void_p, size_t, c.POINTER[uint64_t], c.POINTER[uint32_t], ctypes.c_void_p, c.POINTER[size_t])
def IOConnectCallMethod(connection:mach_port_t, selector:uint32_t, input:c.POINTER[uint64_t], inputCnt:uint32_t, inputStruct:ctypes.c_void_p, inputStructCnt:size_t, output:c.POINTER[uint64_t], outputCnt:c.POINTER[uint32_t], outputStruct:ctypes.c_void_p, outputStructCnt:c.POINTER[size_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, mach_port_t, c.POINTER[uint64_t], uint32_t, c.POINTER[uint64_t], uint32_t, ctypes.c_void_p, size_t, c.POINTER[uint64_t], c.POINTER[uint32_t], ctypes.c_void_p, c.POINTER[size_t])
def IOConnectCallAsyncMethod(connection:mach_port_t, selector:uint32_t, wake_port:mach_port_t, reference:c.POINTER[uint64_t], referenceCnt:uint32_t, input:c.POINTER[uint64_t], inputCnt:uint32_t, inputStruct:ctypes.c_void_p, inputStructCnt:size_t, output:c.POINTER[uint64_t], outputCnt:c.POINTER[uint32_t], outputStruct:ctypes.c_void_p, outputStructCnt:c.POINTER[size_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, ctypes.c_void_p, size_t, ctypes.c_void_p, c.POINTER[size_t])
def IOConnectCallStructMethod(connection:mach_port_t, selector:uint32_t, inputStruct:ctypes.c_void_p, inputStructCnt:size_t, outputStruct:ctypes.c_void_p, outputStructCnt:c.POINTER[size_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, mach_port_t, c.POINTER[uint64_t], uint32_t, ctypes.c_void_p, size_t, ctypes.c_void_p, c.POINTER[size_t])
def IOConnectCallAsyncStructMethod(connection:mach_port_t, selector:uint32_t, wake_port:mach_port_t, reference:c.POINTER[uint64_t], referenceCnt:uint32_t, inputStruct:ctypes.c_void_p, inputStructCnt:size_t, outputStruct:ctypes.c_void_p, outputStructCnt:c.POINTER[size_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, c.POINTER[uint64_t], uint32_t, c.POINTER[uint64_t], c.POINTER[uint32_t])
def IOConnectCallScalarMethod(connection:mach_port_t, selector:uint32_t, input:c.POINTER[uint64_t], inputCnt:uint32_t, output:c.POINTER[uint64_t], outputCnt:c.POINTER[uint32_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, mach_port_t, c.POINTER[uint64_t], uint32_t, c.POINTER[uint64_t], uint32_t, c.POINTER[uint64_t], c.POINTER[uint32_t])
def IOConnectCallAsyncScalarMethod(connection:mach_port_t, selector:uint32_t, wake_port:mach_port_t, reference:c.POINTER[uint64_t], referenceCnt:uint32_t, input:c.POINTER[uint64_t], inputCnt:uint32_t, output:c.POINTER[uint64_t], outputCnt:c.POINTER[uint32_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t)
def IOConnectTrap0(connect:io_connect_t, index:uint32_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, uintptr_t)
def IOConnectTrap1(connect:io_connect_t, index:uint32_t, p1:uintptr_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, uintptr_t, uintptr_t)
def IOConnectTrap2(connect:io_connect_t, index:uint32_t, p1:uintptr_t, p2:uintptr_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, uintptr_t, uintptr_t, uintptr_t)
def IOConnectTrap3(connect:io_connect_t, index:uint32_t, p1:uintptr_t, p2:uintptr_t, p3:uintptr_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t)
def IOConnectTrap4(connect:io_connect_t, index:uint32_t, p1:uintptr_t, p2:uintptr_t, p3:uintptr_t, p4:uintptr_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t)
def IOConnectTrap5(connect:io_connect_t, index:uint32_t, p1:uintptr_t, p2:uintptr_t, p3:uintptr_t, p4:uintptr_t, p5:uintptr_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t)
def IOConnectTrap6(connect:io_connect_t, index:uint32_t, p1:uintptr_t, p2:uintptr_t, p3:uintptr_t, p4:uintptr_t, p5:uintptr_t, p6:uintptr_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_connect_t, io_connect_t)
def IOConnectAddClient(connect:io_connect_t, client:io_connect_t) -> kern_return_t: ...
io_registry_entry_t: TypeAlias = ctypes.c_uint32
@dll.bind(io_registry_entry_t, mach_port_t)
def IORegistryGetRootEntry(mainPort:mach_port_t) -> io_registry_entry_t: ...
io_string_t: TypeAlias = c.Array[ctypes.c_char, Literal[512]]
@dll.bind(io_registry_entry_t, mach_port_t, io_string_t)
def IORegistryEntryFromPath(mainPort:mach_port_t, path:io_string_t) -> io_registry_entry_t: ...
@dll.bind(io_registry_entry_t, mach_port_t, CFStringRef)
def IORegistryEntryCopyFromPath(mainPort:mach_port_t, path:CFStringRef) -> io_registry_entry_t: ...
_anonenum1: dict[int, str] = {(kIORegistryIterateRecursively:=1): 'kIORegistryIterateRecursively', (kIORegistryIterateParents:=2): 'kIORegistryIterateParents'}
@dll.bind(kern_return_t, mach_port_t, io_name_t, IOOptionBits, c.POINTER[io_iterator_t])
def IORegistryCreateIterator(mainPort:mach_port_t, plane:io_name_t, options:IOOptionBits, iterator:c.POINTER[io_iterator_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, IOOptionBits, c.POINTER[io_iterator_t])
def IORegistryEntryCreateIterator(entry:io_registry_entry_t, plane:io_name_t, options:IOOptionBits, iterator:c.POINTER[io_iterator_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_iterator_t)
def IORegistryIteratorEnterEntry(iterator:io_iterator_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_iterator_t)
def IORegistryIteratorExitEntry(iterator:io_iterator_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t)
def IORegistryEntryGetName(entry:io_registry_entry_t, name:io_name_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, io_name_t)
def IORegistryEntryGetNameInPlane(entry:io_registry_entry_t, plane:io_name_t, name:io_name_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, io_name_t)
def IORegistryEntryGetLocationInPlane(entry:io_registry_entry_t, plane:io_name_t, location:io_name_t) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, io_string_t)
def IORegistryEntryGetPath(entry:io_registry_entry_t, plane:io_name_t, path:io_string_t) -> kern_return_t: ...
@dll.bind(CFStringRef, io_registry_entry_t, io_name_t)
def IORegistryEntryCopyPath(entry:io_registry_entry_t, plane:io_name_t) -> CFStringRef: ...
@dll.bind(kern_return_t, io_registry_entry_t, c.POINTER[uint64_t])
def IORegistryEntryGetRegistryEntryID(entry:io_registry_entry_t, entryID:c.POINTER[uint64_t]) -> kern_return_t: ...
CFMutableDictionaryRef: TypeAlias = c.POINTER[struct___CFDictionary]
class struct___CFAllocator(c.Struct): pass
CFAllocatorRef: TypeAlias = c.POINTER[struct___CFAllocator]
@dll.bind(kern_return_t, io_registry_entry_t, c.POINTER[CFMutableDictionaryRef], CFAllocatorRef, IOOptionBits)
def IORegistryEntryCreateCFProperties(entry:io_registry_entry_t, properties:c.POINTER[CFMutableDictionaryRef], allocator:CFAllocatorRef, options:IOOptionBits) -> kern_return_t: ...
@dll.bind(CFTypeRef, io_registry_entry_t, CFStringRef, CFAllocatorRef, IOOptionBits)
def IORegistryEntryCreateCFProperty(entry:io_registry_entry_t, key:CFStringRef, allocator:CFAllocatorRef, options:IOOptionBits) -> CFTypeRef: ...
@dll.bind(CFTypeRef, io_registry_entry_t, io_name_t, CFStringRef, CFAllocatorRef, IOOptionBits)
def IORegistryEntrySearchCFProperty(entry:io_registry_entry_t, plane:io_name_t, key:CFStringRef, allocator:CFAllocatorRef, options:IOOptionBits) -> CFTypeRef: ...
io_struct_inband_t: TypeAlias = c.Array[ctypes.c_char, Literal[4096]]
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, io_struct_inband_t, c.POINTER[uint32_t])
def IORegistryEntryGetProperty(entry:io_registry_entry_t, propertyName:io_name_t, buffer:io_struct_inband_t, size:c.POINTER[uint32_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, CFTypeRef)
def IORegistryEntrySetCFProperties(entry:io_registry_entry_t, properties:CFTypeRef) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, CFStringRef, CFTypeRef)
def IORegistryEntrySetCFProperty(entry:io_registry_entry_t, propertyName:CFStringRef, property:CFTypeRef) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, c.POINTER[io_iterator_t])
def IORegistryEntryGetChildIterator(entry:io_registry_entry_t, plane:io_name_t, iterator:c.POINTER[io_iterator_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, c.POINTER[io_registry_entry_t])
def IORegistryEntryGetChildEntry(entry:io_registry_entry_t, plane:io_name_t, child:c.POINTER[io_registry_entry_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, c.POINTER[io_iterator_t])
def IORegistryEntryGetParentIterator(entry:io_registry_entry_t, plane:io_name_t, iterator:c.POINTER[io_iterator_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, io_registry_entry_t, io_name_t, c.POINTER[io_registry_entry_t])
def IORegistryEntryGetParentEntry(entry:io_registry_entry_t, plane:io_name_t, parent:c.POINTER[io_registry_entry_t]) -> kern_return_t: ...
@dll.bind(boolean_t, io_registry_entry_t, io_name_t)
def IORegistryEntryInPlane(entry:io_registry_entry_t, plane:io_name_t) -> boolean_t: ...
@dll.bind(CFMutableDictionaryRef, c.POINTER[ctypes.c_char])
def IOServiceMatching(name:c.POINTER[ctypes.c_char]) -> CFMutableDictionaryRef: ...
@dll.bind(CFMutableDictionaryRef, c.POINTER[ctypes.c_char])
def IOServiceNameMatching(name:c.POINTER[ctypes.c_char]) -> CFMutableDictionaryRef: ...
@dll.bind(CFMutableDictionaryRef, mach_port_t, uint32_t, c.POINTER[ctypes.c_char])
def IOBSDNameMatching(mainPort:mach_port_t, options:uint32_t, bsdName:c.POINTER[ctypes.c_char]) -> CFMutableDictionaryRef: ...
@dll.bind(CFMutableDictionaryRef, mach_port_t, uint32_t, c.POINTER[ctypes.c_char])
def IOOpenFirmwarePathMatching(mainPort:mach_port_t, options:uint32_t, path:c.POINTER[ctypes.c_char]) -> CFMutableDictionaryRef: ...
@dll.bind(CFMutableDictionaryRef, uint64_t)
def IORegistryEntryIDMatching(entryID:uint64_t) -> CFMutableDictionaryRef: ...
@dll.bind(kern_return_t, mach_port_t, io_name_t, io_name_t)
def IOServiceOFPathToBSDName(mainPort:mach_port_t, openFirmwarePath:io_name_t, bsdName:io_name_t) -> kern_return_t: ...
IOAsyncCallback0: TypeAlias = c.CFUNCTYPE[None, [ctypes.c_void_p, ctypes.c_int32]]
IOAsyncCallback1: TypeAlias = c.CFUNCTYPE[None, [ctypes.c_void_p, ctypes.c_int32, ctypes.c_void_p]]
IOAsyncCallback2: TypeAlias = c.CFUNCTYPE[None, [ctypes.c_void_p, ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p]]
IOAsyncCallback: TypeAlias = c.CFUNCTYPE[None, [ctypes.c_void_p, ctypes.c_int32, c.POINTER[ctypes.c_void_p], ctypes.c_uint32]]
vm_size_t: TypeAlias = ctypes.c_uint64
@dll.bind(kern_return_t, c.POINTER[mach_msg_header_t], uint32_t, c.POINTER[uint32_t], c.POINTER[uintptr_t], c.POINTER[ctypes.c_void_p], c.POINTER[vm_size_t])
def OSGetNotificationFromMessage(msg:c.POINTER[mach_msg_header_t], index:uint32_t, type:c.POINTER[uint32_t], reference:c.POINTER[uintptr_t], content:c.POINTER[ctypes.c_void_p], size:c.POINTER[vm_size_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, c.POINTER[ctypes.c_char], uint32_t)
def IOCatalogueSendData(mainPort:mach_port_t, flag:uint32_t, buffer:c.POINTER[ctypes.c_char], size:uint32_t) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, io_name_t)
def IOCatalogueTerminate(mainPort:mach_port_t, flag:uint32_t, description:io_name_t) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t, c.POINTER[c.POINTER[ctypes.c_char]], c.POINTER[uint32_t])
def IOCatalogueGetData(mainPort:mach_port_t, flag:uint32_t, buffer:c.POINTER[c.POINTER[ctypes.c_char]], size:c.POINTER[uint32_t]) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, io_name_t)
def IOCatalogueModuleLoaded(mainPort:mach_port_t, name:io_name_t) -> kern_return_t: ...
@dll.bind(kern_return_t, mach_port_t, uint32_t)
def IOCatalogueReset(mainPort:mach_port_t, flag:uint32_t) -> kern_return_t: ...
