Files
rosetta/toolchain/xpcg/line-source.h
Max Wash 26a49162e6 toolchain: replace ifc interface compiler with xpcg
xpcg is used to generate xpc interfaces
2026-03-10 19:12:14 +00:00

40 lines
958 B
C

#ifndef LINE_SOURCE_H_
#define LINE_SOURCE_H_
#include "file-span.h"
#include "status.h"
#include <blue/core/stream.h>
#include <blue/ds/array.h>
#include <blue/ds/string.h>
struct line_source {
b_stream *s_stream;
const char *s_path;
b_string *s_linebuf;
b_iterator *s_linebuf_ptr;
b_array *s_lines;
struct file_cell s_cursor;
};
extern enum status line_source_init(
struct line_source *src,
const char *path,
b_stream *stream);
extern void line_source_cleanup(struct line_source *src);
extern const char *line_source_get_path(const struct line_source *src);
extern const struct file_cell *line_source_get_cursor(
const struct line_source *src);
extern b_wchar line_source_peekc(struct line_source *src);
extern b_wchar line_source_getc(struct line_source *src);
extern enum status line_source_get_row(
struct line_source *src,
size_t row,
const b_string **out);
extern bool line_source_input_available(struct line_source *src);
#endif