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

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

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

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

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

示例1: irc_info_get_info_hashtable_cb

struct t_hashtable *irc_info_get_info_hashtable_cb (void *data, const char *info_name,                                struct t_hashtable *hashtable){    const char *server, *message;    struct t_irc_server *ptr_server;    struct t_hashtable *value;    /* make C compiler happy */    (void) data;    if (!hashtable)        return NULL;    if (weechat_strcasecmp (info_name, "irc_message_parse") == 0)    {        server = weechat_hashtable_get (hashtable, "server");        ptr_server = (server) ? irc_server_search (server) : NULL;        message = weechat_hashtable_get (hashtable, "message");        if (message)        {            value = irc_message_parse_to_hashtable (ptr_server, message);            return value;        }    }    else if (weechat_strcasecmp (info_name, "irc_message_split") == 0)    {        server = weechat_hashtable_get (hashtable, "server");        ptr_server = (server) ? irc_server_search (server) : NULL;        message = weechat_hashtable_get (hashtable, "message");        if (message)        {            value = irc_message_split (ptr_server, message);            return value;        }    }    return NULL;}
开发者ID:jameslord,项目名称:weechat,代码行数:39,


示例2: xfer_info_get_infolist_cb

struct t_infolist *xfer_info_get_infolist_cb (void *data, const char *infolist_name,                           void *pointer, const char *arguments){    struct t_infolist *ptr_infolist;    struct t_xfer *ptr_xfer;    /* make C compiler happy */    (void) data;    (void) arguments;    if (!infolist_name || !infolist_name[0])        return NULL;    if (weechat_strcasecmp (infolist_name, "xfer") == 0)    {        if (pointer && !xfer_valid (pointer))            return NULL;        ptr_infolist = weechat_infolist_new ();        if (ptr_infolist)        {            if (pointer)            {                /* build list with only one xfer */                if (!xfer_add_to_infolist (ptr_infolist, pointer))                {                    weechat_infolist_free (ptr_infolist);                    return NULL;                }                return ptr_infolist;            }            else            {                /* build list with all xfers */                for (ptr_xfer = xfer_list; ptr_xfer;                        ptr_xfer = ptr_xfer->next_xfer)                {                    if (!xfer_add_to_infolist (ptr_infolist, ptr_xfer))                    {                        weechat_infolist_free (ptr_infolist);                        return NULL;                    }                }                return ptr_infolist;            }        }    }    return NULL;}
开发者ID:haasn,项目名称:weechat,代码行数:51,


示例3: relay_info_get_infolist_cb

