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

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

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

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

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

示例1: relay_server_new

struct t_relay_server *relay_server_new (enum t_relay_protocol protocol,                  const char *protocol_args,                  int port){    struct t_relay_server *new_server;    if (relay_server_search_port (port))    {        weechat_printf (NULL, _("%s%s: error: port /"%d/" is already used"),                        weechat_prefix ("error"),                        RELAY_PLUGIN_NAME, port);        return NULL;    }    new_server = malloc (sizeof (*new_server));    if (new_server)    {        new_server->protocol = protocol;        new_server->protocol_args =            (protocol_args) ? strdup (protocol_args) : NULL;        new_server->port = port;        new_server->sock = -1;        new_server->hook_fd = NULL;        new_server->start_time = 0;        if (!relay_server_create_socket (new_server))        {            if (new_server->protocol_args)                free (new_server->protocol_args);            free (new_server);            return NULL;        }        new_server->prev_server = NULL;        new_server->next_server = relay_servers;        if (relay_servers)            relay_servers->prev_server = new_server;        else            last_relay_server = new_server;        relay_servers = new_server;    }    else    {        weechat_printf (NULL,                        _("%s%s: not enough memory for listening on new port"),                        weechat_prefix ("error"), RELAY_PLUGIN_NAME);    }    return new_server;}
开发者ID:munkee,项目名称:weechat,代码行数:51,


示例2: weechat_python_output

static PyObject *weechat_python_output (PyObject *self, PyObject *args){    char *msg, *m, *p;    /* make C compiler happy */    (void) self;    msg = NULL;    if (!PyArg_ParseTuple (args, "s", &msg))    {        if (strlen(python_buffer_output) > 0)        {            weechat_printf (NULL,                            weechat_gettext ("%s: stdout/stderr: %s%s"),                            PYTHON_PLUGIN_NAME, python_buffer_output, "");            python_buffer_output[0] = '/0';        }    }    else    {        m = msg;        while ((p = strchr (m, '/n')) != NULL)        {            *p = '/0';            if (strlen (m) + strlen (python_buffer_output) > 0)            {                weechat_printf (NULL,                                weechat_gettext ("%s: stdout/stderr: %s%s"),                                PYTHON_PLUGIN_NAME, python_buffer_output, m);            }            *p = '/n';            python_buffer_output[0] = '/0';            m = ++p;        }        if (strlen(m) + strlen(python_buffer_output) > sizeof(python_buffer_output))        {            weechat_printf (NULL,                            weechat_gettext ("%s: stdout/stderr: %s%s"),                            PYTHON_PLUGIN_NAME, python_buffer_output, m);            python_buffer_output[0] = '/0';        }        else            strcat (python_buffer_output, m);    }    Py_INCREF(Py_None);    return Py_None;}
开发者ID:anders,项目名称:weechat,代码行数:51,


示例3: relay_command_client_list

voidrelay_command_client_list (int full){    struct t_relay_client *ptr_client;    int i;    char date_start[128], date_activity[128];    struct tm *date_tmp;        if (relay_clients)    {        weechat_printf (NULL, "");        weechat_printf (NULL, _("Clients for relay:"));        i = 1;        for (ptr_client = relay_clients; ptr_client;             ptr_client = ptr_client->next_client)        {            date_tmp = localtime (&(ptr_client->start_time));            strftime (date_start, sizeof (date_start),                      "%a, %d %b %Y %H:%M:%S", date_tmp);                        date_tmp = localtime (&(ptr_client->last_activity));            strftime (date_activity, sizeof (date_activity),                      "%a, %d %b %Y %H:%M:%S", date_tmp);                            if (full)            {                weechat_printf (NULL,                                _("%3d. %s, started on: %s, last activity: %s, "                                  "bytes: %lu recv, %lu sent"),                                i,                                ptr_client->address,                                date_start,                                date_activity,                                ptr_client->bytes_recv,                                ptr_client->bytes_sent);            }            else            {                weechat_printf (NULL,                                _("%3d. %s, started on: %s"),                                i,                                ptr_client->address);            }            i++;        }    }    else        weechat_printf (NULL, _("No client for relay"));}
开发者ID:matsuu,项目名称:weechat,代码行数:49,


