|
| 1 | +// |
| 2 | +// Syscalls.swift |
| 3 | +// SwiftAndroid |
| 4 | +// |
| 5 | +// Created by Alsey Coleman Miller on 2/27/26. |
| 6 | +// |
| 7 | + |
| 8 | +#if canImport(Darwin) |
| 9 | +import Darwin |
| 10 | +#elseif canImport(Glibc) |
| 11 | +import Glibc |
| 12 | +#endif |
| 13 | + |
| 14 | +#if !os(Android) |
| 15 | + |
| 16 | +func stub() -> Never { |
| 17 | + fatalError("Not running on Android") |
| 18 | +} |
| 19 | + |
| 20 | +// MARK: - AAssetManager |
| 21 | + |
| 22 | +func AAssetManager_open( |
| 23 | + _ manager: OpaquePointer, |
| 24 | + _ fileName: UnsafePointer<CChar>?, |
| 25 | + _ mode: Int32 |
| 26 | +) -> OpaquePointer? { stub() } |
| 27 | + |
| 28 | +// MARK: - AAsset |
| 29 | + |
| 30 | +func AAsset_close(_ asset: OpaquePointer) { stub() } |
| 31 | + |
| 32 | +func AAsset_read( |
| 33 | + _ asset: OpaquePointer, |
| 34 | + _ buf: UnsafeMutableRawPointer?, |
| 35 | + _ count: Int |
| 36 | +) -> Int32 { stub() } |
| 37 | + |
| 38 | +func AAsset_seek64( |
| 39 | + _ asset: OpaquePointer, |
| 40 | + _ offset: Int64, |
| 41 | + _ whence: Int32 |
| 42 | +) -> Int64 { stub() } |
| 43 | + |
| 44 | +func AAsset_getLength64(_ asset: OpaquePointer) -> Int64 { stub() } |
| 45 | + |
| 46 | +func AAsset_getRemainingLength64(_ asset: OpaquePointer) -> Int64 { stub() } |
| 47 | + |
| 48 | +func AAsset_getBuffer(_ asset: OpaquePointer) -> UnsafeRawPointer? { stub() } |
| 49 | + |
| 50 | +func AAsset_isAllocated(_ asset: OpaquePointer) -> Int32 { stub() } |
| 51 | + |
| 52 | +func AAsset_openFileDescriptor64( |
| 53 | + _ asset: OpaquePointer, |
| 54 | + _ outStart: UnsafeMutablePointer<Int64>?, |
| 55 | + _ outLength: UnsafeMutablePointer<Int64>? |
| 56 | +) -> Int32 { stub() } |
| 57 | + |
| 58 | +// MARK: - AStorageManager |
| 59 | + |
| 60 | +func AStorageManager_new() -> OpaquePointer? { stub() } |
| 61 | + |
| 62 | +func AStorageManager_delete(_ manager: OpaquePointer) { stub() } |
| 63 | + |
| 64 | +func AStorageManager_mountObb( |
| 65 | + _ manager: OpaquePointer, |
| 66 | + _ filename: UnsafePointer<CChar>?, |
| 67 | + _ key: UnsafePointer<CChar>?, |
| 68 | + _ callback: UnsafeMutableRawPointer?, |
| 69 | + _ data: UnsafeMutableRawPointer? |
| 70 | +) { stub() } |
| 71 | + |
| 72 | +func AStorageManager_unmountObb( |
| 73 | + _ manager: OpaquePointer, |
| 74 | + _ filename: UnsafePointer<CChar>?, |
| 75 | + _ force: Int32, |
| 76 | + _ callback: UnsafeMutableRawPointer?, |
| 77 | + _ data: UnsafeMutableRawPointer? |
| 78 | +) { stub() } |
| 79 | + |
| 80 | +func AStorageManager_isObbMounted( |
| 81 | + _ manager: OpaquePointer, |
| 82 | + _ filename: UnsafePointer<CChar>? |
| 83 | +) -> Int32 { stub() } |
| 84 | + |
| 85 | +func AStorageManager_getMountedObbPath( |
| 86 | + _ manager: OpaquePointer, |
| 87 | + _ filename: UnsafePointer<CChar>? |
| 88 | +) -> UnsafePointer<CChar>? { stub() } |
| 89 | + |
| 90 | +#endif |
0 commit comments