return result;
}
+int pakfire_xfer_add_header(struct pakfire_xfer* self, const char* format, ...) {
+ char* header = NULL;
+ va_list args;
+ int r;
+
+ // Format the value
+ va_start(args, format);
+ r = vasprintf(&header, format, args);
+ va_end(args);
+
+ // Break on error
+ if (r < 0) {
+ r = -errno;
+ goto ERROR;
+ }
+
+ // Append the header
+ self->headers = curl_slist_append(self->headers, header);
+
+ERROR:
+ if (header)
+ free(header);
+
+ return r;
+}
+
int pakfire_xfer_add_query(struct pakfire_xfer* xfer,
const char* key, const char* format, ...) {
char* value = NULL;
char* pakfire_xfer_escape(struct pakfire_xfer* self, const char* s);
+int pakfire_xfer_add_header(struct pakfire_xfer* self, const char* format, ...)
+ __attribute__((format(printf, 2, 3)));
int pakfire_xfer_add_query(struct pakfire_xfer* xfer,
const char* key, const char* format, ...) __attribute__((format(printf, 3, 4)));
int pakfire_xfer_add_param(struct pakfire_xfer* xfer,