85 write_callback(
char *
buffer,
104 fprintf(stderr,
"callback buffer grow failed\n");
156 rc =
select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
182 curl_use_buffer(
URL_FILE *file,
int want)
336 curl_fill_buffer(file,want,1);
348 memcpy(ptr, file->
buffer, want);
350 curl_use_buffer(file,want);
380 curl_fill_buffer(file,want,1);
393 for(loop=0;loop < want;loop++)
395 if(file->
buffer[loop] ==
'\n')
403 memcpy(ptr, file->
buffer, want);
406 curl_use_buffer(file,want);
469 url=
"http://192.168.7.3/testfile";
477 outf=fopen(
"fgets.test",
"w+");
480 perror(
"couldnt open fgets output file\n");
487 printf(
"couldn't url_fopen()\n");
495 fwrite(buffer,1,strlen(buffer),outf);
504 outf=fopen(
"fread.test",
"w+");
507 perror(
"couldnt open fread output file\n");
513 printf(
"couldn't url_fopen()\n");
519 nread =
url_fread(buffer, 1,
sizeof(buffer), handle);
520 fwrite(buffer,1,nread,outf);
529 outf=fopen(
"rewind.test",
"w+");
532 perror(
"couldnt open fread output file\n");
538 printf(
"couldn't url_fopen()\n");
543 nread =
url_fread(buffer, 1,
sizeof(buffer), handle);
544 fwrite(buffer,1,nread,outf);
550 nread =
url_fread(buffer, 1,
sizeof(buffer), handle);
551 fwrite(buffer,1,nread,outf);
void url_rewind(URL_FILE *file)
CURLMcode curl_multi_fdset(CURLM *multi_handle, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd_set, int *max_fd)
int url_fclose(URL_FILE *file)
CURLcode curl_easy_setopt(CURL *curl, CURLoption option,...)
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_handle)
union fcurl_data::@0 handle
CURLM * curl_multi_init(void)
CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
char * url_fgets(char *ptr, int size, URL_FILE *file)
int url_feof(URL_FILE *file)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *curl_handle)
URL_FILE * url_fopen(char *url, const char *operation)
void curl_easy_cleanup(CURL *curl)
#define CURLOPT_WRITEDATA
int main(int argc, char *argv[])
CURL * curl_easy_init(void)