MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / ProDOS_BlockGetPathOffset

Function ProDOS_BlockGetPathOffset

source/ProDOS_FileSystem.h:263–291  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

261
262 // ------------------------------------------------------------------------
263 int ProDOS_BlockGetPathOffset ( uint8_t *pDiskBytes, ProDOS_VolumeHeader_t *pVolume, const char *pProDOSPath )
264 {
265 int nOffset = PRODOS_ROOT_OFFSET; // Block 2 * 0x200 Bytes/Block = 0x400 abs offset
266
267#if _DEBUG
268 ProDOS_VolumeHeader_t tVolume;
269 memset( &tVolume, 0, sizeof(tVolume) );
270
271 int iDirBlock = nOffset / PRODOS_BLOCK_SIZE;
272 if (!pVolume)
273 pVolume = &tVolume;
274
275 int nDirBlocks = ProDOS_BlockGetDirectoryBlockCount( pDiskBytes, nOffset );
276 LogOutput( "Directory Entry Bytes : $%04X\n", pVolume->entry_len );
277 LogOutput( "Directory Entries/Block: %d\n" , pVolume->entry_num );
278 LogOutput( "VOLUME Directory Blocks: %d\n" , nDirBlocks );
279// LogOutput( "...Alt. max dir files : %d\n" ,(nDirBlocks * PRODOS_BLOCK_SIZE) / pVolume->entry_len ); // 2nd way to verify
280#endif
281
282 if( !pProDOSPath )
283 return nOffset;
284
285 if (strcmp( pProDOSPath, "/" ) == 0)
286 return nOffset;
287
288 // NOT IMPLEMENTED
289 // return ProDOS_FindFile( pDiskBytes, pVolume, pProDOSPath, nOffset );
290 return 0;
291 }
292
293 // ------------------------------------------------------------------------
294 int ProDOS_BlockInitFree ( uint8_t *pDiskBytes, size_t nDiskSize, ProDOS_VolumeHeader_t *volume )

Callers 1

Util_ProDOS_AddFileFunction · 0.85

Calls 2

LogOutputFunction · 0.85

Tested by

no test coverage detected