return pakfire_hashes_import(&self->expected_hashes, hashes);
}
+char* pakfire_xfer_escape(struct pakfire_xfer* self, const char* s) {
+ char* output = NULL;
+ char* result = NULL;
+
+ // Return NULL if the input is NULL
+ if (!s)
+ return NULL;
+
+ // Escape the output
+ output = curl_easy_escape(self->handle, s, 0);
+ if (!output)
+ return NULL;
+
+ // Copy the string once more so that we don't have to call curl_free() outside of here.
+ result = strdup(output);
+ curl_free(output);
+
+ return result;
+}
+
int pakfire_xfer_add_query(struct pakfire_xfer* xfer,
const char* key, const char* format, ...) {
char* value = NULL;
int pakfire_xfer_verify_hashes(struct pakfire_xfer* self, const struct pakfire_hashes* hashes);
+char* pakfire_xfer_escape(struct pakfire_xfer* self, const char* s);
+
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,