#ifndef LINE_SOURCE_H_ #define LINE_SOURCE_H_ #include "file-span.h" #include "status.h" #include #include #include struct line_source { fx_stream *s_stream; const char *s_path; fx_string *s_linebuf; fx_iterator *s_linebuf_ptr; fx_array *s_lines; struct file_cell s_cursor; }; extern enum status line_source_init( struct line_source *src, const char *path, fx_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 fx_wchar line_source_peekc(struct line_source *src); extern fx_wchar line_source_getc(struct line_source *src); extern enum status line_source_get_row( struct line_source *src, size_t row, const fx_string **out); extern bool line_source_input_available(struct line_source *src); #endif