diff --git a/src/macos/hardware.zig b/src/macos/hardware.zig index c071f6a..602691f 100644 --- a/src/macos/hardware.zig +++ b/src/macos/hardware.zig @@ -6,6 +6,7 @@ const c_cf = @cImport(@cInclude("CoreFoundation/CoreFoundation.h")); const c_mach = @cImport(@cInclude("mach/mach.h")); const c_statvfs = @cImport(@cInclude("sys/statvfs.h")); +/// Struct representing CPU informations pub const CpuInfo = struct { cpu_name: []u8, cpu_cores: i32, @@ -16,6 +17,7 @@ pub const CpuInfo = struct { } }; +/// Struct representing GPU informations pub const GpuInfo = struct { gpu_name: []u8, gpu_cores: i32, @@ -26,6 +28,7 @@ pub const GpuInfo = struct { } }; +/// Struct representing RAM usage informations pub const RamInfo = struct { ram_size: f64, ram_usage: f64, @@ -36,6 +39,7 @@ pub const RamInfo = struct { } }; +/// Struct representing Swap usage informations pub const SwapInfo = struct { swap_size: f64, swap_usage: f64, @@ -46,6 +50,7 @@ pub const SwapInfo = struct { } }; +/// Struct representing Disk usage informations pub const DiskInfo = struct { disk_path: []const u8, disk_size: f64, diff --git a/src/macos/network.zig b/src/macos/network.zig index 610dede..fa1f119 100644 --- a/src/macos/network.zig +++ b/src/macos/network.zig @@ -5,6 +5,7 @@ const c_net_if = @cImport(@cInclude("net/if.h")); const c_netinet_in = @cImport(@cInclude("netinet/in.h")); const c_socket = @cImport(@cInclude("sys/socket.h")); +/// Struct representing Network informations (interface name - ipv4 address) pub const NetInfo = struct { interface_name: []u8, ipv4_addr: []u8, diff --git a/src/macos/system.zig b/src/macos/system.zig index 3a73588..2e96755 100644 --- a/src/macos/system.zig +++ b/src/macos/system.zig @@ -2,7 +2,7 @@ const std = @import("std"); const c_sysctl = @cImport(@cInclude("sys/sysctl.h")); const c_libproc = @cImport(@cInclude("libproc.h")); -/// Structure representing system uptime in days, hours, and minutes. +/// Struct representing system uptime in days, hours, and minutes. pub const SystemUptime = struct { days: i8, hours: i8, @@ -13,6 +13,7 @@ pub const SystemUptime = struct { } }; +/// Struct representing Kernel informations pub const KernelInfo = struct { kernel_name: []u8, kernel_release: []u8, @@ -22,7 +23,7 @@ pub const KernelInfo = struct { } }; -// Returns the hostname. +/// Returns the hostname. pub fn getHostname(allocator: std.mem.Allocator) ![]u8 { var buf: [std.posix.HOST_NAME_MAX]u8 = undefined; const hostnameEnv = try std.posix.gethostname(&buf);