stringport.h 283 B

12345678910111213141516171819
  1. #define STRPORT_CHAR 0
  2. #define STRPORT_FILE 1
  3. typedef struct {
  4. int kind;
  5. // kind=STRPORT_CHAR
  6. char *text;
  7. int place;
  8. // kind=STRPORT_FILE
  9. FILE *fptr;
  10. } string_port;
  11. int port_peek(string_port *port);
  12. int port_eof(string_port *port);
  13. int port_getc(string_port *port);