progress.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef HEADER_CURL_PROGRESS_H
  2. #define HEADER_CURL_PROGRESS_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2014, Daniel Stenberg, <[email protected]>, 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.haxx.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. ***************************************************************************/
  24. #include "timeval.h"
  25. typedef enum {
  26. TIMER_NONE,
  27. TIMER_STARTOP,
  28. TIMER_STARTSINGLE,
  29. TIMER_NAMELOOKUP,
  30. TIMER_CONNECT,
  31. TIMER_APPCONNECT,
  32. TIMER_PRETRANSFER,
  33. TIMER_STARTTRANSFER,
  34. TIMER_POSTRANSFER,
  35. TIMER_STARTACCEPT,
  36. TIMER_REDIRECT,
  37. TIMER_LAST /* must be last */
  38. } timerid;
  39. int Curl_pgrsDone(struct connectdata *);
  40. void Curl_pgrsStartNow(struct Curl_easy *data);
  41. void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size);
  42. void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size);
  43. void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
  44. void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
  45. int Curl_pgrsUpdate(struct connectdata *);
  46. void Curl_pgrsResetTimesSizes(struct Curl_easy *data);
  47. void Curl_pgrsTime(struct Curl_easy *data, timerid timer);
  48. long Curl_pgrsLimitWaitTime(curl_off_t cursize,
  49. curl_off_t startsize,
  50. curl_off_t limit,
  51. struct timeval start,
  52. struct timeval now);
  53. /* Don't show progress for sizes smaller than: */
  54. #define LEAST_SIZE_PROGRESS BUFSIZE
  55. #define PROGRESS_DOWNLOAD (1<<0)
  56. #define PROGRESS_UPLOAD (1<<1)
  57. #define PROGRESS_DOWN_AND_UP (PROGRESS_UPLOAD | PROGRESS_DOWNLOAD)
  58. #define PGRS_SHOW_DL (1<<0)
  59. #define PGRS_SHOW_UL (1<<1)
  60. #define PGRS_DONE_DL (1<<2)
  61. #define PGRS_DONE_UL (1<<3)
  62. #define PGRS_HIDE (1<<4)
  63. #define PGRS_UL_SIZE_KNOWN (1<<5)
  64. #define PGRS_DL_SIZE_KNOWN (1<<6)
  65. #define PGRS_HEADERS_OUT (1<<7) /* set when the headers have been written */
  66. #endif /* HEADER_CURL_PROGRESS_H */