diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-27 23:51:46 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-27 23:51:46 +0800 |
commit | 9c26a7ea4265b6f372ba40ea5fcb6fc440538813 (patch) | |
tree | 1e529c5eefb9b1254d883cb63bc35af5892e499d /shipping.h | |
parent | 65a334cf2fe2d7d524c129f0df765463a91f542c (diff) |
Make headers function inline
Diffstat (limited to 'shipping.h')
-rw-r--r-- | shipping.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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); + } +} |