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

Function ProDOS_PutFileHeader

source/ProDOS_FileSystem.h:526–553  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

524
525 // ------------------------------------------------------------------------
526 void ProDOS_PutFileHeader ( uint8_t *pDiskBytes, int nOffset, ProDOS_FileHeader_t *pMeta )
527 {
528 int base = nOffset;
529
530 uint8_t KindLen = 0
531 | ((pMeta->kind & 0xF) << 4)
532 | ((pMeta->len & 0xF) << 0)
533 ;
534
535 pDiskBytes [ base + 0 ] = KindLen;
536
537 for( int i = 0; i < pMeta->len; i++ )
538 pDiskBytes [ base + 1+i] = pMeta->name[ i ];
539
540 pDiskBytes[ base + 16 ] = pMeta->type;
541 ProDOS_Put16( pDiskBytes, base + 17 , pMeta->inode );
542 ProDOS_Put16( pDiskBytes, base + 19 , pMeta->blocks );
543 ProDOS_Put24( pDiskBytes, base + 21 , pMeta->size );
544 ProDOS_Put16( pDiskBytes, base + 24 , pMeta->date );
545 ProDOS_Put16( pDiskBytes, base + 26 , pMeta->time );
546 pDiskBytes[ base + 28 ] = pMeta->cur_ver ;
547 pDiskBytes[ base + 29 ] = pMeta->min_ver ;
548 pDiskBytes[ base + 30 ] = pMeta->access ;
549 ProDOS_Put16( pDiskBytes, base + 31 , pMeta->aux );
550 ProDOS_Put16( pDiskBytes, base + 33 , pMeta->mod_date );
551 ProDOS_Put16( pDiskBytes, base + 35 , pMeta->mod_time );
552 ProDOS_Put16( pDiskBytes, base + 37 , pMeta->dir_block );
553 }
554
555 // ------------------------------------------------------------------------
556 size_t ProDOS_String_CopyUpper( char *pDst, const char *pSrc, int nLen = 0 )

Callers 1

Util_ProDOS_AddFileFunction · 0.85

Calls 2

ProDOS_Put16Function · 0.85
ProDOS_Put24Function · 0.85

Tested by

no test coverage detected