remove debug code
[project/uclient.git] / uclient-backend.h
1 #ifndef __UCLIENT_INTERNAL_H
2 #define __UCLIENT_INTERNAL_H
3
4 struct uclient_url;
5
6 struct uclient_backend {
7         const char * const * prefix;
8
9         struct uclient *(*alloc)(void);
10         void (*free)(struct uclient *cl);
11
12         int (*connect)(struct uclient *cl);
13         int (*request)(struct uclient *cl);
14
15         int (*read)(struct uclient *cl, char *buf, unsigned int len);
16         int (*write)(struct uclient *cl, char *buf, unsigned int len);
17 };
18
19 struct uclient_url {
20         const struct uclient_backend *backend;
21         int prefix;
22
23         const char *host;
24         const char *port;
25         const char *location;
26
27         const char *auth;
28 };
29
30 extern const struct uclient_backend uclient_backend_http;
31 void uclient_backend_set_eof(struct uclient *cl);
32 void uclient_backend_reset_state(struct uclient *cl);
33
34 #endif