#include "simdutf.h"
typedef struct SIMDUTFResult {
int error;
size_t count;
} SIMDUTFResult;
extern "C" {
int simdutf__detect_encodings(const char* input, size_t length)
{
return simdutf::detect_encodings(input, length);
}
bool simdutf__validate_utf8(const char* buf, size_t len)
{
return simdutf::validate_utf8(buf, len);
}
SIMDUTFResult simdutf__validate_utf8_with_errors(const char* buf, size_t len)
{
auto res = simdutf::validate_utf8_with_errors(buf, len);
return { res.error, res.count };
}
bool simdutf__validate_ascii(const char* buf, size_t len)
{
return simdutf::validate_ascii(buf, len);
}
SIMDUTFResult simdutf__validate_ascii_with_errors(const char* buf, size_t len)
{
auto res = simdutf::validate_ascii_with_errors(buf, len);
return { res.error, res.count };
}
bool simdutf__validate_utf16le(const char16_t* buf, size_t len)
{
return simdutf::validate_utf16le(buf, len);
}
bool simdutf__validate_utf16be(const char16_t* buf, size_t len)
{
return simdutf::validate_utf16be(buf, len);
}
SIMDUTFResult simdutf__validate_utf16le_with_errors(const char16_t* buf,
size_t len)
{
auto res = simdutf::validate_utf16le_with_errors(buf, len);
return { res.error, res.count };
}
SIMDUTFResult simdutf__validate_utf16be_with_errors(const char16_t* buf,
size_t len)
{
auto res = simdutf::validate_utf16be_with_errors(buf, len);
return { res.error, res.count };
}
bool simdutf__validate_utf32(const char32_t* buf, size_t len)
{
return simdutf::validate_utf32(buf, len);
}
SIMDUTFResult simdutf__validate_utf32_with_errors(const char32_t* buf,
size_t len)
{
auto res = simdutf::validate_utf32_with_errors(buf, len);
return { res.error, res.count };
}
size_t simdutf__convert_utf8_to_utf16le(const char* buf, size_t len,
char16_t* utf16_output)
{
return simdutf::convert_utf8_to_utf16le(buf, len, utf16_output);
}
size_t simdutf__convert_utf8_to_utf16be(const char* buf, size_t len,
char16_t* utf16_output)
{
return simdutf::convert_utf8_to_utf16be(buf, len, utf16_output);
}
SIMDUTFResult
simdutf__convert_utf8_to_utf16le_with_errors(const char* buf, size_t len,
char16_t* utf16_output)
{
auto res = simdutf::convert_utf8_to_utf16le_with_errors(buf, len, utf16_output);
return { res.error, res.count };
}
SIMDUTFResult
simdutf__convert_utf8_to_utf16be_with_errors(const char* buf, size_t len,
char16_t* utf16_output)
{
auto res = simdutf::convert_utf8_to_utf16be_with_errors(buf, len, utf16_output);
return { res.error, res.count };
}
size_t simdutf__convert_valid_utf8_to_utf16le(const char* buf, size_t len,
char16_t* utf16_buffer)
{
return simdutf::convert_valid_utf8_to_utf16le(buf, len, utf16_buffer);
}
size_t simdutf__convert_valid_utf8_to_utf16be(const char* buf, size_t len,
char16_t* utf16_buffer)
{
return simdutf::convert_valid_utf8_to_utf16be(buf, len, utf16_buffer);
}
size_t simdutf__convert_utf8_to_utf32(const char* buf, size_t len,
char32_t* utf32_output)
{
return simdutf::convert_utf8_to_utf32(buf, len, utf32_output);
}
SIMDUTFResult
simdutf__convert_utf8_to_utf32_with_errors(const char* buf, size_t len,
char32_t* utf32_output)
{
auto res = simdutf::convert_utf8_to_utf32_with_errors(buf, len, utf32_output);
return { res.error, res.count };
}
size_t simdutf__convert_valid_utf8_to_utf32(const char* buf, size_t len,
char32_t* utf32_buffer)
{
return simdutf::convert_valid_utf8_to_utf32(buf, len, utf32_buffer);
}
size_t simdutf__convert_utf16le_to_utf8(const char16_t* buf, size_t len,
char* utf8_buffer)
{
return simdutf::convert_utf16le_to_utf8(buf, len, utf8_buffer);
}
size_t simdutf__convert_utf16be_to_utf8(const char16_t* buf, size_t len,
char* utf8_buffer)
{
return simdutf::convert_utf16be_to_utf8(buf, len, utf8_buffer);
}
SIMDUTFResult simdutf__convert_utf16le_to_utf8_with_errors(const char16_t* buf,
size_t len,
char* utf8_buffer)
{
auto res = simdutf::convert_utf16le_to_utf8_with_errors(buf, len, utf8_buffer);
return { res.error, res.count };
}
SIMDUTFResult simdutf__convert_utf16be_to_utf8_with_errors(const char16_t* buf,
size_t len,
char* utf8_buffer)
{
auto res = simdutf::convert_utf16be_to_utf8_with_errors(buf, len, utf8_buffer);
return { res.error, res.count };
}
size_t simdutf__convert_valid_utf16le_to_utf8(const char16_t* buf, size_t len,
char* utf8_buffer)
{
return simdutf::convert_valid_utf16le_to_utf8(buf, len, utf8_buffer);
}
size_t simdutf__convert_valid_utf16be_to_utf8(const char16_t* buf, size_t len,
char* utf8_buffer)
{
return simdutf::convert_valid_utf16be_to_utf8(buf, len, utf8_buffer);
}
size_t simdutf__convert_utf32_to_utf8(const char32_t* buf, size_t len,
char* utf8_buffer)
{
return simdutf::convert_utf32_to_utf8(buf, len, utf8_buffer);
}
SIMDUTFResult simdutf__convert_utf32_to_utf8_with_errors(const char32_t* buf,
size_t len,
char* utf8_buffer)
{
auto res = simdutf::convert_utf32_to_utf8_with_errors(buf, len, utf8_buffer);
return { res.error, res.count };
}
size_t simdutf__convert_valid_utf32_to_utf8(const char32_t* buf, size_t len,
char* utf8_buffer)
{
return simdutf::convert_valid_utf32_to_utf8(buf, len, utf8_buffer);
}
size_t simdutf__convert_utf32_to_utf16le(const char32_t* buf, size_t len,
char16_t* utf16_buffer)
{
return simdutf::convert_utf32_to_utf16le(buf, len, utf16_buffer);
}
size_t simdutf__convert_utf32_to_utf16be(const char32_t* buf, size_t len,
char16_t* utf16_buffer)
{
return simdutf::convert_utf32_to_utf16be(buf, len, utf16_buffer);
}
SIMDUTFResult
simdutf__convert_utf32_to_utf16le_with_errors(const char32_t* buf, size_t len,
char16_t* utf16_buffer)
{
auto res = simdutf::convert_utf32_to_utf16le_with_errors(buf, len, utf16_buffer);
return { res.error, res.count };
}
SIMDUTFResult
simdutf__convert_utf32_to_utf16be_with_errors(const char32_t* buf, size_t len,
char16_t* utf16_buffer)
{
auto res = simdutf::convert_utf32_to_utf16be_with_errors(buf, len, utf16_buffer);
return { res.error, res.count };
}
size_t simdutf__convert_valid_utf32_to_utf16le(const char32_t* buf, size_t len,
char16_t* utf16_buffer)
{
return simdutf::convert_valid_utf32_to_utf16le(buf, len, utf16_buffer);
}
size_t simdutf__convert_valid_utf32_to_utf16be(const char32_t* buf, size_t len,
char16_t* utf16_buffer)
{
return simdutf::convert_valid_utf32_to_utf16be(buf, len, utf16_buffer);
}
size_t simdutf__convert_utf16le_to_utf32(const char16_t* buf, size_t len,
char32_t* utf32_buffer)
{
return simdutf::convert_utf16le_to_utf32(buf, len, utf32_buffer);
}
size_t simdutf__convert_utf16be_to_utf32(const char16_t* buf, size_t len,
char32_t* utf32_buffer)
{
return simdutf::convert_utf16be_to_utf32(buf, len, utf32_buffer);
}
SIMDUTFResult
simdutf__convert_utf16le_to_utf32_with_errors(const char16_t* buf, size_t len,
char32_t* utf32_buffer)
{
auto res = simdutf::convert_utf16le_to_utf32_with_errors(buf, len, utf32_buffer);
return { res.error, res.count };
}
SIMDUTFResult
simdutf__convert_utf16be_to_utf32_with_errors(const char16_t* buf, size_t len,
char32_t* utf32_buffer)
{
auto res = simdutf::convert_utf16be_to_utf32_with_errors(buf, len, utf32_buffer);
return { res.error, res.count };
}
size_t simdutf__convert_valid_utf16le_to_utf32(const char16_t* buf, size_t len,
char32_t* utf32_buffer)
{
return simdutf::convert_valid_utf16le_to_utf32(buf, len, utf32_buffer);
}
size_t simdutf__convert_valid_utf16be_to_utf32(const char16_t* buf, size_t len,
char32_t* utf32_buffer)
{
return simdutf::convert_valid_utf16be_to_utf32(buf, len, utf32_buffer);
}
void simdutf__change_endianness_utf16(const char16_t* buf, size_t length,
char16_t* output)
{
simdutf::change_endianness_utf16(buf, length, output);
}
size_t simdutf__count_utf16le(const char16_t* buf, size_t length)
{
return simdutf::count_utf16le(buf, length);
}
size_t simdutf__count_utf16be(const char16_t* buf, size_t length)
{
return simdutf::count_utf16be(buf, length);
}
size_t simdutf__count_utf8(const char* buf, size_t length)
{
return simdutf::count_utf8(buf, length);
}
size_t simdutf__utf8_length_from_utf16le(const char16_t* input, size_t length)
{
return simdutf::utf8_length_from_utf16le(input, length);
}
size_t simdutf__utf8_length_from_utf16be(const char16_t* input, size_t length)
{
return simdutf::utf8_length_from_utf16be(input, length);
}
size_t simdutf__utf32_length_from_utf16le(const char16_t* input, size_t length)
{
return simdutf::utf32_length_from_utf16le(input, length);
}
size_t simdutf__utf32_length_from_utf16be(const char16_t* input, size_t length)
{
return simdutf::utf32_length_from_utf16be(input, length);
}
size_t simdutf__utf16_length_from_utf8(const char* input, size_t length)
{
return simdutf::utf16_length_from_utf8(input, length);
}
size_t simdutf__utf8_length_from_utf32(const char32_t* input, size_t length)
{
return simdutf::utf8_length_from_utf32(input, length);
}
size_t simdutf__utf16_length_from_utf32(const char32_t* input, size_t length)
{
return simdutf::utf16_length_from_utf32(input, length);
}
size_t simdutf__utf32_length_from_utf8(const char* input, size_t length)
{
return simdutf::utf32_length_from_utf8(input, length);
}
}ed/precompile-linux-dependencies'>jarred/precompile-linux-dependencies
jarred/prepare-for-libuv
jarred/profiled-call
jarred/read-tsconfig-jsx
jarred/redo-evaluation-order
jarred/redo-zigstring-for-utf16
jarred/relay
jarred/rename
jarred/repl
jarred/request-finalizer
jarred/rewrite-router
jarred/run
jarred/simdjson
jarred/simplify
jarred/some-fixes-for-eventsource
jarred/standalone-repro1
jarred/start
jarred/strong
jarred/subprocess
jarred/support-tee
jarred/tcc
jarred/throw-if
jarred/update-install-stuff
jarred/update-zig1
jarred/upgrade-zig-2
jarred/uws
jarred/webkit-upgrade-may-17
jarred/wip-more-reliable
jarred/workers
jarred/zlib
jarred/zls
lithdew/picohttp-mimalloc
main
move-templates
nestjs-guide
next-cleanup
origin/main
plugin/plugindata
plugin/resolvedir
postinstall_3
repl
request-body-stream
reserve-commands
revert-5167-dylan/decode-regex-if-needed
rfc/bun-bundler-api
rfc/bunfig-overhaul
save-in-update
sdl
test/action
types/mock
types/readable-stream-default
types/tty
u/vjpr/zig-0.10
xHyroM/types/expose-Bun-Env
Unnamed repository; edit this file 'description' to name the repository.
Age Commit message (Collapse ) Author Files Lines
* Fix `make jsc` on Linux
Previously, it failed with `/usr/bin/bash: Line 3: -DUSE_BUN_JSC_ADDITIONS=ON: Command not found`.
* Update Makefile
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
The sqlite3 logic to dynamically load extensions can be disabled to save space,
which macos does by default.
sqlite3 provides a api to check for these compile time settings at runtime,
we can use that to throw a js error rather then crashing.
It is worth noting though that the api to check for these settings at runtime
itself can be disabled through SQLITE_OMIT_COMPILEOPTION_DIAGS but this seams
to be a edge case.
This make it as the same default depth in Node.
Source: https://github.com/nodejs/node/blob/480ab8c3a40451d5ea459dd35b4039679b26e195/doc/api/console.md?plain=1#L285
WTFString here
* fix(fetch): fix redirect in relative path location.
* fix utf-8 encoding
* use server.reload
* check buf size
* add RedirectURLTooLong test
sudo is required to run pacman if not root user
* test
* gadsgsagdsa
* add better err msg
* r
* oops
* ok
* fix size limit
* 63
* throw error
* ffi.test.js
* add macos tests
* oops
* fix(encoding): export `getIgnoreBOM`
* feat(encoding): support ignoreBOM
* fix(encoding): not replace BOM to 0xFFFD
* chore: use strict equal
* feat(node:dns): implement dns.lookupService
Close: #4347
* fix flags
* add `getSockaddr`
* fix sockaddr size
* flaky test
* implement console._stdout
* nonenum
* Improve types for each
* more
* remove
* [bun install] Add `-E` as alias of `--exact`
* Add test for -E flag
* feat: switch disableTelemetry to bunfig
* feat: zig fmt
* revert: the env variable and invert the logic of telemetry
---------
Co-authored-by: MrPalixir <73360179+MrPalixir@users.noreply.github.com>
Fix: https://github.com/napi-rs/napi-rs/blob/main/examples/napi/__tests__/test.framework.js#L16-L19
* Fix bugs
* Fix bugs
* Revert "Fix bugs"
This reverts commit 608639eb2214fdf4310477051ce47d20702b5dd0.
* some progess
* needs more tests
* make tests easier to debug
* get metadata for constructor arg decorators
* fix some things
* merge `emitDecoratorMetadata` option
* remove `^`
* bundler tests and get option from tsconfig earlier
* remove spaces
* fix tests
* Always call `Error.prepareStackTrace`
* Support node:vm
* Remove this
* Handle more cases
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Fixes #5800
* Fix path used in bunx
* Add test
* Use a different package
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
The URL to download the manifest for Artifact Registry in Google
is larger than 4092 bytes.
cf. issue #4748
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>