您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ weechat_hashtable_set函数代码示例

51自学网 2021-06-03 09:54:51
  C++
这篇教程C++ weechat_hashtable_set函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中weechat_hashtable_set函数的典型用法代码示例。如果您正苦于以下问题:C++ weechat_hashtable_set函数的具体用法?C++ weechat_hashtable_set怎么用?C++ weechat_hashtable_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了weechat_hashtable_set函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: weechat_lua_tohashtable

struct t_hashtable *weechat_lua_tohashtable (lua_State *interpreter, int index, int size,                         const char *type_keys, const char *type_values){    struct t_hashtable *hashtable;    hashtable = weechat_hashtable_new (size, type_keys, type_values,                                       NULL, NULL);    if (!hashtable)        return NULL;    lua_pushnil (interpreter);    while (lua_next (interpreter, index - 1) != 0)    {        if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)        {            weechat_hashtable_set (hashtable,                                   lua_tostring (interpreter, -2),                                   lua_tostring (interpreter, -1));        }        else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)        {            weechat_hashtable_set (hashtable,                                   lua_tostring (interpreter, -2),                                   plugin_script_str2ptr (                                       weechat_lua_plugin,                                       NULL, NULL,                                       lua_tostring (interpreter, -1)));        }        /* remove value from stack (keep key for next iteration) */        lua_pop (interpreter, 1);    }    return hashtable;}
开发者ID:anders,项目名称:weechat,代码行数:35,


示例2: trigger_callback_command_cb

inttrigger_callback_command_cb  (void *data, struct t_gui_buffer *buffer,                              int argc, char **argv, char **argv_eol){    char str_name[32];    int i;    TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);    TRIGGER_CALLBACK_CB_NEW_POINTERS;    TRIGGER_CALLBACK_CB_NEW_EXTRA_VARS;    /* add data in hashtables used for conditions/replace/command */    weechat_hashtable_set (pointers, "buffer", buffer);    for (i = 0; i < argc; i++)    {        snprintf (str_name, sizeof (str_name), "tg_argv%d", i);        weechat_hashtable_set (extra_vars, str_name, argv[i]);        snprintf (str_name, sizeof (str_name), "tg_argv_eol%d", i);        weechat_hashtable_set (extra_vars, str_name, argv_eol[i]);    }    /* execute the trigger (conditions, regex, command) */    trigger_callback_execute (trigger, buffer, pointers, extra_vars);end:    TRIGGER_CALLBACK_CB_END(trigger_rc);}
开发者ID:Petzku,项目名称:weechat,代码行数:28,


示例3: trigger_callback_focus_cb

struct t_hashtable *trigger_callback_focus_cb (void *data, struct t_hashtable *info){    const char *ptr_value;    long unsigned int value;    int rc;    TRIGGER_CALLBACK_CB_INIT(info);    TRIGGER_CALLBACK_CB_NEW_POINTERS;    /* add data in hashtables used for conditions/replace/command */    ptr_value = weechat_hashtable_get (info, "_window");    if (ptr_value && ptr_value[0] && (strncmp (ptr_value, "0x", 2) == 0))    {        rc = sscanf (ptr_value + 2, "%lx", &value);        if ((rc != EOF) && (rc >= 1))            weechat_hashtable_set (pointers, "window", (void *)value);    }    ptr_value = weechat_hashtable_get (info, "_buffer");    if (ptr_value && ptr_value[0] && (strncmp (ptr_value, "0x", 2) == 0))    {        rc = sscanf (ptr_value + 2, "%lx", &value);        if ((rc != EOF) && (rc >= 1))            weechat_hashtable_set (pointers, "buffer", (void *)value);    }    /* execute the trigger (conditions, regex, command) */    trigger_callback_execute (trigger, NULL, pointers, info);end:    TRIGGER_CALLBACK_CB_END(info);}
开发者ID:Petzku,项目名称:weechat,代码行数:33,


示例4: weechat_ruby_hash_foreach_cb

intweechat_ruby_hash_foreach_cb (VALUE key, VALUE value, void *arg){    struct t_hashtable *hashtable;    const char *type_values;    hashtable = (struct t_hashtable *)arg;    if ((TYPE(key) == T_STRING) && (TYPE(value) == T_STRING))    {        type_values = weechat_hashtable_get_string (hashtable, "type_values");        if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)        {            weechat_hashtable_set (hashtable, StringValuePtr(key),                                   StringValuePtr(value));        }        else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)        {            weechat_hashtable_set (hashtable, StringValuePtr(key),                                   plugin_script_str2ptr (weechat_ruby_plugin,                                                          NULL, NULL,                                                          StringValuePtr(value)));        }    }    return 0;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:25,


