progress.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef __PROGRESS_H
  2. #define __PROGRESS_H
  3. /*****************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 2000, Daniel Stenberg, <[email protected]>, et al.
  11. *
  12. * In order to be useful for every potential user, curl and libcurl are
  13. * dual-licensed under the MPL and the MIT/X-derivate licenses.
  14. *
  15. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. * copies of the Software, and permit persons to whom the Software is
  17. * furnished to do so, under the terms of the MPL or the MIT/X-derivate
  18. * licenses. You may pick one of these licenses.
  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_LAST /* must be last */
  35. } timerid;
  36. void Curl_pgrsDone(struct connectdata *);
  37. void Curl_pgrsStartNow(struct SessionHandle *data);
  38. void Curl_pgrsSetDownloadSize(struct SessionHandle *data, double size);
  39. void Curl_pgrsSetUploadSize(struct SessionHandle *data, double size);
  40. void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, double size);
  41. void Curl_pgrsSetUploadCounter(struct SessionHandle *data, double size);
  42. int Curl_pgrsUpdate(struct connectdata *);
  43. void Curl_pgrsTime(struct SessionHandle *data, timerid timer);
  44. /* Don't show progress for sizes smaller than: */
  45. #define LEAST_SIZE_PROGRESS BUFSIZE
  46. #define PROGRESS_DOWNLOAD (1<<0)
  47. #define PROGRESS_UPLOAD (1<<1)
  48. #define PROGRESS_DOWN_AND_UP (PROGRESS_UPLOAD | PROGRESS_DOWNLOAD)
  49. #define PGRS_SHOW_DL (1<<0)
  50. #define PGRS_SHOW_UL (1<<1)
  51. #define PGRS_DONE_DL (1<<2)
  52. #define PGRS_DONE_UL (1<<3)
  53. #define PGRS_HIDE (1<<4)
  54. #define PGRS_UL_SIZE_KNOWN (1<<5)
  55. #define PGRS_DL_SIZE_KNOWN (1<<6)
  56. #define PGRS_HEADERS_OUT (1<<7) /* set when the headers have been written */
  57. #endif /* __PROGRESS_H */