From 5f10d9b51487c4635a8400e8a86bbd51e221bdd2 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 22 Nov 2018 22:04:41 -0500 Subject: Add fileWrite for edi --- bin/edi/edi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin/edi/edi.h') 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); -- cgit 1.4.1