Unknown state [2025-08-04]

This commit is contained in:
2025-08-04 22:24:25 -04:00
parent bc4b577d6f
commit 6e4b76a6d9
10 changed files with 551 additions and 244 deletions

View File

@@ -1,25 +1,11 @@
const std = @import("std");
const core = @import("core.zig");
const common = @import("common.zig");
const Self = @This();
export const MODULE = core.module(Self);
pub fn startup(alloc: std.mem.Allocator) !*Self {
std.log.debug("!! startup {s} !!", .{@typeName(@This())});
return try alloc.create(Self);
fn perform(action: common.Action) !void {
std.log.debug("{s} says {any}", .{ @typeName(@This()), action });
}
pub fn unload(_: *Self, _: std.mem.Allocator) ![]u8 {
std.log.debug("!! unload {s} !!", .{@typeName(@This())});
return &.{};
}
pub fn reload(_: *Self, _: std.mem.Allocator, _: []u8) !void {
std.log.debug("!! reload {s} !!", .{@typeName(@This())});
}
pub fn shutdown(self: *Self, alloc: std.mem.Allocator) void {
std.log.debug("!! shutdown {s} !!", .{@typeName(@This())});
alloc.destroy(self);
}
// TODO in comptime, loop through the struct; generate the "hook" api i used before.
// automatically generate the "interface" and return that. then consumers can import
// and use it directly, but it'll automatically go through the thing.
// use @export in comptime to export the necessary symbols.