Article View: comp.sys.mac
Article #24113Re: Adding to STR# resources
From: Larry Rosenstein
Date: Tue, 19 Jan 1988 23:07
Date: Tue, 19 Jan 1988 23:07
33 lines
1610 bytes
1610 bytes
A couple of comments about this:
In article <7927@eleazar.Dartmouth.EDU> earleh@eleazar.Dartmouth.EDU (Earle R. Horton) writes:
>
>String_list_length = 2 + value_of_header_word + sum_of_length_bytes + PAD
What is the purpose of the PAD? The MPW Rez tool doesn't generate any
padding after the strings. There is no harm in adding padding, however.
Second, a good call to use for this case (often overlooked) is Munger.
Munger operates on the bytes in a handle and can insert, delete, or replace
any sequence of bytes. By using Munger you don't have to worry about
changing the handle size or moving bytes around (if you wanted to insert in
the middle).
Finally, one thing to watch out for is the fact that the individual strings
can start on an odd byte boundary. I ran into this with my ApplicationMenu
INIT, since menus items are stored the same way. You can't use a StringPtr
variable to point to one of the strings, since such a pointer needs to be
even. (This is at least true in MPW Pascal.)
--
Larry Rosenstein
Object Specialist
Apple Computer
AppleLink: Rosenstein1
UUCP: {sun, voder, nsc, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.com
Technical Details
Message-ID:
<7218@apple.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!claris!apple!lsrReferences:
<6554@jade.BERKELEY.EDU> <7927@eleazar.Dartmouth.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!claris!apple!lsr From: lsr@apple.UUCP (Larry Rosenstein) Newsgroups: comp.sys.mac Subject: Re: Adding to STR# resources Message-ID: <7218@apple.UUCP> Date: 19 Jan 88 23:07:00 GMT References: <6554@jade.BERKELEY.EDU> <7927@eleazar.Dartmouth.EDU> Reply-To: lsr@apple.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 33