From 0d1ae015fef8e15442dafa61b9c8d929ce467969 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Wed, 15 Aug 2018 22:46:40 +0200 Subject: Refactor code into a library and implement basic file management methods --- src/c4groupentrycore.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/c4groupentrycore.h (limited to 'src/c4groupentrycore.h') diff --git a/src/c4groupentrycore.h b/src/c4groupentrycore.h new file mode 100644 index 0000000..c77a5d1 --- /dev/null +++ b/src/c4groupentrycore.h @@ -0,0 +1,26 @@ +#pragma once +#include + +typedef enum { + C4GroupEntryCore_NoCRC = 0, + C4GroupEntryCore_ContentsCRC = 1, + C4GroupEntryCore_ContentsFileNameCRC = 2 +} C4GroupEntryCore_HasCRC; + +typedef struct { + char FileName[257]; + uint8_t Reserved1[3]; + int32_t Packed; + int32_t Directory; + int32_t Size; + int32_t Reserved2; + int32_t Offset; + int32_t Modified; + uint8_t HasCRC; + uint32_t CRC; + uint8_t Executable; + uint8_t Reserved3[26]; +} __attribute__((__packed__)) C4GroupEntryCore; + +void C4GroupEntryCore_init(C4GroupEntryCore* const this); +void C4GroupEntryCore_setFileName(C4GroupEntryCore* const this, const char* const fileName); -- cgit v1.2.3-54-g00ecf