*add ui.c

*add TC_NEWLINE
This commit is contained in:
Anton 2024-03-28 20:44:34 +05:30
parent a3a3dc039e
commit e2e4101e15
2 changed files with 26 additions and 0 deletions

View File

@ -59,6 +59,12 @@ CONSOLE_CURSOR_INFO cci;
#define TC_BG_CYN "\x1B[46m" /* Background Cyan */
#define TC_BG_WHT "\x1B[47m" /* Background White */
#ifdef _WIN32
#define TC_NEWLINE "\r\n"
#else
#define TC_NEWLINE "\n"
#endif
// `asprintf` is usable on any POSIX-2008 compliant system (any modern Linux system)
// My compiler likes to complain about it.. Another way to preform this is with `vsprintf`
// Or maybe I'm just a bad programmer :I

20
src/ui.c Normal file
View File

@ -0,0 +1,20 @@
#include<stdio.h>
#include "tercontrol.h"
void clear() {
tc_clear_screen();
tc_set_cursor(0, 0);
}
void error(char str[]) {
printf("%sError: %s%s", TC_RED, str, TC_NEWLINE);
exit(1);
}
void say_blue(char str_list[]){
}
//int main(){error("yeah");}