peachsim 0.1.1673 → 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 (111) hide show
  1. package/cli/commands/inspect/settling.ts +37 -4
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/attached-projects.cjs +1 -1
  5. package/dist-lib/auth/shared-session.cjs +1 -1
  6. package/dist-lib/backend-origin.cjs +1 -1
  7. package/dist-lib/beta.cjs +1 -1
  8. package/dist-lib/beta.mjs +1 -1
  9. package/dist-lib/bridge-constants.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.mjs +1 -1
  12. package/dist-lib/bridge-contract.cjs +1 -1
  13. package/dist-lib/bridge-contract.mjs +1 -1
  14. package/dist-lib/bundle-channel.cjs +32 -9
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cloud-contract.cjs +1 -1
  18. package/dist-lib/cloud-contract.mjs +1 -1
  19. package/dist-lib/cloud-test-args.cjs +1 -1
  20. package/dist-lib/cloud-test-args.mjs +1 -1
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +1 -1
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/config.mjs +1 -1
  25. package/dist-lib/detox/index.cjs +39 -6
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/expo-swift-bundle.cjs +29 -6
  28. package/dist-lib/expo-swift-metadata.cjs +1 -1
  29. package/dist-lib/expo-swift-metadata.mjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +34 -8
  32. package/dist-lib/host/fetch-proxy-handler.cjs +6 -3
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +43 -7
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +1 -1
  48. package/dist-lib/native-app-identity-project.cjs +1 -1
  49. package/dist-lib/native-app-identity-project.mjs +1 -1
  50. package/dist-lib/native-app-identity.cjs +1 -1
  51. package/dist-lib/native-app-identity.mjs +1 -1
  52. package/dist-lib/native-firebase-metadata.cjs +1 -1
  53. package/dist-lib/native-firebase-metadata.mjs +1 -1
  54. package/dist-lib/plist.cjs +1 -1
  55. package/dist-lib/plist.mjs +1 -1
  56. package/dist-lib/profiles.cjs +1 -1
  57. package/dist-lib/public-brand.cjs +1 -1
  58. package/dist-lib/public-origins-lib-esm.json +23 -23
  59. package/dist-lib/public-origins-lib.json +52 -52
  60. package/dist-lib/react-native-host-modules.cjs +1 -1
  61. package/dist-lib/react-native-host-modules.mjs +1 -1
  62. package/dist-lib/reap-browser.cjs +1 -1
  63. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  64. package/dist-lib/sdk.cjs +38 -5
  65. package/dist-lib/sdk.mjs +38 -5
  66. package/dist-lib/skills.cjs +74 -15
  67. package/dist-lib/swift-compile.cjs +27 -5
  68. package/dist-lib/swift-compile.mjs +27 -5
  69. package/dist-lib/swift-package.cjs +23 -4
  70. package/dist-lib/swift-package.mjs +23 -4
  71. package/dist-lib/swift-submit.cjs +1 -1
  72. package/dist-lib/swift-submit.mjs +1 -1
  73. package/dist-lib/swift-toolchain.cjs +1 -1
  74. package/dist-lib/swift.cjs +1 -1
  75. package/dist-lib/vite-swift.cjs +29 -6
  76. package/dist-lib/vite.cjs +6 -3
  77. package/dist-lib/worklet-executable.cjs +1 -1
  78. package/dist-lib/worklet-executable.mjs +1 -1
  79. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
  80. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +1 -1
  81. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +10 -1
  82. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  83. package/package.json +1 -1
  84. package/runtime-companion.json +1 -1
  85. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +18 -0
  86. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +23 -4
  87. package/sdk/ios/usr/include/_ctype.h +388 -0
  88. package/sdk/ios/usr/include/_inttypes.h +296 -0
  89. package/sdk/ios/usr/include/_locale.h +83 -0
  90. package/sdk/ios/usr/include/_locale_posix2008.h +65 -0
  91. package/sdk/ios/usr/include/_time.h +207 -0
  92. package/sdk/ios/usr/include/ctype.h +70 -0
  93. package/sdk/ios/usr/include/dispatch/dispatch.h +69 -6
  94. package/sdk/ios/usr/include/inttypes.h +35 -0
  95. package/sdk/ios/usr/include/locale.h +59 -0
  96. package/sdk/ios/usr/include/runetype.h +118 -0
  97. package/sdk/ios/usr/include/setjmp.h +99 -0
  98. package/sdk/ios/usr/include/sys/_types/_clock_t.h +32 -0
  99. package/sdk/ios/usr/include/sys/_types/_ct_rune_t.h +33 -0
  100. package/sdk/ios/usr/include/sys/_types/_rune_t.h +32 -0
  101. package/sdk/ios/usr/include/sys/_types/_time_t.h +32 -0
  102. package/sdk/ios/usr/include/sys/_types/_wint_t.h +33 -0
  103. package/sdk/ios/usr/include/sys/cdefs.h +2 -0
  104. package/sdk/ios/usr/include/time.h +67 -2
  105. package/src/host/rolldown-bundle-forward.ts +4 -1
  106. package/src/swift-compile.ts +2 -1
  107. package/src/swift-objc-compile.ts +7 -3
  108. package/src/swift-objc-metadata.ts +2 -2
  109. package/src/swift-objc-standin.ts +5 -0
  110. package/src/swift-package.ts +26 -3
  111. package/src/swift-standins.ts +4 -1
