1 // Definitions of an API for loading files.
10 const char *filename, *relative_filename;
13 int64_t num_lines, line_capacity;
14 int64_t *line_offsets;
17 char *resolve_path(const char *path, const char *relative_to, const char *system_path);
18 __attribute__((pure, nonnull)) char *file_base_name(const char *path);
19 __attribute__((nonnull)) file_t *load_file(const char *filename);
20 __attribute__((nonnull, returns_nonnull)) file_t *spoof_file(const char *filename, const char *text);
21 __attribute__((pure, nonnull)) int64_t get_line_number(file_t *f, const char *p);
22 __attribute__((pure, nonnull)) int64_t get_line_column(file_t *f, const char *p);
23 __attribute__((pure, nonnull)) const char *get_line(file_t *f, int64_t line_number);
24 __attribute__((pure, nonnull)) const char *get_file_pos(file_t *f, const char *p);
25 int highlight_error(file_t *file, const char *start, const char *end, const char *hl_color, int64_t context_lines,