From 36da139565202a9a39d1e4261ab8bf950041518b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 24 Aug 2025 23:55:22 +0900 Subject: feat: separate compilation --- src/io.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/io.h (limited to 'src/io.h') diff --git a/src/io.h b/src/io.h new file mode 100644 index 0000000..8a96b59 --- /dev/null +++ b/src/io.h @@ -0,0 +1,25 @@ +#ifndef DUCC_IO_H +#define DUCC_IO_H + +#include "std.h" + +struct SourceLocation { + const char* filename; + int line; +}; +typedef struct SourceLocation SourceLocation; + +struct InFile { + const char* buf; + int pos; + SourceLocation loc; +}; +typedef struct InFile InFile; + +InFile* infile_open(const char* filename); +BOOL infile_eof(InFile* f); +char infile_peek_char(InFile* f); +char infile_next_char(InFile* f); +BOOL infile_consume_if(InFile* f, char expected); + +#endif -- cgit v1.2.3-70-g09d2