if anyone cares: // PasStructs.h #ifndef _H_PasStructs #define _H_PasStructs #ifndef ushort typedef unsigned short ushort; #endif #include "FileSystemTypes.h" #include "PasDiskLocSpec.h" #pragma options align = packed #define Pas_kBytesPerBlock 512L // 0x0200L bytes #define Pas_kBlocksPerDisk 280L // 0x0118L blocks #define Pas_kDirStartBlock 2L #define Pas_kDirEndBlockPlusOne 6L // disk structs typedef struct { Byte byte[Pas_kBytesPerBlock]; } Pas_Block; typedef struct Pas_Disk { Pas_Block block[Pas_kBlocksPerDisk]; } Pas_Disk; typedef ushort Pas_BlockNum, Pas_EntryIndex; #define Pas_GetBlock(imageRec, blockNum) \ &((imageRec)->image.pas->block[blockNum]) #define Pas_kMaxDirEntries 77 #define Pas_kVolIDLength 7 #define Pas_kTitleIDLength 15 typedef struct { unsigned short month : 3; unsigned short day : 5; unsigned short year : 7; unsigned short unused : 1; } Pas_DateRec; typedef unsigned char Pas_VolumeID[Pas_kVolIDLength + 1]; typedef char Pas_VolumeIDStr[Pas_kVolIDLength]; typedef unsigned char Pas_TitleID[Pas_kTitleIDLength + 1]; typedef char Pas_TitleIDStr[Pas_kTitleIDLength]; typedef enum { Pas_FileKind_UNTYPED, Pas_FileKind_X_DISK, Pas_FileKind_CODE, Pas_FileKind_TEXT, Pas_FileKind_INFO, Pas_FileKind_DATA, Pas_FileKind_GRAF, Pas_FileKind_FOTO, Pas_FileKind_SECURE_DIR, Pas_FileKind_NUMTYPES } Pas_FileKindType; /************* Pas_DirEntryVolume is for these types: Pas_FileKind_UNTYPED Pas_FileKind_SECURE_DIR */ typedef struct { // volume info - only in Pas_DirEntry[0] Pas_VolumeID volumeID; // name of disk volume Pas_BlockSpec endOfVolume; // last block in volume Byte numFiles; // number of files in directory RboShort loadTime; // time of last access Pas_DateRec lastBoot; // most recent date settings } Pas_DirEntryVolume; typedef struct { // regular file info Pas_TitleID titleID; // name of file RboShort lastByte; // num bytes in last file block Pas_DateRec access; // date of last modification } Pas_DirEntryFile; typedef union { Pas_DirEntryVolume volume; Pas_DirEntryFile file; } Pas_DirEntryUnion; typedef struct { Pas_BlockSpec firstBlock; Pas_BlockSpec lastBlockPlusOne; RboShort fileKind; // Pas_FileKindType Pas_DirEntryUnion entryType; } Pas_DirEntry; typedef Pas_DirEntry Pas_Directory[Pas_kMaxDirEntries]; #pragma options align = reset Boolean Pas_IsPas(DiskImageRec *imageRec); void Pas_Catalog(DiskImageRec *imageRec); #endif pausch@saaf.se (Paul Schlyter) wrote in message news:... > Do you have these files available too? the only thing in the #include "PasDiskLocSpec.h" is this: typedef RboShort Pas_BlockSpec; an RboShort is a reverse-byte-order unsigned 16 bit value (for macintosh it's reverse, on a PC, I don't think it's reverse) but in #include "FileSystemTypes.h" there's stuff about the data structures that reference the actual disk image, there's nothing in there about Pascal. In article <68a2ec1b.0201201507.3fa71387@posting.google.com>, Lazarus I. Long wrote: > pausch@saaf.se (Paul Schlyter) wrote in message news:... > > Do you have these files available too? > > the only thing in the #include "PasDiskLocSpec.h" is this: > > typedef RboShort Pas_BlockSpec; Which raises the question what a Pas_BlockSpec is -- that too wasn't define din the posted code. > an RboShort is a reverse-byte-order unsigned 16 bit value > (for macintosh it's reverse, on a PC, I don't think it's reverse) :-) ...you've read Gulliver's Travels, and the war therein between the Big Endians and the Little Endians? > but in #include "FileSystemTypes.h" there's stuff about the data > structures that reference the actual disk image, there's nothing in > there about Pascal. I was actually wondering about the definitions of the constants below: typedef enum { Pas_FileKind_UNTYPED, Pas_FileKind_X_DISK, Pas_FileKind_CODE, Pas_FileKind_TEXT, Pas_FileKind_INFO, Pas_FileKind_DATA, Pas_FileKind_GRAF, Pas_FileKind_FOTO, Pas_FileKind_SECURE_DIR, Pas_FileKind_NUMTYPES } Pas_FileKindType; -- ---------------------------------------------------------------- Paul Schlyter, Swedish Amateur Astronomer's Society (SAAF) Grev Turegatan 40, S-114 38 Stockholm, SWEDEN e-mail: pausch at saaf dot se WWW: http://hem.passagen.se/pausch/index.html http://home.tiscali.se/~pausch/ Paul Schlyter wrote: > In article <68a2ec1b.0201201507.3fa71387@posting.google.com>, > Lazarus I. Long wrote: > > > pausch@saaf.se (Paul Schlyter) wrote: > > > Do you have these files available too? > > > > the only thing in the #include "PasDiskLocSpec.h" is this: > > > > typedef RboShort Pas_BlockSpec; > > Which raises the question what a Pas_BlockSpec is -- that too wasn't > define din the posted code. Are you unfamiliar with the C language? The typedef statement above is defining Pas_BlockSpec to be the same type as RboShort. > > an RboShort is a reverse-byte-order unsigned 16 bit value > > (for macintosh it's reverse, on a PC, I don't think it's reverse) > > :-) ...you've read Gulliver's Travels, and the war therein between > the Big Endians and the Little Endians? I agree - defining this as a "little endian 16-bit signed integer" would be clearer than "reverse byte order". > > but in #include "FileSystemTypes.h" there's stuff about the data > > structures that reference the actual disk image, there's nothing in > > there about Pascal. > > I was actually wondering about the definitions of the constants below: > > typedef enum { > Pas_FileKind_UNTYPED, > Pas_FileKind_X_DISK, > Pas_FileKind_CODE, > Pas_FileKind_TEXT, > Pas_FileKind_INFO, > Pas_FileKind_DATA, > Pas_FileKind_GRAF, > Pas_FileKind_FOTO, > Pas_FileKind_SECURE_DIR, > > Pas_FileKind_NUMTYPES > } Pas_FileKindType; This is an enumerated type, and the constants have not been assigned specific values, so the default behaviour applies: the first constant (Pas_FileKind_UNTYPED) is zero, and subsequent constants increment by one. This means that Pas_FileKind_NUMTYPES is 9. -- David Empson dempson@actrix.gen.nz