Remove split-target unit_call forms.

This commit is contained in:
root committed 2026-09-30 14:38:17 +00:00
1 parent 6e2636cc8f
commit 63b52f54a1
313 files changed
+590 -1087

No files matched your search

+62 -62
View File
@@ -15,45 +15,45 @@ bbb5f7d101a0bb2f559217cf07b3529c393f388ded23ebfaee3ea3ba3b2cf188 site_tests_cap
3b10352a32cd427aa56cb9ed5995ead6424cb127e31f97ae796378bd16be1f97 site_tests_capy-backtrace.capy.wasm
1f0501ffdadf152107276aa526e5709bf5fda28a2ef9c21ec10f03cbb0cda43f site_tests_capy-backtrace.capy.wasm.source-map
0fe2fcee9f7fe3114abedd9206c371404c5a656527bacbcf4c82b24397e95a68 site_tests_capy-bits.capy.wasm
9c3929cf1ce7f38d1428aff59d17f69ed63dcb8f30b828995c9537372c6db8af site_tests_capy-bits.capy.wasm.source-map
25e94da32848266117a8da8721636dc05acbf77c1e405550ea1329c56c90c089 site_tests_capy-bits.capy.wasm.source-map
37e06627cec34640390fd0e1776cf885a6cc538f5fbe6c3f224e0c372bdb15ce site_tests_capy-byte-conversion.capy.wasm
937433d0d75a64cac721e3d240930dca9fb4c96badc71cdc13c9deb0c8bd1215 site_tests_capy-byte-conversion.capy.wasm.source-map
5c1c359cf0b17be021b07772dd6dacb033e3ef01c5100d0699f16b87a35f32fe site_tests_capy-closures.capy.wasm
481e83ae7a2fcffc710f048fe32db20d8a3bfa6062838d1337a685e7218c7d0e site_tests_capy-closures.capy.wasm.source-map
4e23afaf9c91724792b45c5c79f304f42de8059715d0789c1fd19e4346fcf916 site_tests_capy-codecs.capy.wasm
1c9a36022de1f1e9597d3d12b5220816d7b8f45b7d9c8885f35e427baac38a7f site_tests_capy-codecs.capy.wasm.source-map
7efbbdd75629be155227a9bb9efd795cdeb2dea957326b2d1c1b4154ce5970bd site_tests_capy-codecs.capy.wasm.source-map
2e82b3359cd021982132589c000e60ec8ed9062a2ea16d0630cf4d998673d732 site_tests_capy-codecs-text.capy.wasm
1ae2eef4d58f90257434f9ee9bbbaf51b1bd39aaa3be7aefb2b2b1ca5a990d97 site_tests_capy-codecs-text.capy.wasm.source-map
2ca0d6eb9f12af31eea0b41cb507f27b6957e17f72dba22800c6cebde0dfebd1 site_tests_capy-codecs-text.capy.wasm.source-map
2108f3a5250deb72162059deab8c71c9763a436231ef321726319642f37cd931 site_tests_capy-codecs-text-trap.capy.wasm
3b33e4ba4e21765e592b807469e6528b0e252428bf31f0377b4bc447ac72b227 site_tests_capy-codecs-text-trap.capy.wasm.source-map
9de812e585aa0664585565d8614a27bd7805e0022652bca7b8209284513c2cee site_tests_capy-coercion.capy.wasm
5e405cbc3482a9c9968dc68e2a6b418db33fe3840cd27645fb40e659dcb897d2 site_tests_capy-coercion.capy.wasm.source-map
059264aea7ca5a2a8bfdd2ea40a606d6c7c5e9a958e2ee8b07cd28ed7364ad34 site_tests_capy-component-parity.capy.wasm
35b9d8cc28cdb7fb939452f62c803de6e1d5be831198783b9c06d7142f43a1e0 site_tests_capy-component-parity.capy.wasm.source-map
10e938a8132b25d9fee1632c69e59691cf5a960fc16cf0c3dba2a782a33b8dc3 site_tests_capy-coercion.capy.wasm.source-map
e83333f5b69c39ffa6640f7a436072dc6bce103e3da1365e00aed130b2e7ee53 site_tests_capy-component-parity.capy.wasm
cfe2a03b9595b9740bae2e50bd2eb7a1f9e0ce9827be30403acd831e4c450374 site_tests_capy-component-parity.capy.wasm.source-map
986895855cf9d36f648a9ca86e78d3d73a13e9d2c1858e69dab339e586658665 site_tests_capy-component-props.capy.wasm
ecb03a5893cad44ad0ce1d4f8a8dbbb036078e0635102785a54ec7d48dac53aa site_tests_capy-component-props.capy.wasm.source-map
9784259384f719f8527239bcb116fb0fd8eacabd1d2f8e559d19003b94d61481 site_tests_capy-component-props.capy.wasm.source-map
a0daa7b955181061d5daa384db9e233d40b2e953fc29497fd9d3c50b99b078c1 site_tests_capy-component-render-result.capy.wasm
2dc4063cec693d43e4065a08454e28795330e8f294483b239fc2f4a1fa6e6024 site_tests_capy-component-render-result.capy.wasm.source-map
f7f2205524602efa3bf3532cfc16d09934431888e8c18c69de14849555dac966 site_tests_capy-component-render-result.capy.wasm.source-map
60891f9f95ec0417ae086bbe25516aa686cb154489bab7f28a632bce0284f664 site_tests_capy-condition-coercion.capy.wasm
d22d13630b9ef3bb005dd1afffffc92a34b606fce3f1d86dd596707e26702b44 site_tests_capy-condition-coercion.capy.wasm.source-map
66339463a01adab28b18aed249b8ed13ac18f8eb6e77728ed5b260f11523fc26 site_tests_capy-constructors.capy.wasm
85d3d340532d4b4536cc75c6fa7ac08265236be516eb53f07940916a4b1b2a1b site_tests_capy-constructors.capy.wasm.source-map
81ea0b435c71a8a96cc65bb2fd12c7891cb677e8210db492040750d653bcb7a7 site_tests_capy-constructors.capy.wasm.source-map
ce004e6f1e8b33921c6b95fcde872524235d15fe4c8f2023b13719401fef3d87 site_tests_capy-coreutil.capy.wasm
7b6f2f7c09ab7693ce2e8e993a39019935f98214307c700d1474580cfb420abc site_tests_capy-coreutil.capy.wasm.source-map
f5cd37e6d799f256885afa503e7fcdebb5a6219244bd881b52f4dd3d443bb362 site_tests_capy-coreutil.capy.wasm.source-map
67fddd40f484084fdf236d8d683d4bf85951e498f8abbd1467e0eec587c734ef site_tests_capy-coreutil-trap.capy.wasm
3661ad1351adc47521da290b3bad995c93d85717fadc61ee2296bb732a351c5f site_tests_capy-coreutil-trap.capy.wasm.source-map
f0ff2e1869f3ca4747a3d6eac4fba72ded9cc1d1434569f4858cb9ba3c821858 site_tests_capy-cross-caller.capy.wasm
40c9c68058bee19d0513ff37ef24d2d9795083e34ff2a4f167b221782a8afb5c site_tests_capy-cross-caller.capy.wasm.source-map
0f06dbd9debe554d39825826c9bc4923ee728fad9a54afb35d4210032be64112 site_tests_capy-cross.capy.wasm
10ed656c4908f6c06f78cf4b7a6488ce5e1681d0618a3a99576d27df8413241b site_tests_capy-cross.capy.wasm.source-map
90b0bf4aed297dd9fd7ca032eccc4cc0c96730b4b64f78e7455348ca0d528a5a site_tests_capy-cross-caller.capy.wasm.source-map
3d803cf2611e513064b1c89cb04f806cfa28050993a75c77eee70fc03403dfc2 site_tests_capy-cross.capy.wasm
359ce12f3618443afd0aa88272ddc0b6fccb60846edd65475c6c52045bbd2177 site_tests_capy-cross.capy.wasm.source-map
6e112cf4a6a583b1af1793f086d2cebf7f5adf2c8ce76753f571c489bd3f83da site_tests_capy-cross-target.capy.wasm
01e5f9ea52b5c6ac386fc59ea6420b8b92b68a00cec6494b39971b7775cbc66a site_tests_capy-cross-target.capy.wasm.source-map
b381c7571a333c502a40c1b8acb173741464a8b51a46c6bdc8d7ec0c18b1cfec site_tests_capy-crypto-random.capy.wasm
04a200481b5b4a6c9cb88b12c102a3ab13560657d7e7b5a692257f16a8cd6e3d site_tests_capy-crypto-random.capy.wasm.source-map
c27ee2cc118a4a465e124ab8ec23609e74d10f714c953d3eb2aca149dfd27882 site_tests_capy-crypto-random.capy.wasm.source-map
004716097feb4993d5d37123c17261ace049e4d1645c9f703b5891eeb92bfad1 site_tests_capy-csrf.capy.wasm
6311b4169f0d857eaafee8deb8c43c928cd9a9852746f4c514e611eb0aee16ee site_tests_capy-csrf.capy.wasm.source-map
65318a7ade17311fe9a3dc355463cbd5027a68860e94c8392ecb72fec40d5a5e site_tests_capy-dval-api.capy.wasm
f84778b33df83d69203179c7d202d5c508c34b1750f1fe59c05b24ceae648edc site_tests_capy-dval-api.capy.wasm.source-map
1b5738a92cc4ef92cb1f74f72b6d48aeadf280aaf6193a773d25f8dfbb90885e site_tests_capy-dval-api.capy.wasm.source-map
f8d84225f7c6ba177f14a724739fb6d8180208e67e2c6e4974e9855309d80c36 site_tests_capy-dval-assign-list-trap.capy.wasm
feee368d9db90f4ade3bdb999ba93a801ea7d179bd97763993c085299f6d299a site_tests_capy-dval-assign-list-trap.capy.wasm.source-map
5ebe7b087986f08ab87f98c64d5e69b6ebf6986c80f7e768f25b17c2c4373253 site_tests_capy-dval-callable.capy.wasm
@@ -61,49 +61,49 @@ feee368d9db90f4ade3bdb999ba93a801ea7d179bd97763993c085299f6d299a site_tests_cap
f8dc96941cc8c60176b99fc5b8d5b27c43066f7010f0e58471febf7fa20b2408 site_tests_capy-dval-callable-signature-trap.capy.wasm
8749f19cced02570ee4cefdcbb0997bf36491c9a4626d1c0b05989c8c1506246 site_tests_capy-dval-callable-signature-trap.capy.wasm.source-map
0a2d46342f8b06e5520a6b8ebc9152d21d24bd29c1541f70c61b908705013380 site_tests_capy-dval-f64-trap.capy.wasm
dd53cb200079df544e89d4c9c62ba827b7a398eb1dea591c5e190f6a4b22a274 site_tests_capy-dval-f64-trap.capy.wasm.source-map
9efea8197c0b5bd189de90dfaf8c48ca25df9ea9cdc0ee48c1009311baa6c48b site_tests_capy-dval-f64-trap.capy.wasm.source-map
410209995e96f863ee301a1d2678fa2e71d0859d46795bc396e22e424c3aa45f site_tests_capy-dval-identity.capy.wasm
3429a5ae93dad3186007899a2437809d4c49f884fa5881f95a3892fcce876387 site_tests_capy-dval-identity.capy.wasm.source-map
478964cd415bcf78eb90b75ca65fc1a80d43ab962c28e10922aa50d511fe42a3 site_tests_capy-dval-identity.capy.wasm.source-map
abde3549ca47cd7e58cc4c86f74e8dbebbdd0c53fb0efd7bcd620b6ea7fddd42 site_tests_capy-dval-merge.capy.wasm
f2a554695fe36d1759f9591ba55f40215f08c7c7449988b6102b9ae9f060abb9 site_tests_capy-dval-merge.capy.wasm.source-map
f475ae1910f30e8de339e065db4f90d3cfffcaa200326be26bb6dcf90556cc2f site_tests_capy-dval-merge.capy.wasm.source-map
fb612d452dee52d20068b574c265bc239f77e89cffb4dc9ccfbc2e25caf69337 site_tests_capy-dval-none.capy.wasm
03a0f66b185952e2e570cfda3057e75e3e83ed427f91b7a4bf28a54378bc840c site_tests_capy-dval-none.capy.wasm.source-map
2b8a32c691ba6562503ec172def99956964688c422ad11abd08c100f32fde57f site_tests_capy-dval-none.capy.wasm.source-map
f9751f55c368ba53d49bb77bfe6471602f29057376cec3485e9df37401398100 site_tests_capy-dval-return.capy.wasm
f5e02ea9df68caf79a1b2a35d728c44d74b80c8415fae771d3dd4e904c970bb5 site_tests_capy-dval-return.capy.wasm.source-map
d93e8f2053b04caed0294881108670498a27028bcf2b04d6c8b702a146c1bd0b site_tests_capy-dval-rich-caller.capy.wasm
38ef1124b976c10f57248bed4f2a7b4fecca227636e20a5fdee7fb85bffade39 site_tests_capy-dval-rich-caller.capy.wasm.source-map
f215197a2d9872182e9a6369f21de7e8633e66c2d6dc2c6bd3bdf8d1cfe65c46 site_tests_capy-dval-rich.capy.wasm
5f190d92d531e298d2b861f78918eceb6882fe3d583ff3e3e531797b8e86d4d0 site_tests_capy-dval-rich.capy.wasm.source-map
42bf8eec00913695c3e032d458414723067ec8153185885730f88b5c7fd064e4 site_tests_capy-dval-rich-caller.capy.wasm
3c5e54ee495d4052205ac47de5c082196b3b9cff19fd2859c3351d3044bb5a18 site_tests_capy-dval-rich-caller.capy.wasm.source-map
590a008aa85dddbed395095b3b292fc460c775acca809410fee167f23dc15eb5 site_tests_capy-dval-rich.capy.wasm
013e528149ffeb9dd1ef78e161dcc76dc031355a6ea30159599d6f564aa30756 site_tests_capy-dval-rich.capy.wasm.source-map
c9108e42252904d030d23c65281745270e03d33474bea1e42c760ec6a3d91320 site_tests_capy-f64-format-bench.capy.wasm
5b83260d448ce682e1b3a529efb8dcf5775e9418872fb9b10c06fd65c884e595 site_tests_capy-f64-format-bench.capy.wasm.source-map
b27df66344ccdc47a70f9dbd8c3484eace651588243c4a169f827e97a39b8a7d site_tests_capy-f64-format-bench.capy.wasm.source-map
b8677acde91eba314c2539668f1a793610669e9513eb994ae4519bb76748251a site_tests_capy-files2.capy.wasm
51345a606a9aaac575d160161f4bbb028abb6b8a80b892b61808d241cdf94886 site_tests_capy-files2.capy.wasm.source-map
710d2312068f82632cf82752d8677705e4c266b69e6ea2998802dc2e6d5c13f1 site_tests_capy-files2.capy.wasm.source-map
163e310050a1a29e9dc8eb542d57ae4bec064f7823e6acaf5a12ef0b5dba2a7a site_tests_capy-files.capy.wasm
bdea67f857674db5535fd4f9a2eec26be5fc0b4fe9abb83a1a57749c3ba24f45 site_tests_capy-files.capy.wasm.source-map
5929c55552297440f4036edbaebc83f95942f6c770775436860a49ae2d6639bf site_tests_capy-files.capy.wasm.source-map
e51d2696251d7a42dcd5b2da2e465bc6d761af458ad6158de892dd810fdd1f46 site_tests_capy-final-parity.capy.wasm
f2766018df107996e4ccfd4c302339c07a23f4969bcf5db83a95d29c3eb45afe site_tests_capy-final-parity.capy.wasm.source-map
5abda8690ca98c9b7b5a411fc18e53c49cc42dd517892a63f2023bf48e425f33 site_tests_capy-final-parity.capy.wasm.source-map
0ef69f3f878036e1de7fa7b28782b792ee63787e8149bee037bf302dbfbf6bae site_tests_capy-first-empty.capy.wasm
a4294d138e7371cb6c2185af5b1a29cf75bfeb4420900559368e75e708bbdeb9 site_tests_capy-first-empty.capy.wasm.source-map
0f6119616c8d8d63427b9e01e98c5bf409c7ade7fda381f757f510e883550faa site_tests_capy-flush-output.capy.wasm
84febd2c1954c1d46070e068d895e5c966ef4acc1f9be972674a93d4d27f6e90 site_tests_capy-flush-output.capy.wasm.source-map
f84da87b601378108d83b61351a46fbaaa625c3d8980b8cdadfe4b58795b35d9 site_tests_capy-flush-output.capy.wasm.source-map
9ff70ec47814f6108442a5c718eb8a7248a38577fa6540a82621f4ad61be8062 site_tests_capy-format-bench.capy.wasm
db23532c5e52998e1a885637a8b2f4c12a0eea2b4bcdbe88db774115f6e4de21 site_tests_capy-format-bench.capy.wasm.source-map
b4631520b92c353d0d113c9491b971a5bd054095506ed782c2de0c2129ab93eb site_tests_capy-format-bench.capy.wasm.source-map
35c489d08c17896e356ebf2b60141f32af0e248d7afeec47b22097560ae9502d site_tests_capy-format.capy.wasm
fdf661360a371a7f85fd3dae7c1fb215764e5caed5c0dc81b217b33c6fb3ab46 site_tests_capy-format.capy.wasm.source-map
c6dbe2422076bcff1fdccf4ddbc8d38f72923ae29bd85372c1a14a53bf17aebd site_tests_capy-format.capy.wasm.source-map
89f5f18da6a8226b25e515d1a754e6b0dd603a97b2a7960f4feded54760906a7 site_tests_capy-jobs.capy.wasm
107819eda0507e7dad16d48d0b374df8b01787f00417812554ebf122ab5393e9 site_tests_capy-jobs.capy.wasm.source-map
7c18650e4a95f399927f7cc02f0196c3ffd1cf2452823d88ef23d0a4fa91aa27 site_tests_capy-jobs.capy.wasm.source-map
cd29672ba9d0dfbdf9c7d0f2b6e696b46bbd7e7968c8843763f7820bad824a39 site_tests_capy-language.capy.wasm
9758ff644a96af8f67aeb8d20a7ab746e05fb3a22c43f4c5bb2ed0f8c42bfb56 site_tests_capy-language.capy.wasm.source-map
f9154bc8147be3ba13568d8c3d1097ca96c1f74ce8692a02d04edf976bada0e7 site_tests_capy-language-consistency.capy.wasm
1b964a4b95888e19bc289454af14162270795a9d4f02e67ca0bb04b793ac7404 site_tests_capy-language-consistency.capy.wasm.source-map
ad0612191eab09dc8d6998cea710c9fcc6177efa15804e3942e16212e65741ea site_tests_capy-language-consistency.capy.wasm.source-map
71732fb2bdc8e2f98c000d9fa7b9439e5d11c6da854e2f1beb60b63f28d1eaab site_tests_capy-lifecycle-child.capy.wasm
94ca853263a53c620b07e75dc041f25c090ffc3bc3206f2dca86adceabc5a529 site_tests_capy-lifecycle-child.capy.wasm.source-map
3bfcc2dd2c228b6ae51bc0fbd64b661b25a902bae90ebac82142b891171a7159 site_tests_capy-lifecycle-parity.capy.wasm
3ce4c8c1172e8ed86c99c33c0f89bfa9b60fdfb49e28f773b6028b0860f02c33 site_tests_capy-lifecycle-parity.capy.wasm.source-map
95bcb5b051e2ca2b146cf7ecf885e4a4737d63e34c71d69ce8c1aa75c2678ee5 site_tests_capy-lifecycle-parity.capy.wasm.source-map
57a841d4e033a2d99ed7d7afee75ce638e65bad6cc069aa3acce0a9f6598c31e site_tests_capy-loop-control.capy.wasm
16b5e693e2f592fab852b6545caba857b6cad8647cc43e654bac711d3c4b8565 site_tests_capy-loop-control.capy.wasm.source-map
b0b6e25a839c1d2e116f602076654de3455faaff33d12afbd40f342fcd37605d site_tests_capy-managed-parameter-rebind.capy.wasm
1aca84fae9f89d09d8b214daaf23b94061a977458f1315824f3c789f86c2d2a7 site_tests_capy-managed-parameter-rebind.capy.wasm.source-map
112ceac8b807edc99bf7d42208d889250c1c643773f493bee63643df58b460ce site_tests_capy-managed-parameter-rebind.capy.wasm.source-map
2fb080026c303237a02b94c5480453b565aa10d6f9534b231f8f26d0d5b32e74 site_tests_capy-map-arc.capy.wasm
67ba3e3a7c3342b5a034a3d4ca744482048c66092d2fd1b31189022243257f1e site_tests_capy-map-arc.capy.wasm.source-map
00ed9b18c14f133bd9d45ae3202e39f38bd58bea56288b1c6d55167821ccfa0c site_tests_capy-markup.capy.wasm
@@ -111,25 +111,25 @@ b0b6e25a839c1d2e116f602076654de3455faaff33d12afbd40f342fcd37605d site_tests_cap
c6bf86a69e2b8649da76233398e90a374e36b12a38e6607b7eb832a6bf24bd41 site_tests_capy-markup-context.capy.wasm
780d29079b3cb5e10e621332d9f26fa9ee6c0ff78542b3c560471c120f9f9e30 site_tests_capy-markup-context.capy.wasm.source-map
cebc7f8c557eb5f9403ce0181815dc33cd69391cf1fb9ca0dd36e8ba6d36dae1 site_tests_capy-math.capy.wasm
54ab465a235517f6e8c7efd674d81ec29a7dd4b62f8a465615237c9bc6f5bd02 site_tests_capy-math.capy.wasm.source-map
94d35ed0cc8cd941d05fe016ad52a150289fd07abe2ae8c210a74063d618e8cf site_tests_capy-math.capy.wasm.source-map
b53131a984a4740fbebf88982e5a8842009f95e88ea4311f427e0ef7c54e3846 site_tests_capy-memcache.capy.wasm
f707371dc73829fec705df7767889c56e95ad9d15e12bbdc08f471bd333cf41f site_tests_capy-memcache.capy.wasm.source-map
db900ef167ed23916a56f2e408e92c0fce4c697a2fca4aa4d4c3180f0b49c764 site_tests_capy-memcache.capy.wasm.source-map
86ca85c16579a7ff3b46aead235d068921723692e01afd2736a8f6f7263c31b8 site_tests_capy-methods.capy.wasm
64a8e6b4637cc6fc5e4584ac2ae4920a87bd2b86b0217a3de374959d15250f32 site_tests_capy-methods.capy.wasm.source-map
3a332e3ccea11c910b476774561551ab09c21c67d76e53c3917d2e15a4cca2c2 site_tests_capy-module-caller.capy.wasm
70232042447d05b25d89948a205c1994504a088fa0826bc088d7acc56227ee2e site_tests_capy-module-caller.capy.wasm.source-map
1b9dceb94ead6b89b7fac7629c1df3da4cb3989c07f6eb4bee7439d8c43acbdf site_tests_capy-methods.capy.wasm.source-map
3d37b6d4ef5e8d578e19d19b75ad3f18b3a74d0e78a02807dd4e93c3c6950fb5 site_tests_capy-module-caller.capy.wasm
a451cbf2c0d2d08aa32f2317e89bdddedcda98cc20f0b1538c0f63ca68681548 site_tests_capy-module-caller.capy.wasm.source-map
23855c9b2e49c49f8e5ffcf313835f6d223ad9111b9221a36ea8884ec833f2af site_tests_capy-module-target.capy.wasm
08e1c7d22d423a280ea466bf5e3bb0e8feb8ce5b4989f77f32cdef670218cece site_tests_capy-module-target.capy.wasm.source-map
a3f0c003b95d9ca95e2fc3bda682f0ee11ed61834a7fd525271144704c310488 site_tests_capy-mutable-array-struct.capy.wasm
e79be635152eab9e2451694b77c0070e90868cbe937ab16c8b74c3136f16ad5b site_tests_capy-mutable-array-struct.capy.wasm.source-map
c27e4cc66815f8b78829cb5fefb5f90e5639206484982fbde40ca9b8a193d5fa site_tests_capy-mutable-array-struct.capy.wasm.source-map
89af8533bb0405a94e122c11eecc9efba680393d7f41ee5e78a88696226eb9fa site_tests_capy-mysql.capy.wasm
873b57dc11396dea632e628414c91bcd5bee1e5610cd66575f1a64c0b753ff24 site_tests_capy-mysql.capy.wasm.source-map
b50d9c75874bcbb3e36b6ab89358123ff5d7ab9f61e2427069350499f838a92d site_tests_capy-mysql.capy.wasm.source-map
67aafc03a22f38b802cdccb13cdfaed01f57d7b3a3e86a0393ba8ca3ff056ad6 site_tests_capy-mysql-info-trap.capy.wasm
0ff3009fb9a33cbc201a0597897f0782baa220b439d284052efd51f4b09563dd site_tests_capy-mysql-info-trap.capy.wasm.source-map
7698c3f58c895c7c52c5444dd0f02f585906b54f92a21e53ac94740261a1fa42 site_tests_capy-network-parity.capy.wasm
99e260c6050487c663e7c1ae37a6fb23f3fcb3a5e76e7938a36ff2f37d0651ae site_tests_capy-network-parity.capy.wasm.source-map
b80b5fad90c540c3c69f659a0564ff7190c4a053887eb6d38412f21b0aba2b88 site_tests_capy-network-parity.capy.wasm.source-map
42d1f0d0d91af47b1b58758c05ce1506c4688f25a448e5ce231a1d78c9f34622 site_tests_capy-numeric-grid.capy.wasm
86404870cd45468933b711a0a35806e522e8de35a71702229214b4afbd378702 site_tests_capy-numeric-grid.capy.wasm.source-map
ca097a9e03afb4f3a8ae079772bb084c2cf31045c7d9a1886c953cbab903e90b site_tests_capy-numeric-grid.capy.wasm.source-map
b04e6c27992c3afb01312886a9f43b4214112bac1eca742b002cfa675a22733d site_tests_capy-operators.capy.wasm
58fea4fe01108badda8f7675279d96f672971ad126fb51d50360f002a672171c site_tests_capy-operators.capy.wasm.source-map
679c53c680d57c1df8a6f987182615b4a5703315800868e7c9f3002dfd98abc8 site_tests_capy-phase1.capy.wasm
@@ -143,21 +143,21 @@ ab23d2a2317cd71024a5ce67c55f0a71847497ba48d214b901cea01c62d50757 site_tests_cap
f348153afb98230380a4c643dda925ad28a09dff202508c39a32312f5177f65f site_tests_capy-reflection.capy.wasm
fc3a57bb5ed671d3048389c471010e0e3cec594b655d3e0a1f4a30da5f9ea21c site_tests_capy-reflection.capy.wasm.source-map
b6a3f7409f75c8cd9c0b5159fabc1693c78fbf0ede96278b6975ff27bf80d3b2 site_tests_capy-regex.capy.wasm
d11cf7a0cc4ec459c494f67f5b5bc4055ffbd75ddfa720f57b906111e346a68a site_tests_capy-regex.capy.wasm.source-map
9970d2de2a5b00c995daf0cb278482b4730563667e15640add3707348d9a5243 site_tests_capy-regex.capy.wasm.source-map
bce788014d8365272c3738452633e6eb32a67574a4467ab4136805c96ed9c232 site_tests_capy-regex-flag-trap.capy.wasm
51d56794183f2f4018f8901fd5e37cffa42e22fa89f11560eaa23b20efb5b683 site_tests_capy-regex-flag-trap.capy.wasm.source-map
1761a853377a58fb1c48848c0b3de31da598bd2f5bb70f20733f1476157f27f3 site_tests_capy-regex-flag-trap.capy.wasm.source-map
dd22168f1991d4ead31bbfb9cd1c95e23234ba64a3b814ff410b2fb315a1b08d site_tests_capy-regex-replace-trap.capy.wasm
14da9211bfa16c25c6456946694be4c73583d64d2e515b47bbe19838eed8ce12 site_tests_capy-regex-replace-trap.capy.wasm.source-map
be5265d75b772de5e4e9a04f7a8f204448b1d01e7ace69e707d9405f31246563 site_tests_capy-regex-replace-trap.capy.wasm.source-map
163b01915002d4a6b6518dc4780c76d45d14375db53f2cdcff6d5e451b4c831f site_tests_capy-regex-trap.capy.wasm
4273cc026b4a65d8ee87d88d592de0fdf05d9967d038567a1693947b135ec5d5 site_tests_capy-regex-trap.capy.wasm.source-map
e3a21d5b33a3eda93cc62634e087f995e7469d6efbd0372eff4c48b0638e58d3 site_tests_capy-regex-trap.capy.wasm.source-map
3a87b905c914cd4782f80011b2048249e20a9e310239a2efaa3641f191fd0976 site_tests_capy-render.capy.wasm
57a864e0633ef772d40bca40bfd0028b098f30228679c0a5b0b31df39cd7ffc5 site_tests_capy-render.capy.wasm.source-map
42b94c9293b0171b18a2795fe90d2f36037f0a758e526633d1ec6f52891f15cb site_tests_capy-request-context-caller.capy.wasm
2588c6104c2f52269f8b8e786e9b1c7a1367c35cb39b9ac76c96d8672ae1a93e site_tests_capy-request-context-caller.capy.wasm.source-map
e0fafcb1e53361e858ee7e1438ed00d7e50817c97588c3847e2c1525723cb6c7 site_tests_capy-request-context-caller.capy.wasm.source-map
9b54512af85218870014ffcafcb866e7e212034cfaa3a4bf62ecb2bd6d52c776 site_tests_capy-request-context.capy.wasm
4dcf8af0062e9b9a8c9a848531dd450ffcf5e96e075dab4be12d13ca5d86cf22 site_tests_capy-request-context.capy.wasm.source-map
17d6abfe33bb96d14fbe73b86d0a61894c6175f7ede8d178ce6f985543bf1b88 site_tests_capy-request-parity.capy.wasm
52be7f13852a0772ce2ae495c207cf30b31caa0aed4dfe0c15b177718847a9f8 site_tests_capy-request-parity.capy.wasm.source-map
3b930617e3dfaf6c8a49017143cdb639445c471c02c7235a3f6e1bdd7b1811a9 site_tests_capy-request-parity.capy.wasm.source-map
58070ef368b60a64d183513d647804e13c5917ce2e139162bdfcac1787b78c40 site_tests_capy-request-writeback.capy.wasm
a40bf450d376780524051187f500202e1cde3a49d1b56a41d0c5780e62c803c9 site_tests_capy-request-writeback.capy.wasm.source-map
31ef777e8c6b456f6402a1e1da521ada5f0b64e4bf3a0269172cfe2a7c457f62 site_tests_capy-response-header-trap.capy.wasm
@@ -201,47 +201,47 @@ b996502ddc904c3212f67f292fd741ed473eede7d482add37c58e7b8750a17e1 site_tests_cap
1edfdf67f64904aa8c4dee22a5ed50a13af9458fc2b311d561578cd5e220cba9 site_tests_capy-string-concat-only.capy.wasm
cd9a1e1209d5a57f062213306193cdf37a1a8dd704d2bf7724ed8bc44fd6e95c site_tests_capy-string-concat-only.capy.wasm.source-map
f978792a5b126f061c582f46711aa8669f5b6ab2101a4051da374daf065822d5 site_tests_capy-string-hostpath-bench.capy.wasm
e2f7576c956f6595d9e0f03e07336e41f6e886c04e713a5166d63e0da5836fef site_tests_capy-string-hostpath-bench.capy.wasm.source-map
fa033e07c0445520c1c67ec5394d4fdcfcb853cc729549da466164b0aea380cd site_tests_capy-string-hostpath-bench.capy.wasm.source-map
00a42c7d8edcdf5dd6b3da30c64c33e21cac4fc820affaa9e634a84a228961d3 site_tests_capy-string-hostpath.capy.wasm
0323cecc0527b1693f09a3f5e73cdd2c295638bfb06dce44e7b9780324d43c8f site_tests_capy-string-hostpath.capy.wasm.source-map
0f4ece6831739472a3da13ad72fbb26b48e316460740dd58f510ddca636a2009 site_tests_capy-string-hostpath.capy.wasm.source-map
abb61960ef5d6db2ce2d963c21377bcc00c493471dc04baffacc6ef4138be7ec site_tests_capy-string-identity.capy.wasm
737b4afa3730524f3e85e999258fffa949a7106943d13a04b953fe851bfe51f9 site_tests_capy-string-identity.capy.wasm.source-map
2257d10a7db13706e46a195b7d8d12d481e182f2d45e565e2b704a8e2a888fde site_tests_capy-string-list-scalar-trap.capy.wasm
05bcbe5de0ced71012ef3bbee4213e8c08c63e8b50f4d50680cb1d40bf3b4102 site_tests_capy-string-list-scalar-trap.capy.wasm.source-map
e4164c68881dc8abad67e9150e116256cda56bacf132756c5e75526b6bafe416 site_tests_capy-string-lists.capy.wasm
85c41cf789b6134a976348b8c82cffdcb57063aad2f37bbdd3430d3b7eec0695 site_tests_capy-string-lists.capy.wasm.source-map
d76a9671609405c8d3a3021ba67bb0fa6797ef2773d88d690bd6b34ab13cb894 site_tests_capy-string-lists.capy.wasm.source-map
12209d6d75cd348ac04f9c697206411f61cb667c9283b942c2eda4a3ea3a41d2 site_tests_capy-string-list-trap.capy.wasm
83a59b866a4dce2cdfff711154b4acdf59d880a76c1f147f8fb30d7ece2ce5c2 site_tests_capy-string-list-trap.capy.wasm.source-map
18fc29583fa5635528091f5da30cc82408aeb44df9ea6d2379db94d92b64902a site_tests_capy-strings.capy.wasm
57290e5da35f1374d88eb368b73faffbe611025a386624d354d140613d207571 site_tests_capy-strings.capy.wasm.source-map
82e8eeeea631289c7b4a41228284fbe29d7f99fb905dd56edd3c9aa88b4e2234 site_tests_capy-task-concurrency.capy.wasm
c5eabf83453bf0534f03d4482ee019b0d8d974cc4314c4909d0c1b342cd8caca site_tests_capy-task-concurrency.capy.wasm.source-map
a2d8a57ceb8f240a9a1d542e71bea5d8d1fb17f107312d6479b77d5d91cc3d8f site_tests_capy-task-concurrency.capy.wasm.source-map
b6ea60d4508ce46a1efc0d5c51273b1b4547618d4538e0da2ea20072e629bf18 site_tests_capy-task-overflow.capy.wasm
33a62364ba28c763c2b8077e6dc90f4d932b6eeccfd01813a9535eadcd857ebc site_tests_capy-task-overflow.capy.wasm.source-map
daf0d75e92b3ba22c6a84aef0c2a0cfb2df6f76f48a40d743a58355dd9d73a45 site_tests_capy-task-runtime.capy.wasm
dd26df4597967f5cb770e2964feb44024683c776debda14810a73c4d3d4755d4 site_tests_capy-task-runtime.capy.wasm.source-map
05a73d334795e0fb926b281b0aa3c4e070105cb4d44790d26d5dbf9edc3200fb site_tests_capy-task-runtime.capy.wasm.source-map
7a8e4eebfb501e1fbca7c7e77125b5d8e04ce1364cb2e31f4c82072c8943d297 site_tests_capy-task-timeout.capy.wasm
90eb0c49ef0a34fc90964ec860db174a8edf3e1ffd091a6260160199461c2b43 site_tests_capy-task-timeout.capy.wasm.source-map
d84c945cd9393cd48004560dc1cb2fba61a5b25eb65781faa61a37a782b11068 site_tests_capy-time-parity.capy.wasm
1ff8ddbfbd465e038c185d99a97e84f53587d05752b7790257f49f62f00e18f2 site_tests_capy-time-parity.capy.wasm.source-map
d4b800cb6cd8c2e3e8819c329010c9784c957aa0a11e1b80f5431e9f64d85566 site_tests_capy-time-parity.capy.wasm.source-map
2f87b6bebb0d195948cda8a03694503a7d8eba6d3bc1741e776045859d3e4210 site_tests_capy-unit-admin.capy.wasm
aa008c62141df7f50227cd4c8956344360264cbb9ab1538a5810c22f3e9fa99a site_tests_capy-unit-admin.capy.wasm.source-map
e6649913d0ab735a87e1b4556ee59dc1c3b9fe9bfcccde698f19ee4c6d2dbd12 site_tests_capy-unit-reference.capy.wasm
9e7a6a75325cc0d44b4f9d21a5ab0dc64e0f51f5050919eda787b31322be9040 site_tests_capy-unit-reference.capy.wasm.source-map
16e7441bc65ba2bad4c3a89dab94ece9b70b496c6baa2b11137f4beb2051cbdc site_tests_capy-unit-admin.capy.wasm.source-map
f90ecdc7918d1a93e0f52a47a354f6bd3a222553715d281fe64b97168c895018 site_tests_capy-unit-reference.capy.wasm
30cd3cd83cdb4e490cf10b265cdcf283ad65290ea0cb7548d479d5a160999f2f site_tests_capy-unit-reference.capy.wasm.source-map
e70dfc0fe4d692a602996a7b746c97ab927cd53a8040061f63dc9fc4c158b42f site_tests_capy-unit-reference-target.capy.wasm
585b8cf61e9e227482ecac7d9dd33e9f4783a9cb9ea2f25b46fc5361281040be site_tests_capy-unit-reference-target.capy.wasm.source-map
23ee285e89caed1b0d6792f56a4debb31e906654f12d62acb787a1be14ea2efd site_tests_capy-variable-expressions.capy.wasm
8fcdc2d626318beb6a7c2a68df2140b6f9443db530f0e6f08c7af113279b96dd site_tests_capy-variable-expressions.capy.wasm.source-map
25402e09f782ee611a0523bee2595709af48c887716325f285e6361b3b140ee6 site_tests_capy-vector-variadic.capy.wasm
de6a0fa4af74e7b44d9c8c9e54f00f09d41b7d948b9320964377da7c6f9c9680 site_tests_capy-vector-variadic.capy.wasm.source-map
dd302861fef965799242e6662c41deaa423a77e5f427c64ccc410fa9b156be45 site_tests_capy-vector-variadic.capy.wasm.source-map
5181d53bdcd259a2269e2c2366694f87e95371120fc184fe0fa71fc9a8e6e23c site_tests_capy-websocket.capy.wasm
06a35caaeee7e98949731b6cb506abc7364d495191f885756c2d5025f5222094 site_tests_capy-websocket.capy.wasm.source-map
faf50b53b0162b36ebb716a05326c2f672a95a2d8f0c857024f24f05c25696c5 site_tests_capy-websocket.capy.wasm.source-map
352858b09f5427d2bed40c586d7bd4c2e61944ddc5f69630543e82898b4f0960 site_tests_capy-whitespace.capy.wasm
a45e9c913eb15cc2f69c09cbd2a2c439dbd5c6f3322a681eaa429e6ff6fa4e44 site_tests_capy-whitespace.capy.wasm.source-map
c6d8f665cb1277013d26e3ee01d54787e98853fed06e3112d27b7a2e9a7f58ef site_tests_capy-wide-conversion-trap.capy.wasm
9327cd0674001e64e6d128751785ed1e73550b83e00c619e862629485db711cf site_tests_capy-wide-conversion-trap.capy.wasm.source-map
e17f8f8c236a3b2ce2e81b86a26b63ff0d24ff2c56c8c9ed81ba7741376540a3 site_tests_capy-wide-scalars.capy.wasm
2b1e0d589d90df102c6e80c99bf747601fdfe3eaf84134c26553080111874d0c site_tests_capy-wide-scalars.capy.wasm.source-map
e017f053028cb7ee0a5e921d3293c8a64968421138886a0d00653774b71f790a site_tests_capy-wide-scalars.capy.wasm.source-map
dd87cbd5d2e2b7ec68caebf1a477b40b362542d86a838f03f50b96289bf7753e site_tests_cli.capy.wasm
adb57b67e0c5aff87da594c32444e4e43e3fcbada9997c216bdde9b47ac7c04e site_tests_cli.capy.wasm.source-map
a4ebd0cf0564579c8022d658583bf9d02e1d807f57f4fb9face1c7f70047551f site_tests_cli_runner.capy.wasm
@@ -255,7 +255,7 @@ cf236d6de408781ca4689f675560f06dbb73a9a67b7f2ed5355a1a6144b47329 site_tests_com
cc93d984e917ba2672a23186d8e0e8281591a498a16bfc24569a342b61c7a227 site_tests_core.capy.wasm
acf6d6eda5bdb1895b53187a18b6871db32f3ae49990ddd3f8a7e914104d9e1b site_tests_core.capy.wasm.source-map
6359cb0e694e7cdf71e46e1ba9df58a48e349f8a5c96ffd12ce4702e4eb1e29a site_tests_http.capy.wasm
731690e491d6fceb0ff85d9ce8057337e0936dd1a1f380a37b4fe0136e645b9a site_tests_http.capy.wasm.source-map
17212719cb4818a22cea319f28b4563041b81454e4ad919d8242d0087d8671b3 site_tests_http.capy.wasm.source-map
08646a06a199b3843bd84c996210e9fcc571c85dad8d21d31608eaf4b50454a6 site_tests_index.capy.wasm
af7a067c46bc73a1538b2425984e4e5a8e881d22a30c4d02b5cd9a2ce6575567 site_tests_index.capy.wasm.source-map
7ae7834ce2247c7815167f6e968ae20e19187f006d8e3f1b15b4d5bdc0bef6eb site_tests_io.capy.wasm
+2 -2
View File
@@ -447,7 +447,7 @@ int main()
const auto stdlib_converted_dvals = capy::compile_bearer_unit(
"function CLI(request : dval) { var a := dval(\"x\"); var b := dval(1); var c := push(dval([]), u64(2)); var d := set({}, \"ok\", true); "
"var task_id := task(\"/task\", 3.5); var output := component(\"/component\", false); component_render(\"/component\", \"props\"); "
"var loaded := unit_load(\"/unit\"); var called := loaded.call(\"echo\", 4); var direct := unit_call(\"/unit\", \"echo\", \"input\") }\n", options);
"var loaded := unit_load(\"/unit\"); var called := loaded.call(\"echo\", 4); var direct := unit_call(\"/unit:echo\", \"input\") }\n", options);
assert(capy::wasm::validate_bearer_unit(stdlib_converted_dvals.wasm, {.bearer_abi_version = "11"}).valid);
const auto component_render_result = capy::compile_bearer_unit(
"function CLI(request : dval) { var plain := component_render(\"/component\"); var props := component_render(\"/component\", \"props\"); if plain && props {} component_render(\"/component\"); component_render(\"/component\", \"props\") }\n", options);
@@ -789,7 +789,7 @@ int main()
const std::string mysql_bytes(ordinary_mysql.wasm.begin(), ordinary_mysql.wasm.end());
assert(mysql_bytes.find("bearer_mysql_escape") != std::string::npos);
const auto typed_sized_hosts = capy::compile_bearer_unit(
"function CLI(request : dval) { var params := dval({}); mysql_query(u64(0), \"select 1\", params); sqlite_query(u64(0), \"select 1\", params); regex_search(\"x\", \"x\"); regex_replace(\"x\", \"y\", \"x\"); unit_call(\"/x\", \"CLI\", params); json_decode(\"{}\"); base64_encode(\"x\") }\n", options);
"function CLI(request : dval) { var params := dval({}); mysql_query(u64(0), \"select 1\", params); sqlite_query(u64(0), \"select 1\", params); regex_search(\"x\", \"x\"); regex_replace(\"x\", \"y\", \"x\"); unit_call(\"/x:CLI\", params); json_decode(\"{}\"); base64_encode(\"x\") }\n", options);
assert(capy::wasm::validate_bearer_unit(typed_sized_hosts.wasm, {.bearer_abi_version = "11"}).valid);
const std::string typed_sized_host_bytes(typed_sized_hosts.wasm.begin(), typed_sized_hosts.wasm.end());
for (const auto& import : {"bearer_mysql_query", "bearer_sqlite_query", "bearer_regex_dval", "bearer_regex_text", "bearer_unit_call_brrb", "bearer_codec_dval", "bearer_codec_text"})
+4 -4
View File
@@ -921,7 +921,7 @@ EOF
}
check_module_trap missing 'function CLI(request : dval) { var module := unit_load("missing.capy") }'
check_module_trap unauthorized 'function CLI(request : dval) { var module := unit_load("/etc/passwd") }'
check_module_trap undeclared $'function CLI(request : dval) {\n unit_call("/tests/capy-module-target.capy", "hidden", "")\n}'
check_module_trap undeclared $'function CLI(request : dval) {\n unit_call("/tests/capy-module-target.capy:hidden", "")\n}'
check_module_trap wrong_target $'function CLI(request : dval) {\n var module := unit_load("/tests/capy-module-caller.capy")\n module.call("CLI")\n}'
external_unit=$(mktemp /tmp/capy-module-external.XXXXXX.capy)
trap 'rm -f -- "$external_unit"; rm -rf -- "$module_test_dir"' EXIT
@@ -948,11 +948,11 @@ EOF
expect_equal "Capy module failed-compile recovery" "v3" "$(scripts/bearer-cli "/tests/$module_test_name/fresh.capy")"
module_artifacts="$(scripts/unit_cache_directory "$bin_directory")$module_test_dir/target.capy"
printf '\377' | dd of="$module_artifacts.wasm" bs=1 seek=8 conv=notrunc status=none
check_module_trap wasm_tamper 'function CLI(request : dval) { unit_call("target.capy", "echo", "") }'
check_module_trap wasm_tamper 'function CLI(request : dval) { unit_call("target.capy:echo", "") }'
printf '%s\n' 'DValue* echo(DValue*);' 'not an export declaration' >"$module_artifacts.exports.txt"
check_module_trap exports_tamper 'function CLI(request : dval) { unit_call("target.capy", "echo", "") }'
check_module_trap exports_tamper 'function CLI(request : dval) { unit_call("target.capy:echo", "") }'
sed -i 's/^wasm_sha256=.*/wasm_sha256=0000000000000000000000000000000000000000000000000000000000000000/' "$module_artifacts.meta.txt"
check_module_trap metadata_tamper 'function CLI(request : dval) { unit_call("target.capy", "echo", "") }'
check_module_trap metadata_tamper 'function CLI(request : dval) { unit_call("target.capy:echo", "") }'
printf '%s\n' '#exports echo, nested, file_relative, boom' \
'function echo(input : dval) dval { -> dval("v4") }' \
'function nested(input : dval) dval { -> unit_load("nested.capy").call("echo", input) }' \
+1 -2
View File
@@ -1,7 +1,6 @@
function RENDER(request : dval)
{
print("<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"></meta><title>All documentation | Capy-Bearer Documentation</title><link rel=\"stylesheet\" href=\"/doc/style.css\"></link></head><body><h1><a href=\"/doc/\">Capy-Bearer Documentation</a><span class=\"dim\"> / </span>All documentation</h1>"
)
print("<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"></meta><title>All documentation | Capy-Bearer Documentation</title><link rel=\"stylesheet\" href=\"/doc/style.css\"></link></head><body><h1><a href=\"/doc/\">Capy-Bearer Documentation</a><span class=\"dim\"> / </span>All documentation</h1>")
component_render("/doc/components/all.capy")
print("</body></html>")
}
+2 -4
View File
@@ -10,10 +10,8 @@ function link(route : string, label : string, kind : string) void
function COMPONENT(request : dval)
{
print("<div class=\"api-reference-heading\"><h2>API Reference</h2><p>Bearer APIs available to Capy units.</p></div>"
)
print("<form class=\"search-bar\" action=\"/doc/search/\" method=\"get\"><input id=\"doc-search\" name=\"q\" type=\"search\" aria-label=\"Search documentation\" placeholder=\"Search documentation…\" autocomplete=\"off\" spellcheck=\"false\"></input><button type=\"submit\">Search</button></form>"
)
print("<div class=\"api-reference-heading\"><h2>API Reference</h2><p>Bearer APIs available to Capy units.</p></div>")
print("<form class=\"search-bar\" action=\"/doc/search/\" method=\"get\"><input id=\"doc-search\" name=\"q\" type=\"search\" aria-label=\"Search documentation\" placeholder=\"Search documentation…\" autocomplete=\"off\" spellcheck=\"false\"></input><button type=\"submit\">Search</button></form>")
print("<section class=\"doc-list-section\"><h2>API Functions</h2><div class=\"func-grid\">")
print("<div class=\"func-item\">");
link("/doc/api/abs/", "abs", "api");
+4 -4
View File
@@ -906,7 +906,7 @@ function COMPONENT(request : dval)
{
found = true
}
if consider(tokens, "/doc/api/unit-call/", "unit_call", "API Functions", "unit_call\n`unit_call` calls an exported function in a unit. A form without `props` sends an empty map as the function input.\n\nThe compound `target` form names the unit and its export in one string, the same way `component()`, `component_render()`, and `task()` do. It splits on the first colon, so a handler name such as `COMPONENT:CARD` still works after a unit path.\n\nPass `props` as map entries, a map, or a `dval` in the compound form. `unit_call(target, greeting: \"hello\")` is equivalent to `unit_call(target, {greeting: \"hello\"})`. A bare string as the second argument selects the `(file_name, function_name)` form instead, because an exact `string` match wins over a conversion.\n\nShared request state does not have to travel in `props`. `unit_context_set()` publishes it once for the whole request and the called unit reads it with `unit_context()`, which avoids copying it into every call.\n\nAn `#import` alias calls the same exported functions with the path written once and the export name checked at compile time.\n\nfile_name : unit path\nfunction_name : exported function name\ntarget : compound \"unit path:exported function name\"\nprops : function input\nexported function result")
if consider(tokens, "/doc/api/unit-call/", "unit_call", "API Functions", "unit_call\n`unit_call` calls an exported function in a unit. A form without `props` sends an empty map as the function input.\n\n`target` names the unit and its export in one string, the same way `component()`, `component_render()`, and `task()` do. It splits on the first colon, so a handler name such as `COMPONENT:CARD` still works after a unit path.\n\nPass `props` as map entries, a map, a `dval`, or a scalar. `unit_call(target, greeting: \"hello\")` is equivalent to `unit_call(target, {greeting: \"hello\"})`. A string or number becomes a scalar `dval`.\n\nShared request state does not have to travel in `props`. `unit_context_set()` publishes it once for the whole request and the called unit reads it with `unit_context()`, which avoids copying it into every call.\n\nAn `#import` alias calls the same exported functions with the path written once and the export name checked at compile time.\n\ntarget : compound \"unit path:exported function name\"\nprops : function input\nexported function result")
{
found = true
}
@@ -926,7 +926,7 @@ function COMPONENT(request : dval)
{
found = true
}
if consider(tokens, "/doc/api/unit-load/", "unit_load", "API Functions", "unit_load\n`unit_load()` loads a unit and returns a handle you can call exported functions on. It is the way one unit calls another unit's code, as opposed to `component()`, which renders another unit's *output*.\n\nThe target unit must publish the names it offers with `#exports`. Anything not exported is invisible to callers.\n\n## Calling through the handle\n\nTwo spellings do the same thing. Member syntax is the readable one:\n\n var target := unit_load(\"/tests/capy-module-target.capy\")\n var result := target.echo(name: \"Ada\")\n\n`call()` is the explicit form, and the one to use when the function name is itself a value:\n\n var result := call(target, \"echo\", name: \"Ada\")\n\nEvery exported function takes at most one `dval` input and returns a `dval`. Calling with no argument passes an empty `dval`.\n\n## When to load a handle, and when not to\n\nLoad a handle once and reuse it when several calls hit the same unit — the handle carries the resolved, compiled unit, so repeat calls skip the lookup.\n\nFor a single call, `unit_call(path, name, input)` does the same work in one step without a handle. Prefer it for one-offs.\n\n## What a handle is\n\nA `module` value is opaque: there is nothing inside it to read, print, or compare. It is request-local — a handle is valid for the request that created it and cannot be stored and reused later. It copies across `dval` boundaries, so passing one around within a request is safe.\n\nValues crossing a call are copied, not shared. Mutating the `dval` you passed in does not affect what the callee saw, and mutating the result does not reach back into the callee.\n\n## Related entry points\n\n`unit_render()` runs a unit's `RENDER` handler and writes its output to the response. `unit_info()` reports a unit's exports and compile state; `unit_compile()` compiles a unit without calling it.\n\npath : the unit path to load\nA `module` handle for the unit.\nA path that does not resolve, a unit that fails to compile, or a name the target does not export raises a runtime error that aborts the request. Use `unit_info()` first when a unit's availability is genuinely optional.")
if consider(tokens, "/doc/api/unit-load/", "unit_load", "API Functions", "unit_load\n`unit_load()` loads a unit and returns a handle you can call exported functions on. It is the way one unit calls another unit's code, as opposed to `component()`, which renders another unit's *output*.\n\nThe target unit must publish the names it offers with `#exports`. Anything not exported is invisible to callers.\n\n## Calling through the handle\n\nTwo spellings do the same thing. Member syntax is the readable one:\n\n var target := unit_load(\"/tests/capy-module-target.capy\")\n var result := target.echo(name: \"Ada\")\n\n`call()` is the explicit form, and the one to use when the function name is itself a value:\n\n var result := call(target, \"echo\", name: \"Ada\")\n\nEvery exported function takes at most one `dval` input and returns a `dval`. Calling with no argument passes an empty `dval`.\n\n## When to load a handle, and when not to\n\nLoad a handle once and reuse it when several calls hit the same unit — the handle carries the resolved, compiled unit, so repeat calls skip the lookup.\n\nFor a single call, `unit_call(\"path:name\", input)` does the same work in one step without a handle. Prefer it for one-offs.\n\n## What a handle is\n\nA `module` value is opaque: there is nothing inside it to read, print, or compare. It is request-local — a handle is valid for the request that created it and cannot be stored and reused later. It copies across `dval` boundaries, so passing one around within a request is safe.\n\nValues crossing a call are copied, not shared. Mutating the `dval` you passed in does not affect what the callee saw, and mutating the result does not reach back into the callee.\n\n## Related entry points\n\n`unit_render()` runs a unit's `RENDER` handler and writes its output to the response. `unit_info()` reports a unit's exports and compile state; `unit_compile()` compiles a unit without calling it.\n\npath : the unit path to load\nA `module` handle for the unit.\nA path that does not resolve, a unit that fails to compile, or a name the target does not export raises a runtime error that aborts the request. Use `unit_info()` first when a unit's availability is genuinely optional.")
{
found = true
}
@@ -1032,7 +1032,7 @@ function COMPONENT(request : dval)
{
found = true
}
if consider(tokens, "/doc/type/module/", "module", "Types", "module\n`module` is the type of a handle returned by `unit_load()`. It represents a loaded unit whose exported functions you can call.\n\n\n```capy\nfunction RENDER(request : dval) {\n var target := unit_load(\"/tests/capy-module-target.capy\")\n print(target.default_input(), \"\\n\")\n}\n```\n\n\n## It is opaque\n\nThere is nothing inside a module handle to read, print or compare. It cannot be used as a condition — `if handle` is a compile error saying the type is opaque — and it has no fields.\n\nThe only thing you do with one is call an exported function on it, either as a method or through `call()`:\n\n\n```capy\nfunction RENDER(request : dval) {\n var target := unit_load(\"/tests/capy-module-target.capy\")\n print(string(call(target, \"echo\", name: \"Ada\").name, \"\"), \"\\n\")\n}\n```\n\n\n## It is request-local\n\nA handle is valid for the request that created it and must not be stored for a later one — a subsequent request may load a newer source generation. It copies across `dval` boundaries, so passing one around within a single request is safe.\n\nValues crossing a call are copied, so mutating what you passed in does not affect the callee, and mutating the result does not reach back.\n\nFor a single call, `unit_call(path, name, input)` does the same work without a handle. Load a handle when several calls share one unit.\n")
if consider(tokens, "/doc/type/module/", "module", "Types", "module\n`module` is the type of a handle returned by `unit_load()`. It represents a loaded unit whose exported functions you can call.\n\n\n```capy\nfunction RENDER(request : dval) {\n var target := unit_load(\"/tests/capy-module-target.capy\")\n print(target.default_input(), \"\\n\")\n}\n```\n\n\n## It is opaque\n\nThere is nothing inside a module handle to read, print or compare. It cannot be used as a condition — `if handle` is a compile error saying the type is opaque — and it has no fields.\n\nThe only thing you do with one is call an exported function on it, either as a method or through `call()`:\n\n\n```capy\nfunction RENDER(request : dval) {\n var target := unit_load(\"/tests/capy-module-target.capy\")\n print(string(call(target, \"echo\", name: \"Ada\").name, \"\"), \"\\n\")\n}\n```\n\n\n## It is request-local\n\nA handle is valid for the request that created it and must not be stored for a later one — a subsequent request may load a newer source generation. It copies across `dval` boundaries, so passing one around within a single request is safe.\n\nValues crossing a call are copied, so mutating what you passed in does not affect the callee, and mutating the result does not reach back.\n\nFor a single call, `unit_call(\"path:name\", input)` does the same work without a handle. Load a handle when several calls share one unit.\n")
{
found = true
}
@@ -1150,7 +1150,7 @@ function COMPONENT(request : dval)
{
found = true
}
if consider(tokens, "/doc/guide/units-components-and-exports/", "10. Units and components", "Learn Capy", "10. Units and components\nEach Capy source file is an independent unit. A unit can expose functions and type metadata to other units. It can also render named components.\n\n## Export a function\n\n`#exports` lists the functions and types that another unit can inspect. A callable `(dval) dval` function can also be called through a module handle:\n\n```capy\n#exports echo\n\nfunction echo(input : dval) dval {\n -> input\n}\n\nfunction RENDER(request : dval) {\n var result := echo(message: \"ready\")\n print(result.message, \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nready\n\n```\n\nA module-callable function has the exact signature `(dval) dval`. Private helper functions do not appear in `#exports`.\n\n## Call another unit\n\nA separate service unit can expose a data function:\n\n```capy\n#exports version\n\nfunction version(input : dval) dval {\n -> {name: \"Capy\"}\n}\n\n```\n\n\nLoad and call it from a neighboring page:\n\n```capy\nfunction RENDER(request : dval) {\n var service := unit_load(\"/doc/examples/call_target.capy\")\n var version := service.default_input()\n print(string(version), \"\\n\")\n}\n\n```\n\n\n`unit_load` returns a request-local `module` handle. Module member calls are dynamic. `service.default_input()` calls the exported function named `default_input` on that loaded unit. Module calls copy input and result `dval` values as BRRB. `unit_call(path, name, input)` performs the same operation without keeping a handle.\n\nRelative paths resolve from the calling unit. Use an absolute site path when the target must not depend on the caller directory.\n\n## Module handles\n\nA module handle is a verified request-local capability. It can pass through typed locals, parameters, and results during that request. It cannot enter a `dval`, aggregate, closure, condition, or serialized boundary.\n\n## Static imports\n\nUse `#import \"path\" as name` to reference another unit at compile time. The alias names that unit's exported types and its exported functions.\n\nAn exported type is valid in any type position, including a constructor:\n\n```capy\n#import \"/doc/examples/call_target.capy\" as example\n\nfunction RENDER(request : dval) {\n var info : example.VersionInfo = example.VersionInfo(\"Capy\")\n print(info.name, \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nCapy\n\n```\n\nAn exported `(dval) dval` function is called through the same alias. The path is written once, and the compiler checks the export name where the call appears:\n\n```capy\n#import \"/doc/examples/call_target.capy\" as example\n\nfunction RENDER(request : dval) {\n var echoed := example.echo(message: \"through the alias\")\n print(string(echoed.message), \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nthrough the alias\n\n```\n\nThe `message: \"through the alias\"` argument is a map entry. Adjacent map entries form the one `dval` input of the export, so the call needs no braces.\n\n`example.echo(props)` means the same thing as `unit_call(\"/doc/examples/call_target.capy:echo\", props)` and compiles to the same call. The difference is when a mistake surfaces: a misspelled export, or one whose signature is not `(dval) dval`, is a compile error at the call, not a message in the response.\n\nA path beginning with `/` is a web path under the site root, the same form `unit_call()` and `component()` accept. A relative path resolves from the importing unit.\n\nA static import reads metadata at compile time. It does not create a runtime module handle, and the alias is not a value. Use `unit_load()` when the target unit must be chosen at runtime.\n\nChanging an imported unit recompiles the units that import it, because the import graph is part of each unit's freshness signature.\n\nDo not retain a module handle for another request. A later request can load a newer valid source generation.\n\n## Shared request state\n\nState that every unit in a request needs does not have to travel in `props`. Publish it once, and read it where it is used:\n\n```capy\nfunction RENDER(request : dval) {\n unit_context_set(user: {name: \"Ada\", scope: \"admin\"})\n print(string(unit_context(\"user.name\")), \" \", string(unit_context(\"user.scope\")), \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nAda admin\n\n```\n\n`unit_context_set()` publishes one value for the current request. Any unit reached through `unit_call()` or `component()` reads it with `unit_context()`. The context starts empty in every request and does not outlive it.\n\nPrefer the dotted-path read. `unit_context(\"user.name\")` copies one subtree, while `unit_context()` copies the whole context, and a unit that reads nothing copies nothing. Passing the same state in `props` instead copies all of it across every call, which is what makes a wide context expensive once many units are involved.\n\n## Components\n\nA component writes reusable response contLine truncated
if consider(tokens, "/doc/guide/units-components-and-exports/", "10. Units and components", "Learn Capy", "10. Units and components\nEach Capy source file is an independent unit. A unit can expose functions and type metadata to other units. It can also render named components.\n\n## Export a function\n\n`#exports` lists the functions and types that another unit can inspect. A callable `(dval) dval` function can also be called through a module handle:\n\n```capy\n#exports echo\n\nfunction echo(input : dval) dval {\n -> input\n}\n\nfunction RENDER(request : dval) {\n var result := echo(message: \"ready\")\n print(result.message, \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nready\n\n```\n\nA module-callable function has the exact signature `(dval) dval`. Private helper functions do not appear in `#exports`.\n\n## Call another unit\n\nA separate service unit can expose a data function:\n\n```capy\n#exports version\n\nfunction version(input : dval) dval {\n -> {name: \"Capy\"}\n}\n\n```\n\n\nLoad and call it from a neighboring page:\n\n```capy\nfunction RENDER(request : dval) {\n var service := unit_load(\"/doc/examples/call_target.capy\")\n var version := service.default_input()\n print(string(version), \"\\n\")\n}\n\n```\n\n\n`unit_load` returns a request-local `module` handle. Module member calls are dynamic. `service.default_input()` calls the exported function named `default_input` on that loaded unit. Module calls copy input and result `dval` values as BRRB. `unit_call(\"path:name\", input)` performs the same operation without keeping a handle.\n\nRelative paths resolve from the calling unit. Use an absolute site path when the target must not depend on the caller directory.\n\n## Module handles\n\nA module handle is a verified request-local capability. It can pass through typed locals, parameters, and results during that request. It cannot enter a `dval`, aggregate, closure, condition, or serialized boundary.\n\n## Static imports\n\nUse `#import \"path\" as name` to reference another unit at compile time. The alias names that unit's exported types and its exported functions.\n\nAn exported type is valid in any type position, including a constructor:\n\n```capy\n#import \"/doc/examples/call_target.capy\" as example\n\nfunction RENDER(request : dval) {\n var info : example.VersionInfo = example.VersionInfo(\"Capy\")\n print(info.name, \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nCapy\n\n```\n\nAn exported `(dval) dval` function is called through the same alias. The path is written once, and the compiler checks the export name where the call appears:\n\n```capy\n#import \"/doc/examples/call_target.capy\" as example\n\nfunction RENDER(request : dval) {\n var echoed := example.echo(message: \"through the alias\")\n print(string(echoed.message), \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nthrough the alias\n\n```\n\nThe `message: \"through the alias\"` argument is a map entry. Adjacent map entries form the one `dval` input of the export, so the call needs no braces.\n\n`example.echo(props)` means the same thing as `unit_call(\"/doc/examples/call_target.capy:echo\", props)` and compiles to the same call. The difference is when a mistake surfaces: a misspelled export, or one whose signature is not `(dval) dval`, is a compile error at the call, not a message in the response.\n\nA path beginning with `/` is a web path under the site root, the same form `unit_call()` and `component()` accept. A relative path resolves from the importing unit.\n\nA static import reads metadata at compile time. It does not create a runtime module handle, and the alias is not a value. Use `unit_load()` when the target unit must be chosen at runtime.\n\nChanging an imported unit recompiles the units that import it, because the import graph is part of each unit's freshness signature.\n\nDo not retain a module handle for another request. A later request can load a newer valid source generation.\n\n## Shared request state\n\nState that every unit in a request needs does not have to travel in `props`. Publish it once, and read it where it is used:\n\n```capy\nfunction RENDER(request : dval) {\n unit_context_set(user: {name: \"Ada\", scope: \"admin\"})\n print(string(unit_context(\"user.name\")), \" \", string(unit_context(\"user.scope\")), \"\\n\")\n}\n\n```\n\n**Output**\n\n```text\nAda admin\n\n```\n\n`unit_context_set()` publishes one value for the current request. Any unit reached through `unit_call()` or `component()` reads it with `unit_context()`. The context starts empty in every request and does not outlive it.\n\nPrefer the dotted-path read. `unit_context(\"user.name\")` copies one subtree, while `unit_context()` copies the whole context, and a unit that reads nothing copies nothing. Passing the same state in `props` instead copies all of it across every call, which is what makes a wide context expensive once many units are involved.\n\n## Components\n\nA component writes reusable response cLine truncated
{
found = true
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>abs</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function abs(value : f32) f32\nfunction abs(value : f64) f64\nfunction abs(value : s8) s8\nfunction abs(value : s16) s16\nfunction abs(value : s32) s32\nfunction abs(value : s64) s64\nfunction abs(value : u8) u8\nfunction abs(value : u16) u16\nfunction abs(value : u32) u32\nfunction abs(value : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>abs()</code> returns the result for <code>value</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A value with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := abs(2.5)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href"
)
print("=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>abs</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function abs(value : f32) f32\nfunction abs(value : f64) f64\nfunction abs(value : s8) s8\nfunction abs(value : s16) s16\nfunction abs(value : s32) s32\nfunction abs(value : s64) s64\nfunction abs(value : u8) u8\nfunction abs(value : u16) u16\nfunction abs(value : u32) u32\nfunction abs(value : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>abs()</code> returns the result for <code>value</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A value with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := abs(2.5)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href")
print("=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>array_merge</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function array_merge(left : dval, right : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>array_merge</code> combines two <code>dval</code> values. It returns a new value.</p><p>For maps, values from <code>right</code> replace matching values from <code>left</code>. The function also merges lists.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>left : first value</p></div><div><p>right : second value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a merged <code>dval</code> value</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var merged := array_merge(dval({&quot;name&quot;: &quot;Ada&quot;}), dval({&quot;role&quot;: &quot;admin&quot;}))\nprint(merged[&quot;name&quot;], &quot; &quot;, merged[&quot;role&quot;], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>array_merge</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function array_merge(left : dval, right : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>array_merge</code> combines two <code>dval</code> values. It returns a new value.</p><p>For maps, values from <code>right</code> replace matching values from <code>left</code>. The function also merges lists.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>left : first value</p></div><div><p>right : second value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a merged <code>dval</code> value</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var merged := array_merge(dval({&quot;name&quot;: &quot;Ada&quot;}), dval({&quot;role&quot;: &quot;admin&quot;}))\nprint(merged[&quot;name&quot;], &quot; &quot;, merged[&quot;role&quot;], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>atan2</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function atan2(y : f32, x : f32) f32\nfunction atan2(y : f64, x : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>atan2()</code> returns the angle for the point <code>(x, y)</code>.</p><p>This function uses a host call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>y : the y coordinate</p></div><div><p>x : the x coordinate</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> angle in radians.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := atan2(1.0, 0.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc"
)
print("/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>atan2</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function atan2(y : f32, x : f32) f32\nfunction atan2(y : f64, x : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>atan2()</code> returns the angle for the point <code>(x, y)</code>.</p><p>This function uses a host call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>y : the y coordinate</p></div><div><p>x : the x coordinate</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> angle in radians.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := atan2(1.0, 0.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc")
print("/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>backtrace_capture</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function backtrace_capture() string\nfunction backtrace_capture(max_frames : s32, skip_frames : s32) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>backtrace_capture</code> gets a backtrace for the current call stack.</p><p>Call it with no arguments. You can also set the maximum frame count and skip count.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>max_frames : maximum number of frames</p></div><div><p>skip_frames : number of newest frames to omit</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a backtrace string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(backtrace_capture(), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/trap/\">trap</a><a class=\"related-link\" href=\"/doc/api/backtrace-get-frames/\">backtrace_get_frames</a><a class=\"related-link\" href=\"/doc/api/posix-info/\">posix_info</a><a class=\"related-link\" href=\"/doc/api/runtime-perf/\">runtime_perf</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>backtrace_capture</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function backtrace_capture() string\nfunction backtrace_capture(max_frames : s32, skip_frames : s32) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>backtrace_capture</code> gets a backtrace for the current call stack.</p><p>Call it with no arguments. You can also set the maximum frame count and skip count.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>max_frames : maximum number of frames</p></div><div><p>skip_frames : number of newest frames to omit</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a backtrace string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(backtrace_capture(), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/trap/\">trap</a><a class=\"related-link\" href=\"/doc/api/backtrace-get-frames/\">backtrace_get_frames</a><a class=\"related-link\" href=\"/doc/api/posix-info/\">posix_info</a><a class=\"related-link\" href=\"/doc/api/runtime-perf/\">runtime_perf</a></aside></div>")
}
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>backtrace_get_frames</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function backtrace_get_frames(max_frames : s32 = 32, skip_frames : s32 = 0) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>backtrace_get_frames</code> gets source-mapped frames for the current Capy call stack.</p><p>Set <code>max_frames</code> to limit the result. Set <code>skip_frames</code> to omit the newest frames.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>max_frames : maximum number of frames</p></div><div><p>skip_frames : number of newest frames to omit</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a backtrace string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(backtrace_get_frames(4, 0), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/trap/\">trap</a><a class=\"related-link\" href=\"/doc/api/backtrace-capture/\">backtrace_capture</a><a class=\"related-link\" href=\"/doc/api/posix-info/\">posix_info</a><a class=\"related-link\" href=\"/doc/api/runtime-perf/\">runtime_perf</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>backtrace_get_frames</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function backtrace_get_frames(max_frames : s32 = 32, skip_frames : s32 = 0) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>backtrace_get_frames</code> gets source-mapped frames for the current Capy call stack.</p><p>Set <code>max_frames</code> to limit the result. Set <code>skip_frames</code> to omit the newest frames.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>max_frames : maximum number of frames</p></div><div><p>skip_frames : number of newest frames to omit</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a backtrace string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(backtrace_get_frames(4, 0), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/trap/\">trap</a><a class=\"related-link\" href=\"/doc/api/backtrace-capture/\">backtrace_capture</a><a class=\"related-link\" href=\"/doc/api/posix-info/\">posix_info</a><a class=\"related-link\" href=\"/doc/api/runtime-perf/\">runtime_perf</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>base64_decode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function base64_decode(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>base64_decode</code> decodes Base64 text into a string.</p><p>Invalid Base64 text returns an empty string.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : Base64 text</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>the decoded string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(base64_decode(&quot;aGVsbG8=&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link"
)
print("\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>base64_decode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function base64_decode(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>base64_decode</code> decodes Base64 text into a string.</p><p>Invalid Base64 text returns an empty string.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : Base64 text</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>the decoded string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(base64_decode(&quot;aGVsbG8=&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link")
print("\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>base64_encode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function base64_encode(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>base64_encode</code> encodes a string as Base64 text.</p><p>Use <code>base64_decode</code> to decode the result.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : source string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Base64 text</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(base64_encode(&quot;hello&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" "
)
print("href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>base64_encode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function base64_encode(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>base64_encode</code> encodes a string as Base64 text.</p><p>Use <code>base64_decode</code> to decode the result.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : source string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Base64 text</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(base64_encode(&quot;hello&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" ")
print("href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>basename</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function basename(path : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>basename</code> returns the final component of a path.</p><p>It does not access the file system.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : a path string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>the final path component</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(basename(&quot;/var/www/site/index.capy&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/dirname/\">dirname</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-get/\">cwd_get</a><a class=\"related-link\" href=\"/doc/api/cwd-set/\">cwd_set</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>basename</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function basename(path : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>basename</code> returns the final component of a path.</p><p>It does not access the file system.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : a path string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>the final path component</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(basename(&quot;/var/www/site/index.capy&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/dirname/\">dirname</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-get/\">cwd_get</a><a class=\"related-link\" href=\"/doc/api/cwd-set/\">cwd_set</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_and</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_and(a : s8, b : s8) s8\nfunction bit_and(a : s16, b : s16) s16\nfunction bit_and(a : s32, b : s32) s32\nfunction bit_and(a : s64, b : s64) s64\nfunction bit_and(a : u8, b : u8) u8\nfunction bit_and(a : u16, b : u16) u16\nfunction bit_and(a : u32, b : u32) u32\nfunction bit_and(a : u64, b : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_and()</code> returns the bitwise AND of <code>a</code> and <code>b</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>a : the first integer value</p></div><div><p>b : the second integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_and(u8(12), u8(10))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"r"
)
print("elated-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_and</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_and(a : s8, b : s8) s8\nfunction bit_and(a : s16, b : s16) s16\nfunction bit_and(a : s32, b : s32) s32\nfunction bit_and(a : s64, b : s64) s64\nfunction bit_and(a : u8, b : u8) u8\nfunction bit_and(a : u16, b : u16) u16\nfunction bit_and(a : u32, b : u32) u32\nfunction bit_and(a : u64, b : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_and()</code> returns the bitwise AND of <code>a</code> and <code>b</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>a : the first integer value</p></div><div><p>b : the second integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_and(u8(12), u8(10))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"r")
print("elated-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_count_1</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_count_1(value : s8) s64\nfunction bit_count_1(value : s16) s64\nfunction bit_count_1(value : s32) s64\nfunction bit_count_1(value : s64) s64\nfunction bit_count_1(value : u8) s64\nfunction bit_count_1(value : u16) s64\nfunction bit_count_1(value : u32) s64\nfunction bit_count_1(value : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_count_1()</code> counts one bits in the width of <code>value</code>. An <code>u8</code> value uses eight bits, not its container width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>s64</code> count.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_count_1(u8(1))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/"
)
print("doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_count_1</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_count_1(value : s8) s64\nfunction bit_count_1(value : s16) s64\nfunction bit_count_1(value : s32) s64\nfunction bit_count_1(value : s64) s64\nfunction bit_count_1(value : u8) s64\nfunction bit_count_1(value : u16) s64\nfunction bit_count_1(value : u32) s64\nfunction bit_count_1(value : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_count_1()</code> counts one bits in the width of <code>value</code>. An <code>u8</code> value uses eight bits, not its container width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>s64</code> count.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_count_1(u8(1))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/")
print("doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_count_lz</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_count_lz(value : s8) s64\nfunction bit_count_lz(value : s16) s64\nfunction bit_count_lz(value : s32) s64\nfunction bit_count_lz(value : s64) s64\nfunction bit_count_lz(value : u8) s64\nfunction bit_count_lz(value : u16) s64\nfunction bit_count_lz(value : u32) s64\nfunction bit_count_lz(value : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_count_lz()</code> counts leading zero bits in the width of <code>value</code>. An <code>u8</code> value uses eight bits, not its container width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>s64</code> count.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_count_lz(u8(1))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"r"
)
print("elated-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_count_lz</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_count_lz(value : s8) s64\nfunction bit_count_lz(value : s16) s64\nfunction bit_count_lz(value : s32) s64\nfunction bit_count_lz(value : s64) s64\nfunction bit_count_lz(value : u8) s64\nfunction bit_count_lz(value : u16) s64\nfunction bit_count_lz(value : u32) s64\nfunction bit_count_lz(value : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_count_lz()</code> counts leading zero bits in the width of <code>value</code>. An <code>u8</code> value uses eight bits, not its container width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>s64</code> count.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_count_lz(u8(1))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"r")
print("elated-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_count_tz</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_count_tz(value : s8) s64\nfunction bit_count_tz(value : s16) s64\nfunction bit_count_tz(value : s32) s64\nfunction bit_count_tz(value : s64) s64\nfunction bit_count_tz(value : u8) s64\nfunction bit_count_tz(value : u16) s64\nfunction bit_count_tz(value : u32) s64\nfunction bit_count_tz(value : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_count_tz()</code> counts trailing zero bits in the width of <code>value</code>. An <code>u8</code> value uses eight bits, not its container width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>s64</code> count.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_count_tz(u8(1))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\""
)
print("related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_count_tz</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_count_tz(value : s8) s64\nfunction bit_count_tz(value : s16) s64\nfunction bit_count_tz(value : s32) s64\nfunction bit_count_tz(value : s64) s64\nfunction bit_count_tz(value : u8) s64\nfunction bit_count_tz(value : u16) s64\nfunction bit_count_tz(value : u32) s64\nfunction bit_count_tz(value : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_count_tz()</code> counts trailing zero bits in the width of <code>value</code>. An <code>u8</code> value uses eight bits, not its container width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>s64</code> count.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_count_tz(u8(1))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"")
print("related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_not</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_not(value : s8) s8\nfunction bit_not(value : s16) s16\nfunction bit_not(value : s32) s32\nfunction bit_not(value : s64) s64\nfunction bit_not(value : u8) u8\nfunction bit_not(value : u16) u16\nfunction bit_not(value : u32) u32\nfunction bit_not(value : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_not()</code> inverts every bit in <code>value</code>. The compiler lowers it with an all-ones mask for the value width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_not(u8(0))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\""
)
print(">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_not</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_not(value : s8) s8\nfunction bit_not(value : s16) s16\nfunction bit_not(value : s32) s32\nfunction bit_not(value : s64) s64\nfunction bit_not(value : u8) u8\nfunction bit_not(value : u16) u16\nfunction bit_not(value : u32) u32\nfunction bit_not(value : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_not()</code> inverts every bit in <code>value</code>. The compiler lowers it with an all-ones mask for the value width.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_not(u8(0))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\"")
print(">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_or</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_or(a : s8, b : s8) s8\nfunction bit_or(a : s16, b : s16) s16\nfunction bit_or(a : s32, b : s32) s32\nfunction bit_or(a : s64, b : s64) s64\nfunction bit_or(a : u8, b : u8) u8\nfunction bit_or(a : u16, b : u16) u16\nfunction bit_or(a : u32, b : u32) u32\nfunction bit_or(a : u64, b : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_or()</code> returns the bitwise OR of <code>a</code> and <code>b</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>a : the first integer value</p></div><div><p>b : the second integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_or(u8(12), u8(10))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-lin"
)
print("k\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_or</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_or(a : s8, b : s8) s8\nfunction bit_or(a : s16, b : s16) s16\nfunction bit_or(a : s32, b : s32) s32\nfunction bit_or(a : s64, b : s64) s64\nfunction bit_or(a : u8, b : u8) u8\nfunction bit_or(a : u16, b : u16) u16\nfunction bit_or(a : u32, b : u32) u32\nfunction bit_or(a : u64, b : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_or()</code> returns the bitwise OR of <code>a</code> and <code>b</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>a : the first integer value</p></div><div><p>b : the second integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_or(u8(12), u8(10))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-lin")
print("k\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_rotate_left</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_rotate_left(value : s8, count : s8) s8\nfunction bit_rotate_left(value : s16, count : s16) s16\nfunction bit_rotate_left(value : s32, count : s32) s32\nfunction bit_rotate_left(value : s64, count : s64) s64\nfunction bit_rotate_left(value : u8, count : u8) u8\nfunction bit_rotate_left(value : u16, count : u16) u16\nfunction bit_rotate_left(value : u32, count : u32) u32\nfunction bit_rotate_left(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_rotate_left()</code> rotates bits left by <code>count</code> positions.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_rotate_left(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/ap"
)
print("i/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_rotate_left</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_rotate_left(value : s8, count : s8) s8\nfunction bit_rotate_left(value : s16, count : s16) s16\nfunction bit_rotate_left(value : s32, count : s32) s32\nfunction bit_rotate_left(value : s64, count : s64) s64\nfunction bit_rotate_left(value : u8, count : u8) u8\nfunction bit_rotate_left(value : u16, count : u16) u16\nfunction bit_rotate_left(value : u32, count : u32) u32\nfunction bit_rotate_left(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_rotate_left()</code> rotates bits left by <code>count</code> positions.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_rotate_left(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/ap")
print("i/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_rotate_right</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_rotate_right(value : s8, count : s8) s8\nfunction bit_rotate_right(value : s16, count : s16) s16\nfunction bit_rotate_right(value : s32, count : s32) s32\nfunction bit_rotate_right(value : s64, count : s64) s64\nfunction bit_rotate_right(value : u8, count : u8) u8\nfunction bit_rotate_right(value : u16, count : u16) u16\nfunction bit_rotate_right(value : u32, count : u32) u32\nfunction bit_rotate_right(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_rotate_right()</code> rotates bits right by <code>count</code> positions.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_rotate_right(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" h"
)
print("ref=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_rotate_right</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_rotate_right(value : s8, count : s8) s8\nfunction bit_rotate_right(value : s16, count : s16) s16\nfunction bit_rotate_right(value : s32, count : s32) s32\nfunction bit_rotate_right(value : s64, count : s64) s64\nfunction bit_rotate_right(value : u8, count : u8) u8\nfunction bit_rotate_right(value : u16, count : u16) u16\nfunction bit_rotate_right(value : u32, count : u32) u32\nfunction bit_rotate_right(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_rotate_right()</code> rotates bits right by <code>count</code> positions.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_rotate_right(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" h")
print("ref=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_shl</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_shl(value : s8, count : s8) s8\nfunction bit_shl(value : s16, count : s16) s16\nfunction bit_shl(value : s32, count : s32) s32\nfunction bit_shl(value : s64, count : s64) s64\nfunction bit_shl(value : u8, count : u8) u8\nfunction bit_shl(value : u16, count : u16) u16\nfunction bit_shl(value : u32, count : u32) u32\nfunction bit_shl(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_shl()</code> shifts bits left by <code>count</code> positions.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_shl(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-"
)
print("right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_shl</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_shl(value : s8, count : s8) s8\nfunction bit_shl(value : s16, count : s16) s16\nfunction bit_shl(value : s32, count : s32) s32\nfunction bit_shl(value : s64, count : s64) s64\nfunction bit_shl(value : u8, count : u8) u8\nfunction bit_shl(value : u16, count : u16) u16\nfunction bit_shl(value : u32, count : u32) u32\nfunction bit_shl(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_shl()</code> shifts bits left by <code>count</code> positions.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_shl(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-")
print("right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_shr</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_shr(value : s8, count : s8) s8\nfunction bit_shr(value : s16, count : s16) s16\nfunction bit_shr(value : s32, count : s32) s32\nfunction bit_shr(value : s64, count : s64) s64\nfunction bit_shr(value : u8, count : u8) u8\nfunction bit_shr(value : u16, count : u16) u16\nfunction bit_shr(value : u32, count : u32) u32\nfunction bit_shr(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_shr()</code> shifts bits right by <code>count</code> positions. For signed types, <code>bit_shr()</code> uses an arithmetic shift. For unsigned types, it uses a logical shift.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_shr(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"rel"
)
print("ated-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_shr</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_shr(value : s8, count : s8) s8\nfunction bit_shr(value : s16, count : s16) s16\nfunction bit_shr(value : s32, count : s32) s32\nfunction bit_shr(value : s64, count : s64) s64\nfunction bit_shr(value : u8, count : u8) u8\nfunction bit_shr(value : u16, count : u16) u16\nfunction bit_shr(value : u32, count : u32) u32\nfunction bit_shr(value : u64, count : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_shr()</code> shifts bits right by <code>count</code> positions. For signed types, <code>bit_shr()</code> uses an arithmetic shift. For unsigned types, it uses a logical shift.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the integer value</p></div><div><p>count : the shift or rotation count. It has the same width as <code>value</code>.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_shr(u8(1), u8(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"rel")
print("ated-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_xor</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_xor(a : s8, b : s8) s8\nfunction bit_xor(a : s16, b : s16) s16\nfunction bit_xor(a : s32, b : s32) s32\nfunction bit_xor(a : s64, b : s64) s64\nfunction bit_xor(a : u8, b : u8) u8\nfunction bit_xor(a : u16, b : u16) u16\nfunction bit_xor(a : u32, b : u32) u32\nfunction bit_xor(a : u64, b : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_xor()</code> returns the bitwise XOR of <code>a</code> and <code>b</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>a : the first integer value</p></div><div><p>b : the second integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_xor(u8(12), u8(10))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"r"
)
print("elated-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bit_xor</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bit_xor(a : s8, b : s8) s8\nfunction bit_xor(a : s16, b : s16) s16\nfunction bit_xor(a : s32, b : s32) s32\nfunction bit_xor(a : s64, b : s64) s64\nfunction bit_xor(a : u8, b : u8) u8\nfunction bit_xor(a : u16, b : u16) u16\nfunction bit_xor(a : u32, b : u32) u32\nfunction bit_xor(a : u64, b : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bit_xor()</code> returns the bitwise XOR of <code>a</code> and <code>b</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>a : the first integer value</p></div><div><p>b : the second integer value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An integer with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bit_xor(u8(12), u8(10))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"r")
print("elated-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bits_of</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bits_of(value : f32) u32\nfunction bits_of(value : f64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bits_of()</code> reinterprets the bits of a floating-point value. It does not convert the numeric value.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the floating-point value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The bit pattern of <code>value</code> as an unsigned integer.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bits_of(f64(1.0))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">"
)
print("f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bits_of</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bits_of(value : f32) u32\nfunction bits_of(value : f64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bits_of()</code> reinterprets the bits of a floating-point value. It does not convert the numeric value.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the floating-point value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The bit pattern of <code>value</code> as an unsigned integer.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := bits_of(f64(1.0))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">")
print("f64_from_bits</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>brb_decode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function brb_decode(encoded : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>brb_decode</code> decodes BRRB data into a <code>dval</code> value.</p><p>Use it to read data from <code>brb_encode</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>encoded : BRRB data</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a decoded <code>dval</code> value</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := brb_decode(brb_encode(dval({&quot;name&quot;: &quot;Ada&quot;})))\nprint(value[&quot;name&quot;], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml"
)
print("_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>brb_decode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function brb_decode(encoded : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>brb_decode</code> decodes BRRB data into a <code>dval</code> value.</p><p>Use it to read data from <code>brb_encode</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>encoded : BRRB data</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>a decoded <code>dval</code> value</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := brb_decode(brb_encode(dval({&quot;name&quot;: &quot;Ada&quot;})))\nprint(value[&quot;name&quot;], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml")
print("_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>brb_encode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function brb_encode(value : dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>brb_encode</code> encodes a <code>dval</code> value as BRRB data.</p><p>Use <code>brb_decode</code> to restore the value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : value to encode</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>BRRB data as a string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var packed := brb_encode(dval({&quot;name&quot;: &quot;Ada&quot;}))\nprint(brb_decode(packed)[&quot;name&quot;], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml_encode</a"
)
print("><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>brb_encode</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function brb_encode(value : dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>brb_encode</code> encodes a <code>dval</code> value as BRRB data.</p><p>Use <code>brb_decode</code> to restore the value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : value to encode</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>BRRB data as a string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var packed := brb_encode(dval({&quot;name&quot;: &quot;Ada&quot;}))\nprint(brb_decode(packed)[&quot;name&quot;], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"/doc/api/xml-encode/\">xml_encode</a")
print("><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bytes_of</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bytes_of(value : string) [u8]</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bytes_of()</code> copies a string into a new byte array.</p><p>The function keeps zero bytes and returns each byte as a <code>u8</code> value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : a string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A byte array with the same bytes as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var bytes := bytes_of(&quot;ABC&quot;)\nprint(bytes[0], bytes[1], bytes[2], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/contains/\">contains</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/first/\">first</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/clone/\">clone</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a class=\"related-link\" href=\"/doc/api/str-ends-with/\">str_ends_with<"
)
print("/a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>bytes_of</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function bytes_of(value : string) [u8]</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>bytes_of()</code> copies a string into a new byte array.</p><p>The function keeps zero bytes and returns each byte as a <code>u8</code> value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : a string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A byte array with the same bytes as <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var bytes := bytes_of(&quot;ABC&quot;)\nprint(bytes[0], bytes[1], bytes[2], &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/contains/\">contains</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/first/\">first</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/clone/\">clone</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a class=\"related-link\" href=\"/doc/api/str-ends-with/\">str_ends_with<")
print("/a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>call</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function call(handle : module, name : string) dval\nfunction call(handle : module, name : string, input : as dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>call()</code> calls an exported function in a loaded unit. It returns the result as <code>dval</code>.</p><p>Use <code>unit_load()</code> once when several calls use the same unit. The two-argument form passes an empty <code>dval</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : a value from <code>unit_load()</code></p></div><div><p>name : an exported function name</p></div><div><p>input : optional <code>dval</code> input</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The exported function result.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := unit_load(&quot;/doc/examples/call_target.capy&quot;)\nvar result := call(handle, &quot;echo&quot;, name: &quot;Ada&quot;)\nprint(string(result.name), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/unit-load/\">unit_load</a><a class=\"related-link\" href=\"/doc/api/unit-call/\">unit_call</a><a class=\"related-link\" href=\"/doc/api/unit-render/\">unit_render</a><a class=\"related-link\" href=\"/doc/api/unit-info/\">unit_info</a><a class=\"related-link\" href=\"/doc/api/unit-compile/\">unit_compile</a><a class=\"related-link\" href=\"/doc/api/units-list/\">units_list</a><a class=\"related-link\" href=\"/"
)
print("doc/api/unit-context/\">unit_context</a><a class=\"related-link\" href=\"/doc/api/unit-context-set/\">unit_context_set</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>call</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function call(handle : module, name : string) dval\nfunction call(handle : module, name : string, input : as dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>call()</code> calls an exported function in a loaded unit. It returns the result as <code>dval</code>.</p><p>Use <code>unit_load()</code> once when several calls use the same unit. The two-argument form passes an empty <code>dval</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : a value from <code>unit_load()</code></p></div><div><p>name : an exported function name</p></div><div><p>input : optional <code>dval</code> input</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The exported function result.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := unit_load(&quot;/doc/examples/call_target.capy&quot;)\nvar result := call(handle, &quot;echo&quot;, name: &quot;Ada&quot;)\nprint(string(result.name), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/unit-load/\">unit_load</a><a class=\"related-link\" href=\"/doc/api/unit-call/\">unit_call</a><a class=\"related-link\" href=\"/doc/api/unit-render/\">unit_render</a><a class=\"related-link\" href=\"/doc/api/unit-info/\">unit_info</a><a class=\"related-link\" href=\"/doc/api/unit-compile/\">unit_compile</a><a class=\"related-link\" href=\"/doc/api/units-list/\">units_list</a><a class=\"related-link\" href=\"/")
print("doc/api/unit-context/\">unit_context</a><a class=\"related-link\" href=\"/doc/api/unit-context-set/\">unit_context_set</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>ceil</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function ceil(value : f32) f32\nfunction ceil(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>ceil()</code> returns the result for <code>value</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := ceil(2.5)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_n"
)
print("an</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>ceil</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function ceil(value : f32) f32\nfunction ceil(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>ceil()</code> returns the result for <code>value</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := ceil(2.5)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_n")
print("an</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>clamp</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function clamp(value : f32, low : f32, high : f32) f32\nfunction clamp(value : f64, low : f64, high : f64) f64\nfunction clamp(value : s8, low : s8, high : s8) s8\nfunction clamp(value : s16, low : s16, high : s16) s16\nfunction clamp(value : s32, low : s32, high : s32) s32\nfunction clamp(value : s64, low : s64, high : s64) s64\nfunction clamp(value : u8, low : u8, high : u8) u8\nfunction clamp(value : u16, low : u16, high : u16) u16\nfunction clamp(value : u32, low : u32, high : u32) u32\nfunction clamp(value : u64, low : u64, high : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>clamp()</code> limits <code>value</code> to the inclusive range from <code>low</code> to <code>high</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div><p>low : the lower bound</p></div><div><p>high : the upper bound</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A value with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := clamp(5, 0, 3)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/"
)
print("ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>clamp</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function clamp(value : f32, low : f32, high : f32) f32\nfunction clamp(value : f64, low : f64, high : f64) f64\nfunction clamp(value : s8, low : s8, high : s8) s8\nfunction clamp(value : s16, low : s16, high : s16) s16\nfunction clamp(value : s32, low : s32, high : s32) s32\nfunction clamp(value : s64, low : s64, high : s64) s64\nfunction clamp(value : u8, low : u8, high : u8) u8\nfunction clamp(value : u16, low : u16, high : u16) u16\nfunction clamp(value : u32, low : u32, high : u32) u32\nfunction clamp(value : u64, low : u64, high : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>clamp()</code> limits <code>value</code> to the inclusive range from <code>low</code> to <code>high</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div><p>low : the lower bound</p></div><div><p>high : the upper bound</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A value with the same type as the inputs.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := clamp(5, 0, 3)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/")
print("ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a></aside></div>")
}
+1 -2
View File
@@ -1,6 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Clear a dynamic value</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function clear(value : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>clear(value)</code> removes all children and makes <code>value</code> an empty map.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : target value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The cleared target value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := dval({&quot;name&quot;: &quot;Ada&quot;})\nvalue = clear(value)\nprint(has(value, &quot;name&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Clear a dynamic value</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function clear(value : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>clear(value)</code> removes all children and makes <code>value</code> an empty map.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : target value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The cleared target value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := dval({&quot;name&quot;: &quot;Ada&quot;})\nvalue = clear(value)\nprint(has(value, &quot;name&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside")
print("></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>clone</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function clone(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>clone()</code> copies a string.</p><p>Most Capy code does not need an explicit copy. Use <code>clone()</code> when a fresh string value is required.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : a source string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A separate string copy.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var source := &quot;token&quot;\nvar copy := clone(source)\nprint(length(source), &quot; &quot;, length(copy), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/contains/\">contains</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/first/\">first</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a class=\"related-link\" href=\"/doc/api/str-ends-with"
)
print("/\">str_ends_with</a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a><a class=\"related-link\" href=\"/doc/api/length/\">length</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>clone</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function clone(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>clone()</code> copies a string.</p><p>Most Capy code does not need an explicit copy. Use <code>clone()</code> when a fresh string value is required.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : a source string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A separate string copy.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var source := &quot;token&quot;\nvar copy := clone(source)\nprint(length(source), &quot; &quot;, length(copy), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/contains/\">contains</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/first/\">first</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a class=\"related-link\" href=\"/doc/api/str-ends-with")
print("/\">str_ends_with</a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a><a class=\"related-link\" href=\"/doc/api/length/\">length</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>component_render</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function component_render(name : string) bool\nfunction component_render(name : string, props : as dval) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>component_render()</code> renders a component and writes its output straight into the current response. It returns true when it renders the component. It returns false when it cannot resolve the component.</p><p>This is the form to reach for in page layouts. <code>component()</code> opens a capture buffer, collects everything the component prints, and hands you a string; <code>component_render()</code> skips that buffer entirely. When you are only going to print the result anyway, <code>component_render(&quot;card&quot;)</code> does less work than <code>print(component(&quot;card&quot;))</code>.</p><p>Use a capturing call instead when you need the output as a value — to measure it, wrap it, store it, or decide whether to emit it at all.</p><p>Name resolution, <code>:HANDLER</code> suffixes, props scoping, and <code>ONCE</code> behaviour are identical to <code>component()</code>; that page documents the rules in full.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>name : a component path, optionally followed by <code>:HANDLER</code></p></div><div><p>props : optional input, readable inside the component as <code>request.props</code></p></div><div></div></div><div class=\"doc-section\"><h3>Errors</h3><p>An unresolvable component does not raise an error. Bearer sets the response status to <code>500</code> and returns <code>false</code>. Rendering"
)
print(" continues.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">component_render(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Release notes&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(&quot;&lt;main&gt;&quot;)\ncomponent_render(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;First&quot;)\ncomponent_render(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Second&quot;)\nprint(&quot;&lt;/main&gt;&quot;, &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var rows := [&quot;Ada&quot;, &quot;Grace&quot;, &quot;Katherine&quot;]\nfor row := rows {\n component_render(&quot;/doc/examples/card.capy:CARD&quot;, title: row)\n}\nprint(&quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/component/\">component</a><a class=\"related-link\" href=\"/doc/api/component-resolve/\">component_resolve</a><a class=\"related-link\" href=\"/doc/handler/component/\">COMPONENT</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>component_render</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function component_render(name : string) bool\nfunction component_render(name : string, props : as dval) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>component_render()</code> renders a component and writes its output straight into the current response. It returns true when it renders the component. It returns false when it cannot resolve the component.</p><p>This is the form to reach for in page layouts. <code>component()</code> opens a capture buffer, collects everything the component prints, and hands you a string; <code>component_render()</code> skips that buffer entirely. When you are only going to print the result anyway, <code>component_render(&quot;card&quot;)</code> does less work than <code>print(component(&quot;card&quot;))</code>.</p><p>Use a capturing call instead when you need the output as a value — to measure it, wrap it, store it, or decide whether to emit it at all.</p><p>Name resolution, <code>:HANDLER</code> suffixes, props scoping, and <code>ONCE</code> behaviour are identical to <code>component()</code>; that page documents the rules in full.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>name : a component path, optionally followed by <code>:HANDLER</code></p></div><div><p>props : optional input, readable inside the component as <code>request.props</code></p></div><div></div></div><div class=\"doc-section\"><h3>Errors</h3><p>An unresolvable component does not raise an error. Bearer sets the response status to <code>500</code> and returns <code>false</code>. Rendering")
print(" continues.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">component_render(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Release notes&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(&quot;&lt;main&gt;&quot;)\ncomponent_render(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;First&quot;)\ncomponent_render(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Second&quot;)\nprint(&quot;&lt;/main&gt;&quot;, &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var rows := [&quot;Ada&quot;, &quot;Grace&quot;, &quot;Katherine&quot;]\nfor row := rows {\n component_render(&quot;/doc/examples/card.capy:CARD&quot;, title: row)\n}\nprint(&quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/component/\">component</a><a class=\"related-link\" href=\"/doc/api/component-resolve/\">component_resolve</a><a class=\"related-link\" href=\"/doc/handler/component/\">COMPONENT</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>component_resolve</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function component_resolve(name : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>component_resolve()</code> answers &quot;which file would <code>component()</code> actually load for this name?&quot;. It renders nothing and runs no handler.</p><p>This is the tool for debugging resolution. Because a relative name is tried against several directories in turn, the same string can mean different files depending on which unit is calling it, and the failure that follows is usually reported against the wrong place. Printing the resolved path shows you which candidate won.</p><h2>The order it searches</h2><p><code>.capy</code> is appended when the name has no suffix. A <code>:HANDLER</code> suffix does not affect the returned path.</p><p>A name starting with <code>/</code> is tried as a real filesystem path first, then as a path under the site root.</p><p>A relative name is tried against, in order:</p><ol><li><p>the directory of the entry unit handling the request</p></li><li><p>the directory of the unit calling <code>component_resolve()</code>, when that differs</p></li><li><p>the site root</p></li></ol><p>The first candidate that exists is returned. A candidate that resolves outside the site root is rejected, and the result is an empty string.</p><p>An empty return means that no component source file matches the name.</p><h2>Check whether a component exists</h2><p><code>if component_resolve(...)</code> is a compile error. A string has no <code>bool</code> constructor.</p><p>Use this test:</p><p>if length("
)
print("component_resolve(name)) &gt; 0 { ... }</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>name : a component path, optionally followed by <code>:HANDLER</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The absolute source path the name resolves to, or an empty string when nothing matches.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(component_resolve(&quot;/doc/examples/card&quot;), &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var resolved := component_resolve(&quot;card&quot;)\nif length(resolved) &gt; 0 { print(resolved, &quot;\\n&quot;) } else { print(&quot;unresolved\\n&quot;) }\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(component_resolve(&quot;/doc/examples/card.capy:CARD&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/component/\">component</a><a class=\"related-link\" href=\"/doc/api/component-render/\">component_render</a><a class=\"related-link\" href=\"/doc/handler/component/\">COMPONENT</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>component_resolve</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function component_resolve(name : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>component_resolve()</code> answers &quot;which file would <code>component()</code> actually load for this name?&quot;. It renders nothing and runs no handler.</p><p>This is the tool for debugging resolution. Because a relative name is tried against several directories in turn, the same string can mean different files depending on which unit is calling it, and the failure that follows is usually reported against the wrong place. Printing the resolved path shows you which candidate won.</p><h2>The order it searches</h2><p><code>.capy</code> is appended when the name has no suffix. A <code>:HANDLER</code> suffix does not affect the returned path.</p><p>A name starting with <code>/</code> is tried as a real filesystem path first, then as a path under the site root.</p><p>A relative name is tried against, in order:</p><ol><li><p>the directory of the entry unit handling the request</p></li><li><p>the directory of the unit calling <code>component_resolve()</code>, when that differs</p></li><li><p>the site root</p></li></ol><p>The first candidate that exists is returned. A candidate that resolves outside the site root is rejected, and the result is an empty string.</p><p>An empty return means that no component source file matches the name.</p><h2>Check whether a component exists</h2><p><code>if component_resolve(...)</code> is a compile error. A string has no <code>bool</code> constructor.</p><p>Use this test:</p><p>if length(")
print("component_resolve(name)) &gt; 0 { ... }</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>name : a component path, optionally followed by <code>:HANDLER</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The absolute source path the name resolves to, or an empty string when nothing matches.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(component_resolve(&quot;/doc/examples/card&quot;), &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var resolved := component_resolve(&quot;card&quot;)\nif length(resolved) &gt; 0 { print(resolved, &quot;\\n&quot;) } else { print(&quot;unresolved\\n&quot;) }\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(component_resolve(&quot;/doc/examples/card.capy:CARD&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/component/\">component</a><a class=\"related-link\" href=\"/doc/api/component-render/\">component_render</a><a class=\"related-link\" href=\"/doc/handler/component/\">COMPONENT</a></aside></div>")
}
+3 -6
View File
@@ -1,10 +1,7 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>component</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function component(name : string) string\nfunction component(name : string, props : as dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>component()</code> renders a component and returns everything it printed as a string.</p><p>It collects the output into a buffer, which costs something. Reach for <code>component_render()</code> instead when you are writing the fragment straight into the current response and never look at the string — it skips the buffer entirely, so <code>component_render(&quot;card&quot;)</code> does less work than <code>print(component(&quot;card&quot;))</code>.</p><p>Capture the string when the string is the goal: wrapping the fragment in surrounding markup, checking whether it produced anything before emitting a container, storing it in a <code>dval</code> beside other values, or emitting the same fragment more than once from one call.</p><h2>How a name resolves</h2><p>A name is a path with an optional <code>:HANDLER</code> suffix. Bearer appends <code>.capy</code> when the path has no suffix, so <code>&quot;card&quot;</code> and <code>&quot;card.capy&quot;</code> mean the same file.</p><p>A path that starts with <code>/</code> is tried first as a real filesystem path and then as a site-root path, so <code>&quot;/tests/capy-request-context.capy&quot;</code> means that file under the site root.</p><p>A relative path is tried against three directories, in order:</p><ol><li><p>the directory of the entry unit that is handling the request</p></li><li><p>the directory of the unit calling <code>c"
)
print("omponent()</code>, when that differs</p></li><li><p>the site root</p></li></ol><p>The first match wins. A resolved path that escapes the site root is rejected. Use <code>component_resolve()</code> to see which file a name reached. Test an optional name with <code>length(component_resolve(name)) &gt; 0</code> before you render it.</p><h2>Named handlers</h2><p><code>&quot;lib/widgets.capy:CARD&quot;</code> calls the <code>COMPONENT:CARD</code> handler in that file. A name that is only <code>&quot;:CARD&quot;</code> calls <code>COMPONENT:CARD</code> in the file that is currently rendering, which lets one file hold several related fragments.</p><p>A file with no named handler must define a plain <code>COMPONENT</code> handler.</p><h2>What the component sees</h2><p><code>props</code> arrives as <code>request.props</code>. It is swapped in for the duration of the call and restored when the component returns, so a component cannot disturb its caller&#39;s props, and nested components each read their own.</p><p>Relative paths inside the component resolve against the component&#39;s own file, not the caller&#39;s — a component in <code>lib/</code> can call <code>component(&quot;sibling&quot;)</code> and reach <code>lib/sibling.capy</code>.</p><p>The target unit&#39;s <code>ONCE</code> handler runs before the component handler the first time that unit is used in the request.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>name : a component path, optionally followed by <code>:HANDLER</code></p></div><div><p>props : optional input, readable inside the component as <code>request.props</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The component output as a string.</p></div><div class=\"doc-section\"><h3>Errors</h3><p>An unresolv"
)
print("able component does not raise an error. Bearer sets the response status to <code>500</code>, returns an empty string, and continues to render the page. Guard optional components with <code>length(component_resolve(name)) &gt; 0</code> when a missing file should not be an error.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(component(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Release notes&quot;), &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var body := component(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Ada&quot;)\nprint(&quot;&lt;section&gt;&quot;, body, &quot;&lt;/section&gt;&quot;, &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var titles := [&quot;Ada&quot;, &quot;Grace&quot;]\nfor title := titles {\n print(component(&quot;/doc/examples/card.capy:CARD&quot;, title: title))\n}\nprint(&quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">if length(component_resolve(&quot;/doc/examples/card.capy&quot;)) &gt; 0 {\n print(component(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Optional&quot;), &quot;\\n&quot;)\n} else {\n print(&quot;no card component\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/component-render/\">component_render</a><a class=\"related-link\" href=\"/doc/api/component-resolve/\">component_resolve</a><a class=\"related-link\" hre"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>component</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function component(name : string) string\nfunction component(name : string, props : as dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>component()</code> renders a component and returns everything it printed as a string.</p><p>It collects the output into a buffer, which costs something. Reach for <code>component_render()</code> instead when you are writing the fragment straight into the current response and never look at the string — it skips the buffer entirely, so <code>component_render(&quot;card&quot;)</code> does less work than <code>print(component(&quot;card&quot;))</code>.</p><p>Capture the string when the string is the goal: wrapping the fragment in surrounding markup, checking whether it produced anything before emitting a container, storing it in a <code>dval</code> beside other values, or emitting the same fragment more than once from one call.</p><h2>How a name resolves</h2><p>A name is a path with an optional <code>:HANDLER</code> suffix. Bearer appends <code>.capy</code> when the path has no suffix, so <code>&quot;card&quot;</code> and <code>&quot;card.capy&quot;</code> mean the same file.</p><p>A path that starts with <code>/</code> is tried first as a real filesystem path and then as a site-root path, so <code>&quot;/tests/capy-request-context.capy&quot;</code> means that file under the site root.</p><p>A relative path is tried against three directories, in order:</p><ol><li><p>the directory of the entry unit that is handling the request</p></li><li><p>the directory of the unit calling <code>c")
print("omponent()</code>, when that differs</p></li><li><p>the site root</p></li></ol><p>The first match wins. A resolved path that escapes the site root is rejected. Use <code>component_resolve()</code> to see which file a name reached. Test an optional name with <code>length(component_resolve(name)) &gt; 0</code> before you render it.</p><h2>Named handlers</h2><p><code>&quot;lib/widgets.capy:CARD&quot;</code> calls the <code>COMPONENT:CARD</code> handler in that file. A name that is only <code>&quot;:CARD&quot;</code> calls <code>COMPONENT:CARD</code> in the file that is currently rendering, which lets one file hold several related fragments.</p><p>A file with no named handler must define a plain <code>COMPONENT</code> handler.</p><h2>What the component sees</h2><p><code>props</code> arrives as <code>request.props</code>. It is swapped in for the duration of the call and restored when the component returns, so a component cannot disturb its caller&#39;s props, and nested components each read their own.</p><p>Relative paths inside the component resolve against the component&#39;s own file, not the caller&#39;s — a component in <code>lib/</code> can call <code>component(&quot;sibling&quot;)</code> and reach <code>lib/sibling.capy</code>.</p><p>The target unit&#39;s <code>ONCE</code> handler runs before the component handler the first time that unit is used in the request.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>name : a component path, optionally followed by <code>:HANDLER</code></p></div><div><p>props : optional input, readable inside the component as <code>request.props</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The component output as a string.</p></div><div class=\"doc-section\"><h3>Errors</h3><p>An unresolv")
print("able component does not raise an error. Bearer sets the response status to <code>500</code>, returns an empty string, and continues to render the page. Guard optional components with <code>length(component_resolve(name)) &gt; 0</code> when a missing file should not be an error.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(component(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Release notes&quot;), &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var body := component(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Ada&quot;)\nprint(&quot;&lt;section&gt;&quot;, body, &quot;&lt;/section&gt;&quot;, &quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var titles := [&quot;Ada&quot;, &quot;Grace&quot;]\nfor title := titles {\n print(component(&quot;/doc/examples/card.capy:CARD&quot;, title: title))\n}\nprint(&quot;\\n&quot;)\n</pre></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">if length(component_resolve(&quot;/doc/examples/card.capy&quot;)) &gt; 0 {\n print(component(&quot;/doc/examples/card.capy:CARD&quot;, title: &quot;Optional&quot;), &quot;\\n&quot;)\n} else {\n print(&quot;no card component\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/component-render/\">component_render</a><a class=\"related-link\" href=\"/doc/api/component-resolve/\">component_resolve</a><a class=\"related-link\" hre")
print("f=\"/doc/handler/component/\">COMPONENT</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>contains</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function contains(haystack : string, needle : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>contains()</code> checks for a substring.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>haystack : the string to search</p></div><div><p>needle : the substring to find</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if <code>needle</code> occurs in <code>haystack</code>. An empty <code>needle</code> matches.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">if contains(&quot;Capy docs&quot;, &quot;docs&quot;) { print(&quot;yes\\n&quot;) } else { print(&quot;no\\n&quot;) }\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/first/\">first</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/clone/\">clone</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a clas"
)
print("s=\"related-link\" href=\"/doc/api/str-ends-with/\">str_ends_with</a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>contains</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function contains(haystack : string, needle : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>contains()</code> checks for a substring.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>haystack : the string to search</p></div><div><p>needle : the substring to find</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if <code>needle</code> occurs in <code>haystack</code>. An empty <code>needle</code> matches.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">if contains(&quot;Capy docs&quot;, &quot;docs&quot;) { print(&quot;yes\\n&quot;) } else { print(&quot;no\\n&quot;) }\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/first/\">first</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/clone/\">clone</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a clas")
print("s=\"related-link\" href=\"/doc/api/str-ends-with/\">str_ends_with</a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>copysign</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function copysign(magnitude : f32, sign : f32) f32\nfunction copysign(magnitude : f64, sign : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>copysign()</code> copies the sign of <code>sign</code> to the magnitude of <code>magnitude</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>magnitude : the absolute value to use</p></div><div><p>sign : the value that supplies the sign</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A value with the magnitude of <code>magnitude</code> and the sign of <code>sign</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := copysign(2.0, -1.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"re"
)
print("lated-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>copysign</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function copysign(magnitude : f32, sign : f32) f32\nfunction copysign(magnitude : f64, sign : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>copysign()</code> copies the sign of <code>sign</code> to the magnitude of <code>magnitude</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>magnitude : the absolute value to use</p></div><div><p>sign : the value that supplies the sign</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A value with the magnitude of <code>magnitude</code> and the sign of <code>sign</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := copysign(2.0, -1.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"re")
print("lated-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">is_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>cos</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function cos(value : f32) f32\nfunction cos(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>cos()</code> returns the host math result for <code>value</code>.</p><p>This function uses a host call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := cos(2.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">i"
)
print("s_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>cos</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function cos(value : f32) f32\nfunction cos(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>cos()</code> returns the host math result for <code>value</code>.</p><p>This function uses a host call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := cos(2.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">i")
print("s_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+1 -2
View File
@@ -1,6 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>crypto_equal</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function crypto_equal(left : string, right : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>crypto_equal()</code> compares byte strings in constant time.</p><p>Use it to compare secrets such as HMACs and tokens. Do not use <code>==</code> to compare secrets.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>left : the expected byte string</p></div><div><p>right : the submitted byte string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if both byte strings are equal.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var expected := hmac_sha256(&quot;key&quot;, &quot;payload&quot;)\nif crypto_equal(expected, hmac_sha256(&quot;key&quot;, &quot;payload&quot;)) { print(&quot;valid\\n&quot;) } else { print(&quot;invalid\\n&quot;) }\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-operation/\">crypto_operation</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a></aside></di"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>crypto_equal</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function crypto_equal(left : string, right : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>crypto_equal()</code> compares byte strings in constant time.</p><p>Use it to compare secrets such as HMACs and tokens. Do not use <code>==</code> to compare secrets.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>left : the expected byte string</p></div><div><p>right : the submitted byte string</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if both byte strings are equal.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var expected := hmac_sha256(&quot;key&quot;, &quot;payload&quot;)\nif crypto_equal(expected, hmac_sha256(&quot;key&quot;, &quot;payload&quot;)) { print(&quot;valid\\n&quot;) } else { print(&quot;invalid\\n&quot;) }\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-operation/\">crypto_operation</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a></aside></di")
print("v>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>crypto_operation</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function crypto_operation(request : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>crypto_operation()</code> runs an ES256 operation from a DValue request.</p><p>Set <code>algorithm</code> to <code>&quot;ES256&quot;</code>. Set <code>operation</code> to <code>&quot;key_generate&quot;</code>, <code>&quot;jwt_sign&quot;</code>, <code>&quot;cbor_decode&quot;</code>, <code>&quot;cose_es256_parse&quot;</code>, or <code>&quot;es256_verify&quot;</code>.</p><p>The function validates the request before it runs the operation. It returns <code>{ok: false, error: &quot;invalid_request&quot;}</code> for an invalid request.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>request : an ES256 operation request map</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A response map with <code>ok</code>. A failed operation also has <code>error</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var result := crypto_operation(operation: &quot;cbor_decode&quot;, algorithm: &quot;ES256&quot;, cbor_base64url: &quot;ggFiaGk&quot;)\nprint(result.ok, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha"
)
print("256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>crypto_operation</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function crypto_operation(request : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>crypto_operation()</code> runs an ES256 operation from a DValue request.</p><p>Set <code>algorithm</code> to <code>&quot;ES256&quot;</code>. Set <code>operation</code> to <code>&quot;key_generate&quot;</code>, <code>&quot;jwt_sign&quot;</code>, <code>&quot;cbor_decode&quot;</code>, <code>&quot;cose_es256_parse&quot;</code>, or <code>&quot;es256_verify&quot;</code>.</p><p>The function validates the request before it runs the operation. It returns <code>{ok: false, error: &quot;invalid_request&quot;}</code> for an invalid request.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>request : an ES256 operation request map</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A response map with <code>ok</code>. A failed operation also has <code>error</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var result := crypto_operation(operation: &quot;cbor_decode&quot;, algorithm: &quot;ES256&quot;, cbor_base64url: &quot;ggFiaGk&quot;)\nprint(result.ok, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha")
print("256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_field</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_field(session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;, field_name : string = &quot;&quot;) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_field()</code> returns a hidden form input with the active CSRF token.</p><p>Use it in a form that changes state. Check the submitted value with <code>csrf_valid()</code> before you change state.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace</p></div><div><p>field<em>name : the form field name. The default is `token</em>name`.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An HTML hidden input with the active CSRF token.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var field := csrf_field(&quot;capy-doc-session&quot;, &quot;profile&quot;, &quot;csrf_token&quot;)\nprint(contains(field, &quot;type=\\&quot;hidden\\&quot;&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-token/\">csrf_token</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a><a class=\"related-link\" href=\"/doc/api/csrf-rotate/\">csrf_rotate</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_field</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_field(session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;, field_name : string = &quot;&quot;) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_field()</code> returns a hidden form input with the active CSRF token.</p><p>Use it in a form that changes state. Check the submitted value with <code>csrf_valid()</code> before you change state.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace</p></div><div><p>field<em>name : the form field name. The default is `token</em>name`.</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An HTML hidden input with the active CSRF token.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var field := csrf_field(&quot;capy-doc-session&quot;, &quot;profile&quot;, &quot;csrf_token&quot;)\nprint(contains(field, &quot;type=\\&quot;hidden\\&quot;&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-token/\">csrf_token</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a><a class=\"related-link\" href=\"/doc/api/csrf-rotate/\">csrf_rotate</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_rotate</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_rotate(session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_rotate()</code> removes the active CSRF token from a token namespace.</p><p>The next <code>csrf_token()</code> call creates a replacement token. Use it after a sensitive successful change.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace to clear</p></div><div></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var old_token := csrf_token(&quot;capy-doc-session&quot;)\ncsrf_rotate(&quot;capy-doc-session&quot;)\nvar new_token := csrf_token(&quot;capy-doc-session&quot;)\nprint(old_token != new_token, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-token/\">csrf_token</a><a class=\"related-link\" href=\"/doc/api/csrf-field/\">csrf_field</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_rotate</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_rotate(session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_rotate()</code> removes the active CSRF token from a token namespace.</p><p>The next <code>csrf_token()</code> call creates a replacement token. Use it after a sensitive successful change.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace to clear</p></div><div></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var old_token := csrf_token(&quot;capy-doc-session&quot;)\ncsrf_rotate(&quot;capy-doc-session&quot;)\nvar new_token := csrf_token(&quot;capy-doc-session&quot;)\nprint(old_token != new_token, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-token/\">csrf_token</a><a class=\"related-link\" href=\"/doc/api/csrf-field/\">csrf_field</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_token</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_token(session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_token()</code> returns a stable token for one session and token namespace.</p><p>Use the result in a hidden form field. Call <code>csrf_valid()</code> before you apply a browser-submitted change.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace in the session</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The active CSRF token.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var token := csrf_token(&quot;capy-doc-session&quot;)\nprint(length(token) &gt; 0, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-field/\">csrf_field</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a><a class=\"related-link\" href=\"/doc/api/csrf-rotate/\">csrf_rotate</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_token</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_token(session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_token()</code> returns a stable token for one session and token namespace.</p><p>Use the result in a hidden form field. Call <code>csrf_valid()</code> before you apply a browser-submitted change.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace in the session</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The active CSRF token.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var token := csrf_token(&quot;capy-doc-session&quot;)\nprint(length(token) &gt; 0, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-field/\">csrf_field</a><a class=\"related-link\" href=\"/doc/api/csrf-valid/\">csrf_valid</a><a class=\"related-link\" href=\"/doc/api/csrf-rotate/\">csrf_rotate</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_valid</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_valid(submitted : string, session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_valid()</code> checks a submitted CSRF token against the session token.</p><p>It does not create a missing token. Check the token before you apply a browser-submitted change.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>submitted : the value from the submitted form</p></div><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if <code>submitted</code> matches the active session token.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var token := csrf_token(&quot;capy-doc-session&quot;)\nprint(csrf_valid(token, &quot;capy-doc-session&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-token/\">csrf_token</a><a class=\"related-link\" href=\"/doc/api/csrf-field/\">csrf_field</a><a class=\"related-link\" href=\"/doc/api/csrf-rotate/\">csrf_rotate</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>csrf_valid</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function csrf_valid(submitted : string, session_name : string = &quot;bearer-session&quot;, token_name : string = &quot;csrf_token&quot;) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>csrf_valid()</code> checks a submitted CSRF token against the session token.</p><p>It does not create a missing token. Check the token before you apply a browser-submitted change.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>submitted : the value from the submitted form</p></div><div><p>session_name : the session and cookie name</p></div><div><p>token_name : the token namespace</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if <code>submitted</code> matches the active session token.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var token := csrf_token(&quot;capy-doc-session&quot;)\nprint(csrf_valid(token, &quot;capy-doc-session&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/csrf-token/\">csrf_token</a><a class=\"related-link\" href=\"/doc/api/csrf-field/\">csrf_field</a><a class=\"related-link\" href=\"/doc/api/csrf-rotate/\">csrf_rotate</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>cwd_get</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function cwd_get() string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>cwd_get()</code> returns the current working directory path.</p><p>Save this path before <code>cwd_set()</code> when you must restore the directory.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>The current working directory path.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(cwd_get() != &quot;&quot;, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/basename/\">basename</a><a class=\"related-link\" href=\"/doc/api/dirname/\">dirname</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-set/\">cwd_set</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>cwd_get</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function cwd_get() string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>cwd_get()</code> returns the current working directory path.</p><p>Save this path before <code>cwd_set()</code> when you must restore the directory.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>The current working directory path.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(cwd_get() != &quot;&quot;, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/basename/\">basename</a><a class=\"related-link\" href=\"/doc/api/dirname/\">dirname</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-set/\">cwd_set</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>cwd_set</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function cwd_set(path : string)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>cwd_set()</code> changes the worker process working directory.</p><p>Save the current directory with <code>cwd_get()</code>. Restore it after temporary use.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the new working directory path</p></div><div></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var old_path := cwd_get()\ncwd_set(&quot;/tmp&quot;)\nprint(cwd_get(), &quot;\\n&quot;)\ncwd_set(old_path)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/basename/\">basename</a><a class=\"related-link\" href=\"/doc/api/dirname/\">dirname</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-get/\">cwd_get</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>cwd_set</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function cwd_set(path : string)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>cwd_set()</code> changes the worker process working directory.</p><p>Save the current directory with <code>cwd_get()</code>. Restore it after temporary use.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the new working directory path</p></div><div></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var old_path := cwd_get()\ncwd_set(&quot;/tmp&quot;)\nprint(cwd_get(), &quot;\\n&quot;)\ncwd_set(old_path)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/basename/\">basename</a><a class=\"related-link\" href=\"/doc/api/dirname/\">dirname</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-get/\">cwd_get</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Delete a child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function delete(value : dval, key : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>delete(value, key)</code> removes <code>key</code> from <code>value</code>. A missing key leaves the value unchanged.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : target value</p></div><div><p>key : child key</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The changed target value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var user := dval({&quot;name&quot;: &quot;Ada&quot;, &quot;role&quot;: &quot;admin&quot;})\nuser = delete(user, &quot;role&quot;)\nprint(has(user, &quot;role&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a c"
)
print("lass=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Delete a child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function delete(value : dval, key : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>delete(value, key)</code> removes <code>key</code> from <code>value</code>. A missing key leaves the value unchanged.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : target value</p></div><div><p>key : child key</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The changed target value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var user := dval({&quot;name&quot;: &quot;Ada&quot;, &quot;role&quot;: &quot;admin&quot;})\nuser = delete(user, &quot;role&quot;)\nprint(has(user, &quot;role&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a c")
print("lass=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dir_list</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dir_list(path : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dir_list()</code> returns one map for each directory entry.</p><p>Each map has <code>name</code>, <code>type</code>, <code>size</code>, and <code>mtime</code>. The <code>type</code> value is <code>file</code>, <code>dir</code>, <code>symlink</code>, or <code>other</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the directory path to list</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>dval</code> list of entry maps.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var root := file_temp(&quot;/tmp/capy-doc-dir-list-&quot;)\nfile_unlink(root)\nmkdir(root)\nfile_put_contents(path_join(root, &quot;note.txt&quot;), &quot;hi&quot;)\nfor item, key := dir_list(root) { print(string(item.name), &quot;\\n&quot;) }\ndir_remove(root, true)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/ls/\">ls</a><a class=\"related-link\" href=\"/doc/api/mkdir/\">mkdir</a><a class=\"related-link\" href=\"/doc/api/dir-remove/\">dir_remove</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dir_list</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dir_list(path : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dir_list()</code> returns one map for each directory entry.</p><p>Each map has <code>name</code>, <code>type</code>, <code>size</code>, and <code>mtime</code>. The <code>type</code> value is <code>file</code>, <code>dir</code>, <code>symlink</code>, or <code>other</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the directory path to list</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>dval</code> list of entry maps.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var root := file_temp(&quot;/tmp/capy-doc-dir-list-&quot;)\nfile_unlink(root)\nmkdir(root)\nfile_put_contents(path_join(root, &quot;note.txt&quot;), &quot;hi&quot;)\nfor item, key := dir_list(root) { print(string(item.name), &quot;\\n&quot;) }\ndir_remove(root, true)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/ls/\">ls</a><a class=\"related-link\" href=\"/doc/api/mkdir/\">mkdir</a><a class=\"related-link\" href=\"/doc/api/dir-remove/\">dir_remove</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dir_remove</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dir_remove(path : string, recursive : bool = false) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dir_remove()</code> removes a directory.</p><p>Without <code>recursive</code>, the directory must be empty. With <code>recursive = true</code>, it removes every contained file and directory.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the directory path to remove</p></div><div><p>recursive : <code>true</code> removes the directory and its contents</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> on success.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var root := file_temp(&quot;/tmp/capy-doc-dir-remove-&quot;)\nfile_unlink(root)\nmkdir(root)\nfile_put_contents(path_join(root, &quot;child.txt&quot;), &quot;x&quot;)\nprint(dir_remove(root, true), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/ls/\">ls</a><a class=\"related-link\" href=\"/doc/api/dir-list/\">dir_list</a><a class=\"related-link\" href=\"/doc/api/mkdir/\">mkdir</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dir_remove</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dir_remove(path : string, recursive : bool = false) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dir_remove()</code> removes a directory.</p><p>Without <code>recursive</code>, the directory must be empty. With <code>recursive = true</code>, it removes every contained file and directory.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the directory path to remove</p></div><div><p>recursive : <code>true</code> removes the directory and its contents</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> on success.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var root := file_temp(&quot;/tmp/capy-doc-dir-remove-&quot;)\nfile_unlink(root)\nmkdir(root)\nfile_put_contents(path_join(root, &quot;child.txt&quot;), &quot;x&quot;)\nprint(dir_remove(root, true), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/ls/\">ls</a><a class=\"related-link\" href=\"/doc/api/dir-list/\">dir_list</a><a class=\"related-link\" href=\"/doc/api/mkdir/\">mkdir</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dirname</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dirname(path : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dirname()</code> removes the final component from a path string.</p><p>The function does not access the file system.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the path to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The directory part of the path.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(dirname(&quot;/var/www/site/index.capy&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/basename/\">basename</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-get/\">cwd_get</a><a class=\"related-link\" href=\"/doc/api/cwd-set/\">cwd_set</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dirname</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dirname(path : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dirname()</code> removes the final component from a path string.</p><p>The function does not access the file system.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : the path to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The directory part of the path.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(dirname(&quot;/var/www/site/index.capy&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/basename/\">basename</a><a class=\"related-link\" href=\"/doc/api/path-join/\">path_join</a><a class=\"related-link\" href=\"/doc/api/path-normalize/\">path_normalize</a><a class=\"related-link\" href=\"/doc/api/cwd-get/\">cwd_get</a><a class=\"related-link\" href=\"/doc/api/cwd-set/\">cwd_set</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>draw_float</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function draw_float(from : f64, to : f64, precision : f64 = 0.000000000001) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>draw_float()</code> returns the next floating-point value from the request random sequence.</p><p>Bearer uses the request random seed and advances the random index after each call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : the first range value</p></div><div><p>to : the second range value</p></div><div><p>precision : the output precision</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f64</code> value between the range values.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := draw_float(0.0, 1.0)\nprint(value &gt;= 0.0, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise/\">gen_noise</a><a class=\"related-link\" href=\"/doc/api/gen-noise64/\">gen_noise64</a><a class=\"related-link\" href=\"/doc/api/draw-int/\">draw_int</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>draw_float</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function draw_float(from : f64, to : f64, precision : f64 = 0.000000000001) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>draw_float()</code> returns the next floating-point value from the request random sequence.</p><p>Bearer uses the request random seed and advances the random index after each call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : the first range value</p></div><div><p>to : the second range value</p></div><div><p>precision : the output precision</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f64</code> value between the range values.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := draw_float(0.0, 1.0)\nprint(value &gt;= 0.0, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise/\">gen_noise</a><a class=\"related-link\" href=\"/doc/api/gen-noise64/\">gen_noise64</a><a class=\"related-link\" href=\"/doc/api/draw-int/\">draw_int</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>draw_int</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function draw_int(from : u64, to : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>draw_int()</code> returns the next integer value from the request random sequence.</p><p>Bearer uses the request random seed and advances the random index after each call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : the first range value</p></div><div><p>to : the second range value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>u64</code> value between the range values.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := draw_int(u64(1), u64(10))\nprint(value &gt;= u64(1), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise/\">gen_noise</a><a class=\"related-link\" href=\"/doc/api/gen-noise64/\">gen_noise64</a><a class=\"related-link\" href=\"/doc/api/draw-float/\">draw_float</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>draw_int</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function draw_int(from : u64, to : u64) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>draw_int()</code> returns the next integer value from the request random sequence.</p><p>Bearer uses the request random seed and advances the random index after each call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : the first range value</p></div><div><p>to : the second range value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>u64</code> value between the range values.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := draw_int(u64(1), u64(10))\nprint(value &gt;= u64(1), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise/\">gen_noise</a><a class=\"related-link\" href=\"/doc/api/gen-noise64/\">gen_noise64</a><a class=\"related-link\" href=\"/doc/api/draw-float/\">draw_float</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dval</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dval(value : string) dval\nfunction dval(value : s32) dval\nfunction dval(value : s64) dval\nfunction dval(value : u64) dval\nfunction dval(value : f64) dval\nfunction dval(value : bool) dval\nfunction dval(value : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dval()</code> converts a scalar or literal structure to a dynamic value.</p><p>Use it for request payloads and nested map or list data. Existing <code>dval</code> input stays a <code>dval</code> value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : a scalar, literal structure, or <code>dval</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>dval</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var profile := dval({name: &quot;Ada&quot;, scores: [1, 2, 3]})\nprint(string(profile.name), &quot; &quot;, length(profile.scores), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/bool/\">bool</a><a class=\"related-link\" href=\"/doc/type/s8/\">s8</a><a class=\"related-link\" href=\"/doc/type/s16/\">s16</a><a class=\"related-link\" href=\"/doc/type/s32/\">s32</a><a class=\"related-link\" href=\"/doc/type/s64/\">s64</a><a class=\"related-link\" href=\"/doc/type/u8/\">u8</a><a class=\"related-link\" href=\"/doc/type/u16/\">u16</a><a class=\"related-link\" href=\"/doc/type/u32/\">u32</a><a class=\"related-link\" href=\"/doc/type/u64/\">u64</a><a class=\"re"
)
print("lated-link\" href=\"/doc/type/f32/\">f32</a><a class=\"related-link\" href=\"/doc/type/f64/\">f64</a><a class=\"related-link\" href=\"/doc/api/string/\">string</a><a class=\"related-link\" href=\"/doc/type/struct/\">struct</a><a class=\"related-link\" href=\"/doc/type/array/\">array</a><a class=\"related-link\" href=\"/doc/type/function/\">function value</a><a class=\"related-link\" href=\"/doc/type/module/\">module</a><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>dval</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function dval(value : string) dval\nfunction dval(value : s32) dval\nfunction dval(value : s64) dval\nfunction dval(value : u64) dval\nfunction dval(value : f64) dval\nfunction dval(value : bool) dval\nfunction dval(value : dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>dval()</code> converts a scalar or literal structure to a dynamic value.</p><p>Use it for request payloads and nested map or list data. Existing <code>dval</code> input stays a <code>dval</code> value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : a scalar, literal structure, or <code>dval</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>dval</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var profile := dval({name: &quot;Ada&quot;, scores: [1, 2, 3]})\nprint(string(profile.name), &quot; &quot;, length(profile.scores), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/bool/\">bool</a><a class=\"related-link\" href=\"/doc/type/s8/\">s8</a><a class=\"related-link\" href=\"/doc/type/s16/\">s16</a><a class=\"related-link\" href=\"/doc/type/s32/\">s32</a><a class=\"related-link\" href=\"/doc/type/s64/\">s64</a><a class=\"related-link\" href=\"/doc/type/u8/\">u8</a><a class=\"related-link\" href=\"/doc/type/u16/\">u16</a><a class=\"related-link\" href=\"/doc/type/u32/\">u32</a><a class=\"related-link\" href=\"/doc/type/u64/\">u64</a><a class=\"re")
print("lated-link\" href=\"/doc/type/f32/\">f32</a><a class=\"related-link\" href=\"/doc/type/f64/\">f64</a><a class=\"related-link\" href=\"/doc/api/string/\">string</a><a class=\"related-link\" href=\"/doc/type/struct/\">struct</a><a class=\"related-link\" href=\"/doc/type/array/\">array</a><a class=\"related-link\" href=\"/doc/type/function/\">function value</a><a class=\"related-link\" href=\"/doc/type/module/\">module</a><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Call a function for each string</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function each(items : dval, callback : function(value : string) string)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>each</code> calls <code>callback</code> once for each item in a list-shaped <code>dval</code>.</p><p>The callback receives a string value. <code>each</code> processes items in list order.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns no value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var items := split(&quot;one,two&quot;, &quot;,&quot;)\neach(items, function(value : string) string { print(value); return &quot;&quot; })\nprint(&quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Call a function for each string</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function each(items : dval, callback : function(value : string) string)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>each</code> calls <code>callback</code> once for each item in a list-shaped <code>dval</code>.</p><p>The callback receives a string value. <code>each</code> processes items in list order.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns no value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var items := split(&quot;one,two&quot;, &quot;,&quot;)\neach(items, function(value : string) string { print(value); return &quot;&quot; })\nprint(&quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>encode_query</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function encode_query(map : dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>encode_query()</code> converts a map-shaped <code>dval</code> to a URL query string.</p><p>Pass the returned string after <code>?</code> in a URL.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>map : map-shaped <code>dval</code> of URL parameters</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>URL query string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var query := dval({&quot;name&quot;: &quot;Ada&quot;})\nprint(encode_query(query), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/parse-uri/\">parse_uri</a><a class=\"related-link\" href=\"/doc/api/parse-query/\">parse_query</a><a class=\"related-link\" href=\"/doc/api/redirect/\">redirect</a><a class=\"related-link\" href=\"/doc/how-to/read-request-context/\">read-request-context</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>encode_query</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function encode_query(map : dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>encode_query()</code> converts a map-shaped <code>dval</code> to a URL query string.</p><p>Pass the returned string after <code>?</code> in a URL.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>map : map-shaped <code>dval</code> of URL parameters</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>URL query string</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var query := dval({&quot;name&quot;: &quot;Ada&quot;})\nprint(encode_query(query), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/parse-uri/\">parse_uri</a><a class=\"related-link\" href=\"/doc/api/parse-query/\">parse_query</a><a class=\"related-link\" href=\"/doc/api/redirect/\">redirect</a><a class=\"related-link\" href=\"/doc/how-to/read-request-context/\">read-request-context</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Test every string</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function every(items : dval, predicate : function(value : string) bool) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>every</code> tests each string in a list-shaped <code>dval</code> with <code>predicate</code>.</p><p>This function does not change <code>items</code>.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns <code>true</code> when every item matches. It returns <code>true</code> for an empty list.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var items := split(&quot;one,two&quot;, &quot;,&quot;)\nprint(every(items, function(value : string) bool { return value != &quot;&quot; }), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Test every string</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function every(items : dval, predicate : function(value : string) bool) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>every</code> tests each string in a list-shaped <code>dval</code> with <code>predicate</code>.</p><p>This function does not change <code>items</code>.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns <code>true</code> when every item matches. It returns <code>true</code> for an empty list.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var items := split(&quot;one,two&quot;, &quot;,&quot;)\nprint(every(items, function(value : string) bool { return value != &quot;&quot; }), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>exp</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function exp(value : f32) f32\nfunction exp(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>exp()</code> returns the host math result for <code>value</code>.</p><p>This function uses a host call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := exp(2.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">i"
)
print("s_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>exp</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function exp(value : f32) f32\nfunction exp(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>exp()</code> returns the host math result for <code>value</code>.</p><p>This function uses a host call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := exp(2.0)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/floor/\">floor</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">i")
print("s_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>f32_from_bits</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function f32_from_bits(value : u32) f32</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>f32_from_bits()</code> reinterprets the bits of an integer as an <code>f32</code> value. It does not convert the numeric value.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the <code>u32</code> bit pattern</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> value with the bit pattern of <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := f32_from_bits(u32(0x3f800000))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" h"
)
print("ref=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>f32_from_bits</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function f32_from_bits(value : u32) f32</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>f32_from_bits()</code> reinterprets the bits of an integer as an <code>f32</code> value. It does not convert the numeric value.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the <code>u32</code> bit pattern</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> value with the bit pattern of <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := f32_from_bits(u32(0x3f800000))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related-link\" h")
print("ref=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f64-from-bits/\">f64_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>f64_from_bits</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function f64_from_bits(value : u64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>f64_from_bits()</code> reinterprets the bits of an integer as an <code>f64</code> value. It does not convert the numeric value.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the <code>u64</code> bit pattern</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f64</code> value with the bit pattern of <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := f64_from_bits(u64(0x3ff0000000000000))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related"
)
print("-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>f64_from_bits</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function f64_from_bits(value : u64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>f64_from_bits()</code> reinterprets the bits of an integer as an <code>f64</code> value. It does not convert the numeric value.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the <code>u64</code> bit pattern</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f64</code> value with the bit pattern of <code>value</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := f64_from_bits(u64(0x3ff0000000000000))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/bit-and/\">bit_and</a><a class=\"related-link\" href=\"/doc/api/bit-or/\">bit_or</a><a class=\"related-link\" href=\"/doc/api/bit-xor/\">bit_xor</a><a class=\"related-link\" href=\"/doc/api/bit-not/\">bit_not</a><a class=\"related-link\" href=\"/doc/api/bit-shl/\">bit_shl</a><a class=\"related-link\" href=\"/doc/api/bit-shr/\">bit_shr</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-left/\">bit_rotate_left</a><a class=\"related-link\" href=\"/doc/api/bit-rotate-right/\">bit_rotate_right</a><a class=\"related-link\" href=\"/doc/api/bit-count-lz/\">bit_count_lz</a><a class=\"related-link\" href=\"/doc/api/bit-count-tz/\">bit_count_tz</a><a class=\"related-link\" href=\"/doc/api/bit-count-1/\">bit_count_1</a><a class=\"related")
print("-link\" href=\"/doc/api/bits-of/\">bits_of</a><a class=\"related-link\" href=\"/doc/api/f32-from-bits/\">f32_from_bits</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_append</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_append(path : string, content : string) bool\nfunction file_append(path : string, first : string, second : string) bool\nfunction file_append(path : string, first : string, second : string, third : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_append</code> adds text to the end of a file. Use <code>file_put_contents</code> to replace a file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to update</p></div><div><p>content : text to append</p></div><div><p>first : first text value to append</p></div><div><p>second : second text value to append</p></div><div><p>third : third text value to append</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy appends the text. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_unlink(&quot;/tmp/doc-append.txt&quot;)\nfile_append(&quot;/tmp/doc-append.txt&quot;, &quot;a&quot;, &quot;b&quot;, &quot;c&quot;)\nprint(file_get_contents(&quot;/tmp/doc-append.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file"
)
print("_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_append</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_append(path : string, content : string) bool\nfunction file_append(path : string, first : string, second : string) bool\nfunction file_append(path : string, first : string, second : string, third : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_append</code> adds text to the end of a file. Use <code>file_put_contents</code> to replace a file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to update</p></div><div><p>content : text to append</p></div><div><p>first : first text value to append</p></div><div><p>second : second text value to append</p></div><div><p>third : third text value to append</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy appends the text. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_unlink(&quot;/tmp/doc-append.txt&quot;)\nfile_append(&quot;/tmp/doc-append.txt&quot;, &quot;a&quot;, &quot;b&quot;, &quot;c&quot;)\nprint(file_get_contents(&quot;/tmp/doc-append.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file")
print("_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_chmod</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_chmod(path : string, mode : s32) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_chmod</code> changes the permission bits of a path.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file or directory</p></div><div><p>mode : Unix permission bits as a decimal <code>s32</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy changes the mode. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-chmod.txt&quot;, &quot;secret&quot;)\nprint(file_chmod(&quot;/tmp/doc-chmod.txt&quot;, 384), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_trunca"
)
print("te</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_chmod</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_chmod(path : string, mode : s32) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_chmod</code> changes the permission bits of a path.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file or directory</p></div><div><p>mode : Unix permission bits as a decimal <code>s32</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy changes the mode. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-chmod.txt&quot;, &quot;secret&quot;)\nprint(file_chmod(&quot;/tmp/doc-chmod.txt&quot;, 384), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_trunca")
print("te</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_close</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_close(handle : u64)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_close</code> closes a handle from <code>file_open</code>. Close a handle after the final read or write.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : handle returned by <code>file_open</code></p></div><div></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-close.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;done&quot;)\nfile_close(handle)\nprint(file_get_contents(&quot;/tmp/doc-close.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_close</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_close(handle : u64)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_close</code> closes a handle from <code>file_open</code>. Close a handle after the final read or write.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : handle returned by <code>file_open</code></p></div><div></div></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-close.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;done&quot;)\nfile_close(handle)\nprint(file_get_contents(&quot;/tmp/doc-close.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_copy</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_copy(from : string, to : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_copy</code> copies a file to another path. The source path remains available after a successful copy.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : source path</p></div><div><p>to : destination path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy copies the file. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-copy-src.txt&quot;, &quot;payload&quot;)\nfile_copy(&quot;/tmp/doc-copy-src.txt&quot;, &quot;/tmp/doc-copy-dst.txt&quot;)\nprint(file_get_contents(&quot;/tmp/doc-copy-dst.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-tru"
)
print("ncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_copy</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_copy(from : string, to : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_copy</code> copies a file to another path. The source path remains available after a successful copy.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : source path</p></div><div><p>to : destination path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy copies the file. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-copy-src.txt&quot;, &quot;payload&quot;)\nfile_copy(&quot;/tmp/doc-copy-src.txt&quot;, &quot;/tmp/doc-copy-dst.txt&quot;)\nprint(file_get_contents(&quot;/tmp/doc-copy-dst.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-tru")
print("ncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_exists</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_exists(path : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_exists</code> tests for a regular file. It returns <code>false</code> for a directory. Use <code>file_stat</code> to inspect another path type.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path to test</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when a regular file exists. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-exists.txt&quot;, &quot;x&quot;)\nprint(file_exists(&quot;/tmp/doc-exists.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"rel"
)
print("ated-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_exists</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_exists(path : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_exists</code> tests for a regular file. It returns <code>false</code> for a directory. Use <code>file_stat</code> to inspect another path type.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path to test</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when a regular file exists. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-exists.txt&quot;, &quot;x&quot;)\nprint(file_exists(&quot;/tmp/doc-exists.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"rel")
print("ated-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_fsync</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_fsync(handle : u64) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_fsync</code> flushes pending writes for a handle. Call it before <code>file_close</code> when the file system must receive the writes first.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : writable handle returned by <code>file_open</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy flushes the handle. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-fsync.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;durable&quot;)\nprint(file_fsync(handle), &quot;\\n&quot;)\nfile_close(handle)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_fsync</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_fsync(handle : u64) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_fsync</code> flushes pending writes for a handle. Call it before <code>file_close</code> when the file system must receive the writes first.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : writable handle returned by <code>file_open</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy flushes the handle. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-fsync.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;durable&quot;)\nprint(file_fsync(handle), &quot;\\n&quot;)\nfile_close(handle)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_get_contents</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_get_contents(path : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_get_contents</code> reads a complete file into a string. Use it for a small file that fits in one value. Use <code>file_open</code> and <code>file_read</code> for incremental reads.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to read</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The file content, or <code>&quot;&quot;</code> when Capy cannot read the file.</p></div><div class=\"doc-section doc-callout note\"><h3>Note</h3><p>An empty file and an unreadable file both return <code>&quot;&quot;</code>. Use <code>file_exists</code> when you must distinguish them.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-get.txt&quot;, &quot;hello&quot;)\nprint(file_get_contents(&quot;/tmp/doc-get.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/d"
)
print("oc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_get_contents</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_get_contents(path : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_get_contents</code> reads a complete file into a string. Use it for a small file that fits in one value. Use <code>file_open</code> and <code>file_read</code> for incremental reads.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to read</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The file content, or <code>&quot;&quot;</code> when Capy cannot read the file.</p></div><div class=\"doc-section doc-callout note\"><h3>Note</h3><p>An empty file and an unreadable file both return <code>&quot;&quot;</code>. Use <code>file_exists</code> when you must distinguish them.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-get.txt&quot;, &quot;hello&quot;)\nprint(file_get_contents(&quot;/tmp/doc-get.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/d")
print("oc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a></aside></div>")
}
+1 -2
View File
@@ -1,6 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_mtime</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_mtime(path : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_mtime</code> returns the modification time of a file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The modification time as a Unix timestamp, or <code>0</code> when it is unavailable.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-mtime.txt&quot;, &quot;x&quot;)\nprint(file_mtime(&quot;/tmp/doc-mtime.txt&quot;) &gt; u64(0), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"rel"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_mtime</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_mtime(path : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_mtime</code> returns the modification time of a file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The modification time as a Unix timestamp, or <code>0</code> when it is unavailable.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-mtime.txt&quot;, &quot;x&quot;)\nprint(file_mtime(&quot;/tmp/doc-mtime.txt&quot;) &gt; u64(0), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"rel")
print("ated-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_open</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_open(path : string, mode : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_open</code> opens a file for incremental access. Use the handle with <code>file_read</code>, <code>file_write</code>, <code>file_seek</code>, and <code>file_close</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to open</p></div><div><p>mode : access mode, such as <code>&quot;r&quot;</code>, <code>&quot;w&quot;</code>, <code>&quot;a&quot;</code>, or <code>&quot;r+&quot;</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A file handle, or <code>u64(0)</code> when Capy cannot open the file.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-open.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;streamed&quot;)\nfile_close(handle)\nprint(file_get_contents(&quot;/tmp/doc-open.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_c"
)
print("lose</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_open</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_open(path : string, mode : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_open</code> opens a file for incremental access. Use the handle with <code>file_read</code>, <code>file_write</code>, <code>file_seek</code>, and <code>file_close</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to open</p></div><div><p>mode : access mode, such as <code>&quot;r&quot;</code>, <code>&quot;w&quot;</code>, <code>&quot;a&quot;</code>, or <code>&quot;r+&quot;</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A file handle, or <code>u64(0)</code> when Capy cannot open the file.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-open.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;streamed&quot;)\nfile_close(handle)\nprint(file_get_contents(&quot;/tmp/doc-open.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_c")
print("lose</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_pread</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_pread(handle : u64, offset : u64, length : u64) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_pread</code> reads at an absolute byte offset. It accepts a maximum length of 16 MiB. It does not change the handle position.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : readable handle returned by <code>file_open</code></p></div><div><p>offset : absolute byte offset</p></div><div><p>length : maximum number of bytes to read</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A string with up to <code>length</code> bytes.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var writer := file_open(&quot;/tmp/doc-pread.txt&quot;, &quot;w&quot;)\nfile_write(writer, &quot;hello world&quot;)\nfile_close(writer)\nvar reader := file_open(&quot;/tmp/doc-pread.txt&quot;, &quot;r&quot;)\nprint(file_pread(reader, u64(6), u64(5)), &quot;\\n&quot;)\nfile_close(reader)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_c"
)
print("lose</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_pread</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_pread(handle : u64, offset : u64, length : u64) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_pread</code> reads at an absolute byte offset. It accepts a maximum length of 16 MiB. It does not change the handle position.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : readable handle returned by <code>file_open</code></p></div><div><p>offset : absolute byte offset</p></div><div><p>length : maximum number of bytes to read</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A string with up to <code>length</code> bytes.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var writer := file_open(&quot;/tmp/doc-pread.txt&quot;, &quot;w&quot;)\nfile_write(writer, &quot;hello world&quot;)\nfile_close(writer)\nvar reader := file_open(&quot;/tmp/doc-pread.txt&quot;, &quot;r&quot;)\nprint(file_pread(reader, u64(6), u64(5)), &quot;\\n&quot;)\nfile_close(reader)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_c")
print("lose</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_put_contents</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_put_contents(path : string, content : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_put_contents</code> writes a complete string to a file. It creates or replaces a small file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to write</p></div><div><p>content : text that replaces the file content</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy writes the file. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-put.txt&quot;, &quot;first&quot;)\nfile_put_contents(&quot;/tmp/doc-put.txt&quot;, &quot;second&quot;)\nprint(file_get_contents(&quot;/tmp/doc-put.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/ap"
)
print("i/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_put_contents</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_put_contents(path : string, content : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_put_contents</code> writes a complete string to a file. It creates or replaces a small file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path of the file to write</p></div><div><p>content : text that replaces the file content</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when Capy writes the file. Otherwise, it returns <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-put.txt&quot;, &quot;first&quot;)\nfile_put_contents(&quot;/tmp/doc-put.txt&quot;, &quot;second&quot;)\nprint(file_get_contents(&quot;/tmp/doc-put.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/ap")
print("i/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a></aside></div>")
}
+1 -2
View File
@@ -1,6 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_pwrite</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_pwrite(handle : u64, offset : u64, data : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_pwrite</code> writes text at an absolute byte offset. It does not change the handle position.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : writable handle returned by <code>file_open</code></p></div><div><p>offset : absolute byte offset</p></div><div><p>data : text to write</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The number of bytes written.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-pwrite.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;hello world&quot;)\nfile_close(handle)\nvar editor := file_open(&quot;/tmp/doc-pwrite.txt&quot;, &quot;r+&quot;)\nfile_pwrite(editor, u64(6), &quot;earth&quot;)\nfile_close(editor)\nprint(file_get_contents(&quot;/tmp/doc-pwrite.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_pwrite</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_pwrite(handle : u64, offset : u64, data : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_pwrite</code> writes text at an absolute byte offset. It does not change the handle position.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : writable handle returned by <code>file_open</code></p></div><div><p>offset : absolute byte offset</p></div><div><p>data : text to write</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The number of bytes written.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-pwrite.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;hello world&quot;)\nfile_close(handle)\nvar editor := file_open(&quot;/tmp/doc-pwrite.txt&quot;, &quot;r+&quot;)\nfile_pwrite(editor, u64(6), &quot;earth&quot;)\nfile_close(editor)\nprint(file_get_contents(&quot;/tmp/doc-pwrite.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</")
print("a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_read</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_read(handle : u64, count : u64) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_read</code> reads from the current handle position. It accepts a maximum count of 16 MiB. It advances the position by the bytes read. It can return fewer bytes at the end of a file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : readable handle returned by <code>file_open</code></p></div><div><p>count : maximum number of bytes to read</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A string with up to <code>count</code> bytes from the current position.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var writer := file_open(&quot;/tmp/doc-read.txt&quot;, &quot;w&quot;)\nfile_write(writer, &quot;hello world&quot;)\nfile_close(writer)\nvar reader := file_open(&quot;/tmp/doc-read.txt&quot;, &quot;r&quot;)\nprint(file_read(reader, u64(5)), &quot;\\n&quot;)\nfile_close(reader)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\""
)
print(">file_close</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_read</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_read(handle : u64, count : u64) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_read</code> reads from the current handle position. It accepts a maximum count of 16 MiB. It advances the position by the bytes read. It can return fewer bytes at the end of a file.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : readable handle returned by <code>file_open</code></p></div><div><p>count : maximum number of bytes to read</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A string with up to <code>count</code> bytes from the current position.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var writer := file_open(&quot;/tmp/doc-read.txt&quot;, &quot;w&quot;)\nfile_write(writer, &quot;hello world&quot;)\nfile_close(writer)\nvar reader := file_open(&quot;/tmp/doc-read.txt&quot;, &quot;r&quot;)\nprint(file_read(reader, u64(5)), &quot;\\n&quot;)\nfile_close(reader)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\"")
print(">file_close</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_rename</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_rename(from : string, to : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_rename</code> changes a file path. The source path no longer exists after a successful call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : source path</p></div><div><p>to : destination path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if Capy renames the file. Otherwise, <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-rename-source.txt&quot;, &quot;moved&quot;)\nif file_rename(&quot;/tmp/doc-rename-source.txt&quot;, &quot;/tmp/doc-rename-destination.txt&quot;) {\n print(file_get_contents(&quot;/tmp/doc-rename-destination.txt&quot;), &quot;\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" hre"
)
print("f=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_rename</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_rename(from : string, to : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_rename</code> changes a file path. The source path no longer exists after a successful call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>from : source path</p></div><div><p>to : destination path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if Capy renames the file. Otherwise, <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-rename-source.txt&quot;, &quot;moved&quot;)\nif file_rename(&quot;/tmp/doc-rename-source.txt&quot;, &quot;/tmp/doc-rename-destination.txt&quot;) {\n print(file_get_contents(&quot;/tmp/doc-rename-destination.txt&quot;), &quot;\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" hre")
print("f=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_seek</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_seek(handle : u64, offset : s64, whence : s64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_seek</code> sets the position for file reads and writes.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : handle from <code>file_open</code></p></div><div><p>offset : byte offset</p></div><div><p>whence : <code>0</code> for the start, <code>1</code> for the current position, or <code>2</code> for the end</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The new byte offset. Returns <code>-1</code> on error.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-seek.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;hello world&quot;)\nfile_close(handle)\nhandle = file_open(&quot;/tmp/doc-seek.txt&quot;, &quot;r&quot;)\nfile_seek(handle, s64(6), s64(0))\nprint(file_read(handle, u64(5)), &quot;\\n&quot;)\nfile_close(handle)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_clo"
)
print("se</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_seek</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_seek(handle : u64, offset : s64, whence : s64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_seek</code> sets the position for file reads and writes.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : handle from <code>file_open</code></p></div><div><p>offset : byte offset</p></div><div><p>whence : <code>0</code> for the start, <code>1</code> for the current position, or <code>2</code> for the end</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The new byte offset. Returns <code>-1</code> on error.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-seek.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;hello world&quot;)\nfile_close(handle)\nhandle = file_open(&quot;/tmp/doc-seek.txt&quot;, &quot;r&quot;)\nfile_seek(handle, s64(6), s64(0))\nprint(file_read(handle, u64(5)), &quot;\\n&quot;)\nfile_close(handle)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_clo")
print("se</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_stat</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_stat(path : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_stat</code> returns metadata for a path. The result includes <code>exists</code>, <code>is_file</code>, <code>is_dir</code>, <code>is_symlink</code>, <code>size</code>, <code>mtime</code>, <code>ctime</code>, and <code>mode</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>dval</code> with file metadata.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-stat.txt&quot;, &quot;12345&quot;)\nvar stat := file_stat(&quot;/tmp/doc-stat.txt&quot;)\nprint(u64(stat[&quot;size&quot;]), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</"
)
print("a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_stat</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_stat(path : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_stat</code> returns metadata for a path. The result includes <code>exists</code>, <code>is_file</code>, <code>is_dir</code>, <code>is_symlink</code>, <code>size</code>, <code>mtime</code>, <code>ctime</code>, and <code>mode</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : path to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A <code>dval</code> with file metadata.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-stat.txt&quot;, &quot;12345&quot;)\nvar stat := file_stat(&quot;/tmp/doc-stat.txt&quot;)\nprint(u64(stat[&quot;size&quot;]), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</")
print("a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_symlink</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_symlink(target : string, linkpath : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_symlink</code> creates a symbolic link at <code>linkpath</code> that points to <code>target</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>target : path for the symbolic link</p></div><div><p>linkpath : path of the new symbolic link</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if Capy creates the link. Otherwise, <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-symlink-target.txt&quot;, &quot;data&quot;)\nfile_unlink(&quot;/tmp/doc-symlink-link.txt&quot;)\nif file_symlink(&quot;/tmp/doc-symlink-target.txt&quot;, &quot;/tmp/doc-symlink-link.txt&quot;) {\n print(file_get_contents(&quot;/tmp/doc-symlink-link.txt&quot;), &quot;\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink<"
)
print("/a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_symlink</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_symlink(target : string, linkpath : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_symlink</code> creates a symbolic link at <code>linkpath</code> that points to <code>target</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>target : path for the symbolic link</p></div><div><p>linkpath : path of the new symbolic link</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if Capy creates the link. Otherwise, <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-symlink-target.txt&quot;, &quot;data&quot;)\nfile_unlink(&quot;/tmp/doc-symlink-link.txt&quot;)\nif file_symlink(&quot;/tmp/doc-symlink-target.txt&quot;, &quot;/tmp/doc-symlink-link.txt&quot;) {\n print(file_get_contents(&quot;/tmp/doc-symlink-link.txt&quot;), &quot;\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink<")
print("/a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_tell</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_tell(handle : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_tell</code> returns the current position for a file handle.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : handle from <code>file_open</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The current byte offset.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-tell.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;hello&quot;)\nprint(file_tell(handle), &quot;\\n&quot;)\nfile_close(handle)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_tell</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_tell(handle : u64) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_tell</code> returns the current position for a file handle.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : handle from <code>file_open</code></p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The current byte offset.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-tell.txt&quot;, &quot;w&quot;)\nfile_write(handle, &quot;hello&quot;)\nprint(file_tell(handle), &quot;\\n&quot;)\nfile_close(handle)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-write/\">file_write</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_temp</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_temp(prefix : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_temp</code> creates an empty file with a unique suffix.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>prefix : path prefix for the temporary file</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The new empty file path. Returns <code>&quot;&quot;</code> on failure.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var path := file_temp(&quot;/tmp/doc-temp-&quot;)\nif path != &quot;&quot; {\n file_put_contents(path, &quot;scratch&quot;)\n print(file_get_contents(path), &quot;\\n&quot;)\n file_unlink(path)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" hr"
)
print("ef=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_temp</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_temp(prefix : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_temp</code> creates an empty file with a unique suffix.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>prefix : path prefix for the temporary file</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The new empty file path. Returns <code>&quot;&quot;</code> on failure.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var path := file_temp(&quot;/tmp/doc-temp-&quot;)\nif path != &quot;&quot; {\n file_put_contents(path, &quot;scratch&quot;)\n print(file_get_contents(path), &quot;\\n&quot;)\n file_unlink(path)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" hr")
print("ef=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_truncate</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_truncate(path : string, size : u64) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_truncate</code> sets a file length. A smaller length removes trailing bytes.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : file path</p></div><div><p>size : new file length in bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if Capy changes the file length. Otherwise, <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-truncate.txt&quot;, &quot;hello world&quot;)\nif file_truncate(&quot;/tmp/doc-truncate.txt&quot;, u64(5)) {\n print(file_get_contents(&quot;/tmp/doc-truncate.txt&quot;), &quot;\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a cla"
)
print("ss=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_truncate</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_truncate(path : string, size : u64) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_truncate</code> sets a file length. A smaller length removes trailing bytes.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : file path</p></div><div><p>size : new file length in bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> if Capy changes the file length. Otherwise, <code>false</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-truncate.txt&quot;, &quot;hello world&quot;)\nif file_truncate(&quot;/tmp/doc-truncate.txt&quot;, u64(5)) {\n print(file_get_contents(&quot;/tmp/doc-truncate.txt&quot;), &quot;\\n&quot;)\n}\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-unlink/\">file_unlink</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a cla")
print("ss=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_temp</a></aside></div>")
}
+1 -2
View File
@@ -1,6 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_unlink</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_unlink(path : string)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_unlink</code> removes a file. A missing path does not cause an error.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : file path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>No value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-unlink.txt&quot;, &quot;x&quot;)\nfile_unlink(&quot;/tmp/doc-unlink.txt&quot;)\nprint(file_exists(&quot;/tmp/doc-unlink.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_te"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_unlink</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_unlink(path : string)</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_unlink</code> removes a file. A missing path does not cause an error.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>path : file path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>No value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">file_put_contents(&quot;/tmp/doc-unlink.txt&quot;, &quot;x&quot;)\nfile_unlink(&quot;/tmp/doc-unlink.txt&quot;)\nprint(file_exists(&quot;/tmp/doc-unlink.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-get-contents/\">file_get_contents</a><a class=\"related-link\" href=\"/doc/api/file-put-contents/\">file_put_contents</a><a class=\"related-link\" href=\"/doc/api/file-append/\">file_append</a><a class=\"related-link\" href=\"/doc/api/file-exists/\">file_exists</a><a class=\"related-link\" href=\"/doc/api/file-mtime/\">file_mtime</a><a class=\"related-link\" href=\"/doc/api/file-stat/\">file_stat</a><a class=\"related-link\" href=\"/doc/api/file-rename/\">file_rename</a><a class=\"related-link\" href=\"/doc/api/file-copy/\">file_copy</a><a class=\"related-link\" href=\"/doc/api/file-truncate/\">file_truncate</a><a class=\"related-link\" href=\"/doc/api/file-chmod/\">file_chmod</a><a class=\"related-link\" href=\"/doc/api/file-symlink/\">file_symlink</a><a class=\"related-link\" href=\"/doc/api/file-temp/\">file_te")
print("mp</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_write</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_write(handle : u64, value : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_write</code> writes bytes at the current handle position. It advances the position.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : writable handle from <code>file_open</code></p></div><div><p>value : bytes to write</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The number of bytes written.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-write.txt&quot;, &quot;w&quot;)\nvar count := file_write(handle, &quot;hello&quot;)\nfile_close(handle)\nprint(count, &quot; &quot;, file_get_contents(&quot;/tmp/doc-write.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>file_write</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function file_write(handle : u64, value : string) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>file_write</code> writes bytes at the current handle position. It advances the position.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>handle : writable handle from <code>file_open</code></p></div><div><p>value : bytes to write</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The number of bytes written.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var handle := file_open(&quot;/tmp/doc-write.txt&quot;, &quot;w&quot;)\nvar count := file_write(handle, &quot;hello&quot;)\nfile_close(handle)\nprint(count, &quot; &quot;, file_get_contents(&quot;/tmp/doc-write.txt&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/file-open/\">file_open</a><a class=\"related-link\" href=\"/doc/api/file-read/\">file_read</a><a class=\"related-link\" href=\"/doc/api/file-pread/\">file_pread</a><a class=\"related-link\" href=\"/doc/api/file-pwrite/\">file_pwrite</a><a class=\"related-link\" href=\"/doc/api/file-seek/\">file_seek</a><a class=\"related-link\" href=\"/doc/api/file-tell/\">file_tell</a><a class=\"related-link\" href=\"/doc/api/file-close/\">file_close</a><a class=\"related-link\" href=\"/doc/api/file-fsync/\">file_fsync</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Filter strings</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function filter(items : dval, predicate : function(value : string) bool) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>filter</code> keeps the strings for which <code>predicate</code> returns <code>true</code>.</p><p>The result keeps input order. This function does not change <code>items</code>.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns a new list-shaped <code>dval</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var items := split(&quot;one,two&quot;, &quot;,&quot;)\nvar kept := filter(items, function(value : string) bool { return value == &quot;two&quot; })\nprint(join(kept, &quot;,&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Filter strings</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function filter(items : dval, predicate : function(value : string) bool) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>filter</code> keeps the strings for which <code>predicate</code> returns <code>true</code>.</p><p>The result keeps input order. This function does not change <code>items</code>.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns a new list-shaped <code>dval</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var items := split(&quot;one,two&quot;, &quot;,&quot;)\nvar kept := filter(items, function(value : string) bool { return value == &quot;two&quot; })\nprint(join(kept, &quot;,&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/find/\">find</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Find text in a string</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function find(haystack : string, needle : string) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>find</code> searches a string for another string.</p><p>For a list-shaped <code>dval</code>, use <code>some</code> to test for a matching item.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns the byte position of <code>needle</code>. It returns <code>-1</code> when it does not find <code>needle</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(find(&quot;one,two&quot;, &quot;two&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Find text in a string</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function find(haystack : string, needle : string) s64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>find</code> searches a string for another string.</p><p>For a list-shaped <code>dval</code>, use <code>some</code> to test for a matching item.</p></div><div class=\"doc-section\"><h3>Return Values</h3><p>This function returns the byte position of <code>needle</code>. It returns <code>-1</code> when it does not find <code>needle</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(find(&quot;one,two&quot;, &quot;two&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/length/\">length</a><a class=\"related-link\" href=\"/doc/api/array-merge/\">array_merge</a><a class=\"related-link\" href=\"/doc/api/map/\">map</a><a class=\"related-link\" href=\"/doc/api/filter/\">filter</a><a class=\"related-link\" href=\"/doc/api/each/\">each</a><a class=\"related-link\" href=\"/doc/api/some/\">some</a><a class=\"related-link\" href=\"/doc/api/every/\">every</a><a class=\"related-link\" href=\"/doc/api/sort/\">sort</a><a class=\"related-link\" href=\"/doc/api/unique/\">unique</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>first</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function first() string\nfunction first(one : string) string\nfunction first(one : string, two : string) string\nfunction first(one : string, two : string, three : string) string\nfunction first(one : string, two : string, three : string, four : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>first</code> checks values in order. It ignores values that contain only whitespace.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>one : first value</p></div><div><p>two : second value</p></div><div><p>three : third value</p></div><div><p>four : fourth value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The first nonblank value. Returns <code>&quot;&quot;</code> if no value is nonblank.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(first(&quot;&quot;, &quot; &quot;, &quot;fallback&quot;, &quot;other&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/contains/\">contains</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><"
)
print("a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/clone/\">clone</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a class=\"related-link\" href=\"/doc/api/str-ends-with/\">str_ends_with</a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>first</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function first() string\nfunction first(one : string) string\nfunction first(one : string, two : string) string\nfunction first(one : string, two : string, three : string) string\nfunction first(one : string, two : string, three : string, four : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>first</code> checks values in order. It ignores values that contain only whitespace.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>one : first value</p></div><div><p>two : second value</p></div><div><p>three : third value</p></div><div><p>four : fourth value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The first nonblank value. Returns <code>&quot;&quot;</code> if no value is nonblank.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(first(&quot;&quot;, &quot; &quot;, &quot;fallback&quot;, &quot;other&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/string/\">String</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/substr/\">substr</a><a class=\"related-link\" href=\"/doc/api/strpos/\">strpos</a><a class=\"related-link\" href=\"/doc/api/contains/\">contains</a><a class=\"related-link\" href=\"/doc/api/replace/\">replace</a><a class=\"related-link\" href=\"/doc/api/trim/\">trim</a><")
print("a class=\"related-link\" href=\"/doc/api/join/\">join</a><a class=\"related-link\" href=\"/doc/api/nibble/\">nibble</a><a class=\"related-link\" href=\"/doc/api/clone/\">clone</a><a class=\"related-link\" href=\"/doc/api/str-starts-with/\">str_starts_with</a><a class=\"related-link\" href=\"/doc/api/str-ends-with/\">str_ends_with</a><a class=\"related-link\" href=\"/doc/api/lower/\">lower</a><a class=\"related-link\" href=\"/doc/api/upper/\">upper</a><a class=\"related-link\" href=\"/doc/api/safe-name/\">safe_name</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>floor</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function floor(value : f32) f32\nfunction floor(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>floor()</code> returns the result for <code>value</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := floor(2.5)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">i"
)
print("s_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>floor</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function floor(value : f32) f32\nfunction floor(value : f64) f64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>floor()</code> returns the result for <code>value</code>.</p><p>The compiler emits a direct lib call.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : the input value</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>An <code>f32</code> or <code>f64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := floor(2.5)\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/sqrt/\">sqrt</a><a class=\"related-link\" href=\"/doc/api/abs/\">abs</a><a class=\"related-link\" href=\"/doc/api/neg/\">neg</a><a class=\"related-link\" href=\"/doc/api/ceil/\">ceil</a><a class=\"related-link\" href=\"/doc/api/trunc/\">trunc</a><a class=\"related-link\" href=\"/doc/api/nearest/\">nearest</a><a class=\"related-link\" href=\"/doc/api/min/\">min</a><a class=\"related-link\" href=\"/doc/api/max/\">max</a><a class=\"related-link\" href=\"/doc/api/copysign/\">copysign</a><a class=\"related-link\" href=\"/doc/api/pow/\">pow</a><a class=\"related-link\" href=\"/doc/api/log/\">log</a><a class=\"related-link\" href=\"/doc/api/exp/\">exp</a><a class=\"related-link\" href=\"/doc/api/sin/\">sin</a><a class=\"related-link\" href=\"/doc/api/cos/\">cos</a><a class=\"related-link\" href=\"/doc/api/atan2/\">atan2</a><a class=\"related-link\" href=\"/doc/api/is-nan/\">i")
print("s_nan</a><a class=\"related-link\" href=\"/doc/api/is-infinite/\">is_infinite</a><a class=\"related-link\" href=\"/doc/api/is-finite/\">is_finite</a><a class=\"related-link\" href=\"/doc/api/clamp/\">clamp</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>flush_output</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function flush_output() bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>flush_output()</code> sends the primary output buffer to the host and clears the buffer.\nIt returns <code>true</code> when the host accepts the bytes.\nIt returns <code>false</code> for a WebSocket handler because WebSocket output uses <code>ws_send()</code> and <code>ws_close()</code>.\nAn empty buffer returns <code>true</code> and remains empty.\nOutput after the call keeps its order after the flushed bytes.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(&quot;first\\n&quot;)\nflush_output()\nprint(&quot;second\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/print/\">print</a><a class=\"related-link\" href=\"/doc/api/ob-start/\">ob_start</a><a class=\"related-link\" href=\"/doc/api/ob-get/\">ob_get</a><a class=\"related-link\" href=\"/doc/api/ob-get-close/\">ob_get_close</a><a class=\"related-link\" href=\"/doc/api/ob-close/\">ob_close</a><a class=\"related-link\" href=\"/doc/api/var-dump/\">var_dump</a><a class=\"related-link\" href=\"/doc/api/ws-send/\">ws_send</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>flush_output</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function flush_output() bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>flush_output()</code> sends the primary output buffer to the host and clears the buffer.\nIt returns <code>true</code> when the host accepts the bytes.\nIt returns <code>false</code> for a WebSocket handler because WebSocket output uses <code>ws_send()</code> and <code>ws_close()</code>.\nAn empty buffer returns <code>true</code> and remains empty.\nOutput after the call keeps its order after the flushed bytes.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(&quot;first\\n&quot;)\nflush_output()\nprint(&quot;second\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/print/\">print</a><a class=\"related-link\" href=\"/doc/api/ob-start/\">ob_start</a><a class=\"related-link\" href=\"/doc/api/ob-get/\">ob_get</a><a class=\"related-link\" href=\"/doc/api/ob-get-close/\">ob_get_close</a><a class=\"related-link\" href=\"/doc/api/ob-close/\">ob_close</a><a class=\"related-link\" href=\"/doc/api/var-dump/\">var_dump</a><a class=\"related-link\" href=\"/doc/api/ws-send/\">ws_send</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gen_noise</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gen_noise(min : any, max : min::type, index : u64, seed : u64) min::type</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gen_noise()</code> returns deterministic noise for the range values, index, and seed.</p><p>Only <code>u64</code> and <code>f64</code> bounds are supported. Integer bounds are inclusive.</p><p>Float generation uses the existing fixed precision. The function does not accept a precision parameter.</p><p>Use the same inputs to reproduce a value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>min : first range value</p></div><div><p>max : second range value</p></div><div><p>index : deterministic input position</p></div><div><p>seed : deterministic input seed</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A deterministic value with the same type as <code>min</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var integer := gen_noise(u64(1), u64(10), u64(1), u64(2))\nvar floating := gen_noise(0.0, 1.0, u64(1), u64(2))\nprint(integer, &quot; &quot;, floating, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise64/\">gen_noise64</a><a class=\"related-link\" href=\"/doc/api/draw-int/\">draw_int</a><a class=\"related-link\" href=\"/doc/api/draw-float/\">draw_float</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gen_noise</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gen_noise(min : any, max : min::type, index : u64, seed : u64) min::type</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gen_noise()</code> returns deterministic noise for the range values, index, and seed.</p><p>Only <code>u64</code> and <code>f64</code> bounds are supported. Integer bounds are inclusive.</p><p>Float generation uses the existing fixed precision. The function does not accept a precision parameter.</p><p>Use the same inputs to reproduce a value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>min : first range value</p></div><div><p>max : second range value</p></div><div><p>index : deterministic input position</p></div><div><p>seed : deterministic input seed</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A deterministic value with the same type as <code>min</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var integer := gen_noise(u64(1), u64(10), u64(1), u64(2))\nvar floating := gen_noise(0.0, 1.0, u64(1), u64(2))\nprint(integer, &quot; &quot;, floating, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise64/\">gen_noise64</a><a class=\"related-link\" href=\"/doc/api/draw-int/\">draw_int</a><a class=\"related-link\" href=\"/doc/api/draw-float/\">draw_float</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gen_noise64</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gen_noise64(index : u64, seed : u64 = 0) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gen_noise64()</code> returns deterministic integer noise for an index and seed.</p><p>Use the same inputs to reproduce a value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>index : deterministic input position</p></div><div><p>seed : deterministic input seed</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A deterministic <code>u64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := gen_noise64(u64(1), u64(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise/\">gen_noise</a><a class=\"related-link\" href=\"/doc/api/draw-int/\">draw_int</a><a class=\"related-link\" href=\"/doc/api/draw-float/\">draw_float</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gen_noise64</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gen_noise64(index : u64, seed : u64 = 0) u64</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gen_noise64()</code> returns deterministic integer noise for an index and seed.</p><p>Use the same inputs to reproduce a value.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>index : deterministic input position</p></div><div><p>seed : deterministic input seed</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A deterministic <code>u64</code> value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value := gen_noise64(u64(1), u64(2))\nprint(value, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/gen-noise/\">gen_noise</a><a class=\"related-link\" href=\"/doc/api/draw-int/\">draw_int</a><a class=\"related-link\" href=\"/doc/api/draw-float/\">draw_float</a><a class=\"related-link\" href=\"/doc/api/random-bytes/\">random_bytes</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gen_sha1</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gen_sha1(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gen_sha1()</code> returns 20 raw SHA-1 bytes. Use <code>hex(gen_sha1(value))</code> when you need lowercase hexadecimal text.</p><p>Use it only for SHA-1 compatibility.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : bytes to hash</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Raw 20-byte SHA-1 digest.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(hex(gen_sha1(&quot;abc&quot;)), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a><a class=\"related-link\" href=\"/doc/api/crypto-operation/\">crypto_operation</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gen_sha1</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gen_sha1(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gen_sha1()</code> returns 20 raw SHA-1 bytes. Use <code>hex(gen_sha1(value))</code> when you need lowercase hexadecimal text.</p><p>Use it only for SHA-1 compatibility.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : bytes to hash</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Raw 20-byte SHA-1 digest.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(hex(gen_sha1(&quot;abc&quot;)), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a><a class=\"related-link\" href=\"/doc/api/crypto-operation/\">crypto_operation</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get a child by path</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get_by_path(value : dval, path : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get_by_path(value, path)</code> reads a nested child without creating nodes. Use a slash between path segments.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : source value</p></div><div><p>path : slash-separated child path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The copied child, or an empty string value when the path fails.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var config := dval({&quot;site&quot;: {&quot;title&quot;: &quot;Bearer&quot;}})\nprint(get_by_path(config, &quot;site/title&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get"
)
print("_type_name</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get a child by path</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get_by_path(value : dval, path : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get_by_path(value, path)</code> reads a nested child without creating nodes. Use a slash between path segments.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : source value</p></div><div><p>path : slash-separated child path</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The copied child, or an empty string value when the path fails.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var config := dval({&quot;site&quot;: {&quot;title&quot;: &quot;Bearer&quot;}})\nprint(get_by_path(config, &quot;site/title&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get")
print("_type_name</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get or create a child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get_or_create(value : dval, key : string, default : as dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get_or_create(value, key, default)</code> stores <code>default</code> when <code>key</code> is missing. It changes and returns <code>value</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : target value</p></div><div><p>key : child key</p></div><div><p>default : value to store when the child is missing</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The target value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var config := dval({})\nconfig = get_or_create(config, &quot;host&quot;, &quot;localhost&quot;)\nprint(config.host, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-"
)
print("link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get or create a child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get_or_create(value : dval, key : string, default : as dval) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get_or_create(value, key, default)</code> stores <code>default</code> when <code>key</code> is missing. It changes and returns <code>value</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : target value</p></div><div><p>key : child key</p></div><div><p>default : value to store when the child is missing</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The target value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var config := dval({})\nconfig = get_or_create(config, &quot;host&quot;, &quot;localhost&quot;)\nprint(config.host, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-")
print("link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get a dynamic value type name</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get_type_name(value : dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get_type_name(value)</code> reports the internal kind currently stored in a <code>dval</code>. Both maps and lists report <code>array</code>. A callable reports <code>unknown</code>.</p><p>This function is different from <code>expression::type_name</code>. The expression form reports the resolved static Capy type. A value with static type <code>dval</code> always reports <code>dval</code>, even when it currently stores a string.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : value to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>One of <code>String</code>, <code>f64</code>, <code>bool</code>, <code>array</code>, <code>none</code>, <code>pointer</code>, <code>reference</code>, or <code>unknown</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value : dval = dval(&quot;text&quot;)\nprint(value::type_name, &quot; &quot;, get_type_name(value), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">c"
)
print("lear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a><a class=\"related-link\" href=\"/doc/guide/values-and-types/\">3. Types</a><a class=\"related-link\" href=\"/doc/type/struct/\">struct</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get a dynamic value type name</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get_type_name(value : dval) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get_type_name(value)</code> reports the internal kind currently stored in a <code>dval</code>. Both maps and lists report <code>array</code>. A callable reports <code>unknown</code>.</p><p>This function is different from <code>expression::type_name</code>. The expression form reports the resolved static Capy type. A value with static type <code>dval</code> always reports <code>dval</code>, even when it currently stores a string.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : value to inspect</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>One of <code>String</code>, <code>f64</code>, <code>bool</code>, <code>array</code>, <code>none</code>, <code>pointer</code>, <code>reference</code>, or <code>unknown</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var value : dval = dval(&quot;text&quot;)\nprint(value::type_name, &quot; &quot;, get_type_name(value), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">c")
print("lear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a><a class=\"related-link\" href=\"/doc/guide/values-and-types/\">3. Types</a><a class=\"related-link\" href=\"/doc/type/struct/\">struct</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get a named child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get(value : dval, key : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get(value, key)</code> reads a named child without creating it. It returns <code>none</code> for a missing key or a scalar.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : source value</p></div><div><p>key : child key</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The copied child, or <code>none</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var user := dval({&quot;email&quot;: &quot;ada@example.test&quot;})\nprint(get(user, &quot;email&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-link\" href=\"/doc/api"
)
print("/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Get a named child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function get(value : dval, key : string) dval</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>get(value, key)</code> reads a named child without creating it. It returns <code>none</code> for a missing key or a scalar.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : source value</p></div><div><p>key : child key</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>The copied child, or <code>none</code>.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var user := dval({&quot;email&quot;: &quot;ada@example.test&quot;})\nprint(get(user, &quot;email&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/has/\">has</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-link\" href=\"/doc/api")
print("/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gz_compress</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gz_compress(source : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gz_compress()</code> compresses a string with gzip.</p><p>The result contains binary data. Pass it to <code>gz_uncompress()</code> to restore the source.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>source : uncompressed bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Gzip-compressed bytes as a string.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var source := &quot;archive data&quot;\nvar packed := gz_compress(source)\nprint(gz_uncompress(packed), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/zip-create/\">zip_create</a><a class=\"related-link\" href=\"/doc/api/zip-list/\">zip_list</a><a class=\"related-link\" href=\"/doc/api/zip-read/\">zip_read</a><a class=\"related-link\" href=\"/doc/api/zip-extract/\">zip_extract</a><a class=\"related-link\" href=\"/doc/api/gz-uncompress/\">gz_uncompress</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gz_compress</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gz_compress(source : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gz_compress()</code> compresses a string with gzip.</p><p>The result contains binary data. Pass it to <code>gz_uncompress()</code> to restore the source.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>source : uncompressed bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Gzip-compressed bytes as a string.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var source := &quot;archive data&quot;\nvar packed := gz_compress(source)\nprint(gz_uncompress(packed), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/zip-create/\">zip_create</a><a class=\"related-link\" href=\"/doc/api/zip-list/\">zip_list</a><a class=\"related-link\" href=\"/doc/api/zip-read/\">zip_read</a><a class=\"related-link\" href=\"/doc/api/zip-extract/\">zip_extract</a><a class=\"related-link\" href=\"/doc/api/gz-uncompress/\">gz_uncompress</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gz_uncompress</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gz_uncompress(source : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gz_uncompress()</code> uncompresses gzip data from a string.</p><p>Use it with data from <code>gz_compress()</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>source : gzip-compressed bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Uncompressed bytes as a string.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var packed := gz_compress(&quot;archive data&quot;)\nvar source := gz_uncompress(packed)\nprint(source, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/zip-create/\">zip_create</a><a class=\"related-link\" href=\"/doc/api/zip-list/\">zip_list</a><a class=\"related-link\" href=\"/doc/api/zip-read/\">zip_read</a><a class=\"related-link\" href=\"/doc/api/zip-extract/\">zip_extract</a><a class=\"related-link\" href=\"/doc/api/gz-compress/\">gz_compress</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>gz_uncompress</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function gz_uncompress(source : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>gz_uncompress()</code> uncompresses gzip data from a string.</p><p>Use it with data from <code>gz_compress()</code>.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>source : gzip-compressed bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Uncompressed bytes as a string.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var packed := gz_compress(&quot;archive data&quot;)\nvar source := gz_uncompress(packed)\nprint(source, &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/zip-create/\">zip_create</a><a class=\"related-link\" href=\"/doc/api/zip-list/\">zip_list</a><a class=\"related-link\" href=\"/doc/api/zip-read/\">zip_read</a><a class=\"related-link\" href=\"/doc/api/zip-extract/\">zip_extract</a><a class=\"related-link\" href=\"/doc/api/gz-compress/\">gz_compress</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Test for a child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>has(value : dval, key : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>has(value, key)</code> tests for a child without creating it. It returns <code>false</code> for a missing key or a scalar.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : value to test</p></div><div><p>key : child key</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when the key exists.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var user := dval({&quot;name&quot;: &quot;Ada&quot;})\nprint(has(user, &quot;name&quot;), &quot; &quot;, has(user, &quot;age&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-lin"
)
print("k\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>Test for a child</h2><span class=\"call-boundary lib-call\">lib call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>has(value : dval, key : string) bool</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>has(value, key)</code> tests for a child without creating it. It returns <code>false</code> for a missing key or a scalar.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : value to test</p></div><div><p>key : child key</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p><code>true</code> when the key exists.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">var user := dval({&quot;name&quot;: &quot;Ada&quot;})\nprint(has(user, &quot;name&quot;), &quot; &quot;, has(user, &quot;age&quot;), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/type/dvalue/\">Dynamic values</a><a class=\"related-link\" href=\"/doc/api/get/\">get</a><a class=\"related-link\" href=\"/doc/api/set/\">set</a><a class=\"related-link\" href=\"/doc/api/delete/\">delete</a><a class=\"related-link\" href=\"/doc/api/clear/\">clear</a><a class=\"related-link\" href=\"/doc/api/push/\">push</a><a class=\"related-link\" href=\"/doc/api/pop/\">pop</a><a class=\"related-link\" href=\"/doc/api/keys/\">keys</a><a class=\"related-link\" href=\"/doc/api/values/\">values</a><a class=\"related-link\" href=\"/doc/api/get-by-path/\">get_by_path</a><a class=\"related-link\" href=\"/doc/api/get-or-create/\">get_or_create</a><a class=\"related-link\" href=\"/doc/api/get-type-name/\">get_type_name</a><a class=\"related-lin")
print("k\" href=\"/doc/api/is-array/\">is_array</a><a class=\"related-link\" href=\"/doc/api/is-list/\">is_list</a></aside></div>")
}
+2 -4
View File
@@ -1,7 +1,5 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>hex</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function hex(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>hex()</code> converts each input byte to two lowercase hexadecimal characters.</p><p>Use it to make digest bytes printable. For example, <code>hex(sha256(value))</code> returns a SHA-256 digest as lowercase hexadecimal text.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : bytes to encode</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Lowercase hexadecimal text.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(hex(sha256(&quot;abc&quot;)), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\""
)
print("/doc/api/xml-encode/\">xml_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>hex</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function hex(value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>hex()</code> converts each input byte to two lowercase hexadecimal characters.</p><p>Use it to make digest bytes printable. For example, <code>hex(sha256(value))</code> returns a SHA-256 digest as lowercase hexadecimal text.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>value : bytes to encode</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>Lowercase hexadecimal text.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(hex(sha256(&quot;abc&quot;)), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/base64-encode/\">base64_encode</a><a class=\"related-link\" href=\"/doc/api/base64-decode/\">base64_decode</a><a class=\"related-link\" href=\"/doc/api/string-from-bytes/\">string_from_bytes</a><a class=\"related-link\" href=\"/doc/api/bytes-of/\">bytes_of</a><a class=\"related-link\" href=\"/doc/api/json-encode/\">json_encode</a><a class=\"related-link\" href=\"/doc/api/json-decode/\">json_decode</a><a class=\"related-link\" href=\"/doc/api/html-escape/\">html_escape</a><a class=\"related-link\" href=\"/doc/api/uri-encode/\">uri_encode</a><a class=\"related-link\" href=\"/doc/api/uri-decode/\">uri_decode</a><a class=\"related-link\" href=\"/doc/api/brb-encode/\">brb_encode</a><a class=\"related-link\" href=\"/doc/api/brb-decode/\">brb_decode</a><a class=\"related-link\" href=\"")
print("/doc/api/xml-encode/\">xml_encode</a><a class=\"related-link\" href=\"/doc/api/xml-decode/\">xml_decode</a><a class=\"related-link\" href=\"/doc/api/yaml-encode/\">yaml_encode</a><a class=\"related-link\" href=\"/doc/api/yaml-decode/\">yaml_decode</a><a class=\"related-link\" href=\"/doc/api/json-consume-space/\">json_consume_space</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/hmac-sha256/\">hmac_sha256</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a></aside></div>")
}
+1 -2
View File
@@ -1,5 +1,4 @@
function COMPONENT(request : dval)
{
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>hmac_sha256</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function hmac_sha256(key : string, value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>hmac_sha256()</code> returns 32 raw HMAC-SHA256 bytes. Use <code>hex(hmac_sha256(key, value))</code> when you need lowercase hexadecimal text.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>key : secret key bytes</p></div><div><p>value : message bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A raw 32-byte HMAC-SHA256 value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(length(hmac_sha256(&quot;key&quot;, &quot;message&quot;)), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a><a class=\"related-link\" href=\"/doc/api/crypto-operation/\">crypto_operation</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a></aside></div>"
)
print("<div class=\"doc-detail-layout\"><main class=\"content doc-page doc-detail\"><div class=\"doc-title\"><h2>hmac_sha256</h2><span class=\"call-boundary host-call\">host call</span></div><div class=\"doc-section signatures\"><h3>Capy</h3><pre>function hmac_sha256(key : string, value : string) string</pre></div><div class=\"doc-section content\"><h3>Description</h3><p><code>hmac_sha256()</code> returns 32 raw HMAC-SHA256 bytes. Use <code>hex(hmac_sha256(key, value))</code> when you need lowercase hexadecimal text.</p></div><div class=\"doc-section params\"><h3>Parameters</h3><div><p>key : secret key bytes</p></div><div><p>value : message bytes</p></div><div></div></div><div class=\"doc-section\"><h3>Return Values</h3><p>A raw 32-byte HMAC-SHA256 value.</p></div><div class=\"doc-section example\"><h3>Example</h3><div class=\"example-language capy\"><h4>Capy</h4><pre class=\"example-source\">print(length(hmac_sha256(&quot;key&quot;, &quot;message&quot;)), &quot;\\n&quot;)\n</pre></div></div></main><aside class=\"doc-section see-also\"><h3>See also</h3><a class=\"related-link\" href=\"/doc/api/password-hash/\">password_hash</a><a class=\"related-link\" href=\"/doc/api/password-verify/\">password_verify</a><a class=\"related-link\" href=\"/doc/api/gen-sha1/\">gen_sha1</a><a class=\"related-link\" href=\"/doc/api/sha256/\">sha256</a><a class=\"related-link\" href=\"/doc/api/crypto-equal/\">crypto_equal</a><a class=\"related-link\" href=\"/doc/api/crypto-operation/\">crypto_operation</a><a class=\"related-link\" href=\"/doc/api/runtime-safe-key/\">runtime_safe_key</a><a class=\"related-link\" href=\"/doc/api/hex/\">hex</a></aside></div>")
}
Loaded 100 of 313 files, more files were not shown because too many files have changed in this diff. Show more