示例5: weechat_python_dict_to_hashtable

struct t_hashtable *weechat_python_dict_to_hashtable (PyObject *dict, int size,                                  const char *type_keys,                                  const char *type_values){    struct t_hashtable *hashtable;    PyObject *key, *value;    Py_ssize_t pos;    char *str_key, *str_value;    hashtable = weechat_hashtable_new (size,                                       type_keys,                                       type_values,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    pos = 0;    while (PyDict_Next (dict, &pos, &key, &value))    {        str_key = NULL;        str_value = NULL;        if (PyBytes_Check (key))        {            if (PyBytes_AsString (key))                str_key = strdup (PyBytes_AsString (key));        }        else            str_key = weechat_python_unicode_to_string (key);        if (PyBytes_Check (value))        {            if (PyBytes_AsString (value))                str_value = strdup (PyBytes_AsString (value));        }        else            str_value = weechat_python_unicode_to_string (value);        if (str_key)        {            if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)                weechat_hashtable_set (hashtable, str_key, str_value);            else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)            {                weechat_hashtable_set (hashtable, str_key,                                       plugin_script_str2ptr (weechat_python_plugin,                                                              NULL, NULL,                                                              str_value));            }        }        if (str_key)            free (str_key);        if (str_value)            free (str_value);    }    return hashtable;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:59,


示例6: irc_message_parse_to_hashtable

