tool_operate.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef HEADER_CURL_TOOL_OPERATE_H
  2. #define HEADER_CURL_TOOL_OPERATE_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2019, 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.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 "tool_setup.h"
  25. #include "tool_cb_hdr.h"
  26. #include "tool_cb_prg.h"
  27. #include "tool_sdecls.h"
  28. struct per_transfer {
  29. /* double linked */
  30. struct per_transfer *next;
  31. struct per_transfer *prev;
  32. struct OperationConfig *config; /* for this transfer */
  33. CURL *curl;
  34. long retry_numretries;
  35. long retry_sleep_default;
  36. long retry_sleep;
  37. struct timeval retrystart;
  38. bool metalink; /* nonzero for metalink download. */
  39. bool metalink_next_res;
  40. metalinkfile *mlfile;
  41. metalink_resource *mlres;
  42. char *this_url;
  43. char *outfile;
  44. bool infdopen; /* TRUE if infd needs closing */
  45. int infd;
  46. struct ProgressData progressbar;
  47. struct OutStruct outs;
  48. struct OutStruct heads;
  49. struct InStruct input;
  50. struct HdrCbData hdrcbdata;
  51. char errorbuffer[CURL_ERROR_SIZE];
  52. bool added; /* set TRUE when added to the multi handle */
  53. /* for parallel progress bar */
  54. curl_off_t dltotal;
  55. curl_off_t dlnow;
  56. curl_off_t ultotal;
  57. curl_off_t ulnow;
  58. bool dltotal_added; /* if the total has been added from this */
  59. bool ultotal_added;
  60. /* NULL or malloced */
  61. char *separator_err;
  62. char *separator;
  63. char *uploadfile;
  64. };
  65. CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[]);
  66. extern struct per_transfer *transfers; /* first node */
  67. #endif /* HEADER_CURL_TOOL_OPERATE_H */