comparison libpurple/protocols/msn/soap.h @ 20481:eb93710aec4d

Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
author Carlos Silva <typ0@pidgin.im>
date Tue, 28 Aug 2007 03:54:18 +0000
parents 9a2a4a0c0003
children 98613886411a
comparison
equal deleted inserted replaced
20480:7d3e53e3f623 20481:eb93710aec4d
47 /*MSN Https connection structure*/ 47 /*MSN Https connection structure*/
48 typedef struct _MsnSoapConn MsnSoapConn; 48 typedef struct _MsnSoapConn MsnSoapConn;
49 49
50 typedef void (*MsnSoapConnectInitFunction)(MsnSoapConn *); 50 typedef void (*MsnSoapConnectInitFunction)(MsnSoapConn *);
51 51
52
52 struct _MsnSoapReq{ 53 struct _MsnSoapReq{
53 /*request sequence*/ 54 /*request sequence*/
54 int id; 55 int id;
55 56
56 char *login_host; 57 char *login_host;
57 char *login_path; 58 char *login_path;
58 char *soap_action; 59 char *soap_action;
59 60
60 char *body; 61 char *body;
61 62
63 gpointer data_cb;
62 PurpleInputFunction read_cb; 64 PurpleInputFunction read_cb;
63 PurpleInputFunction written_cb; 65 PurpleInputFunction written_cb;
64 }; 66 };
65 67
66 struct _MsnSoapConn{ 68 struct _MsnSoapConn{
101 char *read_buf; 103 char *read_buf;
102 gsize read_len; 104 gsize read_len;
103 gsize need_to_read; 105 gsize need_to_read;
104 PurpleInputFunction read_cb; 106 PurpleInputFunction read_cb;
105 107
108 gpointer data_cb;
109
106 /*HTTP reply body part*/ 110 /*HTTP reply body part*/
107 char *body; 111 char *body;
108 int body_len; 112 int body_len;
109 }; 113 };
110 114
111 /*Function Prototype*/ 115 /*Function Prototype*/
112 /*Soap Request Function */ 116 /*Soap Request Function */
113 MsnSoapReq *msn_soap_request_new(const char *host, const char *post_url, 117 MsnSoapReq *msn_soap_request_new(const char *host, const char *post_url,
114 const char *soap_action, const char *body, 118 const char *soap_action, const char *body,
115 PurpleInputFunction read_cb, 119 const gpointer data_cb,
116 PurpleInputFunction written_cb); 120 PurpleInputFunction read_cb,
121 PurpleInputFunction written_cb);
117 122
118 void msn_soap_request_free(MsnSoapReq *request); 123 void msn_soap_request_free(MsnSoapReq *request);
119 void msn_soap_post_request(MsnSoapConn *soapconn,MsnSoapReq *request); 124 void msn_soap_post_request(MsnSoapConn *soapconn,MsnSoapReq *request);
120 void msn_soap_post_head_request(MsnSoapConn *soapconn); 125 void msn_soap_post_head_request(MsnSoapConn *soapconn);
121 126
132 137
133 /*write to soap*/ 138 /*write to soap*/
134 void msn_soap_write(MsnSoapConn * soapconn, char *write_buf, PurpleInputFunction written_cb); 139 void msn_soap_write(MsnSoapConn * soapconn, char *write_buf, PurpleInputFunction written_cb);
135 void msn_soap_post(MsnSoapConn *soapconn,MsnSoapReq *request,MsnSoapConnectInitFunction msn_soap_init_func); 140 void msn_soap_post(MsnSoapConn *soapconn,MsnSoapReq *request,MsnSoapConnectInitFunction msn_soap_init_func);
136 141
137 void msn_soap_free_read_buf(MsnSoapConn *soapconn); 142 void msn_soap_free_data_cb(MsnSoapConn *soapconn);
143 void msn_soap_free_read_buf(MsnSoapConn *soapconn);
138 void msn_soap_free_write_buf(MsnSoapConn *soapconn); 144 void msn_soap_free_write_buf(MsnSoapConn *soapconn);
139 void msn_soap_connect_cb(gpointer data, PurpleSslConnection *gsc, PurpleInputCondition cond); 145 void msn_soap_connect_cb(gpointer data, PurpleSslConnection *gsc, PurpleInputCondition cond);
140 void msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond); 146 void msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond);
141 147
142 /*clean the unhandled request*/ 148 /*clean the unhandled request*/