1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

Add function to get plugin name (return "core" for WeeChat core)

This commit is contained in:
Sebastien Helleu
2008-10-08 19:04:05 +02:00
parent 0e053e072b
commit 5d07aa14ed
16 changed files with 435 additions and 245 deletions
+14
View File
@@ -85,6 +85,18 @@ plugin_search (const char *name)
return NULL;
}
/*
* plugin_get_name: get name of plugin with a pointer
*/
char *
plugin_get_name (struct t_weechat_plugin *plugin)
{
static char *plugin_core = PLUGIN_CORE;
return (plugin) ? plugin->name : plugin_core;
}
/*
* plugin_load: load a WeeChat plugin (a dynamic library)
* return: pointer to new WeeChat plugin, NULL if error
@@ -281,6 +293,8 @@ plugin_load (const char *filename)
new_plugin->charset = (charset) ? strdup (charset) : NULL;
/* functions */
new_plugin->plugin_get_name = &plugin_get_name;
new_plugin->charset_set = &plugin_api_charset_set;
new_plugin->iconv_to_internal = &string_iconv_to_internal;
new_plugin->iconv_from_internal = &string_iconv_from_internal;