ableos/sysdata/libraries/stn/src/lib.hb

47 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-09-18 03:38:49 -05:00
acs := @use("acs.hb")
2024-11-24 10:18:09 -06:00
allocators := @use("alloc/lib.hb")
formatters := @use("formatters.hb")
2024-11-24 14:58:14 -06:00
hashers := @use("hash/lib.hb")
2024-09-18 03:38:49 -05:00
string := @use("string.hb")
log := @use("log.hb")
memory := @use("memory.hb")
buffer := @use("buffer.hb")
math := @use("math.hb")
random := @use("random.hb")
file := @use("file_io.hb")
2024-11-03 16:31:53 -06:00
dt := @use("dt.hb")
2024-11-17 14:29:32 -06:00
process := @use("process.hb")
2024-11-27 06:41:51 -06:00
sleep := @use("sleep.hb")
2024-11-03 16:31:53 -06:00
2024-12-16 07:22:03 -06:00
// todo: replace with comptime message (for zero cost)
2024-11-03 16:31:53 -06:00
panic := fn(message: ?^u8): never {
log.error("Error: Panic Called, Message:\0")
if message == null {
log.error("None\0")
} else {
log.error(message)
}
die
2024-12-16 07:22:03 -06:00
}
2024-12-17 11:43:00 -06:00
Kind := enum {Builtin, Struct, Enum, Union, Pointer, Slice, Opt, Function, Template, Global, Const, Module}
2024-12-17 07:50:04 -06:00
2024-12-16 07:22:03 -06:00
$unsigned_int := fn($T: type): bool {
return T == uint | T == u8 | T == u16 | T == u32
}
$signed_int := fn($T: type): bool {
return T == int | T == i8 | T == i16 | T == i32
}
$integer := fn($T: type): bool {
return unsigned_int(T) | signed_int(T)
}
$float := fn($T: type): bool {
return T == f32 | T == f64
}
$float_bytes := fn($T: type): type {
if T == f64 return uint else if T == f32 return u32
2024-11-03 16:31:53 -06:00
}