struct t_hashtable *irc_message_parse_to_hashtable (struct t_irc_server *server,                                const char *message){    char *tags,*message_without_tags, *nick, *host, *command, *channel;    char *arguments, *text, str_pos_text[32];    char empty_str[1] = { '/0' };    int pos_text;    struct t_hashtable *hashtable;    irc_message_parse (server, message, &tags, &message_without_tags, &nick,                       &host, &command, &channel, &arguments, &text,                       &pos_text);    hashtable = weechat_hashtable_new (32,                                       WEECHAT_HASHTABLE_STRING,                                       WEECHAT_HASHTABLE_STRING,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    weechat_hashtable_set (hashtable, "tags",                           (tags) ? tags : empty_str);    weechat_hashtable_set (hashtable, "message_without_tags",                           (message_without_tags) ? message_without_tags : empty_str);    weechat_hashtable_set (hashtable, "nick",                           (nick) ? nick : empty_str);    weechat_hashtable_set (hashtable, "host",                           (host) ? host : empty_str);    weechat_hashtable_set (hashtable, "command",                           (command) ? command : empty_str);    weechat_hashtable_set (hashtable, "channel",                           (channel) ? channel : empty_str);    weechat_hashtable_set (hashtable, "arguments",                           (arguments) ? arguments : empty_str);    weechat_hashtable_set (hashtable, "text",                           (text) ? text : empty_str);    snprintf (str_pos_text, sizeof (str_pos_text), "%d", pos_text);    weechat_hashtable_set (hashtable, "pos_text", str_pos_text);    if (tags)        free (tags);    if (message_without_tags)        free (message_without_tags);    if (nick)        free (nick);    if (host)        free (host);    if (command)        free (command);    if (channel)        free (channel);    if (arguments)        free (arguments);    if (text)        free (text);    return hashtable;}
开发者ID:emning,项目名称:weechat,代码行数:60,


示例7: relay_config_change_irc_backlog_tags

voidrelay_config_change_irc_backlog_tags (void *data,                                      struct t_config_option *option){    char **items;    int num_items, i;    /* make C compiler happy */    (void) data;    (void) option;    if (!relay_config_hashtable_irc_backlog_tags)    {        relay_config_hashtable_irc_backlog_tags = weechat_hashtable_new (32,                                                                         WEECHAT_HASHTABLE_STRING,                                                                         WEECHAT_HASHTABLE_STRING,                                                                         NULL,                                                                         NULL);    }    else        weechat_hashtable_remove_all (relay_config_hashtable_irc_backlog_tags);    items = weechat_string_split (weechat_config_string (relay_config_irc_backlog_tags),                                  ";", 0, 0, &num_items);    if (items)    {        for (i = 0; i < num_items; i++)        {            weechat_hashtable_set (relay_config_hashtable_irc_backlog_tags,                                   items[i],                                   NULL);        }        weechat_string_free_split (items);    }}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:35,


示例8: weechat_lua_tohashtable

struct t_hashtable *weechat_lua_tohashtable (lua_State *interpreter, int index, int hashtable_size){    struct t_hashtable *hashtable;    hashtable = weechat_hashtable_new (hashtable_size,                                       WEECHAT_HASHTABLE_STRING,                                       WEECHAT_HASHTABLE_STRING,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    lua_pushnil (interpreter);    while (lua_next (interpreter, index - 1) != 0)    {        weechat_hashtable_set (hashtable,                               lua_tostring (interpreter, -2),                               lua_tostring (interpreter, -1));        /* remove value from stack (keep key for next iteration) */        lua_pop (interpreter, 1);    }    return hashtable;}
开发者ID:jameslord,项目名称:weechat,代码行数:25,


示例9: weechat_guile_alist_to_hashtable

struct t_hashtable *weechat_guile_alist_to_hashtable (SCM alist, int hashtable_size){    struct t_hashtable *hashtable;    int length, i;    SCM pair;    hashtable = weechat_hashtable_new (hashtable_size,                                       WEECHAT_HASHTABLE_STRING,                                       WEECHAT_HASHTABLE_STRING,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    length = scm_to_int (scm_length (alist));    for (i = 0; i < length; i++)    {        pair = scm_list_ref (alist, scm_from_int (i));        weechat_hashtable_set (hashtable,                               scm_i_string_chars (scm_list_ref (pair,                                                                 scm_from_int (0))),                               scm_i_string_chars (scm_list_ref (pair,                                                                 scm_from_int (1))));    }    return hashtable;}
开发者ID:munkee,项目名称:weechat,代码行数:28,


示例10: twc_group_namelist_change_callback

voidtwc_group_namelist_change_callback(Tox *tox,                                   int group_number,                                   int peer_number,                                   uint8_t change_type,                                   void *data){    struct t_twc_profile *profile = data;    struct t_twc_chat *chat = twc_chat_search_group(profile,                                                    group_number,                                                    false);    struct t_gui_nick *nick;    char *name = twc_get_peer_name_nt(profile->tox, group_number, peer_number);    if (change_type == TOX_CHAT_CHANGE_PEER_DEL        || change_type == TOX_CHAT_CHANGE_PEER_NAME)    {        nick = weechat_hashtable_get(chat->nicks, &peer_number);        weechat_nicklist_remove_nick(chat->buffer, nick);        weechat_hashtable_remove(chat->nicks, &peer_number);    }    if (change_type == TOX_CHAT_CHANGE_PEER_ADD        || change_type == TOX_CHAT_CHANGE_PEER_NAME)    {        nick = weechat_nicklist_add_nick(chat->buffer, chat->nicklist_group,                                         name, NULL, NULL, NULL, 1);        weechat_hashtable_set(chat->nicks, &peer_number, nick);    }}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:31,


示例11: weechat_tcl_dict_to_hashtable

struct t_hashtable *weechat_tcl_dict_to_hashtable (Tcl_Interp *interp, Tcl_Obj *dict,                               int hashtable_size){    struct t_hashtable *hashtable;    Tcl_DictSearch search;    Tcl_Obj *key, *value;    int done;    hashtable = weechat_hashtable_new (hashtable_size,                                       WEECHAT_HASHTABLE_STRING,                                       WEECHAT_HASHTABLE_STRING,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    if (Tcl_DictObjFirst (interp, dict, &search, &key, &value, &done) == TCL_OK)    {        for (; !done ; Tcl_DictObjNext(&search, &key, &value, &done))        {            weechat_hashtable_set (hashtable,                                   Tcl_GetString (key),                                   Tcl_GetString (value));        }    }    Tcl_DictObjDone(&search);    return hashtable;}
开发者ID:munkee,项目名称:weechat,代码行数:30,


示例12: weechat_guile_alist_to_hashtable

struct t_hashtable *weechat_guile_alist_to_hashtable (SCM alist, int size, const char *type_keys,                                  const char *type_values){    struct t_hashtable *hashtable;    int length, i;    SCM pair;    char *str, *str2;    hashtable = weechat_hashtable_new (size,                                       type_keys,                                       type_values,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    length = scm_to_int (scm_length (alist));    for (i = 0; i < length; i++)    {        pair = scm_list_ref (alist, scm_from_int (i));        if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)        {            str = scm_to_locale_string (scm_list_ref (pair, scm_from_int (0)));            str2 = scm_to_locale_string (scm_list_ref (pair, scm_from_int (1)));            weechat_hashtable_set (hashtable, str, str2);            if (str)                free (str);            if (str2)                free (str2);        }        else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)        {            str = scm_to_locale_string (scm_list_ref (pair, scm_from_int (0)));            str2 = scm_to_locale_string (scm_list_ref (pair, scm_from_int (1)));            weechat_hashtable_set (hashtable, str,                                   plugin_script_str2ptr (weechat_guile_plugin,                                                          NULL, NULL, str2));            if (str)                free (str);            if (str2)                free (str2);        }    }    return hashtable;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:47,


示例13: trigger_callback_config_cb

inttrigger_callback_config_cb  (void *data, const char *option, const char *value){    TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);    TRIGGER_CALLBACK_CB_NEW_EXTRA_VARS;    /* add data in hashtable used for conditions/replace/command */    weechat_hashtable_set (extra_vars, "tg_option", option);    weechat_hashtable_set (extra_vars, "tg_value", value);    /* execute the trigger (conditions, regex, command) */    trigger_callback_execute (trigger, NULL, pointers, extra_vars);end:    TRIGGER_CALLBACK_CB_END(trigger_rc);}
开发者ID:Petzku,项目名称:weechat,代码行数:17,


示例14: weechat_aspell_speller_buffer_new

struct t_aspell_speller_buffer *weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer){    const char *buffer_dicts;    char **dicts;    int num_dicts, i;    struct t_aspell_speller_buffer *new_speller_buffer;    AspellSpeller *ptr_speller;    if (!buffer)        return NULL;    weechat_hashtable_remove (weechat_aspell_speller_buffer, buffer);    new_speller_buffer = malloc (sizeof (*new_speller_buffer));    if (!new_speller_buffer)        return NULL;    new_speller_buffer->spellers = NULL;    new_speller_buffer->modifier_string = NULL;    new_speller_buffer->input_pos = -1;    new_speller_buffer->modifier_result = NULL;    buffer_dicts = weechat_aspell_get_dict (buffer);    if (buffer_dicts)    {        dicts = weechat_string_split (buffer_dicts, ",", 0, 0, &num_dicts);        if (dicts && (num_dicts > 0))        {            new_speller_buffer->spellers =                malloc ((num_dicts + 1) * sizeof (AspellSpeller *));            if (new_speller_buffer->spellers)            {                for (i = 0; i < num_dicts; i++)                {                    ptr_speller = weechat_hashtable_get (weechat_aspell_spellers,                                                         dicts[i]);                    if (!ptr_speller)                        ptr_speller = weechat_aspell_speller_new (dicts[i]);                    new_speller_buffer->spellers[i] = ptr_speller;                }                new_speller_buffer->spellers[num_dicts] = NULL;            }        }        if (dicts)            weechat_string_free_split (dicts);    }    weechat_hashtable_set (weechat_aspell_speller_buffer,                           buffer,                           new_speller_buffer);    weechat_bar_item_update ("aspell_dict");    return new_speller_buffer;}
开发者ID:camilleacey,项目名称:weechat-1,代码行数:56,


示例15: weechat_aspell_speller_new

AspellSpeller *weechat_aspell_speller_new (const char *lang){    AspellConfig *config;    AspellCanHaveError *ret;    AspellSpeller *new_speller;    struct t_infolist *infolist;    if (!lang)        return NULL;    if (weechat_aspell_plugin->debug)    {        weechat_printf (NULL,                        "%s: creating new speller for lang /"%s/"",                        ASPELL_PLUGIN_NAME, lang);    }    /* create a speller instance for the newly created cell */    config = new_aspell_config();    aspell_config_replace (config, "lang", lang);    /* apply all options on speller */    infolist = weechat_infolist_get ("option", NULL, "aspell.option.*");    if (infolist)    {        while (weechat_infolist_next (infolist))        {            aspell_config_replace (config,                                   weechat_infolist_string (infolist, "option_name"),                                   weechat_infolist_string (infolist, "value"));        }        weechat_infolist_free (infolist);    }    ret = new_aspell_speller (config);    if (aspell_error (ret) != 0)    {        weechat_printf (NULL,                        "%s%s: error: %s",                        weechat_prefix ("error"), ASPELL_PLUGIN_NAME,                        aspell_error_message (ret));        delete_aspell_config (config);        delete_aspell_can_have_error (ret);        return NULL;    }    new_speller = to_aspell_speller (ret);    weechat_hashtable_set (weechat_aspell_spellers, lang, new_speller);    /* free configuration */    delete_aspell_config (config);    return new_speller;}
开发者ID:camilleacey,项目名称:weechat-1,代码行数:56,


示例16: cksum_xfers_add

static voidcksum_xfers_add(cksum_xfer_t *xfer){    if (xfer) {        struct t_hashtable *xfers = cksum_global_data->xfers;        char *key = strdup (xfer->local_filename);        if (key)            weechat_hashtable_set(xfers, key, xfer);    }}
开发者ID:talisein,项目名称:weechat-cksum,代码行数:10,


示例17: trigger_callback_command_run_cb

inttrigger_callback_command_run_cb  (void *data, struct t_gui_buffer *buffer,                                  const char *command){    TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);    TRIGGER_CALLBACK_CB_NEW_POINTERS;    TRIGGER_CALLBACK_CB_NEW_EXTRA_VARS;    /* add data in hashtables used for conditions/replace/command */    weechat_hashtable_set (pointers, "buffer", buffer);    weechat_hashtable_set (extra_vars, "tg_command", command);    /* execute the trigger (conditions, regex, command) */    trigger_callback_execute (trigger, buffer, pointers, extra_vars);end:    TRIGGER_CALLBACK_CB_END(trigger_rc);}
开发者ID:Petzku,项目名称:weechat,代码行数:19,


示例18: irc_message_split_add

voidirc_message_split_add (struct t_hashtable *hashtable, int number,                       const char *tags, const char *message,                       const char *arguments){    char key[32], value[32], *buf;    int length;    if (message)    {        length = ((tags) ? strlen (tags) : 0) + strlen (message) + 1;        buf = malloc (length);        if (buf)        {            snprintf (key, sizeof (key), "msg%d", number);            snprintf (buf, length, "%s%s",                      (tags) ? tags : "",                      message);            weechat_hashtable_set (hashtable, key, buf);            if (weechat_irc_plugin->debug >= 2)            {                weechat_printf (NULL,                                "irc_message_split_add >> %s='%s' (%d bytes)",                                key, buf, length - 1);            }            free (buf);        }    }    if (arguments)    {        snprintf (key, sizeof (key), "args%d", number);        weechat_hashtable_set (hashtable, key, arguments);        if (weechat_irc_plugin->debug >= 2)        {            weechat_printf (NULL,                            "irc_message_split_add >> %s='%s'",                            key, arguments);        }    }    snprintf (value, sizeof (value), "%d", number);    weechat_hashtable_set (hashtable, "count", value);}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:42,


示例19: weechat_tcl_dict_to_hashtable

struct t_hashtable *weechat_tcl_dict_to_hashtable (Tcl_Interp *interp, Tcl_Obj *dict,                               int size, const char *type_keys,                               const char *type_values){    struct t_hashtable *hashtable;    Tcl_DictSearch search;    Tcl_Obj *key, *value;    int done;    hashtable = weechat_hashtable_new (size,                                       type_keys,                                       type_values,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    if (Tcl_DictObjFirst (interp, dict, &search, &key, &value, &done) == TCL_OK)    {        for (; !done ; Tcl_DictObjNext(&search, &key, &value, &done))        {            if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)            {                weechat_hashtable_set (hashtable,                                       Tcl_GetString (key),                                       Tcl_GetString (value));            }            else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)            {                weechat_hashtable_set (hashtable,                                       Tcl_GetString (key),                                       plugin_script_str2ptr (weechat_tcl_plugin,                                                              NULL, NULL,                                                              Tcl_GetString (value)));            }        }    }    Tcl_DictObjDone(&search);    return hashtable;}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:42,


