Removed unneeded functions and libraries

This commit is contained in:
_ 2018-04-06 14:46:17 -07:00
parent 95ffa588b1
commit a8b7c51a3a
2 changed files with 3 additions and 37 deletions

View File

@ -13,16 +13,12 @@ struct PldHeader {
#pragma pack(pop)
// input: contents of the .pld file.
// allocates heap memory
//struct PldHeader *getpldh(const char*);
// input: pointer to a struct, contents of the .pld file.
// * = pass by reference of a struct PldHeader
bool getpldh(struct PldHeader*, const char*);
// frees heap memory
void destroypldh(struct PldHeader*);
// input: a pld header struct.
// * = pass by reference of a struct PldHeader
void printpldh(struct PldHeader*);
#endif

View File

@ -1,35 +1,5 @@
#include "devil1pld.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* struct PldHeader *getpldh(const char *filedata) {
if (filedata == NULL) {
return NULL;
}
int32_t *n = (int32_t*)filedata;
struct PldHeader *ph = (struct PldHeader*)malloc(
sizeof(struct PldHeader)
);
uint32_t size_offsets = sizeof(uint32_t) * n[0];
ph -> offsets = (uint32_t*)malloc(size_offsets);
if (ph -> offsets == NULL) {
perror("Error 4: ");
free(ph);
free(ph -> offsets);
return NULL;
}
// set data of struct.
ph -> numOffset = n[0];
memcpy(ph -> offsets, filedata + sizeof(int32_t), size_offsets);
return ph;
} */
void destroypldh(struct PldHeader *ph) {
free(ph -> offsets);
free(ph);
ph = NULL;
}
bool getpldh(struct PldHeader *ph, const char *filedata) {
bool good = false;