[sword-devel] finding conf file for module

Matthew Talbert ransom1982 at gmail.com
Sat May 22 17:06:48 MST 2010


I'm writing gobject bindings for SWORD, which consists of refactoring
most of our backend code that we've used for a long time in Xiphos.
Part of the code we have is to set the cipher key for a module. In
looking at that, I don't see an easy way to get the .conf file for a
particular module. We even have these lines in our code (I didn't
write them....):

#ifdef SWORD_SHOULD_HAVE_A_WAY_TO_GET_A_CONF_FILENAME_FROM_A_MODNAME
        return backend->get_config_file(mod_name, moddir);
#else
        lengthy way to get the config file...

In fact, we have two separate methods for finding the conf file. In
the documentation for setCipherKey(), there is example code for
writing to the config file.  However, the code is fatally flawed in
that it assumes that all of the conf files live in a single directory,
"configPath". In a typical linux system, most of the conf files will
be in ~/.mods.d, and SWORD is set up in such a way that there could be
multiple directories for conf files.

So, my first question is, "what is the best way to get the conf file
for a given module?" and the second is, "could we please add this to
the engine?"

Also, how does SWModule::getConfigEntry("AbsoluteDataPath") work?
There is no entry like this in the .conf files; is it documented
somewhere? Couldn't it just be a method of SWModule?

Thanks,
Matthe



More information about the sword-devel mailing list