lib3ddevil1/include/devil1pld.h
2018-04-17 19:42:28 -07:00

37 lines
987 B
C

#ifndef DEVIL1PLD_H
#define DEVIL1PLD_H
#include <stdint.h>
#include <stdbool.h>
#pragma pack(push, 1)
struct PldHeader {
int32_t numOffset;
// array of numOffset elements
uint32_t *offsets; // <format=hex>
};
#pragma pack(pop)
typedef struct {
bool (* const getheader) (struct PldHeader*, const char*);
int (* const sizeofsector)(struct PldHeader*, unsigned int, unsigned int);
void (* const printheader) (struct PldHeader*);
} namespace_struct;
extern namespace_struct const DEVIL1PLD;
// input: pointer to a struct, contents of the .pld file.
// * = pass by reference of a struct PldHeader
static bool getpldh(struct PldHeader*, const char*);
// input: pointer to header, index of offset, filesize
// * = pass by reference of a struct PldHeader
static int sizeofpldstruct(struct PldHeader*, unsigned int, unsigned int);
// input: a pld header struct.
// * = pass by reference of a struct PldHeader
static void printpldh(struct PldHeader*);
#endif