struct t_infolist *relay_info_get_infolist_cb (void *data, const char *infolist_name,                            void *pointer, const char *arguments){    struct t_infolist *ptr_infolist;    struct t_relay_client *ptr_client;    /* make C compiler happy */    (void) data;    (void) arguments;    if (!infolist_name || !infolist_name[0])        return NULL;    if (weechat_strcasecmp (infolist_name, "relay") == 0)    {        if (pointer && !relay_client_valid (pointer))            return NULL;        ptr_infolist = weechat_infolist_new ();        if (ptr_infolist)        {            if (pointer)            {                /* build list with only one relay */                if (!relay_client_add_to_infolist (ptr_infolist, pointer))                {                    weechat_infolist_free (ptr_infolist);                    return NULL;                }                return ptr_infolist;            }            else            {                /* build list with all relays */                for (ptr_client = relay_clients; ptr_client;                     ptr_client = ptr_client->next_client)                {                    if (!relay_client_add_to_infolist (ptr_infolist, ptr_client))                    {                        weechat_infolist_free (ptr_infolist);                        return NULL;                    }                }                return ptr_infolist;            }        }    }    return NULL;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:51,


示例4: logger_command_cb

intlogger_command_cb (void *data, struct t_gui_buffer *buffer,                   int argc, char **argv, char **argv_eol){    /* make C compiler happy */    (void) data;    (void) argv_eol;    if ((argc == 1)        || ((argc == 2) && (weechat_strcasecmp (argv[1], "list") == 0)))    {        logger_list ();        return WEECHAT_RC_OK;    }    if (argc > 1)    {        if (weechat_strcasecmp (argv[1], "set") == 0)        {            if (argc > 2)                logger_set_buffer (buffer, argv[2]);            return WEECHAT_RC_OK;        }        if (weechat_strcasecmp (argv[1], "flush") == 0)        {            logger_flush ();            return WEECHAT_RC_OK;        }        if (weechat_strcasecmp (argv[1], "disable") == 0)        {            logger_set_buffer (buffer, "0");        }    }    return WEECHAT_RC_OK;}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:38,


示例5: irc_ctcp_get_default_reply

const char *irc_ctcp_get_default_reply (const char *ctcp){    int i;    for (i = 0; irc_ctcp_default_reply[i].name; i++)    {        if (weechat_strcasecmp (irc_ctcp_default_reply[i].name, ctcp) == 0)            return irc_ctcp_default_reply[i].reply;    }    /* unknown CTCP */    return NULL;}
开发者ID:munkee,项目名称:weechat,代码行数:14,


示例6: alias_find_pos

struct t_alias *alias_find_pos (const char *name){    struct t_alias *ptr_alias;    for (ptr_alias = alias_list; ptr_alias; ptr_alias = ptr_alias->next_alias)    {        if (weechat_strcasecmp (name, ptr_alias->name) < 0)            return ptr_alias;    }    /* position not found (we will add to the end of list) */    return NULL;}
开发者ID:jlec,项目名称:weechat,代码行数:14,


示例7: trigger_search_post_action

inttrigger_search_post_action (const char *post_action){    int i;    for (i = 0; i < TRIGGER_NUM_POST_ACTIONS; i++)    {        if (weechat_strcasecmp (trigger_post_action_string[i], post_action) == 0)            return i;    }    /* post action not found */    return -1;}
开发者ID:Evalle,项目名称:weechat,代码行数:14,


示例8: trigger_search_return_code

inttrigger_search_return_code (const char *return_code){    int i;    for (i = 0; i < TRIGGER_NUM_RETURN_CODES; i++)    {        if (weechat_strcasecmp (trigger_return_code_string[i], return_code) == 0)            return i;    }    /* return code not found */    return -1;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:14,


示例9: relay_weechat_compression_search

intrelay_weechat_compression_search (const char *compression){    int i;    for (i = 0; i < RELAY_WEECHAT_NUM_COMPRESSIONS; i++)    {        if (weechat_strcasecmp (relay_weechat_compression_string[i], compression) == 0)            return i;    }    /* compression not found */    return -1;}
开发者ID:munkee,项目名称:weechat,代码行数:14,


示例10: trigger_search_hook_type

inttrigger_search_hook_type (const char *type){    int i;    for (i = 0; i < TRIGGER_NUM_HOOK_TYPES; i++)    {        if (weechat_strcasecmp (trigger_hook_type_string[i], type) == 0)            return i;    }    /* hook type not found */    return -1;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:14,


示例11: trigger_find_pos

struct t_trigger *trigger_find_pos (struct t_trigger *trigger, struct t_trigger *list_triggers){    struct t_trigger *ptr_trigger;    for (ptr_trigger = list_triggers; ptr_trigger;         ptr_trigger = ptr_trigger->next_trigger)    {        if (weechat_strcasecmp (trigger->name, ptr_trigger->name) < 0)            return ptr_trigger;    }    /* position not found */    return NULL;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:15,


示例12: exec_search_color

intexec_search_color (const char *color){    int i;    if (!color)        return -1;    for (i = 0; i < EXEC_NUM_COLORS; i++)    {        if (weechat_strcasecmp (exec_color_string[i], color) == 0)            return i;    }    /* color not found */    return -1;}
开发者ID:weechat,项目名称:weechat,代码行数:17,


示例13: weechat_plugin_init

intweechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]){    int i, upgrading;    /* make C compiler happy */    (void) argc;    (void) argv;    weechat_plugin = plugin;    if (!relay_config_init ())        return WEECHAT_RC_ERROR;    relay_config_read ();    relay_network_init ();    relay_command_init ();    /* hook completions */    relay_completion_init ();    weechat_hook_signal ("upgrade", &relay_signal_upgrade_cb, NULL, NULL);    weechat_hook_signal ("debug_dump", &relay_debug_dump_cb, NULL, NULL);    relay_info_init ();    /* look at arguments */    upgrading = 0;    for (i = 0; i < argc; i++)    {        if (weechat_strcasecmp (argv[i], "--upgrade") == 0)        {            upgrading = 1;        }    }    if (upgrading)        relay_upgrade_load ();    relay_hook_timer = weechat_hook_timer (1 * 1000, 0, 0,                                           &relay_client_timer_cb, NULL, NULL);    return WEECHAT_RC_OK;}
开发者ID:Evalle,项目名称:weechat,代码行数:46,


示例14: trigger_search_option

inttrigger_search_option (const char *option_name){    int i;    if (!option_name)        return -1;    for (i = 0; i < TRIGGER_NUM_OPTIONS; i++)    {        if (weechat_strcasecmp (trigger_option_string[i], option_name) == 0)            return i;    }    /* trigger option not found */    return -1;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:17,


示例15: weechat_lua_signal_debug_dump_cb

intweechat_lua_signal_debug_dump_cb (void *data, const char *signal,                                  const char *type_data, void *signal_data){    /* make C compiler happy */    (void) data;    (void) signal;    (void) type_data;    if (!signal_data        || (weechat_strcasecmp ((char *)signal_data, LUA_PLUGIN_NAME) == 0))    {        plugin_script_print_log (weechat_lua_plugin, lua_scripts);    }    return WEECHAT_RC_OK;}
开发者ID:jameslord,项目名称:weechat,代码行数:17,


示例16: trigger_search

struct t_trigger *trigger_search (const char *name){    struct t_trigger *ptr_trigger;    if (!name || !name[0])        return NULL;    for (ptr_trigger = triggers; ptr_trigger;         ptr_trigger = ptr_trigger->next_trigger)    {        if (weechat_strcasecmp (ptr_trigger->name, name) == 0)            return ptr_trigger;    }    /* trigger not found */    return NULL;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:18,


示例17: weechat_lua_infolist_cb

struct t_infolist *weechat_lua_infolist_cb (void *data, const char *infolist_name,                         void *pointer, const char *arguments){    /* make C compiler happy */    (void) data;    if (!infolist_name || !infolist_name[0])        return NULL;    if (weechat_strcasecmp (infolist_name, "lua_script") == 0)    {        return plugin_script_infolist_list_scripts (weechat_lua_plugin,                                                    lua_scripts, pointer,                                                    arguments);    }    return NULL;}
开发者ID:jameslord,项目名称:weechat,代码行数:19,


示例18: weechat_js_infolist_cb

struct t_infolist *weechat_js_infolist_cb (const void *pointer, void *data,                        const char *infolist_name,                        void *obj_pointer, const char *arguments){    /* make C++ compiler happy */    (void) pointer;    (void) data;    if (!infolist_name || !infolist_name[0])        return NULL;    if (weechat_strcasecmp (infolist_name, "javascript_script") == 0)    {        return plugin_script_infolist_list_scripts (weechat_js_plugin,                                                    js_scripts, obj_pointer,                                                    arguments);    }    return NULL;}
开发者ID:mumixam,项目名称:weechat,代码行数:21,


示例19: weechat_plugin_init

intweechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]){    int i, upgrading;    weechat_plugin = plugin;    trigger_callback_init ();    trigger_command_init ();    if (!trigger_config_init ())        return WEECHAT_RC_ERROR;    trigger_config_read ();    /* hook some signals */    weechat_hook_signal ("debug_dump", &trigger_debug_dump_cb, NULL);    /* hook completions */    trigger_completion_init ();    /* look at arguments */    upgrading = 0;    for (i = 0; i < argc; i++)    {        if (weechat_strcasecmp (argv[i], "--upgrade") == 0)        {            upgrading = 1;        }    }    if (upgrading)        trigger_buffer_set_callbacks ();    return WEECHAT_RC_OK;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:37,


示例20: weechat_aspell_command_authorized

intweechat_aspell_command_authorized (const char *command){    int length_command, i;    if (!command)        return 1;    length_command = strlen (command);    for (i = 0; i < weechat_aspell_count_commands_to_check; i++)    {        if ((weechat_aspell_length_commands_to_check[i] == length_command)            && (weechat_strcasecmp (command,                                    weechat_aspell_commands_to_check[i]) == 0))        {            /* command is authorized */            return 1;        }    }    /* command is not authorized */    return 0;}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:24,


示例21: weechat_python_command_cb

intweechat_python_command_cb (void *data, struct t_gui_buffer *buffer,                           int argc, char **argv, char **argv_eol){    char *ptr_name, *path_script;    /* make C compiler happy */    (void) data;    (void) buffer;    if (argc == 1)    {        plugin_script_display_list (weechat_python_plugin, python_scripts,                                    NULL, 0);    }    else if (argc == 2)    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_python_plugin, python_scripts,                                        NULL, 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_python_plugin, python_scripts,                                        NULL, 1);        }        else if (weechat_strcasecmp (argv[1], "autoload") == 0)        {            plugin_script_auto_load (weechat_python_plugin, &weechat_python_load_cb);        }        else if (weechat_strcasecmp (argv[1], "reload") == 0)        {            weechat_python_unload_all ();            plugin_script_auto_load (weechat_python_plugin, &weechat_python_load_cb);        }        else if (weechat_strcasecmp (argv[1], "unload") == 0)        {            weechat_python_unload_all ();        }        else            WEECHAT_COMMAND_ERROR;    }    else    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_python_plugin, python_scripts,                                        argv_eol[2], 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_python_plugin, python_scripts,                                        argv_eol[2], 1);        }        else if ((weechat_strcasecmp (argv[1], "load") == 0)                 || (weechat_strcasecmp (argv[1], "reload") == 0)                 || (weechat_strcasecmp (argv[1], "unload") == 0))        {            ptr_name = argv_eol[2];            if (strncmp (ptr_name, "-q ", 3) == 0)            {                python_quiet = 1;                ptr_name += 3;                while (ptr_name[0] == ' ')                {                    ptr_name++;                }            }            if (weechat_strcasecmp (argv[1], "load") == 0)            {                /* load python script */                path_script = plugin_script_search_path (weechat_python_plugin,                                                         ptr_name);                weechat_python_load ((path_script) ? path_script : ptr_name);                if (path_script)                    free (path_script);            }            else if (weechat_strcasecmp (argv[1], "reload") == 0)            {                /* reload one python script */                weechat_python_reload_name (ptr_name);            }            else if (weechat_strcasecmp (argv[1], "unload") == 0)            {                /* unload python script */                weechat_python_unload_name (ptr_name);            }            python_quiet = 0;        }        else            WEECHAT_COMMAND_ERROR;    }    return WEECHAT_RC_OK;}
开发者ID:anders,项目名称:weechat,代码行数:96,


