mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
wrapped!
This commit is contained in:
4
.vscode/c_cpp_properties.json
vendored
4
.vscode/c_cpp_properties.json
vendored
@@ -35,9 +35,7 @@
|
||||
"BUILDING_JSCONLY__",
|
||||
"USE_FOUNDATION=1"
|
||||
],
|
||||
"macFrameworkPath": [
|
||||
// "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks"
|
||||
],
|
||||
"macFrameworkPath": [],
|
||||
"compilerPath": "/usr/local/opt/llvm/bin/clang",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -28,6 +28,7 @@
|
||||
"src/javascript/jsc/WebKit/WebInspectorUI": true
|
||||
},
|
||||
"files.associations": {
|
||||
"*.idl": "cpp"
|
||||
"*.idl": "cpp",
|
||||
"memory": "cpp"
|
||||
}
|
||||
}
|
||||
|
||||
12
Makefile
12
Makefile
@@ -4,10 +4,14 @@ speedy: speedy-prod-native speedy-prod-wasi speedy-prod-wasm
|
||||
api:
|
||||
peechy --schema src/api/schema.peechy --esm src/api/schema.js --ts src/api/schema.d.ts --zig src/api/schema.zig
|
||||
|
||||
jsc:
|
||||
jsc-mac
|
||||
jsc: jsc-build jsc-bindings
|
||||
jsc-build: jsc-build-mac
|
||||
jsc-bindings:
|
||||
jsc-bindings-headers
|
||||
jsc-bindings-mac
|
||||
|
||||
jsc-mac: jsc-build-mac 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"
|
||||
@@ -19,6 +23,8 @@ 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 \
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -86,77 +86,75 @@ JSValue DefaultGlobal::moduleLoaderEvaluate(JSGlobalObject* globalObject, JSModu
|
||||
using namespace JSC;
|
||||
|
||||
|
||||
JSC::ObjectPrototype* DefaultGlobal__objectPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::ObjectPrototype* JSC__JSGlobalObject__objectPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->objectPrototype();
|
||||
}
|
||||
JSC::FunctionPrototype* DefaultGlobal__functionPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::FunctionPrototype* JSC__JSGlobalObject__functionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->functionPrototype();
|
||||
}
|
||||
JSC::ArrayPrototype* DefaultGlobal__arrayPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::ArrayPrototype* JSC__JSGlobalObject__arrayPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->arrayPrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__booleanPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__booleanPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->booleanPrototype();
|
||||
}
|
||||
JSC::StringPrototype* DefaultGlobal__stringPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::StringPrototype* JSC__JSGlobalObject__stringPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->stringPrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__numberPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__numberPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->numberPrototype();
|
||||
}
|
||||
JSC::BigIntPrototype* DefaultGlobal__bigIntPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::BigIntPrototype* JSC__JSGlobalObject__bigIntPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->bigIntPrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__datePrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__datePrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->datePrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__symbolPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__symbolPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->symbolPrototype();
|
||||
}
|
||||
JSC::RegExpPrototype* DefaultGlobal__regExpPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::RegExpPrototype* JSC__JSGlobalObject__regExpPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->regExpPrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__errorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__errorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->errorPrototype();
|
||||
}
|
||||
JSC::IteratorPrototype* DefaultGlobal__iteratorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::IteratorPrototype* JSC__JSGlobalObject__iteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->iteratorPrototype();
|
||||
}
|
||||
JSC::AsyncIteratorPrototype* DefaultGlobal__asyncIteratorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::AsyncIteratorPrototype* JSC__JSGlobalObject__asyncIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncIteratorPrototype();
|
||||
}
|
||||
JSC::GeneratorFunctionPrototype* DefaultGlobal__generatorFunctionPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::GeneratorFunctionPrototype* JSC__JSGlobalObject__generatorFunctionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->generatorFunctionPrototype();
|
||||
}
|
||||
JSC::GeneratorPrototype* DefaultGlobal__generatorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::GeneratorPrototype* JSC__JSGlobalObject__generatorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->generatorPrototype();
|
||||
}
|
||||
JSC::AsyncFunctionPrototype* DefaultGlobal__asyncFunctionPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::AsyncFunctionPrototype* JSC__JSGlobalObject__asyncFunctionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncFunctionPrototype();
|
||||
}
|
||||
JSC::ArrayIteratorPrototype* DefaultGlobal__arrayIteratorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::ArrayIteratorPrototype* JSC__JSGlobalObject__arrayIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->arrayIteratorPrototype();
|
||||
}
|
||||
JSC::MapIteratorPrototype* DefaultGlobal__mapIteratorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::MapIteratorPrototype* JSC__JSGlobalObject__mapIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->mapIteratorPrototype();
|
||||
}
|
||||
JSC::SetIteratorPrototype* DefaultGlobal__setIteratorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::SetIteratorPrototype* JSC__JSGlobalObject__setIteratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->setIteratorPrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__mapPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__mapPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->mapPrototype();
|
||||
}
|
||||
JSC::JSObject* DefaultGlobal__jsSetPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSObject* JSC__JSGlobalObject__jsSetPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->jsSetPrototype();
|
||||
}
|
||||
JSC::JSPromisePrototype* DefaultGlobal__promisePrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::JSPromisePrototype* JSC__JSGlobalObject__promisePrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->promisePrototype();
|
||||
}
|
||||
JSC::AsyncGeneratorPrototype* DefaultGlobal__asyncGeneratorPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::AsyncGeneratorPrototype* JSC__JSGlobalObject__asyncGeneratorPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncGeneratorPrototype();
|
||||
}
|
||||
JSC::AsyncGeneratorFunctionPrototype* DefaultGlobal__asyncGeneratorFunctionPrototype(Wundle::DefaultGlobal* arg0) {
|
||||
JSC::AsyncGeneratorFunctionPrototype* JSC__JSGlobalObject__asyncGeneratorFunctionPrototype(JSC::JSGlobalObject* arg0) {
|
||||
return arg0->asyncGeneratorFunctionPrototype();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,5 @@ pub fn main() anyerror!void {
|
||||
Bindings,
|
||||
"src/javascript/jsc/bindings/bindings.zig",
|
||||
);
|
||||
|
||||
HeaderGenerator.exec(HeaderGenerator{}, file);
|
||||
}
|
||||
|
||||
@@ -7,22 +7,35 @@ const EnumMeta = std.builtin.TypeInfo.Enum;
|
||||
const UnionMeta = std.builtin.TypeInfo.Union;
|
||||
const warn = std.debug.warn;
|
||||
|
||||
fn isCppObject(comptime Type: type) bool {
|
||||
return switch (@typeInfo(Type)) {
|
||||
.Struct, .Union, .Opaque => true,
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub const C_Generator = struct {
|
||||
file: std.fs.File,
|
||||
filebase: []const u8,
|
||||
|
||||
direction: Direction = .export_cpp,
|
||||
const Self = @This();
|
||||
|
||||
pub const Direction = enum {
|
||||
export_cpp,
|
||||
export_zig,
|
||||
};
|
||||
|
||||
pub fn init(comptime src_file: []const u8, file: std.fs.File) Self {
|
||||
var res = Self{ .file = file, .filebase = src_file };
|
||||
|
||||
file.writeAll("\n/**** " ++ src_file ++ " /*****/\n\n") catch unreachable;
|
||||
return res;
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Self) void {
|
||||
self.file.writeAll("\n/***** ") catch unreachable;
|
||||
self.file.writeAll(self.filebase) catch unreachable;
|
||||
self.file.writeAll(" *****/") catch unreachable;
|
||||
pub fn deinit(self: *const Self) void {
|
||||
// self.file.writeAll("\n/**** </") catch unreachable;
|
||||
// self.file.writeAll(self.filebase) catch unreachable;
|
||||
// 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 {
|
||||
@@ -34,7 +47,11 @@ pub const C_Generator = struct {
|
||||
else => {},
|
||||
}
|
||||
|
||||
self.write("extern \"C\" ");
|
||||
switch (self.direction) {
|
||||
.export_cpp => self.write("CPP_DECL \"C\" "),
|
||||
.export_zig => self.write("ZIG_DECL \"C\" "),
|
||||
}
|
||||
|
||||
self.writeType(func.return_type);
|
||||
self.write(" " ++ name ++ "(");
|
||||
|
||||
@@ -43,7 +60,12 @@ pub const C_Generator = struct {
|
||||
if (func.arg_names.len > i) {
|
||||
self.write(comptime arg_names[i]);
|
||||
} else {
|
||||
self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
|
||||
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
|
||||
@@ -51,7 +73,16 @@ pub const C_Generator = struct {
|
||||
self.write(", ");
|
||||
}
|
||||
|
||||
self.write(");\n");
|
||||
self.write(")");
|
||||
defer self.write(";\n");
|
||||
// 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 {
|
||||
@@ -118,20 +149,20 @@ pub const C_Generator = struct {
|
||||
}
|
||||
|
||||
fn writeType(self: *Self, comptime T: type) void {
|
||||
const TT = if (@typeInfo(T) == .Pointer) @typeInfo(T).Pointer.child else T;
|
||||
const TT = comptime if (@typeInfo(T) == .Pointer) @typeInfo(T).Pointer.child else T;
|
||||
|
||||
if (comptime std.meta.trait.hasDecls(TT, .{"C"}) and std.meta.trait.hasDecls(TT.C, .{"name"})) {
|
||||
writeType(self, TT.C);
|
||||
if (std.meta.trait.isSingleItemPtr(T)) {
|
||||
write(self, "*");
|
||||
if (comptime (isCppObject(TT)) and @hasDecl(TT, "name")) {
|
||||
if (@typeInfo(T) == .Pointer or @hasDecl(TT, "Type") and @typeInfo(TT.Type) == .Pointer) {
|
||||
if (@hasDecl(TT, "is_pointer") and !TT.is_pointer) {} else if (@typeInfo(T).Pointer.is_const) {
|
||||
write(self, "const ");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (comptime std.meta.trait.hasDecls(TT, .{"name"})) {
|
||||
self.write(comptime T.name);
|
||||
if (std.meta.trait.isSingleItemPtr(T)) {
|
||||
write(self, "*");
|
||||
self.write(comptime TT.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, "*");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -141,7 +172,7 @@ pub const C_Generator = struct {
|
||||
bool => self.write("bool"),
|
||||
usize => self.write("size_t"),
|
||||
isize => self.write("int"),
|
||||
u8 => self.write("uint8_t"),
|
||||
u8 => self.write("char"),
|
||||
u16 => self.write("uint16_t"),
|
||||
u32 => self.write("uint32_t"),
|
||||
u64 => self.write("uint64_t"),
|
||||
@@ -150,10 +181,13 @@ pub const C_Generator = struct {
|
||||
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("uint8_t*"),
|
||||
[*]u8 => self.write("char*"),
|
||||
[*]u16 => self.write("uint16_t*"),
|
||||
[*]u32 => self.write("uint32_t*"),
|
||||
[*]u64 => self.write("uint64_t*"),
|
||||
@@ -161,11 +195,22 @@ pub const C_Generator = struct {
|
||||
[*]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 => {
|
||||
const child = meta.Pointer.child;
|
||||
.Pointer => |Pointer| {
|
||||
const child = Pointer.child;
|
||||
const childmeta = @typeInfo(child);
|
||||
// if (childmeta == .Struct and childmeta.Struct.layout != .Extern) {
|
||||
// self.write("void");
|
||||
@@ -176,7 +221,12 @@ pub const C_Generator = struct {
|
||||
},
|
||||
.Optional => self.writeType(meta.Optional.child),
|
||||
.Array => @compileError("Handle goofy looking C Arrays in the calling function"),
|
||||
else => self.write(@typeName(T) ++ "_t"),
|
||||
.Enum => |Enum| {
|
||||
self.writeType(Enum.tag_type);
|
||||
},
|
||||
else => {
|
||||
return self.write(@typeName(T));
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -226,10 +276,10 @@ pub fn getCStruct(comptime T: type) ?NamedStruct {
|
||||
}
|
||||
|
||||
inline for (std.meta.declarations(T)) |decl| {
|
||||
if (std.mem.eql(u8, decl.name, "C")) {
|
||||
if (std.mem.eql(u8, decl.name, "Type")) {
|
||||
switch (decl.data) {
|
||||
.Type => |TT| {
|
||||
return NamedStruct{ .Type = TT, .name = @typeName(T) };
|
||||
.Type => {
|
||||
return NamedStruct{ .Type = T, .name = @typeName(T) };
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
@@ -244,24 +294,14 @@ 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 processDecls(
|
||||
comptime self: Self,
|
||||
file: std.fs.File,
|
||||
comptime Parent: type,
|
||||
comptime Type: type,
|
||||
comptime prefix: []const u8,
|
||||
) void {
|
||||
const decls = std.meta.declarations(Type);
|
||||
var gen = C_Generator.init(prefix, file);
|
||||
defer gen.deinit();
|
||||
|
||||
pub fn startFile(comptime self: Self, comptime Type: type, comptime prefix: []const u8, file: std.fs.File) void {
|
||||
if (comptime std.meta.trait.hasDecls(Type, .{"include"})) {
|
||||
comptime var new_name = std.mem.zeroes([Type.include.len]u8);
|
||||
|
||||
@@ -270,65 +310,63 @@ pub fn HeaderGen(comptime import: type, comptime fname: []const u8) type {
|
||||
_ = std.mem.replace(u8, &new_name, ".", "_", std.mem.span(&new_name));
|
||||
}
|
||||
const inner_name = comptime std.mem.trim(u8, &new_name, "<>\"");
|
||||
file.writeAll("#ifndef BINDINGS__decls__" ++ inner_name ++ "\n") catch {};
|
||||
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 Wundle {\n class " ++ prefix ++ ";\n}\n") catch {};
|
||||
file.writeAll("namespace " ++ Type.namespace ++ " {\n class " ++ prefix ++ ";\n}\n") catch {};
|
||||
file.writeAll("#endif\n\n") catch {};
|
||||
}
|
||||
|
||||
// iterate exported enums
|
||||
// do this first in case target lang needs enums defined before use
|
||||
inline for (decls) |decl| {
|
||||
if (decl.is_pub and decl.data == .Type and comptime std.ascii.isUpper(decl.name[0])) {
|
||||
const T = decl.data.Type;
|
||||
const info = @typeInfo(T);
|
||||
if (info == .Enum and decl.is_pub) {
|
||||
const layout = info.Enum.layout;
|
||||
gen.gen_enum(prefix ++ "__" ++ decl.name, info.Enum);
|
||||
}
|
||||
pub fn processDecl(
|
||||
comptime self: Self,
|
||||
file: std.fs.File,
|
||||
gen: *C_Generator,
|
||||
comptime Container: type,
|
||||
comptime Decl: std.builtin.TypeInfo.Declaration,
|
||||
comptime name: []const u8,
|
||||
comptime prefix: []const u8,
|
||||
) void {
|
||||
switch (comptime Decl.data) {
|
||||
.Type => |Type| {
|
||||
switch (@typeInfo(Type)) {
|
||||
.Enum => |Enum| {
|
||||
const layout = Enum.layout;
|
||||
gen.gen_enum(prefix ++ "__" ++ name, Enum);
|
||||
},
|
||||
.Struct => |Struct| {
|
||||
gen.gen_struct(decl.name, Struct);
|
||||
},
|
||||
.Union => |Union| {
|
||||
const layout = Union.layout;
|
||||
gen.gen_union(prefix ++ "__" ++ name, Union);
|
||||
},
|
||||
.Fn => |func| {
|
||||
// if (func.) {
|
||||
const fn_meta = @typeInfo(func.name).Fn;
|
||||
// blocked by https://github.com/ziglang/zig/issues/8259
|
||||
gen.gen_func(
|
||||
prefix ++ "__" ++ name,
|
||||
func,
|
||||
fn_meta,
|
||||
&.{},
|
||||
);
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// iterate exported structs
|
||||
inline for (decls) |decl| {
|
||||
if (decl.is_pub and decl.data == .Type and decl.is_pub and comptime std.ascii.isUpper(decl.name[0])) {
|
||||
const T = decl.data.Type;
|
||||
const info = @typeInfo(T);
|
||||
if (info == .Struct and decl.is_pub) {
|
||||
gen.gen_struct(decl.name, @typeInfo(T).Struct);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline for (decls) |decl| {
|
||||
if (decl.is_pub and decl.data == .Type and decl.is_pub) {
|
||||
const T = decl.data.Type;
|
||||
const info = @typeInfo(T);
|
||||
if (info == .Union and comptime std.ascii.isUpper(decl.name[0])) {
|
||||
const layout = info.Union.layout;
|
||||
gen.gen_union(prefix ++ "__" ++ decl.name, info.Union);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// iterate exported fns
|
||||
inline for (decls) |decl, decl_i| {
|
||||
if (decl.is_pub and decl.data == .Fn and decl.is_pub) {
|
||||
const func = decl.data.Fn;
|
||||
},
|
||||
.Fn => |func| {
|
||||
// if (func.) {
|
||||
const fn_meta = @typeInfo(func.fn_type).Fn;
|
||||
const info = @typeInfo(Type);
|
||||
const struct_decl = info.Struct.decls[decl_i];
|
||||
// blocked by https://github.com/ziglang/zig/issues/8259
|
||||
gen.gen_func(
|
||||
prefix ++ "__" ++ decl.name,
|
||||
prefix ++ "__" ++ name,
|
||||
func,
|
||||
fn_meta,
|
||||
struct_decl.data.Fn.arg_names,
|
||||
&.{},
|
||||
);
|
||||
// }
|
||||
}
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,20 +374,36 @@ pub fn HeaderGen(comptime import: type, comptime fname: []const u8) type {
|
||||
const Generator = C_Generator;
|
||||
validateGenerator(Generator);
|
||||
|
||||
file.writeAll("#pragma once\n#include <stddef.h>\n#include <stdint.h>\n#include <stdbool.h>\n\n") 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 {};
|
||||
|
||||
inline for (all_decls) |_decls| {
|
||||
if (comptime _decls.is_pub) {
|
||||
switch (_decls.data) {
|
||||
.Type => |Type| {
|
||||
if (getCStruct(Type)) |CStruct| {
|
||||
processDecls(
|
||||
self,
|
||||
file,
|
||||
Type,
|
||||
CStruct.Type,
|
||||
CStruct.name,
|
||||
);
|
||||
@setEvalBranchQuota(99999);
|
||||
if (@hasDecl(Type, "Extern")) {
|
||||
self.startFile(Type, Type.shim.name, file);
|
||||
var gen = C_Generator.init(Type.name, file);
|
||||
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(
|
||||
self,
|
||||
file,
|
||||
&gen,
|
||||
Type,
|
||||
comptime std.meta.declarationInfo(Type, extern_decl),
|
||||
comptime extern_decl,
|
||||
comptime std.mem.span(&normalized_name),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
else => {},
|
||||
|
||||
@@ -2,41 +2,398 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#define ZIG_DECL extern
|
||||
#define CPP_DECL extern
|
||||
|
||||
|
||||
/**** DefaultGlobal /*****/
|
||||
#pragma mark - JSC::JSObject
|
||||
|
||||
#ifndef BINDINGS__decls__DefaultGlobal_h
|
||||
#define BINDINGS__decls__DefaultGlobal_h
|
||||
#include "DefaultGlobal.h"
|
||||
namespace Wundle {
|
||||
class DefaultGlobal;
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_JSObject_h
|
||||
#define BINDINGS__decls__JavaScriptCore_JSObject_h
|
||||
#include <JavaScriptCore/JSObject.h>
|
||||
namespace JSC {
|
||||
class JSObject;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern "C" JSC::ObjectPrototype* DefaultGlobal__objectPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::FunctionPrototype* DefaultGlobal__functionPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::ArrayPrototype* DefaultGlobal__arrayPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__booleanPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::StringPrototype* DefaultGlobal__stringPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__numberPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::BigIntPrototype* DefaultGlobal__bigIntPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__datePrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__symbolPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::RegExpPrototype* DefaultGlobal__regExpPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__errorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::IteratorPrototype* DefaultGlobal__iteratorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::AsyncIteratorPrototype* DefaultGlobal__asyncIteratorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::GeneratorFunctionPrototype* DefaultGlobal__generatorFunctionPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::GeneratorPrototype* DefaultGlobal__generatorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::AsyncFunctionPrototype* DefaultGlobal__asyncFunctionPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::ArrayIteratorPrototype* DefaultGlobal__arrayIteratorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::MapIteratorPrototype* DefaultGlobal__mapIteratorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::SetIteratorPrototype* DefaultGlobal__setIteratorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__mapPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSObject* DefaultGlobal__jsSetPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::JSPromisePrototype* DefaultGlobal__promisePrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::AsyncGeneratorPrototype* DefaultGlobal__asyncGeneratorPrototype(Wundle::DefaultGlobal* arg0);
|
||||
extern "C" JSC::AsyncGeneratorFunctionPrototype* DefaultGlobal__asyncGeneratorFunctionPrototype(Wundle::DefaultGlobal* arg0);
|
||||
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);
|
||||
|
||||
/***** DefaultGlobal *****/
|
||||
#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);
|
||||
|
||||
#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);
|
||||
|
||||
#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 "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 - 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);
|
||||
|
||||
#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);
|
||||
|
||||
#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);
|
||||
|
||||
#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);
|
||||
|
||||
#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);
|
||||
|
||||
#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 "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::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);
|
||||
|
||||
#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" 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);
|
||||
|
||||
#pragma mark - JSC::JSGlobalObject
|
||||
|
||||
#ifndef BINDINGS__decls__JavaScriptCore_Error_h
|
||||
#define BINDINGS__decls__JavaScriptCore_Error_h
|
||||
#include <JavaScriptCore/Error.h>
|
||||
namespace JSC {
|
||||
class JSGlobalObject;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__throwError(JSC::JSGlobalObject* arg0, JSC::JSObject* arg1);
|
||||
CPP_DECL "C" JSC::JSObject* JSC__JSGlobalObject__createError(JSC::JSGlobalObject* arg0, char ErrorType1, WTF::WTFString* arg2);
|
||||
|
||||
#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);
|
||||
|
||||
#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);
|
||||
|
||||
#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);
|
||||
|
||||
#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 "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::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);
|
||||
|
||||
Reference in New Issue
Block a user