move netsurf and mimalloc into modules

This commit is contained in:
Pierre Tachoire
2024-06-17 16:29:00 +02:00
parent 68c8372493
commit f2a406d224
40 changed files with 127 additions and 88 deletions

View File

@@ -22,8 +22,9 @@ const jsruntime = @import("jsruntime");
const Callback = jsruntime.Callback;
const EventTarget = @import("../dom/event_target.zig").EventTarget;
const event_handler = @import("../events/event.zig").event_handler;
const parser = @import("../netsurf.zig");
const parser = @import("netsurf");
const log = std.log.scoped(.xhr);
@@ -41,8 +42,20 @@ pub const XMLHttpRequestEventTarget = struct {
ontimeout_cbk: ?Callback = null,
onloadend_cbk: ?Callback = null,
fn register(self: *XMLHttpRequestEventTarget, alloc: std.mem.Allocator, typ: []const u8, cbk: Callback) !void {
try parser.eventTargetAddEventListener(@as(*parser.EventTarget, @ptrCast(self)), alloc, typ, cbk, false);
fn register(
self: *XMLHttpRequestEventTarget,
alloc: std.mem.Allocator,
typ: []const u8,
cbk: Callback,
) !void {
try parser.eventTargetAddEventListener(
@as(*parser.EventTarget, @ptrCast(self)),
alloc,
typ,
cbk,
false,
event_handler,
);
}
fn unregister(self: *XMLHttpRequestEventTarget, alloc: std.mem.Allocator, typ: []const u8, cbk: Callback) !void {
const et = @as(*parser.EventTarget, @ptrCast(self));

View File

@@ -22,7 +22,7 @@ const jsruntime = @import("jsruntime");
const Case = jsruntime.test_utils.Case;
const checkCases = jsruntime.test_utils.checkCases;
const parser = @import("../netsurf.zig");
const parser = @import("netsurf");
const Event = @import("../events/event.zig").Event;
const DOMException = @import("../dom/exceptions.zig").DOMException;

View File

@@ -23,7 +23,7 @@ const Case = jsruntime.test_utils.Case;
const checkCases = jsruntime.test_utils.checkCases;
const generate = @import("../generate.zig");
const DOMError = @import("../netsurf.zig").DOMError;
const DOMError = @import("netsurf").DOMError;
const DOMException = @import("../dom/exceptions.zig").DOMException;
const ProgressEvent = @import("progress_event.zig").ProgressEvent;
@@ -35,7 +35,7 @@ const Loop = jsruntime.Loop;
const YieldImpl = Loop.Yield(XMLHttpRequest);
const Client = @import("../async/Client.zig");
const parser = @import("../netsurf.zig");
const parser = @import("netsurf");
const UserContext = @import("../user_context.zig").UserContext;