]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
make callback function private
authorBastian Dehn <hhaalo@arcor.de>
Mon, 22 Jan 2024 19:37:09 +0000 (20:37 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 22 Jan 2024 19:37:09 +0000 (20:37 +0100)
src/kds_s2000w_client.c
src/kds_s2000w_client.h

index da787e0b2aa6c7eb2666502a7c233cffac52858d..628fe64bcc79fffb0f645f3a0e25fa2bac724973 100644 (file)
@@ -3,7 +3,7 @@
 #include <curl/curl.h>
 #include "kds_s2000w_client.h"
 
-size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata)
+size_t kds_s2000w_client_callback(char *ptr, size_t size, size_t nmemb, void *userdata)
 {
        response* data = (response*) userdata;
        size_t fullsize = size * nmemb;
@@ -55,7 +55,7 @@ int kds_s2000w_client_open_session(const char* username, response* response)
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_POST, 1L);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
-       curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
+       curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
@@ -105,7 +105,7 @@ int kds_s2000w_client_get_option(int64_t sessionid, response* response)
 
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
-       curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
+       curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
index 79c85f7df2b7c30f67444afd5a6cb86f5cef84d7..ca0b123f73ecf76f476e0cafde1574a994ad40f9 100644 (file)
@@ -5,9 +5,6 @@ typedef struct {
        long code;
 } response;
 
-// TODO: private method
-size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata);
-
 response* kds_s2000w_client_response_init();
 void kds_s2000w_client_response_free(response* response);
 int kds_s2000w_client_open_session(const char* username, response* response);