summaryrefslogtreecommitdiff
path: root/pikul.c
diff options
context:
space:
mode:
Diffstat (limited to 'pikul.c')
-rw-r--r--pikul.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pikul.c b/pikul.c
index 8a6b3c1..dfb6af8 100644
--- a/pikul.c
+++ b/pikul.c
@@ -16,6 +16,9 @@ void anteraja_order(const char *, const char *, const char *, const char *, cons
char **[], double);
void anteraja_cleanup();
+const char **sicepat_init(char *[]);
+const char **sicepat_services(const char *, const char *, double);
+
static void recurse(struct json_object *outer, const char *trail[], struct json_object **last)
{
struct json_object *inner = NULL;
@@ -116,6 +119,9 @@ void pikul_init(enum pikul_company company, char *provisions[])
case PIKUL_ANTERAJA:
fields = anteraja_init(provisions);
break;
+ case PIKUL_SICEPAT:
+ fields = sicepat_init(provisions);
+ break;
default:
break;
}
@@ -136,12 +142,17 @@ struct pikul_services *pikul_services(const char *origin, const char *destinatio
case PIKUL_ANTERAJA:
attributes = anteraja_services(origin, destination, weight);
break;
+ case PIKUL_SICEPAT:
+ attributes = sicepat_services(origin, destination, weight);
+ break;
default:
break;
}
curl_easy_setopt(curl, CURLOPT_URL, shipping.url);
if (shipping.post)
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, shipping.post);
+ else
+ curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
shipping.mode = SERVICES;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, attributes);
curl_easy_perform(curl);
@@ -211,6 +222,8 @@ char *pikul_order(const char *order_number, const char *service, const char *sen
curl_easy_setopt(curl, CURLOPT_URL, shipping.url);
if (shipping.post)
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, shipping.post);
+ else
+ curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
shipping.mode = ORDER;
curl_easy_perform(curl);
if (shipping.post)