terminal.h 737 B

123456789101112131415161718192021222324
  1. #ifndef TERMINAL_H
  2. #define TERMINAL_H
  3. // TODO: add class. :P
  4. struct console_details {
  5. int posx, posy;
  6. int savedx, savedy;
  7. char ansi[20]; // current ANSI command being processed.
  8. int in_ansi;
  9. int fgcolor; // 0-7 // not 0-15
  10. int bgcolor; // 0-7
  11. int status; // 0, 1 or 5 (Blink)
  12. };
  13. void console_init(struct console_details *cdp);
  14. void ansi_color(struct console_details *cdp, int color);
  15. const char *color_restore(struct console_details *cdp);
  16. void console_ansi(struct console_details *cdp, const char *ansi);
  17. int console_char(struct console_details *cdp, char ch);
  18. void console_string(struct console_details *cdp, const char *chars);
  19. void console_receive(struct console_details *cdp, const char *chars, int len);
  20. #endif