示例20: trigger_callback_timer_cb

inttrigger_callback_timer_cb  (void *data, int remaining_calls){    char str_temp[128];    int i;    time_t date;    struct tm *date_tmp;    TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);    /*     * remove the hook if this is the last call to timer     * (because WeeChat will remove the hook after this call, so the pointer     * will become invalid)     */    if ((remaining_calls == 0) && trigger->hooks)    {        for (i = 0; i < trigger->hooks_count; i++)        {            trigger->hooks[i] = NULL;        }    }    TRIGGER_CALLBACK_CB_NEW_EXTRA_VARS;    /* add data in hashtable used for conditions/replace/command */    snprintf (str_temp, sizeof (str_temp), "%d", remaining_calls);    weechat_hashtable_set (extra_vars, "tg_remaining_calls", str_temp);    date = time (NULL);    date_tmp = localtime (&date);    if (date_tmp)    {        strftime (str_temp, sizeof (str_temp), "%Y-%m-%d %H:%M:%S", date_tmp);        weechat_hashtable_set (extra_vars, "tg_date", str_temp);    }    /* execute the trigger (conditions, regex, command) */    trigger_callback_execute (trigger, NULL, pointers, extra_vars);end:    TRIGGER_CALLBACK_CB_END(trigger_rc);}
开发者ID:Petzku,项目名称:weechat,代码行数:42,


