sendf.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __SENDF_H
  2. #define __SENDF_H
  3. /*****************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 2000, Daniel Stenberg, <[email protected]>, et al.
  11. *
  12. * In order to be useful for every potential user, curl and libcurl are
  13. * dual-licensed under the MPL and the MIT/X-derivate licenses.
  14. *
  15. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. * copies of the Software, and permit persons to whom the Software is
  17. * furnished to do so, under the terms of the MPL or the MIT/X-derivate
  18. * licenses. You may pick one of these licenses.
  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. CURLcode Curl_sendf(int fd, struct connectdata *, const char *fmt, ...);
  26. void Curl_infof(struct SessionHandle *, const char *fmt, ...);
  27. void Curl_failf(struct SessionHandle *, const char *fmt, ...);
  28. #define infof Curl_infof
  29. #define failf Curl_failf
  30. struct send_buffer {
  31. char *buffer;
  32. size_t size_max;
  33. size_t size_used;
  34. };
  35. typedef struct send_buffer send_buffer;
  36. #define CLIENTWRITE_BODY 1
  37. #define CLIENTWRITE_HEADER 2
  38. #define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER)
  39. CURLcode Curl_client_write(struct SessionHandle *data, int type, char *ptr,
  40. size_t len);
  41. /* internal read-function, does plain socket, SSL and krb4 */
  42. int Curl_read(struct connectdata *conn, int sockfd,
  43. char *buf, size_t buffersize,
  44. ssize_t *n);
  45. /* internal write-function, does plain socket, SSL and krb4 */
  46. CURLcode Curl_write(struct connectdata *conn, int sockfd,
  47. void *mem, size_t len,
  48. ssize_t *written);
  49. #endif