lib3ddevil1/src/devil1pld.c

25 lines
643 B
C
Raw Normal View History

#include "devil1pld.h"
#include <stdio.h>
2018-04-07 03:12:52 +05:30
bool getpldh(struct PldHeader *ph, const char *filedata) {
bool good = false;
if (ph != NULL && filedata != NULL) {
ph -> numOffset = (int32_t)filedata[0];
ph -> offsets = (uint32_t*)(filedata + sizeof(int32_t));
good = true;
}
return good;
}
void printpldh(struct PldHeader *ph) {
if (ph == NULL) {
return;
}
printf("number of offsets = %i\n", ph -> numOffset);
2018-04-07 03:12:52 +05:30
printf("offsets = %x\n", ph -> offsets);
unsigned int i;
for (i = 0; i < ph -> numOffset; i++) {
printf("offset %i = %x\n", i, ph -> offsets[i]);
}
}