diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-11 18:36:06 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-11 18:36:06 +0200 |
commit | d975629686360821c020bb7304b7af1528a877f9 (patch) | |
tree | b021375ae20ae8dcffc9b18b86e3dc24ff538dc8 /src/core/wee-hook.c | |
parent | 8211dd6043557f445bf664507fe6daf22a5aa694 (diff) | |
download | weechat-d975629686360821c020bb7304b7af1528a877f9.zip |
Improved /set command, added /unset command, new name for config files (*.conf)
Diffstat (limited to 'src/core/wee-hook.c')
-rw-r--r-- | src/core/wee-hook.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index ba579decb..2855669ce 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -941,7 +941,7 @@ hook_signal_send (char *signal, char *type_data, void *signal_data) */ struct t_hook * -hook_config (struct t_weechat_plugin *plugin, char *type, char *option, +hook_config (struct t_weechat_plugin *plugin, char *option, t_hook_callback_config *callback, void *callback_data) { struct t_hook *new_hook; @@ -961,7 +961,6 @@ hook_config (struct t_weechat_plugin *plugin, char *type, char *option, new_hook->hook_data = new_hook_config; new_hook_config->callback = callback; - new_hook_config->type = (type) ? strdup (type) : strdup (""); new_hook_config->option = (option) ? strdup (option) : strdup (""); hook_add_to_list (new_hook); @@ -974,7 +973,7 @@ hook_config (struct t_weechat_plugin *plugin, char *type, char *option, */ void -hook_config_exec (char *type, char *option, char *value) +hook_config_exec (char *option, char *value) { struct t_hook *ptr_hook, *next_hook; @@ -987,16 +986,13 @@ hook_config_exec (char *type, char *option, char *value) if (!ptr_hook->deleted && !ptr_hook->running - && (!HOOK_CONFIG(ptr_hook, type) - || (string_strcasecmp (HOOK_CONFIG(ptr_hook, type), - type) == 0)) && (!HOOK_CONFIG(ptr_hook, option) || (string_strcasecmp (HOOK_CONFIG(ptr_hook, option), option) == 0))) { ptr_hook->running = 1; (void) (HOOK_CONFIG(ptr_hook, callback)) - (ptr_hook->callback_data, type, option, value); + (ptr_hook->callback_data, option, value); ptr_hook->running = 0; } @@ -1236,8 +1232,6 @@ unhook (struct t_hook *hook) free ((struct t_hook_signal *)hook->hook_data); break; case HOOK_TYPE_CONFIG: - if (HOOK_CONFIG(hook, type)) - free (HOOK_CONFIG(hook, type)); if (HOOK_CONFIG(hook, option)) free (HOOK_CONFIG(hook, option)); free ((struct t_hook_config *)hook->hook_data); @@ -1422,7 +1416,6 @@ hook_print_log () { log_printf (" config data:"); log_printf (" callback . . . . . . : 0x%x", HOOK_CONFIG(ptr_hook, callback)); - log_printf (" type . . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, type)); log_printf (" option . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, option)); } break; |