peachsim 0.1.1667 → 0.1.1674

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +1 -1
  2. package/cli/bridge-flow-runner.ts +4 -1
  3. package/cli/commands/coverage-swift.ts +291 -0
  4. package/cli/commands/coverage.ts +168 -24
  5. package/cli/commands/diagnose.ts +1 -19
  6. package/cli/commands/inspect/settling.ts +37 -4
  7. package/cli/commands/react.ts +3 -18
  8. package/cli/commands/screenshot.ts +1 -1
  9. package/cli/commands/screenshots-capture.ts +1 -1
  10. package/cli/drivers/playwright-provisioning.ts +1 -4
  11. package/cli/drivers/playwright.ts +15 -1
  12. package/cli/scene-video.ts +1 -1
  13. package/cli/ui.ts +20 -0
  14. package/cli/ws-bridge.ts +7 -36
  15. package/detox/frame-identity.cjs +21 -0
  16. package/detox/frame-identity.d.cts +6 -0
  17. package/detox/index.ts +39 -33
  18. package/detox/jest-environment.cjs +4 -1
  19. package/detox/jest-setup-after-env.cjs +0 -4
  20. package/detox/navigation-lifecycle.ts +2 -2
  21. package/detox/proof-observer.ts +126 -0
  22. package/dist-lib/agent-daemon-client.cjs +29 -1
  23. package/dist-lib/agent-events.cjs +1 -1
  24. package/dist-lib/attached-projects.cjs +10 -1
  25. package/dist-lib/auth/shared-session.cjs +1 -1
  26. package/dist-lib/backend-origin.cjs +1 -1
  27. package/dist-lib/beta.cjs +1 -1
  28. package/dist-lib/beta.mjs +1 -1
  29. package/dist-lib/bridge-constants.cjs +1 -1
  30. package/dist-lib/bridge-contract-input.cjs +1 -1
  31. package/dist-lib/bridge-contract-input.mjs +1 -1
  32. package/dist-lib/bridge-contract.cjs +1 -1
  33. package/dist-lib/bridge-contract.mjs +1 -1
  34. package/dist-lib/bundle-channel.cjs +557 -158
  35. package/dist-lib/capture-contract.cjs +1 -1
  36. package/dist-lib/capture-contract.mjs +1 -1
  37. package/dist-lib/cloud-contract.cjs +1 -1
  38. package/dist-lib/cloud-contract.mjs +1 -1
  39. package/dist-lib/cloud-test-args.cjs +1 -1
  40. package/dist-lib/cloud-test-args.mjs +1 -1
  41. package/dist-lib/cloud.cjs +1 -1
  42. package/dist-lib/cloud.mjs +1 -1
  43. package/dist-lib/config.cjs +1 -1
  44. package/dist-lib/config.mjs +1 -1
  45. package/dist-lib/detox/index.cjs +5098 -7344
  46. package/dist-lib/detox/jest-environment.cjs +4 -1
  47. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  48. package/dist-lib/expo-swift-bundle.cjs +602 -152
  49. package/dist-lib/expo-swift-metadata.cjs +1 -1
  50. package/dist-lib/expo-swift-metadata.mjs +1 -1
  51. package/dist-lib/home-paths.cjs +1 -1
  52. package/dist-lib/host/bridge-host.cjs +688 -194
  53. package/dist-lib/host/fetch-proxy-handler.cjs +6 -3
  54. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  55. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  56. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  57. package/dist-lib/host/websocket-proxy.cjs +1 -1
  58. package/dist-lib/index.cjs +247 -11
  59. package/dist-lib/jump-to-source-babel.cjs +1 -1
  60. package/dist-lib/jump-to-source-native.cjs +1 -1
  61. package/dist-lib/kotlin-host.cjs +1 -1
  62. package/dist-lib/menu.cjs +1 -1
  63. package/dist-lib/menu.mjs +1 -1
  64. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  65. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  66. package/dist-lib/metro-production-bundle.cjs +10 -1
  67. package/dist-lib/metro-production-bundle.mjs +12 -1
  68. package/dist-lib/metro.cjs +155 -5
  69. package/dist-lib/native-app-identity-project.cjs +43 -5
  70. package/dist-lib/native-app-identity-project.mjs +43 -5
  71. package/dist-lib/native-app-identity.cjs +1 -1
  72. package/dist-lib/native-app-identity.mjs +1 -1
  73. package/dist-lib/native-firebase-metadata.cjs +1 -1
  74. package/dist-lib/native-firebase-metadata.mjs +1 -1
  75. package/dist-lib/plist.cjs +1 -1
  76. package/dist-lib/plist.mjs +1 -1
  77. package/dist-lib/profiles.cjs +21 -1
  78. package/dist-lib/public-brand.cjs +1 -1
  79. package/dist-lib/public-origins-lib-esm.json +73 -27
  80. package/dist-lib/public-origins-lib-static.json +1 -1
  81. package/dist-lib/public-origins-lib.json +563 -183
  82. package/dist-lib/react-native-host-modules.cjs +1 -1
  83. package/dist-lib/react-native-host-modules.mjs +1 -1
  84. package/dist-lib/reap-browser.cjs +964 -0
  85. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  86. package/dist-lib/sdk.cjs +38 -5
  87. package/dist-lib/sdk.mjs +38 -5
  88. package/dist-lib/skills.cjs +1031 -530
  89. package/dist-lib/swift-compile.cjs +298 -86
  90. package/dist-lib/swift-compile.mjs +298 -86
  91. package/dist-lib/swift-package.cjs +53 -4
  92. package/dist-lib/swift-package.mjs +52 -4
  93. package/dist-lib/swift-submit.cjs +2 -2
  94. package/dist-lib/swift-submit.mjs +2 -2
  95. package/dist-lib/swift-toolchain.cjs +25 -44
  96. package/dist-lib/swift.cjs +1 -1
  97. package/dist-lib/vite-swift.cjs +603 -114
  98. package/dist-lib/vite.cjs +65 -3
  99. package/dist-lib/worklet-executable.cjs +1 -1
  100. package/dist-lib/worklet-executable.mjs +1 -1
  101. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +7 -0
  102. package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +1 -1
  103. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
  104. package/dist-types/packages/peach-engine/src/engine/inspect-outline.d.ts +2 -1
  105. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
  106. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +4 -1
  107. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +7 -0
  108. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime-kind.d.ts +24 -0
  109. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +4 -2
  110. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +1 -1
  111. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +1 -0
  112. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +18 -0
  113. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +10 -1
  114. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  115. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +1 -0
  116. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  117. package/package.json +1 -1
  118. package/runtime-companion.json +1 -1
  119. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +2 -0
  120. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +54 -0
  121. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +23 -4
  122. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStore.h +439 -0
  123. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h +216 -0
  124. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreKey.h +267 -0
  125. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetwork.h +204 -0
  126. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConfiguration.h +1393 -0
  127. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConnection.h +568 -0
  128. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkReachability.h +369 -0
  129. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferences.h +473 -0
  130. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesPath.h +179 -0
  131. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesSetSpecific.h +95 -0
  132. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCSchemaDefinitions.h +2395 -0
  133. package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SystemConfiguration.h +184 -0
  134. package/sdk/ios/usr/include/_ctype.h +388 -0
  135. package/sdk/ios/usr/include/_inttypes.h +296 -0
  136. package/sdk/ios/usr/include/_locale.h +83 -0
  137. package/sdk/ios/usr/include/_locale_posix2008.h +65 -0
  138. package/sdk/ios/usr/include/_time.h +207 -0
  139. package/sdk/ios/usr/include/ctype.h +70 -0
  140. package/sdk/ios/usr/include/dispatch/dispatch.h +69 -6
  141. package/sdk/ios/usr/include/inttypes.h +35 -0
  142. package/sdk/ios/usr/include/libkern/OSByteOrder.h +315 -0
  143. package/sdk/ios/usr/include/libkern/machine/OSByteOrder.h +147 -0
  144. package/sdk/ios/usr/include/locale.h +59 -0
  145. package/sdk/ios/usr/include/runetype.h +118 -0
  146. package/sdk/ios/usr/include/setjmp.h +99 -0
  147. package/sdk/ios/usr/include/sys/_types/_clock_t.h +32 -0
  148. package/sdk/ios/usr/include/sys/_types/_ct_rune_t.h +33 -0
  149. package/sdk/ios/usr/include/sys/_types/_rune_t.h +32 -0
  150. package/sdk/ios/usr/include/sys/_types/_time_t.h +32 -0
  151. package/sdk/ios/usr/include/sys/_types/_wint_t.h +33 -0
  152. package/sdk/ios/usr/include/sys/cdefs.h +2 -0
  153. package/sdk/ios/usr/include/time.h +67 -2
  154. package/src/bridge-contract.ts +42 -0
  155. package/src/chromium-admission.ts +196 -0
  156. package/src/host/bridge-host.ts +6 -43
  157. package/src/host/rolldown-bundle-forward.ts +4 -1
  158. package/src/launch-deadline.ts +74 -0
  159. package/src/nitro-adapter.lock.json +3 -3
  160. package/src/profiles.ts +21 -0
  161. package/src/react-native-coverage/capability-reference-resolution.ts +402 -0
  162. package/src/react-native-coverage/capability-source-references.ts +1296 -0
  163. package/src/react-native-coverage/native-typescript-parser.ts +74 -0
  164. package/src/react-native-coverage/project-aliases.ts +207 -0
  165. package/src/react-native-coverage/verified-reach.ts +47 -0
  166. package/src/reap-browser.ts +1019 -0
  167. package/src/skills/builtin/a11y-review.ts +1 -1
  168. package/src/skills/builtin/perf-profile.ts +1 -1
  169. package/src/skills/builtin/screenshot-all.ts +1 -1
  170. package/src/skills/builtin/visual-diff.ts +1 -1
  171. package/src/swift-compile.ts +109 -57
  172. package/src/swift-coverage/indexdump.ts +80 -0
  173. package/src/swift-coverage/indexing.ts +147 -0
  174. package/src/swift-coverage/package.ts +230 -0
  175. package/src/swift-coverage/provenance.ts +47 -0
  176. package/src/swift-coverage/reader.ts +81 -0
  177. package/src/swift-coverage/source.ts +252 -0
  178. package/src/swift-coverage/types.ts +58 -0
  179. package/src/swift-coverage/xcode-assets.ts +175 -0
  180. package/src/swift-coverage/xcode-bridging.ts +160 -0
  181. package/src/swift-coverage/xcode-packages.ts +251 -0
  182. package/src/swift-coverage/xcode-strings.ts +78 -0
  183. package/src/swift-coverage/xcode.ts +656 -0
  184. package/src/swift-distribution.lock.json +8 -8
  185. package/src/swift-host.ts +21 -1
  186. package/src/swift-objc-compile.ts +7 -3
  187. package/src/swift-objc-import.ts +191 -27
  188. package/src/swift-objc-metadata.ts +2 -2
  189. package/src/swift-objc-standin.ts +9 -2
  190. package/src/swift-package-manifest.ts +134 -13
  191. package/src/swift-package.ts +69 -4
  192. package/src/swift-standins.ts +4 -1
  193. package/src/swift-submit.ts +2 -1
  194. package/src/swift-toolchain.ts +36 -61
  195. package/src/worker-system-chunks.ts +3 -10
  196. package/src/xcode-project.ts +5 -5
  197. package/detox/attempt-events.cjs +0 -914
  198. package/detox/attempt-events.d.cts +0 -113
  199. package/detox/motion-change.cjs +0 -524
  200. package/detox/motion-change.d.cts +0 -140
  201. package/detox/motion-leg-starts.cjs +0 -20
  202. package/detox/motion-leg-starts.d.cts +0 -8
  203. package/detox/proof-frame.cjs +0 -190
  204. package/detox/record-block-execution.cjs +0 -78
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+ /*
24
+ * Copyright (c) 1989, 1993
25
+ * The Regents of the University of California. All rights reserved.
26
+ * (c) UNIX System Laboratories, Inc.
27
+ * All or some portions of this file are derived from material licensed
28
+ * to the University of California by American Telephone and Telegraph
29
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30
+ * the permission of UNIX System Laboratories, Inc.
31
+ *
32
+ * This code is derived from software contributed to Berkeley by
33
+ * Paul Borman at Krystal Technologies.
34
+ *
35
+ * Redistribution and use in source and binary forms, with or without
36
+ * modification, are permitted provided that the following conditions
37
+ * are met:
38
+ * 1. Redistributions of source code must retain the above copyright
39
+ * notice, this list of conditions and the following disclaimer.
40
+ * 2. Redistributions in binary form must reproduce the above copyright
41
+ * notice, this list of conditions and the following disclaimer in the
42
+ * documentation and/or other materials provided with the distribution.
43
+ * 3. All advertising materials mentioning features or use of this software
44
+ * must display the following acknowledgement:
45
+ * This product includes software developed by the University of
46
+ * California, Berkeley and its contributors.
47
+ * 4. Neither the name of the University nor the names of its contributors
48
+ * may be used to endorse or promote products derived from this software
49
+ * without specific prior written permission.
50
+ *
51
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
52
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
55
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
57
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61
+ * SUCH DAMAGE.
62
+ *
63
+ * @(#)ctype.h 8.4 (Berkeley) 1/21/94
64
+ */
65
+
66
+ #include <_ctype.h>
67
+
68
+ #ifdef _USE_EXTENDED_LOCALES_
69
+ #include <xlocale/_ctype.h>
70
+ #endif /* _USE_EXTENDED_LOCALES_ */
@@ -2,6 +2,7 @@
2
2
  #include <sys/types.h>
