diff options
Diffstat (limited to 'pikul.c')
-rw-r--r-- | pikul.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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); @@ -214,7 +225,8 @@ char *pikul_order(const char *order_number, const char *service, const char *sen #ifdef DEBUG fprintf(stderr, "POST: %s\n", shipping.post); #endif - } + } else + curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L); shipping.mode = ORDER; curl_easy_perform(curl); if (shipping.post) |