[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

cdebconf, frontends and namespaces



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.

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

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

Attachment: signature.asc
Description: Digital signature


Reply to: