sendf.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef HEADER_CURL_SENDF_H
  2. #define HEADER_CURL_SENDF_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2020, 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 "curl_setup.h"
  25. void Curl_infof(struct Curl_easy *, const char *fmt, ...);
  26. void Curl_failf(struct Curl_easy *, const char *fmt, ...);
  27. #if defined(CURL_DISABLE_VERBOSE_STRINGS)
  28. #if defined(HAVE_VARIADIC_MACROS_C99)
  29. #define infof(...) Curl_nop_stmt
  30. #elif defined(HAVE_VARIADIC_MACROS_GCC)
  31. #define infof(x...) Curl_nop_stmt
  32. #else
  33. #error "missing VARIADIC macro define, fix and rebuild!"
  34. #endif
  35. #else /* CURL_DISABLE_VERBOSE_STRINGS */
  36. #define infof Curl_infof
  37. #endif /* CURL_DISABLE_VERBOSE_STRINGS */
  38. #define failf Curl_failf
  39. #define CLIENTWRITE_BODY (1<<0)
  40. #define CLIENTWRITE_HEADER (1<<1)
  41. #define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER)
  42. CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr,
  43. size_t len) WARN_UNUSED_RESULT;
  44. bool Curl_recv_has_postponed_data(struct connectdata *conn, int sockindex);
  45. /* internal read-function, does plain socket only */
  46. CURLcode Curl_read_plain(curl_socket_t sockfd,
  47. char *buf,
  48. size_t bytesfromsocket,
  49. ssize_t *n);
  50. ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf,
  51. size_t len, CURLcode *code);
  52. ssize_t Curl_send_plain(struct connectdata *conn, int num,
  53. const void *mem, size_t len, CURLcode *code);
  54. /* internal read-function, does plain socket, SSL and krb4 */
  55. CURLcode Curl_read(struct connectdata *conn, curl_socket_t sockfd,
  56. char *buf, size_t buffersize,
  57. ssize_t *n);
  58. /* internal write-function, does plain socket, SSL, SCP, SFTP and krb4 */
  59. CURLcode Curl_write(struct connectdata *conn,
  60. curl_socket_t sockfd,
  61. const void *mem, size_t len,
  62. ssize_t *written);
  63. /* internal write-function, does plain sockets ONLY */
  64. CURLcode Curl_write_plain(struct connectdata *conn,
  65. curl_socket_t sockfd,
  66. const void *mem, size_t len,
  67. ssize_t *written);
  68. /* the function used to output verbose information */
  69. int Curl_debug(struct Curl_easy *data, curl_infotype type,
  70. char *ptr, size_t size);
  71. #endif /* HEADER_CURL_SENDF_H */