oh, sorry, that was supposed to be "library FUNC pointers"

On 12/2/06, Dmitry Grinberg <[EMAIL PROTECTED]> wrote:
>
> function calls to libraries are made using A-traps, just like system
> calls, so you cannot get pointers to them, for the same reason you cannot
> get a pointer to "SysAppLaunch" or "DmDatabaseInfo" in the standard way.
> That being said, I expect you can get into the library table and get
> pointers out of it on OS4 and below devices. On OS5 it gets much more
> complicated with PACE and I do not know how to get library fuck pointers in
> 68k code there.
>
> On 12/2/06, P REEDER <[EMAIL PROTECTED]> wrote:
> >
> > Several of the palmOne shared libraries have a version function with the
> > following signature:
> > Err PalmPhotoLibGetVersion (UInt16 refNum, UInt32 sdkVersion, UInt32
> > *libVersionP)
> >
> > I have declared a table with some pointers to functions having that
> > signature:
> > typedef struct {
> >         UInt32 type;
> >         UInt32 creator;
> >         char* internalName;
> >         char* humanName;
> >         Err (*GetVersion) (UInt16 refNum, UInt32 sdkVersion, UInt32
> > *libVersionP);
> > } PalmOneLibRec;
> >
> > #define NUM_PALMONE_SHARED_LIB 2
> > PalmOneLibRec palmOneSharedLibs[] = {
> >         {PalmPhotoLibTypeID , PalmPhotoLibCreatorID, PalmPhotoLibName ,
> > "palmOne Photo", &PalmPhotoLibGetVersion},
> >         {kCamLibType, kCamLibCreator, kCamLibName, "palmOne Camera Mgr",
> > &CamLibGetVersion},
> > };
> >
> >
> > However, the above code fails to compile, with the error message
> > undefined reference to `PalmPhotoLibGetVersion'
> >
> >
> > If I declare a helper function:
> >
> > Err CallPalmPhotoLibGetVersion(UInt16 refNum, UInt32 sdkVersion, UInt32
> > *libVersionP) {
> >         return PalmPhotoLibGetVersion(refNum, sdkVersion, libVersionP);
> > }
> >
> > I can put a pointer to this function in my table, without any problem.
> >
> >
> > Obviously, functions in shared libraries are not quite the same as
> > functions in my code, but is there a way to use pointers to functions in
> > shared libraries, without declaring helper functions?
> >
> >
> > [I'm using prc-tools (m68k-palmos-gcc is version 2.95.3-kgpd) under OS X
> > 10.3.9]
> > --
> > For information on using the PalmSource Developer Forums, or to
> > unsubscribe, please see http://www.palmos.com/dev/support/forums/
> >
>
>
>
> --
> Best Regards, Dmitry Grinberg
> Software Engineer, http://PalmPowerups.com
> (847) 226 9295
> AIM: DmitryGrinberg
> MSN: [EMAIL PROTECTED]
> ICQ: 165589894
> Y! IM: dmitrygr2003 -- For information on using the PalmSource Developer
> Forums, or to unsubscribe, please see
> http://www.palmos.com/dev/support/forums/




-- 
Best Regards, Dmitry Grinberg
Software Engineer, http://PalmPowerups.com
(847) 226 9295
AIM: DmitryGrinberg
MSN: [EMAIL PROTECTED]
ICQ: 165589894
Y! IM: dmitrygr2003

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

Reply via email to