diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-11-28 07:54:23 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-11-28 07:54:23 +0100 |
commit | c357408c2c3b133df0e2540a55d58134cf3ff955 (patch) | |
tree | 3279b50da854a3bf5508f975e128f8fd813476ba /src | |
parent | cb60cf9640f99eb73f8c84942a57e8fdc632262b (diff) | |
download | weechat-c357408c2c3b133df0e2540a55d58134cf3ff955.zip |
aspell: rename callback for info "aspell_dict"
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/aspell/weechat-aspell-info.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/src/plugins/aspell/weechat-aspell-info.c b/src/plugins/aspell/weechat-aspell-info.c index ae9676adb..1be2f38cb 100644 --- a/src/plugins/aspell/weechat-aspell-info.c +++ b/src/plugins/aspell/weechat-aspell-info.c @@ -28,12 +28,12 @@ /* - * Returns aspell info. + * Returns aspell info "aspell_dict". */ const char * -weechat_aspell_info_get_info_cb (void *data, const char *info_name, - const char *arguments) +weechat_aspell_info_info_aspell_dict_cb (void *data, const char *info_name, + const char *arguments) { int rc; long unsigned int value; @@ -42,33 +42,30 @@ weechat_aspell_info_get_info_cb (void *data, const char *info_name, /* make C compiler happy */ (void) data; + (void) info_name; - if (weechat_strcasecmp (info_name, "aspell_dict") == 0) + if (!arguments) + return NULL; + + buffer_full_name = NULL; + if (strncmp (arguments, "0x", 2) == 0) { - if (arguments) + rc = sscanf (arguments, "%lx", &value); + if ((rc != EOF) && (rc != 0)) { - buffer_full_name = NULL; - if (strncmp (arguments, "0x", 2) == 0) + buffer = (struct t_gui_buffer *)value; + if (buffer) { - rc = sscanf (arguments, "%lx", &value); - if ((rc != EOF) && (rc != 0)) - { - buffer = (struct t_gui_buffer *)value; - if (buffer) - { - buffer_full_name = weechat_buffer_get_string (buffer, - "full_name"); - } - } + buffer_full_name = weechat_buffer_get_string (buffer, + "full_name"); } - else - buffer_full_name = arguments; - - if (buffer_full_name) - return weechat_aspell_get_dict_with_buffer_name (buffer_full_name); } - return NULL; } + else + buffer_full_name = arguments; + + if (buffer_full_name) + return weechat_aspell_get_dict_with_buffer_name (buffer_full_name); return NULL; } @@ -81,9 +78,10 @@ void weechat_aspell_info_init () { /* info hooks */ - weechat_hook_info ("aspell_dict", - N_("comma-separated list of dictionaries used in buffer"), - N_("buffer pointer (\"0x12345678\") or buffer full name " - "(\"irc.freenode.#weechat\")"), - &weechat_aspell_info_get_info_cb, NULL); + weechat_hook_info ( + "aspell_dict", + N_("comma-separated list of dictionaries used in buffer"), + N_("buffer pointer (\"0x12345678\") or buffer full name " + "(\"irc.freenode.#weechat\")"), + &weechat_aspell_info_info_aspell_dict_cb, NULL); } |