@shd101wyy/yo 0.0.2
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/LICENSE.md +17 -0
- package/README.md +80 -0
- package/out/cjs/index.cjs +51 -0
- package/out/cjs/yo-cli.cjs +2158 -0
- package/out/esm/index.mjs +51 -0
- package/out/types/src/codegen/async/runtime.d.ts +2 -0
- package/out/types/src/codegen/async/state-code-gen.d.ts +10 -0
- package/out/types/src/codegen/async/state-machine.d.ts +13 -0
- package/out/types/src/codegen/c/collection.d.ts +3 -0
- package/out/types/src/codegen/codegen-c.d.ts +12 -0
- package/out/types/src/codegen/constants.d.ts +3 -0
- package/out/types/src/codegen/expressions/array.d.ts +4 -0
- package/out/types/src/codegen/expressions/generation.d.ts +11 -0
- package/out/types/src/codegen/expressions/index.d.ts +2 -0
- package/out/types/src/codegen/functions/collection.d.ts +5 -0
- package/out/types/src/codegen/functions/context.d.ts +57 -0
- package/out/types/src/codegen/functions/generation.d.ts +25 -0
- package/out/types/src/codegen/functions/index.d.ts +2 -0
- package/out/types/src/codegen/index.d.ts +20 -0
- package/out/types/src/codegen/parallelism/runtime.d.ts +2 -0
- package/out/types/src/codegen/types/collection.d.ts +8 -0
- package/out/types/src/codegen/types/generation.d.ts +13 -0
- package/out/types/src/codegen/types/index.d.ts +2 -0
- package/out/types/src/codegen/utils/fixup.d.ts +2 -0
- package/out/types/src/codegen/utils/index.d.ts +77 -0
- package/out/types/src/codegen/values/index.d.ts +1 -0
- package/out/types/src/emitter.d.ts +11 -0
- package/out/types/src/env.d.ts +85 -0
- package/out/types/src/error.d.ts +45 -0
- package/out/types/src/evaluator/async/await-analysis-types.d.ts +23 -0
- package/out/types/src/evaluator/async/await-analysis.d.ts +5 -0
- package/out/types/src/evaluator/builtins/alignof.d.ts +8 -0
- package/out/types/src/evaluator/builtins/and_or.d.ts +8 -0
- package/out/types/src/evaluator/builtins/arc_fns.d.ts +58 -0
- package/out/types/src/evaluator/builtins/array_fns.d.ts +0 -0
- package/out/types/src/evaluator/builtins/as.d.ts +8 -0
- package/out/types/src/evaluator/builtins/async_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/compt_assert.d.ts +8 -0
- package/out/types/src/evaluator/builtins/compt_boolean_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/compt_expect_error.d.ts +8 -0
- package/out/types/src/evaluator/builtins/compt_list_fns.d.ts +33 -0
- package/out/types/src/evaluator/builtins/compt_print.d.ts +8 -0
- package/out/types/src/evaluator/builtins/compt_string_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/consume.d.ts +8 -0
- package/out/types/src/evaluator/builtins/drop.d.ts +8 -0
- package/out/types/src/evaluator/builtins/dup.d.ts +8 -0
- package/out/types/src/evaluator/builtins/expr_fns.d.ts +33 -0
- package/out/types/src/evaluator/builtins/future_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/gc.d.ts +8 -0
- package/out/types/src/evaluator/builtins/gensym.d.ts +8 -0
- package/out/types/src/evaluator/builtins/impl_constraint.d.ts +8 -0
- package/out/types/src/evaluator/builtins/macro_expand.d.ts +8 -0
- package/out/types/src/evaluator/builtins/numeric_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/panic.d.ts +8 -0
- package/out/types/src/evaluator/builtins/ptr_fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/quote.d.ts +13 -0
- package/out/types/src/evaluator/builtins/rc.d.ts +8 -0
- package/out/types/src/evaluator/builtins/sizeof.d.ts +8 -0
- package/out/types/src/evaluator/builtins/the.d.ts +8 -0
- package/out/types/src/evaluator/builtins/type_fns.d.ts +28 -0
- package/out/types/src/evaluator/builtins/va_start.d.ts +8 -0
- package/out/types/src/evaluator/builtins/var_fns.d.ts +18 -0
- package/out/types/src/evaluator/calls/array.d.ts +13 -0
- package/out/types/src/evaluator/calls/array_type.d.ts +11 -0
- package/out/types/src/evaluator/calls/closure_type.d.ts +11 -0
- package/out/types/src/evaluator/calls/compt_function.d.ts +19 -0
- package/out/types/src/evaluator/calls/compt_list_type.d.ts +11 -0
- package/out/types/src/evaluator/calls/function.d.ts +16 -0
- package/out/types/src/evaluator/calls/function_type.d.ts +15 -0
- package/out/types/src/evaluator/calls/helper.d.ts +42 -0
- package/out/types/src/evaluator/calls/iso.d.ts +15 -0
- package/out/types/src/evaluator/calls/module_type.d.ts +11 -0
- package/out/types/src/evaluator/calls/numeric_type.d.ts +15 -0
- package/out/types/src/evaluator/calls/pointer.d.ts +8 -0
- package/out/types/src/evaluator/calls/pointer_type.d.ts +14 -0
- package/out/types/src/evaluator/calls/type.d.ts +12 -0
- package/out/types/src/evaluator/context.d.ts +169 -0
- package/out/types/src/evaluator/exprs/_expr.d.ts +8 -0
- package/out/types/src/evaluator/exprs/assignment.d.ts +9 -0
- package/out/types/src/evaluator/exprs/begin.d.ts +10 -0
- package/out/types/src/evaluator/exprs/binding.d.ts +12 -0
- package/out/types/src/evaluator/exprs/c_include.d.ts +8 -0
- package/out/types/src/evaluator/exprs/cond.d.ts +8 -0
- package/out/types/src/evaluator/exprs/destructuring_assignment.d.ts +33 -0
- package/out/types/src/evaluator/exprs/exists.d.ts +0 -0
- package/out/types/src/evaluator/exprs/expr.d.ts +9 -0
- package/out/types/src/evaluator/exprs/extern.d.ts +8 -0
- package/out/types/src/evaluator/exprs/identifer_and_operator.d.ts +9 -0
- package/out/types/src/evaluator/exprs/import.d.ts +9 -0
- package/out/types/src/evaluator/exprs/initialization_assignment.d.ts +8 -0
- package/out/types/src/evaluator/exprs/match.d.ts +8 -0
- package/out/types/src/evaluator/exprs/open.d.ts +8 -0
- package/out/types/src/evaluator/exprs/property_access.d.ts +8 -0
- package/out/types/src/evaluator/exprs/recur.d.ts +8 -0
- package/out/types/src/evaluator/exprs/subtype_of.d.ts +21 -0
- package/out/types/src/evaluator/exprs/test.d.ts +8 -0
- package/out/types/src/evaluator/exprs/typeof.d.ts +8 -0
- package/out/types/src/evaluator/exprs/while.d.ts +8 -0
- package/out/types/src/evaluator/index.d.ts +26 -0
- package/out/types/src/evaluator/types/array.d.ts +8 -0
- package/out/types/src/evaluator/types/closure.d.ts +8 -0
- package/out/types/src/evaluator/types/compt_list.d.ts +8 -0
- package/out/types/src/evaluator/types/concrete_module.d.ts +8 -0
- package/out/types/src/evaluator/types/dyn.d.ts +8 -0
- package/out/types/src/evaluator/types/enum.d.ts +8 -0
- package/out/types/src/evaluator/types/expr_synthesizer.d.ts +14 -0
- package/out/types/src/evaluator/types/field.d.ts +14 -0
- package/out/types/src/evaluator/types/fn_module.d.ts +8 -0
- package/out/types/src/evaluator/types/function.d.ts +58 -0
- package/out/types/src/evaluator/types/future_module.d.ts +8 -0
- package/out/types/src/evaluator/types/module.d.ts +19 -0
- package/out/types/src/evaluator/types/newtype.d.ts +8 -0
- package/out/types/src/evaluator/types/object.d.ts +8 -0
- package/out/types/src/evaluator/types/proofs.d.ts +0 -0
- package/out/types/src/evaluator/types/slice.d.ts +8 -0
- package/out/types/src/evaluator/types/struct.d.ts +8 -0
- package/out/types/src/evaluator/types/synthesizer.d.ts +16 -0
- package/out/types/src/evaluator/types/tuple.d.ts +18 -0
- package/out/types/src/evaluator/types/union.d.ts +8 -0
- package/out/types/src/evaluator/types/utils.d.ts +71 -0
- package/out/types/src/evaluator/types/validation.d.ts +3 -0
- package/out/types/src/evaluator/utils/array-utils.d.ts +15 -0
- package/out/types/src/evaluator/utils/closure.d.ts +35 -0
- package/out/types/src/evaluator/utils.d.ts +4 -0
- package/out/types/src/evaluator/values/anonymous_function.d.ts +8 -0
- package/out/types/src/evaluator/values/anonymous_module.d.ts +17 -0
- package/out/types/src/evaluator/values/anonymous_struct.d.ts +8 -0
- package/out/types/src/evaluator/values/array.d.ts +8 -0
- package/out/types/src/evaluator/values/boolean.d.ts +3 -0
- package/out/types/src/evaluator/values/char.d.ts +3 -0
- package/out/types/src/evaluator/values/compt_list.d.ts +8 -0
- package/out/types/src/evaluator/values/dyn.d.ts +8 -0
- package/out/types/src/evaluator/values/float.d.ts +4 -0
- package/out/types/src/evaluator/values/integer.d.ts +4 -0
- package/out/types/src/evaluator/values/module.d.ts +58 -0
- package/out/types/src/evaluator/values/string.d.ts +3 -0
- package/out/types/src/evaluator/values/tuple.d.ts +32 -0
- package/out/types/src/expr.d.ts +456 -0
- package/out/types/src/function-value.d.ts +42 -0
- package/out/types/src/index.d.ts +4 -0
- package/out/types/src/lexer.d.ts +2 -0
- package/out/types/src/logger.d.ts +1 -0
- package/out/types/src/module-manager.d.ts +30 -0
- package/out/types/src/naming-checker.d.ts +4 -0
- package/out/types/src/parser.d.ts +33 -0
- package/out/types/src/test-runner.d.ts +30 -0
- package/out/types/src/tests/codegen.test.d.ts +1 -0
- package/out/types/src/tests/fixme.test.d.ts +1 -0
- package/out/types/src/tests/module-manager.test.d.ts +1 -0
- package/out/types/src/tests/parser.test.d.ts +1 -0
- package/out/types/src/tests/sample.test.d.ts +0 -0
- package/out/types/src/tests/std.test.d.ts +1 -0
- package/out/types/src/token.d.ts +40 -0
- package/out/types/src/type-value.d.ts +7 -0
- package/out/types/src/types/compatibility.d.ts +16 -0
- package/out/types/src/types/creators.d.ts +73 -0
- package/out/types/src/types/definitions.d.ts +218 -0
- package/out/types/src/types/guards.d.ts +70 -0
- package/out/types/src/types/hierarchy.d.ts +4 -0
- package/out/types/src/types/index.d.ts +7 -0
- package/out/types/src/types/module_field.d.ts +2 -0
- package/out/types/src/types/tags.d.ts +45 -0
- package/out/types/src/types/utils.d.ts +50 -0
- package/out/types/src/unit-value.d.ts +7 -0
- package/out/types/src/utils.d.ts +6 -0
- package/out/types/src/value-tag.d.ts +29 -0
- package/out/types/src/value.d.ts +110 -0
- package/out/types/src/yo-cli.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +57 -0
- package/scripts/check-liburing.js +76 -0
- package/std/alg/hash.yo +50 -0
- package/std/allocator.yo +113 -0
- package/std/allocators/c_allocator.yo +118 -0
- package/std/async.yo +13 -0
- package/std/collections/array_list.yo +415 -0
- package/std/collections/hash_map.yo +482 -0
- package/std/collections/hash_set.yo +706 -0
- package/std/collections/index.yo +11 -0
- package/std/collections/linked_list.yo +439 -0
- package/std/error.yo +0 -0
- package/std/gc.yo +10 -0
- package/std/index.yo +12 -0
- package/std/io/file.yo +191 -0
- package/std/io/index.yo +5 -0
- package/std/libc/assert.yo +39 -0
- package/std/libc/ctype.yo +57 -0
- package/std/libc/errno.yo +182 -0
- package/std/libc/float.yo +87 -0
- package/std/libc/index.yo +29 -0
- package/std/libc/limits.yo +65 -0
- package/std/libc/math.yo +679 -0
- package/std/libc/signal.yo +101 -0
- package/std/libc/stdatomic.yo +213 -0
- package/std/libc/stdint.yo +214 -0
- package/std/libc/stdio.yo +225 -0
- package/std/libc/stdlib.yo +204 -0
- package/std/libc/string.yo +151 -0
- package/std/libc/time.yo +92 -0
- package/std/libc/unistd.yo +130 -0
- package/std/monad.yo +152 -0
- package/std/prelude.yo +3094 -0
- package/std/string/index.yo +8 -0
- package/std/string/rune.yo +82 -0
- package/std/string/string.yo +288 -0
- package/std/sync.yo +95 -0
- package/std/thread.yo +36 -0
- package/std/time.yo +13 -0
- package/std/worker.yo +36 -0
- package/vendor/mimalloc/.gitattributes +12 -0
- package/vendor/mimalloc/CMakeLists.txt +763 -0
- package/vendor/mimalloc/LICENSE +21 -0
- package/vendor/mimalloc/SECURITY.md +41 -0
- package/vendor/mimalloc/azure-pipelines.yml +251 -0
- package/vendor/mimalloc/bin/mimalloc-redirect-arm64.dll +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect-arm64.lib +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.dll +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.lib +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect.dll +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect.lib +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect32.dll +0 -0
- package/vendor/mimalloc/bin/mimalloc-redirect32.lib +0 -0
- package/vendor/mimalloc/bin/minject-arm64.exe +0 -0
- package/vendor/mimalloc/bin/minject.exe +0 -0
- package/vendor/mimalloc/bin/minject32.exe +0 -0
- package/vendor/mimalloc/bin/readme.md +118 -0
- package/vendor/mimalloc/cmake/JoinPaths.cmake +23 -0
- package/vendor/mimalloc/cmake/mimalloc-config-version.cmake +19 -0
- package/vendor/mimalloc/cmake/mimalloc-config.cmake +14 -0
- package/vendor/mimalloc/contrib/docker/alpine/Dockerfile +23 -0
- package/vendor/mimalloc/contrib/docker/alpine-arm32v7/Dockerfile +28 -0
- package/vendor/mimalloc/contrib/docker/alpine-x86/Dockerfile +28 -0
- package/vendor/mimalloc/contrib/docker/manylinux-x64/Dockerfile +23 -0
- package/vendor/mimalloc/contrib/docker/readme.md +10 -0
- package/vendor/mimalloc/contrib/vcpkg/portfile.cmake +64 -0
- package/vendor/mimalloc/contrib/vcpkg/readme.md +40 -0
- package/vendor/mimalloc/contrib/vcpkg/usage +20 -0
- package/vendor/mimalloc/contrib/vcpkg/vcpkg-cmake-wrapper.cmake +20 -0
- package/vendor/mimalloc/contrib/vcpkg/vcpkg.json +48 -0
- package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-a.svg +887 -0
- package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-b.svg +1185 -0
- package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-a.svg +757 -0
- package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-b.svg +1028 -0
- package/vendor/mimalloc/doc/bench-2020/bench-r5a-1.svg +769 -0
- package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-a.svg +868 -0
- package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-b.svg +1157 -0
- package/vendor/mimalloc/doc/bench-2020/bench-r5a-2.svg +983 -0
- package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-1.svg +683 -0
- package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-2.svg +854 -0
- package/vendor/mimalloc/doc/bench-2020/bench-spec-rss.svg +713 -0
- package/vendor/mimalloc/doc/bench-2020/bench-spec.svg +713 -0
- package/vendor/mimalloc/doc/bench-2020/bench-z4-1.svg +890 -0
- package/vendor/mimalloc/doc/bench-2020/bench-z4-2.svg +1146 -0
- package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-1.svg +796 -0
- package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-2.svg +974 -0
- package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-a.svg +952 -0
- package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-b.svg +1255 -0
- package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-a.svg +955 -0
- package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-b.svg +1269 -0
- package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-a.svg +836 -0
- package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-b.svg +1131 -0
- package/vendor/mimalloc/doc/bench-2021/bench-macmini-2021-01-30.svg +766 -0
- package/vendor/mimalloc/doc/doxyfile +2895 -0
- package/vendor/mimalloc/doc/ds-logo.jpg +0 -0
- package/vendor/mimalloc/doc/ds-logo.png +0 -0
- package/vendor/mimalloc/doc/mimalloc-doc.h +1452 -0
- package/vendor/mimalloc/doc/mimalloc-doxygen.css +60 -0
- package/vendor/mimalloc/doc/mimalloc-logo-100.png +0 -0
- package/vendor/mimalloc/doc/mimalloc-logo.png +0 -0
- package/vendor/mimalloc/doc/mimalloc-logo.svg +161 -0
- package/vendor/mimalloc/doc/spades-logo.png +0 -0
- package/vendor/mimalloc/doc/unreal-logo.svg +43 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj +500 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj.filters +108 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj +508 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj.filters +111 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-override-test-dep.vcxproj +355 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-override-test.vcxproj +360 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-test-api.vcxproj +295 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-test-stress.vcxproj +292 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc-test.vcxproj +289 -0
- package/vendor/mimalloc/ide/vs2022/mimalloc.sln +151 -0
- package/vendor/mimalloc/include/mimalloc/atomic.h +557 -0
- package/vendor/mimalloc/include/mimalloc/internal.h +1153 -0
- package/vendor/mimalloc/include/mimalloc/prim.h +421 -0
- package/vendor/mimalloc/include/mimalloc/track.h +145 -0
- package/vendor/mimalloc/include/mimalloc/types.h +685 -0
- package/vendor/mimalloc/include/mimalloc-new-delete.h +66 -0
- package/vendor/mimalloc/include/mimalloc-override.h +68 -0
- package/vendor/mimalloc/include/mimalloc-stats.h +103 -0
- package/vendor/mimalloc/include/mimalloc.h +612 -0
- package/vendor/mimalloc/mimalloc.pc.in +11 -0
- package/vendor/mimalloc/readme.md +946 -0
- package/vendor/mimalloc/src/alloc-aligned.c +360 -0
- package/vendor/mimalloc/src/alloc-override.c +316 -0
- package/vendor/mimalloc/src/alloc-posix.c +185 -0
- package/vendor/mimalloc/src/alloc.c +692 -0
- package/vendor/mimalloc/src/arena-abandon.c +346 -0
- package/vendor/mimalloc/src/arena.c +1043 -0
- package/vendor/mimalloc/src/bitmap.c +441 -0
- package/vendor/mimalloc/src/bitmap.h +119 -0
- package/vendor/mimalloc/src/free.c +572 -0
- package/vendor/mimalloc/src/heap.c +733 -0
- package/vendor/mimalloc/src/init.c +714 -0
- package/vendor/mimalloc/src/libc.c +334 -0
- package/vendor/mimalloc/src/options.c +663 -0
- package/vendor/mimalloc/src/os.c +770 -0
- package/vendor/mimalloc/src/page-queue.c +390 -0
- package/vendor/mimalloc/src/page.c +1049 -0
- package/vendor/mimalloc/src/prim/emscripten/prim.c +249 -0
- package/vendor/mimalloc/src/prim/osx/alloc-override-zone.c +461 -0
- package/vendor/mimalloc/src/prim/osx/prim.c +9 -0
- package/vendor/mimalloc/src/prim/prim.c +76 -0
- package/vendor/mimalloc/src/prim/readme.md +9 -0
- package/vendor/mimalloc/src/prim/unix/prim.c +934 -0
- package/vendor/mimalloc/src/prim/wasi/prim.c +284 -0
- package/vendor/mimalloc/src/prim/windows/etw-mimalloc.wprp +61 -0
- package/vendor/mimalloc/src/prim/windows/etw.h +905 -0
- package/vendor/mimalloc/src/prim/windows/etw.man +0 -0
- package/vendor/mimalloc/src/prim/windows/prim.c +878 -0
- package/vendor/mimalloc/src/prim/windows/readme.md +17 -0
- package/vendor/mimalloc/src/random.c +258 -0
- package/vendor/mimalloc/src/segment-map.c +142 -0
- package/vendor/mimalloc/src/segment.c +1702 -0
- package/vendor/mimalloc/src/static.c +41 -0
- package/vendor/mimalloc/src/stats.c +635 -0
- package/vendor/mimalloc/test/CMakeLists.txt +56 -0
- package/vendor/mimalloc/test/main-override-dep.cpp +51 -0
- package/vendor/mimalloc/test/main-override-dep.h +11 -0
- package/vendor/mimalloc/test/main-override-static.c +539 -0
- package/vendor/mimalloc/test/main-override.c +36 -0
- package/vendor/mimalloc/test/main-override.cpp +497 -0
- package/vendor/mimalloc/test/main.c +46 -0
- package/vendor/mimalloc/test/readme.md +16 -0
- package/vendor/mimalloc/test/test-api-fill.c +343 -0
- package/vendor/mimalloc/test/test-api.c +466 -0
- package/vendor/mimalloc/test/test-stress.c +428 -0
- package/vendor/mimalloc/test/test-wrong.c +92 -0
- package/vendor/mimalloc/test/testhelper.h +49 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
c_include "<stdio.h>",
|
|
2
|
+
// Types
|
|
3
|
+
FILE : Type,
|
|
4
|
+
fpos_t : Type,
|
|
5
|
+
va_list : Type,
|
|
6
|
+
|
|
7
|
+
// Standard streams
|
|
8
|
+
stdin : *(FILE),
|
|
9
|
+
stdout : *(FILE),
|
|
10
|
+
stderr : *(FILE),
|
|
11
|
+
|
|
12
|
+
// File operations
|
|
13
|
+
fopen :
|
|
14
|
+
fn(filename : *(char), mode : *(char)) -> ?*(FILE),
|
|
15
|
+
freopen :
|
|
16
|
+
fn(filename : *(char), mode : *(char), stream : *(FILE)) -> ?*(FILE),
|
|
17
|
+
fclose :
|
|
18
|
+
fn(stream : *(FILE)) -> int,
|
|
19
|
+
fflush :
|
|
20
|
+
fn(stream : ?*(FILE)) -> int,
|
|
21
|
+
setbuf :
|
|
22
|
+
fn(stream : *(FILE), buffer : ?*(char)) -> unit,
|
|
23
|
+
setvbuf :
|
|
24
|
+
fn(stream : *(FILE), buffer : ?*(char), mode : int, size : usize) -> int,
|
|
25
|
+
|
|
26
|
+
// File positioning
|
|
27
|
+
fseek :
|
|
28
|
+
fn(stream : *(FILE), offset : int, whence : int) -> int,
|
|
29
|
+
ftell :
|
|
30
|
+
fn(stream : *(FILE)) -> int,
|
|
31
|
+
rewind :
|
|
32
|
+
fn(stream : *(FILE)) -> unit,
|
|
33
|
+
fgetpos :
|
|
34
|
+
fn(stream : *(FILE), pos : *(fpos_t)) -> int,
|
|
35
|
+
fsetpos :
|
|
36
|
+
fn(stream : *(FILE), pos : *(fpos_t)) -> int,
|
|
37
|
+
|
|
38
|
+
// Character input/output
|
|
39
|
+
fgetc :
|
|
40
|
+
fn(stream : *(FILE)) -> int,
|
|
41
|
+
getc :
|
|
42
|
+
fn(stream : *(FILE)) -> int,
|
|
43
|
+
getchar :
|
|
44
|
+
fn() -> int,
|
|
45
|
+
fputc :
|
|
46
|
+
fn(c : int, stream : *(FILE)) -> int,
|
|
47
|
+
putc :
|
|
48
|
+
fn(c : int, stream : *(FILE)) -> int,
|
|
49
|
+
putchar :
|
|
50
|
+
fn(c : int) -> int,
|
|
51
|
+
ungetc :
|
|
52
|
+
fn(c : int, stream : *(FILE)) -> int,
|
|
53
|
+
|
|
54
|
+
// String input/output
|
|
55
|
+
fgets :
|
|
56
|
+
fn(s : *(char), n : int, stream : *(FILE)) -> ?*(char),
|
|
57
|
+
gets :
|
|
58
|
+
fn(s : *(char)) -> ?*(char),
|
|
59
|
+
fputs :
|
|
60
|
+
fn(s : *(char), stream : *(FILE)) -> int,
|
|
61
|
+
puts :
|
|
62
|
+
fn(s : *(char)) -> int,
|
|
63
|
+
|
|
64
|
+
// Formatted input/output with variadic arguments
|
|
65
|
+
printf :
|
|
66
|
+
fn(format : *(char), ...) -> int,
|
|
67
|
+
fprintf :
|
|
68
|
+
fn(stream : *(FILE), format : *(char), ...) -> int,
|
|
69
|
+
sprintf :
|
|
70
|
+
fn(s : *(char), format : *(char), ...) -> int,
|
|
71
|
+
snprintf :
|
|
72
|
+
fn(s : *(char), n : usize, format : *(char), ...) -> int,
|
|
73
|
+
|
|
74
|
+
vprintf :
|
|
75
|
+
fn(format : *(char), ap : va_list) -> int,
|
|
76
|
+
vfprintf :
|
|
77
|
+
fn(stream : *(FILE), format : *(char), ap : va_list) -> int,
|
|
78
|
+
vsprintf :
|
|
79
|
+
fn(s : *(char), format : *(char), ap : va_list) -> int,
|
|
80
|
+
vsnprintf :
|
|
81
|
+
fn(s : *(char), n : usize, format : *(char), ap : va_list) -> int,
|
|
82
|
+
|
|
83
|
+
scanf :
|
|
84
|
+
fn(format : *(char), ...) -> int,
|
|
85
|
+
fscanf :
|
|
86
|
+
fn(stream : *(FILE), format : *(char), ...) -> int,
|
|
87
|
+
sscanf :
|
|
88
|
+
fn(s : *(char), format : *(char), ...) -> int,
|
|
89
|
+
|
|
90
|
+
vscanf :
|
|
91
|
+
fn(format : *(char), ap : va_list) -> int,
|
|
92
|
+
vfscanf :
|
|
93
|
+
fn(stream : *(FILE), format : *(char), ap : va_list) -> int,
|
|
94
|
+
vsscanf :
|
|
95
|
+
fn(s : *(char), format : *(char), ap : va_list) -> int,
|
|
96
|
+
|
|
97
|
+
// Binary input/output
|
|
98
|
+
fread :
|
|
99
|
+
fn(ptr : *(unit), size : usize, nmemb : usize, stream : *(FILE)) -> usize,
|
|
100
|
+
fwrite :
|
|
101
|
+
fn(ptr : *(unit), size : usize, nmemb : usize, stream : *(FILE)) -> usize,
|
|
102
|
+
|
|
103
|
+
// File management
|
|
104
|
+
remove :
|
|
105
|
+
fn(filename : *(char)) -> int,
|
|
106
|
+
rename :
|
|
107
|
+
fn(old : *(char), new : *(char)) -> int,
|
|
108
|
+
tmpfile :
|
|
109
|
+
fn() -> ?*(FILE),
|
|
110
|
+
tmpnam :
|
|
111
|
+
fn(s : ?*(char)) -> ?*(char),
|
|
112
|
+
|
|
113
|
+
// Error handling
|
|
114
|
+
feof :
|
|
115
|
+
fn(stream : *(FILE)) -> int,
|
|
116
|
+
ferror :
|
|
117
|
+
fn(stream : *(FILE)) -> int,
|
|
118
|
+
clearerr :
|
|
119
|
+
fn(stream : *(FILE)) -> unit,
|
|
120
|
+
perror :
|
|
121
|
+
fn(s : *(char)) -> unit,
|
|
122
|
+
|
|
123
|
+
// Constants
|
|
124
|
+
EOF : int,
|
|
125
|
+
BUFSIZ : int,
|
|
126
|
+
FILENAME_MAX : int,
|
|
127
|
+
FOPEN_MAX : int,
|
|
128
|
+
TMP_MAX : int,
|
|
129
|
+
L_tmpnam : int,
|
|
130
|
+
SEEK_SET : int,
|
|
131
|
+
SEEK_CUR : int,
|
|
132
|
+
SEEK_END : int,
|
|
133
|
+
_IOFBF : int,
|
|
134
|
+
_IOLBF : int,
|
|
135
|
+
_IONBF : int
|
|
136
|
+
;
|
|
137
|
+
|
|
138
|
+
// Export all stdio functionality
|
|
139
|
+
export
|
|
140
|
+
// Types
|
|
141
|
+
FILE,
|
|
142
|
+
fpos_t,
|
|
143
|
+
va_list,
|
|
144
|
+
|
|
145
|
+
// Standard streams
|
|
146
|
+
stdin,
|
|
147
|
+
stdout,
|
|
148
|
+
stderr,
|
|
149
|
+
|
|
150
|
+
// File operations
|
|
151
|
+
fopen,
|
|
152
|
+
freopen,
|
|
153
|
+
fclose,
|
|
154
|
+
fflush,
|
|
155
|
+
setbuf,
|
|
156
|
+
setvbuf,
|
|
157
|
+
|
|
158
|
+
// File positioning
|
|
159
|
+
fseek,
|
|
160
|
+
ftell,
|
|
161
|
+
rewind,
|
|
162
|
+
fgetpos,
|
|
163
|
+
fsetpos,
|
|
164
|
+
|
|
165
|
+
// Character input/output
|
|
166
|
+
fgetc,
|
|
167
|
+
getc,
|
|
168
|
+
getchar,
|
|
169
|
+
fputc,
|
|
170
|
+
putc,
|
|
171
|
+
putchar,
|
|
172
|
+
ungetc,
|
|
173
|
+
|
|
174
|
+
// String input/output
|
|
175
|
+
fgets,
|
|
176
|
+
gets,
|
|
177
|
+
fputs,
|
|
178
|
+
puts,
|
|
179
|
+
|
|
180
|
+
// Formatted input/output with variadic arguments
|
|
181
|
+
printf,
|
|
182
|
+
fprintf,
|
|
183
|
+
sprintf,
|
|
184
|
+
snprintf,
|
|
185
|
+
vprintf,
|
|
186
|
+
vfprintf,
|
|
187
|
+
vsprintf,
|
|
188
|
+
vsnprintf,
|
|
189
|
+
scanf,
|
|
190
|
+
fscanf,
|
|
191
|
+
sscanf,
|
|
192
|
+
vscanf,
|
|
193
|
+
vfscanf,
|
|
194
|
+
vsscanf,
|
|
195
|
+
|
|
196
|
+
// Binary input/output
|
|
197
|
+
fread,
|
|
198
|
+
fwrite,
|
|
199
|
+
|
|
200
|
+
// File management
|
|
201
|
+
remove,
|
|
202
|
+
rename,
|
|
203
|
+
tmpfile,
|
|
204
|
+
tmpnam,
|
|
205
|
+
|
|
206
|
+
// Error handling
|
|
207
|
+
feof,
|
|
208
|
+
ferror,
|
|
209
|
+
clearerr,
|
|
210
|
+
perror,
|
|
211
|
+
|
|
212
|
+
// Constants
|
|
213
|
+
EOF,
|
|
214
|
+
BUFSIZ,
|
|
215
|
+
FILENAME_MAX,
|
|
216
|
+
FOPEN_MAX,
|
|
217
|
+
TMP_MAX,
|
|
218
|
+
L_tmpnam,
|
|
219
|
+
SEEK_SET,
|
|
220
|
+
SEEK_CUR,
|
|
221
|
+
SEEK_END,
|
|
222
|
+
_IOFBF,
|
|
223
|
+
_IOLBF,
|
|
224
|
+
_IONBF
|
|
225
|
+
;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
c_include "<stdlib.h>",
|
|
2
|
+
// Types for div functions
|
|
3
|
+
div_t : Type,
|
|
4
|
+
ldiv_t : Type,
|
|
5
|
+
lldiv_t : Type,
|
|
6
|
+
wchar_t : Type,
|
|
7
|
+
|
|
8
|
+
// Program termination
|
|
9
|
+
exit :
|
|
10
|
+
fn(status : int) -> unit,
|
|
11
|
+
quick_exit :
|
|
12
|
+
fn(status : int) -> unit,
|
|
13
|
+
_Exit :
|
|
14
|
+
fn(status : int) -> unit,
|
|
15
|
+
abort :
|
|
16
|
+
fn() -> unit,
|
|
17
|
+
atexit :
|
|
18
|
+
fn(func : (fn() -> unit)) -> int,
|
|
19
|
+
at_quick_exit :
|
|
20
|
+
fn(func : (fn() -> unit)) -> int,
|
|
21
|
+
|
|
22
|
+
// Memory management
|
|
23
|
+
malloc :
|
|
24
|
+
fn(size : usize) -> ?*(void),
|
|
25
|
+
calloc :
|
|
26
|
+
fn(nmemb : usize, size : usize) -> ?*(void),
|
|
27
|
+
realloc :
|
|
28
|
+
fn(ptr : ?*(void), size : usize) -> ?*(void),
|
|
29
|
+
free :
|
|
30
|
+
fn(ptr : ?*(void)) -> unit,
|
|
31
|
+
aligned_alloc :
|
|
32
|
+
fn(alignment : usize, size : usize) -> ?*(void),
|
|
33
|
+
|
|
34
|
+
// String to number conversion
|
|
35
|
+
atof :
|
|
36
|
+
fn(nptr : *(char)) -> f64,
|
|
37
|
+
atoi :
|
|
38
|
+
fn(nptr : *(char)) -> int,
|
|
39
|
+
atol :
|
|
40
|
+
fn(nptr : *(char)) -> long,
|
|
41
|
+
atoll :
|
|
42
|
+
fn(nptr : *(char)) -> longlong,
|
|
43
|
+
|
|
44
|
+
strtol :
|
|
45
|
+
fn(nptr : *(char), endptr : ?*(?*(char)), base : int) -> long,
|
|
46
|
+
strtoll :
|
|
47
|
+
fn(nptr : *(char), endptr : ?*(?*(char)), base : int) -> longlong,
|
|
48
|
+
strtoul :
|
|
49
|
+
fn(nptr : *(char), endptr : ?*(?*(char)), base : int) -> ulong,
|
|
50
|
+
strtoull :
|
|
51
|
+
fn(nptr : *(char), endptr : ?*(?*(char)), base : int) -> ulonglong,
|
|
52
|
+
|
|
53
|
+
strtof :
|
|
54
|
+
fn(nptr : *(char), endptr : ?*(?*(char))) -> f32,
|
|
55
|
+
strtod :
|
|
56
|
+
fn(nptr : *(char), endptr : ?*(?*(char))) -> f64,
|
|
57
|
+
strtold :
|
|
58
|
+
fn(nptr : *(char), endptr : ?*(?*(char))) -> longdouble,
|
|
59
|
+
|
|
60
|
+
// Pseudo-random sequence generation
|
|
61
|
+
rand :
|
|
62
|
+
fn() -> int,
|
|
63
|
+
srand :
|
|
64
|
+
fn(seed : uint) -> unit,
|
|
65
|
+
|
|
66
|
+
// C11 - Thread-safe random functions
|
|
67
|
+
rand_r :
|
|
68
|
+
fn(seedp : *(uint)) -> int,
|
|
69
|
+
|
|
70
|
+
// Searching and sorting
|
|
71
|
+
bsearch :
|
|
72
|
+
fn(key : *(void), base : *(void), nmemb : usize, size : usize,
|
|
73
|
+
compar : (fn(a : *(void), b : *(void)) -> int)) -> ?*(void),
|
|
74
|
+
qsort :
|
|
75
|
+
fn(base : *(void), nmemb : usize, size : usize,
|
|
76
|
+
compar : (fn(a : *(void), b : *(void)) -> int)) -> unit,
|
|
77
|
+
|
|
78
|
+
// Integer arithmetic
|
|
79
|
+
abs :
|
|
80
|
+
fn(j : int) -> int,
|
|
81
|
+
labs :
|
|
82
|
+
fn(j : long) -> long,
|
|
83
|
+
llabs :
|
|
84
|
+
fn(j : longlong) -> longlong,
|
|
85
|
+
|
|
86
|
+
div :
|
|
87
|
+
fn(numer : int, denom : int) -> div_t,
|
|
88
|
+
ldiv :
|
|
89
|
+
fn(numer : long, denom : long) -> ldiv_t,
|
|
90
|
+
lldiv :
|
|
91
|
+
fn(numer : longlong, denom : longlong) -> lldiv_t,
|
|
92
|
+
|
|
93
|
+
// Environment functions
|
|
94
|
+
getenv :
|
|
95
|
+
fn(name : *(char)) -> ?*(char),
|
|
96
|
+
system :
|
|
97
|
+
fn(command : ?*(char)) -> int,
|
|
98
|
+
|
|
99
|
+
// C11 Annex K - Bounds-checking interfaces
|
|
100
|
+
getenv_s :
|
|
101
|
+
fn(len : ?*(usize), value : *(char), maxsize : usize, name : *(char)) -> int,
|
|
102
|
+
|
|
103
|
+
// Multibyte/wide character conversion
|
|
104
|
+
mblen :
|
|
105
|
+
fn(s : ?*(char), n : usize) -> int,
|
|
106
|
+
mbtowc :
|
|
107
|
+
fn(pwc : ?*(wchar_t), s : ?*(char), n : usize) -> int,
|
|
108
|
+
wctomb :
|
|
109
|
+
fn(s : ?*(char), wc : wchar_t) -> int,
|
|
110
|
+
|
|
111
|
+
// Multibyte/wide string conversion
|
|
112
|
+
mbstowcs :
|
|
113
|
+
fn(dest : ?*(wchar_t), src : *(char), n : usize) -> usize,
|
|
114
|
+
wcstombs :
|
|
115
|
+
fn(dest : ?*(char), src : *(wchar_t), n : usize) -> usize,
|
|
116
|
+
|
|
117
|
+
// C11 Annex K - Safe multibyte functions
|
|
118
|
+
mbstowcs_s :
|
|
119
|
+
fn(retval : ?*(usize), dest : ?*(wchar_t), destsz : usize,
|
|
120
|
+
src : *(char), len : usize) -> int,
|
|
121
|
+
wcstombs_s :
|
|
122
|
+
fn(retval : ?*(usize), dest : ?*(char), destsz : usize,
|
|
123
|
+
src : *(wchar_t), len : usize) -> int,
|
|
124
|
+
|
|
125
|
+
// Constants
|
|
126
|
+
EXIT_SUCCESS : int,
|
|
127
|
+
EXIT_FAILURE : int,
|
|
128
|
+
RAND_MAX : int,
|
|
129
|
+
MB_CUR_MAX : int
|
|
130
|
+
;
|
|
131
|
+
|
|
132
|
+
// Export all stdlib functionality
|
|
133
|
+
export
|
|
134
|
+
// Program termination
|
|
135
|
+
exit,
|
|
136
|
+
quick_exit,
|
|
137
|
+
_Exit,
|
|
138
|
+
abort,
|
|
139
|
+
atexit,
|
|
140
|
+
at_quick_exit,
|
|
141
|
+
|
|
142
|
+
// Memory management
|
|
143
|
+
malloc,
|
|
144
|
+
calloc,
|
|
145
|
+
realloc,
|
|
146
|
+
free,
|
|
147
|
+
aligned_alloc,
|
|
148
|
+
|
|
149
|
+
// String to number conversion
|
|
150
|
+
atof,
|
|
151
|
+
atoi,
|
|
152
|
+
atol,
|
|
153
|
+
atoll,
|
|
154
|
+
strtol,
|
|
155
|
+
strtoll,
|
|
156
|
+
strtoul,
|
|
157
|
+
strtoull,
|
|
158
|
+
strtof,
|
|
159
|
+
strtod,
|
|
160
|
+
strtold,
|
|
161
|
+
|
|
162
|
+
// Random number generation
|
|
163
|
+
rand,
|
|
164
|
+
srand,
|
|
165
|
+
rand_r,
|
|
166
|
+
|
|
167
|
+
// Searching and sorting
|
|
168
|
+
bsearch,
|
|
169
|
+
qsort,
|
|
170
|
+
|
|
171
|
+
// Integer arithmetic
|
|
172
|
+
abs,
|
|
173
|
+
labs,
|
|
174
|
+
llabs,
|
|
175
|
+
div,
|
|
176
|
+
ldiv,
|
|
177
|
+
lldiv,
|
|
178
|
+
|
|
179
|
+
// Environment
|
|
180
|
+
getenv,
|
|
181
|
+
system,
|
|
182
|
+
getenv_s,
|
|
183
|
+
|
|
184
|
+
// Multibyte/wide character
|
|
185
|
+
mblen,
|
|
186
|
+
mbtowc,
|
|
187
|
+
wctomb,
|
|
188
|
+
mbstowcs,
|
|
189
|
+
wcstombs,
|
|
190
|
+
mbstowcs_s,
|
|
191
|
+
wcstombs_s,
|
|
192
|
+
|
|
193
|
+
// Types
|
|
194
|
+
div_t,
|
|
195
|
+
ldiv_t,
|
|
196
|
+
lldiv_t,
|
|
197
|
+
wchar_t,
|
|
198
|
+
|
|
199
|
+
// Constants
|
|
200
|
+
EXIT_SUCCESS,
|
|
201
|
+
EXIT_FAILURE,
|
|
202
|
+
RAND_MAX,
|
|
203
|
+
MB_CUR_MAX
|
|
204
|
+
;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
c_include "<string.h>",
|
|
2
|
+
// Memory functions
|
|
3
|
+
memcpy :
|
|
4
|
+
fn(dest : *(void), src : *(void), n : usize) -> *(void),
|
|
5
|
+
memmove :
|
|
6
|
+
fn(dest : *(void), src : *(void), n : usize) -> *(void),
|
|
7
|
+
memset :
|
|
8
|
+
fn(s : *(void), c : int, n : usize) -> *(void),
|
|
9
|
+
memcmp :
|
|
10
|
+
fn(s1 : *(void), s2 : *(void), n : usize) -> int,
|
|
11
|
+
memchr :
|
|
12
|
+
fn(s : *(void), c : int, n : usize) -> ?*(void),
|
|
13
|
+
|
|
14
|
+
// String copying functions
|
|
15
|
+
strcpy :
|
|
16
|
+
fn(dest : *(char), src : *(char)) -> *(char),
|
|
17
|
+
strncpy :
|
|
18
|
+
fn(dest : *(char), src : *(char), n : usize) -> *(char),
|
|
19
|
+
|
|
20
|
+
// String concatenation functions
|
|
21
|
+
strcat :
|
|
22
|
+
fn(dest : *(char), src : *(char)) -> *(char),
|
|
23
|
+
strncat :
|
|
24
|
+
fn(dest : *(char), src : *(char), n : usize) -> *(char),
|
|
25
|
+
|
|
26
|
+
// String comparison functions
|
|
27
|
+
strcmp :
|
|
28
|
+
fn(s1 : *(char), s2 : *(char)) -> int,
|
|
29
|
+
strncmp :
|
|
30
|
+
fn(s1 : *(char), s2 : *(char), n : usize) -> int,
|
|
31
|
+
strcoll :
|
|
32
|
+
fn(s1 : *(char), s2 : *(char)) -> int,
|
|
33
|
+
strxfrm :
|
|
34
|
+
fn(dest : *(char), src : *(char), n : usize) -> usize,
|
|
35
|
+
|
|
36
|
+
// String searching functions
|
|
37
|
+
strchr :
|
|
38
|
+
fn(s : *(char), c : int) -> ?*(char),
|
|
39
|
+
strrchr :
|
|
40
|
+
fn(s : *(char), c : int) -> ?*(char),
|
|
41
|
+
strspn :
|
|
42
|
+
fn(s : *(char), accept : *(char)) -> usize,
|
|
43
|
+
strcspn :
|
|
44
|
+
fn(s : *(char), reject : *(char)) -> usize,
|
|
45
|
+
strpbrk :
|
|
46
|
+
fn(s : *(char), accept : *(char)) -> ?*(char),
|
|
47
|
+
strstr :
|
|
48
|
+
fn(haystack : *(char), needle : *(char)) -> ?*(char),
|
|
49
|
+
strtok :
|
|
50
|
+
fn(str : ?*(char), delim : *(char)) -> ?*(char),
|
|
51
|
+
|
|
52
|
+
// String utility functions
|
|
53
|
+
strlen :
|
|
54
|
+
fn(s : *(char)) -> usize,
|
|
55
|
+
strerror :
|
|
56
|
+
fn(errnum : int) -> *(char),
|
|
57
|
+
|
|
58
|
+
// C11 Annex K - Bounds-checking interfaces (optional)
|
|
59
|
+
// These are safer versions of string functions
|
|
60
|
+
strcpy_s :
|
|
61
|
+
fn(dest : *(char), destsz : usize, src : *(char)) -> int,
|
|
62
|
+
strncpy_s :
|
|
63
|
+
fn(dest : *(char), destsz : usize, src : *(char), count : usize) -> int,
|
|
64
|
+
strcat_s :
|
|
65
|
+
fn(dest : *(char), destsz : usize, src : *(char)) -> int,
|
|
66
|
+
strncat_s :
|
|
67
|
+
fn(dest : *(char), destsz : usize, src : *(char), count : usize) -> int,
|
|
68
|
+
|
|
69
|
+
// C11 Annex K - Memory functions
|
|
70
|
+
memcpy_s :
|
|
71
|
+
fn(dest : *(void), destsz : usize, src : *(void), count : usize) -> int,
|
|
72
|
+
memmove_s :
|
|
73
|
+
fn(dest : *(void), destsz : usize, src : *(void), count : usize) -> int,
|
|
74
|
+
memset_s :
|
|
75
|
+
fn(s : *(void), smax : usize, c : int, n : usize) -> int,
|
|
76
|
+
|
|
77
|
+
// C11 - Additional string functions
|
|
78
|
+
strnlen_s :
|
|
79
|
+
fn(s : *(char), maxlen : usize) -> usize,
|
|
80
|
+
strerror_s :
|
|
81
|
+
fn(s : *(char), maxsize : usize, errnum : int) -> int,
|
|
82
|
+
strtok_s :
|
|
83
|
+
fn(str : ?*(char), delim : *(char), ptr : *(?*(char))) -> ?*(char),
|
|
84
|
+
|
|
85
|
+
// C11 - Duplicate string (POSIX, but commonly available)
|
|
86
|
+
strdup :
|
|
87
|
+
fn(s : *(char)) -> ?*(char),
|
|
88
|
+
strndup :
|
|
89
|
+
fn(s : *(char), n : usize) -> ?*(char),
|
|
90
|
+
|
|
91
|
+
// Case-insensitive comparison (POSIX, but commonly available)
|
|
92
|
+
strcasecmp :
|
|
93
|
+
fn(s1 : *(char), s2 : *(char)) -> int,
|
|
94
|
+
strncasecmp :
|
|
95
|
+
fn(s1 : *(char), s2 : *(char), n : usize) -> int
|
|
96
|
+
;
|
|
97
|
+
|
|
98
|
+
// Export all string functionality
|
|
99
|
+
export
|
|
100
|
+
// Memory functions
|
|
101
|
+
memcpy,
|
|
102
|
+
memmove,
|
|
103
|
+
memset,
|
|
104
|
+
memcmp,
|
|
105
|
+
memchr,
|
|
106
|
+
|
|
107
|
+
// String copying
|
|
108
|
+
strcpy,
|
|
109
|
+
strncpy,
|
|
110
|
+
|
|
111
|
+
// String concatenation
|
|
112
|
+
strcat,
|
|
113
|
+
strncat,
|
|
114
|
+
|
|
115
|
+
// String comparison
|
|
116
|
+
strcmp,
|
|
117
|
+
strncmp,
|
|
118
|
+
strcoll,
|
|
119
|
+
strxfrm,
|
|
120
|
+
|
|
121
|
+
// String searching
|
|
122
|
+
strchr,
|
|
123
|
+
strrchr,
|
|
124
|
+
strspn,
|
|
125
|
+
strcspn,
|
|
126
|
+
strpbrk,
|
|
127
|
+
strstr,
|
|
128
|
+
strtok,
|
|
129
|
+
|
|
130
|
+
// String utilities
|
|
131
|
+
strlen,
|
|
132
|
+
strerror,
|
|
133
|
+
|
|
134
|
+
// C11 Annex K - Safe functions
|
|
135
|
+
strcpy_s,
|
|
136
|
+
strncpy_s,
|
|
137
|
+
strcat_s,
|
|
138
|
+
strncat_s,
|
|
139
|
+
memcpy_s,
|
|
140
|
+
memmove_s,
|
|
141
|
+
memset_s,
|
|
142
|
+
strnlen_s,
|
|
143
|
+
strerror_s,
|
|
144
|
+
strtok_s,
|
|
145
|
+
|
|
146
|
+
// Additional useful functions
|
|
147
|
+
strdup,
|
|
148
|
+
strndup,
|
|
149
|
+
strcasecmp,
|
|
150
|
+
strncasecmp
|
|
151
|
+
;
|
package/std/libc/time.yo
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// C11 time.h - Date and time functions
|
|
2
|
+
// Provides time manipulation, formatting, and calendar functions
|
|
3
|
+
c_include "<time.h>",
|
|
4
|
+
// Types
|
|
5
|
+
time_t : Type,
|
|
6
|
+
clock_t : Type,
|
|
7
|
+
|
|
8
|
+
// Structure for broken-down time
|
|
9
|
+
tm : Type,
|
|
10
|
+
|
|
11
|
+
// C11 timespec structure
|
|
12
|
+
timespec : Type,
|
|
13
|
+
|
|
14
|
+
// Time manipulation functions
|
|
15
|
+
clock :
|
|
16
|
+
fn() -> clock_t,
|
|
17
|
+
time :
|
|
18
|
+
fn(timer : ?*(time_t)) -> time_t,
|
|
19
|
+
difftime :
|
|
20
|
+
fn(time1 : time_t, time0 : time_t) -> f64,
|
|
21
|
+
mktime :
|
|
22
|
+
fn(timeptr : *(tm)) -> time_t,
|
|
23
|
+
|
|
24
|
+
// Time conversion functions
|
|
25
|
+
asctime :
|
|
26
|
+
fn(timeptr : *(tm)) -> *(char),
|
|
27
|
+
ctime :
|
|
28
|
+
fn(timer : *(time_t)) -> *(char),
|
|
29
|
+
gmtime :
|
|
30
|
+
fn(timer : *(time_t)) -> ?*(tm),
|
|
31
|
+
localtime :
|
|
32
|
+
fn(timer : *(time_t)) -> ?*(tm),
|
|
33
|
+
strftime :
|
|
34
|
+
fn(s : *(char), maxsize : usize, format : *(char), timeptr : *(tm)) -> usize,
|
|
35
|
+
|
|
36
|
+
// C11 Annex K - Safe time functions
|
|
37
|
+
asctime_s :
|
|
38
|
+
fn(s : *(char), maxsize : usize, timeptr : *(tm)) -> int,
|
|
39
|
+
ctime_s :
|
|
40
|
+
fn(s : *(char), maxsize : usize, timer : *(time_t)) -> int,
|
|
41
|
+
gmtime_s :
|
|
42
|
+
fn(timer : *(time_t), result : *(tm)) -> ?*(tm),
|
|
43
|
+
localtime_s :
|
|
44
|
+
fn(timer : *(time_t), result : *(tm)) -> ?*(tm),
|
|
45
|
+
|
|
46
|
+
// C11 - Additional time functions
|
|
47
|
+
timespec_get :
|
|
48
|
+
fn(ts : *(timespec), base : int) -> int,
|
|
49
|
+
|
|
50
|
+
// Constants
|
|
51
|
+
CLOCKS_PER_SEC : clock_t,
|
|
52
|
+
|
|
53
|
+
// C11 timespec_get base values
|
|
54
|
+
TIME_UTC : int,
|
|
55
|
+
|
|
56
|
+
// Additional useful constants (implementation-defined)
|
|
57
|
+
CLK_TCK : clock_t
|
|
58
|
+
;
|
|
59
|
+
|
|
60
|
+
// Export all time functionality
|
|
61
|
+
export
|
|
62
|
+
// Types
|
|
63
|
+
time_t,
|
|
64
|
+
clock_t,
|
|
65
|
+
tm,
|
|
66
|
+
timespec,
|
|
67
|
+
|
|
68
|
+
// Time manipulation
|
|
69
|
+
clock,
|
|
70
|
+
time,
|
|
71
|
+
difftime,
|
|
72
|
+
mktime,
|
|
73
|
+
|
|
74
|
+
// Time conversion
|
|
75
|
+
asctime,
|
|
76
|
+
ctime,
|
|
77
|
+
gmtime,
|
|
78
|
+
localtime,
|
|
79
|
+
strftime,
|
|
80
|
+
|
|
81
|
+
// C11 safe functions
|
|
82
|
+
asctime_s,
|
|
83
|
+
ctime_s,
|
|
84
|
+
gmtime_s,
|
|
85
|
+
localtime_s,
|
|
86
|
+
timespec_get,
|
|
87
|
+
|
|
88
|
+
// Constants
|
|
89
|
+
CLOCKS_PER_SEC,
|
|
90
|
+
TIME_UTC,
|
|
91
|
+
CLK_TCK
|
|
92
|
+
;
|