3
3
  #include <stddef.h>
4
4
  #include <stdint.h>
5
+ #include <time.h>
5
6
  #include <stdbool.h>
6
7
  #include <stdarg.h>
7
8
  #include <string.h>
@@ -9,7 +10,10 @@
9
10
  #include <fcntl.h>
10
11
  #include <os/object.h>
11
12
  #if OS_OBJECT_USE_OBJC
12
- @protocol OS_dispatch_queue <NSObject>
13
+ @protocol OS_dispatch_object <NSObject>
14
+ @end
15
+ typedef NSObject<OS_dispatch_object> *dispatch_object_t;
16
+ @protocol OS_dispatch_queue <OS_dispatch_object>
13
17
  @end
14
18
  typedef NSObject<OS_dispatch_queue> *dispatch_queue_t;
15
19
  @protocol OS_dispatch_queue_global <OS_dispatch_queue>
@@ -21,12 +25,18 @@ typedef NSObject<OS_dispatch_queue_serial> *dispatch_queue_serial_t;
21
25
  @protocol OS_dispatch_queue_main <OS_dispatch_queue_serial>
22
26
  @end
23
27
  typedef NSObject<OS_dispatch_queue_main> *dispatch_queue_main_t;
24
- @protocol OS_dispatch_source <NSObject>
28
+ @protocol OS_dispatch_source <OS_dispatch_object>
25
29
  @end
