mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
most of the bindings!
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,4 +44,5 @@ outdir/
|
||||
outcss
|
||||
.next
|
||||
txt.js
|
||||
.idea
|
||||
.idea
|
||||
.vscode/cpp*
|
||||
14
.vscode/c_cpp_properties.json
vendored
14
.vscode/c_cpp_properties.json
vendored
@@ -7,10 +7,10 @@
|
||||
],
|
||||
"includePath": [
|
||||
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/WTF/Headers/**",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/WTF/Headers",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/*",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/bindings/**",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/WebKit/Source/bmalloc/**",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/bindings/",
|
||||
"${workspaceFolder}/src/JavaScript/jsc/WebKit/Source/bmalloc/",
|
||||
"${workspaceFolder}/src/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers/"
|
||||
],
|
||||
"browse": {
|
||||
@@ -24,7 +24,7 @@
|
||||
"${workspaceFolder}/src/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers/"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
"databaseFilename": ".vscode/cppdb"
|
||||
},
|
||||
"defines": [
|
||||
"STATICALLY_LINKED_WITH_JavaScriptCore=1",
|
||||
@@ -33,12 +33,14 @@
|
||||
"NOMINMAX",
|
||||
"ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0",
|
||||
"BUILDING_JSCONLY__",
|
||||
"USE_FOUNDATION=1"
|
||||
"USE_FOUNDATION=1",
|
||||
"ASSERT_ENABLED=0",
|
||||
"DU_DISABLE_RENAMING=1"
|
||||
],
|
||||
"macFrameworkPath": [],
|
||||
"compilerPath": "/usr/local/opt/llvm/bin/clang",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "macos-clang-x64"
|
||||
}
|
||||
],
|
||||
|
||||
13
.vscode/settings.json
vendored
13
.vscode/settings.json
vendored
@@ -29,6 +29,17 @@
|
||||
},
|
||||
"files.associations": {
|
||||
"*.idl": "cpp",
|
||||
"memory": "cpp"
|
||||
"memory": "cpp",
|
||||
"iostream": "cpp",
|
||||
"algorithm": "cpp",
|
||||
"random": "cpp",
|
||||
"ios": "cpp",
|
||||
"filesystem": "cpp",
|
||||
"__locale": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"__mutex_base": "cpp",
|
||||
"__string": "cpp",
|
||||
"string": "cpp",
|
||||
"string_view": "cpp"
|
||||
}
|
||||
}
|
||||
|
||||
31
Makefile
31
Makefile
@@ -8,11 +8,14 @@ jsc: jsc-build jsc-bindings
|
||||
jsc-build: jsc-build-mac
|
||||
jsc-bindings:
|
||||
jsc-bindings-headers
|
||||
|
||||
jsc-bindings-mac
|
||||
|
||||
|
||||
jsc-bindings-headers:
|
||||
zig build headers
|
||||
|
||||
|
||||
jsc-build-mac:
|
||||
cd src/javascript/jsc/WebKit && ICU_INCLUDE_DIRS="/usr/local/opt/icu4c/include" ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo" && echo "Ignore the \"has no symbols\" errors"
|
||||
|
||||
@@ -20,15 +23,8 @@ SRC_DIR := src/javascript/jsc/bindings
|
||||
OBJ_DIR := src/javascript/jsc/bindings-obj
|
||||
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
|
||||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES))
|
||||
|
||||
jsc-bindings-mac: $(OBJ_FILES)
|
||||
|
||||
# We do this outside of build.zig for performance reasons
|
||||
# The C compilation stuff with build.zig is really slow and we don't need to run this as often as the rest
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
clang++ -c -o $@ $< \
|
||||
-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders \
|
||||
-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/WTF/Headers \
|
||||
CLANG_FLAGS = -Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders \
|
||||
-Isrc/javascript/jsc/WebKit/WebKitBuild/Release/WTF/Headers \
|
||||
-Isrc/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers \
|
||||
-DSTATICALLY_LINKED_WITH_JavaScriptCore=1 \
|
||||
-DSTATICALLY_LINKED_WITH_WTF=1 \
|
||||
@@ -40,7 +36,22 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/ \
|
||||
-Isrc/JavaScript/jsc/bindings/ \
|
||||
-Isrc/javascript/jsc/WebKit/Source/bmalloc \
|
||||
-std=gnu++17
|
||||
-std=gnu++17 \
|
||||
-stdlib=libc++ \
|
||||
-DDU_DISABLE_RENAMING=1
|
||||
|
||||
jsc-bindings-mac: $(OBJ_FILES)
|
||||
|
||||
# We do this outside of build.zig for performance reasons
|
||||
# The C compilation stuff with build.zig is really slow and we don't need to run this as often as the rest
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
clang++ -c -o $@ $< \
|
||||
$(CLANG_FLAGS)
|
||||
|
||||
sizegen:
|
||||
clang++ src/javascript/jsc/headergen/sizegen.cpp -o /tmp/sizegen $(CLANG_FLAGS)
|
||||
/tmp/sizegen > src/javascript/jsc/bindings/sizes.zig
|
||||
|
||||
|
||||
speedy-prod-native-macos:
|
||||
cd src/deps; clang -c picohttpparser.c; cd ../../
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Speedy - a fast web bundler
|
||||
# Speedy - a fast web bundler & JavaScript runtime environment
|
||||
|
||||
Speedy bundles & transpiles JavaScript, TypeScript, and CSS. Speedy is probably the fastest bundler out today.
|
||||
|
||||
|
||||
@@ -43,118 +43,34 @@ namespace Wundle {
|
||||
|
||||
|
||||
|
||||
const ClassInfo DefaultGlobal::s_info = { "GlobalObject", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(DefaultGlobal) };
|
||||
const GlobalObjectMethodTable DefaultGlobal::s_globalObjectMethodTable = {
|
||||
&supportsRichSourceInfo,
|
||||
&shouldInterruptScript,
|
||||
&javaScriptRuntimeFlags,
|
||||
nullptr, // queueTaskToEventLoop
|
||||
&shouldInterruptScriptBeforeTimeout,
|
||||
&moduleLoaderImportModule, // moduleLoaderImportModule
|
||||
&moduleLoaderResolve, // moduleLoaderResolve
|
||||
&moduleLoaderFetch, // moduleLoaderFetch
|
||||
&moduleLoaderCreateImportMetaProperties, // moduleLoaderCreateImportMetaProperties
|
||||
&moduleLoaderEvaluate, // moduleLoaderEvaluate
|
||||
nullptr, // promiseRejectionTracker
|
||||
&reportUncaughtExceptionAtEventLoop,
|
||||
¤tScriptExecutionOwner,
|
||||
&scriptExecutionStatus,
|
||||
nullptr, // defaultLanguage
|
||||
nullptr, // compileStreaming
|
||||
nullptr, // instantiateStreaming
|
||||
// const ClassInfo DefaultGlobal::s_info = { "GlobalObject", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(DefaultGlobal) };
|
||||
// const GlobalObjectMethodTable DefaultGlobal::s_globalObjectMethodTable = {
|
||||
// &supportsRichSourceInfo,
|
||||
// &shouldInterruptScript,
|
||||
// &javaScriptRuntimeFlags,
|
||||
// nullptr, // queueTaskToEventLoop
|
||||
// &shouldInterruptScriptBeforeTimeout,
|
||||
// &moduleLoaderImportModule, // moduleLoaderImportModule
|
||||
// &moduleLoaderResolve, // moduleLoaderResolve
|
||||
// &moduleLoaderFetch, // moduleLoaderFetch
|
||||
// &moduleLoaderCreateImportMetaProperties, // moduleLoaderCreateImportMetaProperties
|
||||
// &moduleLoaderEvaluate, // moduleLoaderEvaluate
|
||||
// nullptr, // promiseRejectionTracker
|
||||
// &reportUncaughtExceptionAtEventLoop,
|
||||
// ¤tScriptExecutionOwner,
|
||||
// &scriptExecutionStatus,
|
||||
// nullptr, // defaultLanguage
|
||||
// nullptr, // compileStreaming
|
||||
// nullptr, // instantiateStreaming
|
||||
// };
|
||||
|
||||
|
||||
// void DefaultGlobal::reportUncaughtExceptionAtEventLoop(JSGlobalObject* globalObject, Exception* exception) {}
|
||||
// JSC::Identifier DefaultGlobal::moduleLoaderResolve(JSGlobalObject* globalObject, JSModuleLoader* loader, JSValue key, JSValue referrer, JSValue val) {
|
||||
// JSInternalPromise* DefaultGlobal::moduleLoaderImportModule(JSGlobalObject* globalObject, JSModuleLoader*, JSString* specifierValue, JSValue, const SourceOrigin& sourceOrigin) {
|
||||
// JSInternalPromise* DefaultGlobal::moduleLoaderFetch(JSGlobalObject* globalObject, JSModuleLoader*, JSValue key, JSValue, JSValue) {
|
||||
// JSC::JSObject* DefaultGlobal::moduleLoaderCreateImportMetaProperties(JSGlobalObject* globalObject, JSModuleLoader*loader, JSValue key, JSModuleRecord* record, JSValue value) {
|
||||
// JSValue DefaultGlobal::moduleLoaderEvaluate(JSGlobalObject* globalObject, JSModuleLoader* moduleLoader, JSValue key, JSValue moduleRecordValue, JSValue scriptFetcher, JSValue sentValue, JSValue resumeMode) {
|
||||
|
||||
// using namespace JSC;
|
||||
};
|
||||
|
||||
|
||||
void DefaultGlobal::reportUncaughtExceptionAtEventLoop(JSGlobalObject* globalObject, Exception* exception) {}
|
||||
JSC::Identifier DefaultGlobal::moduleLoaderResolve(JSGlobalObject* globalObject, JSModuleLoader* loader, JSValue key, JSValue referrer, JSValue val) {
|
||||
String string = key.toWTFString(globalObject);
|
||||
return JSC::Identifier::fromString(globalObject->vm(), string );
|
||||
}
|
||||
JSInternalPromise* DefaultGlobal::moduleLoaderImportModule(JSGlobalObject* globalObject, JSModuleLoader*, JSString* specifierValue, JSValue, const SourceOrigin& sourceOrigin) {
|
||||
return nullptr;
|
||||
}
|
||||
JSInternalPromise* DefaultGlobal::moduleLoaderFetch(JSGlobalObject* globalObject, JSModuleLoader*, JSValue key, JSValue, JSValue) {
|
||||
return nullptr;
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal::moduleLoaderCreateImportMetaProperties(JSGlobalObject* globalObject, JSModuleLoader*loader, JSValue key, JSModuleRecord* record, JSValue value) {
|
||||
return nullptr;
|
||||
}
|
||||
JSValue DefaultGlobal::moduleLoaderEvaluate(JSGlobalObject* globalObject, JSModuleLoader* moduleLoader, JSValue key, JSValue moduleRecordValue, JSValue scriptFetcher, JSValue sentValue, JSValue resumeMode) {
|
||||
return jsNull();
|
||||
}
|
||||
|
||||
using namespace JSC;
|
||||
|
||||
|
||||
JSC::ObjectPrototype* JSC__JSGlobalObject__objectPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->objectPrototype();
|
||||
}
|
||||
JSC::FunctionPrototype* JSC__JSGlobalObject__functionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->functionPrototype();
|
||||
}
|
||||
JSC::ArrayPrototype* JSC__JSGlobalObject__arrayPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->arrayPrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__booleanPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->booleanPrototype();
|
||||
}
|
||||
JSC::StringPrototype* JSC__JSGlobalObject__stringPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->stringPrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__numberPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->numberPrototype();
|
||||
}
|
||||
JSC::BigIntPrototype* JSC__JSGlobalObject__bigIntPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->bigIntPrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__datePrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->datePrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__symbolPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->symbolPrototype();
|
||||
}
|
||||
JSC::RegExpPrototype* JSC__JSGlobalObject__regExpPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->regExpPrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__errorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->errorPrototype();
|
||||
}
|
||||
JSC::IteratorPrototype* JSC__JSGlobalObject__iteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->iteratorPrototype();
|
||||
}
|
||||
JSC::AsyncIteratorPrototype* JSC__JSGlobalObject__asyncIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncIteratorPrototype();
|
||||
}
|
||||
JSC::GeneratorFunctionPrototype* JSC__JSGlobalObject__generatorFunctionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->generatorFunctionPrototype();
|
||||
}
|
||||
JSC::GeneratorPrototype* JSC__JSGlobalObject__generatorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->generatorPrototype();
|
||||
}
|
||||
JSC::AsyncFunctionPrototype* JSC__JSGlobalObject__asyncFunctionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncFunctionPrototype();
|
||||
}
|
||||
JSC::ArrayIteratorPrototype* JSC__JSGlobalObject__arrayIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->arrayIteratorPrototype();
|
||||
}
|
||||
JSC::MapIteratorPrototype* JSC__JSGlobalObject__mapIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->mapIteratorPrototype();
|
||||
}
|
||||
JSC::SetIteratorPrototype* JSC__JSGlobalObject__setIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->setIteratorPrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__mapPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->mapPrototype();
|
||||
}
|
||||
JSC::JSObject* JSC__JSGlobalObject__jsSetPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->jsSetPrototype();
|
||||
}
|
||||
JSC::JSPromisePrototype* JSC__JSGlobalObject__promisePrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->promisePrototype();
|
||||
}
|
||||
JSC::AsyncGeneratorPrototype* JSC__JSGlobalObject__asyncGeneratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncGeneratorPrototype();
|
||||
}
|
||||
JSC::AsyncGeneratorFunctionPrototype* JSC__JSGlobalObject__asyncGeneratorFunctionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncGeneratorFunctionPrototype();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
65
src/javascript/jsc/bindings/ZigGlobalObject.h
Normal file
65
src/javascript/jsc/bindings/ZigGlobalObject.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
|
||||
namespace JSC {
|
||||
class Structure;
|
||||
class Identifier;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include <JavaScriptCore/JSGlobalObject.h>
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Zig {
|
||||
using namespace JSC;
|
||||
|
||||
class GlobalObject final : public JSGlobalObject {
|
||||
public:
|
||||
using Base = JSGlobalObject;
|
||||
|
||||
DECLARE_EXPORT_INFO;
|
||||
static const GlobalObjectMethodTable s_globalObjectMethodTable;
|
||||
|
||||
static constexpr bool needsDestruction = true;
|
||||
template<typename CellType, SubspaceAccess mode>
|
||||
static IsoSubspace* subspaceFor(VM& vm)
|
||||
{
|
||||
return vm.apiGlobalObjectSpace<mode>();
|
||||
}
|
||||
|
||||
static GlobalObject* create(VM& vm, Structure* structure)
|
||||
{
|
||||
auto* object = new (NotNull, allocateCell<GlobalObject>(vm.heap)) GlobalObject(vm, structure);
|
||||
object->finishCreation(vm);
|
||||
return object;
|
||||
}
|
||||
|
||||
static Structure* createStructure(VM& vm, JSValue prototype)
|
||||
{
|
||||
auto* result = Structure::create(vm, nullptr, prototype, TypeInfo(GlobalObjectType, StructureFlags), info());
|
||||
result->setTransitionWatchpointIsLikelyToBeFired(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void reportUncaughtExceptionAtEventLoop(JSGlobalObject*, Exception*);
|
||||
|
||||
static JSInternalPromise* moduleLoaderImportModule(JSGlobalObject*, JSModuleLoader*, JSString* moduleNameValue, JSValue parameters, const SourceOrigin&);
|
||||
static Identifier moduleLoaderResolve(JSGlobalObject*, JSModuleLoader*, JSValue keyValue, JSValue referrerValue, JSValue);
|
||||
static JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, JSModuleLoader*, JSValue, JSValue, JSValue);
|
||||
static JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*, JSModuleLoader*, JSValue, JSModuleRecord*, JSValue);
|
||||
static JSValue moduleLoaderEvaluate(JSGlobalObject*, JSModuleLoader*, JSValue, JSValue, JSValue, JSValue, JSValue);
|
||||
|
||||
|
||||
private:
|
||||
GlobalObject(VM& vm, Structure* structure)
|
||||
: Base(vm, structure, &s_globalObjectMethodTable)
|
||||
{ }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,11 +21,14 @@ pub fn main() anyerror!void {
|
||||
var writer = stdout.writer();
|
||||
const src: std.builtin.SourceLocation = @src();
|
||||
const paths = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "headers.h" };
|
||||
const paths2 = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "headers-cpp.h" };
|
||||
|
||||
const cpp = try std.fs.createFileAbsolute(try std.fs.path.join(allocator, &paths2), .{});
|
||||
const file = try std.fs.createFileAbsolute(try std.fs.path.join(allocator, &paths), .{});
|
||||
|
||||
const HeaderGenerator = HeaderGen(
|
||||
Bindings,
|
||||
"src/javascript/jsc/bindings/bindings.zig",
|
||||
);
|
||||
HeaderGenerator.exec(HeaderGenerator{}, file);
|
||||
HeaderGenerator.exec(HeaderGenerator{}, file, cpp);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,514 @@
|
||||
|
||||
#include "headers.h"
|
||||
#include "root.h"
|
||||
|
||||
|
||||
// namespace Bundler {
|
||||
// class CustomGlobalObject : public JSC::JSGlobalObject {
|
||||
|
||||
// };
|
||||
#include <JavaScriptCore/ExceptionScope.h>
|
||||
#include <JavaScriptCore/JSObject.h>
|
||||
#include <JavaScriptCore/JSCInlines.h>
|
||||
#include <wtf/text/WTFString.h>
|
||||
#include <wtf/text/StringImpl.h>
|
||||
#include <wtf/text/ExternalStringImpl.h>
|
||||
#include <wtf/text/StringView.h>
|
||||
#include <JavaScriptCore/Identifier.h>
|
||||
#include <JavaScriptCore/VM.h>
|
||||
#include <JavaScriptCore/VM.h>
|
||||
#include <JavaScriptCore/WasmFaultSignalHandler.h>
|
||||
#include <wtf/text/StringCommon.h>
|
||||
|
||||
template<class To, class From>
|
||||
To cast(From v)
|
||||
{
|
||||
return *static_cast<To*>(static_cast<void*>(v));
|
||||
}
|
||||
|
||||
template<class To, class From>
|
||||
To ccast(From v)
|
||||
{
|
||||
return *static_cast<const To*>(static_cast<const void*>(v));
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
#pragma mark - JSC::JSValue
|
||||
|
||||
JSC__JSCell* JSC__JSValue__asCell(JSC__JSValue JSValue0) {
|
||||
auto value = JSC::JSValue::decode(JSValue0);
|
||||
return value.asCell();
|
||||
}
|
||||
double JSC__JSValue__asNumber(JSC__JSValue JSValue0) {
|
||||
auto value = JSC::JSValue::decode(JSValue0);
|
||||
return value.asNumber();
|
||||
};
|
||||
bJSC__JSObject JSC__JSValue__asObject(JSC__JSValue JSValue0) {
|
||||
auto value = JSC::JSValue::decode(JSValue0);
|
||||
auto obj = JSC::asObject(value);
|
||||
return cast<bJSC__JSObject>(&obj);
|
||||
};
|
||||
JSC__JSString* JSC__JSValue__asString(JSC__JSValue JSValue0) {
|
||||
auto value = JSC::JSValue::decode(JSValue0);
|
||||
return JSC::asString(value);
|
||||
};
|
||||
// uint64_t JSC__JSValue__encode(JSC__JSValue JSValue0) {
|
||||
|
||||
// }
|
||||
bool JSC__JSValue__eqlCell(JSC__JSValue JSValue0, JSC__JSCell* arg1) {
|
||||
return JSC::JSValue::decode(JSValue0) == arg1;
|
||||
};
|
||||
bool JSC__JSValue__eqlValue(JSC__JSValue JSValue0, JSC__JSValue JSValue1) {
|
||||
return JSC::JSValue::decode(JSValue0) == JSC::JSValue::decode(JSValue1);
|
||||
};
|
||||
JSC__JSValue JSC__JSValue__getPrototype(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1) {
|
||||
auto value = JSC::JSValue::decode(JSValue0);
|
||||
return JSC::JSValue::encode(value.getPrototype(arg1));
|
||||
}
|
||||
bool JSC__JSValue__isAnyInt(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isAnyInt(); }
|
||||
bool JSC__JSValue__isBigInt(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isBigInt(); }
|
||||
bool JSC__JSValue__isBigInt32(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isBigInt32(); }
|
||||
bool JSC__JSValue__isBoolean(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isBoolean(); }
|
||||
bool JSC__JSValue__isCell(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isCell(); }
|
||||
bool JSC__JSValue__isCustomGetterSetter(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isCustomGetterSetter(); }
|
||||
// bool JSC__JSValue__isError(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).getPrototype() }
|
||||
bool JSC__JSValue__isGetterSetter(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isGetterSetter(); }
|
||||
bool JSC__JSValue__isHeapBigInt(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isHeapBigInt(); }
|
||||
bool JSC__JSValue__isInt32AsAnyInt(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isInt32AsAnyInt(); }
|
||||
bool JSC__JSValue__isNull(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isNull(); }
|
||||
bool JSC__JSValue__isNumber(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isNumber(); }
|
||||
bool JSC__JSValue__isObject(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isObject(); }
|
||||
bool JSC__JSValue__isPrimitive(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isPrimitive(); }
|
||||
bool JSC__JSValue__isString(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isString(); }
|
||||
bool JSC__JSValue__isSymbol(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isSymbol(); }
|
||||
bool JSC__JSValue__isUInt32AsAnyInt(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isUInt32AsAnyInt(); }
|
||||
bool JSC__JSValue__isUndefined(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isUndefined(); }
|
||||
bool JSC__JSValue__isUndefinedOrNull(JSC__JSValue JSValue0) { return JSC::JSValue::decode(JSValue0).isUndefinedOrNull(); }
|
||||
JSC__JSValue JSC__JSValue__jsBoolean(bool arg0) { return JSC::JSValue::encode(JSC::jsBoolean(arg0)); };
|
||||
JSC__JSValue JSC__JSValue__jsDoubleNumber(double arg0) {return JSC::JSValue::encode(JSC::jsNumber(arg0)); }
|
||||
JSC__JSValue JSC__JSValue__jsNull() { return JSC::JSValue::encode(JSC::jsNull()); };
|
||||
JSC__JSValue JSC__JSValue__jsNumberFromChar(char arg0) { return JSC::JSValue::encode(JSC::jsNumber(arg0));};
|
||||
JSC__JSValue JSC__JSValue__jsNumberFromDouble(double arg0) { return JSC::JSValue::encode(JSC::jsNumber(arg0));};
|
||||
JSC__JSValue JSC__JSValue__jsNumberFromInt32(int32_t arg0) { return JSC::JSValue::encode(JSC::jsNumber(arg0));};
|
||||
JSC__JSValue JSC__JSValue__jsNumberFromInt64(int64_t arg0) { return JSC::JSValue::encode(JSC::jsNumber(arg0));};
|
||||
JSC__JSValue JSC__JSValue__jsNumberFromU16(uint16_t arg0) { return JSC::JSValue::encode(JSC::jsNumber(arg0));};
|
||||
JSC__JSValue JSC__JSValue__jsNumberFromUint64(uint64_t arg0) { return JSC::JSValue::encode(JSC::jsNumber(arg0));};
|
||||
JSC__JSValue JSC__JSValue__jsTDZValue() { return JSC::JSValue::encode(JSC::jsTDZValue()); };
|
||||
JSC__JSValue JSC__JSValue__jsUndefined() { return JSC::JSValue::encode(JSC::jsUndefined()); };
|
||||
JSC__JSObject* JSC__JSValue__toObject(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(JSValue0);
|
||||
return value.toObject(arg1);
|
||||
}
|
||||
|
||||
bJSC__Identifier JSC__JSValue__toPropertyKey(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(JSValue0);
|
||||
auto ident = value.toPropertyKey(arg1);
|
||||
return cast<bJSC__Identifier>(&ident);
|
||||
}
|
||||
JSC__JSValue JSC__JSValue__toPropertyKeyValue(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(JSValue0);
|
||||
return JSC::JSValue::encode(value.toPropertyKeyValue(arg1));
|
||||
}
|
||||
JSC__JSString* JSC__JSValue__toString(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(JSValue0);
|
||||
return value.toString(arg1);
|
||||
};
|
||||
JSC__JSString* JSC__JSValue__toStringOrNull(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1) {
|
||||
JSC::JSValue value = JSC::JSValue::decode(JSValue0);
|
||||
return value.toStringOrNull(arg1);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - JSC::PropertyName
|
||||
|
||||
bool JSC__PropertyName__eqlToIdentifier(JSC__PropertyName* arg0, const JSC__Identifier* arg1) {
|
||||
return (*arg0) == (*arg1);
|
||||
};
|
||||
bool JSC__PropertyName__eqlToPropertyName(JSC__PropertyName* arg0, const JSC__PropertyName* arg1) {
|
||||
return (*arg0) == (*arg1);
|
||||
};
|
||||
const WTF__StringImpl* JSC__PropertyName__publicName(JSC__PropertyName* arg0) {
|
||||
return arg0->publicName();
|
||||
};
|
||||
const WTF__StringImpl* JSC__PropertyName__uid(JSC__PropertyName* arg0) {
|
||||
return arg0->uid();
|
||||
};
|
||||
|
||||
|
||||
#pragma mark - JSC::VM
|
||||
|
||||
JSC__JSLock* JSC__VM__apiLock(JSC__VM* arg0) {
|
||||
return makeRefPtr((*arg0).apiLock()).leakRef();
|
||||
}
|
||||
JSC__VM* JSC__VM__create(char HeapType0) {
|
||||
JSC::VM* vm = &JSC::VM::create(HeapType0 == JSC::SmallHeap ? JSC::SmallHeap : JSC::LargeHeap).leakRef();
|
||||
#if ENABLE(WEBASSEMBLY)
|
||||
JSC::Wasm::enableFastMemory();
|
||||
#endif
|
||||
|
||||
return vm;
|
||||
}
|
||||
void JSC__VM__deinit(JSC__VM* arg1, JSC__JSGlobalObject* globalObject) {
|
||||
JSC::VM& vm = reinterpret_cast<JSC::VM&>(arg1);
|
||||
bool protectCountIsZero = vm.heap.unprotect(globalObject);
|
||||
|
||||
if (protectCountIsZero)
|
||||
vm.heap.reportAbandonedObjectGraph();
|
||||
|
||||
vm.deref();
|
||||
}
|
||||
void JSC__VM__drainMicrotasks(JSC__VM* arg0) {
|
||||
arg0->drainMicrotasks();
|
||||
}
|
||||
|
||||
bool JSC__VM__executionForbidden(JSC__VM* arg0) {
|
||||
return (*arg0).executionForbidden();
|
||||
}
|
||||
|
||||
bool JSC__VM__isEntered(JSC__VM* arg0) {
|
||||
return (*arg0).isEntered();
|
||||
}
|
||||
|
||||
void JSC__VM__setExecutionForbidden(JSC__VM* arg0, bool arg1) {
|
||||
(*arg0).setExecutionForbidden();
|
||||
}
|
||||
|
||||
bool JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__ThrowScope* arg2, const char* arg3, size_t arg4) {
|
||||
auto scope = arg2;
|
||||
auto global = arg1;
|
||||
const String& message = WTF::String(arg3, arg4);
|
||||
return JSC::throwException(global, (*scope), createError(global, message));
|
||||
}
|
||||
|
||||
#pragma mark - JSC::ThrowScope
|
||||
|
||||
void JSC__ThrowScope__clearException(JSC__ThrowScope* arg0) {
|
||||
arg0->clearException();
|
||||
};
|
||||
bJSC__ThrowScope JSC__ThrowScope__declare(JSC__VM* arg0, char* arg1, char* arg2, size_t arg3) {
|
||||
JSC::ThrowScope scope = JSC::ThrowScope(reinterpret_cast<JSC::VM&>(arg0));
|
||||
return cast<bJSC__ThrowScope>(&scope);
|
||||
};
|
||||
JSC__Exception* JSC__ThrowScope__exception(JSC__ThrowScope* arg0) {
|
||||
return arg0->exception();
|
||||
}
|
||||
void JSC__ThrowScope__release(JSC__ThrowScope* arg0) {
|
||||
arg0->release();
|
||||
}
|
||||
|
||||
#pragma mark - JSC::CatchScope
|
||||
|
||||
void JSC__CatchScope__clearException(JSC__CatchScope* arg0) {
|
||||
arg0->clearException();
|
||||
}
|
||||
bJSC__CatchScope JSC__CatchScope__declare(JSC__VM* arg0, char* arg1, char* arg2, size_t arg3) {
|
||||
JSC::CatchScope scope = JSC::CatchScope(reinterpret_cast<JSC::VM&>(arg0));
|
||||
return cast<bJSC__CatchScope>(&scope);
|
||||
}
|
||||
JSC__Exception* JSC__CatchScope__exception(JSC__CatchScope* arg0) {
|
||||
return arg0->exception();
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - JSC::CallFrame
|
||||
|
||||
JSC__JSValue JSC__CallFrame__argument(const JSC__CallFrame* arg0, uint16_t arg1) {
|
||||
return JSC::JSValue::encode(arg0->argument(arg1));
|
||||
};
|
||||
size_t JSC__CallFrame__argumentsCount(const JSC__CallFrame* arg0) {
|
||||
return arg0->argumentCount();
|
||||
}
|
||||
JSC__JSObject* JSC__CallFrame__jsCallee(const JSC__CallFrame* arg0) {
|
||||
return arg0->jsCallee();
|
||||
}
|
||||
JSC__JSValue JSC__CallFrame__newTarget(const JSC__CallFrame* arg0) {
|
||||
return JSC::JSValue::encode(arg0->newTarget());
|
||||
};
|
||||
JSC__JSValue JSC__CallFrame__thisValue(const JSC__CallFrame* arg0) {
|
||||
return JSC::JSValue::encode(arg0->thisValue());
|
||||
}
|
||||
JSC__JSValue JSC__CallFrame__uncheckedArgument(const JSC__CallFrame* arg0, uint16_t arg1) {
|
||||
return JSC::JSValue::encode(arg0->uncheckedArgument(arg1));
|
||||
}
|
||||
|
||||
#pragma mark - JSC::Identifier
|
||||
|
||||
bool JSC__Identifier__eqlIdent(const JSC__Identifier* arg0, const JSC__Identifier* arg1) {
|
||||
return arg0 == arg1;
|
||||
};
|
||||
bool JSC__Identifier__eqlStringImpl(const JSC__Identifier* arg0, const WTF__StringImpl* arg1) {
|
||||
return JSC::Identifier::equal(arg0->string().impl(), arg1);
|
||||
};
|
||||
bool JSC__Identifier__eqlUTF8(const JSC__Identifier* arg0, const char* arg1, size_t arg2) {
|
||||
return JSC::Identifier::equal(arg0->string().impl(), reinterpret_cast<const LChar*>(arg1), arg2);
|
||||
};
|
||||
bool JSC__Identifier__neqlIdent(const JSC__Identifier* arg0, const JSC__Identifier* arg1) {
|
||||
return arg0 != arg1;
|
||||
}
|
||||
bool JSC__Identifier__neqlStringImpl(const JSC__Identifier* arg0, const WTF__StringImpl* arg1) {
|
||||
return !JSC::Identifier::equal(arg0->string().impl(), arg1);
|
||||
};
|
||||
|
||||
bJSC__Identifier JSC__Identifier__fromSlice(JSC__VM* arg0, const char* arg1, size_t arg2) {
|
||||
JSC::Identifier ident = JSC::Identifier::fromString(reinterpret_cast<JSC__VM&>(arg0), reinterpret_cast<const LChar*>(arg1), static_cast<int>(arg2));
|
||||
return cast<bJSC__Identifier>(&ident);
|
||||
};
|
||||
bJSC__Identifier JSC__Identifier__fromString(JSC__VM* arg0, const WTF__String* arg1) {
|
||||
JSC::Identifier ident = JSC::Identifier::fromString(reinterpret_cast<JSC__VM&>(arg0), reinterpret_cast<const WTF__String&>(arg1));
|
||||
return cast<bJSC__Identifier>(&ident);
|
||||
};
|
||||
// bJSC__Identifier JSC__Identifier__fromUid(JSC__VM* arg0, const WTF__StringImpl* arg1) {
|
||||
// auto ident = JSC::Identifier::fromUid(&arg0, &arg1);
|
||||
// return *cast<bJSC__Identifier>(&ident);
|
||||
// };
|
||||
bool JSC__Identifier__isEmpty(const JSC__Identifier* arg0) {
|
||||
return arg0->isEmpty();
|
||||
};
|
||||
bool JSC__Identifier__isNull(const JSC__Identifier* arg0) {
|
||||
return arg0->isNull();
|
||||
};
|
||||
bool JSC__Identifier__isPrivateName(const JSC__Identifier* arg0) {
|
||||
return arg0->isPrivateName();
|
||||
};
|
||||
bool JSC__Identifier__isSymbol(const JSC__Identifier* arg0) {
|
||||
return arg0->isSymbol();
|
||||
};
|
||||
size_t JSC__Identifier__length(const JSC__Identifier* arg0) {
|
||||
return arg0->length();
|
||||
};
|
||||
|
||||
bWTF__String JSC__Identifier__toString(const JSC__Identifier* arg0) {
|
||||
auto string = arg0->string();
|
||||
return cast<bWTF__String>(&string);
|
||||
};
|
||||
|
||||
|
||||
#pragma mark - WTF::StringView
|
||||
|
||||
const uint16_t* WTF__StringView__characters16(const WTF__StringView* arg0) {
|
||||
WTF::StringView* view = (WTF::StringView*)arg0;
|
||||
return reinterpret_cast<const uint16_t*>(view->characters16());
|
||||
}
|
||||
const char* WTF__StringView__characters8(const WTF__StringView* arg0) {
|
||||
return reinterpret_cast<const char*>(arg0->characters8());
|
||||
};
|
||||
|
||||
bool WTF__StringView__is16Bit(const WTF__StringView* arg0) {return !arg0->is8Bit(); };
|
||||
bool WTF__StringView__is8Bit(const WTF__StringView* arg0) {return arg0->is8Bit(); };
|
||||
bool WTF__StringView__isEmpty(const WTF__StringView* arg0) {return arg0->isEmpty(); };
|
||||
size_t WTF__StringView__length(const WTF__StringView* arg0) {return arg0->length(); };
|
||||
|
||||
#pragma mark - WTF::StringImpl
|
||||
|
||||
const uint16_t* WTF__StringImpl__characters16(const WTF__StringImpl* arg0) {
|
||||
return reinterpret_cast<const uint16_t*>(arg0->characters16());
|
||||
}
|
||||
const char* WTF__StringImpl__characters8(const WTF__StringImpl* arg0) {
|
||||
return reinterpret_cast<const char*>(arg0->characters8());
|
||||
}
|
||||
|
||||
bWTF__StringView WTF__StringView__from8Bit(const char* arg0, size_t arg1) {
|
||||
WTF::StringView view = WTF::StringView(arg0, arg1);
|
||||
return cast<bWTF__StringView>(&view);
|
||||
}
|
||||
|
||||
bool WTF__StringImpl__is16Bit(const WTF__StringImpl* arg0) {
|
||||
return !arg0->is8Bit();
|
||||
}
|
||||
bool WTF__StringImpl__is8Bit(const WTF__StringImpl* arg0) {
|
||||
return arg0->is8Bit();
|
||||
}
|
||||
bool WTF__StringImpl__isEmpty(const WTF__StringImpl* arg0) {
|
||||
return arg0->isEmpty();
|
||||
}
|
||||
bool WTF__StringImpl__isExternal(const WTF__StringImpl* arg0) {
|
||||
return arg0->isExternal();
|
||||
}
|
||||
bool WTF__StringImpl__isStatic(const WTF__StringImpl* arg0) {
|
||||
return arg0->isStatic();
|
||||
}
|
||||
size_t WTF__StringImpl__length(const WTF__StringImpl* arg0) {
|
||||
return arg0->length();
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - WTF::ExternalStringImpl
|
||||
|
||||
const uint16_t* WTF__ExternalStringImpl__characters16(const WTF__ExternalStringImpl* arg0) {
|
||||
return reinterpret_cast<const uint16_t*>(arg0->characters16());
|
||||
}
|
||||
const char* WTF__ExternalStringImpl__characters8(const WTF__ExternalStringImpl* arg0) {
|
||||
return reinterpret_cast<const char*>(arg0->characters8());
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool WTF__ExternalStringImpl__is16Bit(const WTF__ExternalStringImpl* arg0) {
|
||||
return !arg0->is8Bit();
|
||||
}
|
||||
bool WTF__ExternalStringImpl__is8Bit(const WTF__ExternalStringImpl* arg0) {
|
||||
return arg0->is8Bit();
|
||||
}
|
||||
bool WTF__ExternalStringImpl__isEmpty(const WTF__ExternalStringImpl* arg0) {
|
||||
return arg0->isEmpty();
|
||||
}
|
||||
bool WTF__ExternalStringImpl__isExternal(const WTF__ExternalStringImpl* arg0) {
|
||||
return arg0->isExternal();
|
||||
}
|
||||
bool WTF__ExternalStringImpl__isStatic(const WTF__ExternalStringImpl* arg0) {
|
||||
return arg0->isStatic();
|
||||
}
|
||||
size_t WTF__ExternalStringImpl__length(const WTF__ExternalStringImpl* arg0) {
|
||||
return arg0->length();
|
||||
}
|
||||
|
||||
#pragma mark - WTF::String
|
||||
|
||||
const uint16_t* WTF__String__characters16(WTF__String* arg0) {
|
||||
return reinterpret_cast<const uint16_t*>(arg0->characters16());
|
||||
};
|
||||
const char* WTF__String__characters8(WTF__String* arg0) {
|
||||
return reinterpret_cast<const char*>(arg0->characters8());
|
||||
};
|
||||
|
||||
bool WTF__String__eqlSlice(WTF__String* arg0, const char* arg1, size_t arg2) {
|
||||
return WTF::equal(arg0->impl(), reinterpret_cast<const LChar*>(arg1), arg2);
|
||||
}
|
||||
bool WTF__String__eqlString(WTF__String* arg0, const WTF__String* arg1) {
|
||||
return arg0 == arg1;
|
||||
}
|
||||
const WTF__StringImpl* WTF__String__impl(WTF__String* arg0) {
|
||||
return arg0->impl();
|
||||
}
|
||||
|
||||
bool WTF__String__is16Bit(WTF__String* arg0) {return !arg0->is8Bit();}
|
||||
bool WTF__String__is8Bit(WTF__String* arg0) {return arg0->is8Bit();}
|
||||
bool WTF__String__isEmpty(WTF__String* arg0) {return arg0->isEmpty();}
|
||||
bool WTF__String__isExternal(WTF__String* arg0) {return arg0->impl()->isExternal();}
|
||||
bool WTF__String__isStatic(WTF__String* arg0) {return arg0->impl()->isStatic();}
|
||||
size_t WTF__String__length(WTF__String* arg0) {return arg0->length();}
|
||||
|
||||
bWTF__String WTF__String__createFromExternalString(bWTF__ExternalStringImpl arg0) {
|
||||
WTF::ExternalStringImpl* external = cast<WTF::ExternalStringImpl*>(&arg0);
|
||||
WTF::String string = WTF::String(external);
|
||||
return ccast<bWTF__String>(&string);
|
||||
};
|
||||
bWTF__String WTF__String__createWithoutCopyingFromPtr(const char* arg0, size_t arg1) {
|
||||
const WTF::String string = WTF::String(WTF::StringImpl::createWithoutCopying(reinterpret_cast<const LChar*>(arg0), arg1));
|
||||
return ccast<bWTF__String>(&string);
|
||||
}
|
||||
|
||||
#pragma mark - WTF::URL
|
||||
|
||||
bWTF__StringView WTF__URL__encodedPassword(WTF__URL* arg0) {
|
||||
auto result = arg0->encodedPassword();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__encodedUser(WTF__URL* arg0) {
|
||||
auto result = arg0->encodedUser();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__String WTF__URL__fileSystemPath(WTF__URL* arg0) {
|
||||
auto result = arg0->fileSystemPath();
|
||||
return cast<bWTF__String>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__fragmentIdentifier(WTF__URL* arg0) {
|
||||
auto result = arg0->fragmentIdentifier();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__fragmentIdentifierWithLeadingNumberSign(WTF__URL* arg0) {
|
||||
auto result = arg0->fragmentIdentifierWithLeadingNumberSign();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__URL WTF__URL__fromFileSystemPath(bWTF__StringView arg0) {
|
||||
auto url = WTF::URL::fileURLWithFileSystemPath(cast<WTF::StringView>(&arg0));
|
||||
return cast<bWTF__URL>(&url);
|
||||
};
|
||||
bWTF__URL WTF__URL__fromString(bWTF__String arg0, bWTF__String arg1) {
|
||||
WTF::URL url= WTF::URL(WTF::URL(), cast<WTF::String>(&arg1));
|
||||
return cast<bWTF__URL>(&url);
|
||||
};
|
||||
bWTF__StringView WTF__URL__host(WTF__URL* arg0) {
|
||||
auto result = arg0->host();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__String WTF__URL__hostAndPort(WTF__URL* arg0) {
|
||||
auto result = arg0->hostAndPort();
|
||||
return cast<bWTF__String>(&result);
|
||||
};
|
||||
bool WTF__URL__isEmpty(const WTF__URL* arg0) {
|
||||
return arg0->isEmpty();
|
||||
};
|
||||
bool WTF__URL__isValid(const WTF__URL* arg0) {
|
||||
return arg0->isValid();
|
||||
};
|
||||
bWTF__StringView WTF__URL__lastPathComponent(WTF__URL* arg0) {
|
||||
auto result = arg0->lastPathComponent();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__String WTF__URL__password(WTF__URL* arg0) {
|
||||
auto result = arg0->password();
|
||||
return cast<bWTF__String>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__path(WTF__URL* arg0) {
|
||||
auto result = arg0->path();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__protocol(WTF__URL* arg0) {
|
||||
auto result = arg0->protocol();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__String WTF__URL__protocolHostAndPort(WTF__URL* arg0) {
|
||||
auto result = arg0->protocolHostAndPort();
|
||||
return cast<bWTF__String>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__query(WTF__URL* arg0) {
|
||||
auto result = arg0->query();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__queryWithLeadingQuestionMark(WTF__URL* arg0) {
|
||||
auto result = arg0->queryWithLeadingQuestionMark();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__String WTF__URL__stringWithoutFragmentIdentifier(WTF__URL* arg0) {
|
||||
auto result = arg0->stringWithoutFragmentIdentifier();
|
||||
return cast<bWTF__String>(&result);
|
||||
};
|
||||
bWTF__StringView WTF__URL__stringWithoutQueryOrFragmentIdentifier(WTF__URL* arg0) {
|
||||
auto result = arg0->stringWithoutQueryOrFragmentIdentifier();
|
||||
return cast<bWTF__StringView>(&result);
|
||||
};
|
||||
bWTF__URL WTF__URL__truncatedForUseAsBase(WTF__URL* arg0) {
|
||||
auto result = arg0->truncatedForUseAsBase();
|
||||
return cast<bWTF__URL>(&result);
|
||||
};
|
||||
bWTF__String WTF__URL__user(WTF__URL* arg0) {
|
||||
auto result = arg0->user();
|
||||
return cast<bWTF__String>(&result);
|
||||
};
|
||||
|
||||
void WTF__URL__setHost(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setHost(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
void WTF__URL__setHostAndPort(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setHostAndPort(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
void WTF__URL__setPassword(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setPassword(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
void WTF__URL__setPath(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setPath(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
void WTF__URL__setProtocol(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setProtocol(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
void WTF__URL__setQuery(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setQuery(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
void WTF__URL__setUser(WTF__URL* arg0, bWTF__StringView arg1) {
|
||||
arg0->setUser(cast<WTF::StringView>(&arg1));
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,16 +6,71 @@ const StructMeta = std.builtin.TypeInfo.Struct;
|
||||
const EnumMeta = std.builtin.TypeInfo.Enum;
|
||||
const UnionMeta = std.builtin.TypeInfo.Union;
|
||||
const warn = std.debug.warn;
|
||||
const StaticExport = @import("./static_export.zig");
|
||||
|
||||
const TypeNameMap = std.StringHashMap([]const u8);
|
||||
|
||||
fn isCppObject(comptime Type: type) bool {
|
||||
return switch (@typeInfo(Type)) {
|
||||
.Struct, .Union, .Opaque => true,
|
||||
.Enum => |Enum| @hasDecl(Type, "Type"),
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn cTypeLabel(comptime Type: type) ?[]const u8 {
|
||||
return switch (comptime Type) {
|
||||
void => "void",
|
||||
bool => "bool",
|
||||
usize => "size_t",
|
||||
isize => "int",
|
||||
u8 => "char",
|
||||
u16 => "uint16_t",
|
||||
u32 => "uint32_t",
|
||||
u64 => "uint64_t",
|
||||
i8 => "int8_t",
|
||||
i16 => "int16_t",
|
||||
i24 => "int24_t",
|
||||
i32 => "int32_t",
|
||||
i64 => "int64_t",
|
||||
f64 => "double",
|
||||
f32 => "float",
|
||||
*c_void => "void*",
|
||||
[*]bool => "bool*",
|
||||
[*]usize => "size_t*",
|
||||
[*]isize => "int*",
|
||||
[*]u8 => "char*",
|
||||
[*]u16 => "uint16_t*",
|
||||
[*]u32 => "uint32_t*",
|
||||
[*]u64 => "uint64_t*",
|
||||
[*]i8 => "int8_t*",
|
||||
[*]i16 => "int16_t*",
|
||||
[*]i32 => "int32_t*",
|
||||
[*]i64 => "int64_t*",
|
||||
[*]const bool => "const bool*",
|
||||
[*]const usize => "const size_t*",
|
||||
[*]const isize => "const int*",
|
||||
[*]const u8 => "const char*",
|
||||
[*]const u16 => "const uint16_t*",
|
||||
[*]const u32 => "const uint32_t*",
|
||||
[*]const u64 => "const uint64_t*",
|
||||
[*]const i8 => "const int8_t*",
|
||||
[*]const i16 => "const int16_t*",
|
||||
[*]const i32 => "const int32_t*",
|
||||
[*]const i64 => "const int64_t*",
|
||||
else => null,
|
||||
};
|
||||
}
|
||||
|
||||
var buffer = std.ArrayList(u8).init(std.heap.c_allocator);
|
||||
var writer = buffer.writer();
|
||||
var impl_buffer = std.ArrayList(u8).init(std.heap.c_allocator);
|
||||
var impl_writer = impl_buffer.writer();
|
||||
var bufset = std.BufSet.init(std.heap.c_allocator);
|
||||
var type_names = TypeNameMap.init(std.heap.c_allocator);
|
||||
var size_map = std.StringHashMap(u32).init(std.heap.c_allocator);
|
||||
|
||||
pub const C_Generator = struct {
|
||||
file: std.fs.File,
|
||||
filebase: []const u8,
|
||||
|
||||
direction: Direction = .export_cpp,
|
||||
@@ -26,8 +81,8 @@ pub const C_Generator = struct {
|
||||
export_zig,
|
||||
};
|
||||
|
||||
pub fn init(comptime src_file: []const u8, file: std.fs.File) Self {
|
||||
var res = Self{ .file = file, .filebase = src_file };
|
||||
pub fn init(comptime src_file: []const u8, comptime Writer: type, file: Writer) Self {
|
||||
var res = Self{ .filebase = src_file };
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -38,7 +93,13 @@ pub const C_Generator = struct {
|
||||
// self.file.writeAll("> ****/\n\n") catch unreachable;
|
||||
}
|
||||
|
||||
pub fn gen_func(self: *Self, comptime name: []const u8, comptime func: FnDecl, comptime meta: FnMeta, comptime arg_names: []const []const u8) void {
|
||||
pub fn gen_func(
|
||||
self: *Self,
|
||||
comptime name: []const u8,
|
||||
comptime func: FnDecl,
|
||||
comptime meta: FnMeta,
|
||||
comptime arg_names: []const []const u8,
|
||||
) void {
|
||||
switch (meta.calling_convention) {
|
||||
.Naked => self.write("__attribute__((naked)) "),
|
||||
.Stdcall => self.write("__attribute__((stdcall)) "),
|
||||
@@ -48,26 +109,38 @@ pub const C_Generator = struct {
|
||||
}
|
||||
|
||||
switch (self.direction) {
|
||||
.export_cpp => self.write("CPP_DECL \"C\" "),
|
||||
.export_zig => self.write("ZIG_DECL \"C\" "),
|
||||
.export_cpp => self.write("CPP_DECL "),
|
||||
.export_zig => self.write("ZIG_DECL "),
|
||||
}
|
||||
|
||||
self.writeType(func.return_type);
|
||||
self.write(" " ++ name ++ "(");
|
||||
|
||||
inline for (meta.args) |arg, i| {
|
||||
self.writeType(arg.arg_type.?);
|
||||
if (func.arg_names.len > i) {
|
||||
self.write(comptime arg_names[i]);
|
||||
} else {
|
||||
const ArgType = arg.arg_type.?;
|
||||
if (@typeInfo(ArgType) == .Enum) {
|
||||
self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ @typeName(ArgType), i }));
|
||||
} else {
|
||||
self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
|
||||
}
|
||||
const ArgType = arg.arg_type.?;
|
||||
|
||||
switch (@typeInfo(ArgType)) {
|
||||
.Fn => {
|
||||
self.gen_closure(comptime arg.arg_type.?, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i}));
|
||||
},
|
||||
else => {
|
||||
self.writeType(arg.arg_type.?);
|
||||
switch (@typeInfo(ArgType)) {
|
||||
.Enum => {
|
||||
self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ @typeName(ArgType), i }));
|
||||
},
|
||||
|
||||
else => {
|
||||
self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
// if (comptime func.arg_names.len > 0 and func.arg_names.len > i) {
|
||||
// self.write(comptime arg_names[i]);
|
||||
// } else {
|
||||
|
||||
//TODO: Figure out how to get arg names; for now just do arg0..argN
|
||||
if (i != meta.args.len - 1)
|
||||
self.write(", ");
|
||||
@@ -85,6 +158,43 @@ pub const C_Generator = struct {
|
||||
// }
|
||||
}
|
||||
|
||||
pub fn gen_closure(
|
||||
self: *Self,
|
||||
comptime Function: type,
|
||||
comptime name: []const u8,
|
||||
) void {
|
||||
const func: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn;
|
||||
self.writeType(func.return_type orelse void);
|
||||
self.write(" (*" ++ name ++ ")(");
|
||||
inline for (func.args) |arg, i| {
|
||||
self.writeType(arg.arg_type.?);
|
||||
// if (comptime func.arg_names.len > 0 and func.arg_names.len > i) {
|
||||
// self.write(comptime arg_names[i]);
|
||||
// } else {
|
||||
const ArgType = arg.arg_type.?;
|
||||
if (@typeInfo(ArgType) == .Enum) {
|
||||
self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ @typeName(ArgType), i }));
|
||||
} else {
|
||||
self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
|
||||
}
|
||||
// }
|
||||
|
||||
//TODO: Figure out how to get arg names; for now just do arg0..argN
|
||||
if (i != func.args.len - 1)
|
||||
self.write(", ");
|
||||
}
|
||||
|
||||
self.write(")");
|
||||
// const ReturnTypeInfo: std.builtin.TypeInfo = comptime @typeInfo(func.return_type);
|
||||
// switch (comptime ReturnTypeInfo) {
|
||||
// .Pointer => |Pointer| {
|
||||
// self.write(" __attribute__((returns_nonnull))");
|
||||
// },
|
||||
// .Optional => |Optional| {},
|
||||
// else => {},
|
||||
// }
|
||||
}
|
||||
|
||||
pub fn gen_struct(self: *Self, comptime name: []const u8, comptime meta: StructMeta) void {
|
||||
self.write("typedef struct ");
|
||||
|
||||
@@ -107,7 +217,7 @@ pub const C_Generator = struct {
|
||||
self.write(" " ++ field.name);
|
||||
|
||||
if (info == .Array) {
|
||||
_ = self.file.writer().print("[{}]", .{info.Array.len}) catch unreachable;
|
||||
writer.print("[{}]", .{info.Array.len}) catch unreachable;
|
||||
}
|
||||
|
||||
self.write(";\n");
|
||||
@@ -115,7 +225,11 @@ pub const C_Generator = struct {
|
||||
self.write("} " ++ name ++ "_t;\n\n");
|
||||
}
|
||||
|
||||
pub fn gen_enum(self: *Self, comptime name: []const u8, comptime meta: EnumMeta) void {
|
||||
pub fn gen_enum(
|
||||
self: *Self,
|
||||
comptime name: []const u8,
|
||||
comptime meta: EnumMeta,
|
||||
) void {
|
||||
self.write("enum " ++ name ++ " {\n");
|
||||
|
||||
comptime var last = 0;
|
||||
@@ -124,7 +238,7 @@ pub const C_Generator = struct {
|
||||
|
||||
// if field value is unexpected/custom, manually define it
|
||||
if ((i == 0 and field.value != 0) or (i > 0 and field.value > last + 1)) {
|
||||
_ = self.file.writer().print(" = {}", .{field.value}) catch unreachable;
|
||||
writer.print(" = {}", .{field.value}) catch unreachable;
|
||||
}
|
||||
|
||||
self.write(",\n");
|
||||
@@ -135,7 +249,11 @@ pub const C_Generator = struct {
|
||||
self.write("};\n\n");
|
||||
}
|
||||
|
||||
pub fn gen_union(self: *Self, comptime name: []const u8, comptime meta: UnionMeta) void {
|
||||
pub fn gen_union(
|
||||
self: *Self,
|
||||
comptime name: []const u8,
|
||||
comptime meta: UnionMeta,
|
||||
) void {
|
||||
self.write("typedef union ");
|
||||
|
||||
self.write(name ++ " {\n");
|
||||
@@ -148,7 +266,10 @@ pub const C_Generator = struct {
|
||||
self.write("} " ++ name ++ "_t;\n\n");
|
||||
}
|
||||
|
||||
fn writeType(self: *Self, comptime T: type) void {
|
||||
fn writeType(
|
||||
self: *Self,
|
||||
comptime T: type,
|
||||
) void {
|
||||
const TT = comptime if (@typeInfo(T) == .Pointer) @typeInfo(T).Pointer.child else T;
|
||||
|
||||
if (comptime (isCppObject(TT)) and @hasDecl(TT, "name")) {
|
||||
@@ -158,7 +279,38 @@ pub const C_Generator = struct {
|
||||
}
|
||||
}
|
||||
|
||||
self.write(comptime TT.name);
|
||||
const _formatted_name = comptime brk: {
|
||||
var original: [TT.name.len]u8 = undefined;
|
||||
_ = std.mem.replace(u8, TT.name, ":", "_", &original);
|
||||
break :brk original;
|
||||
};
|
||||
const formatted_name = comptime std.mem.span(&_formatted_name);
|
||||
|
||||
if (@hasDecl(TT, "is_pointer") and !TT.is_pointer) {
|
||||
if (cTypeLabel(TT.Type)) |label| {
|
||||
type_names.put(comptime label, formatted_name) catch unreachable;
|
||||
if (@typeInfo(TT) == .Struct and @hasField(TT, "bytes")) {
|
||||
size_map.put(comptime formatted_name, @as(u32, TT.shim.byte_size)) catch unreachable;
|
||||
}
|
||||
} else {
|
||||
type_names.put(comptime TT.name, formatted_name) catch unreachable;
|
||||
if (@typeInfo(TT) == .Struct and @hasField(TT, "bytes")) {
|
||||
size_map.put(comptime formatted_name, @as(u32, TT.shim.byte_size)) catch unreachable;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
type_names.put(comptime TT.name, formatted_name) catch unreachable;
|
||||
if (@typeInfo(TT) == .Struct and @hasField(TT, "bytes")) {
|
||||
size_map.put(comptime formatted_name, @as(u32, TT.shim.byte_size)) catch unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
if (TT == T and @hasField(T, "bytes")) {
|
||||
write(self, comptime "b" ++ formatted_name);
|
||||
} else {
|
||||
write(self, comptime formatted_name);
|
||||
}
|
||||
|
||||
if (@typeInfo(T) == .Pointer or @hasDecl(TT, "Type") and @typeInfo(TT.Type) == .Pointer) {
|
||||
if (@hasDecl(TT, "is_pointer") and !TT.is_pointer) {} else {
|
||||
write(self, "*");
|
||||
@@ -167,73 +319,35 @@ pub const C_Generator = struct {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (T) {
|
||||
void => self.write("void"),
|
||||
bool => self.write("bool"),
|
||||
usize => self.write("size_t"),
|
||||
isize => self.write("int"),
|
||||
u8 => self.write("char"),
|
||||
u16 => self.write("uint16_t"),
|
||||
u32 => self.write("uint32_t"),
|
||||
u64 => self.write("uint64_t"),
|
||||
i8 => self.write("int8_t"),
|
||||
i16 => self.write("int16_t"),
|
||||
i24 => self.write("int24_t"),
|
||||
i32 => self.write("int32_t"),
|
||||
i64 => self.write("int64_t"),
|
||||
f64 => self.write("double"),
|
||||
f32 => self.write("float"),
|
||||
*c_void => self.write("void*"),
|
||||
[*]bool => self.write("bool*"),
|
||||
[*]usize => self.write("size_t*"),
|
||||
[*]isize => self.write("int*"),
|
||||
[*]u8 => self.write("char*"),
|
||||
[*]u16 => self.write("uint16_t*"),
|
||||
[*]u32 => self.write("uint32_t*"),
|
||||
[*]u64 => self.write("uint64_t*"),
|
||||
[*]i8 => self.write("int8_t*"),
|
||||
[*]i16 => self.write("int16_t*"),
|
||||
[*]i32 => self.write("int32_t*"),
|
||||
[*]i64 => self.write("int64_t*"),
|
||||
[*]const bool => self.write("const bool*"),
|
||||
[*]const usize => self.write("const size_t*"),
|
||||
[*]const isize => self.write("const int*"),
|
||||
[*]const u8 => self.write("const char*"),
|
||||
[*]const u16 => self.write("const uint16_t*"),
|
||||
[*]const u32 => self.write("const uint32_t*"),
|
||||
[*]const u64 => self.write("const uint64_t*"),
|
||||
[*]const i8 => self.write("const int8_t*"),
|
||||
[*]const i16 => self.write("const int16_t*"),
|
||||
[*]const i32 => self.write("const int32_t*"),
|
||||
[*]const i64 => self.write("const int64_t*"),
|
||||
else => {
|
||||
const meta = @typeInfo(T);
|
||||
switch (meta) {
|
||||
.Pointer => |Pointer| {
|
||||
const child = Pointer.child;
|
||||
const childmeta = @typeInfo(child);
|
||||
// if (childmeta == .Struct and childmeta.Struct.layout != .Extern) {
|
||||
// self.write("void");
|
||||
// } else {
|
||||
self.writeType(child);
|
||||
// }
|
||||
self.write("*");
|
||||
},
|
||||
.Optional => self.writeType(meta.Optional.child),
|
||||
.Array => @compileError("Handle goofy looking C Arrays in the calling function"),
|
||||
.Enum => |Enum| {
|
||||
self.writeType(Enum.tag_type);
|
||||
},
|
||||
else => {
|
||||
return self.write(@typeName(T));
|
||||
},
|
||||
}
|
||||
},
|
||||
if (comptime cTypeLabel(T)) |label| {
|
||||
self.write(comptime label);
|
||||
} else {
|
||||
const meta = @typeInfo(T);
|
||||
switch (meta) {
|
||||
.Pointer => |Pointer| {
|
||||
const child = Pointer.child;
|
||||
const childmeta = @typeInfo(child);
|
||||
// if (childmeta == .Struct and childmeta.Struct.layout != .Extern) {
|
||||
// self.write("void");
|
||||
// } else {
|
||||
self.writeType(child);
|
||||
// }
|
||||
self.write("*");
|
||||
},
|
||||
.Optional => self.writeType(meta.Optional.child),
|
||||
.Array => @compileError("Handle goofy looking C Arrays in the calling function"),
|
||||
.Enum => |Enum| {
|
||||
self.writeType(Enum.tag_type);
|
||||
},
|
||||
else => {
|
||||
return self.write(@typeName(T));
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn write(self: *Self, comptime str: []const u8) void {
|
||||
_ = self.file.writeAll(str) catch {};
|
||||
_ = writer.write(str) catch {};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -295,32 +409,62 @@ pub fn HeaderGen(comptime import: type, comptime fname: []const u8) type {
|
||||
return struct {
|
||||
source_file: []const u8 = fname,
|
||||
gen: C_Generator = undefined,
|
||||
|
||||
const Self = @This();
|
||||
|
||||
pub fn init() Self {
|
||||
return Self{};
|
||||
}
|
||||
|
||||
pub fn startFile(comptime self: Self, comptime Type: type, comptime prefix: []const u8, file: std.fs.File) void {
|
||||
pub fn startFile(
|
||||
comptime self: Self,
|
||||
comptime Type: type,
|
||||
comptime prefix: []const u8,
|
||||
file: anytype,
|
||||
other: std.fs.File,
|
||||
) void {
|
||||
if (comptime std.meta.trait.hasDecls(Type, .{"include"})) {
|
||||
comptime var new_name = std.mem.zeroes([Type.include.len]u8);
|
||||
|
||||
comptime {
|
||||
_ = std.mem.replace(u8, Type.include, "/", "_", std.mem.span(&new_name));
|
||||
_ = std.mem.replace(u8, &new_name, ".", "_", std.mem.span(&new_name));
|
||||
_ = std.mem.replace(u8, &new_name, "<", "_", std.mem.span(&new_name));
|
||||
_ = std.mem.replace(u8, &new_name, ">", "_", std.mem.span(&new_name));
|
||||
_ = std.mem.replace(u8, &new_name, "\"", "_", std.mem.span(&new_name));
|
||||
}
|
||||
file.writeAll("\n#pragma mark - " ++ Type.name ++ "\n\n") catch unreachable;
|
||||
|
||||
if (@hasDecl(Type, "include")) {
|
||||
other.writer().print(
|
||||
\\
|
||||
\\#ifndef INCLUDED_{s}
|
||||
\\#define INCLUDED_{s}
|
||||
\\#include {s}
|
||||
\\#endif
|
||||
\\
|
||||
\\extern "C" const size_t {s} = sizeof({s});
|
||||
\\
|
||||
,
|
||||
.{ new_name, new_name, Type.include, Type.shim.size_of_symbol, Type.name },
|
||||
) catch unreachable;
|
||||
}
|
||||
const inner_name = comptime std.mem.trim(u8, &new_name, "<>\"");
|
||||
file.writeAll("\n#pragma mark - " ++ Type.name ++ "\n") catch unreachable;
|
||||
file.writeAll("\n#ifndef BINDINGS__decls__" ++ inner_name ++ "\n") catch {};
|
||||
file.writeAll("#define BINDINGS__decls__" ++ inner_name ++ "\n") catch {};
|
||||
file.writeAll("#include " ++ Type.include ++ "\n") catch {};
|
||||
file.writeAll("namespace " ++ Type.namespace ++ " {\n class " ++ prefix ++ ";\n}\n") catch {};
|
||||
file.writeAll("#endif\n\n") catch {};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn processStaticExport(comptime self: Self, file: anytype, gen: *C_Generator, comptime static_export: StaticExport) void {
|
||||
const fn_meta = comptime @typeInfo(static_export.Type).Fn;
|
||||
gen.gen_func(
|
||||
comptime static_export.symbol_name,
|
||||
comptime static_export.Decl().data.Fn,
|
||||
comptime fn_meta,
|
||||
comptime std.mem.zeroes([]const []const u8),
|
||||
);
|
||||
}
|
||||
|
||||
pub fn processDecl(
|
||||
comptime self: Self,
|
||||
file: std.fs.File,
|
||||
file: anytype,
|
||||
gen: *C_Generator,
|
||||
comptime Container: type,
|
||||
comptime Decl: std.builtin.TypeInfo.Declaration,
|
||||
@@ -332,14 +476,20 @@ pub fn HeaderGen(comptime import: type, comptime fname: []const u8) type {
|
||||
switch (@typeInfo(Type)) {
|
||||
.Enum => |Enum| {
|
||||
const layout = Enum.layout;
|
||||
gen.gen_enum(prefix ++ "__" ++ name, Enum);
|
||||
gen.gen_enum(
|
||||
prefix ++ "__" ++ name,
|
||||
Enum,
|
||||
);
|
||||
},
|
||||
.Struct => |Struct| {
|
||||
gen.gen_struct(decl.name, Struct);
|
||||
gen.gen_struct(decl.name, Struct, file);
|
||||
},
|
||||
.Union => |Union| {
|
||||
const layout = Union.layout;
|
||||
gen.gen_union(prefix ++ "__" ++ name, Union);
|
||||
gen.gen_union(
|
||||
prefix ++ "__" ++ name,
|
||||
Union,
|
||||
);
|
||||
},
|
||||
.Fn => |func| {
|
||||
// if (func.) {
|
||||
@@ -370,41 +520,136 @@ pub fn HeaderGen(comptime import: type, comptime fname: []const u8) type {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn exec(comptime self: Self, file: std.fs.File) void {
|
||||
pub fn exec(comptime self: Self, file: std.fs.File, impl: std.fs.File) void {
|
||||
const Generator = C_Generator;
|
||||
validateGenerator(Generator);
|
||||
var file_writer = file.writer();
|
||||
file_writer.print("//-- AUTOGENERATED FILE -- {d}\n", .{std.time.timestamp()}) catch unreachable;
|
||||
file.writeAll(
|
||||
\\#pragma once
|
||||
\\
|
||||
\\#include <stddef.h>
|
||||
\\#include <stdint.h>
|
||||
\\#include <stdbool.h>
|
||||
\\
|
||||
\\#ifdef __cplusplus
|
||||
\\ #define AUTO_EXTERN_C extern "C"
|
||||
\\#else
|
||||
\\ #define AUTO_EXTERN_C
|
||||
\\#endif
|
||||
\\#define ZIG_DECL AUTO_EXTERN_C
|
||||
\\#define CPP_DECL AUTO_EXTERN_C
|
||||
\\#define CPP_SIZE AUTO_EXTERN_C
|
||||
\\
|
||||
\\
|
||||
) catch {};
|
||||
|
||||
file.writeAll("#pragma once\n#include <stddef.h>\n#include <stdint.h>\n#include <stdbool.h>\n#define ZIG_DECL extern\n#define CPP_DECL extern \n\n") catch {};
|
||||
var bufset = std.BufSet.init(std.heap.c_allocator);
|
||||
impl.writer().print("//-- AUTOGENERATED FILE -- {d}\n", .{std.time.timestamp()}) catch unreachable;
|
||||
impl.writer().writeAll(
|
||||
\\#pragma once
|
||||
\\
|
||||
\\#include <stddef.h>
|
||||
\\#include <stdint.h>
|
||||
\\#include <stdbool.h>
|
||||
\\
|
||||
\\#include "root.h"
|
||||
\\
|
||||
) catch {};
|
||||
|
||||
var impl_second_buffer = std.ArrayList(u8).init(std.heap.c_allocator);
|
||||
var impl_second_writer = impl_second_buffer.writer();
|
||||
|
||||
var impl_third_buffer = std.ArrayList(u8).init(std.heap.c_allocator);
|
||||
var impl_third_writer = impl_third_buffer.writer();
|
||||
|
||||
var to_get_sizes: usize = 0;
|
||||
inline for (all_decls) |_decls| {
|
||||
if (comptime _decls.is_pub) {
|
||||
switch (_decls.data) {
|
||||
.Type => |Type| {
|
||||
@setEvalBranchQuota(99999);
|
||||
if (@hasDecl(Type, "Extern")) {
|
||||
|
||||
if (@hasDecl(Type, "Extern") or @hasDecl(Type, "Export")) {
|
||||
const identifier = comptime std.fmt.comptimePrint("{s}_{s}", .{ Type.shim.name, Type.shim.namespace });
|
||||
if (!bufset.contains(identifier)) {
|
||||
self.startFile(Type, Type.shim.name, file);
|
||||
self.startFile(
|
||||
Type,
|
||||
Type.shim.name,
|
||||
writer,
|
||||
impl,
|
||||
);
|
||||
|
||||
bufset.insert(identifier) catch unreachable;
|
||||
|
||||
var gen = C_Generator.init(Type.name, file);
|
||||
var gen = C_Generator.init(Type.name, @TypeOf(writer), writer);
|
||||
defer gen.deinit();
|
||||
inline for (Type.Extern) |extern_decl| {
|
||||
if (@hasDecl(Type, extern_decl)) {
|
||||
const normalized_name = comptime brk: {
|
||||
var _normalized_name: [Type.name.len]u8 = undefined;
|
||||
_ = std.mem.replace(u8, Type.name, ":", "_", std.mem.span(&_normalized_name));
|
||||
break :brk _normalized_name;
|
||||
};
|
||||
|
||||
processDecl(
|
||||
if (@hasDecl(Type, "Extern")) {
|
||||
if (to_get_sizes > 0) {
|
||||
impl_second_writer.writeAll(", ") catch unreachable;
|
||||
impl_third_writer.writeAll(", ") catch unreachable;
|
||||
}
|
||||
|
||||
const formatted_name = comptime brk: {
|
||||
var original: [Type.name.len]u8 = undefined;
|
||||
_ = std.mem.replace(u8, Type.name, ":", "_", &original);
|
||||
break :brk original;
|
||||
};
|
||||
|
||||
impl_third_writer.print("sizeof({s})", .{comptime Type.name}) catch unreachable;
|
||||
impl_second_writer.print("\"{s}\"", .{formatted_name}) catch unreachable;
|
||||
to_get_sizes += 1;
|
||||
const ExternList = comptime brk: {
|
||||
const Sorder = struct {
|
||||
pub fn lessThan(context: @This(), lhs: []const u8, rhs: []const u8) bool {
|
||||
return std.ascii.orderIgnoreCase(lhs, rhs) == std.math.Order.lt;
|
||||
}
|
||||
};
|
||||
var extern_list = Type.Extern;
|
||||
std.sort.sort([]const u8, &extern_list, Sorder{}, Sorder.lessThan);
|
||||
break :brk extern_list;
|
||||
};
|
||||
// impl_writer.print(" #include {s}\n", .{Type.include}) catch unreachable;
|
||||
inline for (&ExternList) |extern_decl| {
|
||||
if (@hasDecl(Type, extern_decl)) {
|
||||
const normalized_name = comptime brk: {
|
||||
var _normalized_name: [Type.name.len]u8 = undefined;
|
||||
_ = std.mem.replace(u8, Type.name, ":", "_", std.mem.span(&_normalized_name));
|
||||
break :brk _normalized_name;
|
||||
};
|
||||
|
||||
processDecl(
|
||||
self,
|
||||
writer,
|
||||
&gen,
|
||||
Type,
|
||||
comptime std.meta.declarationInfo(Type, extern_decl),
|
||||
comptime extern_decl,
|
||||
comptime std.mem.span(&normalized_name),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (@hasDecl(Type, "Export")) {
|
||||
const ExportLIst = comptime brk: {
|
||||
const Sorder = struct {
|
||||
pub fn lessThan(context: @This(), comptime lhs: StaticExport, comptime rhs: StaticExport) bool {
|
||||
return std.ascii.orderIgnoreCase(lhs.symbol_name, rhs.symbol_name) == std.math.Order.lt;
|
||||
}
|
||||
};
|
||||
var extern_list = Type.Export;
|
||||
std.sort.sort(StaticExport, &extern_list, Sorder{}, Sorder.lessThan);
|
||||
break :brk extern_list;
|
||||
};
|
||||
|
||||
gen.direction = C_Generator.Direction.export_zig;
|
||||
inline for (ExportLIst) |static_export| {
|
||||
processStaticExport(
|
||||
self,
|
||||
file,
|
||||
&gen,
|
||||
Type,
|
||||
comptime std.meta.declarationInfo(Type, extern_decl),
|
||||
comptime extern_decl,
|
||||
comptime std.mem.span(&normalized_name),
|
||||
comptime static_export,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -415,6 +660,90 @@ pub fn HeaderGen(comptime import: type, comptime fname: []const u8) type {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl.writer().print("\nconst size_t sizes[{d}] = {{", .{to_get_sizes}) catch unreachable;
|
||||
impl.writeAll(impl_third_buffer.items) catch unreachable;
|
||||
impl.writeAll("};\n") catch unreachable;
|
||||
impl.writer().print("\nconst char* names[{d}] = {{", .{to_get_sizes}) catch unreachable;
|
||||
impl.writeAll(impl_second_buffer.items) catch unreachable;
|
||||
impl.writeAll("};\n") catch unreachable;
|
||||
|
||||
var iter = type_names.iterator();
|
||||
|
||||
const NamespaceMap = std.StringArrayHashMap(std.BufMap);
|
||||
var namespaces = NamespaceMap.init(std.heap.c_allocator);
|
||||
|
||||
file_writer.writeAll("\n#ifndef __cplusplus\n") catch unreachable;
|
||||
while (iter.next()) |entry| {
|
||||
const key = entry.key_ptr.*;
|
||||
const value = entry.value_ptr.*;
|
||||
if (std.mem.indexOfScalar(u8, entry.key_ptr.*, ':')) |namespace_start| {
|
||||
const namespace = entry.key_ptr.*[0..namespace_start];
|
||||
file_writer.print(" typedef struct {s} {s}; // {s}\n", .{
|
||||
value,
|
||||
value,
|
||||
key,
|
||||
}) catch unreachable;
|
||||
if (!namespaces.contains(namespace)) {
|
||||
namespaces.put(namespace, std.BufMap.init(std.heap.c_allocator)) catch unreachable;
|
||||
}
|
||||
const class = key[namespace_start + 2 ..];
|
||||
namespaces.getPtr(namespace).?.put(class, value) catch unreachable;
|
||||
} else {
|
||||
file_writer.print(" typedef {s} {s};\n", .{
|
||||
key,
|
||||
value,
|
||||
}) catch unreachable;
|
||||
|
||||
impl_writer.print(" typedef {s} {s};\n", .{
|
||||
key,
|
||||
value,
|
||||
}) catch unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
file_writer.writeAll("\n#endif\n") catch unreachable;
|
||||
var size_iter = size_map.iterator();
|
||||
while (size_iter.next()) |size| {
|
||||
file_writer.print(" typedef struct b{s} {{ char bytes[{d}]; }} b{s};\n", .{
|
||||
size.key_ptr.*,
|
||||
size.value_ptr.*,
|
||||
size.key_ptr.*,
|
||||
}) catch unreachable;
|
||||
}
|
||||
|
||||
file_writer.writeAll("\n#ifdef __cplusplus\n") catch unreachable;
|
||||
|
||||
iter = type_names.iterator();
|
||||
var namespace_iter = namespaces.iterator();
|
||||
while (namespace_iter.next()) |map| {
|
||||
file_writer.print(" namespace {s} {{\n", .{map.key_ptr.*}) catch unreachable;
|
||||
var classes = map.value_ptr.iterator();
|
||||
while (classes.next()) |class| {
|
||||
file_writer.print(" class {s};\n", .{class.key_ptr.*}) catch unreachable;
|
||||
}
|
||||
file_writer.writeAll(" }\n") catch unreachable;
|
||||
}
|
||||
|
||||
file_writer.writeAll("\n") catch unreachable;
|
||||
|
||||
file_writer.writeAll(impl_buffer.items) catch unreachable;
|
||||
|
||||
iter = type_names.iterator();
|
||||
namespace_iter = namespaces.iterator();
|
||||
while (namespace_iter.next()) |map| {
|
||||
var classes = map.value_ptr.iterator();
|
||||
while (classes.next()) |class| {
|
||||
file_writer.print(" using {s} = {s}::{s};\n", .{
|
||||
class.value_ptr.*,
|
||||
map.key_ptr.*,
|
||||
class.key_ptr.*,
|
||||
}) catch unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
file_writer.writeAll("\n#endif\n\n") catch unreachable;
|
||||
|
||||
file.writeAll(buffer.items) catch unreachable;
|
||||
|
||||
// processDecls(
|
||||
// self,
|
||||
|
||||
194
src/javascript/jsc/bindings/headers-cpp.h
Normal file
194
src/javascript/jsc/bindings/headers-cpp.h
Normal file
@@ -0,0 +1,194 @@
|
||||
//-- AUTOGENERATED FILE -- 1626855517
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "root.h"
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSObject_h_
|
||||
#define INCLUDED__JavaScriptCore_JSObject_h_
|
||||
#include <JavaScriptCore/JSObject.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSObject_object_size_ = sizeof(JSC::JSObject);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_PropertyNameArray_h_
|
||||
#define INCLUDED__JavaScriptCore_PropertyNameArray_h_
|
||||
#include <JavaScriptCore/PropertyNameArray.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__PropertyNameArray_object_size_ = sizeof(JSC::PropertyNameArray);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSCell_h_
|
||||
#define INCLUDED__JavaScriptCore_JSCell_h_
|
||||
#include <JavaScriptCore/JSCell.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSCell_object_size_ = sizeof(JSC::JSCell);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSString_h_
|
||||
#define INCLUDED__JavaScriptCore_JSString_h_
|
||||
#include <JavaScriptCore/JSString.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSString_object_size_ = sizeof(JSC::JSString);
|
||||
|
||||
#ifndef INCLUDED__ZigGlobalObject_h_
|
||||
#define INCLUDED__ZigGlobalObject_h_
|
||||
#include "ZigGlobalObject.h"
|
||||
#endif
|
||||
|
||||
extern "C" const size_t Zig__GlobalObject_object_size_ = sizeof(Zig::GlobalObject);
|
||||
|
||||
#ifndef INCLUDED__DefaultGlobal_h_
|
||||
#define INCLUDED__DefaultGlobal_h_
|
||||
#include "DefaultGlobal.h"
|
||||
#endif
|
||||
|
||||
extern "C" const size_t Wundle__DefaultGlobal_object_size_ = sizeof(Wundle::DefaultGlobal);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSModuleLoader_h_
|
||||
#define INCLUDED__JavaScriptCore_JSModuleLoader_h_
|
||||
#include <JavaScriptCore/JSModuleLoader.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSModuleLoader_object_size_ = sizeof(JSC::JSModuleLoader);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSModuleRecord_h_
|
||||
#define INCLUDED__JavaScriptCore_JSModuleRecord_h_
|
||||
#include <JavaScriptCore/JSModuleRecord.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSModuleRecord_object_size_ = sizeof(JSC::JSModuleRecord);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSPromise_h_
|
||||
#define INCLUDED__JavaScriptCore_JSPromise_h_
|
||||
#include <JavaScriptCore/JSPromise.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSPromise_object_size_ = sizeof(JSC::JSPromise);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_SourceOrigin_h_
|
||||
#define INCLUDED__JavaScriptCore_SourceOrigin_h_
|
||||
#include <JavaScriptCore/SourceOrigin.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__SourceOrigin_object_size_ = sizeof(JSC::SourceOrigin);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_SourceProvider_h_
|
||||
#define INCLUDED__JavaScriptCore_SourceProvider_h_
|
||||
#include <JavaScriptCore/SourceProvider.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__SourceCode_object_size_ = sizeof(JSC::SourceCode);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSFunction_h_
|
||||
#define INCLUDED__JavaScriptCore_JSFunction_h_
|
||||
#include <JavaScriptCore/JSFunction.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSFunction_object_size_ = sizeof(JSC::JSFunction);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSGlobalObject_h_
|
||||
#define INCLUDED__JavaScriptCore_JSGlobalObject_h_
|
||||
#include <JavaScriptCore/JSGlobalObject.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSGlobalObject_object_size_ = sizeof(JSC::JSGlobalObject);
|
||||
|
||||
#ifndef INCLUDED__wtf_URL_h_
|
||||
#define INCLUDED__wtf_URL_h_
|
||||
#include <wtf/URL.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t WTF__URL_object_size_ = sizeof(WTF::URL);
|
||||
|
||||
#ifndef INCLUDED__wtf_text_WTFString_h_
|
||||
#define INCLUDED__wtf_text_WTFString_h_
|
||||
#include <wtf/text/WTFString.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t WTF__String_object_size_ = sizeof(WTF::String);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_JSValue_h_
|
||||
#define INCLUDED__JavaScriptCore_JSValue_h_
|
||||
#include <JavaScriptCore/JSValue.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__JSValue_object_size_ = sizeof(JSC::JSValue);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_PropertyName_h_
|
||||
#define INCLUDED__JavaScriptCore_PropertyName_h_
|
||||
#include <JavaScriptCore/PropertyName.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__PropertyName_object_size_ = sizeof(JSC::PropertyName);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_Exception_h_
|
||||
#define INCLUDED__JavaScriptCore_Exception_h_
|
||||
#include <JavaScriptCore/Exception.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__Exception_object_size_ = sizeof(JSC::Exception);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_VM_h_
|
||||
#define INCLUDED__JavaScriptCore_VM_h_
|
||||
#include <JavaScriptCore/VM.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__VM_object_size_ = sizeof(JSC::VM);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_ThrowScope_h_
|
||||
#define INCLUDED__JavaScriptCore_ThrowScope_h_
|
||||
#include <JavaScriptCore/ThrowScope.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__ThrowScope_object_size_ = sizeof(JSC::ThrowScope);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_CatchScope_h_
|
||||
#define INCLUDED__JavaScriptCore_CatchScope_h_
|
||||
#include <JavaScriptCore/CatchScope.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__CatchScope_object_size_ = sizeof(JSC::CatchScope);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_CallFrame_h_
|
||||
#define INCLUDED__JavaScriptCore_CallFrame_h_
|
||||
#include <JavaScriptCore/CallFrame.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__CallFrame_object_size_ = sizeof(JSC::CallFrame);
|
||||
|
||||
#ifndef INCLUDED__JavaScriptCore_Identifier_h_
|
||||
#define INCLUDED__JavaScriptCore_Identifier_h_
|
||||
#include <JavaScriptCore/Identifier.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t JSC__Identifier_object_size_ = sizeof(JSC::Identifier);
|
||||
|
||||
#ifndef INCLUDED__wtf_text_StringImpl_h_
|
||||
#define INCLUDED__wtf_text_StringImpl_h_
|
||||
#include <wtf/text/StringImpl.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t WTF__StringImpl_object_size_ = sizeof(WTF::StringImpl);
|
||||
|
||||
#ifndef INCLUDED__wtf_text_ExternalStringImpl_h_
|
||||
#define INCLUDED__wtf_text_ExternalStringImpl_h_
|
||||
#include <wtf/text/ExternalStringImpl.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t WTF__ExternalStringImpl_object_size_ = sizeof(WTF::ExternalStringImpl);
|
||||
|
||||
#ifndef INCLUDED__wtf_text_StringView_h_
|
||||
#define INCLUDED__wtf_text_StringView_h_
|
||||
#include <wtf/text/StringView.h>
|
||||
#endif
|
||||
|
||||
extern "C" const size_t WTF__StringView_object_size_ = sizeof(WTF::StringView);
|
||||
|
||||
const size_t sizes[25] = {sizeof(JSC::JSObject), sizeof(JSC::PropertyNameArray), sizeof(JSC::JSCell), sizeof(JSC::JSString), sizeof(Wundle::DefaultGlobal), sizeof(JSC::JSModuleLoader), sizeof(JSC::JSModuleRecord), sizeof(JSC::JSPromise), sizeof(JSC::SourceOrigin), sizeof(JSC::SourceCode), sizeof(JSC::JSFunction), sizeof(JSC::JSGlobalObject), sizeof(WTF::URL), sizeof(WTF::String), sizeof(JSC::JSValue), sizeof(JSC::PropertyName), sizeof(JSC::Exception), sizeof(JSC::VM), sizeof(JSC::ThrowScope), sizeof(JSC::CatchScope), sizeof(JSC::CallFrame), sizeof(JSC::Identifier), sizeof(WTF::StringImpl), sizeof(WTF::ExternalStringImpl), sizeof(WTF::StringView)};
|
||||
|
||||
const char* names[25] = {"JSC__JSObject", "JSC__PropertyNameArray", "JSC__JSCell", "JSC__JSString", "Wundle__DefaultGlobal", "JSC__JSModuleLoader", "JSC__JSModuleRecord", "JSC__JSPromise", "JSC__SourceOrigin", "JSC__SourceCode", "JSC__JSFunction", "JSC__JSGlobalObject", "WTF__URL", "WTF__String", "JSC__JSValue", "JSC__PropertyName", "JSC__Exception", "JSC__VM", "JSC__ThrowScope", "JSC__CatchScope", "JSC__CallFrame", "JSC__Identifier", "WTF__StringImpl", "WTF__ExternalStringImpl", "WTF__StringView"};
|
||||
@@ -1,440 +1,492 @@
|
||||
//-- AUTOGENERATED FILE -- 1626855517
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#define ZIG_DECL extern
|
||||
#define CPP_DECL extern
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define AUTO_EXTERN_C extern "C"
|
||||
#else
|
||||
#define AUTO_EXTERN_C
|
||||
#endif
|
||||
#define ZIG_DECL AUTO_EXTERN_C
|
||||
#define CPP_DECL AUTO_EXTERN_C
|
||||
#define CPP_SIZE AUTO_EXTERN_C
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef struct JSC__StringPrototype JSC__StringPrototype; // JSC::StringPrototype
|
||||
typedef struct JSC__GeneratorPrototype JSC__GeneratorPrototype; // JSC::GeneratorPrototype
|
||||
typedef struct JSC__ArrayIteratorPrototype JSC__ArrayIteratorPrototype; // JSC::ArrayIteratorPrototype
|
||||
typedef struct JSC__CatchScope JSC__CatchScope; // JSC::CatchScope
|
||||
typedef struct WTF__StringView WTF__StringView; // WTF::StringView
|
||||
typedef struct JSC__JSPromisePrototype JSC__JSPromisePrototype; // JSC::JSPromisePrototype
|
||||
typedef struct JSC__CallFrame JSC__CallFrame; // JSC::CallFrame
|
||||
typedef struct JSC__ThrowScope JSC__ThrowScope; // JSC::ThrowScope
|
||||
typedef struct JSC__PropertyName JSC__PropertyName; // JSC::PropertyName
|
||||
typedef struct JSC__JSObject JSC__JSObject; // JSC::JSObject
|
||||
typedef struct WTF__StringImpl WTF__StringImpl; // WTF::StringImpl
|
||||
typedef struct JSC__AsyncIteratorPrototype JSC__AsyncIteratorPrototype; // JSC::AsyncIteratorPrototype
|
||||
typedef struct WTF__ExternalStringImpl WTF__ExternalStringImpl; // WTF::ExternalStringImpl
|
||||
typedef struct JSC__JSLock JSC__JSLock; // JSC::JSLock
|
||||
typedef struct JSC__JSModuleLoader JSC__JSModuleLoader; // JSC::JSModuleLoader
|
||||
typedef struct JSC__VM JSC__VM; // JSC::VM
|
||||
typedef struct JSC__AsyncGeneratorPrototype JSC__AsyncGeneratorPrototype; // JSC::AsyncGeneratorPrototype
|
||||
typedef struct JSC__AsyncGeneratorFunctionPrototype JSC__AsyncGeneratorFunctionPrototype; // JSC::AsyncGeneratorFunctionPrototype
|
||||
typedef struct JSC__JSGlobalObject JSC__JSGlobalObject; // JSC::JSGlobalObject
|
||||
typedef struct Wundle__DefaultGlobal Wundle__DefaultGlobal; // Wundle::DefaultGlobal
|
||||
typedef struct JSC__JSFunction JSC__JSFunction; // JSC::JSFunction
|
||||
typedef struct JSC__ArrayPrototype JSC__ArrayPrototype; // JSC::ArrayPrototype
|
||||
typedef struct JSC__AsyncFunctionPrototype JSC__AsyncFunctionPrototype; // JSC::AsyncFunctionPrototype
|
||||
typedef struct JSC__JSPromise JSC__JSPromise; // JSC::JSPromise
|
||||
typedef struct JSC__Identifier JSC__Identifier; // JSC::Identifier
|
||||
typedef struct JSC__SetIteratorPrototype JSC__SetIteratorPrototype; // JSC::SetIteratorPrototype
|
||||
typedef struct JSC__SourceCode JSC__SourceCode; // JSC::SourceCode
|
||||
typedef struct JSC__JSCell JSC__JSCell; // JSC::JSCell
|
||||
typedef struct JSC__BigIntPrototype JSC__BigIntPrototype; // JSC::BigIntPrototype
|
||||
typedef struct JSC__GeneratorFunctionPrototype JSC__GeneratorFunctionPrototype; // JSC::GeneratorFunctionPrototype
|
||||
typedef struct JSC__SourceOrigin JSC__SourceOrigin; // JSC::SourceOrigin
|
||||
typedef struct JSC__JSModuleRecord JSC__JSModuleRecord; // JSC::JSModuleRecord
|
||||
typedef struct WTF__String WTF__String; // WTF::String
|
||||
typedef struct WTF__URL WTF__URL; // WTF::URL
|
||||
typedef int64_t JSC__JSValue;
|
||||
typedef struct JSC__IteratorPrototype JSC__IteratorPrototype; // JSC::IteratorPrototype
|
||||
typedef struct JSC__FunctionPrototype JSC__FunctionPrototype; // JSC::FunctionPrototype
|
||||
typedef struct JSC__Exception JSC__Exception; // JSC::Exception
|
||||
typedef struct JSC__JSString JSC__JSString; // JSC::JSString
|
||||
typedef struct JSC__PropertyNameArray JSC__PropertyNameArray; // JSC::PropertyNameArray
|
||||
typedef struct JSC__ObjectPrototype JSC__ObjectPrototype; // JSC::ObjectPrototype
|
||||
typedef struct JSC__MapIteratorPrototype JSC__MapIteratorPrototype; // JSC::MapIteratorPrototype
|
||||
typedef struct JSC__RegExpPrototype JSC__RegExpPrototype; // JSC::RegExpPrototype
|
||||
|
||||
#endif
|
||||
typedef struct bJSC__JSModuleRecord { char bytes[344]; } bJSC__JSModuleRecord;
|
||||
typedef struct bJSC__PropertyNameArray { char bytes[48]; } bJSC__PropertyNameArray;
|
||||
typedef struct bJSC__PropertyName { char bytes[8]; } bJSC__PropertyName;
|
||||
typedef struct bJSC__ThrowScope { char bytes[8]; } bJSC__ThrowScope;
|
||||
typedef struct bJSC__CallFrame { char bytes[8]; } bJSC__CallFrame;
|
||||
typedef struct bJSC__CatchScope { char bytes[8]; } bJSC__CatchScope;
|
||||
typedef struct bWTF__String { char bytes[8]; } bWTF__String;
|
||||
typedef struct bWTF__StringView { char bytes[24]; } bWTF__StringView;
|
||||
typedef struct bJSC__JSModuleLoader { char bytes[16]; } bJSC__JSModuleLoader;
|
||||
typedef struct bJSC__SourceOrigin { char bytes[48]; } bJSC__SourceOrigin;
|
||||
typedef struct bJSC__VM { char bytes[49080]; } bJSC__VM;
|
||||
typedef struct bJSC__JSString { char bytes[16]; } bJSC__JSString;
|
||||
typedef struct bJSC__Exception { char bytes[40]; } bJSC__Exception;
|
||||
typedef struct bWTF__ExternalStringImpl { char bytes[32]; } bWTF__ExternalStringImpl;
|
||||
typedef struct bWTF__StringImpl { char bytes[24]; } bWTF__StringImpl;
|
||||
typedef struct bJSC__SourceCode { char bytes[24]; } bJSC__SourceCode;
|
||||
typedef struct bJSC__JSPromise { char bytes[32]; } bJSC__JSPromise;
|
||||
typedef struct bWTF__URL { char bytes[40]; } bWTF__URL;
|
||||
typedef struct bJSC__JSFunction { char bytes[32]; } bJSC__JSFunction;
|
||||
typedef struct bJSC__JSGlobalObject { char bytes[2464]; } bJSC__JSGlobalObject;
|
||||
typedef struct bJSC__JSCell { char bytes[8]; } bJSC__JSCell;
|
||||
typedef struct bJSC__JSLock { char bytes[40]; } bJSC__JSLock;
|
||||
typedef struct bWundle__DefaultGlobal { char bytes[2464]; } bWundle__DefaultGlobal;
|
||||
typedef struct bJSC__JSObject { char bytes[16]; } bJSC__JSObject;
|
||||
typedef struct bJSC__Identifier { char bytes[8]; } bJSC__Identifier;
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace JSC {
|
||||
class JSCell;
|
||||
class Exception;
|
||||
class StringPrototype;
|
||||
class JSPromisePrototype;
|
||||
class GeneratorFunctionPrototype;
|
||||
class ArrayPrototype;
|
||||
class JSString;
|
||||
class JSObject;
|
||||
class AsyncIteratorPrototype;
|
||||
class AsyncGeneratorFunctionPrototype;
|
||||
class JSPromise;
|
||||
class Identifier;
|
||||
class RegExpPrototype;
|
||||
class AsyncFunctionPrototype;
|
||||
class CatchScope;
|
||||
class VM;
|
||||
class BigIntPrototype;
|
||||
class SetIteratorPrototype;
|
||||
class ThrowScope;
|
||||
class SourceOrigin;
|
||||
class PropertyNameArray;
|
||||
class AsyncGeneratorPrototype;
|
||||
class PropertyName;
|
||||
class MapIteratorPrototype;
|
||||
class JSModuleRecord;
|
||||
class ArrayIteratorPrototype;
|
||||
class JSFunction;
|
||||
class JSModuleLoader;
|
||||
class GeneratorPrototype;
|
||||
class JSGlobalObject;
|
||||
class SourceCode;
|
||||
class JSLock;
|
||||
class FunctionPrototype;
|
||||
class IteratorPrototype;
|
||||
class CallFrame;
|
||||
class ObjectPrototype;
|
||||
}
|
||||
namespace WTF {
|
||||
class URL;
|
||||
class StringImpl;
|
||||
class String;
|
||||
class StringView;
|
||||
class ExternalStringImpl;
|
||||
}
|
||||
namespace Wundle {
|
||||
class DefaultGlobal;
|
||||
}
|
||||
|
||||
typedef int64_t JSC__JSValue;
|
||||
using JSC__JSCell = JSC::JSCell;
|
||||
using JSC__Exception = JSC::Exception;
|
||||
using JSC__StringPrototype = JSC::StringPrototype;
|
||||
using JSC__JSPromisePrototype = JSC::JSPromisePrototype;
|
||||
using JSC__GeneratorFunctionPrototype = JSC::GeneratorFunctionPrototype;
|
||||
using JSC__ArrayPrototype = JSC::ArrayPrototype;
|
||||
using JSC__JSString = JSC::JSString;
|
||||
using JSC__JSObject = JSC::JSObject;
|
||||
using JSC__AsyncIteratorPrototype = JSC::AsyncIteratorPrototype;
|
||||
using JSC__AsyncGeneratorFunctionPrototype = JSC::AsyncGeneratorFunctionPrototype;
|
||||
using JSC__JSPromise = JSC::JSPromise;
|
||||
using JSC__Identifier = JSC::Identifier;
|
||||
using JSC__RegExpPrototype = JSC::RegExpPrototype;
|
||||
using JSC__AsyncFunctionPrototype = JSC::AsyncFunctionPrototype;
|
||||
using JSC__CatchScope = JSC::CatchScope;
|
||||
using JSC__VM = JSC::VM;
|
||||
using JSC__BigIntPrototype = JSC::BigIntPrototype;
|
||||
using JSC__SetIteratorPrototype = JSC::SetIteratorPrototype;
|
||||
using JSC__ThrowScope = JSC::ThrowScope;
|
||||
using JSC__SourceOrigin = JSC::SourceOrigin;
|
||||
using JSC__PropertyNameArray = JSC::PropertyNameArray;
|
||||
using JSC__AsyncGeneratorPrototype = JSC::AsyncGeneratorPrototype;
|
||||
using JSC__PropertyName = JSC::PropertyName;
|
||||
using JSC__MapIteratorPrototype = JSC::MapIteratorPrototype;
|
||||
using JSC__JSModuleRecord = JSC::JSModuleRecord;
|
||||
using JSC__ArrayIteratorPrototype = JSC::ArrayIteratorPrototype;
|
||||
using JSC__JSFunction = JSC::JSFunction;
|
||||
using JSC__JSModuleLoader = JSC::JSModuleLoader;
|
||||
using JSC__GeneratorPrototype = JSC::GeneratorPrototype;
|
||||
using JSC__JSGlobalObject = JSC::JSGlobalObject;
|
||||
using JSC__SourceCode = JSC::SourceCode;
|
||||
using JSC__JSLock = JSC::JSLock;
|
||||
using JSC__FunctionPrototype = JSC::FunctionPrototype;
|
||||
using JSC__IteratorPrototype = JSC::IteratorPrototype;
|
||||
using JSC__CallFrame = JSC::CallFrame;
|
||||
using JSC__ObjectPrototype = JSC::ObjectPrototype;
|
||||
using WTF__URL = WTF::URL;
|
||||
using WTF__StringImpl = WTF::StringImpl;
|
||||
using WTF__String = WTF::String;
|
||||
using WTF__StringView = WTF::StringView;
|
||||
using WTF__ExternalStringImpl = WTF::ExternalStringImpl;
|
||||
using Wundle__DefaultGlobal = Wundle::DefaultGlobal;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#pragma mark - JSC::JSObject
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSObject_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSObject_h
|
||||
#include <JavaScriptCore/JSObject.h>
|
||||
namespace JSC {
|
||||
class JSObject;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" bool JSC__JSObject__hasProperty(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2);
|
||||
CPP_DECL "C" JSC::PropertyNameArray* JSC__JSObject__getPropertyNames(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" size_t JSC__JSObject__getArrayLength(JSC::JSObject* arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSObject__getDirect(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2);
|
||||
CPP_DECL "C" bool JSC__JSObject__putDirect(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2, JSC::JSValue arg3);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSObject__get(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSObject__getAtIndex(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2, uint32_t arg3);
|
||||
CPP_DECL "C" bool JSC__JSObject__putAtIndex(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2, uint32_t arg3);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSObject__getIfExists(JSC::JSObject* arg0, JSC::JSGlobalObject* arg1, JSC::PropertyName* arg2);
|
||||
CPP_DECL size_t JSC__JSObject__getArrayLength(JSC__JSObject* arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSObject__getAtIndex(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, JSC__PropertyName* arg2, uint32_t arg3);
|
||||
CPP_DECL bool JSC__JSObject__putAtIndex(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, JSC__PropertyName* arg2, uint32_t arg3);
|
||||
|
||||
#pragma mark - JSC::PropertyNameArray
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_PropertyNameArray_h
|
||||
#define BINDINGS__decls__JavaScriptCore_PropertyNameArray_h
|
||||
#include <JavaScriptCore/PropertyNameArray.h>
|
||||
namespace JSC {
|
||||
class PropertyNameArray;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" size_t JSC__PropertyNameArray__length(JSC::PropertyNameArray* arg0);
|
||||
CPP_DECL "C" void JSC__PropertyNameArray__release(JSC::PropertyNameArray* arg0);
|
||||
CPP_DECL "C" const JSC::PropertyName* JSC__PropertyNameArray__next(JSC::PropertyNameArray* arg0, size_t arg1);
|
||||
CPP_DECL size_t JSC__PropertyNameArray__length(JSC__PropertyNameArray* arg0);
|
||||
CPP_DECL const JSC__PropertyName* JSC__PropertyNameArray__next(JSC__PropertyNameArray* arg0, size_t arg1);
|
||||
CPP_DECL void JSC__PropertyNameArray__release(JSC__PropertyNameArray* arg0);
|
||||
|
||||
#pragma mark - JSC::JSCell
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSCell_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSCell_h
|
||||
#include <JavaScriptCore/JSCell.h>
|
||||
namespace JSC {
|
||||
class JSCell;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSCell__getObject(JSC::JSCell* arg0);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__JSCell__getString(JSC::JSCell* arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" char JSC__JSCell__getType(JSC::JSCell* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSCell__getObject(JSC__JSCell* arg0);
|
||||
CPP_DECL WTF__String* JSC__JSCell__getString(JSC__JSCell* arg0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL char JSC__JSCell__getType(JSC__JSCell* arg0);
|
||||
|
||||
#pragma mark - JSC::JSString
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSString_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSString_h
|
||||
#include <JavaScriptCore/JSString.h>
|
||||
namespace JSC {
|
||||
class JSString;
|
||||
}
|
||||
#endif
|
||||
CPP_DECL bool JSC__JSString__createFromOwnedString(JSC__VM* arg0, const WTF__StringImpl* arg1);
|
||||
CPP_DECL bool JSC__JSString__createFromString(JSC__VM* arg0, const WTF__StringImpl* arg1);
|
||||
CPP_DECL bool JSC__JSString__eql(const JSC__JSString* arg0, const JSC__JSString* arg1);
|
||||
CPP_DECL JSC__JSObject* JSC__JSString__getObject(JSC__JSString* arg0);
|
||||
CPP_DECL bool JSC__JSString__is8Bit(const JSC__JSString* arg0);
|
||||
CPP_DECL size_t JSC__JSString__length(const JSC__JSString* arg0);
|
||||
CPP_DECL WTF__String* JSC__JSString__value(JSC__JSString* arg0, JSC__JSGlobalObject* arg1);
|
||||
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSString__getObject(JSC::JSString* arg0);
|
||||
CPP_DECL "C" bool JSC__JSString__eql(const JSC::JSString* arg0, const JSC::JSString* arg1);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__JSString__value(JSC::JSString* arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" size_t JSC__JSString__length(const JSC::JSString* arg0);
|
||||
CPP_DECL "C" bool JSC__JSString__is8Bit(const JSC::JSString* arg0);
|
||||
CPP_DECL "C" bool JSC__JSString__createFromOwnedString(JSC::VM* arg0, WTF::StringImpl* arg1);
|
||||
CPP_DECL "C" bool JSC__JSString__createFromString(JSC::VM* arg0, WTF::StringImpl* arg1);
|
||||
#pragma mark - Zig::GlobalObject
|
||||
|
||||
ZIG_DECL JSC__JSValue Zig__GlobalObject__eval(JSC__JSGlobalObject* arg0, JSC__JSModuleLoader* arg1, JSC__JSValue JSValue2, JSC__JSValue JSValue3, JSC__JSValue JSValue4, JSC__JSValue JSValue5, JSC__JSValue JSValue6);
|
||||
ZIG_DECL JSC__JSPromise* Zig__GlobalObject__fetch(JSC__JSGlobalObject* arg0, JSC__JSModuleLoader* arg1, JSC__JSValue JSValue2, JSC__JSValue JSValue3, JSC__JSValue JSValue4);
|
||||
ZIG_DECL JSC__JSPromise* Zig__GlobalObject__import(JSC__JSGlobalObject* arg0, JSC__JSModuleLoader* arg1, JSC__JSString* arg2, JSC__JSValue JSValue3, const JSC__SourceOrigin* arg4);
|
||||
ZIG_DECL JSC__JSValue Zig__GlobalObject__reportUncaughtException(JSC__JSGlobalObject* arg0, JSC__JSPromise* arg1, uint32_t JSPromiseRejectionOperation2);
|
||||
ZIG_DECL const JSC__Identifier* Zig__GlobalObject__resolve(JSC__JSGlobalObject* arg0, JSC__JSModuleLoader* arg1, JSC__JSString* arg2, JSC__JSValue JSValue3, const JSC__SourceOrigin* arg4);
|
||||
|
||||
#pragma mark - Wundle::DefaultGlobal
|
||||
|
||||
CPP_DECL Wundle__DefaultGlobal* Wundle__DefaultGlobal__create(Wundle__DefaultGlobal* arg0, void* arg1);
|
||||
CPP_DECL void* Wundle__DefaultGlobal__getWrapper(Wundle__DefaultGlobal* arg0);
|
||||
|
||||
#pragma mark - JSC::JSModuleLoader
|
||||
|
||||
CPP_DECL JSC__JSValue JSC__JSModuleLoader__dependencyKeysIfEvaluated(JSC__JSModuleLoader* arg0, JSC__JSGlobalObject* arg1, JSC__JSModuleRecord* arg2);
|
||||
|
||||
#pragma mark - JSC::JSModuleRecord
|
||||
|
||||
CPP_DECL const JSC__SourceCode* JSC__JSModuleRecord__sourceCode(JSC__JSModuleRecord* arg0);
|
||||
|
||||
#pragma mark - JSC::JSPromise
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSPromise_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSPromise_h
|
||||
#include <JavaScriptCore/JSPromise.h>
|
||||
namespace JSC {
|
||||
class JSPromise;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" uint32_t JSC__JSPromise__status(JSC::JSPromise* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSPromise__result(JSC::JSPromise* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" bool JSC__JSPromise__isHandled(JSC::JSPromise* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" JSC::JSPromise* JSC__JSPromise__resolvedPromise(JSC::JSGlobalObject* arg0, JSC::JSValue arg1);
|
||||
CPP_DECL "C" JSC::JSPromise* JSC__JSPromise__rejectedPromise(JSC::JSGlobalObject* arg0, JSC::JSValue arg1);
|
||||
CPP_DECL "C" void JSC__JSPromise__resolve(JSC::JSGlobalObject* arg0, JSC::JSValue arg1);
|
||||
CPP_DECL "C" void JSC__JSPromise__reject(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::JSValue arg2);
|
||||
CPP_DECL "C" void JSC__JSPromise__rejectAsHandled(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::JSValue arg2);
|
||||
CPP_DECL "C" void JSC__JSPromise__rejectException(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::Exception* arg2);
|
||||
CPP_DECL "C" void JSC__JSPromise__rejectAsHandledException(JSC::JSPromise* arg0, JSC::JSGlobalObject* arg1, JSC::Exception* arg2);
|
||||
CPP_DECL "C" bool JSC__JSPromise__isInternal(JSC::JSPromise* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" JSC::JSPromise* JSC__JSPromise__createDeferred(JSC::JSGlobalObject* arg0, JSC::JSFunction* arg1, JSC::JSFunction* arg2, JSC::Exception* arg3);
|
||||
CPP_DECL JSC__JSPromise* JSC__JSPromise__createDeferred(JSC__JSGlobalObject* arg0, JSC__JSFunction* arg1, JSC__JSFunction* arg2, JSC__Exception* arg3);
|
||||
CPP_DECL bool JSC__JSPromise__isHandled(const JSC__JSPromise* arg0, JSC__VM* arg1);
|
||||
CPP_DECL bool JSC__JSPromise__isInternal(JSC__JSPromise* arg0, JSC__VM* arg1);
|
||||
CPP_DECL void JSC__JSPromise__reject(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2);
|
||||
CPP_DECL void JSC__JSPromise__rejectAsHandled(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2);
|
||||
CPP_DECL void JSC__JSPromise__rejectAsHandledException(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__Exception* arg2);
|
||||
CPP_DECL JSC__JSPromise* JSC__JSPromise__rejectedPromise(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1);
|
||||
CPP_DECL void JSC__JSPromise__rejectException(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, JSC__Exception* arg2);
|
||||
CPP_DECL void JSC__JSPromise__rejectWithCaughtException(JSC__JSPromise* arg0, JSC__JSGlobalObject* arg1, bJSC__ThrowScope arg2);
|
||||
CPP_DECL void JSC__JSPromise__resolve(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1);
|
||||
CPP_DECL JSC__JSPromise* JSC__JSPromise__resolvedPromise(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1);
|
||||
CPP_DECL JSC__JSValue JSC__JSPromise__result(const JSC__JSPromise* arg0, JSC__VM* arg1);
|
||||
CPP_DECL uint32_t JSC__JSPromise__status(const JSC__JSPromise* arg0, JSC__VM* arg1);
|
||||
|
||||
#pragma mark - JSC::SourceOrigin
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_SourceOrigin_h
|
||||
#define BINDINGS__decls__JavaScriptCore_SourceOrigin_h
|
||||
#include <JavaScriptCore/SourceOrigin.h>
|
||||
namespace JSC {
|
||||
class SourceOrigin;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" const JSC::SourceOrigin* JSC__SourceOrigin__fromURL(const WTF::URL* arg0);
|
||||
CPP_DECL const JSC__SourceOrigin* JSC__SourceOrigin__fromURL(const WTF__URL* arg0);
|
||||
|
||||
#pragma mark - JSC::SourceCode
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_SourceProvider_h
|
||||
#define BINDINGS__decls__JavaScriptCore_SourceProvider_h
|
||||
#include <JavaScriptCore/SourceProvider.h>
|
||||
namespace JSC {
|
||||
class SourceCode;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" const JSC::SourceCode* JSC__SourceCode__fromString(const WTF::WTFString* arg0, const JSC::SourceOrigin* arg1, WTF::WTFString* arg2, char SourceType3);
|
||||
CPP_DECL const JSC__SourceCode* JSC__SourceCode__fromString(const WTF__String* arg0, const JSC__SourceOrigin* arg1, WTF__String* arg2, char SourceType3);
|
||||
|
||||
#pragma mark - JSC::JSFunction
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSFunction_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSFunction_h
|
||||
#include <JavaScriptCore/JSFunction.h>
|
||||
namespace JSC {
|
||||
class JSFunction;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" JSC::JSFunction* JSC__JSFunction__createFromSourceCode(JSC::SourceCode* arg0, JSC::SourceOrigin* arg1, JSC::Exception* arg2);
|
||||
CPP_DECL "C" JSC::JSFunction* JSC__JSFunction__createFromNative(JSC::VM* arg0, JSC::JSGlobalObject* arg1, uint32_t arg2, WTF::WTFString* arg3, void* arg4);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__JSFunction__getName(JSC::JSFunction* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__JSFunction__displayName(JSC::JSFunction* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__JSFunction__calculatedDisplayName(JSC::JSFunction* arg0, JSC::VM* arg1);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__callWithArgumentsAndThis(JSC::JSFunction* arg0, JSC::JSValue arg1, JSC::JSGlobalObject* arg2, JSC::JSValue* arg3, size_t arg4, JSC::Exception** arg5, char* arg6);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__callWithArguments(JSC::JSFunction* arg0, JSC::JSGlobalObject* arg1, JSC::JSValue* arg2, size_t arg3, JSC::Exception** arg4, char* arg5);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__callWithThis(JSC::JSFunction* arg0, JSC::JSGlobalObject* arg1, JSC::JSValue arg2, JSC::Exception** arg3, char* arg4);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__callWithoutAnyArgumentsOrThis(JSC::JSFunction* arg0, JSC::JSGlobalObject* arg1, JSC::Exception** arg2, char* arg3);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__constructWithArgumentsAndNewTarget(JSC::JSFunction* arg0, JSC::JSValue arg1, JSC::JSGlobalObject* arg2, JSC::JSValue* arg3, size_t arg4, JSC::Exception** arg5, char* arg6);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__constructWithArguments(JSC::JSFunction* arg0, JSC::JSGlobalObject* arg1, JSC::JSValue* arg2, size_t arg3, JSC::Exception** arg4, char* arg5);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__constructWithNewTarget(JSC::JSFunction* arg0, JSC::JSGlobalObject* arg1, JSC::JSValue arg2, JSC::Exception** arg3, char* arg4);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSFunction__constructWithoutAnyArgumentsOrNewTarget(JSC::JSFunction* arg0, JSC::JSGlobalObject* arg1, JSC::Exception** arg2, char* arg3);
|
||||
CPP_DECL WTF__String* JSC__JSFunction__calculatedDisplayName(JSC__JSFunction* arg0, JSC__VM* arg1);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__callWithArguments(JSC__JSFunction* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue arg2, size_t arg3, JSC__Exception** arg4, char* arg5);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__callWithArgumentsAndThis(JSC__JSFunction* arg0, JSC__JSValue JSValue1, JSC__JSGlobalObject* arg2, JSC__JSValue arg3, size_t arg4, JSC__Exception** arg5, char* arg6);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__callWithoutAnyArgumentsOrThis(JSC__JSFunction* arg0, JSC__JSGlobalObject* arg1, JSC__Exception** arg2, char* arg3);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__callWithThis(JSC__JSFunction* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2, JSC__Exception** arg3, char* arg4);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__constructWithArguments(JSC__JSFunction* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue arg2, size_t arg3, JSC__Exception** arg4, char* arg5);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__constructWithArgumentsAndNewTarget(JSC__JSFunction* arg0, JSC__JSValue JSValue1, JSC__JSGlobalObject* arg2, JSC__JSValue arg3, size_t arg4, JSC__Exception** arg5, char* arg6);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__constructWithNewTarget(JSC__JSFunction* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2, JSC__Exception** arg3, char* arg4);
|
||||
CPP_DECL JSC__JSValue JSC__JSFunction__constructWithoutAnyArgumentsOrNewTarget(JSC__JSFunction* arg0, JSC__JSGlobalObject* arg1, JSC__Exception** arg2, char* arg3);
|
||||
CPP_DECL JSC__JSFunction* JSC__JSFunction__createFromNative(JSC__VM* arg0, JSC__JSGlobalObject* arg1, uint32_t arg2, WTF__String* arg3, void* arg4);
|
||||
CPP_DECL JSC__JSFunction* JSC__JSFunction__createFromSourceCode(JSC__SourceCode* arg0, JSC__SourceOrigin* arg1, JSC__Exception* arg2);
|
||||
CPP_DECL WTF__String* JSC__JSFunction__displayName(JSC__JSFunction* arg0, JSC__VM* arg1);
|
||||
CPP_DECL WTF__String* JSC__JSFunction__getName(JSC__JSFunction* arg0, JSC__VM* arg1);
|
||||
|
||||
#pragma mark - JSC::JSGlobalObject
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSGlobalObject_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSGlobalObject_h
|
||||
#include <JavaScriptCore/JSGlobalObject.h>
|
||||
namespace JSC {
|
||||
class JSGlobalObject;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" JSC::ObjectPrototype* JSC__JSGlobalObject__objectPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::FunctionPrototype* JSC__JSGlobalObject__functionPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::ArrayPrototype* JSC__JSGlobalObject__arrayPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__booleanPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::StringPrototype* JSC__JSGlobalObject__stringPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__numberPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::BigIntPrototype* JSC__JSGlobalObject__bigIntPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__datePrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__symbolPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::RegExpPrototype* JSC__JSGlobalObject__regExpPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__errorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::IteratorPrototype* JSC__JSGlobalObject__iteratorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::AsyncIteratorPrototype* JSC__JSGlobalObject__asyncIteratorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::GeneratorFunctionPrototype* JSC__JSGlobalObject__generatorFunctionPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::GeneratorPrototype* JSC__JSGlobalObject__generatorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::AsyncFunctionPrototype* JSC__JSGlobalObject__asyncFunctionPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::ArrayIteratorPrototype* JSC__JSGlobalObject__arrayIteratorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::MapIteratorPrototype* JSC__JSGlobalObject__mapIteratorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::SetIteratorPrototype* JSC__JSGlobalObject__setIteratorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__mapPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__jsSetPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::JSPromisePrototype* JSC__JSGlobalObject__promisePrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::AsyncGeneratorPrototype* JSC__JSGlobalObject__asyncGeneratorPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL "C" JSC::AsyncGeneratorFunctionPrototype* JSC__JSGlobalObject__asyncGeneratorFunctionPrototype(JSC::JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__ArrayIteratorPrototype* JSC__JSGlobalObject__arrayIteratorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__ArrayPrototype* JSC__JSGlobalObject__arrayPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__AsyncFunctionPrototype* JSC__JSGlobalObject__asyncFunctionPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__AsyncGeneratorFunctionPrototype* JSC__JSGlobalObject__asyncGeneratorFunctionPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__AsyncGeneratorPrototype* JSC__JSGlobalObject__asyncGeneratorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__AsyncIteratorPrototype* JSC__JSGlobalObject__asyncIteratorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__BigIntPrototype* JSC__JSGlobalObject__bigIntPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__booleanPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__createError(JSC__JSGlobalObject* arg0, char ErrorType1, WTF__String* arg2);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__datePrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__errorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__FunctionPrototype* JSC__JSGlobalObject__functionPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__GeneratorFunctionPrototype* JSC__JSGlobalObject__generatorFunctionPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__GeneratorPrototype* JSC__JSGlobalObject__generatorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__IteratorPrototype* JSC__JSGlobalObject__iteratorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__jsSetPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__MapIteratorPrototype* JSC__JSGlobalObject__mapIteratorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__mapPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__numberPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__ObjectPrototype* JSC__JSGlobalObject__objectPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSPromisePrototype* JSC__JSGlobalObject__promisePrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__RegExpPrototype* JSC__JSGlobalObject__regExpPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__SetIteratorPrototype* JSC__JSGlobalObject__setIteratorPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__StringPrototype* JSC__JSGlobalObject__stringPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__symbolPrototype(JSC__JSGlobalObject* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__JSGlobalObject__throwError(JSC__JSGlobalObject* arg0, JSC__JSObject* arg1);
|
||||
CPP_DECL JSC__VM* JSC__JSGlobalObject__vm(JSC__JSGlobalObject* arg0);
|
||||
|
||||
#pragma mark - WTF::URL
|
||||
|
||||
#ifndef BINDINGS__decls__wtf_URL_h
|
||||
#define BINDINGS__decls__wtf_URL_h
|
||||
#include <wtf/URL.h>
|
||||
namespace WTF {
|
||||
class URL;
|
||||
}
|
||||
#endif
|
||||
CPP_DECL bWTF__StringView WTF__URL__encodedPassword(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__encodedUser(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__String WTF__URL__fileSystemPath(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__fragmentIdentifier(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__fragmentIdentifierWithLeadingNumberSign(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__URL WTF__URL__fromFileSystemPath(bWTF__StringView arg0);
|
||||
CPP_DECL bWTF__URL WTF__URL__fromString(bWTF__String arg0, bWTF__String arg1);
|
||||
CPP_DECL bWTF__StringView WTF__URL__host(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__String WTF__URL__hostAndPort(WTF__URL* arg0);
|
||||
CPP_DECL bool WTF__URL__isEmpty(const WTF__URL* arg0);
|
||||
CPP_DECL bool WTF__URL__isValid(const WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__lastPathComponent(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__String WTF__URL__password(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__path(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__protocol(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__String WTF__URL__protocolHostAndPort(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__query(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__queryWithLeadingQuestionMark(WTF__URL* arg0);
|
||||
CPP_DECL void WTF__URL__setHost(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL void WTF__URL__setHostAndPort(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL void WTF__URL__setPassword(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL void WTF__URL__setPath(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL void WTF__URL__setProtocol(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL void WTF__URL__setQuery(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL void WTF__URL__setUser(WTF__URL* arg0, bWTF__StringView arg1);
|
||||
CPP_DECL bWTF__String WTF__URL__stringWithoutFragmentIdentifier(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__URL__stringWithoutQueryOrFragmentIdentifier(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__URL WTF__URL__truncatedForUseAsBase(WTF__URL* arg0);
|
||||
CPP_DECL bWTF__String WTF__URL__user(WTF__URL* arg0);
|
||||
|
||||
CPP_DECL "C" WTF::URL* WTF__URL__fromFileSystemPath(const WTF::StringView* arg0);
|
||||
CPP_DECL "C" WTF::URL* WTF__URL__fromString(const WTF::WTFString* arg0, const WTF::WTFString* arg1);
|
||||
CPP_DECL "C" bool WTF__URL__isEmpty(const WTF::URL* arg0);
|
||||
CPP_DECL "C" bool WTF__URL__isValid(const WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__protocol(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__encodedUser(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__encodedPassword(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__host(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__path(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__lastPathComponent(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__query(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__fragmentIdentifier(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__queryWithLeadingQuestionMark(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__fragmentIdentifierWithLeadingNumberSign(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__stringWithoutQueryOrFragmentIdentifier(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::StringView* WTF__URL__stringWithoutFragmentIdentifier(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::WTFString* WTF__URL__protocolHostAndPort(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::WTFString* WTF__URL__hostAndPort(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::WTFString* WTF__URL__user(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::WTFString* WTF__URL__password(WTF::URL* arg0);
|
||||
CPP_DECL "C" const WTF::WTFString* WTF__URL__fileSystemPath(WTF::URL* arg0);
|
||||
CPP_DECL "C" void WTF__URL__setProtocol(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" void WTF__URL__setHost(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" void WTF__URL__setHostAndPort(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" void WTF__URL__setUser(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" void WTF__URL__setPassword(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" void WTF__URL__setPath(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" void WTF__URL__setQuery(WTF::URL* arg0, const WTF::StringView* arg1);
|
||||
CPP_DECL "C" WTF::URL* WTF__URL__truncatedForUseAsBase(WTF::URL* arg0);
|
||||
#pragma mark - WTF::String
|
||||
|
||||
#pragma mark - WTF::WTFString
|
||||
|
||||
#ifndef BINDINGS__decls__wtf_text_WTFString_h
|
||||
#define BINDINGS__decls__wtf_text_WTFString_h
|
||||
#include <wtf/text/WTFString.h>
|
||||
namespace WTF {
|
||||
class WTFString;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" bool WTF__WTFString__is8Bit(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" bool WTF__WTFString__is16Bit(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" bool WTF__WTFString__isExternal(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" bool WTF__WTFString__isStatic(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" bool WTF__WTFString__isEmpty(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" size_t WTF__WTFString__length(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" char* WTF__WTFString__characters8(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" char* WTF__WTFString__characters16(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" WTF::WTFString* WTF__WTFString__createWithoutCopyingFromPtr(const char* arg0, size_t arg1);
|
||||
CPP_DECL "C" bool WTF__WTFString__eqlString(WTF::WTFString* arg0, WTF::WTFString* arg1);
|
||||
CPP_DECL "C" bool WTF__WTFString__eqlSlice(WTF::WTFString* arg0, char* arg1, size_t arg2);
|
||||
CPP_DECL "C" WTF::StringImpl* WTF__WTFString__impl(WTF::WTFString* arg0);
|
||||
CPP_DECL "C" WTF::WTFString* WTF__WTFString__createFromExternalString(WTF::StringImpl* arg0);
|
||||
CPP_DECL const uint16_t* WTF__String__characters16(WTF__String* arg0);
|
||||
CPP_DECL const char* WTF__String__characters8(WTF__String* arg0);
|
||||
CPP_DECL bWTF__String WTF__String__createFromExternalString(bWTF__ExternalStringImpl arg0);
|
||||
CPP_DECL bWTF__String WTF__String__createWithoutCopyingFromPtr(const char* arg0, size_t arg1);
|
||||
CPP_DECL bool WTF__String__eqlSlice(WTF__String* arg0, const char* arg1, size_t arg2);
|
||||
CPP_DECL bool WTF__String__eqlString(WTF__String* arg0, const WTF__String* arg1);
|
||||
CPP_DECL const WTF__StringImpl* WTF__String__impl(WTF__String* arg0);
|
||||
CPP_DECL bool WTF__String__is16Bit(WTF__String* arg0);
|
||||
CPP_DECL bool WTF__String__is8Bit(WTF__String* arg0);
|
||||
CPP_DECL bool WTF__String__isEmpty(WTF__String* arg0);
|
||||
CPP_DECL bool WTF__String__isExternal(WTF__String* arg0);
|
||||
CPP_DECL bool WTF__String__isStatic(WTF__String* arg0);
|
||||
CPP_DECL size_t WTF__String__length(WTF__String* arg0);
|
||||
|
||||
#pragma mark - JSC::JSValue
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSValue_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSValue_h
|
||||
#include <JavaScriptCore/JSValue.h>
|
||||
namespace JSC {
|
||||
class JSValue;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" uint64_t JSC__JSValue__encode(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSString* JSC__JSValue__asString(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSString* JSC__JSValue__asObject(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSString* JSC__JSValue__asNumber(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isError(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNull();
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsUndefined();
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsTDZValue();
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsBoolean(bool arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsDoubleNumber(double arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNumberFromDouble(double arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNumberFromChar(char arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNumberFromU16(uint16_t arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNumberFromInt32(int32_t arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNumberFromInt64(int64_t arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__jsNumberFromUint64(uint64_t arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isUndefined(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isNull(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isUndefinedOrNull(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isBoolean(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isAnyInt(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isUInt32AsAnyInt(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isInt32AsAnyInt(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isNumber(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isString(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isBigInt(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isHeapBigInt(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isBigInt32(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isSymbol(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isPrimitive(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isGetterSetter(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isCustomGetterSetter(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isObject(JSC::JSValue arg0);
|
||||
CPP_DECL "C" bool JSC__JSValue__isCell(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSCell* JSC__JSValue__asCell(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSString* JSC__JSValue__toString(JSC::JSValue arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" JSC::JSString* JSC__JSValue__toStringOrNull(JSC::JSValue arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" JSC::Identifier* JSC__JSValue__toPropertyKey(JSC::JSValue arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__toPropertyKeyValue(JSC::JSValue arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSValue__toObject(JSC::JSValue arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__JSValue__toWTFString(JSC::JSValue arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__getPrototype(JSC::JSValue arg0, JSC::JSGlobalObject* arg1);
|
||||
CPP_DECL "C" JSC::JSValue JSC__JSValue__getPropertyByPropertyName(JSC::JSValue arg0, JSC::PropertyName* arg1, JSC::JSGlobalObject* arg2);
|
||||
CPP_DECL "C" bool JSC__JSValue__eqlValue(JSC::JSValue arg0, JSC::JSValue arg1);
|
||||
CPP_DECL "C" bool JSC__JSValue__eqlCell(JSC::JSValue arg0, JSC::JSCell* arg1);
|
||||
CPP_DECL JSC__JSCell* JSC__JSValue__asCell(JSC__JSValue JSValue0);
|
||||
CPP_DECL double JSC__JSValue__asNumber(JSC__JSValue JSValue0);
|
||||
CPP_DECL bJSC__JSObject JSC__JSValue__asObject(JSC__JSValue JSValue0);
|
||||
CPP_DECL JSC__JSString* JSC__JSValue__asString(JSC__JSValue JSValue0);
|
||||
CPP_DECL uint64_t JSC__JSValue__encode(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__eqlCell(JSC__JSValue JSValue0, JSC__JSCell* arg1);
|
||||
CPP_DECL bool JSC__JSValue__eqlValue(JSC__JSValue JSValue0, JSC__JSValue JSValue1);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__getPrototype(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL bool JSC__JSValue__isAnyInt(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isBigInt(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isBigInt32(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isBoolean(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isCell(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isCustomGetterSetter(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isError(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isGetterSetter(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isHeapBigInt(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isInt32AsAnyInt(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isNull(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isNumber(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isObject(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isPrimitive(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isString(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isSymbol(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isUInt32AsAnyInt(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isUndefined(JSC__JSValue JSValue0);
|
||||
CPP_DECL bool JSC__JSValue__isUndefinedOrNull(JSC__JSValue JSValue0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsBoolean(bool arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsDoubleNumber(double arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNull();
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNumberFromChar(char arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNumberFromDouble(double arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNumberFromInt32(int32_t arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNumberFromInt64(int64_t arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNumberFromU16(uint16_t arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsNumberFromUint64(uint64_t arg0);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsTDZValue();
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__jsUndefined();
|
||||
CPP_DECL JSC__JSObject* JSC__JSValue__toObject(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL bJSC__Identifier JSC__JSValue__toPropertyKey(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL JSC__JSValue JSC__JSValue__toPropertyKeyValue(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL JSC__JSString* JSC__JSValue__toString(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL JSC__JSString* JSC__JSValue__toString(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL JSC__JSString* JSC__JSValue__toStringOrNull(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1);
|
||||
|
||||
#pragma mark - JSC::PropertyName
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_PropertyName_h
|
||||
#define BINDINGS__decls__JavaScriptCore_PropertyName_h
|
||||
#include <JavaScriptCore/PropertyName.h>
|
||||
namespace JSC {
|
||||
class PropertyName;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" bool JSC__PropertyName__eqlToPropertyName(JSC::PropertyName* arg0, const JSC::PropertyName* arg1);
|
||||
CPP_DECL "C" bool JSC__PropertyName__eqlToIdentifier(JSC::PropertyName* arg0, const JSC::Identifier* arg1);
|
||||
CPP_DECL "C" WTF::StringImpl* JSC__PropertyName__publicName(JSC::PropertyName* arg0);
|
||||
CPP_DECL "C" WTF::StringImpl* JSC__PropertyName__uid(JSC::PropertyName* arg0);
|
||||
CPP_DECL bool JSC__PropertyName__eqlToIdentifier(JSC__PropertyName* arg0, const JSC__Identifier* arg1);
|
||||
CPP_DECL bool JSC__PropertyName__eqlToPropertyName(JSC__PropertyName* arg0, const JSC__PropertyName* arg1);
|
||||
CPP_DECL const WTF__StringImpl* JSC__PropertyName__publicName(JSC__PropertyName* arg0);
|
||||
CPP_DECL const WTF__StringImpl* JSC__PropertyName__uid(JSC__PropertyName* arg0);
|
||||
|
||||
#pragma mark - JSC::Exception
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_Exception_h
|
||||
#define BINDINGS__decls__JavaScriptCore_Exception_h
|
||||
#include <JavaScriptCore/Exception.h>
|
||||
namespace JSC {
|
||||
class Exception;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" JSC::Exception* JSC__Exception__create(JSC::JSGlobalObject* arg0, JSC::JSObject* arg1, char StackCaptureAction2);
|
||||
CPP_DECL JSC__Exception* JSC__Exception__create(JSC__JSGlobalObject* arg0, JSC__JSObject* arg1, char StackCaptureAction2);
|
||||
|
||||
#pragma mark - JSC::VM
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_VM_h
|
||||
#define BINDINGS__decls__JavaScriptCore_VM_h
|
||||
#include <JavaScriptCore/VM.h>
|
||||
namespace JSC {
|
||||
class VM;
|
||||
}
|
||||
#endif
|
||||
CPP_DECL JSC__JSLock* JSC__VM__apiLock(JSC__VM* arg0);
|
||||
CPP_DECL JSC__VM* JSC__VM__create(char HeapType0);
|
||||
CPP_DECL void JSC__VM__deinit(JSC__VM* arg0, JSC__JSGlobalObject* arg1);
|
||||
CPP_DECL void JSC__VM__drainMicrotasks(JSC__VM* arg0);
|
||||
CPP_DECL bool JSC__VM__executionForbidden(JSC__VM* arg0);
|
||||
CPP_DECL bool JSC__VM__isEntered(JSC__VM* arg0);
|
||||
CPP_DECL void JSC__VM__setExecutionForbidden(JSC__VM* arg0, bool arg1);
|
||||
CPP_DECL bool JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__ThrowScope* arg2, const char* arg3, size_t arg4);
|
||||
|
||||
CPP_DECL "C" JSC::VM* JSC__VM__create(char HeapType0);
|
||||
CPP_DECL "C" void JSC__VM__deinit(JSC::VM* arg0);
|
||||
CPP_DECL "C" void JSC__VM__setExecutionForbidden(JSC::VM* arg0, bool arg1);
|
||||
CPP_DECL "C" bool JSC__VM__executionForbidden(JSC::VM* arg0);
|
||||
CPP_DECL "C" bool JSC__VM__isEntered(JSC::VM* arg0);
|
||||
CPP_DECL "C" bool JSC__VM__throwError(JSC::VM* arg0, JSC::ExceptionScope* arg1, const char* arg2, size_t arg3);
|
||||
#pragma mark - JSC::ThrowScope
|
||||
|
||||
#pragma mark - JSC::ExceptionScope
|
||||
CPP_DECL void JSC__ThrowScope__clearException(JSC__ThrowScope* arg0);
|
||||
CPP_DECL bJSC__ThrowScope JSC__ThrowScope__declare(JSC__VM* arg0, char* arg1, char* arg2, size_t arg3);
|
||||
CPP_DECL JSC__Exception* JSC__ThrowScope__exception(JSC__ThrowScope* arg0);
|
||||
CPP_DECL void JSC__ThrowScope__release(JSC__ThrowScope* arg0);
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_ExceptionScope_h
|
||||
#define BINDINGS__decls__JavaScriptCore_ExceptionScope_h
|
||||
#include <JavaScriptCore/ExceptionScope.h>
|
||||
namespace JSC {
|
||||
class ExceptionScope;
|
||||
}
|
||||
#endif
|
||||
#pragma mark - JSC::CatchScope
|
||||
|
||||
CPP_DECL "C" void JSC__ExceptionScope__release(JSC::ExceptionScope* arg0);
|
||||
CPP_DECL "C" JSC::ExceptionScope* JSC__ExceptionScope__declareThrowScope(JSC::VM* arg0, char* arg1, char* arg2, size_t arg3);
|
||||
CPP_DECL "C" JSC::ExceptionScope* JSC__ExceptionScope__declareCatchScope(JSC::VM* arg0, char* arg1, char* arg2, size_t arg3);
|
||||
CPP_DECL "C" void JSC__ExceptionScope__release(JSC::ExceptionScope* arg0);
|
||||
CPP_DECL "C" JSC::Exception* JSC__ExceptionScope__exception(JSC::ExceptionScope* arg0);
|
||||
CPP_DECL "C" void JSC__ExceptionScope__clearException(JSC::ExceptionScope* arg0);
|
||||
CPP_DECL void JSC__CatchScope__clearException(JSC__CatchScope* arg0);
|
||||
CPP_DECL bJSC__CatchScope JSC__CatchScope__declare(JSC__VM* arg0, char* arg1, char* arg2, size_t arg3);
|
||||
CPP_DECL JSC__Exception* JSC__CatchScope__exception(JSC__CatchScope* arg0);
|
||||
|
||||
#pragma mark - JSC::CallFrame
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_CallFrame_h
|
||||
#define BINDINGS__decls__JavaScriptCore_CallFrame_h
|
||||
#include <JavaScriptCore/CallFrame.h>
|
||||
namespace JSC {
|
||||
class CallFrame;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" size_t JSC__CallFrame__argumentsCount(const JSC::CallFrame* arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__CallFrame__uncheckedArgument(const JSC::CallFrame* arg0, uint16_t arg1);
|
||||
CPP_DECL "C" JSC::JSValue JSC__CallFrame__argument(const JSC::CallFrame* arg0, uint16_t arg1);
|
||||
CPP_DECL "C" JSC::JSValue JSC__CallFrame__thisValue(const JSC::CallFrame* arg0);
|
||||
CPP_DECL "C" JSC::JSValue JSC__CallFrame__newTarget(const JSC::CallFrame* arg0);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__CallFrame__jsCallee(const JSC::CallFrame* arg0);
|
||||
CPP_DECL JSC__JSValue JSC__CallFrame__argument(const JSC__CallFrame* arg0, uint16_t arg1);
|
||||
CPP_DECL size_t JSC__CallFrame__argumentsCount(const JSC__CallFrame* arg0);
|
||||
CPP_DECL JSC__JSObject* JSC__CallFrame__jsCallee(const JSC__CallFrame* arg0);
|
||||
CPP_DECL JSC__JSValue JSC__CallFrame__newTarget(const JSC__CallFrame* arg0);
|
||||
CPP_DECL JSC__JSValue JSC__CallFrame__thisValue(const JSC__CallFrame* arg0);
|
||||
CPP_DECL JSC__JSValue JSC__CallFrame__uncheckedArgument(const JSC__CallFrame* arg0, uint16_t arg1);
|
||||
|
||||
#pragma mark - JSC::Identifier
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_Identifier_h
|
||||
#define BINDINGS__decls__JavaScriptCore_Identifier_h
|
||||
#include <JavaScriptCore/Identifier.h>
|
||||
namespace JSC {
|
||||
class Identifier;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" JSC::Identifier* JSC__Identifier__fromString(JSC::VM* arg0, WTF::WTFString* arg1);
|
||||
CPP_DECL "C" JSC::Identifier* JSC__Identifier__fromSlice(JSC::VM* arg0, char* arg1, size_t arg2);
|
||||
CPP_DECL "C" JSC::Identifier* JSC__Identifier__fromUid(JSC::VM* arg0, WTF::StringImpl* arg1);
|
||||
CPP_DECL "C" void JSC__Identifier__deinit(JSC::VM* arg0);
|
||||
CPP_DECL "C" WTF::WTFString* JSC__Identifier__toString(JSC::Identifier* arg0);
|
||||
CPP_DECL "C" size_t JSC__Identifier__length(JSC::Identifier* arg0);
|
||||
CPP_DECL "C" bool JSC__Identifier__isNull(JSC::Identifier* arg0);
|
||||
CPP_DECL "C" bool JSC__Identifier__isEmpty(JSC::Identifier* arg0);
|
||||
CPP_DECL "C" bool JSC__Identifier__isSymbol(JSC::Identifier* arg0);
|
||||
CPP_DECL "C" bool JSC__Identifier__isPrivateName(JSC::Identifier* arg0);
|
||||
CPP_DECL "C" bool JSC__Identifier__eqlIdent(JSC::Identifier* arg0, JSC::Identifier* arg1);
|
||||
CPP_DECL "C" bool JSC__Identifier__neqlIdent(JSC::Identifier* arg0, JSC::Identifier* arg1);
|
||||
CPP_DECL "C" bool JSC__Identifier__eqlStringImpl(JSC::Identifier* arg0, WTF::StringImpl* arg1);
|
||||
CPP_DECL "C" bool JSC__Identifier__neqlStringImpl(JSC::Identifier* arg0, WTF::StringImpl* arg1);
|
||||
CPP_DECL "C" bool JSC__Identifier__eqlUTF8(JSC::Identifier* arg0, char* arg1, size_t arg2);
|
||||
CPP_DECL void JSC__Identifier__deinit(const JSC__Identifier* arg0);
|
||||
CPP_DECL bool JSC__Identifier__eqlIdent(const JSC__Identifier* arg0, const JSC__Identifier* arg1);
|
||||
CPP_DECL bool JSC__Identifier__eqlStringImpl(const JSC__Identifier* arg0, const WTF__StringImpl* arg1);
|
||||
CPP_DECL bool JSC__Identifier__eqlUTF8(const JSC__Identifier* arg0, const char* arg1, size_t arg2);
|
||||
CPP_DECL bJSC__Identifier JSC__Identifier__fromSlice(JSC__VM* arg0, const char* arg1, size_t arg2);
|
||||
CPP_DECL bJSC__Identifier JSC__Identifier__fromString(JSC__VM* arg0, const WTF__String* arg1);
|
||||
CPP_DECL bJSC__Identifier JSC__Identifier__fromUid(JSC__VM* arg0, const WTF__StringImpl* arg1);
|
||||
CPP_DECL bool JSC__Identifier__isEmpty(const JSC__Identifier* arg0);
|
||||
CPP_DECL bool JSC__Identifier__isNull(const JSC__Identifier* arg0);
|
||||
CPP_DECL bool JSC__Identifier__isPrivateName(const JSC__Identifier* arg0);
|
||||
CPP_DECL bool JSC__Identifier__isSymbol(const JSC__Identifier* arg0);
|
||||
CPP_DECL size_t JSC__Identifier__length(const JSC__Identifier* arg0);
|
||||
CPP_DECL bool JSC__Identifier__neqlIdent(const JSC__Identifier* arg0, const JSC__Identifier* arg1);
|
||||
CPP_DECL bool JSC__Identifier__neqlStringImpl(const JSC__Identifier* arg0, const WTF__StringImpl* arg1);
|
||||
CPP_DECL bWTF__String JSC__Identifier__toString(const JSC__Identifier* arg0);
|
||||
|
||||
#pragma mark - WTF::StringImpl
|
||||
|
||||
#ifndef BINDINGS__decls__WTF_text_StringImpl_h
|
||||
#define BINDINGS__decls__WTF_text_StringImpl_h
|
||||
#include <WTF/text/StringImpl.h>
|
||||
namespace WTF {
|
||||
class StringImpl;
|
||||
}
|
||||
#endif
|
||||
CPP_DECL const uint16_t* WTF__StringImpl__characters16(const WTF__StringImpl* arg0);
|
||||
CPP_DECL const char* WTF__StringImpl__characters8(const WTF__StringImpl* arg0);
|
||||
CPP_DECL bool WTF__StringImpl__is16Bit(const WTF__StringImpl* arg0);
|
||||
CPP_DECL bool WTF__StringImpl__is8Bit(const WTF__StringImpl* arg0);
|
||||
CPP_DECL bool WTF__StringImpl__isEmpty(const WTF__StringImpl* arg0);
|
||||
CPP_DECL bool WTF__StringImpl__isExternal(const WTF__StringImpl* arg0);
|
||||
CPP_DECL bool WTF__StringImpl__isStatic(const WTF__StringImpl* arg0);
|
||||
CPP_DECL size_t WTF__StringImpl__length(const WTF__StringImpl* arg0);
|
||||
|
||||
CPP_DECL "C" bool WTF__StringImpl__is8Bit(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" bool WTF__StringImpl__is16Bit(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" bool WTF__StringImpl__isExternal(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" bool WTF__StringImpl__isStatic(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" bool WTF__StringImpl__isEmpty(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" size_t WTF__StringImpl__length(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" char* WTF__StringImpl__characters8(WTF::StringImpl* arg0);
|
||||
CPP_DECL "C" uint16_t* WTF__StringImpl__characters16(WTF::StringImpl* arg0);
|
||||
#pragma mark - WTF::ExternalStringImpl
|
||||
|
||||
CPP_DECL const uint16_t* WTF__ExternalStringImpl__characters16(const WTF__ExternalStringImpl* arg0);
|
||||
CPP_DECL const char* WTF__ExternalStringImpl__characters8(const WTF__ExternalStringImpl* arg0);
|
||||
CPP_DECL bWTF__ExternalStringImpl WTF__ExternalStringImpl__create(const char* arg0, size_t arg1, void (* ArgFn2)(void* arg0, char* arg1, size_t arg2));
|
||||
CPP_DECL bool WTF__ExternalStringImpl__is16Bit(const WTF__ExternalStringImpl* arg0);
|
||||
CPP_DECL bool WTF__ExternalStringImpl__is8Bit(const WTF__ExternalStringImpl* arg0);
|
||||
CPP_DECL bool WTF__ExternalStringImpl__isEmpty(const WTF__ExternalStringImpl* arg0);
|
||||
CPP_DECL size_t WTF__ExternalStringImpl__length(const WTF__ExternalStringImpl* arg0);
|
||||
|
||||
#pragma mark - WTF::StringView
|
||||
|
||||
#ifndef BINDINGS__decls__WTF_text_StringView_h
|
||||
#define BINDINGS__decls__WTF_text_StringView_h
|
||||
#include <WTF/text/StringView.h>
|
||||
namespace WTF {
|
||||
class StringView;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" WTF::StringView* WTF__StringView__from8Bit(const char* arg0, size_t arg1);
|
||||
CPP_DECL "C" bool WTF__StringView__is8Bit(WTF::StringView* arg0);
|
||||
CPP_DECL "C" bool WTF__StringView__is16Bit(WTF::StringView* arg0);
|
||||
CPP_DECL "C" bool WTF__StringView__isEmpty(WTF::StringView* arg0);
|
||||
CPP_DECL "C" size_t WTF__StringView__length(WTF::StringView* arg0);
|
||||
CPP_DECL "C" char* WTF__StringView__characters8(WTF::StringView* arg0);
|
||||
CPP_DECL "C" uint16_t* WTF__StringView__characters16(WTF::StringView* arg0);
|
||||
CPP_DECL const uint16_t* WTF__StringView__characters16(const WTF__StringView* arg0);
|
||||
CPP_DECL const char* WTF__StringView__characters8(const WTF__StringView* arg0);
|
||||
CPP_DECL bWTF__StringView WTF__StringView__from8Bit(const char* arg0, size_t arg1);
|
||||
CPP_DECL bool WTF__StringView__is16Bit(const WTF__StringView* arg0);
|
||||
CPP_DECL bool WTF__StringView__is8Bit(const WTF__StringView* arg0);
|
||||
CPP_DECL bool WTF__StringView__isEmpty(const WTF__StringView* arg0);
|
||||
CPP_DECL size_t WTF__StringView__length(const WTF__StringView* arg0);
|
||||
|
||||
38
src/javascript/jsc/bindings/sizes.zig
Normal file
38
src/javascript/jsc/bindings/sizes.zig
Normal file
@@ -0,0 +1,38 @@
|
||||
// Auto-generated by src/javascript/jsc/headergen/sizegen.cpp at 2021-07-21 02:02:1626858148.
|
||||
// These are the byte sizes for the different object types with bindings in JavaScriptCore.
|
||||
// This allows us to safely return stack allocated C++ types to Zig.
|
||||
// It is only safe to do this when these sizes are correct.
|
||||
// That means:
|
||||
// 1. We can't dynamically link JavaScriptCore
|
||||
// 2. It's important that this is run whenever JavaScriptCore is updated or the bindings on the Zig side change.
|
||||
// Failure to do so will lead to undefined behavior and probably some frustrated people.
|
||||
// --- To renegerate: ---
|
||||
// 1. "make jsc-bindings-headers"
|
||||
// 2. "make sizegen"
|
||||
// 3. "make jsc-bindings-headers"
|
||||
// You can verify the numbers written in this file at runtime via the `extern`d types
|
||||
pub const JSC__JSObject = 16;
|
||||
pub const JSC__PropertyNameArray = 48;
|
||||
pub const JSC__JSCell = 8;
|
||||
pub const JSC__JSString = 16;
|
||||
pub const Wundle__DefaultGlobal = 2464;
|
||||
pub const JSC__JSModuleLoader = 16;
|
||||
pub const JSC__JSModuleRecord = 344;
|
||||
pub const JSC__JSPromise = 32;
|
||||
pub const JSC__SourceOrigin = 48;
|
||||
pub const JSC__SourceCode = 24;
|
||||
pub const JSC__JSFunction = 32;
|
||||
pub const JSC__JSGlobalObject = 2464;
|
||||
pub const WTF__URL = 40;
|
||||
pub const WTF__String = 8;
|
||||
pub const JSC__JSValue = 8;
|
||||
pub const JSC__PropertyName = 8;
|
||||
pub const JSC__Exception = 40;
|
||||
pub const JSC__VM = 49080;
|
||||
pub const JSC__ThrowScope = 8;
|
||||
pub const JSC__CatchScope = 8;
|
||||
pub const JSC__CallFrame = 8;
|
||||
pub const JSC__Identifier = 8;
|
||||
pub const WTF__StringImpl = 24;
|
||||
pub const WTF__ExternalStringImpl = 32;
|
||||
pub const WTF__StringView = 24;
|
||||
8
src/javascript/jsc/bindings/static_export.zig
Normal file
8
src/javascript/jsc/bindings/static_export.zig
Normal file
@@ -0,0 +1,8 @@
|
||||
const std = @import("std");
|
||||
Type: type,
|
||||
symbol_name: []const u8,
|
||||
local_name: []const u8,
|
||||
Parent: type,
|
||||
pub fn Decl(comptime this: *const @This()) std.builtin.TypeInfo.Declaration {
|
||||
return comptime std.meta.declarationInfo(this.Parent, this.local_name);
|
||||
}
|
||||
40
src/javascript/jsc/headergen/sizegen.cpp
Normal file
40
src/javascript/jsc/headergen/sizegen.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <ctime>
|
||||
using namespace std;
|
||||
|
||||
#include "headers-cpp.h"
|
||||
|
||||
int main() {
|
||||
time_t rawtime;
|
||||
struct tm * timeinfo;
|
||||
char buf [80];
|
||||
|
||||
time (&rawtime);
|
||||
timeinfo = localtime (&rawtime);
|
||||
|
||||
strftime (buf,80,"%Y-%m-%d %H:%M:%s",timeinfo);
|
||||
|
||||
cout << "// Auto-generated by src/javascript/jsc/headergen/sizegen.cpp at " << buf << ".\n";
|
||||
cout << "// These are the byte sizes for the different object types with bindings in JavaScriptCore.\n";
|
||||
cout << "// This allows us to safely return stack allocated C++ types to Zig.\n";
|
||||
cout << "// It is only safe to do this when these sizes are correct.\n";
|
||||
cout << "// That means:\n";
|
||||
cout << "// 1. We can't dynamically link JavaScriptCore\n";
|
||||
cout << "// 2. It's important that this is run whenever JavaScriptCore is updated or the bindings on the Zig side change.\n";
|
||||
cout << "// Failure to do so will lead to undefined behavior and probably some frustrated people.\n";
|
||||
cout << "// --- Regenerate this: --- \n";
|
||||
cout << "// 1. \"make jsc-bindings-headers\"\n";
|
||||
cout << "// 2. \"make sizegen\"\n";
|
||||
cout << "// 3. \"make jsc-bindings-headers\"\n";
|
||||
cout << "// You can verify the numbers written in this file at runtime via the `extern`d types\n";
|
||||
cout << "// Run \"jsc-bindings-headers\" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values. \n";
|
||||
cout << "// The data for this file is generated in headers-cpp.h \n";
|
||||
int i = 0;
|
||||
int len = sizeof(sizes)/sizeof(sizes[0]);
|
||||
for (i = 0; i < len ; i++) {
|
||||
cout << "pub const " << names[i] << " = " << sizes[i] << ";\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user