示例4: weechat_ruby_unload

voidweechat_ruby_unload (struct t_plugin_script *script){    int *rc;    void *interpreter;    if ((weechat_ruby_plugin->debug >= 1) || !ruby_quiet)    {        weechat_printf (NULL,                        weechat_gettext ("%s: unloading script /"%s/""),                        RUBY_PLUGIN_NAME, script->name);    }    if (script->shutdown_func && script->shutdown_func[0])    {        rc = (int *)weechat_ruby_exec (script,                                       WEECHAT_SCRIPT_EXEC_INT,                                       script->shutdown_func,                                       0, NULL);        if (rc)            free (rc);    }    interpreter = script->interpreter;    if (ruby_current_script == script)        ruby_current_script = (ruby_current_script->prev_script) ?            ruby_current_script->prev_script : ruby_current_script->next_script;    script_remove (weechat_ruby_plugin, &ruby_scripts, &last_ruby_script,                   script);    if (interpreter)        rb_gc_unregister_address (interpreter);}
开发者ID:munkee,项目名称:weechat,代码行数:35,


示例5: relay_config_check_port_cb

intrelay_config_check_port_cb (void *data, struct t_config_option *option,                            const char *value){    char *error;    long port;    struct t_relay_server *ptr_server;    /* make C compiler happy */    (void) data;    (void) option;    error = NULL;    port = strtol (value, &error, 10);    ptr_server = relay_server_search_port ((int)port);    if (ptr_server)    {        weechat_printf (NULL, _("%s%s: error: port /"%d/" is already used"),                        weechat_prefix ("error"),                        RELAY_PLUGIN_NAME, (int)port);        return 0;    }    return 1;}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:25,


示例6: relay_server_close_socket

voidrelay_server_close_socket (struct t_relay_server *server){    if (server->hook_fd)    {        weechat_unhook (server->hook_fd);        server->hook_fd = NULL;    }    if (server->sock >= 0)    {        close (server->sock);        server->sock = -1;        if (server->unix_socket)            unlink (server->path);        if (!relay_signal_upgrade_received)        {            weechat_printf (NULL,                            _("%s: socket closed for %s (%s: %s)"),                            RELAY_PLUGIN_NAME,                            server->protocol_string,                            (server->unix_socket) ? _("path") : _("port"),                            server->path);        }    }}
开发者ID:weechat,项目名称:weechat,代码行数:25,


示例7: relay_network_init

voidrelay_network_init (){#ifdef HAVE_GNUTLS    /* credentials */    gnutls_certificate_allocate_credentials (&relay_gnutls_x509_cred);    relay_network_set_ssl_cert_key (0);    /* priority */    relay_gnutls_priority_cache = malloc (sizeof (*relay_gnutls_priority_cache));    if (relay_gnutls_priority_cache)    {        if (gnutls_priority_init (relay_gnutls_priority_cache,                                  "PERFORMANCE", NULL) != GNUTLS_E_SUCCESS)        {            weechat_printf (NULL,                            _("%s%s: unable to initialize priority for SSL"),                            weechat_prefix ("error"), RELAY_PLUGIN_NAME);            free (relay_gnutls_priority_cache);            relay_gnutls_priority_cache = NULL;        }    }#endif    relay_network_init_ok = 1;}
开发者ID:FauxFaux,项目名称:weechat_old,代码行数:26,


示例8: weechat_guile_unload

voidweechat_guile_unload (struct t_plugin_script *script){    int *rc;    if ((weechat_guile_plugin->debug >= 1) || !guile_quiet)    {        weechat_printf (NULL,                        weechat_gettext ("%s: unloading script /"%s/""),                        GUILE_PLUGIN_NAME, script->name);    }    if (script->shutdown_func && script->shutdown_func[0])    {        rc = (int *)weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT,                                        script->shutdown_func, NULL, NULL);        if (rc)            free (rc);    }    weechat_guile_catch (scm_gc_unprotect_object, script->interpreter);    if (guile_current_script == script)        guile_current_script = (guile_current_script->prev_script) ?            guile_current_script->prev_script : guile_current_script->next_script;    script_remove (weechat_guile_plugin, &guile_scripts, &last_guile_script,                   script);}
开发者ID:munkee,项目名称:weechat,代码行数:29,


