summaryrefslogtreecommitdiff
path: root/shipping.h
blob: e1c5ba521c99b958815fc5c95817a09044134255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <string.h>
#include <curl/curl.h>
#include "pikul.h"

struct shipping {
	enum pikul_company company;
	char *base;
	struct curl_slist *headers;
};

inline void headers(const char *fields[], char *provisions[], struct shipping *shipping)
{
	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);
	}
}