summaryrefslogtreecommitdiff
path: root/shipping.h
blob: dc7d7df1a886b45ff28304662f76e0b41dcd9c54 (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(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);
	}
}