diff options
author | 2023-08-28 04:53:51 -0700 | |
---|---|---|
committer | 2023-08-28 04:53:51 -0700 | |
commit | ebfaa682f761aac3d0c3c6d6ec1bbf4831d86ea4 (patch) | |
tree | a4f87cb0b8669a8ca3e85a7e544c421b529f211f | |
parent | 277e5c0b77fff14b090d9c2981ac0b372d7a7f77 (diff) | |
download | bun-ebfaa682f761aac3d0c3c6d6ec1bbf4831d86ea4.tar.gz bun-ebfaa682f761aac3d0c3c6d6ec1bbf4831d86ea4.tar.zst bun-ebfaa682f761aac3d0c3c6d6ec1bbf4831d86ea4.zip |
More renaming
-rw-r--r-- | src/bun.js/node/node_fs.zig | 4 | ||||
-rw-r--r-- | src/bun.js/node/types.zig | 4 | ||||
-rw-r--r-- | src/bun.js/rare_data.zig | 8 | ||||
-rw-r--r-- | src/bun.js/test/snapshot.zig | 2 | ||||
-rw-r--r-- | src/bun.js/webcore/blob.zig | 2 | ||||
-rw-r--r-- | src/bun.js/webcore/streams.zig | 10 | ||||
-rw-r--r-- | src/bun.zig | 8 | ||||
-rw-r--r-- | src/io/io_windows.zig | 6 | ||||
-rw-r--r-- | src/jsc.zig | 1 |
9 files changed, 23 insertions, 22 deletions
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig index 01952dc68..2750bd1b8 100644 --- a/src/bun.js/node/node_fs.zig +++ b/src/bun.js/node/node_fs.zig @@ -14,7 +14,7 @@ const Flavor = JSC.Node.Flavor; const system = std.os.system; const Maybe = JSC.Maybe; const Encoding = JSC.Node.Encoding; -const Syscall = @import("./syscall.zig"); +const Syscall = bun.sys; const Constants = @import("./node_fs_constant.zig").Constants; const builtin = @import("builtin"); const os = @import("std").os; @@ -30,7 +30,7 @@ const FileSystem = @import("../../fs.zig").FileSystem; const StringOrBuffer = JSC.Node.StringOrBuffer; const ArgumentsSlice = JSC.Node.ArgumentsSlice; const TimeLike = JSC.Node.TimeLike; -const Mode = JSC.Node.Mode; +const Mode = bun.Mode; const E = C.E; const uid_t = if (Environment.isPosix) std.os.uid_t else i32; const gid_t = if (Environment.isPosix) std.os.gid_t else i32; diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig index 51094d629..efd6d806b 100644 --- a/src/bun.js/node/types.zig +++ b/src/bun.js/node/types.zig @@ -8,7 +8,7 @@ const JSC = @import("root").bun.JSC; const PathString = JSC.PathString; const Environment = bun.Environment; const C = bun.C; -const Syscall = @import("./syscall.zig"); +const Syscall = bun.sys; const os = std.os; pub const Buffer = JSC.MarkedArrayBuffer; const IdentityContext = @import("../../identity_context.zig").IdentityContext; @@ -20,7 +20,7 @@ const is_bindgen: bool = std.meta.globalOption("bindgen", bool) orelse false; const meta = bun.meta; /// Time in seconds. Not nanos! pub const TimeLike = c_int; -pub const Mode = bun.C.Mode; +const Mode = bun.Mode; const heap_allocator = bun.default_allocator; pub fn DeclEnum(comptime T: type) type { const fieldInfos = std.meta.declarations(T); diff --git a/src/bun.js/rare_data.zig b/src/bun.js/rare_data.zig index 30adeabe3..af2b90f3b 100644 --- a/src/bun.js/rare_data.zig +++ b/src/bun.js/rare_data.zig @@ -3,7 +3,7 @@ const Blob = JSC.WebCore.Blob; const default_allocator = @import("root").bun.default_allocator; const Output = @import("root").bun.Output; const RareData = @This(); -const Syscall = @import("./node/syscall.zig"); +const Syscall = bun.sys; const JSC = @import("root").bun.JSC; const std = @import("std"); const BoringSSL = @import("root").bun.BoringSSL; @@ -224,7 +224,7 @@ pub fn boringEngine(rare: *RareData) *BoringSSL.ENGINE { pub fn stderr(rare: *RareData) *Blob.Store { return rare.stderr_store orelse brk: { var store = default_allocator.create(Blob.Store) catch unreachable; - var mode: JSC.Node.Mode = 0; + var mode: bun.Mode = 0; switch (Syscall.fstat(bun.STDERR_FD)) { .result => |stat| { mode = stat.mode; @@ -254,7 +254,7 @@ pub fn stderr(rare: *RareData) *Blob.Store { pub fn stdout(rare: *RareData) *Blob.Store { return rare.stdout_store orelse brk: { var store = default_allocator.create(Blob.Store) catch unreachable; - var mode: JSC.Node.Mode = 0; + var mode: bun.Mode = 0; switch (Syscall.fstat(bun.STDOUT_FD)) { .result => |stat| { mode = stat.mode; @@ -282,7 +282,7 @@ pub fn stdout(rare: *RareData) *Blob.Store { pub fn stdin(rare: *RareData) *Blob.Store { return rare.stdin_store orelse brk: { var store = default_allocator.create(Blob.Store) catch unreachable; - var mode: JSC.Node.Mode = 0; + var mode: bun.Mode = 0; switch (Syscall.fstat(bun.STDIN_FD)) { .result => |stat| { mode = stat.mode; diff --git a/src/bun.js/test/snapshot.zig b/src/bun.js/test/snapshot.zig index 072194b11..3e6afd4c9 100644 --- a/src/bun.js/test/snapshot.zig +++ b/src/bun.js/test/snapshot.zig @@ -247,7 +247,7 @@ pub const Snapshots = struct { remain[0] = 0; const snapshot_file_path = snapshot_file_path_buf[0 .. snapshot_file_path_buf.len - remain.len :0]; - var flags: JSC.Node.Mode = std.os.O.CREAT | std.os.O.RDWR; + var flags: bun.Mode = std.os.O.CREAT | std.os.O.RDWR; if (this.update_snapshots) flags |= std.os.O.TRUNC; const fd = switch (bun.sys.open(snapshot_file_path, flags, 0o644)) { .result => |_fd| _fd, diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index f30a4a3d3..25f762e97 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -2635,7 +2635,7 @@ pub const Blob = struct { pathlike: JSC.Node.PathOrFileDescriptor, mime_type: HTTPClient.MimeType = HTTPClient.MimeType.other, is_atty: ?bool = null, - mode: JSC.Node.Mode = 0, + mode: bun.Mode = 0, seekable: ?bool = null, max_size: SizeType = Blob.max_size, // milliseconds since ECMAScript epoch diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig index 94f10925f..85783dbc3 100644 --- a/src/bun.js/webcore/streams.zig +++ b/src/bun.js/webcore/streams.zig @@ -356,7 +356,7 @@ pub const StreamStart = union(Tag) { input_path: PathOrFileDescriptor, truncate: bool = true, close: bool = false, - mode: JSC.Node.Mode = 0o664, + mode: bun.Mode = 0o664, }, HTTPSResponseSink: void, HTTPResponseSink: void, @@ -1175,7 +1175,7 @@ pub const FileSink = struct { auto_close: bool = false, auto_truncate: bool = false, fd: bun.FileDescriptor = bun.invalid_fd, - mode: JSC.Node.Mode = 0, + mode: bun.Mode = 0, chunk_size: usize = 0, pending: StreamResult.Writable.Pending = StreamResult.Writable.Pending{ .result = .{ .done = {} }, @@ -1207,7 +1207,7 @@ pub const FileSink = struct { } const max_fifo_size = 64 * 1024; - pub fn prepare(this: *FileSink, input_path: PathOrFileDescriptor, mode: JSC.Node.Mode) JSC.Node.Maybe(void) { + pub fn prepare(this: *FileSink, input_path: PathOrFileDescriptor, mode: bun.Mode) JSC.Node.Maybe(void) { var file_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; const auto_close = this.auto_close; const fd = if (!auto_close) @@ -4075,7 +4075,7 @@ pub const File = struct { remaining_bytes: Blob.SizeType = std.math.maxInt(Blob.SizeType), user_chunk_size: Blob.SizeType = 0, total_read: Blob.SizeType = 0, - mode: JSC.Node.Mode = 0, + mode: bun.Mode = 0, pending: StreamResult.Pending = .{}, scheduled_count: u32 = 0, @@ -4198,7 +4198,7 @@ pub const File = struct { return .{ .err = Syscall.Error.fromCode(.INVAL, .fstat) }; } - file.mode = @as(JSC.Node.Mode, @intCast(stat.mode)); + file.mode = @as(bun.Mode, @intCast(stat.mode)); this.mode = file.mode; this.seekable = bun.isRegularFile(stat.mode); diff --git a/src/bun.zig b/src/bun.zig index 3c428cbbf..2d7fdf03b 100644 --- a/src/bun.zig +++ b/src/bun.zig @@ -1666,7 +1666,7 @@ const WindowsStat = extern struct { ino: u32, nlink: usize, - mode: JSC.Node.Mode, + mode: Mode, uid: u32, gid: u32, rdev: u32, @@ -1775,7 +1775,7 @@ pub const win32 = struct { pub usingnamespace if (@import("builtin").target.os.tag != .windows) posix else win32; -pub fn isRegularFile(mode: JSC.Node.Mode) bool { +pub fn isRegularFile(mode: Mode) bool { if (comptime Environment.isPosix) { return std.os.S.ISREG(mode); } @@ -1787,7 +1787,9 @@ pub fn isRegularFile(mode: JSC.Node.Mode) bool { @compileError("Unsupported platform"); } -pub const sys = @import("./bun.js/node/syscall.zig"); +pub const sys = @import("./sys.zig"); + +pub const Mode = C.Mode; pub const windows = @import("./windows.zig"); diff --git a/src/io/io_windows.zig b/src/io/io_windows.zig index 55803d7ea..47f813c35 100644 --- a/src/io/io_windows.zig +++ b/src/io/io_windows.zig @@ -166,7 +166,7 @@ pub const Completion = struct { }, open: struct { path: [:0]const u8, - flags: bun.JSC.Node.Mode, + flags: bun.Mode, }, connect: struct { socket: os.socket_t, @@ -417,8 +417,8 @@ pub fn open( ) void, completion: *Completion, path: [:0]const u8, - flags: bun.JSC.Node.Mode, - _: bun.JSC.Node.Mode, + flags: bun.Mode, + _: bun.Mode, ) void { self.submit( context, diff --git a/src/jsc.zig b/src/jsc.zig index 1e844464a..c33192f32 100644 --- a/src/jsc.zig +++ b/src/jsc.zig @@ -53,7 +53,6 @@ pub const Node = struct { pub usingnamespace @import("./bun.js/node/node_fs_watcher.zig"); pub usingnamespace @import("./bun.js/node/node_fs_binding.zig"); pub usingnamespace @import("./bun.js/node/node_os.zig"); - pub const Syscall = @import("./bun.js/node/syscall.zig"); pub const fs = @import("./bun.js/node/node_fs_constant.zig"); }; pub const Maybe = Node.Maybe; |