示例21: weechat_plugin_init

intweechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]){    weechat_tcl_plugin = plugin;    /* set interpreter name and version */    weechat_hashtable_set (plugin->variables, "interpreter_name",                           plugin->name);#ifdef TCL_VERSION    weechat_hashtable_set (plugin->variables, "interpreter_version",                           TCL_VERSION);#else    weechat_hashtable_set (plugin->variables, "interpreter_version",                           "");#endif /* TCL_VERSION */    tcl_data.config_file = &tcl_config_file;    tcl_data.config_look_check_license = &tcl_config_look_check_license;    tcl_data.config_look_eval_keep_context = &tcl_config_look_eval_keep_context;    tcl_data.scripts = &tcl_scripts;    tcl_data.last_script = &last_tcl_script;    tcl_data.callback_command = &weechat_tcl_command_cb;    tcl_data.callback_completion = &weechat_tcl_completion_cb;    tcl_data.callback_hdata = &weechat_tcl_hdata_cb;    tcl_data.callback_info_eval = &weechat_tcl_info_eval_cb;    tcl_data.callback_infolist = &weechat_tcl_infolist_cb;    tcl_data.callback_signal_debug_dump = &weechat_tcl_signal_debug_dump_cb;    tcl_data.callback_signal_script_action = &weechat_tcl_signal_script_action_cb;    tcl_data.callback_load_file = &weechat_tcl_load_cb;    tcl_data.unload_all = &weechat_tcl_unload_all;    tcl_quiet = 1;    plugin_script_init (weechat_tcl_plugin, argc, argv, &tcl_data);    tcl_quiet = 0;    plugin_script_display_short_list (weechat_tcl_plugin,                                      tcl_scripts);    /* init OK */    return WEECHAT_RC_OK;}
开发者ID:mumixam,项目名称:weechat,代码行数:41,


示例22: relay_weechat_alloc_with_infolist

voidrelay_weechat_alloc_with_infolist (struct t_relay_client *client,                                   struct t_infolist *infolist){    struct t_relay_weechat_data *weechat_data;    int index, value;    char name[64];    const char *key;    client->protocol_data = malloc (sizeof (*weechat_data));    if (client->protocol_data)    {        /* general stuff */        RELAY_WEECHAT_DATA(client, password_ok) = weechat_infolist_integer (infolist, "password_ok");        RELAY_WEECHAT_DATA(client, compression) = weechat_infolist_integer (infolist, "compression");        /* sync of buffers */        RELAY_WEECHAT_DATA(client, buffers_sync) = weechat_hashtable_new (32,                                                                          WEECHAT_HASHTABLE_STRING,                                                                          WEECHAT_HASHTABLE_INTEGER,                                                                          NULL,                                                                          NULL);        index = 0;        while (1)        {            snprintf (name, sizeof (name), "buffers_sync_name_%05d", index);            key = weechat_infolist_string (infolist, name);            if (!key)                break;            snprintf (name, sizeof (name), "buffers_sync_value_%05d", index);            value = weechat_infolist_integer (infolist, name);            weechat_hashtable_set (RELAY_WEECHAT_DATA(client, buffers_sync),                                   key,                                   &value);            index++;        }        RELAY_WEECHAT_DATA(client, hook_signal_buffer) = NULL;        RELAY_WEECHAT_DATA(client, hook_hsignal_nicklist) = NULL;        RELAY_WEECHAT_DATA(client, hook_signal_upgrade) = NULL;        RELAY_WEECHAT_DATA(client, buffers_nicklist) =            weechat_hashtable_new (32,                                   WEECHAT_HASHTABLE_POINTER,                                   WEECHAT_HASHTABLE_POINTER,                                   NULL,                                   NULL);        weechat_hashtable_set_pointer (RELAY_WEECHAT_DATA(client, buffers_nicklist),                                       "callback_free_value",                                       &relay_weechat_free_buffers_nicklist);        RELAY_WEECHAT_DATA(client, hook_timer_nicklist) = NULL;        relay_weechat_hook_signals (client);    }}
开发者ID:Ratler,项目名称:weechat,代码行数:53,


示例23: weechat_perl_hash_to_hashtable

struct t_hashtable *weechat_perl_hash_to_hashtable (SV *hash, int size, const char *type_keys,                                const char *type_values){    struct t_hashtable *hashtable;    HV *hash2;    SV *value;    char *str_key;    I32 retlen;    hashtable = weechat_hashtable_new (size, type_keys, type_values,                                       NULL, NULL);    if (!hashtable)        return NULL;    if ((hash) && SvROK(hash) && SvRV(hash)        && (SvTYPE(SvRV(hash)) == SVt_PVHV))    {        hash2 = (HV *)SvRV(hash);        hv_iterinit (hash2);        while ((value = hv_iternextsv (hash2, &str_key, &retlen)))        {            if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)            {                weechat_hashtable_set (hashtable, str_key,                                       SvPV (value, PL_na));            }            else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)            {                weechat_hashtable_set (hashtable, str_key,                                       plugin_script_str2ptr (                                           weechat_perl_plugin,                                           NULL, NULL,                                           SvPV (value, PL_na)));            }        }    }    return hashtable;}
开发者ID:aadiarbakerli,项目名称:weechat,代码行数:40,