示例9: relay_server_close_socket

voidrelay_server_close_socket (struct t_relay_server *server){    if (server->hook_fd)    {        weechat_unhook (server->hook_fd);        server->hook_fd = NULL;    }    if (server->sock >= 0)    {        close (server->sock);        server->sock = -1;        if (!relay_signal_upgrade_received)        {            weechat_printf (NULL,                            _("%s: socket closed for %s%s%s (port %d)"),                            RELAY_PLUGIN_NAME,                            relay_protocol_string[server->protocol],                            (server->protocol_args) ? "." : "",                            (server->protocol_args) ? server->protocol_args : "",                            server->port);        }    }}
开发者ID:munkee,项目名称:weechat,代码行数:25,


示例10: twc_sqlite_add_friend_request

/** * Add a friend request. Return ID on success, -1 on error. */inttwc_sqlite_add_friend_request(struct t_twc_profile *profile,                              struct t_twc_friend_request *friend_request){    int64_t profile_id;    if (!twc_sqlite_profile_id(profile, &profile_id))    {        weechat_printf(NULL, "missing profile!");        return -1;    }    TWC_SQLITE_STMT(statement,                    "INSERT OR REPLACE INTO friend_requests (tox_id, message, profile_id)"                    "VALUES (?, ?, ?)");    sqlite3_bind_blob(statement, 1,                      friend_request->tox_id, TOX_CLIENT_ID_SIZE,                      NULL);    sqlite3_bind_text(statement, 2,                      friend_request->message, strlen(friend_request->message) + 1,                      NULL);    sqlite3_bind_int(statement, 3,                     profile_id);    int rc = sqlite3_step(statement);    TWC_SQLITE_DEBUG_RC(rc, SQLITE_DONE)    if (rc != SQLITE_DONE)        return -1;    else        return sqlite3_last_insert_rowid(twc_sqlite_db);}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:33,


示例11: twc_sqlite_friend_requests

/** * Return a list of all friend requests for the given profile. */struct t_twc_list *twc_sqlite_friend_requests(struct t_twc_profile *profile){    int64_t profile_id;    if (!twc_sqlite_profile_id(profile, &profile_id))    {        weechat_printf(NULL, "missing profile!");        return NULL;    }    TWC_SQLITE_STMT(statement,                    "SELECT id, tox_id, message "                    "FROM friend_requests "                    "WHERE profile_id == ?");    sqlite3_bind_int(statement, 1,                     profile_id);    struct t_twc_list *friend_requests = twc_list_new();    int rc;    while ((rc = sqlite3_step(statement)) == SQLITE_ROW)    {        struct t_twc_friend_request *request =            twc_sqlite_friend_request_row(statement, profile);        twc_list_item_new_data_add(friend_requests, request);    }    TWC_SQLITE_DEBUG_RC(rc, SQLITE_DONE)    return friend_requests;}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:33,


示例12: charset_encode_cb

char *charset_encode_cb (const void *pointer, void *data,                   const char *modifier, const char *modifier_data,                   const char *string){    const char *charset;    /* make C compiler happy */    (void) pointer;    (void) data;    (void) modifier;    charset = charset_get (charset_config_section_encode, modifier_data,                           charset_default_encode);    if (weechat_charset_plugin->debug)    {        weechat_printf (NULL,                        "charset: debug: using 'encode' charset: %s "                        "(modifier=/"%s/", modifier_data=/"%s/", string=/"%s/")",                        charset, modifier, modifier_data, string);    }    if (charset && charset[0])        return weechat_iconv_from_internal (charset, string);    return NULL;}
开发者ID:Evalle,项目名称:weechat,代码行数:26,


示例13: weechat_perl_unload

