aboutsummaryrefslogtreecommitdiff
path: root/modules/TUI/unix.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2024-05-05 02:34:33 +0100
committerdam <dam@gudinoff>2024-05-05 02:34:33 +0100
commit36af624cdd9cb54454587bfae21b30096986d22e (patch)
tree89fb9d3eb79ff68f047bd30dbcb680e6dce8abc3 /modules/TUI/unix.jai
parentcb6c3caaa285bc8bd12c356d57bbfad86d70c0eb (diff)
downloadtask-time-tracker-36af624cdd9cb54454587bfae21b30096986d22e.tar.zst
task-time-tracker-36af624cdd9cb54454587bfae21b30096986d22e.zip
WIP : Cleanup TUI module and improved assert/error messages.
Diffstat (limited to 'modules/TUI/unix.jai')
-rw-r--r--modules/TUI/unix.jai14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/TUI/unix.jai b/modules/TUI/unix.jai
index 940ac80..99cc61d 100644
--- a/modules/TUI/unix.jai
+++ b/modules/TUI/unix.jai
@@ -230,7 +230,7 @@ restore_resize_handler :: () {
////////////////////////////////////////////////////////////////////////////////
-#scope_export
+#scope_module
OS_prepare_terminal :: () -> success := true {
error: int = ---;
@@ -238,7 +238,7 @@ OS_prepare_terminal :: () -> success := true {
error = tcgetattr(STDIN_FILENO, *initial_tio_mode);
if error {
error_code, error_string := get_error_value_and_string();
- log_error("Failed to get initial_tio_mode: code %, %", error_code, error_string);
+ log_tui_error("Failed to get initial_tio_mode: code %, %", error_code, error_string);
return false;
}
@@ -254,7 +254,7 @@ OS_prepare_terminal :: () -> success := true {
error = tcsetattr(STDIN_FILENO, xx Optional_Actions.TCSANOW, *raw_tio_mode);
if error {
error_code, error_string := get_error_value_and_string();
- log_error("Failed to set raw_tio_mode: code %, %", error_code, error_string);
+ log_tui_error("Failed to set raw_tio_mode: code %, %", error_code, error_string);
return false;
}
@@ -268,7 +268,7 @@ OS_reset_terminal :: () -> success := true {
error := tcsetattr(STDIN_FILENO, xx Optional_Actions.TCSANOW, *initial_tio_mode);
if error {
error_code, error_string := get_error_value_and_string();
- log_error("Failed to set initial_tio_mode: code %, %", error_code, error_string);
+ log_tui_error("Failed to set initial_tio_mode: code %, %", error_code, error_string);
return false;
}
return;
@@ -278,7 +278,7 @@ OS_flush_input :: () -> success := true {
error := tcflush(STDIN_FILENO, xx Queue_Selector.TCIFLUSH);
if error {
error_code, error_string := get_error_value_and_string();
- log_error("Failed to flush input: code %, %", error_code, error_string);
+ log_tui_error("Failed to flush input: code %, %", error_code, error_string);
return false;
}
return;
@@ -288,7 +288,7 @@ OS_read_input :: (buffer: *u8, bytes_to_read: s64) -> bytes_read: s64, success :
bytes_read := read(STDIN_FILENO, buffer, xx bytes_to_read);
if bytes_read < 0 {
error_code, error_string := get_error_value_and_string();
- log_error("Failed to read input: code %, %", error_code, error_string);
+ log_tui_error("Failed to read input: code %, %", error_code, error_string);
return 0, false;
}
return bytes_read;
@@ -306,7 +306,7 @@ OS_wait_for_input :: (timeout_milliseconds: s32 = -1) -> is_input_available: boo
error_code, error_string := get_error_value_and_string();
// Ignore window resize events (error_code 4).
if error_code != 4 {
- log_error("Unexpected error while waiting for input: code %, %", error_code, error_string);
+ log_tui_error("Unexpected error while waiting for input: code %, %", error_code, error_string);
return false, false;
}
}