On Wed, Jun 27, 2001 at 07:56:59PM -0000, [EMAIL PROTECTED] wrote:
> So after a little hand massaging, I got the new build-prc installed.
What new build-prc? What massaging? I assume you mean the one from
prc-tools 2.0.92, and that the massaging was to extract only build-prc.
> I also have the new pilrc installed.
What new pilrc? I assume you mean 2.8p5.
> Now I am just going nuts
As am I! :-) It would be much easier if you would just tell us the
versions of the tools you're complaining about, and the contents of your
.rcp files, instead of making us guess.
> I use this to make LargeIcon.ro and SmallIcon.ro
> pilrc -R SmallIcon.ro -prc SmallIcon.rcp
> pilrc -R LargeIcon.ro -prc LargeIcon.rcp
[...]
> and I run this line:
> build-prc -o BE.prc -c pook -n BE BE.exe SmallIcon.ro LargeIcon.ro
> and get this output:
> BE.exe: corrupt 4
"corrupt 4" is to be sure not a great error message. Until today I'd
never actually seen a corrupt PRC formatted file, so I didn't bother
making these messages very descriptive. This particular one means that
an offset to the contents of a resource is invalid.
With some (most?) compilers, pilrc 2.8p5 makes a lot of those.
The pilrc PRC-writing code generates the affected parts by fwrite()ing
records of type RsrcEntryType:
typedef struct
{
UInt32 type; // resource type
UInt16 id; // resource id
LocalID localChunkID; // resource data chunk ID
}
RsrcEntryType;
This is inherently utterly unportable code. It's completely broken.
For some compilers on some platforms some of the time, it's possible to
ensure that this struct is packed such that fwrite()ing it writes
exactly 10 bytes. But in general it's impossible. For Palm OS
programs, this kind of code can be made to work; but for a program like
pilrc that's supposed to run on dozens of OSes on dozens of platforms,
it's a waste of time.
There's no excuse for this sort of code in pilrc. Pilrc spends all its
time writing out structures in a particular packed format, and contains
many portable routines for doing it properly. Pilrc's PRC-writing code
ought to reuse those routines instead of trying to do the impossible.
Fortunately a patch that does just that is already written [1]. It's
not too late for pilrc to use it.
> and to show what I think is a bug:
> build-prc -o BE.prc -c pook -n BE SmallIcon.ro BE.exe LargeIcon.ro
> and get this output:
> (null): corrupt 4
> BE.exe: corrupt 4
True. Thank you for reporting this.
John
[1] http://www.geocrawler.com/archives/3/2912/2001/5/0/5705126/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/