示例22: weechat_lua_command_cb

intweechat_lua_command_cb (void *data, struct t_gui_buffer *buffer,                        int argc, char **argv, char **argv_eol){    char *ptr_name, *path_script;    /* make C compiler happy */    (void) data;    (void) buffer;    if (argc == 1)    {        plugin_script_display_list (weechat_lua_plugin, lua_scripts,                                    NULL, 0);    }    else if (argc == 2)    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_lua_plugin, lua_scripts,                                        NULL, 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_lua_plugin, lua_scripts,                                        NULL, 1);        }        else if (weechat_strcasecmp (argv[1], "autoload") == 0)        {            plugin_script_auto_load (weechat_lua_plugin, &weechat_lua_load_cb);        }        else if (weechat_strcasecmp (argv[1], "reload") == 0)        {            weechat_lua_unload_all ();            plugin_script_auto_load (weechat_lua_plugin, &weechat_lua_load_cb);        }        else if (weechat_strcasecmp (argv[1], "unload") == 0)        {            weechat_lua_unload_all ();        }    }    else    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_lua_plugin, lua_scripts,                                        argv_eol[2], 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_lua_plugin, lua_scripts,                                        argv_eol[2], 1);        }        else if ((weechat_strcasecmp (argv[1], "load") == 0)                 || (weechat_strcasecmp (argv[1], "reload") == 0)                 || (weechat_strcasecmp (argv[1], "unload") == 0))        {            ptr_name = argv_eol[2];            if (strncmp (ptr_name, "-q ", 3) == 0)            {                lua_quiet = 1;                ptr_name += 3;                while (ptr_name[0] == ' ')                {                    ptr_name++;                }            }            if (weechat_strcasecmp (argv[1], "load") == 0)            {                /* load Lua script */                path_script = plugin_script_search_path (weechat_lua_plugin,                                                         ptr_name);                weechat_lua_load ((path_script) ? path_script : ptr_name);                if (path_script)                    free (path_script);            }            else if (weechat_strcasecmp (argv[1], "reload") == 0)            {                /* reload one Lua script */                weechat_lua_reload_name (ptr_name);            }            else if (weechat_strcasecmp (argv[1], "unload") == 0)            {                /* unload Lua script */                weechat_lua_unload_name (ptr_name);            }            lua_quiet = 0;        }        else        {            weechat_printf (NULL,                            weechat_gettext ("%s%s: unknown option for "                                             "command /"%s/""),                            weechat_prefix ("error"), LUA_PLUGIN_NAME, "lua");        }    }    return WEECHAT_RC_OK;}
开发者ID:jameslord,项目名称:weechat,代码行数:99,


