summary refs log tree commit diff
path: root/bin/edi/edi.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-22 22:04:41 -0500
committerJune McEnroe <june@causal.agency>2018-11-22 22:04:41 -0500
commit34532a56421ef19a5a5bc5c93068fb26f4c29187 (patch)
tree2b63a1df063087ffa7fbed09a85e9812f4f6f096 /bin/edi/edi.h
parentSimplify edi file reading (diff)
downloadsrc-34532a56421ef19a5a5bc5c93068fb26f4c29187.tar.gz
src-34532a56421ef19a5a5bc5c93068fb26f4c29187.zip
Add fileWrite for edi
Diffstat (limited to 'bin/edi/edi.h')
-rw-r--r--bin/edi/edi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/edi/edi.h b/bin/edi/edi.h
index fbfab40f..fd3a2f33 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);