static int my_c_asprintf (char **result, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = c_vasprintf (result, format, args); va_end (args); return ret; }
void sircc_server_vprintf(struct sircc_server *server, const char *fmt, va_list ap) { char *string; int sz; sz = c_vasprintf(&string, fmt, ap); io_tcp_client_write(server->tcp_client, string, (size_t)sz); c_free(string); }
char * c_xvasprintf (const char *format, va_list args) { char *result; if (c_vasprintf (&result, format, args) < 0) { if (errno == ENOMEM) xalloc_die (); return NULL; } return result; }
void sircc_chan_log_error(struct sircc_chan *chan, const char *fmt, ...) { struct sircc_history *history; va_list ap; char *str; va_start(ap, fmt); c_vasprintf(&str, fmt, ap); va_end(ap); history = sircc_chan_history(chan); sircc_history_add_error(history, str); sircc_chan_on_msg_added(chan, false); }