diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-24 23:55:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-25 00:18:08 +0900 |
| commit | 36da139565202a9a39d1e4261ab8bf950041518b (patch) | |
| tree | c8e8867edc4e4fed94403331b8a7837e9951d9af /src/io.h | |
| parent | 5bbc4414b8178ff924444857ac05e5b06cf0e651 (diff) | |
| download | ducc-36da139565202a9a39d1e4261ab8bf950041518b.tar.gz ducc-36da139565202a9a39d1e4261ab8bf950041518b.tar.zst ducc-36da139565202a9a39d1e4261ab8bf950041518b.zip | |
feat: separate compilation
Diffstat (limited to 'src/io.h')
| -rw-r--r-- | src/io.h | 25 |
1 files changed, 25 insertions, 0 deletions
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 |
