Eliminate QFS_LoadHunkFile().

It is unused, and part of the group of functions I wish to remove from QF.
This commit is contained in:
Bill Currie 2010-08-25 08:23:59 +09:00
parent ea22ec1271
commit 745bdfafdf
2 changed files with 0 additions and 131 deletions

View File

@ -89,7 +89,6 @@ int _QFS_FOpenFile (const char *filename, QFile **gzfile,
int QFS_FOpenFile (const char *filename, QFile **gzfile);
byte *QFS_LoadFile (const char *path, int usehunk);
byte *QFS_LoadStackFile (const char *path, void *buffer, int bufsize);
byte *QFS_LoadTempFile (const char *path);
byte *QFS_LoadHunkFile (const char *path);
void QFS_LoadCacheFile (const char *path, struct cache_user_s *cu);
@ -115,8 +114,6 @@ void QFS_FilelistAdd (filelist_t *filelist, const char *fname,
void QFS_FilelistFill (filelist_t *list, const char *path, const char *ext,
int strip);
void QFS_FilelistFree (filelist_t *list);
void QFS_FilelistEnumerate(filelist_t* list, const char* path);
qboolean QFS_IsDirectory (const char *path);
/** Expand leading "~/" in \a path to the user's home directory.

View File

@ -972,12 +972,6 @@ QFS_LoadHunkFile (const char *path)
return QFS_LoadFile (path, 1);
}
VISIBLE byte *
QFS_LoadTempFile (const char *path)
{
return QFS_LoadFile (path, 2);
}
VISIBLE void
QFS_LoadCacheFile (const char *path, struct cache_user_s *cu)
{
@ -1526,128 +1520,6 @@ QFS_FilelistFill (filelist_t *list, const char *path, const char *ext,
}
}
VISIBLE qboolean
QFS_IsDirectory (const char *path)
{
searchpath_t *search;
if (!path[0])
return true;
for (search = qfs_searchpaths; search != NULL; search = search->next)
{
if (search->pack)
{
int i;
pack_t *pak = search->pack;
for (i = 0; i < pak->numfiles; i++)
{
const char* prefix = va("%s/", path);
const char* filename = pak->files[i].name;
if (strlen(prefix) < strlen(filename) && !strncmp(prefix, filename, strlen(prefix)))
{
return true;
}
}
}
else
{
const char* truepath = va("%s/%s", search->filename, path);
struct stat buf;
if (!stat(truepath, &buf) && S_ISDIR(buf.st_mode))
return true;
}
}
return false;
}
VISIBLE void
QFS_FilelistEnumerate(filelist_t* list, const char* path)
{
searchpath_t *search;
for (search = qfs_searchpaths; search != NULL; search = search->next)
{
if (search->pack)
{
int i;
pack_t *pak = search->pack;
for (i = 0; i < pak->numfiles; i++)
{
const char* prefix = path[0] ? va("%s/", path) : "";
char* filename = pak->files[i].name;
int j;
for (j = 0; j < list->count; j++)
{
if (list->list[j] && !strncmp(list->list[j], filename, strlen(list->list[j])))
{
goto OUT;
}
}
if (strlen(prefix) < strlen(filename) &&
!strncmp(prefix, filename, strlen(prefix)))
{
char* slash = strchr(filename + strlen(prefix), '/');
int j;
qboolean exists = false;
if (slash)
*slash = 0;
for (j = 0; j < list->count; j++)
{
if (list->list[j] && !strcmp(list->list[j], filename))
{
exists = true;
break;
}
}
if (!exists)
QFS_FilelistAdd(list, filename, 0);
if (slash)
*slash = '/';
}
OUT: ;
}
}
else
{
const char* truepath = va("%s/%s", search->filename, path);
DIR *dir_ptr = opendir (truepath);
struct dirent *dirent;
if (!dir_ptr)
continue;
while ((dirent = readdir (dir_ptr)))
{
if (strcmp(".", dirent->d_name) && strcmp("..", dirent->d_name))
{
int j;
qboolean exists = false;
for (j = 0; j < list->count; j++)
{
if (list->list[j] && !strcmp(list->list[j], dirent->d_name))
{
exists = true;
break;
}
}
if (!exists)
QFS_FilelistAdd(list, dirent->d_name, 0);
}
}
closedir (dir_ptr);
}
}
}
VISIBLE void
QFS_FilelistFree (filelist_t *list)
{