summary refs log tree commit diff
path: root/bin/edi/edi.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-24 01:10:07 -0500
committerJune McEnroe <june@causal.agency>2018-11-24 01:10:07 -0500
commitcab57be05c395b18fb726ec2ec64880445caa54a (patch)
tree40ea82c33b5debdcaf6eeda6b971e59edf6ad69f /bin/edi/edi.h
parentSet default .asm, .h, .sh syntax modes for vim (diff)
downloadsrc-cab57be05c395b18fb726ec2ec64880445caa54a.tar.gz
src-cab57be05c395b18fb726ec2ec64880445caa54a.zip
Add premature serialization to edi
Diffstat (limited to '')
-rw-r--r--bin/edi/edi.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/edi/edi.h b/bin/edi/edi.h
index be7bf681..f335d1bd 100644
--- a/bin/edi/edi.h
+++ b/bin/edi/edi.h
@@ -14,6 +14,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <stdbool.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <wchar.h>
 
@@ -75,8 +77,8 @@ struct Log {
 	size_t cap, len;
 	size_t state;
 	struct State {
-		struct Table table;
 		size_t prev, next;
+		struct Table table;
 	} *states;
 };
 struct Log logAlloc(size_t cap);
@@ -87,6 +89,14 @@ static inline struct Table *logTable(const struct Log *log) {
 	return &log->states[log->state].table;
 }
 
+struct Edit {
+	struct Buffer buf;
+	struct Log log;
+};
+
+bool storeWrite(FILE *stream, const struct Edit *edit);
+bool storeRead(FILE *stream, struct Edit *edit);
+
 struct File {
 	char *path;
 	struct Buffer buf;