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
gboolean xr_client_open(xr_client_conn *conn, const char *uri, GError **err)
Open new connection to the server.
XML-RPC Call Handling API.
SSL_CTX * xr_client_get_ssl_context(xr_client_conn *conn)
Get SSL context used by the client.
xr_call_transport
Transport type.
Definition: xr-call.h:38
gboolean xr_client_call(xr_client_conn *conn, xr_call *call, GError **err)
Perform XML-RPC call over connection.
struct _xr_http xr_http
Opaque HTTP object.
Definition: xr-http.h:46
HTTP Transport.
void xr_client_reset_http_headers(xr_client_conn *conn)
Remove all user defined HTTP headers.
xr_value parser/builder.
struct _xr_call xr_call
Opaque data structrure for storing intermediate representation of XML-RPC call.
Definition: xr-call.h:49
void xr_client_set_http_header(xr_client_conn *conn, const char *name, const char *value)
Set HTTP header to be used in RPCs.
void xr_client_close(xr_client_conn *conn)
Close currently open connection.
gboolean xr_client_set_transport(xr_client_conn *conn, xr_call_transport transport)
Set transport type.
xr_client_conn * xr_client_new(GError **err)
Create new connection object.
typedefG_BEGIN_DECLS struct _xr_client_conn xr_client_conn
Opaque data structrure that represents client connection.
Definition: xr-client.h:55
xr_http * xr_client_get_http(xr_client_conn *conn)
Get HTTP transport object.
void xr_client_free(xr_client_conn *conn)
Free connection object.
void xr_client_basic_auth(xr_client_conn *conn, const char *username, const char *password)
Helper function for setting HTTP headers for Basic Authorization.
Documentation for libxr, Wed Apr 27 2016 22:07:49.