I'm sorry, but this was wrong.  You must have, as the first argument of
every shared library call, a reference number that is used to determine the
proper library dispatch table to index into for the trap of your call.

However, you don't have to use the reference number in your library function
to unlock your library globals and all that stuff if you aren't going to use
any globals for that particular call.

I hope this hasn't caused anyone any pain...

Kevin


> -----Original Message-----
> From: Kevin O'Keefe 
> Sent: Saturday, February 05, 2000 1:50 PM
> To: Palm Developer Forum
> Subject: RE: Shared libraries and reference numbers
> 
> 
> Once you have opened your library, you can create calls that 
> don't use the
> reference number if they don't use any globals.  
> 
> However, the glue method that Greg suggested can hide the 
> reference number
> pretty well from the standpoint of the callers of your 
> library.  You'll just
> have to have a global in your application that holds the 
> reference number
> (which might preclude you from using the library calls under 
> certain launch
> conditions).
> 
> Kevin
> 
> > -----Original Message-----
> > From: Margus Freudenthal [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 05, 2000 9:11 AM
> > To: Palm-dev-forum list
> > Subject: Shared libraries and reference numbers
> > 
> > 
> > Hello.
> > 
> > I am trying to implement existing C library as a collection 
> of shared
> > libraries.  Problem with this approach is that all calls to shared
> > library functions must have library reference number as first
> > parameter.  Since all shared library calls are implemented as system
> > traps, there should be no real reason for including library 
> reference
> > number, if I don't use any globals.  I tried to do small 
> library based
> > on SampleLib project from Palm, but my program crashed when calling
> > function from library.  Then I compiled SampleLibraryApp that 
> > came with
> > SampleLib project and it chrashed too, so not including 
> > reference number
> > in parameter list might not be the cause of my problems.
> > 
> > I'd prefer not to have reference numbers because this would 
> > mean that I
> > will have to change lot of existing code.
> > 
> > Anyway, is it possible to have shared library functions without
> > reference number and if so, could anyone send me some 
> working piece of
> > code that implements shared library and program that calls it?
> > 
> > -- 
> > Margus
> > 
> 
> -- 
> For information on using the Palm Developer Forums, or to 
> unsubscribe, please see http://www.palm.com/devzone/mailinglists.html
> 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to