diff options
author | Thibaut Mattern <thibaut.mattern@gmail.com> | 2007-04-05 19:00:10 +0200 |
---|---|---|
committer | Thibaut Mattern <thibaut.mattern@gmail.com> | 2007-04-05 19:00:10 +0200 |
commit | 54ad01301df2b562e316a7910436ac1ff7494ac3 (patch) | |
tree | db013fe306d1a9da7c4c88534edb22a563aebda3 /src/xine-engine/load_plugins.c | |
parent | b69a5d17e266401901adf5e62ca7d4f4e94d82e0 (diff) | |
download | xine-lib-54ad01301df2b562e316a7910436ac1ff7494ac3.tar.gz xine-lib-54ad01301df2b562e316a7910436ac1ff7494ac3.tar.bz2 |
Defined a callback for config entry registration.
The next step is to add the entries to the node.
Diffstat (limited to 'src/xine-engine/load_plugins.c')
-rw-r--r-- | src/xine-engine/load_plugins.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index d35eba736..320fc0dd2 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -338,6 +338,7 @@ static void _insert_node (xine_t *this, entry->file = file; entry->ref = 0; entry->priority = 0; /* default priority */ + entry->config_entry_list = NULL; switch (info->type & PLUGIN_TYPE_MASK){ @@ -694,6 +695,17 @@ static inline int _plugin_info_equal(const plugin_info_t *a, return 1; } +/* + * This callback is called by the config entry system when a plugin register a + * new config entry. + */ +static void _new_entry_cb (void *user_data, xine_cfg_entry_t *entry) { + plugin_node_t *node = (plugin_node_t *)user_data; + /* + printf("_new_entry_cb: key %s, plugin id: %s\n", entry->key, node->info->id); + */ +} + static int _load_plugin_class(xine_t *this, plugin_node_t *node, void *data) { @@ -721,9 +733,16 @@ static int _load_plugin_class(xine_t *this, if ((info = dlsym(node->file->lib_handle, "xine_plugin_info"))) { /* TODO: use sigsegv handler */ - while (info->type != PLUGIN_NONE){ - if (_plugin_info_equal(info, target)){ - if ((node->plugin_class = info->init(this, data))) { + while (info->type != PLUGIN_NONE) { + if (_plugin_info_equal(info, target)) { + config_values_t *config = this->config; + + /* the callback is called for each entry registered by this plugin */ + config->set_new_entry_callback(config, _new_entry_cb, node); + node->plugin_class = info->init(this, data); + config->unset_new_entry_callback(config); + + if (node->plugin_class) { inc_file_ref(node->file); return 1; } else { |