|
|
@@ -305,6 +305,17 @@ void file_export (char * name, void * data) { |
|
|
|
(void) data; |
|
|
|
} |
|
|
|
|
|
|
|
int character_compare_array (char character, char * character_array, int count) { |
|
|
|
int i = 0; |
|
|
|
|
|
|
|
do { |
|
|
|
if (character == character_array [i]) { |
|
|
|
return (i); |
|
|
|
} |
|
|
|
} while (++i != count); |
|
|
|
|
|
|
|
return (0); |
|
|
|
} |
|
|
|
|
|
|
|
int string_length (char * string) { |
|
|
|
int length = 0; |
|
|
@@ -451,4 +462,29 @@ int string_split_space (char * string) { |
|
|
|
return (++count); |
|
|
|
} |
|
|
|
|
|
|
|
void terminal_clear (void) { |
|
|
|
out ("\033[2J\033[H", 7); |
|
|
|
} |
|
|
|
|
|
|
|
void terminal_style (int effect, int colour) { |
|
|
|
char format [8] = "\033[ ;3 m"; |
|
|
|
|
|
|
|
if ((effect == -1) || (colour == -1)) { |
|
|
|
out ("\033[0m", 4); |
|
|
|
} else { |
|
|
|
format [2] = (char) effect + '0'; |
|
|
|
format [5] = (char) colour + '0'; |
|
|
|
|
|
|
|
out (format, 7); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void terminal_show_cursor (int show) { |
|
|
|
if (show != 0) { |
|
|
|
out ("\033[?25h", 6); |
|
|
|
} else { |
|
|
|
out ("\033[?25l", 6); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |