progress.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef HEADER_CURL_PROGRESS_H
  2. #define HEADER_CURL_PROGRESS_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. #include "timeval.h"
  27. typedef enum {
  28. TIMER_NONE,
  29. TIMER_STARTOP,
  30. TIMER_STARTSINGLE,
  31. TIMER_NAMELOOKUP,
  32. TIMER_CONNECT,
  33. TIMER_APPCONNECT,
  34. TIMER_PRETRANSFER,
  35. TIMER_STARTTRANSFER,
  36. TIMER_POSTRANSFER,
  37. TIMER_STARTACCEPT,
  38. TIMER_REDIRECT,
  39. TIMER_LAST /* must be last */
  40. } timerid;
  41. int Curl_pgrsDone(struct Curl_easy *data);
  42. void Curl_pgrsStartNow(struct Curl_easy *data);
  43. void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size);
  44. void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size);
  45. void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
  46. void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
  47. void Curl_ratelimit(struct Curl_easy *data, struct curltime now);
  48. int Curl_pgrsUpdate(struct Curl_easy *data);
  49. void Curl_pgrsResetTransferSizes(struct Curl_easy *data);
  50. struct curltime Curl_pgrsTime(struct Curl_easy *data, timerid timer);
  51. timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize,
  52. curl_off_t startsize,
  53. curl_off_t limit,
  54. struct curltime start,
  55. struct curltime now);
  56. #define PGRS_HIDE (1<<4)
  57. #define PGRS_UL_SIZE_KNOWN (1<<5)
  58. #define PGRS_DL_SIZE_KNOWN (1<<6)
  59. #define PGRS_HEADERS_OUT (1<<7) /* set when the headers have been written */
  60. #endif /* HEADER_CURL_PROGRESS_H */