annotate src/protocols/msn/httpmethod.h @ 9007:0a08f671b591

[gaim-migrate @ 9783] You can now use gtk to theme your hyperlink colors. It works something like this: style "mystyle" { GtkIMHtml::hyperlink-color = "#00FF00" } widget_class "*" style "mystyle" If you change it while gaim is running, old hyperlinks won't change color, but new ones should, assuming you use a program that sends the right event to make things reparse their gtkrcs. Old hyperlinks will change color if you restart Gaim and view them in the logs or something. Actually using bright green for hyperlinks is discourged. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sat, 22 May 2004 06:35:13 +0000
parents 06f57183e29f
children c30d81b4dd22
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file httpmethod.h HTTP connection method
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * gaim
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
8475
06f57183e29f [gaim-migrate @ 9208]
Christian Hammond <chipx86@chipx86.com>
parents: 8298
diff changeset
6 * Copyright (C) 2003-2004 Christian Hammond <chipx86@gnupdate.org>
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * (at your option) any later version.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * GNU General Public License for more details.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 #ifndef _MSN_HTTP_METHOD_H_
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 #define _MSN_HTTP_METHOD_H_
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 typedef struct _MsnHttpMethodData MsnHttpMethodData;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include "servconn.h"
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 struct _MsnHttpMethodData
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 {
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 char *session_id;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 char *old_gateway_ip;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 char *gateway_ip;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 const char *server_type;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 int timer;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 gboolean virgin;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 gboolean waiting_response;
8298
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
40 gboolean dirty;
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 GList *queue;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 };
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 /**
8298
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
46 * Initializes the HTTP data for a session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
47 *
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
48 * @param session The session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
49 */
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
50 void msn_http_session_init(MsnSession *session);
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
51
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
52 /**
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
53 * Uninitializes the HTTP data for a session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
54 *
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
55 * @param session The session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
56 */
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
57 void msn_http_session_uninit(MsnSession *session);
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
58
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
59 /**
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 * Writes data to the server using the HTTP connection method.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 * @param servconn The server connection.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 * @param buf The data to write.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 * @param size The size of the data to write.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 * @param server_type The optional server type.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 * @return The number of bytes written.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 size_t msn_http_servconn_write(MsnServConn *servconn, const char *buf,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 size_t size, const char *server_type);
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 /**
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 * Polls the server for data.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 * @param servconn The server connection.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 void msn_http_servconn_poll(MsnServConn *servconn);
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 /**
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 * Processes an incoming message and returns a string the rest of MSN
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 * can deal with.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 * @param servconn The server connection.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 * @param buf The incoming buffer.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 * @param size The incoming size.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 * @param ret_buf The returned buffer.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 * @param ret_len The returned length.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 * @param error TRUE if there was an HTTP error.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 * @return TRUE if the returned buffer is ready to be processed.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 * FALSE otherwise.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 gboolean msn_http_servconn_parse_data(MsnServConn *servconn,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 const char *buf, size_t size,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 char **ret_buf, size_t *ret_size,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 gboolean *error);
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 #endif /* _MSN_HTTP_METHOD_H_ */