@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/stdatomic.yo
CHANGED
|
@@ -1,212 +1,241 @@
|
|
|
1
1
|
//! C11 `<stdatomic.h>` — atomic operations and types.
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
c_include(
|
|
3
|
+
"<stdatomic.h>",
|
|
4
4
|
// Atomic types
|
|
5
|
-
atomic_bool: Type,
|
|
6
|
-
atomic_char: Type,
|
|
7
|
-
atomic_schar: Type,
|
|
8
|
-
atomic_uchar: Type,
|
|
9
|
-
atomic_short: Type,
|
|
10
|
-
atomic_ushort: Type,
|
|
11
|
-
atomic_int: Type,
|
|
12
|
-
atomic_uint: Type,
|
|
13
|
-
atomic_long: Type,
|
|
14
|
-
atomic_ulong: Type,
|
|
15
|
-
atomic_llong: Type,
|
|
16
|
-
atomic_ullong: Type,
|
|
17
|
-
atomic_char16_t: Type,
|
|
18
|
-
atomic_char32_t: Type,
|
|
19
|
-
atomic_wchar_t: Type,
|
|
20
|
-
atomic_int_least8_t: Type,
|
|
21
|
-
atomic_uint_least8_t: Type,
|
|
22
|
-
atomic_int_least16_t: Type,
|
|
23
|
-
atomic_uint_least16_t: Type,
|
|
24
|
-
atomic_int_least32_t: Type,
|
|
25
|
-
atomic_uint_least32_t: Type,
|
|
26
|
-
atomic_int_least64_t: Type,
|
|
27
|
-
atomic_uint_least64_t: Type,
|
|
28
|
-
atomic_int_fast8_t: Type,
|
|
29
|
-
atomic_uint_fast8_t: Type,
|
|
30
|
-
atomic_int_fast16_t: Type,
|
|
31
|
-
atomic_uint_fast16_t: Type,
|
|
32
|
-
atomic_int_fast32_t: Type,
|
|
33
|
-
atomic_uint_fast32_t: Type,
|
|
34
|
-
atomic_int_fast64_t: Type,
|
|
35
|
-
atomic_uint_fast64_t: Type,
|
|
36
|
-
atomic_intptr_t: Type,
|
|
37
|
-
atomic_uintptr_t: Type,
|
|
38
|
-
atomic_size_t: Type,
|
|
39
|
-
atomic_ptrdiff_t: Type,
|
|
40
|
-
atomic_intmax_t: Type,
|
|
41
|
-
atomic_uintmax_t: Type,
|
|
42
|
-
|
|
5
|
+
atomic_bool : Type,
|
|
6
|
+
atomic_char : Type,
|
|
7
|
+
atomic_schar : Type,
|
|
8
|
+
atomic_uchar : Type,
|
|
9
|
+
atomic_short : Type,
|
|
10
|
+
atomic_ushort : Type,
|
|
11
|
+
atomic_int : Type,
|
|
12
|
+
atomic_uint : Type,
|
|
13
|
+
atomic_long : Type,
|
|
14
|
+
atomic_ulong : Type,
|
|
15
|
+
atomic_llong : Type,
|
|
16
|
+
atomic_ullong : Type,
|
|
17
|
+
atomic_char16_t : Type,
|
|
18
|
+
atomic_char32_t : Type,
|
|
19
|
+
atomic_wchar_t : Type,
|
|
20
|
+
atomic_int_least8_t : Type,
|
|
21
|
+
atomic_uint_least8_t : Type,
|
|
22
|
+
atomic_int_least16_t : Type,
|
|
23
|
+
atomic_uint_least16_t : Type,
|
|
24
|
+
atomic_int_least32_t : Type,
|
|
25
|
+
atomic_uint_least32_t : Type,
|
|
26
|
+
atomic_int_least64_t : Type,
|
|
27
|
+
atomic_uint_least64_t : Type,
|
|
28
|
+
atomic_int_fast8_t : Type,
|
|
29
|
+
atomic_uint_fast8_t : Type,
|
|
30
|
+
atomic_int_fast16_t : Type,
|
|
31
|
+
atomic_uint_fast16_t : Type,
|
|
32
|
+
atomic_int_fast32_t : Type,
|
|
33
|
+
atomic_uint_fast32_t : Type,
|
|
34
|
+
atomic_int_fast64_t : Type,
|
|
35
|
+
atomic_uint_fast64_t : Type,
|
|
36
|
+
atomic_intptr_t : Type,
|
|
37
|
+
atomic_uintptr_t : Type,
|
|
38
|
+
atomic_size_t : Type,
|
|
39
|
+
atomic_ptrdiff_t : Type,
|
|
40
|
+
atomic_intmax_t : Type,
|
|
41
|
+
atomic_uintmax_t : Type,
|
|
43
42
|
// Memory order enumeration
|
|
44
|
-
memory_order: Type,
|
|
45
|
-
memory_order_relaxed: memory_order,
|
|
46
|
-
memory_order_consume: memory_order,
|
|
47
|
-
memory_order_acquire: memory_order,
|
|
48
|
-
memory_order_release: memory_order,
|
|
49
|
-
memory_order_acq_rel: memory_order,
|
|
50
|
-
memory_order_seq_cst: memory_order,
|
|
51
|
-
|
|
43
|
+
memory_order : Type,
|
|
44
|
+
memory_order_relaxed : memory_order,
|
|
45
|
+
memory_order_consume : memory_order,
|
|
46
|
+
memory_order_acquire : memory_order,
|
|
47
|
+
memory_order_release : memory_order,
|
|
48
|
+
memory_order_acq_rel : memory_order,
|
|
49
|
+
memory_order_seq_cst : memory_order,
|
|
52
50
|
// Atomic flag type
|
|
53
|
-
atomic_flag: Type,
|
|
54
|
-
ATOMIC_FLAG_INIT: atomic_flag,
|
|
55
|
-
|
|
51
|
+
atomic_flag : Type,
|
|
52
|
+
ATOMIC_FLAG_INIT : atomic_flag,
|
|
56
53
|
// Generic atomic operations
|
|
57
|
-
atomic_init:
|
|
58
|
-
fn(obj: *(atomic_bool), value: bool) -> unit,
|
|
59
|
-
atomic_load:
|
|
60
|
-
fn(obj: *(atomic_bool)) -> bool,
|
|
61
|
-
atomic_load_explicit:
|
|
62
|
-
fn(obj: *(atomic_bool), order: memory_order) -> bool,
|
|
63
|
-
atomic_store:
|
|
64
|
-
fn(obj: *(atomic_bool), desired: bool) -> unit,
|
|
65
|
-
atomic_store_explicit:
|
|
66
|
-
fn(obj: *(atomic_bool), desired: bool, order: memory_order) -> unit,
|
|
67
|
-
atomic_exchange:
|
|
68
|
-
fn(obj: *(atomic_bool), desired: bool) -> bool,
|
|
69
|
-
atomic_exchange_explicit:
|
|
70
|
-
fn(obj: *(atomic_bool), desired: bool, order: memory_order) -> bool,
|
|
71
|
-
atomic_compare_exchange_strong:
|
|
72
|
-
fn(obj: *(atomic_bool), expected: *(bool), desired: bool) -> bool,
|
|
73
|
-
atomic_compare_exchange_strong_explicit:
|
|
74
|
-
fn(obj: *(atomic_bool), expected: *(bool), desired: bool, success: memory_order, failure: memory_order) -> bool,
|
|
75
|
-
atomic_compare_exchange_weak:
|
|
76
|
-
fn(obj: *(atomic_bool), expected: *(bool), desired: bool) -> bool,
|
|
77
|
-
atomic_compare_exchange_weak_explicit:
|
|
78
|
-
fn(obj: *(atomic_bool), expected: *(bool), desired: bool, success: memory_order, failure: memory_order) -> bool,
|
|
79
|
-
|
|
54
|
+
atomic_init :
|
|
55
|
+
fn(obj : *(atomic_bool), value : bool) -> unit,
|
|
56
|
+
atomic_load :
|
|
57
|
+
fn(obj : *(atomic_bool)) -> bool,
|
|
58
|
+
atomic_load_explicit :
|
|
59
|
+
fn(obj : *(atomic_bool), order : memory_order) -> bool,
|
|
60
|
+
atomic_store :
|
|
61
|
+
fn(obj : *(atomic_bool), desired : bool) -> unit,
|
|
62
|
+
atomic_store_explicit :
|
|
63
|
+
fn(obj : *(atomic_bool), desired : bool, order : memory_order) -> unit,
|
|
64
|
+
atomic_exchange :
|
|
65
|
+
fn(obj : *(atomic_bool), desired : bool) -> bool,
|
|
66
|
+
atomic_exchange_explicit :
|
|
67
|
+
fn(obj : *(atomic_bool), desired : bool, order : memory_order) -> bool,
|
|
68
|
+
atomic_compare_exchange_strong :
|
|
69
|
+
fn(obj : *(atomic_bool), expected : *(bool), desired : bool) -> bool,
|
|
70
|
+
atomic_compare_exchange_strong_explicit :
|
|
71
|
+
fn(obj : *(atomic_bool), expected : *(bool), desired : bool, success : memory_order, failure : memory_order) -> bool,
|
|
72
|
+
atomic_compare_exchange_weak :
|
|
73
|
+
fn(obj : *(atomic_bool), expected : *(bool), desired : bool) -> bool,
|
|
74
|
+
atomic_compare_exchange_weak_explicit :
|
|
75
|
+
fn(obj : *(atomic_bool), expected : *(bool), desired : bool, success : memory_order, failure : memory_order) -> bool,
|
|
80
76
|
// Integer atomic operations
|
|
81
|
-
atomic_fetch_add:
|
|
82
|
-
fn(obj: *(atomic_int), arg: int) -> int,
|
|
83
|
-
atomic_fetch_add_explicit:
|
|
84
|
-
fn(obj: *(atomic_int), arg: int, order: memory_order) -> int,
|
|
85
|
-
atomic_fetch_sub:
|
|
86
|
-
fn(obj: *(atomic_int), arg: int) -> int,
|
|
87
|
-
atomic_fetch_sub_explicit:
|
|
88
|
-
fn(obj: *(atomic_int), arg: int, order: memory_order) -> int,
|
|
89
|
-
atomic_fetch_or:
|
|
90
|
-
fn(obj: *(atomic_int), arg: int) -> int,
|
|
91
|
-
atomic_fetch_or_explicit:
|
|
92
|
-
fn(obj: *(atomic_int), arg: int, order: memory_order) -> int,
|
|
93
|
-
atomic_fetch_xor:
|
|
94
|
-
fn(obj: *(atomic_int), arg: int) -> int,
|
|
95
|
-
atomic_fetch_xor_explicit:
|
|
96
|
-
fn(obj: *(atomic_int), arg: int, order: memory_order) -> int,
|
|
97
|
-
atomic_fetch_and:
|
|
98
|
-
fn(obj: *(atomic_int), arg: int) -> int,
|
|
99
|
-
atomic_fetch_and_explicit:
|
|
100
|
-
fn(obj: *(atomic_int), arg: int, order: memory_order) -> int,
|
|
101
|
-
|
|
77
|
+
atomic_fetch_add :
|
|
78
|
+
fn(obj : *(atomic_int), arg : int) -> int,
|
|
79
|
+
atomic_fetch_add_explicit :
|
|
80
|
+
fn(obj : *(atomic_int), arg : int, order : memory_order) -> int,
|
|
81
|
+
atomic_fetch_sub :
|
|
82
|
+
fn(obj : *(atomic_int), arg : int) -> int,
|
|
83
|
+
atomic_fetch_sub_explicit :
|
|
84
|
+
fn(obj : *(atomic_int), arg : int, order : memory_order) -> int,
|
|
85
|
+
atomic_fetch_or :
|
|
86
|
+
fn(obj : *(atomic_int), arg : int) -> int,
|
|
87
|
+
atomic_fetch_or_explicit :
|
|
88
|
+
fn(obj : *(atomic_int), arg : int, order : memory_order) -> int,
|
|
89
|
+
atomic_fetch_xor :
|
|
90
|
+
fn(obj : *(atomic_int), arg : int) -> int,
|
|
91
|
+
atomic_fetch_xor_explicit :
|
|
92
|
+
fn(obj : *(atomic_int), arg : int, order : memory_order) -> int,
|
|
93
|
+
atomic_fetch_and :
|
|
94
|
+
fn(obj : *(atomic_int), arg : int) -> int,
|
|
95
|
+
atomic_fetch_and_explicit :
|
|
96
|
+
fn(obj : *(atomic_int), arg : int, order : memory_order) -> int,
|
|
102
97
|
// Pointer atomic operations
|
|
103
|
-
atomic_load_ptr:
|
|
104
|
-
fn(obj: *(*(void))) -> *(void),
|
|
105
|
-
atomic_store_ptr:
|
|
106
|
-
fn(obj: *(*(void)), desired: *(void)) -> unit,
|
|
107
|
-
atomic_exchange_ptr:
|
|
108
|
-
fn(obj: *(*(void)), desired: *(void)) -> *(void),
|
|
109
|
-
atomic_compare_exchange_strong_ptr:
|
|
110
|
-
fn(obj: *(*(void)), expected: *(*(void)), desired: *(void)) -> bool,
|
|
111
|
-
atomic_compare_exchange_weak_ptr:
|
|
112
|
-
fn(obj: *(*(void)), expected: *(*(void)), desired: *(void)) -> bool,
|
|
113
|
-
|
|
98
|
+
atomic_load_ptr :
|
|
99
|
+
fn(obj : *(*(void))) -> *(void),
|
|
100
|
+
atomic_store_ptr :
|
|
101
|
+
fn(obj : *(*(void)), desired : *(void)) -> unit,
|
|
102
|
+
atomic_exchange_ptr :
|
|
103
|
+
fn(obj : *(*(void)), desired : *(void)) -> *(void),
|
|
104
|
+
atomic_compare_exchange_strong_ptr :
|
|
105
|
+
fn(obj : *(*(void)), expected : *(*(void)), desired : *(void)) -> bool,
|
|
106
|
+
atomic_compare_exchange_weak_ptr :
|
|
107
|
+
fn(obj : *(*(void)), expected : *(*(void)), desired : *(void)) -> bool,
|
|
114
108
|
// Atomic flag operations
|
|
115
|
-
atomic_flag_test_and_set:
|
|
116
|
-
fn(obj: *(atomic_flag)) -> bool,
|
|
117
|
-
atomic_flag_test_and_set_explicit:
|
|
118
|
-
fn(obj: *(atomic_flag), order: memory_order) -> bool,
|
|
119
|
-
atomic_flag_clear:
|
|
120
|
-
fn(obj: *(atomic_flag)) -> unit,
|
|
121
|
-
atomic_flag_clear_explicit:
|
|
122
|
-
fn(obj: *(atomic_flag), order: memory_order) -> unit,
|
|
123
|
-
|
|
109
|
+
atomic_flag_test_and_set :
|
|
110
|
+
fn(obj : *(atomic_flag)) -> bool,
|
|
111
|
+
atomic_flag_test_and_set_explicit :
|
|
112
|
+
fn(obj : *(atomic_flag), order : memory_order) -> bool,
|
|
113
|
+
atomic_flag_clear :
|
|
114
|
+
fn(obj : *(atomic_flag)) -> unit,
|
|
115
|
+
atomic_flag_clear_explicit :
|
|
116
|
+
fn(obj : *(atomic_flag), order : memory_order) -> unit,
|
|
124
117
|
// Memory fences
|
|
125
|
-
atomic_thread_fence:
|
|
126
|
-
fn(order: memory_order) -> unit,
|
|
127
|
-
atomic_signal_fence:
|
|
128
|
-
fn(order: memory_order) -> unit,
|
|
129
|
-
|
|
118
|
+
atomic_thread_fence :
|
|
119
|
+
fn(order : memory_order) -> unit,
|
|
120
|
+
atomic_signal_fence :
|
|
121
|
+
fn(order : memory_order) -> unit,
|
|
130
122
|
// Lock-free property query
|
|
131
|
-
atomic_is_lock_free:
|
|
132
|
-
fn(obj: *(atomic_bool)) -> bool,
|
|
133
|
-
|
|
123
|
+
atomic_is_lock_free :
|
|
124
|
+
fn(obj : *(atomic_bool)) -> bool,
|
|
134
125
|
// Kill dependency
|
|
135
|
-
kill_dependency:
|
|
136
|
-
fn(y: i32) -> i32,
|
|
137
|
-
|
|
126
|
+
kill_dependency :
|
|
127
|
+
fn(y : i32) -> i32,
|
|
138
128
|
// Lock-free constants
|
|
139
|
-
ATOMIC_BOOL_LOCK_FREE: i32,
|
|
140
|
-
ATOMIC_CHAR_LOCK_FREE: i32,
|
|
141
|
-
ATOMIC_CHAR16_T_LOCK_FREE: i32,
|
|
142
|
-
ATOMIC_CHAR32_T_LOCK_FREE: i32,
|
|
143
|
-
ATOMIC_WCHAR_T_LOCK_FREE: i32,
|
|
144
|
-
ATOMIC_SHORT_LOCK_FREE: i32,
|
|
145
|
-
ATOMIC_INT_LOCK_FREE: i32,
|
|
146
|
-
ATOMIC_LONG_LOCK_FREE: i32,
|
|
147
|
-
ATOMIC_LLONG_LOCK_FREE: i32,
|
|
148
|
-
ATOMIC_POINTER_LOCK_FREE: i32
|
|
149
|
-
|
|
150
|
-
export
|
|
129
|
+
ATOMIC_BOOL_LOCK_FREE : i32,
|
|
130
|
+
ATOMIC_CHAR_LOCK_FREE : i32,
|
|
131
|
+
ATOMIC_CHAR16_T_LOCK_FREE : i32,
|
|
132
|
+
ATOMIC_CHAR32_T_LOCK_FREE : i32,
|
|
133
|
+
ATOMIC_WCHAR_T_LOCK_FREE : i32,
|
|
134
|
+
ATOMIC_SHORT_LOCK_FREE : i32,
|
|
135
|
+
ATOMIC_INT_LOCK_FREE : i32,
|
|
136
|
+
ATOMIC_LONG_LOCK_FREE : i32,
|
|
137
|
+
ATOMIC_LLONG_LOCK_FREE : i32,
|
|
138
|
+
ATOMIC_POINTER_LOCK_FREE : i32
|
|
139
|
+
);
|
|
140
|
+
export(
|
|
151
141
|
// Atomic types
|
|
152
|
-
atomic_bool,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
atomic_bool,
|
|
143
|
+
atomic_char,
|
|
144
|
+
atomic_schar,
|
|
145
|
+
atomic_uchar,
|
|
146
|
+
atomic_short,
|
|
147
|
+
atomic_ushort,
|
|
148
|
+
atomic_int,
|
|
149
|
+
atomic_uint,
|
|
150
|
+
atomic_long,
|
|
151
|
+
atomic_ulong,
|
|
152
|
+
atomic_llong,
|
|
153
|
+
atomic_ullong,
|
|
154
|
+
atomic_char16_t,
|
|
155
|
+
atomic_char32_t,
|
|
156
|
+
atomic_wchar_t,
|
|
157
|
+
atomic_int_least8_t,
|
|
158
|
+
atomic_uint_least8_t,
|
|
159
|
+
atomic_int_least16_t,
|
|
160
|
+
atomic_uint_least16_t,
|
|
161
|
+
atomic_int_least32_t,
|
|
162
|
+
atomic_uint_least32_t,
|
|
163
|
+
atomic_int_least64_t,
|
|
164
|
+
atomic_uint_least64_t,
|
|
165
|
+
atomic_int_fast8_t,
|
|
166
|
+
atomic_uint_fast8_t,
|
|
167
|
+
atomic_int_fast16_t,
|
|
168
|
+
atomic_uint_fast16_t,
|
|
169
|
+
atomic_int_fast32_t,
|
|
170
|
+
atomic_uint_fast32_t,
|
|
171
|
+
atomic_int_fast64_t,
|
|
172
|
+
atomic_uint_fast64_t,
|
|
173
|
+
atomic_intptr_t,
|
|
174
|
+
atomic_uintptr_t,
|
|
175
|
+
atomic_size_t,
|
|
176
|
+
atomic_ptrdiff_t,
|
|
177
|
+
atomic_intmax_t,
|
|
178
|
+
atomic_uintmax_t,
|
|
168
179
|
// Memory order and flag types
|
|
169
|
-
memory_order,
|
|
170
|
-
|
|
180
|
+
memory_order,
|
|
181
|
+
atomic_flag,
|
|
171
182
|
// Memory order constants
|
|
172
|
-
memory_order_relaxed,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
183
|
+
memory_order_relaxed,
|
|
184
|
+
memory_order_consume,
|
|
185
|
+
memory_order_acquire,
|
|
186
|
+
memory_order_release,
|
|
187
|
+
memory_order_acq_rel,
|
|
188
|
+
memory_order_seq_cst,
|
|
176
189
|
// Generic atomic operations
|
|
177
|
-
atomic_init,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
atomic_init,
|
|
191
|
+
atomic_load,
|
|
192
|
+
atomic_load_explicit,
|
|
193
|
+
atomic_store,
|
|
194
|
+
atomic_store_explicit,
|
|
195
|
+
atomic_exchange,
|
|
196
|
+
atomic_exchange_explicit,
|
|
197
|
+
atomic_compare_exchange_strong,
|
|
198
|
+
atomic_compare_exchange_strong_explicit,
|
|
199
|
+
atomic_compare_exchange_weak,
|
|
200
|
+
atomic_compare_exchange_weak_explicit,
|
|
183
201
|
// Integer atomic operations
|
|
184
|
-
atomic_fetch_add,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
202
|
+
atomic_fetch_add,
|
|
203
|
+
atomic_fetch_add_explicit,
|
|
204
|
+
atomic_fetch_sub,
|
|
205
|
+
atomic_fetch_sub_explicit,
|
|
206
|
+
atomic_fetch_or,
|
|
207
|
+
atomic_fetch_or_explicit,
|
|
208
|
+
atomic_fetch_xor,
|
|
209
|
+
atomic_fetch_xor_explicit,
|
|
210
|
+
atomic_fetch_and,
|
|
211
|
+
atomic_fetch_and_explicit,
|
|
190
212
|
// Pointer atomic operations
|
|
191
|
-
atomic_load_ptr,
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
atomic_load_ptr,
|
|
214
|
+
atomic_store_ptr,
|
|
215
|
+
atomic_exchange_ptr,
|
|
216
|
+
atomic_compare_exchange_strong_ptr,
|
|
217
|
+
atomic_compare_exchange_weak_ptr,
|
|
194
218
|
// Atomic flag operations
|
|
195
|
-
atomic_flag_test_and_set,
|
|
196
|
-
|
|
197
|
-
|
|
219
|
+
atomic_flag_test_and_set,
|
|
220
|
+
atomic_flag_test_and_set_explicit,
|
|
221
|
+
atomic_flag_clear,
|
|
222
|
+
atomic_flag_clear_explicit,
|
|
198
223
|
// Memory fences
|
|
199
|
-
atomic_thread_fence,
|
|
200
|
-
|
|
224
|
+
atomic_thread_fence,
|
|
225
|
+
atomic_signal_fence,
|
|
201
226
|
// Lock-free property
|
|
202
227
|
atomic_is_lock_free,
|
|
203
|
-
|
|
204
228
|
// Lock-free constants
|
|
205
|
-
ATOMIC_BOOL_LOCK_FREE,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
229
|
+
ATOMIC_BOOL_LOCK_FREE,
|
|
230
|
+
ATOMIC_CHAR_LOCK_FREE,
|
|
231
|
+
ATOMIC_CHAR16_T_LOCK_FREE,
|
|
232
|
+
ATOMIC_CHAR32_T_LOCK_FREE,
|
|
233
|
+
ATOMIC_WCHAR_T_LOCK_FREE,
|
|
234
|
+
ATOMIC_SHORT_LOCK_FREE,
|
|
235
|
+
ATOMIC_INT_LOCK_FREE,
|
|
236
|
+
ATOMIC_LONG_LOCK_FREE,
|
|
237
|
+
ATOMIC_LLONG_LOCK_FREE,
|
|
238
|
+
ATOMIC_POINTER_LOCK_FREE,
|
|
211
239
|
// Kill dependency
|
|
212
|
-
kill_dependency
|
|
240
|
+
kill_dependency
|
|
241
|
+
);
|
package/std/libc/stdint.yo
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
//!
|
|
3
3
|
//! Note: Yo already has `i8`, `i16`, `i32`, `i64`, `u8`, `u16`, `u32`, `u64`.
|
|
4
4
|
//! This file provides C-compatible aliases and additional types/constants.
|
|
5
|
-
|
|
6
5
|
// Type aliases for C compatibility (mapping Yo types to C stdint names)
|
|
7
6
|
int8_t :: i8;
|
|
8
7
|
int16_t :: i16;
|
|
@@ -12,11 +11,10 @@ uint8_t :: u8;
|
|
|
12
11
|
uint16_t :: u16;
|
|
13
12
|
uint32_t :: u32;
|
|
14
13
|
uint64_t :: u64;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
c_include(
|
|
15
|
+
"<stdint.h>",
|
|
17
16
|
// Additional types needed for some limits
|
|
18
17
|
wint_t : Type,
|
|
19
|
-
|
|
20
18
|
// Least-width integer types (at least N bits)
|
|
21
19
|
int_least8_t : Type,
|
|
22
20
|
int_least16_t : Type,
|
|
@@ -26,7 +24,6 @@ c_include "<stdint.h>",
|
|
|
26
24
|
uint_least16_t : Type,
|
|
27
25
|
uint_least32_t : Type,
|
|
28
26
|
uint_least64_t : Type,
|
|
29
|
-
|
|
30
27
|
// Fastest minimum-width integer types (fastest with at least N bits)
|
|
31
28
|
int_fast8_t : Type,
|
|
32
29
|
int_fast16_t : Type,
|
|
@@ -36,15 +33,12 @@ c_include "<stdint.h>",
|
|
|
36
33
|
uint_fast16_t : Type,
|
|
37
34
|
uint_fast32_t : Type,
|
|
38
35
|
uint_fast64_t : Type,
|
|
39
|
-
|
|
40
36
|
// Pointer-sized integers
|
|
41
37
|
intptr_t : Type,
|
|
42
38
|
uintptr_t : Type,
|
|
43
|
-
|
|
44
39
|
// Maximum-width integer types
|
|
45
40
|
intmax_t : Type,
|
|
46
41
|
uintmax_t : Type,
|
|
47
|
-
|
|
48
42
|
// Limits for exact-width integer types
|
|
49
43
|
INT8_MIN : i8,
|
|
50
44
|
INT8_MAX : i8,
|
|
@@ -58,7 +52,6 @@ c_include "<stdint.h>",
|
|
|
58
52
|
UINT16_MAX : u16,
|
|
59
53
|
UINT32_MAX : u32,
|
|
60
54
|
UINT64_MAX : u64,
|
|
61
|
-
|
|
62
55
|
// Limits for least-width integer types
|
|
63
56
|
INT_LEAST8_MIN : int_least8_t,
|
|
64
57
|
INT_LEAST8_MAX : int_least8_t,
|
|
@@ -72,7 +65,6 @@ c_include "<stdint.h>",
|
|
|
72
65
|
UINT_LEAST16_MAX : uint_least16_t,
|
|
73
66
|
UINT_LEAST32_MAX : uint_least32_t,
|
|
74
67
|
UINT_LEAST64_MAX : uint_least64_t,
|
|
75
|
-
|
|
76
68
|
// Limits for fastest minimum-width integer types
|
|
77
69
|
INT_FAST8_MIN : int_fast8_t,
|
|
78
70
|
INT_FAST8_MAX : int_fast8_t,
|
|
@@ -86,31 +78,26 @@ c_include "<stdint.h>",
|
|
|
86
78
|
UINT_FAST16_MAX : uint_fast16_t,
|
|
87
79
|
UINT_FAST32_MAX : uint_fast32_t,
|
|
88
80
|
UINT_FAST64_MAX : uint_fast64_t,
|
|
89
|
-
|
|
90
81
|
// Limits for pointer-sized integer types
|
|
91
82
|
INTPTR_MIN : intptr_t,
|
|
92
83
|
INTPTR_MAX : intptr_t,
|
|
93
84
|
UINTPTR_MAX : uintptr_t,
|
|
94
|
-
|
|
95
85
|
// Limits for maximum-width integer types
|
|
96
86
|
INTMAX_MIN : intmax_t,
|
|
97
87
|
INTMAX_MAX : intmax_t,
|
|
98
88
|
UINTMAX_MAX : uintmax_t,
|
|
99
|
-
|
|
100
89
|
// Limits for ptrdiff_t, size_t, and sig_atomic_t
|
|
101
90
|
PTRDIFF_MIN : isize,
|
|
102
91
|
PTRDIFF_MAX : isize,
|
|
103
92
|
SIZE_MAX : usize,
|
|
104
93
|
SIG_ATOMIC_MIN : int,
|
|
105
94
|
SIG_ATOMIC_MAX : int,
|
|
106
|
-
|
|
107
95
|
// Limits for wint_t (wide character input type)
|
|
108
96
|
WINT_MIN : wint_t,
|
|
109
97
|
WINT_MAX : wint_t
|
|
110
|
-
;
|
|
111
|
-
|
|
98
|
+
);
|
|
112
99
|
// Export all stdint functionality
|
|
113
|
-
export
|
|
100
|
+
export(
|
|
114
101
|
// C-compatible type aliases
|
|
115
102
|
int8_t,
|
|
116
103
|
int16_t,
|
|
@@ -120,7 +107,6 @@ export
|
|
|
120
107
|
uint16_t,
|
|
121
108
|
uint32_t,
|
|
122
109
|
uint64_t,
|
|
123
|
-
|
|
124
110
|
// Least-width types
|
|
125
111
|
int_least8_t,
|
|
126
112
|
int_least16_t,
|
|
@@ -130,7 +116,6 @@ export
|
|
|
130
116
|
uint_least16_t,
|
|
131
117
|
uint_least32_t,
|
|
132
118
|
uint_least64_t,
|
|
133
|
-
|
|
134
119
|
// Fastest minimum-width types
|
|
135
120
|
int_fast8_t,
|
|
136
121
|
int_fast16_t,
|
|
@@ -140,15 +125,12 @@ export
|
|
|
140
125
|
uint_fast16_t,
|
|
141
126
|
uint_fast32_t,
|
|
142
127
|
uint_fast64_t,
|
|
143
|
-
|
|
144
128
|
// Pointer-sized types
|
|
145
129
|
intptr_t,
|
|
146
130
|
uintptr_t,
|
|
147
|
-
|
|
148
131
|
// Maximum-width types
|
|
149
132
|
intmax_t,
|
|
150
133
|
uintmax_t,
|
|
151
|
-
|
|
152
134
|
// Exact-width limits
|
|
153
135
|
INT8_MIN,
|
|
154
136
|
INT8_MAX,
|
|
@@ -162,7 +144,6 @@ export
|
|
|
162
144
|
UINT16_MAX,
|
|
163
145
|
UINT32_MAX,
|
|
164
146
|
UINT64_MAX,
|
|
165
|
-
|
|
166
147
|
// Least-width limits
|
|
167
148
|
INT_LEAST8_MIN,
|
|
168
149
|
INT_LEAST8_MAX,
|
|
@@ -176,7 +157,6 @@ export
|
|
|
176
157
|
UINT_LEAST16_MAX,
|
|
177
158
|
UINT_LEAST32_MAX,
|
|
178
159
|
UINT_LEAST64_MAX,
|
|
179
|
-
|
|
180
160
|
// Fastest minimum-width limits
|
|
181
161
|
INT_FAST8_MIN,
|
|
182
162
|
INT_FAST8_MAX,
|
|
@@ -190,17 +170,14 @@ export
|
|
|
190
170
|
UINT_FAST16_MAX,
|
|
191
171
|
UINT_FAST32_MAX,
|
|
192
172
|
UINT_FAST64_MAX,
|
|
193
|
-
|
|
194
173
|
// Pointer-sized limits
|
|
195
174
|
INTPTR_MIN,
|
|
196
175
|
INTPTR_MAX,
|
|
197
176
|
UINTPTR_MAX,
|
|
198
|
-
|
|
199
177
|
// Maximum-width limits
|
|
200
178
|
INTMAX_MIN,
|
|
201
179
|
INTMAX_MAX,
|
|
202
180
|
UINTMAX_MAX,
|
|
203
|
-
|
|
204
181
|
// Other limits
|
|
205
182
|
PTRDIFF_MIN,
|
|
206
183
|
PTRDIFF_MAX,
|
|
@@ -209,7 +186,6 @@ export
|
|
|
209
186
|
SIG_ATOMIC_MAX,
|
|
210
187
|
WINT_MIN,
|
|
211
188
|
WINT_MAX,
|
|
212
|
-
|
|
213
189
|
// Additional types
|
|
214
190
|
wint_t
|
|
215
|
-
;
|
|
191
|
+
);
|