示例24: irc_redirect_stop

voidirc_redirect_stop (struct t_irc_redirect *redirect, const char *error){    struct t_hashtable *hashtable;    char signal_name[1024], str_int[64];    redirect->current_count++;    if (error || (redirect->current_count > redirect->count))    {        /*         * error or max count reached, then we run callback and remove         * redirect         */        hashtable = weechat_hashtable_new (32,                                           WEECHAT_HASHTABLE_STRING,                                           WEECHAT_HASHTABLE_STRING,                                           NULL,                                           NULL);        if (hashtable)        {            /* set error and output (main fields) */            weechat_hashtable_set (hashtable, "error",                                   (error) ? (char *)error : "");            weechat_hashtable_set (hashtable, "output",                                   (redirect->output) ? redirect->output : "");            snprintf (str_int, sizeof (str_int), "%d", redirect->output_size);            weechat_hashtable_set (hashtable, "output_size", str_int);            /* set some other fields with values from redirect */            weechat_hashtable_set (hashtable, "server", redirect->server->name);            weechat_hashtable_set (hashtable, "pattern", redirect->pattern);            weechat_hashtable_set (hashtable, "signal", redirect->signal);            weechat_hashtable_set (hashtable, "command", redirect->command);        }        snprintf (signal_name, sizeof (signal_name), "irc_redirection_%s_%s",                  redirect->signal, redirect->pattern);        (void) weechat_hook_hsignal_send (signal_name, hashtable);        if (hashtable)            weechat_hashtable_free (hashtable);        irc_redirect_free (redirect);    }    else    {        /*         * max count not yet reached, then we prepare redirect to continue         * redirection         */        redirect->cmd_start_received = 0;        redirect->cmd_stop_received = 0;    }}
开发者ID:angrylogic,项目名称:weechat,代码行数:55,


