1
0

private.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <termios.h>
  2. #include "tinyrl/tinyrl.h"
  3. #include "tinyrl/vt100.h"
  4. /* define the class member data and virtual methods */
  5. struct _tinyrl {
  6. const char *line;
  7. unsigned max_line_length;
  8. char *prompt;
  9. size_t prompt_size;
  10. char *buffer;
  11. size_t buffer_size;
  12. bool_t done;
  13. bool_t completion_over;
  14. bool_t completion_error_over;
  15. unsigned point;
  16. unsigned end;
  17. tinyrl_completion_func_t *attempted_completion_function;
  18. int state;
  19. #define RL_STATE_COMPLETING (0x00000001)
  20. char *kill_string;
  21. #define NUM_HANDLERS 256
  22. tinyrl_key_func_t *handlers[NUM_HANDLERS];
  23. tinyrl_history_t *history;
  24. tinyrl_history_iterator_t hist_iter;
  25. tinyrl_vt100_t *term;
  26. void *context; /* context supplied by caller
  27. * to tinyrl_readline()
  28. */
  29. char echo_char;
  30. bool_t echo_enabled;
  31. struct termios default_termios;
  32. bool_t isatty;
  33. char *last_buffer; /* hold record of the previous
  34. buffer for redisplay purposes */
  35. unsigned last_point; /* hold record of the previous
  36. cursor position for redisplay purposes */
  37. bool_t utf8; /* Is the encoding UTF-8 */
  38. };