aboutsummaryrefslogtreecommitdiff
path: root/file_loader.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-09-23 22:37:28 -0700
committerBruce Hill <bruce@bruce-hill.com>2020-09-23 22:37:28 -0700
commit938ff73730b49488e06677fed8c2980638cbeeca (patch)
treef88eabbb93aabfbb8785b264d77477f3ac4c86a0 /file_loader.h
parent452c7df023181954d48c5338ba8cb10dbeae1a94 (diff)
More rigorous compile-time checks via __attribute__s
Diffstat (limited to 'file_loader.h')
-rw-r--r--file_loader.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/file_loader.h b/file_loader.h
index a93c7a3..1634f15 100644
--- a/file_loader.h
+++ b/file_loader.h
@@ -14,9 +14,13 @@ typedef struct {
} file_t;
file_t *load_file(const char *filename);
+__attribute__((nonnull))
void destroy_file(file_t **f);
+__attribute__((pure, nonnull))
size_t get_line_number(file_t *f, const char *p);
+__attribute__((pure, nonnull))
size_t get_char_number(file_t *f, const char *p);
+__attribute__((pure, nonnull))
const char *get_line(file_t *f, size_t line_number);
void fprint_line(FILE *dest, file_t *f, const char *start, const char *end, const char *msg);