示例25: weechat_js_object_to_hashtable

struct t_hashtable *weechat_js_object_to_hashtable (v8::Handle<v8::Object> obj,                                int size,                                const char *type_keys,                                const char *type_values){    struct t_hashtable *hashtable;    unsigned int i;    v8::Handle<v8::Array> keys;    v8::Handle<v8::Value> key, value;    hashtable = weechat_hashtable_new (size, type_keys, type_values,                                       NULL, NULL);    if (!hashtable)        return NULL;    keys = obj->GetPropertyNames();    for (i = 0; i < keys->Length(); i++)    {        key = keys->Get(i);        value = obj->Get(key);        v8::String::Utf8Value str_key(key);        v8::String::Utf8Value str_value(value);        if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)        {            weechat_hashtable_set (hashtable, *str_key, *str_value);        }        else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)        {            weechat_hashtable_set (hashtable, *str_key,                                   plugin_script_str2ptr (weechat_js_plugin,                                                          NULL, NULL,                                                          *str_value));        }    }    return hashtable;}
开发者ID:mumixam,项目名称:weechat,代码行数:39,


示例26: weechat_ruby_hash_foreach_cb

intweechat_ruby_hash_foreach_cb (VALUE key, VALUE value, void *arg){    struct t_hashtable *hashtable;    hashtable = (struct t_hashtable *)arg;    if ((TYPE(key) == T_STRING) && (TYPE(value) == T_STRING))    {        weechat_hashtable_set (hashtable, StringValuePtr(key),                               StringValuePtr(value));    }    return 0;}
开发者ID:munkee,项目名称:weechat,代码行数:13,


示例27: weechat_plugin_init

