devil1pld.h 808 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef DEVIL1PLD_H
  2. #define DEVIL1PLD_H
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #pragma pack(push, 1)
  6. struct PldHeader {
  7. int32_t numOffset;
  8. // array of numOffset elements
  9. uint32_t *offsets; // <format=hex>
  10. };
  11. #pragma pack(pop)
  12. typedef struct {
  13. // input: pointer to a struct, contents of the .pld file.
  14. // * = pass by reference of a struct PldHeader
  15. bool (* const getheader) (struct PldHeader*, const char*);
  16. // input: pointer to header, index of offset, filesize
  17. // * = pass by reference of a struct PldHeader
  18. int (* const sizeofsector)(struct PldHeader*, unsigned int, unsigned int);
  19. // input: a pld header struct.
  20. // * = pass by reference of a struct PldHeader
  21. void (* const printheader) (struct PldHeader*);
  22. } fn_devil1pld;
  23. extern fn_devil1pld const DEVIL1PLD;
  24. #endif