mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-25 16:28:57 +05:30
Removed unneeded functions and libraries
This commit is contained in:
parent
95ffa588b1
commit
a8b7c51a3a
@ -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
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user