uclient-backend.h 802 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __UCLIENT_INTERNAL_H
  2. #define __UCLIENT_INTERNAL_H
  3. struct uclient_url;
  4. struct uclient_backend {
  5. const char * const * prefix;
  6. struct uclient *(*alloc)(void);
  7. void (*free)(struct uclient *cl);
  8. int (*connect)(struct uclient *cl);
  9. int (*request)(struct uclient *cl);
  10. int (*read)(struct uclient *cl, char *buf, unsigned int len);
  11. int (*write)(struct uclient *cl, char *buf, unsigned int len);
  12. int (*set_write_len)(struct uclient *cl, unsigned int len);
  13. };
  14. struct uclient_url {
  15. const struct uclient_backend *backend;
  16. int prefix;
  17. const char *host;
  18. const char *port;
  19. const char *location;
  20. const char *auth;
  21. };
  22. extern const struct uclient_backend uclient_backend_http;
  23. void uclient_backend_set_eof(struct uclient *cl);
  24. void uclient_backend_reset_state(struct uclient *cl);
  25. #endif