tool_writeout.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef HEADER_CURL_TOOL_WRITEOUT_H
  2. #define HEADER_CURL_TOOL_WRITEOUT_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2021, 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. ***************************************************************************/
  24. #include "tool_setup.h"
  25. #include "tool_operate.h"
  26. typedef enum {
  27. VAR_NONE, /* must be the first */
  28. VAR_APPCONNECT_TIME,
  29. VAR_CONNECT_TIME,
  30. VAR_CONTENT_TYPE,
  31. VAR_EFFECTIVE_FILENAME,
  32. VAR_EFFECTIVE_METHOD,
  33. VAR_EFFECTIVE_URL,
  34. VAR_ERRORMSG,
  35. VAR_EXITCODE,
  36. VAR_FTP_ENTRY_PATH,
  37. VAR_HEADER_SIZE,
  38. VAR_HTTP_CODE,
  39. VAR_HTTP_CODE_PROXY,
  40. VAR_HTTP_VERSION,
  41. VAR_INPUT_URL,
  42. VAR_JSON,
  43. VAR_LOCAL_IP,
  44. VAR_LOCAL_PORT,
  45. VAR_NAMELOOKUP_TIME,
  46. VAR_NUM_CONNECTS,
  47. VAR_NUM_HEADERS,
  48. VAR_ONERROR,
  49. VAR_PRETRANSFER_TIME,
  50. VAR_PRIMARY_IP,
  51. VAR_PRIMARY_PORT,
  52. VAR_PROXY_SSL_VERIFY_RESULT,
  53. VAR_REDIRECT_COUNT,
  54. VAR_REDIRECT_TIME,
  55. VAR_REDIRECT_URL,
  56. VAR_REFERER,
  57. VAR_REQUEST_SIZE,
  58. VAR_SCHEME,
  59. VAR_SIZE_DOWNLOAD,
  60. VAR_SIZE_UPLOAD,
  61. VAR_SPEED_DOWNLOAD,
  62. VAR_SPEED_UPLOAD,
  63. VAR_SSL_VERIFY_RESULT,
  64. VAR_STARTTRANSFER_TIME,
  65. VAR_STDERR,
  66. VAR_STDOUT,
  67. VAR_TOTAL_TIME,
  68. VAR_URLNUM,
  69. VAR_NUM_OF_VARS /* must be the last */
  70. } writeoutid;
  71. struct writeoutvar {
  72. const char *name;
  73. writeoutid id;
  74. CURLINFO ci;
  75. int (*writefunc)(FILE *stream, const struct writeoutvar *wovar,
  76. struct per_transfer *per, CURLcode per_result,
  77. bool use_json);
  78. };
  79. void ourWriteOut(const char *writeinfo, struct per_transfer *per,
  80. CURLcode per_result);
  81. #endif /* HEADER_CURL_TOOL_WRITEOUT_H */