Flutter iOS Embedder
IOKit.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // These declarations are an amalgamation of different headers whose
6 // symbols exist in IOKit.framework. The headers have been removed
7 // from the iOS SDKs but all the functions are documented here:
8 // * https://developer.apple.com/documentation/iokit/iokitlib_h?language=objc
9 // * https://developer.apple.com/documentation/iokit/iokit_functions?language=objc
10 // * file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Versions/A/Headers/IOKitLib.h
11 
12 #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG || \
13  FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE
14 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_IOKIT_H_
15 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_IOKIT_H_
16 
17 #if defined(__cplusplus)
18 extern "C" {
19 #endif // defined(__cplusplus)
20 
21 #include <CoreFoundation/CoreFoundation.h>
22 #include <mach/mach.h>
23 #include <stdint.h>
24 
25 #define IOKIT
26 #include <device/device_types.h>
27 
28 static const char* kIOServicePlane = "IOService";
29 
30 typedef io_object_t io_registry_entry_t;
31 typedef io_object_t io_service_t;
32 typedef io_object_t io_connect_t;
33 typedef io_object_t io_iterator_t;
34 
35 enum {
37 };
38 
39 extern const mach_port_t kIOMasterPortDefault;
40 
41 kern_return_t IOObjectRetain(io_object_t object);
42 kern_return_t IOObjectRelease(io_object_t object);
43 boolean_t IOObjectConformsTo(io_object_t object, const io_name_t name);
44 uint32_t IOObjectGetKernelRetainCount(io_object_t object);
45 kern_return_t IOObjectGetClass(io_object_t object, io_name_t name);
46 CFStringRef IOObjectCopyClass(io_object_t object);
47 CFStringRef IOObjectCopySuperclassForClass(CFStringRef name);
48 CFStringRef IOObjectCopyBundleIdentifierForClass(CFStringRef name);
49 
51 kern_return_t IORegistryEntryGetName(io_registry_entry_t entry, io_name_t name);
53  uint64_t* entryID);
55  const io_name_t plane,
56  io_string_t path);
58  const io_name_t name,
59  io_struct_inband_t buffer,
60  uint32_t* size);
62  io_registry_entry_t entry,
63  CFMutableDictionaryRef* properties,
64  CFAllocatorRef allocator,
65  uint32_t options);
67  CFStringRef key,
68  CFAllocatorRef allocator,
69  uint32_t options);
71  CFTypeRef properties);
72 
73 kern_return_t IORegistryCreateIterator(mach_port_t master,
74  const io_name_t plane,
75  uint32_t options,
76  io_iterator_t* it);
78  const io_name_t plane,
79  uint32_t options,
80  io_iterator_t* it);
82  const io_name_t plane,
83  io_iterator_t* it);
85  const io_name_t plane,
86  io_iterator_t* it);
87 io_object_t IOIteratorNext(io_iterator_t it);
88 boolean_t IOIteratorIsValid(io_iterator_t it);
90 
91 CFMutableDictionaryRef IOServiceMatching(const char* name) CF_RETURNS_RETAINED;
92 CFMutableDictionaryRef IOServiceNameMatching(const char* name)
93  CF_RETURNS_RETAINED;
95  mach_port_t master,
96  CFDictionaryRef matching CF_RELEASES_ARGUMENT);
97 kern_return_t IOServiceGetMatchingServices(
98  mach_port_t master,
99  CFDictionaryRef matching CF_RELEASES_ARGUMENT,
100  io_iterator_t* it);
101 
102 #if __cplusplus
103 }
104 #endif // __cplusplus
105 
106 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_IOKIT_H_
107 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_IOKIT_H_
108  // defined(FLUTTER_RUNTIME_MODE_PROFILE)
IOObjectGetKernelRetainCount
uint32_t IOObjectGetKernelRetainCount(io_object_t object)
io_connect_t
io_object_t io_connect_t
Definition: IOKit.h:32
IORegistryGetRootEntry
io_registry_entry_t IORegistryGetRootEntry(mach_port_t master)
IORegistryEntryGetRegistryEntryID
kern_return_t IORegistryEntryGetRegistryEntryID(io_registry_entry_t entry, uint64_t *entryID)
IOObjectRelease
kern_return_t IOObjectRelease(io_object_t object)
IORegistryEntryGetProperty
kern_return_t IORegistryEntryGetProperty(io_registry_entry_t entry, const io_name_t name, io_struct_inband_t buffer, uint32_t *size)
IOObjectRetain
kern_return_t IOObjectRetain(io_object_t object)
IOObjectCopyBundleIdentifierForClass
CFStringRef IOObjectCopyBundleIdentifierForClass(CFStringRef name)
IOServiceMatching
CFMutableDictionaryRef IOServiceMatching(const char *name) CF_RETURNS_RETAINED
IOIteratorReset
void IOIteratorReset(io_iterator_t it)
io_registry_entry_t
io_object_t io_registry_entry_t
Definition: IOKit.h:30
kIOReturnSuccess
@ kIOReturnSuccess
Definition: IOKit.h:36
IOObjectConformsTo
boolean_t IOObjectConformsTo(io_object_t object, const io_name_t name)
IORegistryEntryGetName
kern_return_t IORegistryEntryGetName(io_registry_entry_t entry, io_name_t name)
IORegistryEntrySetCFProperties
kern_return_t IORegistryEntrySetCFProperties(io_registry_entry_t entry, CFTypeRef properties)
kIOMasterPortDefault
const mach_port_t kIOMasterPortDefault
io_service_t
io_object_t io_service_t
Definition: IOKit.h:31
IORegistryEntryGetChildIterator
kern_return_t IORegistryEntryGetChildIterator(io_registry_entry_t entry, const io_name_t plane, io_iterator_t *it)
IORegistryCreateIterator
kern_return_t IORegistryCreateIterator(mach_port_t master, const io_name_t plane, uint32_t options, io_iterator_t *it)
IORegistryEntryCreateIterator
kern_return_t IORegistryEntryCreateIterator(io_registry_entry_t entry, const io_name_t plane, uint32_t options, io_iterator_t *it)
IOServiceNameMatching
CFMutableDictionaryRef IOServiceNameMatching(const char *name) CF_RETURNS_RETAINED
IOIteratorIsValid
boolean_t IOIteratorIsValid(io_iterator_t it)
IOServiceGetMatchingServices
kern_return_t IOServiceGetMatchingServices(mach_port_t master, CFDictionaryRef matching CF_RELEASES_ARGUMENT, io_iterator_t *it)
IOObjectCopyClass
CFStringRef IOObjectCopyClass(io_object_t object)
IORegistryEntryGetParentIterator
kern_return_t IORegistryEntryGetParentIterator(io_registry_entry_t entry, const io_name_t plane, io_iterator_t *it)
IOObjectGetClass
kern_return_t IOObjectGetClass(io_object_t object, io_name_t name)
IOServiceGetMatchingService
io_service_t IOServiceGetMatchingService(mach_port_t master, CFDictionaryRef matching CF_RELEASES_ARGUMENT)
IORegistryEntryGetPath
kern_return_t IORegistryEntryGetPath(io_registry_entry_t entry, const io_name_t plane, io_string_t path)
IOIteratorNext
io_object_t IOIteratorNext(io_iterator_t it)
IOObjectCopySuperclassForClass
CFStringRef IOObjectCopySuperclassForClass(CFStringRef name)
IORegistryEntryCreateCFProperty
CFTypeRef IORegistryEntryCreateCFProperty(io_registry_entry_t entry, CFStringRef key, CFAllocatorRef allocator, uint32_t options)
kIOServicePlane
static const char * kIOServicePlane
Definition: IOKit.h:28
io_iterator_t
io_object_t io_iterator_t
Definition: IOKit.h:33
IORegistryEntryCreateCFProperties
kern_return_t IORegistryEntryCreateCFProperties(io_registry_entry_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, uint32_t options)