summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-06-18 11:38:54 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-06-18 11:38:54 +0200
commit0e7d76d6a87bbae77af0bf37bed4428748295a44 (patch)
tree6c73211575ba8e2e10e5cc147c954bd2337eab78
parent26583a62ab8f29f672f91932b81c595f33c72b9f (diff)
downloadcurl-0e7d76d6a87bbae77af0bf37bed4428748295a44.tar.gz
examples: more descriptions
-rw-r--r--docs/examples/curlgtk.c7
-rw-r--r--docs/examples/curlx.c5
-rw-r--r--docs/examples/evhiperfifo.c6
-rw-r--r--docs/examples/externalsocket.c7
-rw-r--r--docs/examples/fileupload.c6
-rw-r--r--docs/examples/fopen.c4
-rw-r--r--docs/examples/ftp-wildcard.c6
-rw-r--r--docs/examples/ftpget.c10
-rw-r--r--docs/examples/ftpgetinfo.c8
-rw-r--r--docs/examples/ftpgetresp.c10
-rw-r--r--docs/examples/ftpsget.c10
-rw-r--r--docs/examples/ftpupload.c11
-rw-r--r--docs/examples/ftpuploadresume.c12
-rw-r--r--docs/examples/getinfo.c11
-rw-r--r--docs/examples/getinmemory.c10
-rw-r--r--docs/examples/ghiper.c6
-rw-r--r--docs/examples/hiperfifo.c6
-rw-r--r--docs/examples/href_extractor.c14
-rw-r--r--docs/examples/htmltidy.c13
19 files changed, 90 insertions, 72 deletions
diff --git a/docs/examples/curlgtk.c b/docs/examples/curlgtk.c
index 8cb9914c6..df6b419f2 100644
--- a/docs/examples/curlgtk.c
+++ b/docs/examples/curlgtk.c
@@ -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>
diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c
index c68cf0ddb..9bfb0cbd8 100644
--- a/docs/examples/curlx.c
+++ b/docs/examples/curlx.c
@@ -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.
diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c
index e03801d8c..5a60c8d2c 100644
--- a/docs/examples/evhiperfifo.c
+++ b/docs/examples/evhiperfifo.c
@@ -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.
*
diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c
index 5486d1255..cae5ccc72 100644
--- a/docs/examples/externalsocket.c
+++ b/docs/examples/externalsocket.c
@@ -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>
diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c
index 665eca0af..b695a2a61 100644
--- a/docs/examples/fileupload.c
+++ b/docs/examples/fileupload.c
@@ -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>
diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c
index 0aad0abf5..de9ce19a6 100644
--- a/docs/examples/fopen.c
+++ b/docs/examples/fopen.c
@@ -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>
diff --git a/docs/examples/ftp-wildcard.c b/docs/examples/ftp-wildcard.c
index d175ddfdc..ae0855cb8 100644
--- a/docs/examples/ftp-wildcard.c
+++ b/docs/examples/ftp-wildcard.c
@@ -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>
diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c
index 285283f72..8ec7d7336 100644
--- a/docs/examples/ftpget.c
+++ b/docs/examples/ftpget.c
@@ -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 {
diff --git a/docs/examples/ftpgetinfo.c b/docs/examples/ftpgetinfo.c
index dfdcf78b7..baea7d8e1 100644
--- a/docs/examples/ftpgetinfo.c
+++ b/docs/examples/ftpgetinfo.c
@@ -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)
diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c
index dcb296adf..76c512bb3 100644
--- a/docs/examples/ftpgetresp.c
+++ b/docs/examples/ftpgetresp.c
@@ -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)
{
diff --git a/docs/examples/ftpsget.c b/docs/examples/ftpsget.c
index dae453482..2c1fd3e99 100644
--- a/docs/examples/ftpsget.c
+++ b/docs/examples/ftpsget.c
@@ -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 {
diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c
index e79f8d842..b4fc79f99 100644
--- a/docs/examples/ftpupload.c
+++ b/docs/examples/ftpupload.c
@@ -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"
diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c
index 55b8986c7..1a24f7cbd 100644
--- a/docs/examples/ftpuploadresume.c
+++ b/docs/examples/ftpuploadresume.c
@@ -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>
diff --git a/docs/examples/getinfo.c b/docs/examples/getinfo.c
index acbe1e1af..7f578df43 100644
--- a/docs/examples/getinfo.c
+++ b/docs/examples/getinfo.c
@@ -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;
diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c
index a1c21404d..2cf201e96 100644
--- a/docs/examples/getinmemory.c
+++ b/docs/examples/getinmemory.c
@@ -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;
diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c
index 7571ffa3d..0621d3eef 100644
--- a/docs/examples/ghiper.c
+++ b/docs/examples/ghiper.c
@@ -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.
*
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c
index 84035aa2c..63614f7d4 100644
--- a/docs/examples/hiperfifo.c
+++ b/docs/examples/hiperfifo.c
@@ -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.
diff --git a/docs/examples/href_extractor.c b/docs/examples/href_extractor.c
index c11325d2e..f2c324e3c 100644
--- a/docs/examples/href_extractor.c
+++ b/docs/examples/href_extractor.c
@@ -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>
diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c
index a36e331bf..c1d9508da 100644
--- a/docs/examples/htmltidy.c
+++ b/docs/examples/htmltidy.c
@@ -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>