diff options
Diffstat (limited to 'docs/examples/ftp-wildcard.c')
-rw-r--r-- | docs/examples/ftp-wildcard.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c index 0186a38a..d175ddfd 100644 --- a/docs/examples/ftp-wildcard.c +++ b/docs/examples/ftp-wildcard.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ #include <curl/curl.h> #include <stdio.h> @@ -14,14 +26,14 @@ struct callback_data { FILE *output; }; -static long file_is_comming(struct curl_fileinfo *finfo, - struct callback_data *data, - int remains); +static long file_is_coming(struct curl_fileinfo *finfo, + struct callback_data *data, + int remains); static long file_is_downloaded(struct callback_data *data); static size_t write_it(char *buff, size_t size, size_t nmemb, - struct callback_data *data); + void *cb_data); int main(int argc, char **argv) { @@ -49,7 +61,7 @@ int main(int argc, char **argv) curl_easy_setopt(handle, CURLOPT_WILDCARDMATCH, 1L); /* callback is called before download of concrete file started */ - curl_easy_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, file_is_comming); + curl_easy_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, file_is_coming); /* callback is called after data from the file have been transferred */ curl_easy_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded); @@ -77,9 +89,9 @@ int main(int argc, char **argv) return rc; } -static long file_is_comming(struct curl_fileinfo *finfo, - struct callback_data *data, - int remains) +static long file_is_coming(struct curl_fileinfo *finfo, + struct callback_data *data, + int remains) { printf("%3d %40s %10luB ", remains, finfo->filename, (unsigned long)finfo->size); @@ -123,8 +135,9 @@ static long file_is_downloaded(struct callback_data *data) } static size_t write_it(char *buff, size_t size, size_t nmemb, - struct callback_data *data) + void *cb_data) { + struct callback_data *data = cb_data; size_t written = 0; if(data->output) written = fwrite(buff, size, nmemb, data->output); |