authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-18 00:01:18 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-18 00:01:18 -08:00
logc9b47dd116ee7627b1914dc9374d5dde829c9f7e
treed0542cd0e113e18b2b72fe7f5cf8b20ca10f5b3e
parent6e779d9740046f181a001d6290eebcff283aa532

zig-sys rework


3 files changed, 6 insertions(+), 8 deletions(-)

licenses.txt+1-3
......@@ -1,10 +1,8 @@
11MIT:
22= https://spdx.org/licenses/MIT
33- This
4- git https://github.com/nektro/zig-errno
54- git https://github.com/nektro/zig-extras
6- git https://github.com/nektro/zig-libc
7- git https://github.com/nektro/zig-sys-libc
5- git https://github.com/nektro/zig-sys-linux
86
97Unspecified:
108- system_lib c
src/lib.zig+4-4
......@@ -2,7 +2,7 @@ const std = @import("std");
22const string = []const u8;
33const List = std.ArrayList(string);
44const extras = @import("extras");
5const libc = @import("sys-libc");
5const linux = @import("sys-linux");
66
77var singles: std.StringArrayHashMap(string) = undefined;
88var multis: std.StringArrayHashMap(List) = undefined;
......@@ -68,7 +68,7 @@ pub fn parse(k: FlagDashKind) !std.process.ArgIterator {
6868 }
6969 }
7070 std.log.err("Unrecognized argument: {s}{s}", .{ dash, name });
71 libc.exit(1);
71 linux.exit(1);
7272 }
7373 return argiter;
7474}
......@@ -79,7 +79,7 @@ pub fn parseEnv() !void {
7979 for (singles.keys(), singles.values()) |k, *v| {
8080 const u = try fixNameForEnv(alloc, k);
8181 defer alloc.free(u);
82 if (libc.getenv(u)) |value| {
82 if (linux.getenv(u)) |value| {
8383 v.* = value;
8484 }
8585 }
......@@ -90,7 +90,7 @@ pub fn parseEnv() !void {
9090 defer alloc.free(u);
9191 const w = try std.fmt.allocPrintZ(alloc, "{s}_{d}", .{ u, n });
9292 defer alloc.free(w);
93 if (libc.getenv(w)) |value| {
93 if (linux.getenv(w)) |value| {
9494 try v.append(value);
9595 continue;
9696 }
zig.mod+1-1
......@@ -5,4 +5,4 @@ license: MIT
55description: Config management for Zig.
66dependencies:
77 - src: git https://github.com/nektro/zig-extras
8 - src: git https://github.com/nektro/zig-sys-libc
8 - src: git https://github.com/nektro/zig-sys-linux