26
30
  typedef NSObject<OS_dispatch_source> *dispatch_source_t;
27
- @protocol OS_dispatch_queue_attr <NSObject>
31
+ @protocol OS_dispatch_queue_attr <OS_dispatch_object>
28
32
  @end
29
33
  typedef NSObject<OS_dispatch_queue_attr> *dispatch_queue_attr_t;
34
+ @protocol OS_dispatch_group <OS_dispatch_object>
35
+ @end
36
+ typedef NSObject<OS_dispatch_group> *dispatch_group_t;
37
+ @protocol OS_dispatch_semaphore <OS_dispatch_object>
38
+ @end
39
+ typedef NSObject<OS_dispatch_semaphore> *dispatch_semaphore_t;
30
40
  #elif defined(__cplusplus)
31
41
  typedef struct dispatch_object_s {
32
42
  private:
@@ -41,6 +51,8 @@ typedef struct dispatch_queue_serial_s : public dispatch_queue_s {} *dispatch_qu
41
51
  typedef struct dispatch_queue_main_s : public dispatch_queue_serial_s {} *dispatch_queue_main_t;
42
52
  typedef struct dispatch_source_s : public dispatch_object_s {} *dispatch_source_t;
43
53
  typedef struct dispatch_queue_attr_s : public dispatch_object_s {} *dispatch_queue_attr_t;
54
+ typedef struct dispatch_group_s : public dispatch_object_s {} *dispatch_group_t;
55
+ typedef struct dispatch_semaphore_s : public dispatch_object_s {} *dispatch_semaphore_t;
44
56
  #else
45
57
  typedef struct dispatch_queue_s *dispatch_queue_t;
46
58
  typedef dispatch_queue_t dispatch_queue_global_t;
@@ -48,6 +60,22 @@ typedef dispatch_queue_t dispatch_queue_serial_t;
48
60
  typedef dispatch_queue_t dispatch_queue_main_t;
49
61
  typedef struct dispatch_source_s *dispatch_source_t;
50
62
  typedef struct dispatch_queue_attr_s *dispatch_queue_attr_t;
63
+ typedef struct dispatch_group_s *dispatch_group_t;
64
+ typedef struct dispatch_semaphore_s *dispatch_semaphore_t;
65
+ typedef union {
66
+ struct _os_object_s *_os_obj;
67
+ struct dispatch_object_s *_do;
68
+ struct dispatch_queue_s *_dq;
69
+ struct dispatch_queue_attr_s *_dqa;
70
+ struct dispatch_group_s *_dg;
71
+ struct dispatch_source_s *_ds;
72
+ struct dispatch_channel_s *_dch;
73
+ struct dispatch_mach_s *_dm;
74
+ struct dispatch_mach_msg_s *_dmsg;
75
+ struct dispatch_semaphore_s *_dsema;
76
+ struct dispatch_data_s *_ddata;
77
+ struct dispatch_io_s *_dchannel;
78
+ } dispatch_object_t __attribute__((__transparent_union__));
51
79
  #endif
52
80
  #define DISPATCH_QUEUE_PRIORITY_HIGH 2
53
81
  #define DISPATCH_QUEUE_PRIORITY_DEFAULT 0
@@ -62,14 +90,29 @@ typedef uint64_t dispatch_time_t;
62
90
  #define DISPATCH_TIME_NOW (0ull)
63
91
  #define DISPATCH_TIME_FOREVER (~0ull)
64
92
  #define DISPATCH_QUEUE_SERIAL NULL
93
+ #ifdef __cplusplus
94
+ extern "C" {
95
+ #endif
96
+ extern const struct dispatch_queue_attr_s _dispatch_queue_attr_concurrent;
97
+ #define DISPATCH_QUEUE_CONCURRENT DISPATCH_GLOBAL_OBJECT(dispatch_queue_attr_t, _dispatch_queue_attr_concurrent)
98
+ #define DISPATCH_CURRENT_QUEUE_LABEL NULL
99
+ enum { DISPATCH_WALLTIME_NOW __attribute__((availability(ios,introduced=12.0))) = ~1ull };
100
+ typedef const struct dispatch_source_type_s *dispatch_source_type_t;
101
+ extern const struct dispatch_source_type_s _dispatch_source_type_timer;
102
+ extern const struct dispatch_source_type_s _dispatch_source_type_memorypressure;
103
+ #define DISPATCH_SOURCE_TYPE_TIMER (&_dispatch_source_type_timer)
104
+ #define DISPATCH_SOURCE_TYPE_MEMORYPRESSURE (&_dispatch_source_type_memorypressure)
105
+ #define DISPATCH_TIMER_STRICT 0x1
106
+ typedef unsigned long dispatch_source_timer_flags_t;
107
+ #define DISPATCH_MEMORYPRESSURE_NORMAL 0x01
108
+ #define DISPATCH_MEMORYPRESSURE_WARN 0x02
109
+ #define DISPATCH_MEMORYPRESSURE_CRITICAL 0x04
110
+ typedef unsigned long dispatch_source_memorypressure_flags_t;
65
111
  typedef void (*dispatch_function_t)(void *_Nullable);
66
112
  #ifdef __BLOCKS__
67
113
  typedef void (^dispatch_block_t)(void);
68
114
  #endif
69
115
  typedef intptr_t dispatch_once_t __attribute__((availability(swift, unavailable, message="Use lazily initialized globals instead")));
70
- #ifdef __cplusplus
71
- extern "C" {
72
- #endif
73
116
  dispatch_queue_global_t _Nonnull dispatch_get_global_queue(intptr_t identifier, uintptr_t flags) __attribute__((const, warn_unused_result, nothrow, swift_private, availability(ios, introduced=4.0)));
74
117
  #ifdef __BLOCKS__
75
118
  void dispatch_async(dispatch_queue_t _Nonnull queue, dispatch_block_t _Nonnull block) __attribute__((nonnull, nothrow, swift_private, availability(ios, introduced=4.0)));
@@ -83,6 +126,23 @@ extern __attribute__((visibility("default"), availability(ios,introduced=4.0)))
83
126
  #endif
84
127
  static inline __attribute__((always_inline, const, nothrow, availability(swift, unavailable, message="Use getter:DispatchQueue.main()"))) dispatch_queue_main_t _Nonnull dispatch_get_main_queue(void) { return DISPATCH_GLOBAL_OBJECT(dispatch_queue_main_t, _dispatch_main_q); }
85
128
  dispatch_time_t dispatch_time(dispatch_time_t when, int64_t delta) __attribute__((warn_unused_result, nothrow, swift_private, availability(ios,introduced=4.0)));
129
+ dispatch_time_t dispatch_walltime(const struct timespec * _Nullable when, int64_t delta) __attribute__((warn_unused_result, nothrow));
130
+ void dispatch_retain(dispatch_object_t object) __attribute__((nonnull(1), nothrow));
131
+ void dispatch_release(dispatch_object_t object) __attribute__((nonnull(1), nothrow));
132
+ void dispatch_activate(dispatch_object_t object) __attribute__((nonnull(1), nothrow));
133
+ void dispatch_resume(dispatch_object_t object) __attribute__((nonnull(1), nothrow));
134
+ void dispatch_suspend(dispatch_object_t object) __attribute__((nonnull(1), nothrow));
135
+ dispatch_source_t _Nullable dispatch_source_create(dispatch_source_type_t _Nonnull type, uintptr_t handle, unsigned long mask, dispatch_queue_t _Nullable queue) __attribute__((ns_returns_retained, warn_unused_result, nothrow));
136
+ void dispatch_source_cancel(dispatch_source_t _Nonnull source) __attribute__((nothrow));
137
+ uintptr_t dispatch_source_get_data(dispatch_source_t _Nonnull source) __attribute__((warn_unused_result, nothrow));
138
+ void dispatch_source_set_timer(dispatch_source_t _Nonnull source, dispatch_time_t start, uint64_t interval, uint64_t leeway) __attribute__((nothrow));
139
+ dispatch_group_t _Nonnull dispatch_group_create(void) __attribute__((ns_returns_retained, warn_unused_result, nothrow));
140
+ void dispatch_group_enter(dispatch_group_t _Nonnull group) __attribute__((nothrow));
141
+ void dispatch_group_leave(dispatch_group_t _Nonnull group) __attribute__((nothrow));
142
+ intptr_t dispatch_group_wait(dispatch_group_t _Nonnull group, dispatch_time_t timeout) __attribute__((nothrow));
143
+ dispatch_semaphore_t _Nullable dispatch_semaphore_create(intptr_t value) __attribute__((ns_returns_retained, warn_unused_result, nothrow));
144
+ intptr_t dispatch_semaphore_wait(dispatch_semaphore_t _Nonnull semaphore, dispatch_time_t timeout) __attribute__((nothrow));
145
+ intptr_t dispatch_semaphore_signal(dispatch_semaphore_t _Nonnull semaphore) __attribute__((nothrow));
86
146
  dispatch_queue_t _Nonnull dispatch_queue_create(const char * _Nullable label, dispatch_queue_attr_t _Nullable attr) __attribute__((malloc, ns_returns_retained, warn_unused_result, nothrow, swift_private, availability(ios,introduced=4.0)));
87
147
  #ifndef DISPATCH_ALIAS_V2
88
148
  #if TARGET_OS_MAC
@@ -97,6 +157,9 @@ void dispatch_queue_set_specific(dispatch_queue_t _Nonnull queue, const void * _
97
157
  #ifdef __BLOCKS__
98
158
  void dispatch_after(dispatch_time_t when, dispatch_queue_t _Nonnull queue, dispatch_block_t _Nonnull block) __attribute__((nonnull(2, 3), nothrow, swift_private, availability(ios,introduced=4.0)));
99
159
  void dispatch_sync(dispatch_queue_t _Nonnull queue, __attribute__((noescape)) dispatch_block_t _Nonnull block) __attribute__((nonnull, nothrow, availability(ios,introduced=4.0)));
160
+ void dispatch_source_set_event_handler(dispatch_source_t _Nonnull source, dispatch_block_t _Nullable handler) __attribute__((nothrow));
161
+ void dispatch_group_async(dispatch_group_t _Nonnull group, dispatch_queue_t _Nonnull queue, dispatch_block_t _Nonnull block) __attribute__((nothrow));
162
+ void dispatch_group_notify(dispatch_group_t _Nonnull group, dispatch_queue_t _Nonnull queue, dispatch_block_t _Nonnull block) __attribute__((nothrow));
100
163
  #endif
101
164
  typedef enum : unsigned long {
102
165
  DISPATCH_AUTORELEASE_FREQUENCY_INHERIT __attribute__((availability(macos,introduced=10.12), availability(ios,introduced=10.0), availability(tvos,introduced=10.0), availability(watchos,introduced=3.0))) = 0,
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (c) 2000-2004, 2013, 2023 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
24
+ /*
25
+ * <inttypes.h> -- Standard C header, defined in ISO/IEC 9899:1999
26
+ * (aka "C99"), section 7.8. This defines format string conversion
27
+ * specifiers suitable for use within arguments to fprintf and fscanf
28
+ * and their ilk.
29
+ */
30
+
31
+ #include <_inttypes.h>
32
+
33
+ #ifdef _USE_EXTENDED_LOCALES_
34
+ #include <xlocale/_inttypes.h>
35
+ #endif /* _USE_EXTENDED_LOCALES_ */
@@ -0,0 +1,315 @@
1
+ /*
2
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. The rights granted to you under the License
10
+ * may not be used to create, or enable the creation or redistribution of,
11
+ * unlawful or unlicensed copies of an Apple operating system, or to
12
+ * circumvent, violate, or enable the circumvention or violation of, any
13
+ * terms of an Apple operating system software license agreement.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
18
+ * The Original Code and all software distributed under the License are
19
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
+ * Please see the License for the specific language governing rights and
24
+ * limitations under the License.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+
29
+ #ifndef _OS_OSBYTEORDER_H
30
+ #define _OS_OSBYTEORDER_H
31
+
32
+ #include <stdint.h>
33
+ #include <libkern/_OSByteOrder.h>
34
+
35
+ /* Macros for swapping constant values in the preprocessing stage. */
36
+ #define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x)
37
+ #define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x)
38
+ #define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x)
39
+
40
+ #if !defined(__DARWIN_OS_INLINE)
41
+ # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
42
+ # define __DARWIN_OS_INLINE static inline
43
+ # elif defined(__MWERKS__) || defined(__cplusplus)
44
+ # define __DARWIN_OS_INLINE static inline
45
+ # else
46
+ # define __DARWIN_OS_INLINE static __inline__
47
+ # endif
48
+ #endif
49
+
50
+ #if defined(__GNUC__)
51
+
52
+ #if defined (__arm__) || defined(__arm64__)
53
+ #include <libkern/arm/OSByteOrder.h>
54
+ #else
55
+ #include <libkern/machine/OSByteOrder.h>
56
+ #endif
57
+
58
+ #else /* ! __GNUC__ */
59
+
60
+ #include <libkern/machine/OSByteOrder.h>
61
+
62
+ #endif /* __GNUC__ */
63
+
64
+ #define OSSwapInt16(x) __DARWIN_OSSwapInt16(x)
65
+ #define OSSwapInt32(x) __DARWIN_OSSwapInt32(x)
66
+ #define OSSwapInt64(x) __DARWIN_OSSwapInt64(x)
67
+
68
+ enum {
69
+ OSUnknownByteOrder,
70
+ OSLittleEndian,
71
+ OSBigEndian
72
+ };
73
+
74
+ __DARWIN_OS_INLINE
75
+ int32_t
76
+ OSHostByteOrder(void)
77
+ {
78
+ #if defined(__LITTLE_ENDIAN__)
79
+ return OSLittleEndian;
80
+ #elif defined(__BIG_ENDIAN__)
81
+ return OSBigEndian;
82
+ #else
83
+ return OSUnknownByteOrder;
84
+ #endif
85
+ }
86
+
87
+ #define OSReadBigInt(x, y) OSReadBigInt32(x, y)
88
+ #define OSWriteBigInt(x, y, z) OSWriteBigInt32(x, y, z)
89
+ #define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x)
90
+ #define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x)
91
+ #define OSReadLittleInt(x, y) OSReadLittleInt32(x, y)
92
+ #define OSWriteLittleInt(x, y, z) OSWriteLittleInt32(x, y, z)
93
+ #define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x)
94
+ #define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x)
95
+
96
+ /* Functions for loading native endian values. */
97
+
98
+ __DARWIN_OS_INLINE
99
+ uint16_t
100
+ _OSReadInt16(
101
+ const volatile void * base,
102
+ uintptr_t byteOffset
103
+ )
104
+ {
105
+ return *(volatile uint16_t *)((uintptr_t)base + byteOffset);
106
+ }
107
+
108
+ __DARWIN_OS_INLINE
109
+ uint32_t
110
+ _OSReadInt32(
111
+ const volatile void * base,
112
+ uintptr_t byteOffset
113
+ )
114
+ {
115
+ return *(volatile uint32_t *)((uintptr_t)base + byteOffset);
116
+ }
117
+
118
+ __DARWIN_OS_INLINE
119
+ uint64_t
120
+ _OSReadInt64(
121
+ const volatile void * base,
122
+ uintptr_t byteOffset
123
+ )
124
+ {
125
+ return *(volatile uint64_t *)((uintptr_t)base + byteOffset);
126
+ }
127
+
128
+ /* Functions for storing native endian values. */
129
+
130
+ __DARWIN_OS_INLINE
131
+ void
132
+ _OSWriteInt16(
133
+ volatile void * base,
134
+ uintptr_t byteOffset,
135
+ uint16_t data
136
+ )
137
+ {
138
+ *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data;
139
+ }
140
+
141
+ __DARWIN_OS_INLINE
142
+ void
143
+ _OSWriteInt32(
144
+ volatile void * base,
145
+ uintptr_t byteOffset,
146
+ uint32_t data
147
+ )
148
+ {
149
+ *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data;
150
+ }
151
+
152
+ __DARWIN_OS_INLINE
153
+ void
154
+ _OSWriteInt64(
155
+ volatile void * base,
156
+ uintptr_t byteOffset,
157
+ uint64_t data
158
+ )
159
+ {
160
+ *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data;
161
+ }
162
+
163
+ #if defined(__BIG_ENDIAN__)
164
+
165
+ /* Functions for loading big endian to host endianess. */
166
+
167
+ #define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
168
+ #define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
169
+ #define OSReadBigInt64(base, byteOffset) _OSReadInt64(base, byteOffset)
170
+
171
+ /* Functions for storing host endianess to big endian. */
172
+
173
+ #define OSWriteBigInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data)
174
+ #define OSWriteBigInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data)
175
+ #define OSWriteBigInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data)
176
+
177
+ /* Functions for loading little endian to host endianess. */
178
+
179
+ #define OSReadLittleInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset)
180
+ #define OSReadLittleInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset)
181
+ #define OSReadLittleInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset)
182
+
183
+ /* Functions for storing host endianess to little endian. */
184
+
185
+ #define OSWriteLittleInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data)
186
+ #define OSWriteLittleInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data)
187
+ #define OSWriteLittleInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data)
188
+
189
+ /* Host endianess to big endian byte swapping macros for constants. */
190
+
191
+ #define OSSwapHostToBigConstInt16(x) ((uint16_t)(x))
192
+ #define OSSwapHostToBigConstInt32(x) ((uint32_t)(x))
193
+ #define OSSwapHostToBigConstInt64(x) ((uint64_t)(x))
194
+
195
+ /* Generic host endianess to big endian byte swapping functions. */
196
+
197
+ #define OSSwapHostToBigInt16(x) ((uint16_t)(x))
198
+ #define OSSwapHostToBigInt32(x) ((uint32_t)(x))
199
+ #define OSSwapHostToBigInt64(x) ((uint64_t)(x))
200
+
201
+ /* Host endianess to little endian byte swapping macros for constants. */
202
+
203
+ #define OSSwapHostToLittleConstInt16(x) OSSwapConstInt16(x)
204
+ #define OSSwapHostToLittleConstInt32(x) OSSwapConstInt32(x)
205
+ #define OSSwapHostToLittleConstInt64(x) OSSwapConstInt64(x)
206
+
207
+ /* Generic host endianess to little endian byte swapping functions. */
208
+
209
+ #define OSSwapHostToLittleInt16(x) OSSwapInt16(x)
210
+ #define OSSwapHostToLittleInt32(x) OSSwapInt32(x)
211
+ #define OSSwapHostToLittleInt64(x) OSSwapInt64(x)
212
+
213
+ /* Big endian to host endianess byte swapping macros for constants. */
214
+
215
+ #define OSSwapBigToHostConstInt16(x) ((uint16_t)(x))
216
+ #define OSSwapBigToHostConstInt32(x) ((uint32_t)(x))
217
+ #define OSSwapBigToHostConstInt64(x) ((uint64_t)(x))
218
+
219
+ /* Generic big endian to host endianess byte swapping functions. */
220
+
221
+ #define OSSwapBigToHostInt16(x) ((uint16_t)(x))
222
+ #define OSSwapBigToHostInt32(x) ((uint32_t)(x))
223
+ #define OSSwapBigToHostInt64(x) ((uint64_t)(x))
224
+
225
+ /* Little endian to host endianess byte swapping macros for constants. */
226
+
227
+ #define OSSwapLittleToHostConstInt16(x) OSSwapConstInt16(x)
228
+ #define OSSwapLittleToHostConstInt32(x) OSSwapConstInt32(x)
229
+ #define OSSwapLittleToHostConstInt64(x) OSSwapConstInt64(x)
230
+
231
+ /* Generic little endian to host endianess byte swapping functions. */
232
+
233
+ #define OSSwapLittleToHostInt16(x) OSSwapInt16(x)
234
+ #define OSSwapLittleToHostInt32(x) OSSwapInt32(x)
235
+ #define OSSwapLittleToHostInt64(x) OSSwapInt64(x)
236
+
237
+ #elif defined(__LITTLE_ENDIAN__)
238
+
239
+ /* Functions for loading big endian to host endianess. */
240
+
241
+ #define OSReadBigInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset)
242
+ #define OSReadBigInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset)
243
+ #define OSReadBigInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset)
244
+
245
+ /* Functions for storing host endianess to big endian. */
246
+
247
+ #define OSWriteBigInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data)
248
+ #define OSWriteBigInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data)
249
+ #define OSWriteBigInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data)
250
+
251
+ /* Functions for loading little endian to host endianess. */
252
+
253
+ #define OSReadLittleInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
254
+ #define OSReadLittleInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
255
+ #define OSReadLittleInt64(base, byteOffset) _OSReadInt64(base, byteOffset)
256
+
257
+ /* Functions for storing host endianess to little endian. */
258
+
259
+ #define OSWriteLittleInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data)
260
+ #define OSWriteLittleInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data)
261
+ #define OSWriteLittleInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data)
262
+
263
+ /* Host endianess to big endian byte swapping macros for constants. */
264
+
265
+ #define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x)
266
+ #define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x)
267
+ #define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x)
268
+
269
+ /* Generic host endianess to big endian byte swapping functions. */
270
+
271
+ #define OSSwapHostToBigInt16(x) OSSwapInt16(x)
272
+ #define OSSwapHostToBigInt32(x) OSSwapInt32(x)
273
+ #define OSSwapHostToBigInt64(x) OSSwapInt64(x)
274
+
275
+ /* Host endianess to little endian byte swapping macros for constants. */
276
+
277
+ #define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x))
278
+ #define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x))
279
+ #define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x))
280
+
281
+ /* Generic host endianess to little endian byte swapping functions. */
282
+
283
+ #define OSSwapHostToLittleInt16(x) ((uint16_t)(x))
284
+ #define OSSwapHostToLittleInt32(x) ((uint32_t)(x))
285
+ #define OSSwapHostToLittleInt64(x) ((uint64_t)(x))
286
+
287
+ /* Big endian to host endianess byte swapping macros for constants. */
288
+
289
+ #define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x)
290
+ #define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x)
291
+ #define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x)
292
+
293
+ /* Generic big endian to host endianess byte swapping functions. */
294
+
295
+ #define OSSwapBigToHostInt16(x) OSSwapInt16(x)
296
+ #define OSSwapBigToHostInt32(x) OSSwapInt32(x)
297
+ #define OSSwapBigToHostInt64(x) OSSwapInt64(x)
298
+
299
+ /* Little endian to host endianess byte swapping macros for constants. */
300
+
301
+ #define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x))
302
+ #define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x))
303
+ #define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x))
304
+
305
+ /* Generic little endian to host endianess byte swapping functions. */
306
+
307
+ #define OSSwapLittleToHostInt16(x) ((uint16_t)(x))
308
+ #define OSSwapLittleToHostInt32(x) ((uint32_t)(x))
309
+ #define OSSwapLittleToHostInt64(x) ((uint64_t)(x))
310
+
311
+ #else
312
+ #error Unknown endianess.
313
+ #endif
314
+
315
+ #endif /* ! _OS_OSBYTEORDER_H */