mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Removed trailing whitespace
This commit is contained in:
parent
02eedc9e4d
commit
722bbfad23
@ -24,9 +24,9 @@ c_plugin_create(const char * const filename)
|
||||
log_warning ("asprintf failed, plugin %s not loaded", filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
handle = dlopen (path, RTLD_NOW | RTLD_GLOBAL);
|
||||
|
||||
|
||||
if (!handle) {
|
||||
log_warning ("dlopen failed to open `%s', %s", filename, dlerror ());
|
||||
return NULL;
|
||||
@ -40,7 +40,7 @@ c_plugin_create(const char * const filename)
|
||||
plugin->on_start_func = c_on_start_hook;
|
||||
plugin->on_connect_func = c_on_connect_hook;
|
||||
plugin->on_message_received_func = c_on_message_received_hook;
|
||||
|
||||
|
||||
if (!path)
|
||||
free (path);
|
||||
|
||||
@ -54,14 +54,14 @@ c_init_hook(ProfPlugin *plugin, const char * const version, const char * const
|
||||
void (*func)(const char * const __version, const char * const __status);
|
||||
|
||||
assert (plugin && plugin->module);
|
||||
|
||||
|
||||
if (NULL == (f = dlsym (plugin->module, "prof_init"))) {
|
||||
log_warning ("warning: %s does not have init function", plugin->name);
|
||||
return ;
|
||||
}
|
||||
|
||||
func = (void (*)(const char * const, const char * const))f;
|
||||
|
||||
|
||||
// FIXME maybe we want to make it boolean to see if it succeeded or not?
|
||||
func (version, status);
|
||||
}
|
||||
@ -70,10 +70,10 @@ c_init_hook(ProfPlugin *plugin, const char * const version, const char * const
|
||||
void
|
||||
c_on_start_hook (ProfPlugin *plugin)
|
||||
{
|
||||
void * f = NULL;
|
||||
void * f = NULL;
|
||||
void (*func)(void);
|
||||
assert (plugin && plugin->module);
|
||||
|
||||
|
||||
if (NULL == (f = dlsym (plugin->module, "prof_on_start")))
|
||||
return ;
|
||||
|
||||
@ -85,10 +85,10 @@ c_on_start_hook (ProfPlugin *plugin)
|
||||
void
|
||||
c_on_connect_hook (ProfPlugin *plugin)
|
||||
{
|
||||
void * f = NULL;
|
||||
void * f = NULL;
|
||||
void (*func)(void);
|
||||
assert (plugin && plugin->module);
|
||||
|
||||
|
||||
if (NULL == (f = dlsym (plugin->module, "prof_on_connect")))
|
||||
return ;
|
||||
|
||||
@ -101,10 +101,10 @@ c_on_connect_hook (ProfPlugin *plugin)
|
||||
void
|
||||
c_on_message_received_hook(ProfPlugin *plugin, const char * const jid, const char * const message)
|
||||
{
|
||||
void * f = NULL;
|
||||
void * f = NULL;
|
||||
void (*func)(const char * const __jid, const char * const __message);
|
||||
assert (plugin && plugin->module);
|
||||
|
||||
|
||||
if (NULL == (f = dlsym (plugin->module, "prof_on_message_received")))
|
||||
return;
|
||||
|
||||
|
@ -53,7 +53,7 @@ plugins_init(void)
|
||||
cons_show("Loaded python plugin: %s", filename);
|
||||
}
|
||||
// TODO include configure option to vary on windows and
|
||||
// unix i.e. so, dll, or maybe we can come up with unified
|
||||
// unix i.e. so, dll, or maybe we can come up with unified
|
||||
// shared library plugin name... dunno...
|
||||
} else if (g_str_has_suffix(filename, ".so")) {
|
||||
ProfPlugin *plugin = c_plugin_create(filename);
|
||||
@ -68,7 +68,7 @@ plugins_init(void)
|
||||
GSList *curr = plugins;
|
||||
while (curr != NULL) {
|
||||
ProfPlugin *plugin = curr->data;
|
||||
|
||||
|
||||
plugin->init_func(plugin, PACKAGE_VERSION, PACKAGE_STATUS);
|
||||
// TODO well, it should be more of a generic check error here
|
||||
python_check_error();
|
||||
@ -116,18 +116,18 @@ void
|
||||
plugins_shutdown(void)
|
||||
{
|
||||
GSList *curr = plugins;
|
||||
|
||||
|
||||
python_shutdown();
|
||||
|
||||
//FIXME do we need to clean the plugins list?
|
||||
//for the time being I'll just call dlclose for
|
||||
//for the time being I'll just call dlclose for
|
||||
//every C plugin.
|
||||
|
||||
|
||||
while (curr != NULL) {
|
||||
ProfPlugin *plugin = curr->data;
|
||||
if (plugin->lang == C)
|
||||
c_close_library (plugin);
|
||||
|
||||
|
||||
curr = g_slist_next(curr);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user