EXPORT intweechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]){    char str_interpreter[64];    weechat_js_plugin = plugin;    /* set interpreter name and version */    snprintf (str_interpreter, sizeof (str_interpreter),              "%s (v8)", plugin->name);    weechat_hashtable_set (plugin->variables, "interpreter_name",                           str_interpreter);    weechat_hashtable_set (plugin->variables, "interpreter_version",                           v8::V8::GetVersion());    js_data.config_file = &js_config_file;    js_data.config_look_check_license = &js_config_look_check_license;    js_data.config_look_eval_keep_context = &js_config_look_eval_keep_context;    js_data.scripts = &js_scripts;    js_data.last_script = &last_js_script;    js_data.callback_command = &weechat_js_command_cb;    js_data.callback_completion = &weechat_js_completion_cb;    js_data.callback_hdata = &weechat_js_hdata_cb;    js_data.callback_info_eval = &weechat_js_info_eval_cb;    js_data.callback_infolist = &weechat_js_infolist_cb;    js_data.callback_signal_debug_dump = &weechat_js_signal_debug_dump_cb;    js_data.callback_signal_script_action = &weechat_js_signal_script_action_cb;    js_data.callback_load_file = &weechat_js_load_cb;    js_data.unload_all = &weechat_js_unload_all;    js_quiet = 1;    plugin_script_init (plugin, argc, argv, &js_data);    js_quiet = 0;    plugin_script_display_short_list (weechat_js_plugin, js_scripts);    return WEECHAT_RC_OK;}
开发者ID:mumixam,项目名称:weechat,代码行数:38,


示例28: trigger_callback_init

voidtrigger_callback_init (){    trigger_callback_hashtable_options = weechat_hashtable_new (32,                                                                WEECHAT_HASHTABLE_STRING,                                                                WEECHAT_HASHTABLE_STRING,                                                                NULL,                                                                NULL);    if (trigger_callback_hashtable_options)    {        weechat_hashtable_set (trigger_callback_hashtable_options,                               "type", "condition");    }}
开发者ID:AlexTalker,项目名称:weechat,代码行数:14,


示例29: trigger_callback_set_tags

inttrigger_callback_set_tags (struct t_gui_buffer *buffer,                           const char **tags, int tags_count,                           struct t_hashtable *extra_vars){    const char *localvar_type;    char str_temp[128];    int i;    snprintf (str_temp, sizeof (str_temp), "%d", tags_count);    weechat_hashtable_set (extra_vars, "tg_tags_count", str_temp);    localvar_type = (buffer) ?        weechat_buffer_get_string (buffer, "localvar_type") : NULL;    for (i = 0; i < tags_count; i++)    {        if (strcmp (tags[i], "no_trigger") == 0)        {            return 0;        }        else if (strncmp (tags[i], "notify_", 7) == 0)        {            weechat_hashtable_set (extra_vars, "tg_tag_notify", tags[i] + 7);            if (strcmp (tags[i] + 7, "none") != 0)            {                weechat_hashtable_set (extra_vars, "tg_notify", tags[i] + 7);                if (strcmp (tags[i] + 7, "private") == 0)                {                    snprintf (str_temp, sizeof (str_temp), "%d",                              (localvar_type                               && (strcmp (localvar_type, "private") == 0)) ? 1 : 0);                    weechat_hashtable_set (extra_vars, "tg_msg_pv", str_temp);                }            }        }        else if (strncmp (tags[i], "nick_", 5) == 0)        {            weechat_hashtable_set (extra_vars, "tg_tag_nick", tags[i] + 5);        }        else if (strncmp (tags[i], "prefix_nick_", 12) == 0)        {            weechat_hashtable_set (extra_vars, "tg_tag_prefix_nick",                                   tags[i] + 12);        }        else if (strncmp (tags[i], "host_", 5) == 0)        {            weechat_hashtable_set (extra_vars, "tg_tag_host", tags[i] + 5);        }    }    return 1;}
开发者ID:Petzku,项目名称:weechat,代码行数:52,


示例30: twc_message_queue_get_or_create

/** * Get a message queue for a friend, or create one if it does not exist. */struct t_twc_list *twc_message_queue_get_or_create(struct t_twc_profile *profile,                                int32_t friend_number){    struct t_twc_list *message_queue = weechat_hashtable_get(profile->message_queues, &friend_number);    if (!message_queue)    {        message_queue = twc_list_new();        weechat_hashtable_set(profile->message_queues,                              &friend_number,                              message_queue);    }    return message_queue;}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:18,



注:本文中的weechat_hashtable_set函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ weechat_printf函数代码示例
C++ weechat_gettext函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。