aboutsummaryrefslogtreecommitdiff
path: root/c/data.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-16 04:37:48 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-16 04:37:48 +0200
commit5095c2e2ba9aadf468514804fb3a872d10fdc17d (patch)
tree6683057496648797923ce686440c101510d9bc87 /c/data.h
parentafd245c205e2787e54cb7e2fd34de617eeceed25 (diff)
downloadEpisodeBrowser-5095c2e2ba9aadf468514804fb3a872d10fdc17d.tar.gz
Implement preliminary IO.
It might be a good idea to eschew the structs and access the data directly from the view. Alternatively, the serialization functions might be rewritten to simply memcpy the structs, after either adding __attribute__((packed)) or ensuring consistent padding.
Diffstat (limited to 'c/data.h')
-rw-r--r--c/data.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/c/data.h b/c/data.h
index 797271d..91e34d9 100644
--- a/c/data.h
+++ b/c/data.h
@@ -24,6 +24,16 @@ struct DlvData
wchar_t wiki[128] = {0};
};
+struct DatView
+{
+ DatView(const wchar_t* filename, size_t cb);
+ ~DatView();
+ HANDLE hf;
+ HANDLE hm;
+ void* view;
+ /* TODO: Handle exceptions on read and write... */
+};
+
constexpr size_t CB_SERIALIZE_ELVDATA = 1+sizeof(ElvData);
unsigned char* Serialize(const ElvData& e, unsigned char* buf);
unsigned char* Unserialize(ElvData& e, unsigned char* buf);