libxrdeveloper's documentation
xr-client.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
3  *
4  * This file is part of libxr.
5  *
6  * Libxr is free software: you can redistribute it and/or modify it under the
7  * terms of the GNU Lesser General Public License as published by the Free
8  * Software Foundation, either version 2 of the License, or (at your option) any
9  * later version.
10  *
11  * Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13  * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with libxr. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
32 #ifndef __XR_CLIENT_H__
33 #define __XR_CLIENT_H__
34 
35 #include <openssl/ssl.h>
36 #include "xr-call.h"
37 #include "xr-http.h"
38 #include "xr-value-utils.h"
39 
40 #define XR_CLIENT_ERROR xr_client_error_quark()
41 
42 typedef enum
43 {
44  XR_CLIENT_ERROR_MARCHALIZER,
45  XR_CLIENT_ERROR_CLOSED,
46  XR_CLIENT_ERROR_CONNECT,
47  XR_CLIENT_ERROR_IO,
48  XR_CLIENT_ERROR_FAILED
49 } XRClientError;
50 
51 G_BEGIN_DECLS
52 
55 typedef struct _xr_client_conn xr_client_conn;
56 
63 xr_client_conn* xr_client_new(GError** err);
64 
74 
80 void xr_client_free(xr_client_conn* conn);
81 
93 
104 void xr_client_set_http_header(xr_client_conn* conn, const char* name, const char* value);
105 
111 
118 void xr_client_basic_auth(xr_client_conn* conn, const char* username, const char* password);
119 
127 
136 gboolean xr_client_open(xr_client_conn* conn, const char* uri, GError** err);
137 
142 void xr_client_close(xr_client_conn* conn);
143 
153 gboolean xr_client_call(xr_client_conn* conn, xr_call* call, GError** err);
154 
155 GQuark xr_client_error_quark();
156 
157 G_END_DECLS
158 
159 #endif
Documentation for libxr, Sat Nov 1 2014 21:06:15.