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) #pragma pack(pop)
// input: contents of the .pld file. // input: pointer to a struct, contents of the .pld file.
// allocates heap memory // * = pass by reference of a struct PldHeader
//struct PldHeader *getpldh(const char*);
bool getpldh(struct PldHeader*, const char*); bool getpldh(struct PldHeader*, const char*);
// frees heap memory
void destroypldh(struct PldHeader*);
// input: a pld header struct. // input: a pld header struct.
// * = pass by reference of a struct PldHeader
void printpldh(struct PldHeader*); void printpldh(struct PldHeader*);
#endif #endif

View File

@ -1,35 +1,5 @@
#include "devil1pld.h" #include "devil1pld.h"
#include <stdio.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 getpldh(struct PldHeader *ph, const char *filedata) {
bool good = false; bool good = false;