filesystem: hungry

This commit is contained in:
Alibek Omarov 2022-12-15 01:06:20 +03:00
parent 08f834cd82
commit f1ec612819
6 changed files with 36 additions and 36 deletions

View File

@ -121,12 +121,12 @@ void FS_InitDirectorySearchpath( searchpath_t *search, const char *path, int fla
Q_strncpy( search->filename, path, sizeof( search->filename ));
search->type = SEARCHPATH_PLAIN;
search->flags = flags;
search->printinfo = FS_PrintInfo_DIR;
search->close = FS_Close_DIR;
search->openfile = FS_OpenFile_DIR;
search->filetime = FS_FileTime_DIR;
search->findfile = FS_FindFile_DIR;
search->search = FS_Search_DIR;
search->pfnPrintInfo = FS_PrintInfo_DIR;
search->pfnClose = FS_Close_DIR;
search->pfnOpenFile = FS_OpenFile_DIR;
search->pfnFileTime = FS_FileTime_DIR;
search->pfnFindFile = FS_FindFile_DIR;
search->pfnSearch = FS_Search_DIR;
}
qboolean FS_AddDir_Fullpath( const char *path, qboolean *already_loaded, int flags )

View File

@ -489,7 +489,7 @@ void FS_ClearSearchPath( void )
}
else fs_searchpaths = search->next;
search->close( search );
search->pfnClose( search );
Mem_Free( search );
}
@ -1526,7 +1526,7 @@ void FS_Path_f( void )
{
string info;
s->printinfo( s, info, sizeof(info) );
s->pfnPrintInfo( s, info, sizeof(info) );
Con_Printf( "%s", info );
@ -1799,7 +1799,7 @@ searchpath_t *FS_FindFile( const char *name, int *index, qboolean gamedironly )
if( gamedironly & !FBitSet( search->flags, FS_GAMEDIRONLY_SEARCH_FLAGS ))
continue;
pack_ind = search->findfile( search, name );
pack_ind = search->pfnFindFile( search, name );
if( pack_ind >= 0 )
{
if( index ) *index = pack_ind;
@ -1848,7 +1848,7 @@ file_t *FS_OpenReadFile( const char *filename, const char *mode, qboolean gamedi
if( search == NULL )
return NULL;
return search->openfile( search, filename, mode, pack_ind );
return search->pfnOpenFile( search, filename, mode, pack_ind );
}
/*
@ -2532,7 +2532,7 @@ int FS_FileTime( const char *filename, qboolean gamedironly )
search = FS_FindFile( filename, &pack_ind, gamedironly );
if( !search ) return -1; // doesn't exist
return search->filetime( search, filename );
return search->pfnFileTime( search, filename );
}
/*
@ -2642,7 +2642,7 @@ search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly )
if( gamedironly && !FBitSet( searchpath->flags, FS_GAMEDIRONLY_SEARCH_FLAGS ))
continue;
searchpath->search( searchpath, &resultlist, pattern, caseinsensitive );
searchpath->pfnSearch( searchpath, &resultlist, pattern, caseinsensitive );
}
if( resultlist.numstrings )

View File

@ -79,12 +79,12 @@ typedef struct searchpath_s
struct searchpath_s *next;
void ( *printinfo )( struct searchpath_s *search, char *dst, size_t size );
void ( *close )( struct searchpath_s *search );
file_t *( *openfile )( struct searchpath_s *search, const char *filename, const char *mode, int pack_ind );
int ( *filetime )( struct searchpath_s *search, const char *filename );
int ( *findfile )( struct searchpath_s *search, const char *path );
void ( *search )( struct searchpath_s *search, stringlist_t *list, const char *pattern, int caseinsensitive );
void (*pfnPrintInfo)( struct searchpath_s *search, char *dst, size_t size );
void (*pfnClose)( struct searchpath_s *search );
file_t *(*pfnOpenFile)( struct searchpath_s *search, const char *filename, const char *mode, int pack_ind );
int (*pfnFileTime)( struct searchpath_s *search, const char *filename );
int (*pfnFindFile)( struct searchpath_s *search, const char *path );
void (*pfnSearch)( struct searchpath_s *search, stringlist_t *list, const char *pattern, int caseinsensitive );
} searchpath_t;
extern fs_globals_t FI;

View File

@ -404,12 +404,12 @@ qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loaded, int
search->next = fs_searchpaths;
search->flags |= flags;
search->printinfo = FS_PrintInfo_PAK;
search->close = FS_Close_PAK;
search->openfile = FS_OpenFile_PAK;
search->filetime = FS_FileTime_PAK;
search->findfile = FS_FindFile_PAK;
search->search = FS_Search_PAK;
search->pfnPrintInfo = FS_PrintInfo_PAK;
search->pfnClose = FS_Close_PAK;
search->pfnOpenFile = FS_OpenFile_PAK;
search->pfnFileTime = FS_FileTime_PAK;
search->pfnFindFile = FS_FindFile_PAK;
search->pfnSearch = FS_Search_PAK;
fs_searchpaths = search;

View File

@ -596,12 +596,12 @@ qboolean FS_AddWad_Fullpath( const char *wadfile, qboolean *already_loaded, int
search->next = fs_searchpaths;
search->flags |= flags;
search->printinfo = FS_PrintInfo_WAD;
search->close = FS_Close_WAD;
search->openfile = FS_OpenFile_WAD;
search->filetime = FS_FileTime_WAD;
search->findfile = FS_FindFile_WAD;
search->search = FS_Search_WAD;
search->pfnPrintInfo = FS_PrintInfo_WAD;
search->pfnClose = FS_Close_WAD;
search->pfnOpenFile = FS_OpenFile_WAD;
search->pfnFileTime = FS_FileTime_WAD;
search->pfnFindFile = FS_FindFile_WAD;
search->pfnSearch = FS_Search_WAD;
fs_searchpaths = search;

View File

@ -706,12 +706,12 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int
search->next = fs_searchpaths;
search->flags |= flags;
search->printinfo = FS_PrintInfo_ZIP;
search->close = FS_Close_ZIP;
search->openfile = FS_OpenFile_ZIP;
search->filetime = FS_FileTime_ZIP;
search->findfile = FS_FindFile_ZIP;
search->search = FS_Search_ZIP;
search->pfnPrintInfo = FS_PrintInfo_ZIP;
search->pfnClose = FS_Close_ZIP;
search->pfnOpenFile = FS_OpenFile_ZIP;
search->pfnFileTime = FS_FileTime_ZIP;
search->pfnFindFile = FS_FindFile_ZIP;
search->pfnSearch = FS_Search_ZIP;
fs_searchpaths = search;