libxrdeveloper's documentation
xr-client.h
Go to the documentation of this file.
00001 /* 
00002  * Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
00003  * 
00004  * This file is part of libxr.
00005  *
00006  * Libxr is free software: you can redistribute it and/or modify it under the
00007  * terms of the GNU Lesser General Public License as published by the Free
00008  * Software Foundation, either version 2 of the License, or (at your option) any
00009  * later version.
00010  *
00011  * Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
00012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00013  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00014  * details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with libxr.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00032 #ifndef __XR_CLIENT_H__
00033 #define __XR_CLIENT_H__
00034 
00035 #include <openssl/ssl.h>
00036 #include "xr-call.h"
00037 #include "xr-http.h"
00038 #include "xr-value-utils.h"
00039 
00040 #define XR_CLIENT_ERROR xr_client_error_quark()
00041 
00042 typedef enum
00043 {
00044   XR_CLIENT_ERROR_MARCHALIZER,
00045   XR_CLIENT_ERROR_CLOSED,
00046   XR_CLIENT_ERROR_CONNECT,
00047   XR_CLIENT_ERROR_IO,
00048   XR_CLIENT_ERROR_FAILED
00049 } XRClientError;
00050 
00051 G_BEGIN_DECLS
00052 
00055 typedef struct _xr_client_conn xr_client_conn;
00056 
00063 xr_client_conn* xr_client_new(GError** err);
00064 
00073 SSL_CTX* xr_client_get_ssl_context(xr_client_conn* conn);
00074 
00080 void xr_client_free(xr_client_conn* conn);
00081 
00092 gboolean xr_client_set_transport(xr_client_conn* conn, xr_call_transport transport);
00093 
00104 void xr_client_set_http_header(xr_client_conn* conn, const char* name, const char* value);
00105 
00110 void xr_client_reset_http_headers(xr_client_conn* conn);
00111 
00118 void xr_client_basic_auth(xr_client_conn* conn, const char* username, const char* password);
00119 
00126 xr_http* xr_client_get_http(xr_client_conn* conn);
00127 
00136 gboolean xr_client_open(xr_client_conn* conn, const char* uri, GError** err);
00137 
00142 void xr_client_close(xr_client_conn* conn);
00143 
00153 gboolean xr_client_call(xr_client_conn* conn, xr_call* call, GError** err);
00154 
00155 GQuark xr_client_error_quark();
00156 
00157 G_END_DECLS
00158 
00159 #endif
Documentation for libxr, Thu Jun 2 2011 18:47:18.