@@ -16,10 +16,19 @@ export interface SootSimAuxCompositorStats {
16
16
  browserCompositeFrames: number;
17
17
  shellScene: SootSimShellSceneFanoutStats | null;
18
18
  }
19
+ export type SootSimLiveCompositeFreshStage = 'readHeadlessFrames' | 'forceRenderAll' | 'paintNow';
20
+ export interface SootSimLiveCompositePublicationStatus {
21
+ holds: number;
22
+ subscribers: number;
23
+ painting: boolean;
24
+ paintsStarted: number;
25
+ paintsDrawn: number;
26
+ }
19
27
  export interface SootSimLiveCompositeBridge {
20
28
  getCanvas(): HTMLCanvasElement | null;
21
29
  getFrameToken(): number;
22
- captureFresh(): Promise<{
30
+ getPublicationStatus(): SootSimLiveCompositePublicationStatus;
31
+ captureFresh(onStage?: (stage: SootSimLiveCompositeFreshStage) => void): Promise<{
23
32
  canvas: HTMLCanvasElement | null;
24
33
  frameToken: number;
25
34
  }>;
@@ -33,7 +33,7 @@ export type { SootSimWindowScaleBridge } from './windowBridgeContract.d.ts';
33
33
  export type { SootSimElectronBridge } from './electronBridgeContract.d.ts';
34
34
  export { isBoxViewingMessage } from './shellBridgeContract.d.ts';
35
35
  export type { PeachHomeApp, PeachHomeStorageValue, PeachHomeStorageBinding, PeachHomeScreenConfig, SootSimConsoleBuffer, SootSimShellCommands, SootSimMainShellBridge, SootSimDemoShareLeaseOptions, SootSimDemoShareBridge, BoxViewingMode, BoxViewingMessage, } from './shellBridgeContract.d.ts';
36
- export type { SootSimRenderActivityState, SootSimShellSceneFanoutStats, SootSimAuxCompositorStats, SootSimLiveCompositeBridge, } from './compositorBridgeContract.d.ts';
36
+ export type { SootSimRenderActivityState, SootSimShellSceneFanoutStats, SootSimAuxCompositorStats, SootSimLiveCompositeBridge, SootSimLiveCompositeFreshStage, SootSimLiveCompositePublicationStatus, } from './compositorBridgeContract.d.ts';
37
37
  export type { PeachAnimatedExecution, PeachLockstepTenantFrame, SootSimLockstepFrameReceipt, LockstepInputReceipt, LockstepScheduledInput, SootSimLockstepCaptureController, SootSimLockstepCaptureBridge, } from './lockstepCaptureBridgeContract.d.ts';
38
38
  export type { PointerDeliveryTarget, PointerDeliveryPendingDrop, PointerDeliveryStats, SootSimShellHostBridge, } from './shellHostBridgeContract.d.ts';
39
39
  export type { SootSimLaunchArguments, SootSimExternalAppLifecycleOptions, SootSimStorageResetStrategy, SootSimExternalAppResetOptions, SootSimExternalAppResetResult, SootSimHotRemountBridge, } from './appLifecycleBridgeContract.d.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1673",
3
+ "version": "0.1.1674",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"64b30b73101e38ea8d4aaa3e07f22bdedd2736a7d1f0f21f9229f2f4daf45756","file":"node/cli-64b30b73101e38ea8d4aaa3e07f22bdedd2736a7d1f0f21f9229f2f4daf45756.cjs"}
1
+ {"abi":1,"sha256":"24766e3afc21d3c7b319b6d6db0422d93f64ecd0af7147a8ef16d16b5cb4e9a8","file":"node/cli-24766e3afc21d3c7b319b6d6db0422d93f64ecd0af7147a8ef16d16b5cb4e9a8.cjs"}
@@ -6,11 +6,29 @@
6
6
  #define __null_unspecified _Null_unspecified
7
7
  #endif
8
8
  #if !defined(CF_EXCLUDE_CSTD_HEADERS)
9
+ #include <sys/types.h>
10
+ #include <stdarg.h>
11
+ #include <assert.h>
12
+ #include <ctype.h>
9
13
  #include <errno.h>
14
+ #include <float.h>
15
+ #include <limits.h>
16
+ #include <locale.h>
10
17
  #include <math.h>
18
+ #include <setjmp.h>
11
19
  #include <signal.h>
20
+ #include <stddef.h>
21
+ #include <stdio.h>
12
22
  #include <stdlib.h>
13
23
  #include <string.h>
24
+ #include <time.h>
25
+ #if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__)
26
+ #include <inttypes.h>
27
+ #include <stdint.h>
28
+ #endif
29
+ #if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) && (__STDC_VERSION__ <= 201710L)
30
+ #include <stdbool.h>
31
+ #endif
14
32
  #endif
15
33
  #include <MacTypes.h>
16
34
  #include <TargetConditionals.h>
@@ -83,9 +83,28 @@ typedef void NSUncaughtExceptionHandler(NSException * _Nonnull exception);
83
83
  #define NS_ENUM(...) CF_ENUM(__VA_ARGS__)
84
84
  #define NS_CLOSED_ENUM(_type, _name) CF_CLOSED_ENUM(_type, _name)
85
85
  #define NS_OPTIONS(_type, _name) CF_OPTIONS(_type, _name)
86
- #define __PEACH_NAMED_ERROR_ENUM(_domain, _name) enum _name : NSInteger _name; enum __attribute__((ns_error_domain(_domain))) _name : NSInteger
87
- #define __PEACH_ANON_ERROR_ENUM(_domain) enum __attribute__((ns_error_domain(_domain))) : NSInteger
88
- #define NS_ERROR_ENUM(...) __PEACH_ENUM_GET(__VA_ARGS__, __PEACH_NAMED_ERROR_ENUM, __PEACH_ANON_ERROR_ENUM, )(__VA_ARGS__)
86
+ #define __NS_ERROR_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
87
+ #if ((__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))) && __has_attribute(ns_error_domain)
88
+ #define __NS_NAMED_ERROR_ENUM(_domain, _name) enum _name : NSInteger _name; enum __attribute__((ns_error_domain(_domain))) _name : NSInteger
89
+ #define __NS_ANON_ERROR_ENUM(_domain) enum __attribute__((ns_error_domain(_domain))) : NSInteger
90
+ #else
91
+ #define __NS_NAMED_ERROR_ENUM(_domain, _name) NS_ENUM(NSInteger, _name)
92
+ #define __NS_ANON_ERROR_ENUM(_domain) NS_ENUM(NSInteger)
93
+ #endif
94
+
95
+ /* NS_ERROR_ENUM supports the use of one or two arguments. The first argument is always the domain specifier for the enum. The second argument is an optional name of the typedef for the macro. When specifying a name for of the typedef, you must precede the macro with 'typedef' like so:
96
+
97
+ typedef NS_ERROR_ENUM(MyErrorDomain, SomeErrorCodes) {
98
+ ...
99
+ };
100
+
101
+ If you do not specify a typedef name, do not use 'typedef', like so:
102
+
103
+ NS_ERROR_ENUM(MyErrorDomain) {
104
+ ...
105
+ };
106
+ */
107
+ #define NS_ERROR_ENUM(...) __NS_ERROR_ENUM_GET_MACRO(__VA_ARGS__, __NS_NAMED_ERROR_ENUM, __NS_ANON_ERROR_ENUM)(__VA_ARGS__)
89
108
  #define NS_ENUM_AVAILABLE(...)
90
109
  #define NS_ENUM_AVAILABLE_IOS(...)
91
110
  #define NS_ENUM_DEPRECATED_IOS(...)
@@ -207,7 +226,7 @@ NS_INLINE NSRange NSMakeRange(NSUInteger loc, NSUInteger len) {
207
226
  r.length = len;
208
227
  return r;
209
228
  }
210
- typedef NS_ENUM(NSInteger, NSComparisonResult) { NSOrderedAscending = -1L, NSOrderedSame, NSOrderedDescending } NS_SWIFT_NAME(ComparisonResult);
229
+ typedef NS_CLOSED_ENUM(NSInteger, NSComparisonResult) { NSOrderedAscending = -1L, NSOrderedSame, NSOrderedDescending } NS_SWIFT_NAME(ComparisonResult);
211
230
  typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
212
231
  typedef NS_OPTIONS(NSUInteger, NSEnumerationOptions) { NSEnumerationConcurrent = (1UL << 0), NSEnumerationReverse = (1UL << 1) };
213
232
  typedef NS_OPTIONS(NSUInteger, NSStringCompareOptions) {
@@ -0,0 +1,388 @@
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
+ #ifndef _CTYPE_H_
67
+ #define _CTYPE_H_
68
+ #define __CTYPE_H_
69
+
70
+ #include <sys/cdefs.h>
71
+ #include <_bounds.h>
72
+ #include <runetype.h>
73
+
74
+ _LIBC_SINGLE_BY_DEFAULT()
75
+
76
+ #define _CTYPE_A 0x00000100L /* Alpha */
77
+ #define _CTYPE_C 0x00000200L /* Control */
78
+ #define _CTYPE_D 0x00000400L /* Digit */
79
+ #define _CTYPE_G 0x00000800L /* Graph */
80
+ #define _CTYPE_L 0x00001000L /* Lower */
81
+ #define _CTYPE_P 0x00002000L /* Punct */
82
+ #define _CTYPE_S 0x00004000L /* Space */
83
+ #define _CTYPE_U 0x00008000L /* Upper */
84
+ #define _CTYPE_X 0x00010000L /* X digit */
85
+ #define _CTYPE_B 0x00020000L /* Blank */
86
+ #define _CTYPE_R 0x00040000L /* Print */
87
+ #define _CTYPE_I 0x00080000L /* Ideogram */
88
+ #define _CTYPE_T 0x00100000L /* Special */
89
+ #define _CTYPE_Q 0x00200000L /* Phonogram */
90
+ #define _CTYPE_SW0 0x20000000L /* 0 width character */
91
+ #define _CTYPE_SW1 0x40000000L /* 1 width character */
92
+ #define _CTYPE_SW2 0x80000000L /* 2 width character */
93
+ #define _CTYPE_SW3 0xc0000000L /* 3 width character */
94
+ #define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */
95
+ #define _CTYPE_SWS 30 /* Bits to shift to get width */
96
+
97
+ #ifdef _NONSTD_SOURCE
98
+ /*
99
+ * Backward compatibility
100
+ */
101
+ #define _A _CTYPE_A /* Alpha */
102
+ #define _C _CTYPE_C /* Control */
103
+ #define _D _CTYPE_D /* Digit */
104
+ #define _G _CTYPE_G /* Graph */
105
+ #define _L _CTYPE_L /* Lower */
106
+ #define _P _CTYPE_P /* Punct */
107
+ #define _S _CTYPE_S /* Space */
108
+ #define _U _CTYPE_U /* Upper */
109
+ #define _X _CTYPE_X /* X digit */
110
+ #define _B _CTYPE_B /* Blank */
111
+ #define _R _CTYPE_R /* Print */
112
+ #define _I _CTYPE_I /* Ideogram */
113
+ #define _T _CTYPE_T /* Special */
114
+ #define _Q _CTYPE_Q /* Phonogram */
115
+ #define _SW0 _CTYPE_SW0 /* 0 width character */
116
+ #define _SW1 _CTYPE_SW1 /* 1 width character */
117
+ #define _SW2 _CTYPE_SW2 /* 2 width character */
118
+ #define _SW3 _CTYPE_SW3 /* 3 width character */
119
+ #endif /* _NONSTD_SOURCE */
120
+
121
+ #define __DARWIN_CTYPE_inline __header_inline
122
+
123
+ #define __DARWIN_CTYPE_TOP_inline __header_inline
124
+
125
+
126
+ /*
127
+ * Use inline functions if we are allowed to and the compiler supports them.
128
+ */
129
+ #if !defined(_DONT_USE_CTYPE_INLINE_) && \
130
+ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
131
+
132
+ /* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
133
+ __BEGIN_DECLS
134
+ unsigned long ___runetype(__darwin_ct_rune_t);
135
+ __darwin_ct_rune_t ___tolower(__darwin_ct_rune_t);
136
+ __darwin_ct_rune_t ___toupper(__darwin_ct_rune_t);
137
+ __END_DECLS
138
+
139
+ __DARWIN_CTYPE_TOP_inline int
140
+ isascii(int _c)
141
+ {
142
+ return ((_c & ~0x7F) == 0);
143
+ }
144
+
145
+ #ifdef USE_ASCII
146
+ __DARWIN_CTYPE_inline int
147
+ __maskrune(__darwin_ct_rune_t _c, unsigned long _f)
148
+ {
149
+ return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f;
150
+ }
151
+ #else /* !USE_ASCII */
152
+ __BEGIN_DECLS
153
+ int __maskrune(__darwin_ct_rune_t, unsigned long);
154
+ __END_DECLS
155
+ #endif /* USE_ASCII */
156
+
157
+ __DARWIN_CTYPE_inline int
158
+ __istype(__darwin_ct_rune_t _c, unsigned long _f)
159
+ {
160
+ #ifdef USE_ASCII
161
+ return !!(__maskrune(_c, _f));
162
+ #else /* USE_ASCII */
163
+ return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f)
164
+ : !!__maskrune(_c, _f));
165
+ #endif /* USE_ASCII */
166
+ }
167
+
168
+ __DARWIN_CTYPE_inline __darwin_ct_rune_t
169
+ __isctype(__darwin_ct_rune_t _c, unsigned long _f)
170
+ {
171
+ #ifdef USE_ASCII
172
+ return !!(__maskrune(_c, _f));
173
+ #else /* USE_ASCII */
174
+ return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
175
+ !!(_DefaultRuneLocale.__runetype[_c] & _f);
176
+ #endif /* USE_ASCII */
177
+ }
178
+
179
+ #ifdef USE_ASCII
180
+ __DARWIN_CTYPE_inline __darwin_ct_rune_t
181
+ __toupper(__darwin_ct_rune_t _c)
182
+ {
183
+ return _DefaultRuneLocale.__mapupper[_c & 0xff];
184
+ }
185
+
186
+ __DARWIN_CTYPE_inline __darwin_ct_rune_t
187
+ __tolower(__darwin_ct_rune_t _c)
188
+ {
189
+ return _DefaultRuneLocale.__maplower[_c & 0xff];
190
+ }
191
+ #else /* !USE_ASCII */
192
+ __BEGIN_DECLS
193
+ __darwin_ct_rune_t __toupper(__darwin_ct_rune_t);
194
+ __darwin_ct_rune_t __tolower(__darwin_ct_rune_t);
195
+ __END_DECLS
196
+ #endif /* USE_ASCII */
197
+
198
+ __DARWIN_CTYPE_inline int
199
+ __wcwidth(__darwin_ct_rune_t _c)
200
+ {
201
+ unsigned int _x;
202
+
203
+ if (_c == 0)
204
+ return (0);
205
+ _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R);
206
+ if ((_x & _CTYPE_SWM) != 0)
207
+ return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
208
+ return ((_x & _CTYPE_R) != 0 ? 1 : -1);
209
+ }
210
+
211
+ #ifndef _EXTERNALIZE_CTYPE_INLINES_
212
+
213
+ #define _tolower(c) __tolower(c)
214
+ #define _toupper(c) __toupper(c)
215
+
216
+ __DARWIN_CTYPE_TOP_inline int
217
+ isalnum(int _c)
218
+ {
219
+ return (__istype(_c, _CTYPE_A|_CTYPE_D));
220
+ }
221
+
222
+ __DARWIN_CTYPE_TOP_inline int
223
+ isalpha(int _c)
224
+ {
225
+ return (__istype(_c, _CTYPE_A));
226
+ }
227
+
228
+ __DARWIN_CTYPE_TOP_inline int
229
+ isblank(int _c)
230
+ {
231
+ return (__istype(_c, _CTYPE_B));
232
+ }
233
+
234
+ __DARWIN_CTYPE_TOP_inline int
235
+ iscntrl(int _c)
236
+ {
237
+ return (__istype(_c, _CTYPE_C));
238
+ }
239
+
240
+ /* ANSI -- locale independent */
241
+ __DARWIN_CTYPE_TOP_inline int
242
+ isdigit(int _c)
243
+ {
244
+ return (__isctype(_c, _CTYPE_D));
245
+ }
246
+
247
+ __DARWIN_CTYPE_TOP_inline int
248
+ isgraph(int _c)
249
+ {
250
+ return (__istype(_c, _CTYPE_G));
251
+ }
252
+
253
+ __DARWIN_CTYPE_TOP_inline int
254
+ islower(int _c)
255
+ {
256
+ return (__istype(_c, _CTYPE_L));
257
+ }
258
+
259
+ __DARWIN_CTYPE_TOP_inline int
260
+ isprint(int _c)
261
+ {
262
+ return (__istype(_c, _CTYPE_R));
263
+ }
264
+
265
+ __DARWIN_CTYPE_TOP_inline int
266
+ ispunct(int _c)
267
+ {
268
+ return (__istype(_c, _CTYPE_P));
269
+ }
270
+
271
+ __DARWIN_CTYPE_TOP_inline int
272
+ isspace(int _c)
273
+ {
274
+ return (__istype(_c, _CTYPE_S));
275
+ }
276
+
277
+ __DARWIN_CTYPE_TOP_inline int
278
+ isupper(int _c)
279
+ {
280
+ return (__istype(_c, _CTYPE_U));
281
+ }
282
+
283
+ /* ANSI -- locale independent */
284
+ __DARWIN_CTYPE_TOP_inline int
285
+ isxdigit(int _c)
286
+ {
287
+ return (__isctype(_c, _CTYPE_X));
288
+ }
289
+
290
+ __DARWIN_CTYPE_TOP_inline int
291
+ toascii(int _c)
292
+ {
293
+ return (_c & 0x7F);
294
+ }
295
+
296
+ __DARWIN_CTYPE_TOP_inline int
297
+ tolower(int _c)
298
+ {
299
+ return (__tolower(_c));
300
+ }
301
+
302
+ __DARWIN_CTYPE_TOP_inline int
303
+ toupper(int _c)
304
+ {
305
+ return (__toupper(_c));
306
+ }
307
+
308
+ #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
309
+ __DARWIN_CTYPE_TOP_inline int
310
+ digittoint(int _c)
311
+ {
312
+ return (__maskrune(_c, 0x0F));
313
+ }
314
+
315
+ __DARWIN_CTYPE_TOP_inline int
316
+ ishexnumber(int _c)
317
+ {
318
+ return (__istype(_c, _CTYPE_X));
319
+ }
320
+
321
+ __DARWIN_CTYPE_TOP_inline int
322
+ isideogram(int _c)
323
+ {
324
+ return (__istype(_c, _CTYPE_I));
325
+ }
326
+
327
+ __DARWIN_CTYPE_TOP_inline int
328
+ isnumber(int _c)
329
+ {
330
+ return (__istype(_c, _CTYPE_D));
331
+ }
332
+
333
+ __DARWIN_CTYPE_TOP_inline int
334
+ isphonogram(int _c)
335
+ {
336
+ return (__istype(_c, _CTYPE_Q));
337
+ }
338
+
339
+ __DARWIN_CTYPE_TOP_inline int
340
+ isrune(int _c)
341
+ {
342
+ return (__istype(_c, 0xFFFFFFF0L));
343
+ }
344
+
345
+ __DARWIN_CTYPE_TOP_inline int
346
+ isspecial(int _c)
347
+ {
348
+ return (__istype(_c, _CTYPE_T));
349
+ }
350
+ #endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
351
+ #endif /* _EXTERNALIZE_CTYPE_INLINES_ */
352
+
353
+ #else /* not using inlines */
354
+
355
+ __BEGIN_DECLS
356
+ int isalnum(int);
357
+ int isalpha(int);
358
+ int isblank(int);
359
+ int iscntrl(int);
360
+ int isdigit(int);
361
+ int isgraph(int);
362
+ int islower(int);
363
+ int isprint(int);
364
+ int ispunct(int);
365
+ int isspace(int);
366
+ int isupper(int);
367
+ int isxdigit(int);
368
+ int tolower(int);
369
+ int toupper(int);
370
+ int isascii(int);
371
+ int toascii(int);
372
+
373
+ #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
374
+ int _tolower(int);
375
+ int _toupper(int);
376
+ int digittoint(int);
377
+ int ishexnumber(int);
378
+ int isideogram(int);
379
+ int isnumber(int);
380
+ int isphonogram(int);
381
+ int isrune(int);
382
+ int isspecial(int);
383
+ #endif
384
+ __END_DECLS
385
+
386
+ #endif /* using inlines */
387
+
388
+ #endif /* !_CTYPE_H_ */