Initial Commit

This commit is contained in:
SoraKatadzuma committed 2026-10-28 22:13:49 -05:00
commit 05756094ac
706 files changed
+135430

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
#! @file on_linux_x86_64.sakura
#! @author John Christman (sorakatadzuma@gmail.com)
#! @copyright Malunal Studios, LLC.
#! @license MIT
#!
#! Contains the numbers Linux gives the signals `system` names, on x86-64.
module system when os == linux && arch == x86_64;
# The number Linux gives a signal on x86-64.
def number_of(which: signal): i32 {
return match which {
hangup => 1,
interrupt => 2,
quit => 3,
kill => 9,
user1 => 10,
user2 => 12,
pipe => 13,
alarm => 14,
terminate => 15,
child => 17,
resume => 18,
stop => 19,
suspend => 20,
resized => 28,
};
}
#! The signal Linux gives a number on x86-64, where it is one `signal` names.
#! @param number The number.
#! @returns The signal, or nothing.
pub def signal_of(number: i64): maybe<signal> {
return match number {
1 => signal::hangup,
2 => signal::interrupt,
3 => signal::quit,
9 => signal::kill,
10 => signal::user1,
12 => signal::user2,
13 => signal::pipe,
14 => signal::alarm,
15 => signal::terminate,
17 => signal::child,
18 => signal::resume,
19 => signal::stop,
20 => signal::suspend,
28 => signal::resized,
else => nothing{},
};
}