I did a very similar thing using gcc/PilRC not CodeWarrior, but something
similar is probably possible in CodeWarrior.

I used a resource command  DATA in PilRC this has the following structure

DATA "name" id_number "filename"

where name is a resource type of your choise (I don't think it matters what
you put here but you will need this to access to data from code), id_number
is a resource id number and filename was the name of the file containing the
binary data. This is limited to data blocks < 64K.

Then to access the data in your program use the following:

DmGetResource(...)
MemHandleLock(...);

not forgetting

MemHandleUnlock(...);
DmReleaseResource(...);

before you exit your application.

James Screech


Andrew D. Stadler <[EMAIL PROTECTED]> wrote in message
news:53453@palm-dev-forum...
>
> Hi all,
>
> I've seen a lot of traffic devoted to the issue of large apps (how to
> segment your code when it's greater than 32k or 64k).
>
> I haven't found any messages dealing with very large data sets, and how
> best to build them into applications.
>
> For example, suppose I am building an application which views maps.  I
> wouldn't need a very big program (let's assume segmented code is easy).
> But I would like to bundle a large dataset with the application - the
> maps themselves.
>
> Assumptions:
>   I can cram it all into one or more large binary blobs and deal with
> the internal organization myself
>   Dataset can be spread across multiple <64k blobs
>   Dataset is static - I don't need to deal with
> read/write/update/backup.  Consider it part of the program itself.
>   Beam or backup of the app, should bring the dataset along.  The app
> shouldn't fail.
>   I would like to remain largely within the CodeWarrior environment
>
> Can anyone point me to documentation, or sample code, or suggestions, on
> good ways to do this?  I'm planning to experiment with a couple of
> possible solutions
>
> Some ideas include...
>
> (1)  For each <64k blob of source data, create a 1-line .r file and
> "read" that blob into a resource.  Put each .r file in a separate linker
> segment.  Q:  Will this work, and will the separate .r files segment the
> data properly?
>
> (2)  Put the user data into a .pdb file and associate it with the
> program.  Q:  OK to have a >64k .pdb file?  Q:  How do I assure that the
> .pdb file will travel with the program, if the program is backed up /
> copied / beamed ?
>
> Any other ideas welcome but what I'm really looking for is real-world
> examples here.  Thanks!
>
> Andy
>
>
>
>
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to