summaryrefslogtreecommitdiff
path: root/docs/libcurl/opts/CURLOPT_XFERINFODATA.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-09-01 09:23:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-09-04 11:27:04 +0200
commit1731a77989230c117bc687937eec9d0bb488d0cc (patch)
treeb10083c7188c22d59eb4ada24f45c345ab00b104 /docs/libcurl/opts/CURLOPT_XFERINFODATA.3
parentc8210ef06df2bc7e3ecd2d0c389e664450b3a00c (diff)
downloadcurl-1731a77989230c117bc687937eec9d0bb488d0cc.tar.gz
opt-docs: make sure all man pages have examples
Extended manpage-syntax.pl (run by test 1173) to check that every man page for a libcurl option has an EXAMPLE section that is more than two lines. Then fixed all errors it found and added examples. Reviewed-by: Daniel Gustafsson Closes #7656
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_XFERINFODATA.3')
-rw-r--r--docs/libcurl/opts/CURLOPT_XFERINFODATA.329
1 files changed, 27 insertions, 2 deletions
diff --git a/docs/libcurl/opts/CURLOPT_XFERINFODATA.3 b/docs/libcurl/opts/CURLOPT_XFERINFODATA.3
index 1d3ea2ed0..d7aa4a77c 100644
--- a/docs/libcurl/opts/CURLOPT_XFERINFODATA.3
+++ b/docs/libcurl/opts/CURLOPT_XFERINFODATA.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, 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
@@ -37,7 +37,32 @@ The default value of this parameter is NULL.
.SH PROTOCOLS
All
.SH EXAMPLE
-https://curl.se/libcurl/c/progressfunc.html
+.nf
+ struct progress {
+ char *private;
+ size_t size;
+ };
+
+ static size_t progress_callback(void *clientp,
+ curl_off_t dltotal,
+ curl_off_t dlnow,
+ curl_off_t ultotal,
+ curl_off_t ulnow)
+ {
+ struct memory *progress = (struct progress *)userp;
+
+ /* use the values */
+
+ return 0; /* all is good */
+ }
+
+ struct progress data;
+
+ /* pass struct to callback */
+ curl_easy_setopt(curl_handle, CURLOPT_XFERINFODATA, &data);
+
+ curl_easy_setopt(curl_handle, CURLOPT_XFERINFOFUNCTION, progress_callback);
+.fi
.SH AVAILABILITY
Added in 7.32.0
.SH RETURN VALUE