More renaming

This commit is contained in:
Jarred Sumner
2023-08-28 04:53:51 -07:00
parent 277e5c0b77
commit ebfaa682f7
9 changed files with 23 additions and 22 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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

View File

@@ -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);

View File

@@ -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");

View File

@@ -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,

View File

@@ -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;