From a1ad5b01a78cdeb982aab8704acf218c94678b22 Mon Sep 17 00:00:00 2001 From: Manuel Bl Date: Tue, 20 Feb 2024 21:23:14 +0100 Subject: [PATCH] macOS: remove unnecessary typedef includes --- java-does-usb/jextract/README.md | 2 + java-does-usb/jextract/macos/gen_macos.sh | 3 - .../macos/gen/iokit/IOCFPlugInInterface.java | 26 -------- .../gen/iokit/IOUSBDeviceInterface187.java | 55 ---------------- .../gen/iokit/IOUSBInterfaceInterface190.java | 66 ------------------- 5 files changed, 2 insertions(+), 150 deletions(-) delete mode 100644 java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOCFPlugInInterface.java delete mode 100644 java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBDeviceInterface187.java delete mode 100644 java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBInterfaceInterface190.java diff --git a/java-does-usb/jextract/README.md b/java-does-usb/jextract/README.md index 729896a..85ad11e 100644 --- a/java-does-usb/jextract/README.md +++ b/java-does-usb/jextract/README.md @@ -26,6 +26,8 @@ The resulting code is then committed to the source code repository. Before the c - `--include-typedef mystruct` if `mystruct` is actually a `struct`. - `--include-typedef mytypedef` if `mytypedef` is a `typedef` for a primitive type. +- *jextract* resolves all _typedef_s to their actual types. So this library does not use any _--include-typedef_ option. And there does not seem any obvious use for it. + ## Linux diff --git a/java-does-usb/jextract/macos/gen_macos.sh b/java-does-usb/jextract/macos/gen_macos.sh index a8eb2ac..1c5db86 100755 --- a/java-does-usb/jextract/macos/gen_macos.sh +++ b/java-does-usb/jextract/macos/gen_macos.sh @@ -42,7 +42,6 @@ $JEXTRACT --output ../../src/main/java \ --include-constant kIOReturnExclusiveAccess \ --include-var kCFRunLoopDefaultMode \ --include-struct IOCFPlugInInterfaceStruct \ - --include-typedef IOCFPlugInInterface \ --include-function IOObjectRelease \ --include-function IOIteratorNext \ --include-function IOCreatePlugInInterfaceForService \ @@ -53,12 +52,10 @@ $JEXTRACT --output ../../src/main/java \ --include-function IOServiceAddMatchingNotification \ --include-function IOServiceMatching \ --include-struct IOUSBDeviceStruct187 \ - --include-typedef IOUSBDeviceInterface187 \ --include-constant kIOUSBFindInterfaceDontCare \ --include-struct IOUSBFindInterfaceRequest \ --include-struct IOUSBDevRequest \ --include-struct IOUSBInterfaceStruct190 \ - --include-typedef IOUSBInterfaceInterface190 \ --include-constant kIOUSBTransactionTimeout \ --include-constant kIOReturnAborted \ --include-constant kIOUSBPipeStalled \ diff --git a/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOCFPlugInInterface.java b/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOCFPlugInInterface.java deleted file mode 100644 index 5fe6f2d..0000000 --- a/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOCFPlugInInterface.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by jextract - -package net.codecrete.usb.macos.gen.iokit; - -/** - * {@snippet lang=c : - * typedef struct IOCFPlugInInterfaceStruct { - * void *_reserved; - * HRESULT (*QueryInterface)(void *, REFIID, LPVOID *); - * ULONG (*AddRef)(void *); - * ULONG (*Release)(void *); - * UInt16 version; - * UInt16 revision; - * IOReturn (*Probe)(void *, CFDictionaryRef, io_service_t, SInt32 *); - * IOReturn (*Start)(void *, CFDictionaryRef, io_service_t); - * IOReturn (*Stop)(void *); - * } IOCFPlugInInterface - * } - */ -public class IOCFPlugInInterface extends IOCFPlugInInterfaceStruct { - - IOCFPlugInInterface() { - // Should not be called directly - } -} - diff --git a/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBDeviceInterface187.java b/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBDeviceInterface187.java deleted file mode 100644 index 739a592..0000000 --- a/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBDeviceInterface187.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by jextract - -package net.codecrete.usb.macos.gen.iokit; - -/** - * {@snippet lang=c : - * typedef struct IOUSBDeviceStruct187 { - * void *_reserved; - * HRESULT (*QueryInterface)(void *, REFIID, LPVOID *); - * ULONG (*AddRef)(void *); - * ULONG (*Release)(void *); - * IOReturn (*CreateDeviceAsyncEventSource)(void *, CFRunLoopSourceRef *); - * CFRunLoopSourceRef (*GetDeviceAsyncEventSource)(void *); - * IOReturn (*CreateDeviceAsyncPort)(void *, mach_port_t *); - * mach_port_t (*GetDeviceAsyncPort)(void *); - * IOReturn (*USBDeviceOpen)(void *); - * IOReturn (*USBDeviceClose)(void *); - * IOReturn (*GetDeviceClass)(void *, UInt8 *); - * IOReturn (*GetDeviceSubClass)(void *, UInt8 *); - * IOReturn (*GetDeviceProtocol)(void *, UInt8 *); - * IOReturn (*GetDeviceVendor)(void *, UInt16 *); - * IOReturn (*GetDeviceProduct)(void *, UInt16 *); - * IOReturn (*GetDeviceReleaseNumber)(void *, UInt16 *); - * IOReturn (*GetDeviceAddress)(void *, USBDeviceAddress *); - * IOReturn (*GetDeviceBusPowerAvailable)(void *, UInt32 *); - * IOReturn (*GetDeviceSpeed)(void *, UInt8 *); - * IOReturn (*GetNumberOfConfigurations)(void *, UInt8 *); - * IOReturn (*GetLocationID)(void *, UInt32 *); - * IOReturn (*GetConfigurationDescriptorPtr)(void *, UInt8, IOUSBConfigurationDescriptorPtr *); - * IOReturn (*GetConfiguration)(void *, UInt8 *); - * IOReturn (*SetConfiguration)(void *, UInt8); - * IOReturn (*GetBusFrameNumber)(void *, UInt64 *, AbsoluteTime *); - * IOReturn (*ResetDevice)(void *); - * IOReturn (*DeviceRequest)(void *, IOUSBDevRequest *); - * IOReturn (*DeviceRequestAsync)(void *, IOUSBDevRequest *, IOAsyncCallback1, void *); - * IOReturn (*CreateInterfaceIterator)(void *, IOUSBFindInterfaceRequest *, io_iterator_t *); - * IOReturn (*USBDeviceOpenSeize)(void *); - * IOReturn (*DeviceRequestTO)(void *, IOUSBDevRequestTO *); - * IOReturn (*DeviceRequestAsyncTO)(void *, IOUSBDevRequestTO *, IOAsyncCallback1, void *); - * IOReturn (*USBDeviceSuspend)(void *, Boolean); - * IOReturn (*USBDeviceAbortPipeZero)(void *); - * IOReturn (*USBGetManufacturerStringIndex)(void *, UInt8 *); - * IOReturn (*USBGetProductStringIndex)(void *, UInt8 *); - * IOReturn (*USBGetSerialNumberStringIndex)(void *, UInt8 *); - * IOReturn (*USBDeviceReEnumerate)(void *, UInt32); - * } IOUSBDeviceInterface187 - * } - */ -public class IOUSBDeviceInterface187 extends IOUSBDeviceStruct187 { - - IOUSBDeviceInterface187() { - // Should not be called directly - } -} - diff --git a/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBInterfaceInterface190.java b/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBInterfaceInterface190.java deleted file mode 100644 index 15e4f19..0000000 --- a/java-does-usb/src/main/java/net/codecrete/usb/macos/gen/iokit/IOUSBInterfaceInterface190.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by jextract - -package net.codecrete.usb.macos.gen.iokit; - -/** - * {@snippet lang=c : - * typedef struct IOUSBInterfaceStruct190 { - * void *_reserved; - * HRESULT (*QueryInterface)(void *, REFIID, LPVOID *); - * ULONG (*AddRef)(void *); - * ULONG (*Release)(void *); - * IOReturn (*CreateInterfaceAsyncEventSource)(void *, CFRunLoopSourceRef *); - * CFRunLoopSourceRef (*GetInterfaceAsyncEventSource)(void *); - * IOReturn (*CreateInterfaceAsyncPort)(void *, mach_port_t *); - * mach_port_t (*GetInterfaceAsyncPort)(void *); - * IOReturn (*USBInterfaceOpen)(void *); - * IOReturn (*USBInterfaceClose)(void *); - * IOReturn (*GetInterfaceClass)(void *, UInt8 *); - * IOReturn (*GetInterfaceSubClass)(void *, UInt8 *); - * IOReturn (*GetInterfaceProtocol)(void *, UInt8 *); - * IOReturn (*GetDeviceVendor)(void *, UInt16 *); - * IOReturn (*GetDeviceProduct)(void *, UInt16 *); - * IOReturn (*GetDeviceReleaseNumber)(void *, UInt16 *); - * IOReturn (*GetConfigurationValue)(void *, UInt8 *); - * IOReturn (*GetInterfaceNumber)(void *, UInt8 *); - * IOReturn (*GetAlternateSetting)(void *, UInt8 *); - * IOReturn (*GetNumEndpoints)(void *, UInt8 *); - * IOReturn (*GetLocationID)(void *, UInt32 *); - * IOReturn (*GetDevice)(void *, io_service_t *); - * IOReturn (*SetAlternateInterface)(void *, UInt8); - * IOReturn (*GetBusFrameNumber)(void *, UInt64 *, AbsoluteTime *); - * IOReturn (*ControlRequest)(void *, UInt8, IOUSBDevRequest *); - * IOReturn (*ControlRequestAsync)(void *, UInt8, IOUSBDevRequest *, IOAsyncCallback1, void *); - * IOReturn (*GetPipeProperties)(void *, UInt8, UInt8 *, UInt8 *, UInt8 *, UInt16 *, UInt8 *); - * IOReturn (*GetPipeStatus)(void *, UInt8); - * IOReturn (*AbortPipe)(void *, UInt8); - * IOReturn (*ResetPipe)(void *, UInt8); - * IOReturn (*ClearPipeStall)(void *, UInt8); - * IOReturn (*ReadPipe)(void *, UInt8, void *, UInt32 *); - * IOReturn (*WritePipe)(void *, UInt8, void *, UInt32); - * IOReturn (*ReadPipeAsync)(void *, UInt8, void *, UInt32, IOAsyncCallback1, void *); - * IOReturn (*WritePipeAsync)(void *, UInt8, void *, UInt32, IOAsyncCallback1, void *); - * IOReturn (*ReadIsochPipeAsync)(void *, UInt8, void *, UInt64, UInt32, IOUSBIsocFrame *, IOAsyncCallback1, void *); - * IOReturn (*WriteIsochPipeAsync)(void *, UInt8, void *, UInt64, UInt32, IOUSBIsocFrame *, IOAsyncCallback1, void *); - * IOReturn (*ControlRequestTO)(void *, UInt8, IOUSBDevRequestTO *); - * IOReturn (*ControlRequestAsyncTO)(void *, UInt8, IOUSBDevRequestTO *, IOAsyncCallback1, void *); - * IOReturn (*ReadPipeTO)(void *, UInt8, void *, UInt32 *, UInt32, UInt32); - * IOReturn (*WritePipeTO)(void *, UInt8, void *, UInt32, UInt32, UInt32); - * IOReturn (*ReadPipeAsyncTO)(void *, UInt8, void *, UInt32, UInt32, UInt32, IOAsyncCallback1, void *); - * IOReturn (*WritePipeAsyncTO)(void *, UInt8, void *, UInt32, UInt32, UInt32, IOAsyncCallback1, void *); - * IOReturn (*USBInterfaceGetStringIndex)(void *, UInt8 *); - * IOReturn (*USBInterfaceOpenSeize)(void *); - * IOReturn (*ClearPipeStallBothEnds)(void *, UInt8); - * IOReturn (*SetPipePolicy)(void *, UInt8, UInt16, UInt8); - * IOReturn (*GetBandwidthAvailable)(void *, UInt32 *); - * IOReturn (*GetEndpointProperties)(void *, UInt8, UInt8, UInt8, UInt8 *, UInt16 *, UInt8 *); - * } IOUSBInterfaceInterface190 - * } - */ -public class IOUSBInterfaceInterface190 extends IOUSBInterfaceStruct190 { - - IOUSBInterfaceInterface190() { - // Should not be called directly - } -} -