Skip to content

Commit

Permalink
coff: add missing Dll.zig source file
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Mar 28, 2024
1 parent 980e671 commit 6607f72
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/Coff/Dll.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
path: []const u8,
index: File.Index,

alive: bool = false,

pub fn deinit(self: *Dll, allocator: Allocator) void {
allocator.free(self.path);
}

pub fn addExport(self: *Dll, coff_file: *Coff, args: struct {
name: [:0]const u8,
type: coff.ImportType,
name_type: coff.ImportNameType,
hint: u16,
}) !void {
_ = self;
_ = coff_file;
log.debug("TODO: add symbol '{s}' of type {s}, name_type {s} and hint {x}", .{
args.name,
@tagName(args.type),
@tagName(args.name_type),
args.hint,
});
}

pub fn format(
self: *Dll,
comptime unused_fmt_string: []const u8,
options: std.fmt.FormatOptions,
writer: anytype,
) !void {
_ = self;
_ = unused_fmt_string;
_ = options;
_ = writer;
@compileError("do not format Dll directly");
}

const coff = std.coff;
const log = std.log.scoped(.coff);
const mem = std.mem;
const std = @import("std");

const Allocator = mem.Allocator;
const Coff = @import("../Coff.zig");
const Dll = @This();
const File = @import("file.zig").File;

0 comments on commit 6607f72

Please sign in to comment.