[hfs-user] Catalog Thread record size ?

Entwicklung entwicklung@whengenibk.de
Tue, 16 Apr 2002 11:06:00 +0200


Yes, but if you look at the definitions below  : UniChar has been defined as
UInt16 - since Multibyte Unicode is being used for HFS+  - So every
character takes up 2 Bytes in BigEndian format .

So the HFSUniStr255 structure has actually 256 units of 2 Bytes
each -including the length - please correct me if I'm wrong or you think
otherwise.

Regards,
Nandini


----- Original Message -----
From: "Simon Bazley" <sibaz@sibaz.com>
To: "Entwicklung" <entwicklung@whengenibk.de>
Cc: <hfs-user@lists.mars.org>
Sent: Tuesday, April 16, 2002 10:57 AM
Subject: Re: [hfs-user] Catalog Thread record size ?


> Why would you want to multiply 256 by 2? a byte is 1, a char is 1,
> therefore 256 chars are 256.
>
> Entwicklung wrote:
>
> > Hello,        I just have a question regarding the size of the HFS
> > Plus - Catalog Thread Record specified in the Apple Universal
> > Interfaces headers - typedef UInt16                UniChar; /*
> > HFSUniStr255 is the Unicode equivalent of Str255 */
> > struct HFSUniStr255 {
> >   UInt16               length;                 /* number of unicode
> > characters */
> >   UniChar             unicode[255];           /* unicode characters */
> >
> > }; /* HFS Plus catalog thread record -- 264 bytes */
> > struct HFSPlusCatalogThread {
> >   UInt16                      recordType;             /* record type
> > */
> >   UInt16                      reserved;               /* reserved -
> > set to zero */
> >   HFSCatalogNodeID    parentID;               /* parent ID for this
> > catalog node */
> >   HFSUniStr255           nodeName;               /* name of this
> > catalog node (variable length) */
> > };
> > typedef struct HFSPlusCatalogThread     HFSPlusCatalogThread; Based on
> > the above declarations shouldn't the size for the HFSPlus catalog
> > thread record be 2+2+4 (since CNID's are 4 bytes long ) + 256*2 =
> > 264+256 instead of 264 as mentioned above ? I think someone probably
> > forgot to multiply the 256 by 2 but I just wanted to make sure that is
> > an error. I'd be happy to hear some feedback from the list wrt
> > this. Best Regards,Nandini Hengen
>