cmCurl.h 971 B

123456789101112131415161718192021222324252627
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file LICENSE.rst or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <cm/optional>
  7. #include <cm/string_view>
  8. #include <cm3p/curl/curl.h>
  9. // curl versions before 7.87.0 did not provide CURL_WRITEFUNC_ERROR
  10. #if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x075700
  11. # define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
  12. #endif
  13. cm::optional<int> cmCurlParseTLSVersion(cm::string_view tls_version);
  14. cm::optional<std::string> cmCurlPrintTLSVersion(int curl_tls_version);
  15. std::string cmCurlSetCAInfo(::CURL* curl, std::string const& cafile = {});
  16. std::string cmCurlSetNETRCOption(::CURL* curl, std::string const& netrc_level,
  17. std::string const& netrc_file);
  18. std::string cmCurlFixFileURL(std::string url);
  19. ::CURLcode cm_curl_global_init(long flags);
  20. ::CURL* cm_curl_easy_init();