diff options
author | June McEnroe <june@causal.agency> | 2018-11-22 22:04:41 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-11-22 22:04:41 -0500 |
commit | 5f10d9b51487c4635a8400e8a86bbd51e221bdd2 (patch) | |
tree | c92c5eb89ee2fb5ad060e6c80135f2e32794bc2e /bin/edi/edi.h | |
parent | Simplify edi file reading (diff) | |
download | src-5f10d9b51487c4635a8400e8a86bbd51e221bdd2.tar.gz src-5f10d9b51487c4635a8400e8a86bbd51e221bdd2.zip |
Add fileWrite for edi
Diffstat (limited to 'bin/edi/edi.h')
-rw-r--r-- | bin/edi/edi.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/edi/edi.h b/bin/edi/edi.h index 644e0901..ee1fdd4a 100644 --- a/bin/edi/edi.h +++ b/bin/edi/edi.h @@ -82,6 +82,10 @@ struct Log { struct Log logAlloc(size_t cap); void logFree(struct Log *log); void logPush(struct Log *log, struct Table table); +static inline struct Table *logTable(const struct Log *log) { + if (log->state == log->len) return NULL; + return &log->states[log->state].table; +} struct File { char *path; @@ -92,3 +96,4 @@ struct File { struct File fileAlloc(char *path); void fileFree(struct File *file); void fileRead(struct File *file); +void fileWrite(struct File *file); |