voidweechat_perl_unload (struct t_plugin_script *script){    int *rc;    void *interpreter;    char *filename;    if ((weechat_perl_plugin->debug >= 2) || !perl_quiet)    {        weechat_printf (NULL,                        weechat_gettext ("%s: unloading script /"%s/""),                        PERL_PLUGIN_NAME, script->name);    }#ifdef MULTIPLICITY    PERL_SET_CONTEXT (script->interpreter);#endif /* MULTIPLICITY */    if (script->shutdown_func && script->shutdown_func[0])    {        rc = (int *)weechat_perl_exec (script,                                       WEECHAT_SCRIPT_EXEC_INT,                                       script->shutdown_func,                                       NULL, NULL);        if (rc)            free (rc);    }    filename = strdup (script->filename);    interpreter = script->interpreter;    if (perl_current_script == script)    {        perl_current_script = (perl_current_script->prev_script) ?            perl_current_script->prev_script : perl_current_script->next_script;    }    plugin_script_remove (weechat_perl_plugin, &perl_scripts, &last_perl_script,                          script);#ifdef MULTIPLICITY    if (interpreter)    {        perl_destruct (interpreter);        perl_free (interpreter);    }    if (perl_current_script)    {        PERL_SET_CONTEXT (perl_current_script->interpreter);    }#else    if (interpreter)        free (interpreter);#endif /* MULTIPLICITY */    (void) weechat_hook_signal_send ("perl_script_unloaded",                                     WEECHAT_HOOK_SIGNAL_STRING, filename);    if (filename)        free (filename);}
开发者ID:aadiarbakerli,项目名称:weechat,代码行数:60,


示例14: twc_sqlite_init

/** * Initialize connection to SQLite database and create tables if necessary. * Returns 0 on success, -1 on failure. */inttwc_sqlite_init(){    char *path = twc_sqlite_db_path();    int rc = sqlite3_open(path, &twc_sqlite_db);    free(path);    TWC_SQLITE_DEBUG_RC(rc, SQLITE_OK)    if (rc != SQLITE_OK)    {        weechat_printf(NULL,                      "%s: could not open database: %s/n",                      weechat_plugin->name,                      sqlite3_errmsg(twc_sqlite_db));        sqlite3_close(twc_sqlite_db);        twc_sqlite_db = NULL;        return -1;    }    // statement list (so we can finalize later)    twc_sqlite_statements = twc_list_new();    // initialize tables    if (twc_sqlite_init_profiles() != 0 ||        twc_sqlite_init_friend_requests() != 0)        return -1;    return 0;}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:35,


示例15: alias_config_completion_create_option_cb

intalias_config_completion_create_option_cb (void *data,                                          struct t_config_file *config_file,                                          struct t_config_section *section,                                          const char *option_name,                                          const char *value){    struct t_alias *ptr_alias;    /* make C compiler happy */    (void) data;    (void) config_file;    (void) section;    ptr_alias = alias_search (option_name);    if (!ptr_alias)    {        weechat_printf (NULL,                        _("%s%s: error creating completion for alias /"%s/": "                          "alias not found"),                        weechat_prefix ("error"), ALIAS_PLUGIN_NAME,                        option_name);        return WEECHAT_CONFIG_OPTION_SET_ERROR;    }    /* create configuration option */    alias_config_completion_new_option (option_name, value);    /* create/update completion in alias */    alias_update_completion (ptr_alias, value);    return WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;}
开发者ID:Shawn-Smith,项目名称:weechat,代码行数:33,


示例16: weechat_plugin_init

intweechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]){    /* make C compiler happy */    (void) argc;    (void) argv;    weechat_plugin = plugin;    rmodifier_count = 0;    rmodifier_hook_list = weechat_list_new ();    if (!rmodifier_config_init ())    {        weechat_printf (NULL,                        _("%s%s: error creating configuration file"),                        weechat_prefix("error"), RMODIFIER_PLUGIN_NAME);        return WEECHAT_RC_ERROR;    }    rmodifier_config_read ();    rmodifier_command_init ();    rmodifier_completion_init ();    rmodifier_info_init ();    rmodifier_debug_init ();    return WEECHAT_RC_OK;}
开发者ID:jameslord,项目名称:weechat,代码行数:31,


示例17: irc_redirect_init_command

