Curtis writes:
> Greg, thanks for that tip. I'm not the original poster here, but 
> I have similar problems (not with AppCopyTextToField() ). Are there 
> guidelines for creating an app with multiple code sections?

As far as I know, the official spec is 
http://prc-tools.sourceforge.net/doc/prc-tools_3.html#SEC17
(although m68k-palmos-obj-res is obsolete; build-prc does that 
step for you now.)

Those instructions include: "Make very sure that the relevant annotated 
declaration is visible when you define such a function, and especially 
everywhere you call it".


> --------------------- main.c -------------------
> #include morecode.h
> myvar = getvar();
> -------------------------------------------------
> 
> --------------------- morecode.h ----------------
> Int16 getvar();
> -------------------------------------------------
> 
> --------------------- morecode.c ----------------
> Int16 getvar() EXTRA;
> ...
> Int16 getvar()
> {
> code goes here
>  }
> --------------------------------------------------

Here, the call to getvar() in main.c sees the prototype from 
morecode.h, which is not annotated. If getvar() is in the wrong 
section, the code generated for the call will be wrong. 

I'd rewrite it like this:

-- main.c --
#include "morecode.h"
myvar = getvar();

-- morecode.h --
Int16 getvar() EXTRA;

-- morecode.c --
#include "morecode.h"
Int16 getvar() { ... }

This way all code uses the same annotated prototype.


-- 
Greg Parker     [EMAIL PROTECTED]
pssh: SSH 2 for Palm OS 5     http://www.sealiesoftware.com/pssh/
Peal: Palm ELF ARM Loader     http://www.sealiesoftware.com/peal/


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

Reply via email to