diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-13 18:56:22 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-13 18:56:22 -0800 |
| commit | e7f94bbf50e7d68c3294efc4d437598b8b56b92d (patch) | |
| tree | 8b5a4f1318dec4690bc4ebb9ab48e8fdf2d5d8b7 /file_loader.h | |
| parent | 9a6c0ee9ccf22d635a4bfdff6808b5716cdeca64 (diff) | |
Working towards zero memory leakage
Diffstat (limited to 'file_loader.h')
| -rw-r--r-- | file_loader.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/file_loader.h b/file_loader.h index 2a47d40..85bb920 100644 --- a/file_loader.h +++ b/file_loader.h @@ -8,7 +8,8 @@ struct allocated_op_s; // declared in types.h -typedef struct { +typedef struct file_s { + struct file_s *next; const char *filename; char *contents, **lines, *end; size_t nlines; @@ -16,9 +17,9 @@ typedef struct { unsigned int mmapped:1; } file_t; -file_t *load_file(const char *filename); -__attribute__((nonnull(2), returns_nonnull)) -file_t *spoof_file(const char *filename, char *text); +file_t *load_file(file_t **files, const char *filename); +__attribute__((nonnull(3), returns_nonnull)) +file_t *spoof_file(file_t **files, const char *filename, char *text); __attribute__((nonnull)) void intern_file(file_t *f); __attribute__((nonnull)) |
