progress.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef __PROGRESS_H
  2. #define __PROGRESS_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2004, 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 http://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. * $Id$
  24. ***************************************************************************/
  25. #include "timeval.h"
  26. typedef enum {
  27. TIMER_NONE,
  28. TIMER_NAMELOOKUP,
  29. TIMER_CONNECT,
  30. TIMER_PRETRANSFER,
  31. TIMER_STARTTRANSFER,
  32. TIMER_POSTRANSFER,
  33. TIMER_STARTSINGLE,
  34. TIMER_REDIRECT,
  35. TIMER_LAST /* must be last */
  36. } timerid;
  37. void Curl_pgrsDone(struct connectdata *);
  38. void Curl_pgrsStartNow(struct SessionHandle *data);
  39. void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size);
  40. void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size);
  41. void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size);
  42. void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size);
  43. int Curl_pgrsUpdate(struct connectdata *);
  44. void Curl_pgrsResetTimes(struct SessionHandle *data);
  45. void Curl_pgrsTime(struct SessionHandle *data, timerid timer);
  46. /* Don't show progress for sizes smaller than: */
  47. #define LEAST_SIZE_PROGRESS BUFSIZE
  48. #define PROGRESS_DOWNLOAD (1<<0)
  49. #define PROGRESS_UPLOAD (1<<1)
  50. #define PROGRESS_DOWN_AND_UP (PROGRESS_UPLOAD | PROGRESS_DOWNLOAD)
  51. #define PGRS_SHOW_DL (1<<0)
  52. #define PGRS_SHOW_UL (1<<1)
  53. #define PGRS_DONE_DL (1<<2)
  54. #define PGRS_DONE_UL (1<<3)
  55. #define PGRS_HIDE (1<<4)
  56. #define PGRS_UL_SIZE_KNOWN (1<<5)
  57. #define PGRS_DL_SIZE_KNOWN (1<<6)
  58. #define PGRS_HEADERS_OUT (1<<7) /* set when the headers have been written */
  59. #endif /* __PROGRESS_H */