VuoUrlFetch implementation.
Definition in file VuoUrlFetch.c.
Go to the source code of this file.
Classes | |
struct | VuoUrl_curlBuffer |
A memory buffer, filled by VuoUrl_curlCallback() . More... | |
Functions | |
__attribute__ ((constructor)) | |
Initializes the cURL library. More... | |
static size_t | VuoUrl_curlCallback (void *contents, size_t size, size_t nmemb, void *userp) |
Reads the contents of the URL into a memory buffer. More... | |
void | VuoUrlFetch_convertToUTF8 (struct VuoUrl_curlBuffer *buffer, CFStringEncoding sourceEncoding) |
Converts buffer from sourceEncoding to UTF-8. More... | |
bool | VuoUrl_fetch (const char *url, void **data, unsigned int *dataLength) |
Receives the data at the specified url . More... | |
__attribute__ | ( | (constructor) | ) |
Initializes the cURL library.
Definition at line 39 of file VuoUrlFetch.c.
|
static |
Reads the contents of the URL into a memory buffer.
A callback function for use by curl_easy_setopt()
.
Definition at line 57 of file VuoUrlFetch.c.
bool VuoUrl_fetch | ( | const char * | url, |
void ** | data, | ||
unsigned int * | dataLength | ||
) |
Receives the data at the specified url
.
The caller is responsible for free()
ing the data.
data
includes an extra trailing NULL terminator byte (not counted in dataLength
), to make it easier to work with URLs containing plain text.
Definition at line 117 of file VuoUrlFetch.c.
void VuoUrlFetch_convertToUTF8 | ( | struct VuoUrl_curlBuffer * | buffer, |
CFStringEncoding | sourceEncoding | ||
) |
Converts buffer
from sourceEncoding
to UTF-8.
Definition at line 79 of file VuoUrlFetch.c.