Remove callbacks-related hacks from samples/libcurl

This commit is contained in:
Svyatoslav Scherbina
2017-04-20 12:39:35 +03:00
committed by SvyatoslavScherbina
parent 3f84ba462f
commit c0b40ffedb
4 changed files with 3 additions and 8 deletions
-5
View File
@@ -1,5 +0,0 @@
#include <stddef.h>
// Those types are needed but not defined or used in libcurl headers.
typedef size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata);
typedef size_t write_data_callback(void *buffer, size_t size, size_t nmemb, void *userp);
+1 -1
View File
@@ -1,2 +1,2 @@
headers = curl/curl.h callbacks.h
headers = curl/curl.h
excludedFunctions = zopen pfctlinput
@@ -10,7 +10,7 @@ class CUrl(val url: String) {
init {
curl_easy_setopt(curl, CURLOPT_URL, url)
val header: CPointer<header_callback> = staticCFunction(::header_callback)
val header = staticCFunction(::header_callback)
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header)
curl_easy_setopt(curl, CURLOPT_HEADERDATA, stablePtr.value)
}
@@ -12,7 +12,7 @@ fun main(args: Array<String>) {
curl.close()
/*
val write_data: CPointer<write_data_callback> = staticCFunction(::write_data)
val write_data = staticCFunction(::write_data)
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
*/
}