#include <stdlib.h>
#include "gmqcc.h"
+#include "platform.h"
/*
* The PAK format uses a FOURCC concept for storing the magic ident within
memset(pathsplit, 0, 56);
- util_strncpy(directory, entry, 56);
+ platform_strncpy(directory, entry, 56);
for (itr = 0; (token = pak_tree_sep(&directory, "/")) != NULL; itr++) {
elements[itr] = token;
}
for (jtr = 0; jtr < itr - 1; jtr++) {
- util_strcat(pathsplit, elements[jtr]);
- util_strcat(pathsplit, "/");
+ platform_strcat(pathsplit, elements[jtr]);
+ platform_strcat(pathsplit, "/");
if (fs_dir_make(pathsplit)) {
mem_d(pathsplit);
typedef struct {
pak_directory_t *directories;
pak_header_t header;
- FILE *handle;
+ fs_file_t *handle;
bool insert;
} pak_file_t;
pak_directory_t *dir = NULL;
unsigned char *dat = NULL;
char *local = NULL;
- FILE *out = NULL;
+ fs_file_t *out = NULL;
if (!pak_exists(pak, file, &dir)) {
return false;
mem_d(dat);
return true;
-
+
err:
if (dat) mem_d(dat);
if (out) fs_file_close(out);
pak_directory_t dir;
unsigned char *dat;
long len;
- FILE *fp;
+ fs_file_t *fp;
/*
* We don't allow insertion on files that already exist within the
if (strlen(file) >= 56)
goto err;
- util_strncpy(dir.name, file, strlen(file));
+ platform_strncpy(dir.name, file, strlen(file));
/*
* Allocate some memory for loading in the data that will be
* Like pak_insert_one, except this collects files in all directories
* from a root directory, and inserts them all.
*/
-bool pak_insert_all(pak_file_t *pak, const char *dir) {
+#if 0
+static bool pak_insert_all(pak_file_t *pak, const char *dir) {
DIR *dp;
struct dirent *dirp;
fs_dir_close(dp);
return true;
}
+#endif /*!if 0 renable when ready to use */
static bool pak_close(pak_file_t *pak) {
size_t itr;