about summary refs log tree commit diff stats
path: root/src/tlv.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-12-25 13:05:37 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-12-25 13:33:37 -0800
commitbb6e79aa0debb17d2e3ebc3af91092ef21e7a911 (patch)
treee6bc92c957b4bf464492b018c6847f0b33852336 /src/tlv.c
parent1fdfa8909b27a1e217a7ba3956c16355fe78d2f8 (diff)
downloadteliva-bb6e79aa0debb17d2e3ebc3af91092ef21e7a911.tar.gz
reorg: pull Teliva-specific stuff out of lua.c
It should now be easier to diff against the Lua 5.1 sources upstream.
Diffstat (limited to 'src/tlv.c')
-rw-r--r--src/tlv.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tlv.c b/src/tlv.c
index cca8f6e..815f713 100644
--- a/src/tlv.c
+++ b/src/tlv.c
@@ -184,3 +184,18 @@ void save_tlv(lua_State* L, char* filename) {
   rename(outfilename, filename);
   lua_pop(L, 1);
 }
+
+static const char* special_history_keys[] = {
+  "__teliva_timestamp",
+  "__teliva_undo",
+  "__teliva_note",
+  NULL,
+};
+
+int is_special_history_key(const char* key) {
+  for (const char** curr = special_history_keys; *curr != NULL; ++curr) {
+    if (strcmp(*curr, key) == 0)
+      return 1;
+  }
+  return 0;
+}