Highlight things
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4KB

  1. #ifndef TERMINAL_H_
  2. #include "hl.h"
  3. // Terminal manipulation
  4. #define TERMINAL_RESET "\033[0m"
  5. #define TERMINAL_COLOR_FG_BLACK "\033[30m"
  6. #define TERMINAL_COLOR_FG_RED "\033[31m"
  7. #define TERMINAL_COLOR_FG_GREEN "\033[32m"
  8. #define TERMINAL_COLOR_FG_YELLOW "\033[33m"
  9. #define TERMINAL_COLOR_FG_BLUE "\033[34m"
  10. #define TERMINAL_COLOR_FG_MAGENTA "\033[35m"
  11. #define TERMINAL_COLOR_FG_CYAN "\033[36m"
  12. #define TERMINAL_COLOR_FG_WHITE "\033[37m"
  13. #define TERMINAL_COLOR_BG_BLACK "\033[40m"
  14. #define TERMINAL_COLOR_BG_RED "\033[41m"
  15. #define TERMINAL_COLOR_BG_GREEN "\033[42m"
  16. #define TERMINAL_COLOR_BG_YELLOW "\033[43m"
  17. #define TERMINAL_COLOR_BG_BLUE "\033[44m"
  18. #define TERMINAL_COLOR_BG_MAGENTA "\033[45m"
  19. #define TERMINAL_COLOR_BG_CYAN "\033[46m"
  20. #define TERMINAL_COLOR_BG_WHITE "\033[47m"
  21. #define TERMINAL_STYLE_BOLD "\033[1m"
  22. #define TERMINAL_STYLE_ITALICS "\033[3m"
  23. #define TERMINAL_STYLE_REVERSE "\033[7m"
  24. typedef struct {
  25. const char * attribute;
  26. const char * foreground_color;
  27. const char * background_color;
  28. } terminal_hl_t;
  29. extern display_t * cterm;
  30. extern void cterm_render_callback(const char * const string,
  31. const int length,
  32. void * const attributes);
  33. extern int terminal_hl_init(void);
  34. #define TERMINAL_H_
  35. #endif