return resp;
}
-void kds_s2000w_client_response_free(response* response)
+void kds_s2000w_client_response_free(response* resp)
{
debug_printf(ALL, "kds_s2000w_client_response_free");
- if (response == NULL)
+ if (resp == NULL)
return;
- free(response->error_status);
- response->error_status = NULL;
- free(response->data);
- response->data = NULL;
- free(response);
- response = NULL;
+ free(resp->error_status);
+ resp->error_status = NULL;
+ free(resp->data);
+ resp->data = NULL;
+ free(resp);
+ resp = NULL;
}
void kds_s2000w_client_init()
curl = NULL;
}
-int kds_s2000w_client_open_session(response* response)
+int kds_s2000w_client_open_session(response* resp)
{
debug_printf(ALL, "kds_s2000w_client_open_session");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
header_str = NULL;
}
-int kds_s2000w_client_status_session(int64_t sessionid, response* response)
+int kds_s2000w_client_status_session(int64_t sessionid, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_status_session");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_start_scan(int64_t sessionid, response* response)
+int kds_s2000w_client_start_scan(int64_t sessionid, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_start_scan");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_stop_scan(int64_t sessionid, response* response)
+int kds_s2000w_client_stop_scan(int64_t sessionid, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_stop_scan");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* response)
+int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_get_image");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response* response)
+int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_delete_image");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_get_capabilities(response* response)
+int kds_s2000w_client_get_capabilities(response* resp)
{
debug_printf(ALL, "kds_s2000w_client_get_capabilities");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_get_option(int64_t sessionid, response* response)
+int kds_s2000w_client_get_option(int64_t sessionid, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_get_option");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
fflush(stream);
- _kds_s2000w_client_stream_to_response(stream, response, sizeloc);
+ _kds_s2000w_client_stream_to_response(stream, resp, sizeloc);
fclose(stream);
curl_url_cleanup(url_handler);
return result;
}
-int kds_s2000w_client_set_option(int64_t sessionid, response* response)
+int kds_s2000w_client_set_option(int64_t sessionid, response* resp)
{
debug_printf(ALL, "kds_s2000w_client_set_option");
headers = curl_slist_append(headers, ACCEPT_JSON_HEADER);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, response->data);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, response->size);
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, resp->data);
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, resp->size);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
_kds_s2000w_client_set_ssl_verification_off(curl);
CURLcode result = curl_easy_perform(curl);
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
+ curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
- _kds_s2000w_client_read_error_status(curl, response);
+ _kds_s2000w_client_read_error_status(curl, resp);
_kds_s2000w_client_print_error_result(result);
curl_url_cleanup(url_handler);