diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2018-08-15 22:46:40 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2018-08-15 23:15:15 +0200 |
| commit | 0d1ae015fef8e15442dafa61b9c8d929ce467969 (patch) | |
| tree | a8d56fd12f5c5366e1f6fa3ecc20c78c0202f747 /src/c4groupheader.h | |
| parent | e04f662a42c75cb202684e7254d3b7600e6e1756 (diff) | |
| download | cc4group-0d1ae015fef8e15442dafa61b9c8d929ce467969.tar.gz cc4group-0d1ae015fef8e15442dafa61b9c8d929ce467969.zip | |
Refactor code into a library and implement basic file management methods
Diffstat (limited to 'src/c4groupheader.h')
| -rw-r--r-- | src/c4groupheader.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/c4groupheader.h b/src/c4groupheader.h new file mode 100644 index 0000000..1faa912 --- /dev/null +++ b/src/c4groupheader.h @@ -0,0 +1,27 @@ +#pragma once +#include <stdint.h> +#include <stdbool.h> + +#define C4GroupMaxMaker 30 +#define C4GroupMaxPassword 30 + +#define C4GroupId "RedWolf Design GrpFolder" +#define C4GroupOfficial 1234567 + +typedef struct { + char id[25]; + uint8_t Reserved1[3]; + int32_t Ver1, Ver2; + int32_t Entries; + char Maker[C4GroupMaxMaker + 2]; + char Password[C4GroupMaxPassword + 2]; // also reserved + int32_t Creation; + int32_t Official; + uint8_t Reserved2[92]; +} __attribute__((__packed__)) C4GroupHeader; + +void C4GroupHeader_init(C4GroupHeader* const this); +void C4GroupHeader_setMaker(C4GroupHeader* const this, const char* const maker); +bool C4GroupHeader_isOfficial(const C4GroupHeader* const this); +void C4GroupHeader_setOfficial(C4GroupHeader* const this, bool const official); +void C4GroupHeader_setCreation(C4GroupHeader* const this, int32_t const creation); |
