This commit is contained in:
1 parent
9055c5c825
commit
5e67c596b9
43 files changed
+476
-450
No files matched your search
@@ -22,7 +22,7 @@ struct TermcolourData {
|
||||
wpMiscUtilsReservePadding(sizeof(HANDLE) + sizeof(WORD) + sizeof(WORD));
|
||||
};
|
||||
|
||||
wp_intern void init_data(TermcolourData *data);
|
||||
wp_intern void initData(TermcolourData *data);
|
||||
|
||||
wp_intern WORD colours[COUNT_TERM_COLOUR] = {
|
||||
[WP_TERM_COLOUR_FG_BLACK] = 0,
|
||||
@@ -43,10 +43,10 @@ wp_intern WORD colours[COUNT_TERM_COLOUR] = {
|
||||
[WP_TERM_COLOUR_FG_BR_WHITE] = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
|
||||
};
|
||||
|
||||
void _printColouredText(WpStr8RO *text, WpTerminalColour colour) {
|
||||
void printColouredText(WpStr8RO *text, WpTerminalColour colour) {
|
||||
wp_persist TermcolourData data = {0};
|
||||
if (data.handle == 0) {
|
||||
init_data(&data);
|
||||
initData(&data);
|
||||
}
|
||||
|
||||
if (colour == WP_TERM_COLOUR_CLEAR) {
|
||||
@@ -59,7 +59,7 @@ void _printColouredText(WpStr8RO *text, WpTerminalColour colour) {
|
||||
printf(WP_STR8_SPEC, wpStr8Varg((*text)));
|
||||
}
|
||||
|
||||
wp_intern void init_data(TermcolourData *data) {
|
||||
wp_intern void initData(TermcolourData *data) {
|
||||
// create handle
|
||||
data->handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
|
||||
Reference in new issue
Block a user