comparison libpurple/protocols/msn/soap2.h @ 20526:915e11fbaeb0

beginning of soap layer rewrite, does that even compile?
author Ka-Hing Cheung <khc@hxbc.us>
date Wed, 19 Sep 2007 06:20:08 +0000
parents
children 0034d7e89032
comparison
equal deleted inserted replaced
20525:5bef3197383a 20526:915e11fbaeb0
1 /**
2 * @file soap2.h
3 * header file for SOAP connection related process
4 *
5 * purple
6 *
7 * Purple is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25
26 #ifndef _MSN_SOAP2_H
27 #define _MSN_SOAP2_H
28
29 #include "session.h"
30 #include "sslconn.h"
31 #include "xmlnode.h"
32
33 #include <glib.h>
34
35 typedef struct _MsnSoapMessage MsnSoapMessage;
36 typedef struct _MsnSoapConnection2 MsnSoapConnection2;
37
38 typedef void (*MsnSoapCallback)(MsnSoapConnection2 *conn,
39 MsnSoapMessage *req, MsnSoapMessage *resp, gpointer cb_data);
40
41 struct _MsnSoapMessage {
42 char *action;
43 xmlnode *message;
44 GSList *headers;
45
46 MsnSoapCallback cb;
47 gpointer data;
48
49 char *host;
50 char *path;
51 };
52
53 struct _MsnSoapConnection2 {
54 MsnSession *session;
55
56 char *path;
57
58 PurpleSslConnection *ssl;
59 gboolean connected;
60
61 guint idle_handle;
62 guint io_handle;
63 GQueue *queue;
64
65 MsnSoapMessage *current;
66 MsnSoapMessage *response;
67 char *buf;
68 gsize buf_len;
69 gsize buf_count;
70 };
71
72 MsnSoapConnection2 *msn_soap_connection2_new(MsnSession *session);
73
74 void msn_soap_connection2_post(MsnSoapConnection2 *conn, MsnSoapMessage *req,
75 const char *host, const char *path, MsnSoapCallback cb, gpointer data);
76
77 void msn_soap_connection2_destroy(MsnSoapConnection2 *conn);
78
79 MsnSoapMessage *msn_soap_message_new(const char *action, xmlnode *message);
80
81 void msn_soap_message_destroy(MsnSoapMessage *req);
82
83 void msn_soap_message_add_header(MsnSoapMessage *req,
84 const char *name, const char *value);
85
86 #endif