private.h 1.6 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. {
  7. const char *line;
  8. unsigned max_line_length;
  9. const char *prompt;
  10. size_t prompt_size;
  11. char *buffer;
  12. size_t buffer_size;
  13. bool_t done;
  14. bool_t completion_over;
  15. bool_t completion_error_over;
  16. unsigned point;
  17. unsigned end;
  18. tinyrl_completion_func_t *attempted_completion_function;
  19. int state;
  20. #define RL_STATE_COMPLETING (0x00000001)
  21. char *kill_string;
  22. #define NUM_HANDLERS 256
  23. tinyrl_key_func_t *handlers[NUM_HANDLERS];
  24. tinyrl_history_t *history;
  25. tinyrl_history_iterator_t hist_iter;
  26. tinyrl_vt100_t *term;
  27. void *context; /* context supplied by caller
  28. * to tinyrl_readline()
  29. */
  30. char echo_char;
  31. bool_t echo_enabled;
  32. struct termios default_termios;
  33. bool_t isatty;
  34. char *last_buffer; /* hold record of the previous
  35. buffer for redisplay purposes */
  36. unsigned last_point; /* hold record of the previous
  37. cursor position for redisplay purposes */
  38. };