From 65a334cf2fe2d7d524c129f0df765463a91f542c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 27 Jun 2021 23:41:31 +0800 Subject: Shipping API client framework with 1 module so far. --- shipping.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 shipping.c (limited to 'shipping.c') diff --git a/shipping.c b/shipping.c new file mode 100644 index 0000000..f2e263c --- /dev/null +++ b/shipping.c @@ -0,0 +1,12 @@ +#include +#include "shipping.h" + +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); + } +} -- cgit v1.2.3