tool_writeout.h 2.5 KB

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