A small library to create terminal UIs more easily. Uses ANSI escape codes
Initialize the library Returns 0 on success and -1 on failure
Clean up and recreate the initial state of terminal (won't clear console)
Change the color of future text to standard colors Colors:
- CLI_COLOR_BLACK
- CLI_COLOR_RED
- CLI_COLOR_GREEN
- CLI_COLOR_YELLOW
- CLI_COLOR_BLUE
- CLI_COLOR_MAGENTA
- CLI_COLOR_CYAN
- CLI_COLOR_WHITE
Set the foreground or background color to the given RGB value. Might not be supported.
Reset color to terminal default
Clear console and move the cursor to 1,1
Clear the line the cursor is currently on
Write Zero-Terminated string to the console Returns the length of the printed string
Format string and print to console Returns the length of the printed string
Set cursor position
Set cursor x-position inside current line
Move cursor relative to the current position
Move to the start of the n-th line below or minus the n-th line above
Move n lines downwards or -n line upwards
Read a single character from input after Return has been pressed Returns inputted character
Read one line from the user and store it inside the buffer Returns length of line.
Read non-canonical (without waiting for input or Return) input from the user Returns read char.
Hide cursor. Might not be supported.
Show cursor. Might not be supported.