sendf.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef __SENDF_H
  2. #define __SENDF_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2008, 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 http://curl.haxx.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. * $Id$
  24. ***************************************************************************/
  25. #include "setup.h"
  26. CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *,
  27. const char *fmt, ...);
  28. void Curl_infof(struct SessionHandle *, const char *fmt, ...);
  29. void Curl_failf(struct SessionHandle *, const char *fmt, ...);
  30. #if defined(CURL_DISABLE_VERBOSE_STRINGS)
  31. #if defined(HAVE_VARIADIC_MACROS_C99)
  32. #define infof(...) do { } while (0)
  33. #elif defined(HAVE_VARIADIC_MACROS_GCC)
  34. #define infof(x...) do { } while (0)
  35. #else
  36. #define infof (void)
  37. #endif
  38. #else /* CURL_DISABLE_VERBOSE_STRINGS */
  39. #define infof Curl_infof
  40. #endif /* CURL_DISABLE_VERBOSE_STRINGS */
  41. #define failf Curl_failf
  42. #define CLIENTWRITE_BODY 1
  43. #define CLIENTWRITE_HEADER 2
  44. #define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER)
  45. CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr,
  46. size_t len);
  47. void Curl_read_rewind(struct connectdata *conn,
  48. size_t extraBytesRead);
  49. /* internal read-function, does plain socket only */
  50. int Curl_read_plain(curl_socket_t sockfd,
  51. char *buf,
  52. size_t bytesfromsocket,
  53. ssize_t *n);
  54. /* internal read-function, does plain socket, SSL and krb4 */
  55. int 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 SessionHandle *handle, curl_infotype type,
  70. char *data, size_t size,
  71. struct connectdata *conn);
  72. #endif /* __SENDF_H */