[jp] Plugin namespaces...
judd at jpilot.org
Fri Mar 21 02:11:02 EST 2003
Gerard W. Patterson wrote:
> 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
> 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
> Platform: Linux
> Distro: Debian/Sid
> Jpilot: 0.99.5
More information about the Jpilot