From: Daniel Stenberg Date: Mon, 4 Jan 2016 14:34:05 +0000 (+0100) Subject: examples: added descriptions X-Git-Tag: curl-7_47_0~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e503441edc98dedb6c070be6b526e4264762586;p=thirdparty%2Fcurl.git examples: added descriptions --- diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index b8258975e7..065d48d921 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,7 +19,11 @@ * KIND, either express or implied. * ***************************************************************************/ -/* This is an example application source code using the multi interface. */ +/* + * A basic application source code using the multi interface doing two + * transfers in parallel. */ +* + */ #include #include diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index 3afac4b2f4..edeb84e692 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Make a HTTP POST with data from memory and receive response in memory. + * + */ #include #include #include diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index 88ea78c866..0f8dd98bbd 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * HTTP Multipart formpost with file upload and two additional parts. + * + */ /* Example code that uploads a file name 'foo' to a remote script that accepts * "HTML form based" (as described in RFC1738) uploads using HTTP POST. * diff --git a/docs/examples/progressfunc.c b/docs/examples/progressfunc.c index b2635bc8ae..9789762e0d 100644 --- a/docs/examples/progressfunc.c +++ b/docs/examples/progressfunc.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,11 @@ * KIND, either express or implied. * ***************************************************************************/ +/* + * Use the progress callbacks, old and/or new one depending on avaiable + * libcurl version. + * + */ #include #include diff --git a/docs/examples/resolve.c b/docs/examples/resolve.c index 7b3e5656e0..cc58bebba7 100644 --- a/docs/examples/resolve.c +++ b/docs/examples/resolve.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,11 @@ * KIND, either express or implied. * ***************************************************************************/ +/* + * Use CURLOPT_RESOLVE to feed custom IP addresses for given host name + port + * number combinations. + * + */ #include #include diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c index fed343dfd6..581f7339fb 100644 --- a/docs/examples/rtsp.c +++ b/docs/examples/rtsp.c @@ -27,6 +27,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +/* + * A basic RTSP transfer + * + */ #include #include diff --git a/docs/examples/sampleconv.c b/docs/examples/sampleconv.c index 3db316096c..466c40cc7b 100644 --- a/docs/examples/sampleconv.c +++ b/docs/examples/sampleconv.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,10 +19,13 @@ * KIND, either express or implied. * ***************************************************************************/ +/* + * This is a simple example showing how a program on a non-ASCII platform + * would invoke callbacks to do its own codeset conversions instead of + * using the built-in iconv functions in libcurl. + * + */ /* - This is a simple example showing how a program on a non-ASCII platform - would invoke callbacks to do its own codeset conversions instead of - using the built-in iconv functions in libcurl. The IBM-1047 EBCDIC codeset is used for this example but the code would be similar for other non-ASCII codesets. diff --git a/docs/examples/sendrecv.c b/docs/examples/sendrecv.c index 88fddf59f8..9bc2371caf 100644 --- a/docs/examples/sendrecv.c +++ b/docs/examples/sendrecv.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,7 +19,10 @@ * KIND, either express or implied. * ***************************************************************************/ -/* An example of curl_easy_send() and curl_easy_recv() usage. */ +/* + * An example of curl_easy_send() and curl_easy_recv() usage. + * + */ #include #include @@ -66,6 +69,14 @@ int main(void) size_t iolen; curl_off_t nread; + /* A general note of caution here: if you're using curl_easy_recv() or + curl_easy_send() to implement HTTP or _any_ other protocol libcurl + supports "natively", you're doing it wrong and you should stop. + + This example uses HTTP only to show how to use this API, it does not + suggest that writing an application doing this is sensible. + */ + curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index 7402e3542d..94cbd909cc 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Simple HTTP GET that stores the headers in a separate file + * + */ #include #include #include diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index 2641c7139f..94e8884c95 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Uses the CURLINFO_TLS_SESSION data. + * + */ /* Note that this example currently requires cURL to be linked against GnuTLS (and this program must also be linked against -lgnutls). */ diff --git a/docs/examples/sftpget.c b/docs/examples/sftpget.c index 434299dc08..dec91fde95 100644 --- a/docs/examples/sftpget.c +++ b/docs/examples/sftpget.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Gets a file using an SFTP URL. + * + */ #include diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c index 8657771f46..985d7397f4 100644 --- a/docs/examples/simplepost.c +++ b/docs/examples/simplepost.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Very simple HTTP POST + * + */ #include #include #include diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c index aefb79f624..509f1aaa0f 100644 --- a/docs/examples/simplessl.c +++ b/docs/examples/simplessl.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Shows HTTPS usage with client certs and optional ssl engine use. + * + */ #include #include diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c index 932f6e3963..a367da05b2 100644 --- a/docs/examples/smooth-gtk-thread.c +++ b/docs/examples/smooth-gtk-thread.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,12 @@ * KIND, either express or implied. * ***************************************************************************/ -/* This is a multi threaded application that uses a progress bar to show +/* + * A multi threaded application that uses a progress bar to show * status. It uses Gtk+ to make a smooth pulse. - * + * + */ +/* * Written by Jud Bishop after studying the other examples provided with * libcurl. * diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c index cd7d0731be..69535ca1c5 100644 --- a/docs/examples/synctime.c +++ b/docs/examples/synctime.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Set your system time from a remote HTTP server's Date: header. + * + */ /* This example code only builds as-is on Windows. * * While Unix/Linux user, you do not need this software. diff --git a/docs/examples/threaded-ssl.c b/docs/examples/threaded-ssl.c index a7e9c2de16..d73766ac06 100644 --- a/docs/examples/threaded-ssl.c +++ b/docs/examples/threaded-ssl.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,11 @@ * KIND, either express or implied. * ***************************************************************************/ +/* + * Show the required mutex callback setups for GnuTLS and OpenSSL when using + * libcurl multi-threaded. + * + */ /* A multi-threaded example that uses pthreads and fetches 4 remote files at * once over HTTPS. The lock callbacks and stuff assume OpenSSL or GnuTLS * (libgcrypt) so far. diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c index adf696c9a1..a357a3120e 100644 --- a/docs/examples/url2file.c +++ b/docs/examples/url2file.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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. * ***************************************************************************/ +/* + * Download a given URL into a local file named page.out. + * + */ #include #include #include diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index dd56c6167e..43716eaeea 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2013, Daniel Stenberg, , et al. + * Copyright (C) 2013 - 2016, Daniel Stenberg, , 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,10 +19,13 @@ * KIND, either express or implied. * ***************************************************************************/ +/* /* Example using an in memory PEM user certificate and RSA key to retrieve an * https page. - * Written by Ishan SinghLevett, based on Theo Borm's cacertinmem.c. - * Note that to maintain simplicity this example does not use a CA certificate + * + */ +/* Written by Ishan SinghLevett, based on Theo Borm's cacertinmem.c. + * Note that to maintain simplicity this example does not use a CA certificate * for peer verification. However, some form of peer verification * must be used in real circumstances when a secure connection is required. */ diff --git a/docs/examples/xmlstream.c b/docs/examples/xmlstream.c index 8193445027..1b3c6b6bdd 100644 --- a/docs/examples/xmlstream.c +++ b/docs/examples/xmlstream.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, , 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,11 @@ * KIND, either express or implied. * ***************************************************************************/ -/* Stream-parse a document using the streaming Expat parser. - * Written by David Strauss +/* + * Stream-parse a document using the streaming Expat parser. + * + */ +/* Written by David Strauss * * Expat => http://www.libexpat.org/ *