From 3034e4d1864e008a28f870ac2688053bcb6a9ce8 Mon Sep 17 00:00:00 2001 From: Timerix Date: Mon, 10 Nov 2025 12:40:53 +0500 Subject: [PATCH] readme --- README.md | 7 ++++--- include/tlibc/errors.h | 6 +++--- src/errors.c | 2 +- src/tlibc.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aa39beb..717e4b8 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ C library with collections, strings, exceptions, io... ``` ## Usage -Put this code at the beginning of `main()` +Include `tlibc/tlibc.h` and put this code at the beginning of `main()`. ``` -// tlibc/tlibc.h -try_fatal_void(tlibc_init()); + Deferral(32); + try_fatal_void(tlibc_init()); + Defer(tlibc_deinit()); ``` diff --git a/include/tlibc/errors.h b/include/tlibc/errors.h index 4c33dcd..44685e8 100755 --- a/include/tlibc/errors.h +++ b/include/tlibc/errors.h @@ -36,11 +36,11 @@ void Error_printAndExit(Error* e) ATTRIBUTE_NORETURN; void _ErrorCodePage_register(u16* error_code_page_ptr); #define ErrorCodePage_register(name) _ErrorCodePage_register(&ErrorCodePage_name(name)); -typedef enum TLIBC_ERROR { +typedef enum TlibcError { TLIBC_ERROR_UNKNOWN -} TLIBC_ERROR; +} TlibcError; #define ErrorCodePage_NONE 0 -ErrorCodePage_declare(TLIBC_ERROR); +ErrorCodePage_declare(TLIBC); ErrorCodePage_declare(LIBC_ERRNO); typedef struct Result_ { diff --git a/src/errors.c b/src/errors.c index 84b7c77..829a0fa 100755 --- a/src/errors.c +++ b/src/errors.c @@ -56,7 +56,7 @@ void Error_printAndExit(Error* e){ exit(111); } -ErrorCodePage_define(TLIBC_ERROR); +ErrorCodePage_define(TLIBC); ErrorCodePage_define(LIBC_ERRNO); static u16 _error_code_page_last = 0; diff --git a/src/tlibc.c b/src/tlibc.c index 9befbd5..4219049 100644 --- a/src/tlibc.c +++ b/src/tlibc.c @@ -3,7 +3,7 @@ Result(void) tlibc_init(){ Deferral(8); - ErrorCodePage_register(TLIBC_ERROR); + ErrorCodePage_register(TLIBC); ErrorCodePage_register(LIBC_ERRNO); Return RESULT_VOID;