2018-04-02 02:51:12 +05:30
|
|
|
#ifndef DEVIL1PLD_H
|
|
|
|
#define DEVIL1PLD_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-04-07 03:12:52 +05:30
|
|
|
#include <stdbool.h>
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
2018-04-02 02:51:12 +05:30
|
|
|
struct PldHeader {
|
|
|
|
int32_t numOffset;
|
|
|
|
// array of numOffset elements
|
|
|
|
uint32_t *offsets; // <format=hex>
|
|
|
|
};
|
|
|
|
|
2018-04-07 03:12:52 +05:30
|
|
|
#pragma pack(pop)
|
|
|
|
|
2018-04-07 03:16:17 +05:30
|
|
|
// input: pointer to a struct, contents of the .pld file.
|
|
|
|
// * = pass by reference of a struct PldHeader
|
2018-04-18 08:07:59 +05:30
|
|
|
static bool getpldh(struct PldHeader*, const char*);
|
2018-04-02 12:15:30 +05:30
|
|
|
|
2018-04-07 04:18:44 +05:30
|
|
|
// input: pointer to header, index of offset, filesize
|
|
|
|
// * = pass by reference of a struct PldHeader
|
2018-04-18 08:07:59 +05:30
|
|
|
static int sizeofpldstruct(struct PldHeader*, unsigned int, unsigned int);
|
2018-04-07 04:18:44 +05:30
|
|
|
|
2018-04-02 13:51:21 +05:30
|
|
|
// input: a pld header struct.
|
2018-04-07 03:16:17 +05:30
|
|
|
// * = pass by reference of a struct PldHeader
|
2018-04-18 08:07:59 +05:30
|
|
|
static void printpldh(struct PldHeader*);
|
2018-04-02 13:51:21 +05:30
|
|
|
|
2018-04-18 08:07:59 +05:30
|
|
|
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;
|
|
|
|
|
|
|
|
#endif
|