X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=uclient-backend.h;h=9ccc7999dbf7a0e3251db9d0a1be9ca90890f779;hb=d2d1a9c477abe660e01943b3fee069b28b6610e0;hp=308cd575aabc9c8675fe7531f454836ce5a40d4a;hpb=25e44fc1e666fb333b3c53bcda90e44b0b74bf19;p=project%2Fuclient.git diff --git a/uclient-backend.h b/uclient-backend.h index 308cd57..9ccc799 100644 --- a/uclient-backend.h +++ b/uclient-backend.h @@ -1,3 +1,20 @@ +/* + * uclient - ustream based protocol client library + * + * Copyright (C) 2014 Felix Fietkau + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ #ifndef __UCLIENT_INTERNAL_H #define __UCLIENT_INTERNAL_H @@ -12,20 +29,10 @@ struct uclient_backend { int (*connect)(struct uclient *cl); int (*request)(struct uclient *cl); + void (*disconnect)(struct uclient *cl); int (*read)(struct uclient *cl, char *buf, unsigned int len); - int (*write)(struct uclient *cl, char *buf, unsigned int len); -}; - -struct uclient_url { - const struct uclient_backend *backend; - int prefix; - - const char *host; - const char *port; - const char *location; - - const char *auth; + int (*write)(struct uclient *cl, const char *buf, unsigned int len); }; void uclient_backend_set_error(struct uclient *cl, int code);