diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 18:31:28 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 18:31:28 -0700 |
| commit | 219f62ed3f51a1094e75d4bf8823db7608e70b0e (patch) | |
| tree | 4fcfbb08525b61590086ba1494152721d9bbb221 /files.h | |
| parent | cc6e25a06fdebbabe4b170ca5f43c399cfa0f70e (diff) | |
Renamed file_t.contents -> file_t.start, added file_t.memory for
canonical tracking of memory for mmap, simplified json printing,
and added support for initiating searches on a specific line (and/or
column).
Diffstat (limited to 'files.h')
| -rw-r--r-- | files.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -15,7 +15,7 @@ struct allocated_pat_s; // declared in types.h typedef struct file_s { struct file_s *next; const char *filename; - char *contents, **lines, *end; + char *memory, **lines, *start, *end; size_t nlines; struct allocated_pat_s *pats; bool mmapped:1; @@ -25,6 +25,8 @@ __attribute__((nonnull(2))) file_t *load_file(file_t **files, const char *filename); __attribute__((format(printf,2,3))) file_t *load_filef(file_t **files, const char *fmt, ...); +__attribute__((nonnull)) +void slice_file(file_t *slice, file_t *src, const char *start, const char *end); __attribute__((nonnull(3), returns_nonnull)) file_t *spoof_file(file_t **files, const char *filename, const char *text, ssize_t len); __attribute__((nonnull)) |
