refactor: add comments
This commit is contained in:
@@ -2,6 +2,7 @@ const std = @import("std");
|
|||||||
const c_unistd = @cImport(@cInclude("unistd.h"));
|
const c_unistd = @cImport(@cInclude("unistd.h"));
|
||||||
const c_statvfs = @cImport(@cInclude("sys/statvfs.h"));
|
const c_statvfs = @cImport(@cInclude("sys/statvfs.h"));
|
||||||
|
|
||||||
|
/// Struct representing CPU informations
|
||||||
pub const CpuInfo = struct {
|
pub const CpuInfo = struct {
|
||||||
cpu_name: []u8,
|
cpu_name: []u8,
|
||||||
cpu_cores: i32,
|
cpu_cores: i32,
|
||||||
@@ -12,6 +13,7 @@ pub const CpuInfo = struct {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Struct representing RAM usage informations
|
||||||
pub const RamInfo = struct {
|
pub const RamInfo = struct {
|
||||||
ram_size: f64,
|
ram_size: f64,
|
||||||
ram_usage: f64,
|
ram_usage: f64,
|
||||||
@@ -22,6 +24,7 @@ pub const RamInfo = struct {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Struct representing Swap usage informations
|
||||||
pub const SwapInfo = struct {
|
pub const SwapInfo = struct {
|
||||||
swap_size: f64,
|
swap_size: f64,
|
||||||
swap_usage: f64,
|
swap_usage: f64,
|
||||||
@@ -32,6 +35,7 @@ pub const SwapInfo = struct {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Struct representing Disk usage informations
|
||||||
pub const DiskInfo = struct {
|
pub const DiskInfo = struct {
|
||||||
disk_path: []const u8,
|
disk_path: []const u8,
|
||||||
disk_size: f64,
|
disk_size: f64,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const c_net_if = @cImport(@cInclude("net/if.h"));
|
|||||||
const c_netinet_in = @cImport(@cInclude("netinet/in.h"));
|
const c_netinet_in = @cImport(@cInclude("netinet/in.h"));
|
||||||
const c_socket = @cImport(@cInclude("sys/socket.h"));
|
const c_socket = @cImport(@cInclude("sys/socket.h"));
|
||||||
|
|
||||||
|
/// Struct representing Network informations (interface name - ipv4 address)
|
||||||
pub const NetInfo = struct {
|
pub const NetInfo = struct {
|
||||||
interface_name: []u8,
|
interface_name: []u8,
|
||||||
ipv4_addr: []u8,
|
ipv4_addr: []u8,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const std = @import("std");
|
|||||||
const c_sysinfo = @cImport(@cInclude("sys/sysinfo.h"));
|
const c_sysinfo = @cImport(@cInclude("sys/sysinfo.h"));
|
||||||
const c_utsname = @cImport(@cInclude("sys/utsname.h"));
|
const c_utsname = @cImport(@cInclude("sys/utsname.h"));
|
||||||
|
|
||||||
/// Structure representing system uptime in days, hours, and minutes.
|
/// Struct representing system uptime in days, hours, and minutes.
|
||||||
pub const SystemUptime = struct {
|
pub const SystemUptime = struct {
|
||||||
days: i8,
|
days: i8,
|
||||||
hours: i8,
|
hours: i8,
|
||||||
@@ -13,6 +13,7 @@ pub const SystemUptime = struct {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Struct representing Kernel informations
|
||||||
pub const KernelInfo = struct {
|
pub const KernelInfo = struct {
|
||||||
kernel_name: []u8,
|
kernel_name: []u8,
|
||||||
kernel_release: []u8,
|
kernel_release: []u8,
|
||||||
|
|||||||
Reference in New Issue
Block a user