This commit is contained in:
Daniel Stenberg 2015-06-18 11:38:54 +02:00
Родитель 26583a62ab
Коммит 0e7d76d6a8
19 изменённых файлов: 90 добавлений и 72 удалений

Просмотреть файл

@ -5,9 +5,12 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft
*/
/* <DESC>
* use the libcurl in a gtk-threaded application
* </DESC>
*/
/* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft */
/* an attempt to use the curl library in concert with a gtk-threaded application */
#include <stdio.h>
#include <gtk/gtk.h>

Просмотреть файл

@ -9,7 +9,10 @@
certificate presented during ssl session establishment.
*/
/* <DESC>
* demonstrates use of SSL context callback, requires OpenSSL
* </DESC>
*/
/*
* Copyright (c) 2003 The OpenEvidence Project. All rights reserved.

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* multi socket interface together with libev
* </DESC>
*/
/* Example application source code using the multi socket interface to
* download many files at once.
*

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,9 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/*
* This is an example demonstrating how an application can pass in a custom
/* <DESC>
* An example demonstrating how an application can pass in a custom
* socket to libcurl to use. This example also handles the connect itself.
* </DESC>
*/
#include <stdio.h>
#include <string.h>

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Upload to a file:// URL
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
#include <sys/stat.h>

Просмотреть файл

@ -42,6 +42,10 @@
*
* This example requires libcurl 7.9.7 or later.
*/
/* <DESC>
* implements an fopen() abstraction allowing reading from URLs
* </DESC>
*/
#include <stdio.h>
#include <string.h>

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* FTP wildcard pattern matching
* </DESC>
*/
#include <curl/curl.h>
#include <stdio.h>

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -23,11 +23,9 @@
#include <curl/curl.h>
/*
* This is an example showing how to get a single file from an FTP server.
* It delays the actual destination file creation until the first write
* callback so that it won't create an empty file in case the remote file
* doesn't exist or something else fails.
/* <DESC>
* Get a single file from an FTP server.
* </DESC>
*/
struct FtpFile {

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -24,9 +24,9 @@
#include <curl/curl.h>
/*
* This is an example showing how to check a single file's size and mtime
* from an FTP server.
/* <DESC>
* Checks a single file's size and mtime from an FTP server.
* </DESC>
*/
static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -23,13 +23,11 @@
#include <curl/curl.h>
/*
* Similar to ftpget.c but this also stores the received response-lines
/* <DESC>
* Similar to ftpget.c but also stores the received response-lines
* in a separate file using our own callback!
*
* This functionality was introduced in libcurl 7.9.3.
* </DESC>
*/
static size_t
write_response(void *ptr, size_t size, size_t nmemb, void *data)
{

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -24,11 +24,9 @@
#include <curl/curl.h>
/*
* This is an example showing how to get a single file from an FTPS server.
* It delays the actual destination file creation until the first write
* callback so that it won't create an empty file in case the remote file
* doesn't exist or something else fails.
/* <DESC>
* Get a single file from an FTPS server.
* </DESC>
*/
struct FtpFile {

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -33,11 +33,10 @@
#include <unistd.h>
#endif
/*
* This example shows an FTP upload, with a rename of the file just after
* a successful upload.
*
* Example based on source code provided by Erick Nuwendam. Thanks!
/* <DESC>
* Performs an FTP upload and renames the file just after a successful
* transfer.
* </DESC>
*/
#define LOCAL_FILE "/tmp/uploadthis.txt"

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,13 +19,9 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Upload to FTP, resuming failed transfers
*
* Compile for MinGW like this:
* gcc -Wall -pedantic -std=c99 ftpuploadwithresume.c -o ftpuploadresume.exe
* -lcurl -lmsvcr70
*
* Written by Philip Bock
/* <DESC>
* Upload to FTP, resuming failed transfers.
* </DESC>
*/
#include <stdlib.h>

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Use getinfo to get content-type after completed transfer.
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
@ -27,18 +31,14 @@ int main(void)
CURL *curl;
CURLcode res;
/* http://curl.haxx.se/libcurl/c/curl_easy_init.html */
curl = curl_easy_init();
if(curl) {
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
char *ct;
/* ask for the content-type */
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
if((CURLE_OK == res) && ct)
@ -46,7 +46,6 @@ int main(void)
}
/* always cleanup */
/* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */
curl_easy_cleanup(curl);
}
return 0;

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,8 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Example source code to show how the callback function can be used to
* download data into a chunk of memory instead of storing it in a file.
/* <DESC>
* Shows how the write callback function can be used to download data into a
* chunk of memory instead of storing it in a file.
* </DESC>
*/
#include <stdio.h>
@ -34,7 +36,6 @@ struct MemoryStruct {
size_t size;
};
static size_t
WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
@ -55,7 +56,6 @@ WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
return realsize;
}
int main(void)
{
CURL *curl_handle;

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* multi socket API usage together with with glib2
* </DESC>
*/
/* Example application source code using the multi socket interface to
* download many files at once.
*

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* multi socket API usage with libevent 2
* </DESC>
*/
/* Example application source code using the multi socket interface to
download many files at once.

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2012 - 2015, 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
@ -20,13 +20,13 @@
*
***************************************************************************/
/* <DESC>
* Uses the "Streaming HTML parser" to extract the href pieces in a streaming
* manner from a downloaded HTML.
* </DESC>
*/
/*
* This example uses the "Streaming HTML parser" to extract the href pieces in
* a streaming manner from a downloaded HTML. Kindly donated by Michał
* Kowalczyk.
*
* The parser is found at
* http://code.google.com/p/htmlstreamparser/
* The HTML parser is found at http://code.google.com/p/htmlstreamparser/
*/
#include <stdio.h>

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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
@ -19,13 +19,12 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Download a document and use libtidy to parse the HTML.
* Written by Jeff Pohlmeyer
*
/* <DESC>
* Download a document and use libtidy to parse the HTML.
* </DESC>
*/
/*
* LibTidy => http://tidy.sourceforge.net
*
* gcc -Wall -I/usr/local/include tidycurl.c -lcurl -ltidy -o tidycurl
*
*/
#include <stdio.h>