summaryrefslogtreecommitdiff
path: root/shipping.h
diff options
context:
space:
mode:
Diffstat (limited to 'shipping.h')
-rw-r--r--shipping.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/shipping.h b/shipping.h
index 345eaef..dc7d7df 100644
--- a/shipping.h
+++ b/shipping.h
@@ -1,3 +1,4 @@
+#include <string.h>
#include <curl/curl.h>
#include "pikul.h"
@@ -7,4 +8,12 @@ struct shipping {
struct curl_slist *headers;
};
-void headers(struct shipping *, const char *[], char *[]);
+inline void headers(struct shipping *shipping, const char *fields[], char *provisions[])
+{
+ shipping->headers = NULL;
+ while (*fields) {
+ char header[strlen(*fields) + strlen(*provisions) + 2];
+ sprintf(header, "%s:%s", *fields++, *provisions++);
+ shipping->headers = curl_slist_append(shipping->headers, header);
+ }
+}