void chunks_printf(chunks_t *c, char *fmt, ...) { char *buf; va_list ap; va_start(ap, fmt); cpo_pool_vasprintf(c->pool, &buf, fmt, ap); va_end(ap); chunks_add_tail(c, buf, cpo_strlen(buf)); }
int calipso_reply_set_header_value(calipso_reply_t *p, char *header, char *fmt, ...) { char *buf = NULL; va_list ap; va_start(ap, fmt); cpo_pool_vasprintf(p->request->pool/*p->pool*/, &buf, fmt, ap); va_end(ap); //TRACE("key: %s value: %s\n", header, buf); return (header && buf) ? (hash_table_insert(p->header, header, buf) == 0) : CPO_ERR; }
int calipso_reply_printf(calipso_reply_t *reply, char *fmt, ...) { int ret; char *buf; calipso_pool_t *pool; va_list ap; pool = calipso_reply_get_pool(reply); va_start(ap, fmt); ret = cpo_pool_vasprintf(pool, &buf, fmt, ap); va_end(ap); calipso_reply_print(reply, buf, ret); cpo_pool_free(pool, buf); return (ret); }