url.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef HEADER_CURL_URL_H
  2. #define HEADER_CURL_URL_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 "curl_setup.h"
  27. /*
  28. * Prototypes for library-wide functions provided by url.c
  29. */
  30. CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn);
  31. CURLcode Curl_open(struct Curl_easy **curl);
  32. CURLcode Curl_init_userdefined(struct Curl_easy *data);
  33. void Curl_freeset(struct Curl_easy *data);
  34. CURLcode Curl_uc_to_curlcode(CURLUcode uc);
  35. CURLcode Curl_close(struct Curl_easy **datap); /* opposite of curl_open() */
  36. CURLcode Curl_connect(struct Curl_easy *, bool *async, bool *protocol_connect);
  37. bool Curl_on_disconnect(struct Curl_easy *data,
  38. struct connectdata *, bool aborted);
  39. CURLcode Curl_setup_conn(struct Curl_easy *data,
  40. bool *protocol_done);
  41. void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn);
  42. CURLcode Curl_parse_login_details(const char *login, const size_t len,
  43. char **userptr, char **passwdptr,
  44. char **optionsptr);
  45. /* Get protocol handler for a URI scheme
  46. * @param scheme URI scheme, case-insensitive
  47. * @return NULL of handler not found
  48. */
  49. const struct Curl_handler *Curl_get_scheme_handler(const char *scheme);
  50. const struct Curl_handler *Curl_getn_scheme_handler(const char *scheme,
  51. size_t len);
  52. #define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
  53. #define CURL_DEFAULT_HTTPS_PROXY_PORT 443 /* default https proxy port unless
  54. specified */
  55. #ifdef CURL_DISABLE_VERBOSE_STRINGS
  56. #define Curl_verboseconnect(x,y,z) Curl_nop_stmt
  57. #else
  58. void Curl_verboseconnect(struct Curl_easy *data, struct connectdata *conn,
  59. int sockindex);
  60. #endif
  61. /**
  62. * Return TRUE iff the given connection is considered dead.
  63. * @param nowp NULL or pointer to time being checked against.
  64. */
  65. bool Curl_conn_seems_dead(struct connectdata *conn,
  66. struct Curl_easy *data,
  67. struct curltime *nowp);
  68. /**
  69. * Perform upkeep operations on the connection.
  70. */
  71. CURLcode Curl_conn_upkeep(struct Curl_easy *data,
  72. struct connectdata *conn,
  73. struct curltime *now);
  74. #if defined(USE_HTTP2) || defined(USE_HTTP3)
  75. void Curl_data_priority_clear_state(struct Curl_easy *data);
  76. #else
  77. #define Curl_data_priority_clear_state(x)
  78. #endif /* !(defined(USE_HTTP2) || defined(USE_HTTP3)) */
  79. #ifdef USE_NGHTTP2
  80. CURLcode Curl_data_priority_add_child(struct Curl_easy *parent,
  81. struct Curl_easy *child,
  82. bool exclusive);
  83. #else
  84. #define Curl_data_priority_add_child(x, y, z) CURLE_NOT_BUILT_IN
  85. #endif
  86. #endif /* HEADER_CURL_URL_H */