30 #define DBG_PROGNAME "OPENCBM.DLL"
33 #define DBG_IS_DEBUG_C
40 #define OPENCBM_PLUGIN 1
42 #include "archlib-windows.h"
70 DllMain(IN HANDLE Module, IN DWORD Reason, IN LPVOID Reserved)
72 static BOOL bIsOpen = FALSE;
78 if (Reason == DLL_PROCESS_ATTACH)
107 const char * configurationFilename = NULL;
115 if (configurationFilename == NULL) {
121 if (configuration_handle == NULL) {
125 if (DefaultPluginname != NULL) {
127 "plugins",
"default", DefaultPluginname);
151 opencbm_plugin_self_init_plugin_t * opencbm_plugin_self_init_plugin = NULL;
155 DBG_ERROR((
DBG_PREFIX "Could not load plugin '%s' at '%s' for self-init!\n", Pluginname, Filepath));
159 opencbm_plugin_self_init_plugin =
plugin_get_address(pluginHandle,
"opencbm_plugin_self_init_plugin");
160 if ( ! opencbm_plugin_self_init_plugin ) {
165 error = opencbm_plugin_self_init_plugin();
197 const char * configurationFilename = NULL;
206 if (configurationFilename == NULL) {
211 if (configuration_handle == NULL) {
217 Pluginname,
"location", Filepath);
220 error = cbm_plugin_call_self_init_plugin(Pluginname, Filepath, CommandlineData->OptionMemory);
246 const char Section[],
249 opencbm_plugin_get_all_plugin_names_context_t * Context = Data;
256 if ( ! Section || strcmp(Section,
"plugins") == 0 ) {
269 error = Context->Callback(Context->InstallParameter, Section);
286 const char * configurationFilename = NULL;
292 if (configurationFilename == NULL) {
297 if (configuration_handle == NULL) {
303 opencbm_plugin_get_all_plugin_names_callback, Context);
void cbm_get_debugging_flags(const char *ModuleName)
Set the debugging flags.
void * SHARED_OBJECT_HANDLE
@@@
const char * configuration_get_default_filename_for_install(unsigned int DefaultLocation)
Get the default filename for the configuration file on installation.
Define makros for debugging purposes.
struct CbmPluginInstallProcessCommandlineData_s CbmPluginInstallProcessCommandlineData_t
void cbmlibmisc_strfree(const char *String)
Free a string.
void * plugin_get_address(SHARED_OBJECT_HANDLE handle, const char *name)
@@@
opencbm_configuration_handle opencbm_configuration_create(const char *Filename)
Creates the configuration file for reading and writing.
int opencbm_configuration_set_data(opencbm_configuration_handle Handle, const char Section[], const char Entry[], const char Value[])
Write/Change data to/in the configuration file.
opencbm_configuration_enum_sections_callback_t callback
@@@
Shared library / DLL for accessing the driver Functions for obtaining the addresses of plugin functio...
Shared library / DLL for accessing the driver Read configuration file.
#define FUNC_LEAVE_BOOL(_xxx)
BOOL CBMAPIDECL opencbm_plugin_install_generic(const char *DefaultPluginname, unsigned int DefaultLocation)
@@@
EXTERN BOOL CBMAPIDECL opencbm_plugin_get_all_plugin_names(opencbm_plugin_get_all_plugin_names_context_t *Context)
@@@
void plugin_unload(SHARED_OBJECT_HANDLE handle)
@@@
#define SHARED_OBJECT_HANDLE_INVALID
@@@
SHARED_OBJECT_HANDLE plugin_load(const char *name)
@@@
BOOL WINAPI DllMain(IN HANDLE Module, IN DWORD Reason, IN LPVOID Reserved)
DLL initialization und unloading.
opencbm_configuration_handle opencbm_configuration_open(const char *Filename)
Open the configuration file.
BOOL CBMAPIDECL opencbm_plugin_install_plugin_data(const char *Pluginname, const char *Filepath, const CbmPluginInstallProcessCommandlineData_t *CommandlineData)
@@@
const char * configuration_get_default_filename(void)
Get the default filename for the configuration file.
int opencbm_configuration_enum_sections_callback_t(opencbm_configuration_handle Handle, const char Section[], void *Context)
Callback type for section enumeration.
int plugin_is_active(opencbm_configuration_handle Handle, const char PluginName[])
@@@
Some functions for string handling.
int plugin_set_active(const char PluginName[])
@@@
int opencbm_configuration_enum_sections(opencbm_configuration_handle Handle, opencbm_configuration_enum_sections_callback_t Callback, void *Data)
Enumerate sections in the configuration file.
int opencbm_configuration_close(opencbm_configuration_handle Handle)
Close the configuration file.