| author | |
| committer | |
| log | 74f0ddb0a4dfa7921739b88cc381951a6b6e73ce |
| tree | f89839e96624ae2b27ffdc52e540aefd234fc196 |
| parent | 3dcc531937b58d787e183c25bad535c91bab1f7d |
2 files changed, 10 insertions(+), 0 deletions(-)
src/globalOption.zig created+9| ... | @@ -0,0 +1,9 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | const string = []const u8; | ||
| 3 | const extras = @import("./lib.zig"); | ||
| 4 | const root = @import("root"); | ||
| 5 | |||
| 6 | pub fn globalOption(comptime T: type, comptime name: []const u8) ?T { | ||
| 7 | if (!@hasDecl(root, name)) return null; | ||
| 8 | return @as(T, @field(root, name)); | ||
| 9 | } | ||
src/lib.zig+1| ... | @@ -92,3 +92,4 @@ pub fn fd_realpath(fd: std.os.fd_t) ![std.fs.MAX_PATH_BYTES:0]u8 { | ... | @@ -92,3 +92,4 @@ pub fn fd_realpath(fd: std.os.fd_t) ![std.fs.MAX_PATH_BYTES:0]u8 { |
| 92 | pub usingnamespace @import("./rawInt.zig"); | 92 | pub usingnamespace @import("./rawInt.zig"); |
| 93 | pub usingnamespace @import("./expectSimilarType.zig"); | 93 | pub usingnamespace @import("./expectSimilarType.zig"); |
| 94 | pub usingnamespace @import("./rawIntBytes.zig"); | 94 | pub usingnamespace @import("./rawIntBytes.zig"); |
| 95 | pub usingnamespace @import("./globalOption.zig"); |