blob: 71e25b0a77386b5f6dc1099a410008acbe00d819 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef DUCC_IO_H
#define DUCC_IO_H
#include "json.h"
typedef struct {
const char* filename;
int line;
} SourceLocation;
void sourcelocation_build_json(JsonBuilder* builder, SourceLocation* loc);
typedef struct {
const char* buf;
int pos;
SourceLocation loc;
} InFile;
InFile* infile_open(const char* filename);
bool infile_eof(InFile* f);
char infile_peek_char(InFile* f);
char infile_peek_char2(InFile* f);
char infile_next_char(InFile* f);
bool infile_consume_if(InFile* f, char expected);
#endif
|