Annotation of embedaddon/curl/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3, revision 1.1
1.1 ! misho 1: .\" **************************************************************************
! 2: .\" * _ _ ____ _
! 3: .\" * Project ___| | | | _ \| |
! 4: .\" * / __| | | | |_) | |
! 5: .\" * | (__| |_| | _ <| |___
! 6: .\" * \___|\___/|_| \_\_____|
! 7: .\" *
! 8: .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
! 9: .\" *
! 10: .\" * This software is licensed as described in the file COPYING, which
! 11: .\" * you should have received as part of this distribution. The terms
! 12: .\" * are also available at https://curl.haxx.se/docs/copyright.html.
! 13: .\" *
! 14: .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
! 15: .\" * copies of the Software, and permit persons to whom the Software is
! 16: .\" * furnished to do so, under the terms of the COPYING file.
! 17: .\" *
! 18: .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
! 19: .\" * KIND, either express or implied.
! 20: .\" *
! 21: .\" **************************************************************************
! 22: .\"
! 23: .TH CURLOPT_PROGRESSFUNCTION 3 "March 23, 2020" "libcurl 7.70.0" "curl_easy_setopt options"
! 24:
! 25: .SH NAME
! 26: CURLOPT_PROGRESSFUNCTION \- callback to progress meter function
! 27: .SH SYNOPSIS
! 28: #include <curl/curl.h>
! 29:
! 30: int progress_callback(void *clientp,
! 31: double dltotal,
! 32: double dlnow,
! 33: double ultotal,
! 34: double ulnow);
! 35:
! 36: CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROGRESSFUNCTION, progress_callback);
! 37: .SH DESCRIPTION
! 38: Pass a pointer to your callback function, which should match the prototype
! 39: shown above.
! 40:
! 41: We encourage users to use the newer \fICURLOPT_XFERINFOFUNCTION(3)\fP instead,
! 42: if you can.
! 43:
! 44: This function gets called by libcurl instead of its internal equivalent with a
! 45: frequent interval. While data is being transferred it will be called very
! 46: frequently, and during slow periods like when nothing is being transferred it
! 47: can slow down to about one call per second.
! 48:
! 49: \fIclientp\fP is the pointer set with \fICURLOPT_PROGRESSDATA(3)\fP, it is not
! 50: used by libcurl but is only passed along from the application to the callback.
! 51:
! 52: The callback gets told how much data libcurl will transfer and has
! 53: transferred, in number of bytes. \fIdltotal\fP is the total number of bytes
! 54: libcurl expects to download in this transfer. \fIdlnow\fP is the number of
! 55: bytes downloaded so far. \fIultotal\fP is the total number of bytes libcurl
! 56: expects to upload in this transfer. \fIulnow\fP is the number of bytes
! 57: uploaded so far.
! 58:
! 59: Unknown/unused argument values passed to the callback will be set to zero
! 60: (like if you only download data, the upload size will remain 0). Many times
! 61: the callback will be called one or more times first, before it knows the data
! 62: sizes so a program must be made to handle that.
! 63:
! 64: If your callback function returns CURL_PROGRESSFUNC_CONTINUE it will cause
! 65: libcurl to continue executing the default progress function.
! 66:
! 67: Returning any other non-zero value from this callback will cause libcurl to
! 68: abort the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP.
! 69:
! 70: If you transfer data with the multi interface, this function will not be
! 71: called during periods of idleness unless you call the appropriate libcurl
! 72: function that performs transfers.
! 73:
! 74: \fICURLOPT_NOPROGRESS(3)\fP must be set to 0 to make this function actually
! 75: get called.
! 76: .SH DEFAULT
! 77: By default, libcurl has an internal progress meter. That's rarely wanted by
! 78: users.
! 79: .SH PROTOCOLS
! 80: All
! 81: .SH EXAMPLE
! 82: https://curl.haxx.se/libcurl/c/progressfunc.html
! 83: .SH AVAILABILITY
! 84: Always
! 85: .SH RETURN VALUE
! 86: Returns CURLE_OK.
! 87: .SH "SEE ALSO"
! 88: .BR CURLOPT_VERBOSE "(3), " CURLOPT_NOPROGRESS "(3), "
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>