[jp] Plugin namespaces...

Gerard W. Patterson gerry.patterson at computalog.com
Fri Mar 21 11:06:01 EST 2003


Judd,

   Thank you for the reply.  I figured as much.  I will make as many of
   the functions I can static (you're right, the best practice) and make
   the rest prefixed.

   Gerry

On Fri, Mar 21, 2003 at 02:11:02AM -0500, Judd Montgomery wrote:
> Gerard W. Patterson wrote:
> >Hello,
> >
> >   I started writing a plug-in to syncronize entries between my Palm
> >   Address database and cell-phone.  I am aware there are already
> >   a few utilities that do this but none seem to have the integration
> >   into Jpilot that I was looking for.  I am very new to the gtk library
> >   and building shared libraries in general.  Quite a learning
> >   experience...
> >
> >   My question is this:
> >
> >   I had a function called make_category_menu().  This appeared to collide
> >   with a function already declared in the main application.  Jpilot
> >   kept crashing until I changed the name or declared it static.  This I
> >   can understand.  However, is the name-space of all of the loaded
> >   plug-ins shared?  Do I have to ensure that every function I declare
> >   (and don't make static) is different from every other function in
> >   every other plug-in?  Or just the main app?
> >
> Yes, you have to either make all of your function names static, or 
> unique.  Static is the best practice.  You could attempt to make them 
> unique by prefixing them with an abbreviation of the plugin name.
> 
> >   I didn't want to declare these functions static as eventually I want
> >   to move this function to a separate .c file as the library grows.
> >
> ok, then just prefix it to try to make it unique.
> 
> >   Sorry, this sounds like a generic C question but I couldn't find
> >   anything in the comp.lang.c forum that described this.  I was
> >   wondering if the plug-in loader in Jpilot had some form of mangler...
> >
> I don't think you can mangle the names after the compile, but I could be 
> wrong.
> 
> >   Platform: Linux
> >   Distro:   Debian/Sid
> >   Jpilot:   0.99.5
> >
> >
> > Gerry
> 
> _______________________________________________
> jpilot mailing list
> jpilot at jpilot.org
> http://www.jpilot.org/mailman/listinfo/jpilot



More information about the Jpilot mailing list