voidirc_redirect_init_command (struct t_irc_redirect *redirect,                           const char *command){    char *pos;    if (!redirect)        return;    if (command)    {        pos = strchr (command, '/r');        if (!pos)            pos = strchr (command, '/n');        if (pos)            redirect->command = weechat_strndup (command, pos - command);        else            redirect->command = strdup (command);    }    else        redirect->command = NULL;    redirect->assigned_to_command = 1;    redirect->start_time = time (NULL);    if (weechat_irc_plugin->debug >= 2)    {        weechat_printf (            redirect->server->buffer,            _("%s: starting redirection for command /"%s/" on server /"%s/" "              "(redirect pattern: /"%s/")"),            IRC_PLUGIN_NAME, redirect->command, redirect->server->name,            redirect->pattern);    }}
开发者ID:sardemff7,项目名称:weechat,代码行数:35,


示例18: charset_display_charsets

voidcharset_display_charsets (){    weechat_printf (NULL,                    _("%s: terminal: %s, internal: %s"),                    CHARSET_PLUGIN_NAME, charset_terminal, charset_internal);}
开发者ID:Evalle,项目名称:weechat,代码行数:7,


示例19: weechat_aspell_speller_check_dictionaries

voidweechat_aspell_speller_check_dictionaries (const char *dict_list){    char **argv;    int argc, i;    if (dict_list)    {        argv = weechat_string_split (dict_list, ",", 0, 0, &argc);        if (argv)        {            for (i = 0; i < argc; i++)            {                if (!weechat_aspell_speller_dict_supported (argv[i]))                {                    weechat_printf (NULL,                                    _("%s: warning: dictionary /"%s/" is not "                                      "available on your system"),                                    ASPELL_PLUGIN_NAME, argv[i]);                }            }            weechat_string_free_split (argv);        }    }}
开发者ID:lp0,项目名称:weechat,代码行数:25,


示例20: xfer_chat_sendf

voidxfer_chat_sendf (struct t_xfer *xfer, const char *format, ...){    char *ptr_msg, *msg_encoded;    if (!xfer || (xfer->sock < 0))        return;    weechat_va_format (format);    if (!vbuffer)        return;    msg_encoded = (xfer->charset_modifier) ?        weechat_hook_modifier_exec ("charset_encode",                                    xfer->charset_modifier,                                    vbuffer) : NULL;    ptr_msg = (msg_encoded) ? msg_encoded : vbuffer;    if (xfer_chat_send (xfer, ptr_msg, strlen (ptr_msg)) <= 0)    {        weechat_printf (NULL,                        _("%s%s: error sending data to /"%s/" via xfer chat"),                        weechat_prefix ("error"), XFER_PLUGIN_NAME,                        xfer->remote_nick);        xfer_close (xfer, XFER_STATUS_FAILED);    }    if (msg_encoded)        free (msg_encoded);    free (vbuffer);}
开发者ID:Petzku,项目名称:weechat,代码行数:33,


示例21: weechat_aspell_speller_free_value_cb

