11#define COLOR_GREEN "\033[32m"
12#define COLOR_YELLOW "\033[33m"
13#define COLOR_RED "\033[31m"
14#define COLOR_BLUE "\033[34m"
15#define COLOR_BLACK "\033[30m"
16#define COLOR_WHITE "\033[97m"
18#define COLOR_DEFAULT (*io_use_white_text() ? COLOR_WHITE : COLOR_BLACK)
20 static bool res =
false;
38 static bool visible =
true;
62 va_start(argptr, fmt);
63 vfprintf(stdout, fmt, argptr);
73 va_start(argptr, fmt);
74 vfprintf(stdout, fmt, argptr);
84 va_start(argptr, fmt);
85 vfprintf(stdout, fmt, argptr);
94 va_start(argptr, fmt);
95 vfprintf(stdout, fmt, argptr);
111 printf(
"%s\n-> ", buffer);
119 printf(
"%s\n:( -> ", buffer);
122 assert(
false &&
"unimplemented");
void cmd_init_from_str(struct cmd *res, const char *str)
Build command from raw input.
#define INPUT_BUFFER_SIZE
void format_output(char *fmt,...)
Used format_xxx instead of printf and such for uniform output.
void io_set_text_white()
Set default text color to white.
void format_usage(char *fmt,...)
Used format_xxx instead of printf and such for uniform output.
static bool * io_use_white_text()
void format_success(char *fmt,...)
Used format_xxx instead of printf and such for uniform output.
void scan_input(struct cmd *obj)
Ask and convert user's input into command.
void format_error(char *fmt,...)
Used format_xxx instead of printf and such for uniform output.
void io_set_last_status(enum run_result result)
Set the result of last command (RUN_OK/RUN_FAIL/...)
void io_set_prompt_visibility(bool visible)
Config if prompt should be printed.
bool * is_prompt_visible()
enum run_result * last_run_status()
void get_cwd(unsigned int buffer_size, os_char *buffer)
Fetch current working directory and copy them into buffer
run_result
Result of the execution of a command line.
Resulting struct after parsing the input.