summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-01-04 15:34:05 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-01-04 15:34:05 +0100
commit2e503441edc98dedb6c070be6b526e4264762586 (patch)
tree5502b876ad1d72707d5c36d225c15497b14e8332
parente45059214c432b41ae9926f8a64bfce917281fb1 (diff)
downloadcurl-2e503441edc98dedb6c070be6b526e4264762586.tar.gz
examples: added descriptions
-rw-r--r--docs/examples/multi-app.c8
-rw-r--r--docs/examples/postinmemory.c6
-rw-r--r--docs/examples/postit2.c6
-rw-r--r--docs/examples/progressfunc.c7
-rw-r--r--docs/examples/resolve.c7
-rw-r--r--docs/examples/rtsp.c4
-rw-r--r--docs/examples/sampleconv.c11
-rw-r--r--docs/examples/sendrecv.c15
-rw-r--r--docs/examples/sepheaders.c6
-rw-r--r--docs/examples/sessioninfo.c6
-rw-r--r--docs/examples/sftpget.c6
-rw-r--r--docs/examples/simplepost.c6
-rw-r--r--docs/examples/simplessl.c6
-rw-r--r--docs/examples/smooth-gtk-thread.c9
-rw-r--r--docs/examples/synctime.c6
-rw-r--r--docs/examples/threaded-ssl.c7
-rw-r--r--docs/examples/url2file.c6
-rw-r--r--docs/examples/usercertinmem.c9
-rw-r--r--docs/examples/xmlstream.c9
19 files changed, 111 insertions, 29 deletions
diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c
index b8258975e..065d48d92 100644
--- a/docs/examples/multi-app.c
+++ b/docs/examples/multi-app.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,7 +19,11 @@
* KIND, either express or implied.
*
***************************************************************************/
-/* This is an example application source code using the multi interface. */
+/* <DESC>
+ * A basic application source code using the multi interface doing two
+ * transfers in parallel. */
+* </DESC>
+ */
#include <stdio.h>
#include <string.h>
diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c
index 3afac4b2f..edeb84e69 100644
--- a/docs/examples/postinmemory.c
+++ b/docs/examples/postinmemory.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Make a HTTP POST with data from memory and receive response in memory.
+ * </DESC>
+ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c
index 88ea78c86..0f8dd98bb 100644
--- a/docs/examples/postit2.c
+++ b/docs/examples/postit2.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * HTTP Multipart formpost with file upload and two additional parts.
+ * </DESC>
+ */
/* 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 b2635bc8a..9789762e0 100644
--- a/docs/examples/progressfunc.c
+++ b/docs/examples/progressfunc.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,11 @@
* KIND, either express or implied.
*
***************************************************************************/
+/* <DESC>
+ * Use the progress callbacks, old and/or new one depending on avaiable
+ * libcurl version.
+ * </DESC>
+ */
#include <stdio.h>
#include <curl/curl.h>
diff --git a/docs/examples/resolve.c b/docs/examples/resolve.c
index 7b3e5656e..cc58bebba 100644
--- a/docs/examples/resolve.c
+++ b/docs/examples/resolve.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,11 @@
* KIND, either express or implied.
*
***************************************************************************/
+/* <DESC>
+ * Use CURLOPT_RESOLVE to feed custom IP addresses for given host name + port
+ * number combinations.
+ * </DESC>
+ */
#include <stdio.h>
#include <curl/curl.h>
diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c
index fed343dfd..581f7339f 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.
*
*/
+/* <DESC>
+ * A basic RTSP transfer
+ * </DESC>
+ */
#include <stdio.h>
#include <stdlib.h>
diff --git a/docs/examples/sampleconv.c b/docs/examples/sampleconv.c
index 3db316096..466c40cc7 100644
--- a/docs/examples/sampleconv.c
+++ b/docs/examples/sampleconv.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,10 +19,13 @@
* KIND, either express or implied.
*
***************************************************************************/
+/* <DESC>
+ * 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.
+ * </DESC>
+ */
/*
- 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 88fddf59f..9bc2371ca 100644
--- a/docs/examples/sendrecv.c
+++ b/docs/examples/sendrecv.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,7 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
-/* An example of curl_easy_send() and curl_easy_recv() usage. */
+/* <DESC>
+ * An example of curl_easy_send() and curl_easy_recv() usage.
+ * </DESC>
+ */
#include <stdio.h>
#include <string.h>
@@ -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 7402e3542..94cbd909c 100644
--- a/docs/examples/sepheaders.c
+++ b/docs/examples/sepheaders.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Simple HTTP GET that stores the headers in a separate file
+ * </DESC>
+ */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c
index 2641c7139..94e8884c9 100644
--- a/docs/examples/sessioninfo.c
+++ b/docs/examples/sessioninfo.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Uses the CURLINFO_TLS_SESSION data.
+ * </DESC>
+ */
/* 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 434299dc0..dec91fde9 100644
--- a/docs/examples/sftpget.c
+++ b/docs/examples/sftpget.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Gets a file using an SFTP URL.
+ * </DESC>
+ */
#include <stdio.h>
diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c
index 8657771f4..985d7397f 100644
--- a/docs/examples/simplepost.c
+++ b/docs/examples/simplepost.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Very simple HTTP POST
+ * </DESC>
+ */
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c
index aefb79f62..509f1aaa0 100644
--- a/docs/examples/simplessl.c
+++ b/docs/examples/simplessl.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Shows HTTPS usage with client certs and optional ssl engine use.
+ * </DESC>
+ */
#include <stdio.h>
#include <curl/curl.h>
diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c
index 932f6e396..a367da05b 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, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,12 @@
* KIND, either express or implied.
*
***************************************************************************/
-/* This is a multi threaded application that uses a progress bar to show
+/* <DESC>
+ * A multi threaded application that uses a progress bar to show
* status. It uses Gtk+ to make a smooth pulse.
- *
+ * </DESC>
+ */
+/*
* 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 cd7d0731b..69535ca1c 100644
--- a/docs/examples/synctime.c
+++ b/docs/examples/synctime.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Set your system time from a remote HTTP server's Date: header.
+ * </DESC>
+ */
/* 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 a7e9c2de1..d73766ac0 100644
--- a/docs/examples/threaded-ssl.c
+++ b/docs/examples/threaded-ssl.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,11 @@
* KIND, either express or implied.
*
***************************************************************************/
+/* <DESC>
+ * Show the required mutex callback setups for GnuTLS and OpenSSL when using
+ * libcurl multi-threaded.
+ * </DESC>
+ */
/* 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 adf696c9a..a357a3120 100644
--- a/docs/examples/url2file.c
+++ b/docs/examples/url2file.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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>
+ * Download a given URL into a local file named page.out.
+ * </DESC>
+ */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c
index dd56c6167..43716eaee 100644
--- a/docs/examples/usercertinmem.c
+++ b/docs/examples/usercertinmem.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2013 - 2016, 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,10 +19,13 @@
* KIND, either express or implied.
*
***************************************************************************/
+/* <DESC>
/* 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
+ * </DESC>
+ */
+/* 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 819344502..1b3c6b6bd 100644
--- a/docs/examples/xmlstream.c
+++ b/docs/examples/xmlstream.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, 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,11 @@
* KIND, either express or implied.
*
***************************************************************************/
-/* Stream-parse a document using the streaming Expat parser.
- * Written by David Strauss
+/* <DESC>
+ * Stream-parse a document using the streaming Expat parser.
+ * </DESC>
+ */
+/* Written by David Strauss
*
* Expat => http://www.libexpat.org/
*