remove unused items
parent
43089a01f1
commit
4d165fbaaa
|
|
@ -589,16 +589,6 @@ pub fn genericMacOSTarget(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The extension to use for a shared library on the given target.
|
|
||||||
pub fn sharedLibExt(target: std.Build.ResolvedTarget) []const u8 {
|
|
||||||
return if (target.result.os.tag.isDarwin())
|
|
||||||
"dylib"
|
|
||||||
else if (target.result.os.tag == .windows)
|
|
||||||
return "dll"
|
|
||||||
else
|
|
||||||
return "so";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The possible entrypoints for the exe artifact. This has no effect on
|
/// The possible entrypoints for the exe artifact. This has no effect on
|
||||||
/// other artifact types (i.e. lib, wasm_module).
|
/// other artifact types (i.e. lib, wasm_module).
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
const Ghostty = @This();
|
const Ghostty = @This();
|
||||||
|
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
|
||||||
const Config = @import("Config.zig");
|
const Config = @import("Config.zig");
|
||||||
const SharedDeps = @import("SharedDeps.zig");
|
const SharedDeps = @import("SharedDeps.zig");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,40 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
const assert = std.debug.assert;
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const lib_alloc = @import("../lib/allocator.zig");
|
const lib_alloc = @import("../lib/allocator.zig");
|
||||||
const CAllocator = lib_alloc.Allocator;
|
const CAllocator = lib_alloc.Allocator;
|
||||||
const osc = @import("osc.zig");
|
const osc = @import("osc.zig");
|
||||||
|
|
||||||
|
/// C: GhosttyOscParser
|
||||||
pub const GhosttyOscParser = extern struct {
|
pub const GhosttyOscParser = extern struct {
|
||||||
parser: *osc.Parser,
|
parser: *osc.Parser,
|
||||||
|
|
||||||
|
comptime {
|
||||||
|
// C API is an opaque pointer so the sizes must match.
|
||||||
|
assert(@sizeOf(@This()) == @sizeOf(usize));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// C: GhosttyResult
|
||||||
pub const Result = enum(c_int) {
|
pub const Result = enum(c_int) {
|
||||||
success = 0,
|
success = 0,
|
||||||
out_of_memory = -1,
|
out_of_memory = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn ghostty_vt_osc_new(
|
pub fn ghostty_vt_osc_new(
|
||||||
c_alloc_: ?*const CAllocator,
|
alloc_: ?*const CAllocator,
|
||||||
result: *GhosttyOscParser,
|
result: *GhosttyOscParser,
|
||||||
) callconv(.c) Result {
|
) callconv(.c) Result {
|
||||||
const alloc = lib_alloc.default(c_alloc_);
|
const alloc = lib_alloc.default(alloc_);
|
||||||
const ptr = alloc.create(osc.Parser) catch return .out_of_memory;
|
const ptr = alloc.create(osc.Parser) catch
|
||||||
|
return .out_of_memory;
|
||||||
ptr.* = .initAlloc(alloc);
|
ptr.* = .initAlloc(alloc);
|
||||||
result.* = .{ .parser = ptr };
|
result.* = .{ .parser = ptr };
|
||||||
return .success;
|
return .success;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ghostty_vt_osc_free(parser: GhosttyOscParser) callconv(.c) void {
|
pub fn ghostty_vt_osc_free(parser: GhosttyOscParser) callconv(.c) void {
|
||||||
|
// C-built parsers always have an associated allocator.
|
||||||
const alloc = parser.parser.alloc.?;
|
const alloc = parser.parser.alloc.?;
|
||||||
parser.parser.deinit();
|
parser.parser.deinit();
|
||||||
alloc.destroy(parser.parser);
|
alloc.destroy(parser.parser);
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,6 @@ pub const isSafePaste = sanitize.isSafePaste;
|
||||||
|
|
||||||
/// This is set to true when we're building the C library.
|
/// This is set to true when we're building the C library.
|
||||||
pub const is_c_lib = @import("root") == @import("../lib_vt.zig");
|
pub const is_c_lib = @import("root") == @import("../lib_vt.zig");
|
||||||
|
|
||||||
/// This is the C API for this package. Do NOT reference this unless
|
|
||||||
/// you want a bunch of symbols exported into your final artifact.
|
|
||||||
pub const c_api = @import("c_api.zig");
|
pub const c_api = @import("c_api.zig");
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue