io.h 659 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __IO_H__
  2. #define __IO_H__
  3. #include <stdio.h>
  4. #include <stdbool.h>
  5. #include "parse.h"
  6. typedef enum invocation_type {
  7. INTERACTIVE = 0,
  8. SCRIPTED,
  9. PIPE
  10. } invocation_type;
  11. struct arguments {
  12. char *prompt;
  13. invocation_type mode;
  14. unsigned int seed;
  15. bool seed_set;
  16. FILE *ist;
  17. };
  18. void getline_wrapper(struct parse_tree *t, struct arguments *args);
  19. void no_read(struct parse_tree *t, struct arguments *args);
  20. void readline_wrapper(struct parse_tree *t, struct arguments *args);
  21. void read_history_wrapper(const char *filename);
  22. void write_history_wrapper(const char *filename);
  23. void sigint_handler(int sig);
  24. #endif // __IO_H__