Ejemplo n.º 1
0
const char *
weechat_aspell_get_dict (struct t_gui_buffer *buffer)
{
    char *name;
    const char *dict;

    name = weechat_aspell_build_option_name (buffer);
    if (!name)
        return NULL;

    dict = weechat_aspell_get_dict_with_buffer_name (name);

    free (name);

    return dict;
}
Ejemplo n.º 2
0
const char *
weechat_aspell_info_info_aspell_dict_cb (void *data, const char *info_name,
                                         const char *arguments)
{
    int rc;
    long unsigned int value;
    struct t_gui_buffer *buffer;
    const char *buffer_full_name;

    /* make C compiler happy */
    (void) data;
    (void) info_name;

    if (!arguments)
        return NULL;

    buffer_full_name = NULL;
    if (strncmp (arguments, "0x", 2) == 0)
    {
        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");
            }
        }
    }
    else
        buffer_full_name = arguments;

    if (buffer_full_name)
        return weechat_aspell_get_dict_with_buffer_name (buffer_full_name);

    return NULL;
}