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/c4groupentrycore.c | |
| 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/c4groupentrycore.c')
| -rw-r--r-- | src/c4groupentrycore.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/c4groupentrycore.c b/src/c4groupentrycore.c new file mode 100644 index 0000000..8b483cc --- /dev/null +++ b/src/c4groupentrycore.c @@ -0,0 +1,24 @@ +#include "c4groupentrycore.h" +#include <string.h> +#include <time.h> + +void C4GroupEntryCore_init(C4GroupEntryCore* const this) +{ + memset(this->FileName, 0, sizeof(this->FileName)); + memset(this->Reserved1, 0, sizeof(this->Reserved1)); + this->Packed = 0; + this->Directory = 0; + this->Size = 0; + this->Reserved2 = 0; + this->Offset = 0; + this->Modified = time(NULL); + this->HasCRC = C4GroupEntryCore_NoCRC; + this->CRC = 0; + this->Executable = 0; + memset(this->Reserved3, 0, sizeof(this->Reserved3)); +} + +void C4GroupEntryCore_setFileName(C4GroupEntryCore* const this, const char* const fileName) +{ + strncpy(this->FileName, fileName, sizeof(this->FileName) - 1); +} |
