@shd101wyy/yo 0.1.25 → 0.1.27
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.
- package/.github/skills/yo-async-effects/SKILL.md +4 -4
- package/.github/skills/yo-async-effects/async-effects-recipes.md +40 -40
- package/.github/skills/yo-core-patterns/SKILL.md +1 -1
- package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +30 -26
- package/.github/skills/yo-project-workflow/SKILL.md +6 -3
- package/.github/skills/yo-project-workflow/workflow-cheatsheet.md +34 -11
- package/.github/skills/yo-syntax/SKILL.md +7 -6
- package/.github/skills/yo-syntax/syntax-cheatsheet.md +78 -60
- package/.github/skills/yo-wasm-integration/wasm-integration-cheatsheet.md +3 -3
- package/README.md +10 -8
- package/out/cjs/index.cjs +583 -567
- package/out/cjs/yo-cli.cjs +664 -632
- package/out/cjs/yo-lsp.cjs +510 -485
- package/out/esm/index.mjs +538 -522
- package/out/types/src/codegen/codegen-c.d.ts +2 -2
- package/out/types/src/codegen/functions/collection.d.ts +2 -2
- package/out/types/src/codegen/functions/context.d.ts +3 -2
- package/out/types/src/codegen/types/collection.d.ts +2 -2
- package/out/types/src/codegen/utils/index.d.ts +3 -1
- package/out/types/src/doc/builder.d.ts +2 -2
- package/out/types/src/evaluator/calls/closure-type.d.ts +2 -2
- package/out/types/src/evaluator/calls/record-type.d.ts +11 -0
- package/out/types/src/evaluator/context.d.ts +8 -9
- package/out/types/src/evaluator/index.d.ts +3 -3
- package/out/types/src/evaluator/types/record.d.ts +14 -0
- package/out/types/src/evaluator/types/validation.d.ts +2 -2
- package/out/types/src/evaluator/values/anonymous-module.d.ts +5 -5
- package/out/types/src/evaluator/values/impl.d.ts +1 -1
- package/out/types/src/expr.d.ts +1 -4
- package/out/types/src/formatter.d.ts +11 -0
- package/out/types/src/function-value.d.ts +1 -1
- package/out/types/src/lsp/document-manager.d.ts +1 -1
- package/out/types/src/lsp/formatting.d.ts +2 -0
- package/out/types/src/module-manager.d.ts +3 -3
- package/out/types/src/tests/formatter.test.d.ts +1 -0
- package/out/types/src/types/creators.d.ts +3 -4
- package/out/types/src/types/definitions.d.ts +8 -19
- package/out/types/src/types/guards.d.ts +3 -3
- package/out/types/src/types/tags.d.ts +0 -1
- package/out/types/src/types/utils.d.ts +1 -1
- package/out/types/src/value-tag.d.ts +0 -1
- package/out/types/src/value.d.ts +6 -13
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/std/alg/hash.yo +13 -21
- package/std/allocator.yo +25 -40
- package/std/async.yo +3 -7
- package/std/build.yo +105 -151
- package/std/cli/arg_parser.yo +184 -169
- package/std/collections/array_list.yo +350 -314
- package/std/collections/btree_map.yo +142 -131
- package/std/collections/deque.yo +132 -128
- package/std/collections/hash_map.yo +542 -566
- package/std/collections/hash_set.yo +623 -687
- package/std/collections/linked_list.yo +275 -293
- package/std/collections/ordered_map.yo +113 -85
- package/std/collections/priority_queue.yo +73 -73
- package/std/crypto/md5.yo +191 -95
- package/std/crypto/random.yo +56 -64
- package/std/crypto/sha256.yo +151 -107
- package/std/encoding/base64.yo +87 -81
- package/std/encoding/hex.yo +43 -50
- package/std/encoding/html.yo +56 -81
- package/std/encoding/html_char_utils.yo +7 -13
- package/std/encoding/html_entities.yo +2248 -2253
- package/std/encoding/json.yo +316 -224
- package/std/encoding/punycode.yo +86 -116
- package/std/encoding/toml.yo +67 -66
- package/std/encoding/utf16.yo +37 -44
- package/std/env.yo +62 -91
- package/std/error.yo +12 -20
- package/std/fmt/display.yo +5 -9
- package/std/fmt/index.yo +8 -14
- package/std/fmt/to_string.yo +330 -315
- package/std/fmt/writer.yo +58 -87
- package/std/fs/dir.yo +83 -102
- package/std/fs/file.yo +147 -180
- package/std/fs/metadata.yo +45 -78
- package/std/fs/temp.yo +55 -65
- package/std/fs/types.yo +27 -40
- package/std/fs/walker.yo +53 -68
- package/std/gc.yo +5 -8
- package/std/glob.yo +30 -43
- package/std/http/client.yo +107 -120
- package/std/http/http.yo +106 -96
- package/std/http/index.yo +4 -6
- package/std/imm/list.yo +88 -93
- package/std/imm/map.yo +528 -464
- package/std/imm/set.yo +52 -57
- package/std/imm/sorted_map.yo +340 -286
- package/std/imm/sorted_set.yo +57 -63
- package/std/imm/string.yo +404 -345
- package/std/imm/vec.yo +173 -181
- package/std/io/reader.yo +3 -6
- package/std/io/writer.yo +4 -8
- package/std/libc/assert.yo +5 -9
- package/std/libc/ctype.yo +32 -22
- package/std/libc/dirent.yo +26 -25
- package/std/libc/errno.yo +164 -90
- package/std/libc/fcntl.yo +52 -45
- package/std/libc/float.yo +66 -44
- package/std/libc/limits.yo +42 -33
- package/std/libc/math.yo +53 -82
- package/std/libc/signal.yo +72 -47
- package/std/libc/stdatomic.yo +217 -188
- package/std/libc/stdint.yo +5 -29
- package/std/libc/stdio.yo +5 -29
- package/std/libc/stdlib.yo +32 -39
- package/std/libc/string.yo +5 -23
- package/std/libc/sys/stat.yo +58 -56
- package/std/libc/time.yo +5 -19
- package/std/libc/unistd.yo +5 -20
- package/std/libc/wctype.yo +6 -9
- package/std/libc/windows.yo +26 -30
- package/std/log.yo +41 -55
- package/std/net/addr.yo +102 -97
- package/std/net/dns.yo +27 -28
- package/std/net/errors.yo +50 -49
- package/std/net/tcp.yo +113 -124
- package/std/net/udp.yo +55 -66
- package/std/os/env.yo +35 -33
- package/std/os/signal.yo +15 -25
- package/std/path.yo +276 -311
- package/std/prelude.yo +6316 -4333
- package/std/process/command.yo +87 -103
- package/std/process/index.yo +12 -31
- package/std/regex/compiler.yo +196 -95
- package/std/regex/flags.yo +58 -39
- package/std/regex/index.yo +157 -173
- package/std/regex/match.yo +20 -31
- package/std/regex/node.yo +134 -152
- package/std/regex/parser.yo +283 -259
- package/std/regex/unicode.yo +172 -202
- package/std/regex/vm.yo +155 -171
- package/std/string/index.yo +5 -7
- package/std/string/rune.yo +45 -55
- package/std/string/string.yo +937 -964
- package/std/string/string_builder.yo +94 -104
- package/std/string/unicode.yo +46 -64
- package/std/sync/channel.yo +72 -73
- package/std/sync/cond.yo +31 -36
- package/std/sync/mutex.yo +30 -32
- package/std/sync/once.yo +13 -16
- package/std/sync/rwlock.yo +26 -31
- package/std/sync/waitgroup.yo +20 -25
- package/std/sys/advise.yo +16 -24
- package/std/sys/bufio/buf_reader.yo +77 -93
- package/std/sys/bufio/buf_writer.yo +52 -65
- package/std/sys/clock.yo +4 -9
- package/std/sys/constants.yo +77 -61
- package/std/sys/copy.yo +4 -10
- package/std/sys/dir.yo +26 -43
- package/std/sys/dns.yo +41 -61
- package/std/sys/errors.yo +95 -103
- package/std/sys/events.yo +45 -57
- package/std/sys/externs.yo +319 -267
- package/std/sys/fallocate.yo +7 -11
- package/std/sys/fcntl.yo +14 -22
- package/std/sys/file.yo +26 -40
- package/std/sys/future.yo +5 -8
- package/std/sys/iov.yo +12 -25
- package/std/sys/lock.yo +12 -13
- package/std/sys/mmap.yo +38 -43
- package/std/sys/path.yo +3 -8
- package/std/sys/perm.yo +7 -21
- package/std/sys/pipe.yo +5 -12
- package/std/sys/process.yo +23 -29
- package/std/sys/seek.yo +10 -12
- package/std/sys/signal.yo +7 -13
- package/std/sys/signals.yo +52 -35
- package/std/sys/socket.yo +63 -58
- package/std/sys/socketpair.yo +3 -6
- package/std/sys/sockinfo.yo +11 -20
- package/std/sys/statfs.yo +11 -34
- package/std/sys/statx.yo +25 -52
- package/std/sys/sysinfo.yo +15 -20
- package/std/sys/tcp.yo +62 -92
- package/std/sys/temp.yo +5 -9
- package/std/sys/time.yo +5 -15
- package/std/sys/timer.yo +6 -11
- package/std/sys/tty.yo +10 -18
- package/std/sys/udp.yo +22 -39
- package/std/sys/umask.yo +3 -6
- package/std/sys/unix.yo +33 -52
- package/std/testing/bench.yo +49 -52
- package/std/thread.yo +10 -15
- package/std/time/datetime.yo +105 -89
- package/std/time/duration.yo +43 -56
- package/std/time/instant.yo +13 -18
- package/std/time/sleep.yo +5 -9
- package/std/url/index.yo +184 -209
- package/std/worker.yo +6 -10
- package/out/types/src/evaluator/calls/module-type.d.ts +0 -11
- package/out/types/src/evaluator/types/module.d.ts +0 -19
package/std/libc/math.yo
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
//! C11 `<math.h>` — mathematical functions and constants.
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
c_include(
|
|
3
|
+
"<math.h>",
|
|
4
4
|
// Mathematical constants (implementation-defined)
|
|
5
|
-
M_E : f64,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
M_E : f64,
|
|
6
|
+
// e (2.71828...)
|
|
7
|
+
M_LOG2E : f64,
|
|
8
|
+
// log_2(e)
|
|
9
|
+
M_LOG10E : f64,
|
|
10
|
+
// log_10(e)
|
|
11
|
+
M_LN2 : f64,
|
|
12
|
+
// ln(2)
|
|
13
|
+
M_LN10 : f64,
|
|
14
|
+
// ln(10)
|
|
15
|
+
M_PI : f64,
|
|
16
|
+
// π (3.14159...)
|
|
17
|
+
M_PI_2 : f64,
|
|
18
|
+
// π/2
|
|
19
|
+
M_PI_4 : f64,
|
|
20
|
+
// π/4
|
|
21
|
+
M_1_PI : f64,
|
|
22
|
+
// 1/π
|
|
23
|
+
M_2_PI : f64,
|
|
24
|
+
// 2/π
|
|
25
|
+
M_2_SQRTPI : f64,
|
|
26
|
+
// 2/√π
|
|
27
|
+
M_SQRT2 : f64,
|
|
28
|
+
// √2
|
|
29
|
+
M_SQRT1_2 : f64,
|
|
30
|
+
// 1/√2
|
|
19
31
|
// Special values
|
|
20
32
|
HUGE_VAL : f64,
|
|
21
33
|
HUGE_VALF : f32,
|
|
22
34
|
HUGE_VALL : longdouble,
|
|
23
35
|
INFINITY : f32,
|
|
24
36
|
NAN : f32,
|
|
25
|
-
|
|
26
37
|
// Trigonometric functions
|
|
27
38
|
sin :
|
|
28
39
|
fn(x : f64) -> f64,
|
|
@@ -38,7 +49,6 @@ c_include "<math.h>",
|
|
|
38
49
|
fn(x : f64) -> f64,
|
|
39
50
|
atan2 :
|
|
40
51
|
fn(y : f64, x : f64) -> f64,
|
|
41
|
-
|
|
42
52
|
// Hyperbolic functions
|
|
43
53
|
sinh :
|
|
44
54
|
fn(x : f64) -> f64,
|
|
@@ -52,47 +62,52 @@ c_include "<math.h>",
|
|
|
52
62
|
fn(x : f64) -> f64,
|
|
53
63
|
atanh :
|
|
54
64
|
fn(x : f64) -> f64,
|
|
55
|
-
|
|
56
65
|
// Exponential and logarithmic functions
|
|
57
66
|
exp :
|
|
58
67
|
fn(x : f64) -> f64,
|
|
59
68
|
exp2 :
|
|
60
69
|
fn(x : f64) -> f64,
|
|
61
70
|
expm1 :
|
|
62
|
-
fn(x : f64) -> f64,
|
|
71
|
+
fn(x : f64) -> f64,
|
|
72
|
+
// exp(x) - 1
|
|
63
73
|
log :
|
|
64
|
-
fn(x : f64) -> f64,
|
|
74
|
+
fn(x : f64) -> f64,
|
|
75
|
+
// natural logarithm
|
|
65
76
|
log2 :
|
|
66
77
|
fn(x : f64) -> f64,
|
|
67
78
|
log10 :
|
|
68
79
|
fn(x : f64) -> f64,
|
|
69
80
|
log1p :
|
|
70
|
-
fn(x : f64) -> f64,
|
|
81
|
+
fn(x : f64) -> f64,
|
|
82
|
+
// log(1 + x)
|
|
71
83
|
logb :
|
|
72
84
|
fn(x : f64) -> f64,
|
|
73
85
|
ilogb :
|
|
74
86
|
fn(x : f64) -> int,
|
|
75
|
-
|
|
76
87
|
// Power functions
|
|
77
88
|
pow :
|
|
78
89
|
fn(x : f64, y : f64) -> f64,
|
|
79
90
|
sqrt :
|
|
80
91
|
fn(x : f64) -> f64,
|
|
81
92
|
cbrt :
|
|
82
|
-
fn(x : f64) -> f64,
|
|
93
|
+
fn(x : f64) -> f64,
|
|
94
|
+
// cube root
|
|
83
95
|
hypot :
|
|
84
|
-
fn(x : f64, y : f64) -> f64,
|
|
85
|
-
|
|
96
|
+
fn(x : f64, y : f64) -> f64,
|
|
97
|
+
// sqrt(x^2 + y^2)
|
|
86
98
|
// Error and gamma functions
|
|
87
99
|
erf :
|
|
88
|
-
fn(x : f64) -> f64,
|
|
100
|
+
fn(x : f64) -> f64,
|
|
101
|
+
// error function
|
|
89
102
|
erfc :
|
|
90
|
-
fn(x : f64) -> f64,
|
|
103
|
+
fn(x : f64) -> f64,
|
|
104
|
+
// complementary error function
|
|
91
105
|
gamma :
|
|
92
|
-
fn(x : f64) -> f64,
|
|
106
|
+
fn(x : f64) -> f64,
|
|
107
|
+
// gamma function
|
|
93
108
|
lgamma :
|
|
94
|
-
fn(x : f64) -> f64,
|
|
95
|
-
|
|
109
|
+
fn(x : f64) -> f64,
|
|
110
|
+
// log gamma function
|
|
96
111
|
// Nearest integer functions
|
|
97
112
|
ceil :
|
|
98
113
|
fn(x : f64) -> f64,
|
|
@@ -114,7 +129,6 @@ c_include "<math.h>",
|
|
|
114
129
|
fn(x : f64) -> longlong,
|
|
115
130
|
nearbyint :
|
|
116
131
|
fn(x : f64) -> f64,
|
|
117
|
-
|
|
118
132
|
// Floating point manipulation functions
|
|
119
133
|
frexp :
|
|
120
134
|
fn(value : f64, _exp : *(int)) -> f64,
|
|
@@ -126,7 +140,6 @@ c_include "<math.h>",
|
|
|
126
140
|
fn(x : f64, n : int) -> f64,
|
|
127
141
|
scalbln :
|
|
128
142
|
fn(x : f64, n : long) -> f64,
|
|
129
|
-
|
|
130
143
|
// Absolute value and remainder functions
|
|
131
144
|
fabs :
|
|
132
145
|
fn(x : f64) -> f64,
|
|
@@ -136,7 +149,6 @@ c_include "<math.h>",
|
|
|
136
149
|
fn(x : f64, y : f64) -> f64,
|
|
137
150
|
remquo :
|
|
138
151
|
fn(x : f64, y : f64, quo : *(int)) -> f64,
|
|
139
|
-
|
|
140
152
|
// Copying sign functions
|
|
141
153
|
copysign :
|
|
142
154
|
fn(x : f64, y : f64) -> f64,
|
|
@@ -146,19 +158,18 @@ c_include "<math.h>",
|
|
|
146
158
|
fn(tagp : *(char)) -> f32,
|
|
147
159
|
nanl :
|
|
148
160
|
fn(tagp : *(char)) -> longdouble,
|
|
149
|
-
|
|
150
161
|
// Maximum, minimum, and positive difference functions
|
|
151
162
|
fdim :
|
|
152
|
-
fn(x : f64, y : f64) -> f64,
|
|
163
|
+
fn(x : f64, y : f64) -> f64,
|
|
164
|
+
// positive difference
|
|
153
165
|
fmax :
|
|
154
166
|
fn(x : f64, y : f64) -> f64,
|
|
155
167
|
fmin :
|
|
156
168
|
fn(x : f64, y : f64) -> f64,
|
|
157
|
-
|
|
158
169
|
// Floating multiply-add
|
|
159
170
|
fma :
|
|
160
|
-
fn(x : f64, y : f64, z : f64) -> f64,
|
|
161
|
-
|
|
171
|
+
fn(x : f64, y : f64, z : f64) -> f64,
|
|
172
|
+
// x*y + z
|
|
162
173
|
// Classification functions
|
|
163
174
|
fpclassify :
|
|
164
175
|
fn(x : f64) -> int,
|
|
@@ -172,7 +183,6 @@ c_include "<math.h>",
|
|
|
172
183
|
fn(x : f64) -> int,
|
|
173
184
|
signbit :
|
|
174
185
|
fn(x : f64) -> int,
|
|
175
|
-
|
|
176
186
|
// Comparison functions
|
|
177
187
|
isgreater :
|
|
178
188
|
fn(x : f64, y : f64) -> int,
|
|
@@ -186,7 +196,6 @@ c_include "<math.h>",
|
|
|
186
196
|
fn(x : f64, y : f64) -> int,
|
|
187
197
|
isunordered :
|
|
188
198
|
fn(x : f64, y : f64) -> int,
|
|
189
|
-
|
|
190
199
|
// Float versions of functions
|
|
191
200
|
sinf :
|
|
192
201
|
fn(x : f32) -> f32,
|
|
@@ -202,7 +211,6 @@ c_include "<math.h>",
|
|
|
202
211
|
fn(x : f32) -> f32,
|
|
203
212
|
atan2f :
|
|
204
213
|
fn(y : f32, x : f32) -> f32,
|
|
205
|
-
|
|
206
214
|
sinhf :
|
|
207
215
|
fn(x : f32) -> f32,
|
|
208
216
|
coshf :
|
|
@@ -215,7 +223,6 @@ c_include "<math.h>",
|
|
|
215
223
|
fn(x : f32) -> f32,
|
|
216
224
|
atanhf :
|
|
217
225
|
fn(x : f32) -> f32,
|
|
218
|
-
|
|
219
226
|
expf :
|
|
220
227
|
fn(x : f32) -> f32,
|
|
221
228
|
exp2f :
|
|
@@ -234,7 +241,6 @@ c_include "<math.h>",
|
|
|
234
241
|
fn(x : f32) -> f32,
|
|
235
242
|
ilogbf :
|
|
236
243
|
fn(x : f32) -> int,
|
|
237
|
-
|
|
238
244
|
powf :
|
|
239
245
|
fn(x : f32, y : f32) -> f32,
|
|
240
246
|
sqrtf :
|
|
@@ -243,7 +249,6 @@ c_include "<math.h>",
|
|
|
243
249
|
fn(x : f32) -> f32,
|
|
244
250
|
hypotf :
|
|
245
251
|
fn(x : f32, y : f32) -> f32,
|
|
246
|
-
|
|
247
252
|
erff :
|
|
248
253
|
fn(x : f32) -> f32,
|
|
249
254
|
erfcf :
|
|
@@ -252,7 +257,6 @@ c_include "<math.h>",
|
|
|
252
257
|
fn(x : f32) -> f32,
|
|
253
258
|
lgammaf :
|
|
254
259
|
fn(x : f32) -> f32,
|
|
255
|
-
|
|
256
260
|
ceilf :
|
|
257
261
|
fn(x : f32) -> f32,
|
|
258
262
|
floorf :
|
|
@@ -273,7 +277,6 @@ c_include "<math.h>",
|
|
|
273
277
|
fn(x : f32) -> longlong,
|
|
274
278
|
nearbyintf :
|
|
275
279
|
fn(x : f32) -> f32,
|
|
276
|
-
|
|
277
280
|
frexpf :
|
|
278
281
|
fn(value : f32, _exp : *(int)) -> f32,
|
|
279
282
|
ldexpf :
|
|
@@ -284,7 +287,6 @@ c_include "<math.h>",
|
|
|
284
287
|
fn(x : f32, n : int) -> f32,
|
|
285
288
|
scalblnf :
|
|
286
289
|
fn(x : f32, n : long) -> f32,
|
|
287
|
-
|
|
288
290
|
fabsf :
|
|
289
291
|
fn(x : f32) -> f32,
|
|
290
292
|
fmodf :
|
|
@@ -293,7 +295,6 @@ c_include "<math.h>",
|
|
|
293
295
|
fn(x : f32, y : f32) -> f32,
|
|
294
296
|
remquof :
|
|
295
297
|
fn(x : f32, y : f32, quo : *(int)) -> f32,
|
|
296
|
-
|
|
297
298
|
copysignf :
|
|
298
299
|
fn(x : f32, y : f32) -> f32,
|
|
299
300
|
fdimf :
|
|
@@ -304,7 +305,6 @@ c_include "<math.h>",
|
|
|
304
305
|
fn(x : f32, y : f32) -> f32,
|
|
305
306
|
fmaf :
|
|
306
307
|
fn(x : f32, y : f32, z : f32) -> f32,
|
|
307
|
-
|
|
308
308
|
// Long f64 versions of functions
|
|
309
309
|
sinl :
|
|
310
310
|
fn(x : longdouble) -> longdouble,
|
|
@@ -320,7 +320,6 @@ c_include "<math.h>",
|
|
|
320
320
|
fn(x : longdouble) -> longdouble,
|
|
321
321
|
atan2l :
|
|
322
322
|
fn(x : longdouble, y : longdouble) -> longdouble,
|
|
323
|
-
|
|
324
323
|
sinhl :
|
|
325
324
|
fn(x : longdouble) -> longdouble,
|
|
326
325
|
coshl :
|
|
@@ -333,7 +332,6 @@ c_include "<math.h>",
|
|
|
333
332
|
fn(x : longdouble) -> longdouble,
|
|
334
333
|
atanhl :
|
|
335
334
|
fn(x : longdouble) -> longdouble,
|
|
336
|
-
|
|
337
335
|
expl :
|
|
338
336
|
fn(x : longdouble) -> longdouble,
|
|
339
337
|
exp2l :
|
|
@@ -352,7 +350,6 @@ c_include "<math.h>",
|
|
|
352
350
|
fn(x : longdouble) -> longdouble,
|
|
353
351
|
ilogbl :
|
|
354
352
|
fn(x : longdouble) -> int,
|
|
355
|
-
|
|
356
353
|
powl :
|
|
357
354
|
fn(x : longdouble, y : longdouble) -> longdouble,
|
|
358
355
|
sqrtl :
|
|
@@ -361,7 +358,6 @@ c_include "<math.h>",
|
|
|
361
358
|
fn(x : longdouble) -> longdouble,
|
|
362
359
|
hypotl :
|
|
363
360
|
fn(x : longdouble, y : longdouble) -> longdouble,
|
|
364
|
-
|
|
365
361
|
erfl :
|
|
366
362
|
fn(x : longdouble) -> longdouble,
|
|
367
363
|
erfcl :
|
|
@@ -370,7 +366,6 @@ c_include "<math.h>",
|
|
|
370
366
|
fn(x : longdouble) -> longdouble,
|
|
371
367
|
lgammal :
|
|
372
368
|
fn(x : longdouble) -> longdouble,
|
|
373
|
-
|
|
374
369
|
ceill :
|
|
375
370
|
fn(x : longdouble) -> longdouble,
|
|
376
371
|
floorl :
|
|
@@ -391,7 +386,6 @@ c_include "<math.h>",
|
|
|
391
386
|
fn(x : longdouble) -> longlong,
|
|
392
387
|
nearbyintl :
|
|
393
388
|
fn(x : longdouble) -> longdouble,
|
|
394
|
-
|
|
395
389
|
frexpl :
|
|
396
390
|
fn(value : longdouble, _exp : *(int)) -> longdouble,
|
|
397
391
|
ldexpl :
|
|
@@ -402,7 +396,6 @@ c_include "<math.h>",
|
|
|
402
396
|
fn(x : longdouble, n : int) -> longdouble,
|
|
403
397
|
scalblnl :
|
|
404
398
|
fn(x : longdouble, n : long) -> longdouble,
|
|
405
|
-
|
|
406
399
|
fabsl :
|
|
407
400
|
fn(x : longdouble) -> longdouble,
|
|
408
401
|
fmodl :
|
|
@@ -411,7 +404,6 @@ c_include "<math.h>",
|
|
|
411
404
|
fn(x : longdouble, y : longdouble) -> longdouble,
|
|
412
405
|
remquol :
|
|
413
406
|
fn(x : longdouble, y : longdouble, quo : *(int)) -> longdouble,
|
|
414
|
-
|
|
415
407
|
copysignl :
|
|
416
408
|
fn(x : longdouble, y : longdouble) -> longdouble,
|
|
417
409
|
fdiml :
|
|
@@ -422,22 +414,19 @@ c_include "<math.h>",
|
|
|
422
414
|
fn(x : longdouble, y : longdouble) -> longdouble,
|
|
423
415
|
fmal :
|
|
424
416
|
fn(x : longdouble, y : longdouble, z : longdouble) -> longdouble,
|
|
425
|
-
|
|
426
417
|
// Classification constants
|
|
427
418
|
FP_INFINITE : int,
|
|
428
419
|
FP_NAN : int,
|
|
429
420
|
FP_NORMAL : int,
|
|
430
421
|
FP_SUBNORMAL : int,
|
|
431
422
|
FP_ZERO : int,
|
|
432
|
-
|
|
433
423
|
// Math error handling
|
|
434
424
|
math_errhandling : int,
|
|
435
425
|
MATH_ERRNO : int,
|
|
436
426
|
MATH_ERREXCEPT : int
|
|
437
|
-
;
|
|
438
|
-
|
|
427
|
+
);
|
|
439
428
|
// Export all math functionality
|
|
440
|
-
export
|
|
429
|
+
export(
|
|
441
430
|
// Mathematical constants
|
|
442
431
|
M_E,
|
|
443
432
|
M_LOG2E,
|
|
@@ -452,14 +441,12 @@ export
|
|
|
452
441
|
M_2_SQRTPI,
|
|
453
442
|
M_SQRT2,
|
|
454
443
|
M_SQRT1_2,
|
|
455
|
-
|
|
456
444
|
// Special values
|
|
457
445
|
HUGE_VAL,
|
|
458
446
|
HUGE_VALF,
|
|
459
447
|
HUGE_VALL,
|
|
460
448
|
INFINITY,
|
|
461
449
|
NAN,
|
|
462
|
-
|
|
463
450
|
// Trigonometric functions
|
|
464
451
|
sin,
|
|
465
452
|
cos,
|
|
@@ -468,7 +455,6 @@ export
|
|
|
468
455
|
acos,
|
|
469
456
|
atan,
|
|
470
457
|
atan2,
|
|
471
|
-
|
|
472
458
|
// Hyperbolic functions
|
|
473
459
|
sinh,
|
|
474
460
|
cosh,
|
|
@@ -476,7 +462,6 @@ export
|
|
|
476
462
|
asinh,
|
|
477
463
|
acosh,
|
|
478
464
|
atanh,
|
|
479
|
-
|
|
480
465
|
// Exponential and logarithmic functions
|
|
481
466
|
exp,
|
|
482
467
|
exp2,
|
|
@@ -487,19 +472,16 @@ export
|
|
|
487
472
|
log1p,
|
|
488
473
|
logb,
|
|
489
474
|
ilogb,
|
|
490
|
-
|
|
491
475
|
// Power functions
|
|
492
476
|
pow,
|
|
493
477
|
sqrt,
|
|
494
478
|
cbrt,
|
|
495
479
|
hypot,
|
|
496
|
-
|
|
497
480
|
// Error and gamma functions
|
|
498
481
|
erf,
|
|
499
482
|
erfc,
|
|
500
483
|
gamma,
|
|
501
484
|
lgamma,
|
|
502
|
-
|
|
503
485
|
// Nearest integer functions
|
|
504
486
|
ceil,
|
|
505
487
|
floor,
|
|
@@ -511,34 +493,28 @@ export
|
|
|
511
493
|
lrint,
|
|
512
494
|
llrint,
|
|
513
495
|
nearbyint,
|
|
514
|
-
|
|
515
496
|
// Floating point manipulation functions
|
|
516
497
|
frexp,
|
|
517
498
|
ldexp,
|
|
518
499
|
modf,
|
|
519
500
|
scalbn,
|
|
520
501
|
scalbln,
|
|
521
|
-
|
|
522
502
|
// Absolute value and remainder functions
|
|
523
503
|
fabs,
|
|
524
504
|
fmod,
|
|
525
505
|
remainder,
|
|
526
506
|
remquo,
|
|
527
|
-
|
|
528
507
|
// Copying sign functions
|
|
529
508
|
copysign,
|
|
530
509
|
nan,
|
|
531
510
|
nanf,
|
|
532
511
|
nanl,
|
|
533
|
-
|
|
534
512
|
// Maximum, minimum, and positive difference functions
|
|
535
513
|
fdim,
|
|
536
514
|
fmax,
|
|
537
515
|
fmin,
|
|
538
|
-
|
|
539
516
|
// Floating multiply-add
|
|
540
517
|
fma,
|
|
541
|
-
|
|
542
518
|
// Classification functions
|
|
543
519
|
fpclassify,
|
|
544
520
|
isfinite,
|
|
@@ -546,7 +522,6 @@ export
|
|
|
546
522
|
isnan,
|
|
547
523
|
isnormal,
|
|
548
524
|
signbit,
|
|
549
|
-
|
|
550
525
|
// Comparison functions
|
|
551
526
|
isgreater,
|
|
552
527
|
isgreaterequal,
|
|
@@ -554,7 +529,6 @@ export
|
|
|
554
529
|
islessequal,
|
|
555
530
|
islessgreater,
|
|
556
531
|
isunordered,
|
|
557
|
-
|
|
558
532
|
// Float versions
|
|
559
533
|
sinf,
|
|
560
534
|
cosf,
|
|
@@ -610,7 +584,6 @@ export
|
|
|
610
584
|
fmaxf,
|
|
611
585
|
fminf,
|
|
612
586
|
fmaf,
|
|
613
|
-
|
|
614
587
|
// Long f64 versions
|
|
615
588
|
sinl,
|
|
616
589
|
cosl,
|
|
@@ -666,16 +639,14 @@ export
|
|
|
666
639
|
fmaxl,
|
|
667
640
|
fminl,
|
|
668
641
|
fmal,
|
|
669
|
-
|
|
670
642
|
// Classification constants
|
|
671
643
|
FP_INFINITE,
|
|
672
644
|
FP_NAN,
|
|
673
645
|
FP_NORMAL,
|
|
674
646
|
FP_SUBNORMAL,
|
|
675
647
|
FP_ZERO,
|
|
676
|
-
|
|
677
648
|
// Math error handling
|
|
678
649
|
math_errhandling,
|
|
679
650
|
MATH_ERRNO,
|
|
680
651
|
MATH_ERREXCEPT
|
|
681
|
-
;
|
|
652
|
+
);
|
package/std/libc/signal.yo
CHANGED
|
@@ -1,63 +1,90 @@
|
|
|
1
1
|
//! C11 `<signal.h>` — signal handling functions and constants.
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
c_include(
|
|
3
|
+
"<signal.h>",
|
|
4
4
|
// Signal handler type
|
|
5
5
|
// Note: In C this is: void (*signal(int sig, void (*func)(int)))(int)
|
|
6
6
|
// We simplify this for Yo
|
|
7
7
|
signal :
|
|
8
8
|
fn(sig : int, func : (fn(signal_num : int) -> unit)) -> (fn(signal_num : int) -> unit),
|
|
9
|
-
|
|
10
9
|
// Raise a signal
|
|
11
10
|
raise :
|
|
12
11
|
fn(sig : int) -> int,
|
|
13
|
-
|
|
14
12
|
// Standard signal numbers (POSIX.1)
|
|
15
|
-
SIGHUP : int,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
13
|
+
SIGHUP : int,
|
|
14
|
+
// Hangup
|
|
15
|
+
SIGINT : int,
|
|
16
|
+
// Interrupt (Ctrl+C)
|
|
17
|
+
SIGQUIT : int,
|
|
18
|
+
// Quit (Ctrl+\)
|
|
19
|
+
SIGILL : int,
|
|
20
|
+
// Illegal instruction
|
|
21
|
+
SIGTRAP : int,
|
|
22
|
+
// Trace/breakpoint trap
|
|
23
|
+
SIGABRT : int,
|
|
24
|
+
// Abort signal
|
|
25
|
+
SIGBUS : int,
|
|
26
|
+
// Bus error
|
|
27
|
+
SIGFPE : int,
|
|
28
|
+
// Floating point exception
|
|
29
|
+
SIGKILL : int,
|
|
30
|
+
// Kill signal (cannot be caught)
|
|
31
|
+
SIGUSR1 : int,
|
|
32
|
+
// User-defined signal 1
|
|
33
|
+
SIGSEGV : int,
|
|
34
|
+
// Segmentation fault
|
|
35
|
+
SIGUSR2 : int,
|
|
36
|
+
// User-defined signal 2
|
|
37
|
+
SIGPIPE : int,
|
|
38
|
+
// Broken pipe
|
|
39
|
+
SIGALRM : int,
|
|
40
|
+
// Alarm clock
|
|
41
|
+
SIGTERM : int,
|
|
42
|
+
// Termination signal
|
|
43
|
+
SIGCHLD : int,
|
|
44
|
+
// Child status changed
|
|
45
|
+
SIGCONT : int,
|
|
46
|
+
// Continue if stopped
|
|
47
|
+
SIGSTOP : int,
|
|
48
|
+
// Stop executing (cannot be caught)
|
|
49
|
+
SIGTSTP : int,
|
|
50
|
+
// Terminal stop signal (Ctrl+Z)
|
|
51
|
+
SIGTTIN : int,
|
|
52
|
+
// Background process attempting read
|
|
53
|
+
SIGTTOU : int,
|
|
54
|
+
// Background process attempting write
|
|
55
|
+
SIGURG : int,
|
|
56
|
+
// Urgent condition on socket
|
|
57
|
+
SIGXCPU : int,
|
|
58
|
+
// CPU limit exceeded
|
|
59
|
+
SIGXFSZ : int,
|
|
60
|
+
// File size limit exceeded
|
|
61
|
+
SIGVTALRM : int,
|
|
62
|
+
// Virtual alarm clock
|
|
63
|
+
SIGPROF : int,
|
|
64
|
+
// Profiling alarm clock
|
|
65
|
+
SIGWINCH : int,
|
|
66
|
+
// Window resize signal
|
|
67
|
+
SIGIO : int,
|
|
68
|
+
// I/O now possible
|
|
69
|
+
SIGPWR : int,
|
|
70
|
+
// Power failure restart
|
|
71
|
+
SIGSYS : int,
|
|
72
|
+
// Bad system call
|
|
46
73
|
// Signal handling constants
|
|
47
|
-
SIG_DFL : (fn(signal_num : int) -> unit),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
74
|
+
SIG_DFL : (fn(signal_num : int) -> unit),
|
|
75
|
+
// Default signal handling
|
|
76
|
+
SIG_IGN : (fn(signal_num : int) -> unit),
|
|
77
|
+
// Ignore signal
|
|
78
|
+
SIG_ERR : (fn(signal_num : int) -> unit),
|
|
79
|
+
// Signal error return
|
|
51
80
|
// C11 - Additional signal handling (optional)
|
|
52
|
-
sig_atomic_t : Type
|
|
53
|
-
;
|
|
54
|
-
|
|
81
|
+
sig_atomic_t : Type // Type for atomic signal variables
|
|
82
|
+
);
|
|
55
83
|
// Export all signal functionality
|
|
56
|
-
export
|
|
84
|
+
export(
|
|
57
85
|
// Signal functions
|
|
58
86
|
signal,
|
|
59
87
|
raise,
|
|
60
|
-
|
|
61
88
|
// Standard signals
|
|
62
89
|
SIGHUP,
|
|
63
90
|
SIGINT,
|
|
@@ -89,12 +116,10 @@ export
|
|
|
89
116
|
SIGIO,
|
|
90
117
|
SIGPWR,
|
|
91
118
|
SIGSYS,
|
|
92
|
-
|
|
93
119
|
// Signal handling constants
|
|
94
120
|
SIG_DFL,
|
|
95
121
|
SIG_IGN,
|
|
96
122
|
SIG_ERR,
|
|
97
|
-
|
|
98
123
|
// Types
|
|
99
124
|
sig_atomic_t
|
|
100
|
-
;
|
|
125
|
+
);
|