#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;
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);
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);
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);