diff options
-rw-r--r-- | anteraja.c | 4 | ||||
-rw-r--r-- | handler.h | 6 | ||||
-rw-r--r-- | pikul.c | 10 |
3 files changed, 10 insertions, 10 deletions
@@ -146,14 +146,14 @@ void anteraja_order(const char *order_number, const char *service, const char *s curl_easy_setopt(curl, CURLOPT_POSTFIELDS, *post); } -size_t anteraja_order_handle(const char *contents, size_t size, size_t nmemb, char **waybill) +size_t anteraja_order_handle(const char *contents, size_t size, size_t nmemb, char **tracking_number) { size_t realsize = size * nmemb; handle(ORDER, contents, realsize, status_trail, (const char *[]){ "content", "waybill_no", NULL - }, NULL, waybill); + }, NULL, tracking_number); return realsize; } @@ -75,9 +75,9 @@ inline void handle(enum type type, const char *contents, size_t num_bytes, const ; struct json_object *string = NULL; recurse(response, trail, &string); - char **waybill = (char **)data; - *waybill = malloc(json_object_get_string_len(string) + 1); - strcpy(*waybill, json_object_get_string(string)); + char **tracking_number = (char **)data; + *tracking_number = malloc(json_object_get_string_len(string) + 1); + strcpy(*tracking_number, json_object_get_string(string)); break; default: break; @@ -4,7 +4,7 @@ CURL *curl; json_tokener *tokener; struct shipping shipping; -static char *waybill = NULL; +static char *tracking_number = NULL; extern inline void headers(const char *[], char *[]); extern inline void handle(enum type, const char *, size_t, const char *[], const char *[], const char *[], @@ -118,7 +118,7 @@ char *pikul_order(const char *order_number, const char *service, const char *sen const char *destination, const char *receiver_address, const char *receiver_postal, int nitems, char **items[], _Bool insurance, double subtotal) { - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &waybill); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &tracking_number); char *url; char *post = NULL; size_t (*handler)(const char *, size_t, size_t, char **); @@ -139,7 +139,7 @@ char *pikul_order(const char *order_number, const char *service, const char *sen if (post) free(post); free(url); - return waybill; + return tracking_number; } void pikul_cleanup() @@ -151,8 +151,8 @@ void pikul_cleanup() default: break; } - if (waybill) - free(waybill); + if (tracking_number) + free(tracking_number); free(shipping.base); json_tokener_free(tokener); curl_slist_free_all(shipping.headers); |