MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FS_HandleForFile

Function FS_HandleForFile

code/qcommon/files.cpp:329–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329static fileHandle_t FS_HandleForFile(void) {
330 int i;
331
332 for ( i = 1 ; i < MAX_FILE_HANDLES ; i++ ) {
333 if ( fsh[i].handleFiles.file.o == NULL ) {
334 return i;
335 }
336 }
337
338 Com_Printf( "FS_HandleForFile: all handles taken:\n" );
339 for ( i = 1 ; i < MAX_FILE_HANDLES ; i++ ) {
340 Com_Printf( "%d. %s\n", i, fsh[i].name);
341 }
342 Com_Error( ERR_DROP, "FS_HandleForFile: none free" );
343 return 0;
344}
345
346static FILE *FS_FileForHandle( fileHandle_t f ) {
347 if ( f < 1 || f >= MAX_FILE_HANDLES ) {

Callers 5

FS_SV_FOpenFileWriteFunction · 0.70
FS_SV_FOpenFileReadFunction · 0.70
FS_FOpenFileWriteFunction · 0.70
FS_FOpenFileAppendFunction · 0.70
FS_FOpenFileReadFunction · 0.70

Calls 2

Com_PrintfFunction · 0.70
Com_ErrorFunction · 0.70

Tested by

no test coverage detected