示例23: exec_command_parse_options

intexec_command_parse_options (struct t_exec_cmd_options *cmd_options,                            int argc, char **argv, int start_arg,                            int set_command_index){    int i, j, end, length, length_total;    char *error;    for (i = start_arg; i < argc; i++)    {        if (weechat_strcasecmp (argv[i], "-sh") == 0)        {            cmd_options->use_shell = 1;        }        else if (weechat_strcasecmp (argv[i], "-nosh") == 0)        {            cmd_options->use_shell = 0;        }        else if (weechat_strcasecmp (argv[i], "-bg") == 0)        {            cmd_options->detached = 1;        }        else if (weechat_strcasecmp (argv[i], "-nobg") == 0)        {            cmd_options->detached = 0;        }        else if (weechat_strcasecmp (argv[i], "-stdin") == 0)        {            cmd_options->pipe_stdin = 1;        }        else if (weechat_strcasecmp (argv[i], "-nostdin") == 0)        {            cmd_options->pipe_stdin = 0;        }        else if (weechat_strcasecmp (argv[i], "-buffer") == 0)        {            if (i + 1 >= argc)                return 0;            i++;            cmd_options->ptr_buffer_name = argv[i];            cmd_options->ptr_buffer = weechat_buffer_search ("==", argv[i]);            if (cmd_options->ptr_buffer                && (weechat_buffer_get_integer (cmd_options->ptr_buffer, "type") != 0))            {                /* only a buffer with formatted content is allowed */                return 0;            }            if (!cmd_options->ptr_buffer)                cmd_options->new_buffer = 1;        }        else if (weechat_strcasecmp (argv[i], "-l") == 0)        {            cmd_options->output_to_buffer = 0;            cmd_options->new_buffer = 0;        }        else if (weechat_strcasecmp (argv[i], "-o") == 0)        {            cmd_options->output_to_buffer = 1;            cmd_options->new_buffer = 0;        }        else if (weechat_strcasecmp (argv[i], "-n") == 0)        {            cmd_options->output_to_buffer = 0;            cmd_options->new_buffer = 1;        }        else if (weechat_strcasecmp (argv[i], "-nf") == 0)        {            cmd_options->output_to_buffer = 0;            cmd_options->new_buffer = 2;        }        else if (weechat_strcasecmp (argv[i], "-cl") == 0)        {            cmd_options->new_buffer_clear = 1;        }        else if (weechat_strcasecmp (argv[i], "-nocl") == 0)        {            cmd_options->new_buffer_clear = 0;        }        else if (weechat_strcasecmp (argv[i], "-sw") == 0)        {            cmd_options->switch_to_buffer = 1;        }        else if (weechat_strcasecmp (argv[i], "-nosw") == 0)        {            cmd_options->switch_to_buffer = 0;        }        else if (weechat_strcasecmp (argv[i], "-ln") == 0)        {            cmd_options->line_numbers = 1;        }        else if (weechat_strcasecmp (argv[i], "-noln") == 0)        {            cmd_options->line_numbers = 0;        }        else if (weechat_strcasecmp (argv[i], "-flush") == 0)        {            cmd_options->flush = 1;        }        else if (weechat_strcasecmp (argv[i], "-noflush") == 0)        {//.........这里部分代码省略.........
开发者ID:bobbertson,项目名称:weechat,代码行数:101,


示例24: exec_command_exec

intexec_command_exec (void *data, struct t_gui_buffer *buffer, int argc,                   char **argv, char **argv_eol){    int i, length, count;    char *text;    struct t_exec_cmd *ptr_exec_cmd, *ptr_next_exec_cmd;    /* make C compiler happy */    (void) data;    (void) buffer;    /* list running commands */    if ((argc == 1)        || ((argc == 2) && (weechat_strcasecmp (argv[1], "-list") == 0)))    {        exec_command_list ();        return WEECHAT_RC_OK;    }    /* send text to a running process */    if (weechat_strcasecmp (argv[1], "-in") == 0)    {        WEECHAT_COMMAND_MIN_ARGS(4, "-in");        ptr_exec_cmd = exec_command_search_running_id (argv[2]);        if (ptr_exec_cmd && ptr_exec_cmd->hook)        {            length = strlen (argv_eol[3]) + 1 + 1;            text = malloc (length);            if (text)            {                snprintf (text, length, "%s/n", argv_eol[3]);                weechat_hook_set (ptr_exec_cmd->hook, "stdin", text);                free (text);            }        }        return WEECHAT_RC_OK;    }    /* send text to a running process (if given), then close stdin */    if (weechat_strcasecmp (argv[1], "-inclose") == 0)    {        WEECHAT_COMMAND_MIN_ARGS(3, "-inclose");        ptr_exec_cmd = exec_command_search_running_id (argv[2]);        if (ptr_exec_cmd && ptr_exec_cmd->hook)        {            if (argc > 3)            {                length = strlen (argv_eol[3]) + 1 + 1;                text = malloc (length);                if (text)                {                    snprintf (text, length, "%s/n", argv_eol[3]);                    weechat_hook_set (ptr_exec_cmd->hook, "stdin", text);                    free (text);                }            }            weechat_hook_set (ptr_exec_cmd->hook, "stdin_close", "1");        }        return WEECHAT_RC_OK;    }    /* send a signal to a running process */    if (weechat_strcasecmp (argv[1], "-signal") == 0)    {        WEECHAT_COMMAND_MIN_ARGS(4, "-signal");        ptr_exec_cmd = exec_command_search_running_id (argv[2]);        if (ptr_exec_cmd)            weechat_hook_set (ptr_exec_cmd->hook, "signal", argv[3]);        return WEECHAT_RC_OK;    }    /* send a KILL signal to a running process */    if (weechat_strcasecmp (argv[1], "-kill") == 0)    {        WEECHAT_COMMAND_MIN_ARGS(3, "-kill");        ptr_exec_cmd = exec_command_search_running_id (argv[2]);        if (ptr_exec_cmd)            weechat_hook_set (ptr_exec_cmd->hook, "signal", "kill");        return WEECHAT_RC_OK;    }    /* send a KILL signal to all running processes */    if (weechat_strcasecmp (argv[1], "-killall") == 0)    {        for (ptr_exec_cmd = exec_cmds; ptr_exec_cmd;             ptr_exec_cmd = ptr_exec_cmd->next_cmd)        {            if (ptr_exec_cmd->hook)            {                weechat_hook_set (ptr_exec_cmd->hook, "signal", "kill");            }        }        return WEECHAT_RC_OK;    }    /* set a hook property */    if (weechat_strcasecmp (argv[1], "-set") == 0)    {        WEECHAT_COMMAND_MIN_ARGS(5, "-set");//.........这里部分代码省略.........
开发者ID:bobbertson,项目名称:weechat,代码行数:101,


示例25: weechat_js_command_cb

intweechat_js_command_cb (const void *pointer, void *data,                       struct t_gui_buffer *buffer,                       int argc, char **argv, char **argv_eol){    char *ptr_name, *ptr_code, *path_script;    int i, send_to_buffer_as_input, exec_commands;    /* make C++ compiler happy */    (void) pointer;    (void) data;    if (argc == 1)    {        plugin_script_display_list (weechat_js_plugin, js_scripts,                                    NULL, 0);    }    else if (argc == 2)    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_js_plugin, js_scripts,                                        NULL, 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_js_plugin, js_scripts,                                        NULL, 1);        }        else if (weechat_strcasecmp (argv[1], "autoload") == 0)        {            plugin_script_auto_load (weechat_js_plugin, &weechat_js_load_cb);        }        else if (weechat_strcasecmp (argv[1], "reload") == 0)        {            weechat_js_unload_all ();            plugin_script_auto_load (weechat_js_plugin, &weechat_js_load_cb);        }        else if (weechat_strcasecmp(argv[1], "unload") == 0)        {            weechat_js_unload_all ();        }        else if (weechat_strcasecmp (argv[1], "version") == 0)        {            plugin_script_display_interpreter (weechat_js_plugin, 0);        }        else            WEECHAT_COMMAND_ERROR;    }    else    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_js_plugin, js_scripts,                                        argv_eol[2], 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_js_plugin, js_scripts,                                        argv_eol[2], 1);        }        else if ((weechat_strcasecmp (argv[1], "load") == 0)                 || (weechat_strcasecmp (argv[1], "reload") == 0)                 || (weechat_strcasecmp (argv[1], "unload") == 0))        {            ptr_name = argv_eol[2];            if (strncmp (ptr_name, "-q ", 3) == 0)            {                js_quiet = 1;                ptr_name += 3;                while (ptr_name[0] == ' ')                {                    ptr_name++;                }            }            if (weechat_strcasecmp (argv[1], "load") == 0)            {                /* load javascript script */                path_script = plugin_script_search_path (weechat_js_plugin,                                                         ptr_name);                weechat_js_load ((path_script) ? path_script : ptr_name,                                 NULL);                if (path_script)                    free (path_script);            }            else if (weechat_strcasecmp (argv[1], "reload") == 0)            {                /* reload one javascript script */                weechat_js_reload_name (ptr_name);            }            else if (weechat_strcasecmp (argv[1], "unload") == 0)            {                /* unload javascript script */                weechat_js_unload_name (ptr_name);            }            js_quiet = 0;        }        else if (weechat_strcasecmp (argv[1], "eval") == 0)        {            send_to_buffer_as_input = 0;//.........这里部分代码省略.........
开发者ID:mumixam,项目名称:weechat,代码行数:101,


示例26: charset_command_cb

intcharset_command_cb (const void *pointer, void *data,                    struct t_gui_buffer *buffer, int argc,                    char **argv, char **argv_eol){    struct t_config_section *ptr_section;    int length;    char *ptr_charset, *option_name;    const char *plugin_name, *name, *charset_modifier;    /* make C compiler happy */    (void) pointer;    (void) data;    if (argc < 2)    {        charset_display_charsets ();        return WEECHAT_RC_OK;    }    ptr_section = NULL;    plugin_name = weechat_buffer_get_string (buffer, "plugin");    name = weechat_buffer_get_string (buffer, "name");    charset_modifier = weechat_buffer_get_string (buffer,                                                  "localvar_charset_modifier");    if (charset_modifier)        option_name = strdup (charset_modifier);    else    {        length = strlen (plugin_name) + 1 + strlen (name) + 1;        option_name = malloc (length);        if (!option_name)            WEECHAT_COMMAND_ERROR;        snprintf (option_name, length, "%s.%s", plugin_name, name);    }    if (weechat_strcasecmp (argv[1], "reset") == 0)    {        charset_set (charset_config_section_decode, "decode", option_name,                     NULL);        charset_set (charset_config_section_encode, "encode", option_name,                     NULL);    }    else    {        if (argc > 2)        {            if (weechat_strcasecmp (argv[1], "decode") == 0)            {                ptr_section = charset_config_section_decode;                ptr_charset = argv_eol[2];            }            else if (weechat_strcasecmp (argv[1], "encode") == 0)            {                ptr_section = charset_config_section_encode;                ptr_charset = argv_eol[2];            }            if (!ptr_section)            {                weechat_printf (NULL,                                _("%s%s: wrong charset type (decode or encode "                                  "expected)"),                                weechat_prefix ("error"), CHARSET_PLUGIN_NAME);                if (option_name)                    free (option_name);                return WEECHAT_RC_OK;            }        }        else            ptr_charset = argv_eol[1];        if (!charset_check (ptr_charset))        {            weechat_printf (NULL,                            _("%s%s: invalid charset: /"%s/""),                            weechat_prefix ("error"), CHARSET_PLUGIN_NAME,                            ptr_charset);            if (option_name)                free (option_name);            return WEECHAT_RC_OK;        }        if (ptr_section)        {            charset_set (ptr_section, argv[1], option_name, ptr_charset);        }        else        {            charset_set (charset_config_section_decode, "decode", option_name,                         ptr_charset);            charset_set (charset_config_section_encode, "encode", option_name,                         ptr_charset);        }    }    free (option_name);    return WEECHAT_RC_OK;//.........这里部分代码省略.........
开发者ID:Evalle,项目名称:weechat,代码行数:101,


示例27: charset_config_init

intcharset_config_init (){    struct t_config_section *ptr_section;    charset_config_file = weechat_config_new (CHARSET_CONFIG_NAME,                                              &charset_config_reload, NULL, NULL);    if (!charset_config_file)        return 0;    ptr_section = weechat_config_new_section (charset_config_file, "default",                                              0, 0,                                              NULL, NULL, NULL,                                              NULL, NULL, NULL,                                              NULL, NULL, NULL,                                              NULL, NULL, NULL,                                              NULL, NULL, NULL);    if (!ptr_section)    {        weechat_config_free (charset_config_file);        return 0;    }    charset_default_decode = weechat_config_new_option (        charset_config_file, ptr_section,        "decode", "string",        N_("global decoding charset: charset used to decode incoming messages "           "when they are not UTF-8 valid"),        NULL, 0, 0,        (charset_terminal && charset_internal         && (weechat_strcasecmp (charset_terminal,                                 charset_internal) != 0)) ?        charset_terminal : "iso-8859-1", NULL, 0,        &charset_check_charset_decode_cb, NULL, NULL,        NULL, NULL, NULL,        NULL, NULL, NULL);    charset_default_encode = weechat_config_new_option (        charset_config_file, ptr_section,        "encode", "string",        N_("global encoding charset: charset used to encode outgoing messages "           "(if empty, default is UTF-8 because it is the WeeChat internal "           "charset)"),        NULL, 0, 0, "", NULL, 0,        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);    ptr_section = weechat_config_new_section (        charset_config_file, "decode",        1, 1,        NULL, NULL, NULL,        NULL, NULL, NULL,        NULL, NULL, NULL,        &charset_config_create_option, NULL, NULL,        NULL, NULL, NULL);    if (!ptr_section)    {        weechat_config_free (charset_config_file);        return 0;    }    charset_config_section_decode = ptr_section;    ptr_section = weechat_config_new_section (        charset_config_file, "encode",        1, 1,        NULL, NULL, NULL,        NULL, NULL, NULL,        NULL, NULL, NULL,        &charset_config_create_option, NULL, NULL,        NULL, NULL, NULL);    if (!ptr_section)    {        weechat_config_free (charset_config_file);        return 0;    }    charset_config_section_encode = ptr_section;    return 1;}
开发者ID:Evalle,项目名称:weechat,代码行数:79,


示例28: trigger_command_trigger

inttrigger_command_trigger (void *data, struct t_gui_buffer *buffer, int argc,                         char **argv, char **argv_eol){    struct t_trigger *ptr_trigger, *ptr_trigger2;    struct t_trigger_regex *regex;    char *value, **sargv, **items, input[1024], str_pos[16];    int rc, i, type, count, index_option, enable, sargc, num_items, add_rc;    int regex_count, regex_rc;    /* make C compiler happy */    (void) data;    rc = WEECHAT_RC_OK;    sargv = NULL;    /* list all triggers */    if ((argc == 1)        || ((argc == 2) && (weechat_strcasecmp (argv[1], "list") == 0)))    {        trigger_command_list (_("List of triggers:"), 0);        goto end;    }    /* full list of all triggers */    if ((argc == 2) && (weechat_strcasecmp (argv[1], "listfull") == 0))    {        trigger_command_list (_("List of triggers:"), 1);        goto end;    }    /* list of default triggers */    if ((argc == 2) && (weechat_strcasecmp (argv[1], "listdefault") == 0))    {        trigger_command_list_default (1);        goto end;    }    /* add a trigger */    if ((weechat_strcasecmp (argv[1], "add") == 0)        || (weechat_strcasecmp (argv[1], "addoff") == 0)        || (weechat_strcasecmp (argv[1], "addreplace") == 0))    {        sargv = weechat_string_split_shell (argv_eol[2], &sargc);        if (!sargv || (sargc < 2))            goto error;        if (!trigger_name_valid (sargv[0]))        {            weechat_printf_tags (NULL, "no_trigger",                                 _("%s%s: invalid name for trigger"),                                 weechat_prefix ("error"), TRIGGER_PLUGIN_NAME);            goto end;        }        type = trigger_search_hook_type (sargv[1]);        if (type < 0)        {            weechat_printf_tags (NULL, "no_trigger",                                 _("%s%s: invalid hook type /"%s/""),                                 weechat_prefix ("error"), TRIGGER_PLUGIN_NAME,                                 sargv[1]);            goto end;        }        if ((sargc > 4) && sargv[4][0])        {            regex_count = 0;            regex = NULL;            regex_rc = trigger_regex_split (sargv[4], &regex_count, &regex);            trigger_regex_free (&regex_count, &regex);            switch (regex_rc)            {                case 0: /* OK */                    break;                case -1: /* format error */                    weechat_printf (NULL,                                    _("%s%s: invalid format for regular "                                      "expression"),                                    weechat_prefix ("error"),                                    TRIGGER_PLUGIN_NAME);                    goto end;                    break;                case -2: /* regex compilation error */                    weechat_printf (NULL,                                    _("%s%s: invalid regular expression "                                      "(compilation failed)"),                                    weechat_prefix ("error"),                                    TRIGGER_PLUGIN_NAME);                    goto end;                    break;                case -3: /* memory error */                    weechat_printf (NULL,                                    _("%s%s: not enough memory"),                                    weechat_prefix ("error"),                                    TRIGGER_PLUGIN_NAME);                    goto end;                    break;            }        }        if ((sargc > 6) && sargv[6][0]            && (trigger_search_return_code (sargv[6]) < 0))        {//.........这里部分代码省略.........
开发者ID:AlexTalker,项目名称:weechat,代码行数:101,


示例29: irc_message_split

struct t_hashtable *irc_message_split (struct t_irc_server *server, const char *message){    struct t_hashtable *hashtable;    char **argv, **argv_eol, *tags, *host, *command, *arguments, target[512];    char *pos;    int split_ok, argc, index_args, max_length_nick, max_length_host;    split_ok = 0;    tags = NULL;    host = NULL;    command = NULL;    arguments = NULL;    index_args = 0;    argv = NULL;    argv_eol = NULL;    /* debug message */    if (weechat_irc_plugin->debug >= 2)        weechat_printf (NULL, "irc_message_split: message='%s'", message);    hashtable = weechat_hashtable_new (32,                                       WEECHAT_HASHTABLE_STRING,                                       WEECHAT_HASHTABLE_STRING,                                       NULL,                                       NULL);    if (!hashtable)        return NULL;    if (!message || !message[0])        goto end;    if (message[0] == '@')    {        pos = strchr (message, ' ');        if (pos)        {            tags = weechat_strndup (message, pos - message + 1);            message = pos + 1;        }    }    argv = weechat_string_split (message, " ", 0, 0, &argc);    argv_eol = weechat_string_split (message, " ", 2, 0, NULL);    if (argc < 2)        goto end;    if (argv[0][0] == ':')    {        if (argc < 3)            goto end;        host = argv[0];        command = argv[1];        arguments = argv_eol[2];        index_args = 2;    }    else    {        command = argv[0];        arguments = argv_eol[1];        index_args = 1;    }    max_length_nick = (server && (server->nick_max_length > 0)) ?        server->nick_max_length : 16;    max_length_host = 1 + /* ":"  */        max_length_nick + /* nick */        1 +               /* "!"  */        63 +              /* host */        1;                /* " "  */    if ((weechat_strcasecmp (command, "ison") == 0)        || (weechat_strcasecmp (command, "wallops") == 0))    {        split_ok = irc_message_split_string (hashtable, tags, host, command,                                             NULL, ":",                                             (argv_eol[index_args][0] == ':') ?                                             argv_eol[index_args] + 1 : argv_eol[index_args],                                             NULL, ' ', max_length_host);    }    else if (weechat_strcasecmp (command, "join") == 0)    {        /* split join (if it's more than 510 bytes) */        if (strlen (message) > 510)        {            split_ok = irc_message_split_join (hashtable, tags, host,                                               arguments);        }    }    else if ((weechat_strcasecmp (command, "privmsg") == 0)             || (weechat_strcasecmp (command, "notice") == 0))    {        /* split privmsg/notice */        if (index_args + 1 <= argc - 1)        {            split_ok = irc_message_split_privmsg_notice (hashtable, tags, host,                                                         command,                                                         argv[index_args],                                                         (argv_eol[index_args + 1][0] == ':') ?//.........这里部分代码省略.........
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:101,


示例30: weechat_guile_command_cb

intweechat_guile_command_cb (void *data, struct t_gui_buffer *buffer,                          int argc, char **argv, char **argv_eol){    char *ptr_name, *path_script;    SCM value;    /* make C compiler happy */    (void) data;    (void) buffer;    if (argc == 1)    {        plugin_script_display_list (weechat_guile_plugin, guile_scripts,                                    NULL, 0);    }    else if (argc == 2)    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_guile_plugin, guile_scripts,                                        NULL, 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_guile_plugin, guile_scripts,                                        NULL, 1);        }        else if (weechat_strcasecmp (argv[1], "autoload") == 0)        {            plugin_script_auto_load (weechat_guile_plugin, &weechat_guile_load_cb);        }        else if (weechat_strcasecmp (argv[1], "reload") == 0)        {            weechat_guile_unload_all ();            plugin_script_auto_load (weechat_guile_plugin, &weechat_guile_load_cb);        }        else if (weechat_strcasecmp (argv[1], "unload") == 0)        {            weechat_guile_unload_all ();        }        else            return WEECHAT_RC_ERROR;    }    else    {        if (weechat_strcasecmp (argv[1], "list") == 0)        {            plugin_script_display_list (weechat_guile_plugin, guile_scripts,                                        argv_eol[2], 0);        }        else if (weechat_strcasecmp (argv[1], "listfull") == 0)        {            plugin_script_display_list (weechat_guile_plugin, guile_scripts,                                        argv_eol[2], 1);        }        else if ((weechat_strcasecmp (argv[1], "load") == 0)                 || (weechat_strcasecmp (argv[1], "reload") == 0)                 || (weechat_strcasecmp (argv[1], "unload") == 0))        {            ptr_name = argv_eol[2];            if (strncmp (ptr_name, "-q ", 3) == 0)            {                guile_quiet = 1;                ptr_name += 3;                while (ptr_name[0] == ' ')                {                    ptr_name++;                }            }            if (weechat_strcasecmp (argv[1], "load") == 0)            {                /* load guile script */                path_script = plugin_script_search_path (weechat_guile_plugin,                                                         ptr_name);                weechat_guile_load ((path_script) ? path_script : ptr_name);                if (path_script)                    free (path_script);            }            else if (weechat_strcasecmp (argv[1], "reload") == 0)            {                /* reload one guile script */                weechat_guile_reload_name (ptr_name);            }            else if (weechat_strcasecmp (argv[1], "unload") == 0)            {                /* unload guile script */                weechat_guile_unload_name (ptr_name);            }            guile_quiet = 0;        }        else if (weechat_strcasecmp (argv[1], "eval") == 0)        {            /* eval guile code */            value = weechat_guile_catch (scm_c_eval_string, argv_eol[2]);            if (!SCM_EQ_P (value, SCM_UNDEFINED)                && !SCM_EQ_P (value, SCM_UNSPECIFIED))            {                scm_display (value, guile_port);            }//.........这里部分代码省略.........
开发者ID:AlexTalker,项目名称:weechat,代码行数:101,



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


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