voidweechat_aspell_speller_free_value_cb (struct t_hashtable *hashtable,                                      const void *key, void *value){#ifdef USE_ENCHANT    EnchantDict *ptr_speller;#else    AspellSpeller *ptr_speller;#endif /* USE_ENCHANT */    /* make C compiler happy */    (void) hashtable;    if (weechat_aspell_plugin->debug)    {        weechat_printf (NULL,                        "%s: removing speller for lang /"%s/"",                        ASPELL_PLUGIN_NAME, (const char *)key);    }    /* free speller */#ifdef USE_ENCHANT    ptr_speller = (EnchantDict *)value;    enchant_broker_free_dict (broker, ptr_speller);#else    ptr_speller = (AspellSpeller *)value;    aspell_speller_save_all_word_lists (ptr_speller);    delete_aspell_speller (ptr_speller);#endif /* USE_ENCHANT */}
开发者ID:lp0,项目名称:weechat,代码行数:30,


示例22: weechat_tcl_unload

voidweechat_tcl_unload (struct t_plugin_script *script){    Tcl_Interp* interp;    int *rc;    if ((weechat_tcl_plugin->debug >= 1) || !tcl_quiet)    {        weechat_printf (NULL,                        weechat_gettext ("%s: unloading script /"%s/""),                        TCL_PLUGIN_NAME, script->name);    }    if (script->shutdown_func && script->shutdown_func[0])    {        rc = (int *)weechat_tcl_exec (script,                                      WEECHAT_SCRIPT_EXEC_INT,                                      script->shutdown_func,                                      NULL, NULL);        if (rc)            free (rc);    }    interp = (Tcl_Interp*)script->interpreter;    if (tcl_current_script == script)        tcl_current_script = (tcl_current_script->prev_script) ?            tcl_current_script->prev_script : tcl_current_script->next_script;    script_remove (weechat_tcl_plugin, &tcl_scripts, &last_tcl_script, script);    Tcl_DeleteInterp(interp);}
开发者ID:munkee,项目名称:weechat,代码行数:33,


示例23: twc_sqlite_delete_friend_request_with_id

inttwc_sqlite_delete_friend_request_with_id(struct t_twc_profile *profile,                                         int64_t id){    int64_t profile_id;    if (!twc_sqlite_profile_id(profile, &profile_id))    {        weechat_printf(NULL, "missing profile!");        return -1;    }    TWC_SQLITE_STMT(statement,                    "DELETE FROM friend_requests "                    "WHERE id == ? AND profile_id == ?");    sqlite3_bind_int(statement, 1,                     id);    sqlite3_bind_int(statement, 2,                     profile_id);    int rc = sqlite3_step(statement);    TWC_SQLITE_DEBUG_RC(rc, SQLITE_DONE)    if (rc == SQLITE_DONE)        return 0;    else        return -1;}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:26,


示例24: twc_sqlite_friend_request_with_id

struct t_twc_friend_request *twc_sqlite_friend_request_with_id(struct t_twc_profile *profile,                                  int64_t id){    int64_t profile_id;    if (!twc_sqlite_profile_id(profile, &profile_id))    {        weechat_printf(NULL, "missing profile!");        return NULL;    }    TWC_SQLITE_STMT(statement,                    "SELECT id, tox_id, message "                    "FROM friend_requests "                    "WHERE id == ? AND profile_id == ?");    sqlite3_bind_int(statement, 1, id);    sqlite3_bind_int(statement, 2, profile_id);    struct t_twc_friend_request *request;    int rc = sqlite3_step(statement);    if (rc == SQLITE_ROW)    {        request = twc_sqlite_friend_request_row(statement, profile);        return request;    }    else        TWC_SQLITE_DEBUG_RC(rc, SQLITE_DONE)    return NULL;}
开发者ID:cmcsun,项目名称:tox-weechat,代码行数:30,


示例25: irc_input_send_user_message

voidirc_input_send_user_message (struct t_gui_buffer *buffer, char *text){    int max_length;    char *pos, *pos_max, *last_space, *pos_next, *next, saved_char;        IRC_GET_SERVER_CHANNEL(buffer);        if (!ptr_server || !ptr_channel || !text || !text[0])        return;        if (!ptr_server->is_connected)    {        weechat_printf (buffer,                        _("%s%s: you are not connected to server"),                        weechat_prefix ("error"), IRC_PLUGIN_NAME);        return;    }        next = NULL;    last_space = NULL;    saved_char = '/0';        max_length = 512 - 16 - 65 - 10 - strlen (ptr_server->nick) -        strlen (ptr_channel->name);        if (max_length > 0)    {        if ((int)strlen (text) > max_length)        {            pos = text;            pos_max = text + max_length;            while (pos && pos[0])            {                if (pos[0] == ' ')                    last_space = pos;                pos_next = weechat_utf8_next_char (pos);                if (pos_next > pos_max)                    break;                pos = pos_next;            }            if (last_space && (last_space < pos))                pos = last_space + 1;            saved_char = pos[0];            pos[0] = '/0';            next = pos;        }    }        irc_server_sendf (ptr_server, 1, "PRIVMSG %s :%s",                      ptr_channel->name, text);    irc_input_user_message_display (buffer, text);        if (next)    {        next[0] = saved_char;        irc_input_send_user_message (buffer, next);    }}
开发者ID:matsuu,项目名称:weechat,代码行数:59,


示例26: irc_input_data

intirc_input_data (struct t_gui_buffer *buffer, const char *input_data, int flags){    const char *ptr_data;    char *data_with_colors, *msg;    IRC_BUFFER_GET_SERVER_CHANNEL(buffer);    if (buffer == irc_raw_buffer)    {        if (weechat_strcasecmp (input_data, "q") == 0)            weechat_buffer_close (buffer);    }    else    {        /*         * if send unknown commands is enabled and that input data is a         * command, then send this command to IRC server         */        if (weechat_config_boolean (irc_config_network_send_unknown_commands)            && !weechat_string_input_for_buffer (input_data))        {            if (ptr_server)            {                irc_server_sendf (ptr_server, flags, NULL,                                  "%s", weechat_utf8_next_char (input_data));            }            return WEECHAT_RC_OK;        }        if (ptr_channel)        {            ptr_data = weechat_string_input_for_buffer (input_data);            if (!ptr_data)                ptr_data = input_data;            data_with_colors = irc_color_encode (                ptr_data,                weechat_config_boolean (irc_config_network_colors_send));            msg = strdup ((data_with_colors) ? data_with_colors : ptr_data);            if (msg)            {                irc_input_send_user_message (buffer, flags, NULL, msg);                free (msg);            }            if (data_with_colors)                free (data_with_colors);        }        else        {            weechat_printf (buffer,                            _("%s%s: this buffer is not a channel!"),                            weechat_prefix ("error"), IRC_PLUGIN_NAME);        }    }    return WEECHAT_RC_OK;}
开发者ID:aadiarbakerli,项目名称:weechat,代码行数:59,


示例27: weechat_ruby_output

static VALUEweechat_ruby_output (VALUE self, VALUE str){    if (ruby_hide_errors)        return Qnil;    char *msg, *p, *m;    /* make C compiler happy */    (void) self;    msg = strdup(StringValuePtr(str));    m = msg;    while ((p = strchr (m, '/n')) != NULL)    {        *p = '/0';        if (strlen (m) + strlen (ruby_buffer_output) > 0)        {            weechat_printf (NULL,                            weechat_gettext ("%s%s: stdout/stderr: %s%s"),                            weechat_prefix ("error"), RUBY_PLUGIN_NAME,                            ruby_buffer_output, m);        }        *p = '/n';        ruby_buffer_output[0] = '/0';        m = ++p;    }    if (strlen(m) + strlen(ruby_buffer_output) > sizeof(ruby_buffer_output))    {        weechat_printf (NULL,                        weechat_gettext ("%s%s: stdout/stderr: %s%s"),                        weechat_prefix ("error"), RUBY_PLUGIN_NAME,                        ruby_buffer_output, m);        ruby_buffer_output[0] = '/0';    }    else        strcat (ruby_buffer_output, m);    if (msg)        free (msg);    return Qnil;}
开发者ID:AlexTalker,项目名称:weechat,代码行数:45,


示例28: list_connections

void list_connections(struct t_gui_buffer *buffer) {    struct SilcPluginServer *server;    server = server_list;    while (server->next != NULL) {        server = server->next;        weechat_printf(buffer, "Connection: %s", server->server_name);    }}
开发者ID:bsx,项目名称:weechat-silc,代码行数:9,


示例29: charset_set

voidcharset_set (struct t_config_section *section, const char *type,             const char *name, const char *value){    if (charset_config_create_option (NULL, NULL,                                      charset_config_file,                                      section,                                      name,                                      value) > 0)    {        if (value && value[0])            weechat_printf (NULL, "%s: %s, /"%s/" => %s",                            CHARSET_PLUGIN_NAME, type, name, value);        else            weechat_printf (NULL, _("%s: %s, /"%s/": removed"),                            CHARSET_PLUGIN_NAME, type, name);    }}
开发者ID:Evalle,项目名称:weechat,代码行数:18,


示例30: weechat_python_signal_debug_libs_cb

intweechat_python_signal_debug_libs_cb (void *data, const char *signal,                                     const char *type_data, void *signal_data){    /* make C compiler happy */    (void) data;    (void) signal;    (void) type_data;    (void) signal_data;#ifdef PY_VERSION    weechat_printf (NULL, "  %s: %s", PYTHON_PLUGIN_NAME, PY_VERSION);#else    weechat_printf (NULL, "  %s: (?)", PYTHON_PLUGIN_NAME);#endif    return WEECHAT_RC_OK;}
开发者ID:anders,项目名称:weechat,代码行数:18,



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


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