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

Function ProDOS_GetFileHeader

source/ProDOS_FileSystem.h:494–523  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

492
493 // ------------------------------------------------------------
494 void ProDOS_GetFileHeader ( uint8_t *pDiskBytes, int nOffset, ProDOS_FileHeader_t *pFileHeader_ )
495 {
496 ProDOS_FileHeader_t info;
497
498 info.kind = (pDiskBytes[ nOffset + 0 ] >> 4) & 0xF;
499 info.len = (pDiskBytes[ nOffset + 0 ] >> 0) & 0xF;
500
501 for( int i = 0; i < PRODOS_MAX_FILENAME+1; i++ )
502 info.name[ i ] = 0;
503
504 for( int i = 0; i < info.len; i++ )
505 info.name[ i ] = pDiskBytes[ nOffset + 1+i];
506
507 info.type = pDiskBytes[ nOffset + 16 ];
508 info.inode = ProDOS_Get16( pDiskBytes, nOffset + 17 );
509 info.blocks = ProDOS_Get16( pDiskBytes, nOffset + 19 );
510 info.size = ProDOS_Get24( pDiskBytes, nOffset + 21 );
511 info.date = ProDOS_Get16( pDiskBytes, nOffset + 24 );
512 info.time = ProDOS_Get16( pDiskBytes, nOffset + 26 );
513 info.cur_ver = pDiskBytes[ nOffset + 28 ];
514 info.min_ver = pDiskBytes[ nOffset + 29 ];
515 info.access = pDiskBytes[ nOffset + 30 ];
516 info.aux = ProDOS_Get16( pDiskBytes, nOffset + 31 );
517 info.mod_date = ProDOS_Get16( pDiskBytes, nOffset + 33 );
518 info.mod_time = ProDOS_Get16( pDiskBytes, nOffset + 35 );
519 info.dir_block = ProDOS_Get16( pDiskBytes, nOffset + 37 );
520
521 if ( pFileHeader_ )
522 *pFileHeader_ = info;
523 }
524
525 // ------------------------------------------------------------------------
526 void ProDOS_PutFileHeader ( uint8_t *pDiskBytes, int nOffset, ProDOS_FileHeader_t *pMeta )

Callers 1

Calls 2

ProDOS_Get16Function · 0.85
ProDOS_Get24Function · 0.85

Tested by

no test coverage detected