aboutsummaryrefslogtreecommitdiff
path: root/core/sys/info/sysinfo.odin
blob: 69f9f15847e557f38b55592076880905399e35da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package sysinfo

when !(ODIN_ARCH == .amd64 || ODIN_ARCH == .i386 || ODIN_ARCH == .arm32 || ODIN_ARCH == .arm64) {
	#assert(false, "This package is unsupported on this architecture.")
}

os_version: OS_Version
ram:        RAM
gpus:       []GPU

OS_Version_Platform :: enum {
	Unknown,
	Windows,
	Linux,
	MacOS,
	iOS,
	FreeBSD,
	OpenBSD,
	NetBSD,
}

OS_Version :: struct {
	platform: OS_Version_Platform,

	major:     int,
	minor:     int,
	patch:     int,
	build:     [2]int,
	version:   string,

	as_string: string,
}

RAM :: struct {
	total_ram:  int,
	free_ram:   int,
	total_swap: int,
	free_swap:  int,
}

GPU :: struct {
	vendor_name: string,
	model_name:  string,
	total_ram:   int,
}