Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

cdebconf, frontends and namespaces

From: Jérémy Bobbio <lunar(at)debian.org>
Date: Tue Jul 31 2007 - 17:03:21 EDT


Hi!

While working on the GTK+ frontend of cdebconf, I was a little bothered by an issue regarding namespace. I would like to get more opinions on that matter so we can decide how to handle it.

cdebconf loads frontend by loading a shared object located at "<frontend_path>/<frontend_name>.so". The only exported symbol needed is "frontend_module" which is then used to lookup the relevant functions. Up to this point, the frontend is actually free to name its symbols whatever feels the best.

Plugin handling is more restrictive though. Plugin shared objects are located at "<frontend_path>/<frontend>/plugin-<type>.so" and cdebconf looks for a specific symbol in the form "<frontend>_handler_<type>".

As we usually name our frontends with the name of the library they are built on top (newt, gtk, bogl, etc.) this last requirements means you end up needing something like "gtk_handler_entropy".

My personal coding tastes tell me that it's wrong, as the "gtk_" namespace is reserved for the GTK+ library.

Possible solutions I can see to fix this:

  • Do nothing, as I'm just splitting hair.
  • Rename the GTK+ frontend to "fe_gtk" or something similar. I don't like this option because it is inconsistent with other frontends (DEBCONF_FRONTEND=newt vs. DEBCONF_FRONTEND=fe_gtk).
  • Change the plugin symbol lookup to "fe_<frontend>_handler_<type>" (adding "fe_" in front of the current way). That won't be a huge change, as they are not that many plugins currently.

This last option gets my preference. Although, for consistency, I would probably like to rename any exported frontend symbols to "fe_<frontend>" while doing that change.

Do you need help?X

Any comments is more than welcome if you have an opinion. :)

Cheers,

-- 
Jérémy Bobbio                        .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   

-- To UNSUBSCRIBE, email to debian-boot-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Received on Tue Jul 31 17:03:36 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 18:04:12 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library