Use Str8 instead of const char * in termcolour functions

This commit is contained in:
2025-02-16 16:32:52 +00:00
parent 62dcfdaa93
commit 180425707b
4 changed files with 30 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
#include "termcolour.h"
#include "terminal_colours.h"
void wapp_shell_termcolour_print_text(const char *text, TerminalColour colour) {
void wapp_shell_termcolour_print_text(Str8RO *text, TerminalColour colour) {
if (colour < WAPP_TERM_COLOUR_FG_BLACK || colour > WAPP_TERM_COLOUR_FG_BR_WHITE) {
return;
}
@@ -10,5 +10,6 @@ void wapp_shell_termcolour_print_text(const char *text, TerminalColour colour) {
}
void wapp_shell_termcolour_clear_colour(void) {
print_coloured_text("", WAPP_TERM_COLOUR_CLEAR);
Str8RO empty = wapp_str8_lit_ro("");
print_coloured_text(&empty, WAPP_TERM_COLOUR_CLEAR);
}