diff options
Diffstat (limited to 'Hamcore.h')
-rw-r--r-- | Hamcore.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Hamcore.h b/Hamcore.h new file mode 100644 index 0000000..8a2e248 --- /dev/null +++ b/Hamcore.h @@ -0,0 +1,37 @@ +#ifndef HAMCORE_H +#define HAMCORE_H + +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> + +#define HAMCORE_HEADER_DATA "HamCore" +#define HAMCORE_HEADER_SIZE 7 + +typedef struct HAMCORE_FILE +{ + char *Path; + size_t Offset; + size_t Size; + size_t OriginalSize; +} HAMCORE_FILE; + +typedef struct HAMCORE_FILES +{ + size_t Num; + HAMCORE_FILE *List; +} HAMCORE_FILES; + +typedef struct HAMCORE +{ + FILE *File; + HAMCORE_FILES Files; +} HAMCORE; + +HAMCORE *HamcoreOpen(const char *path); +void HamcoreClose(HAMCORE *hamcore); + +const HAMCORE_FILE *HamcoreFind(const HAMCORE *hamcore, const char *path); +bool HamcoreRead(HAMCORE *hamcore, void *dst, const HAMCORE_FILE *file); + +#endif |