Mercurial > pidgin
annotate src/protocols/msn/servconn.h @ 8114:7a6e30eb7aad
[gaim-migrate @ 8818]
Thanks to Tim Ringenbach for this IRC chat list.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Thu, 15 Jan 2004 22:53:07 +0000 |
parents | ff9127038a5a |
children | 06f57183e29f |
rev | line source |
---|---|
5309 | 1 /** |
2 * @file servconn.h Server connection functions | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
7 * |
5309 | 8 * This program is free software; you can redistribute it and/or modify |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 */ | |
22 #ifndef _MSN_SERVCONN_H_ | |
23 #define _MSN_SERVCONN_H_ | |
24 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
25 #include "proxy.h" |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
26 |
5309 | 27 typedef struct _MsnServConn MsnServConn; |
28 | |
29 #include "msg.h" | |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
30 #include "httpmethod.h" |
5309 | 31 |
32 typedef gboolean (*MsnServConnCommandCb)(MsnServConn *servconn, | |
33 const char *cmd, const char **params, | |
34 size_t param_count); | |
35 | |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
36 typedef gboolean (*MsnServConnMsgCb)(MsnServConn *servconn, MsnMessage *msg); |
5309 | 37 |
38 #include "session.h" | |
39 | |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
40 typedef enum |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
41 { |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
42 MSN_MULTILINE_MSG, |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
43 MSN_MULTILINE_IPG, |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
44 MSN_MULTILINE_NOT |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
45 |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
46 } MsnMultilineType; |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
47 |
5309 | 48 struct _MsnServConn |
49 { | |
50 MsnSession *session; | |
51 | |
52 gboolean connected; | |
53 | |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
54 MsnHttpMethodData *http_data; |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
55 |
5309 | 56 char *server; |
57 int port; | |
58 | |
59 int fd; | |
60 int inpa; | |
61 | |
62 char *rxqueue; | |
63 int rxlen; | |
64 | |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
65 GSList *msg_queue; |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
66 |
5309 | 67 GSList *txqueue; |
68 | |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
69 gboolean parsing_multiline; |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
70 MsnMultilineType multiline_type; |
5309 | 71 char *msg_passport; |
72 char *msg_friendly; | |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
73 int multiline_len; |
5309 | 74 |
75 GHashTable *commands; | |
76 GHashTable *msg_types; | |
77 | |
78 gboolean (*connect_cb)(gpointer, gint, GaimInputCondition); | |
79 void (*failed_read_cb)(gpointer, gint, GaimInputCondition); | |
80 void (*login_cb)(gpointer, gint, GaimInputCondition); | |
81 | |
82 void *data; | |
83 }; | |
84 | |
85 MsnServConn *msn_servconn_new(MsnSession *session); | |
86 | |
87 void msn_servconn_destroy(MsnServConn *servconn); | |
88 | |
89 gboolean msn_servconn_connect(MsnServConn *servconn); | |
90 void msn_servconn_disconnect(MsnServConn *servconn); | |
91 | |
92 void msn_servconn_set_server(MsnServConn *servconn, const char *server, | |
93 int port); | |
94 | |
95 const char *msn_servconn_get_server(const MsnServConn *servconn); | |
96 int msn_servconn_get_port(const MsnServConn *servconn); | |
97 | |
98 void msn_servconn_set_connect_cb(MsnServConn *servconn, | |
99 gboolean (*connect_cb)(gpointer, gint, GaimInputCondition)); | |
100 | |
101 void msn_servconn_set_failed_read_cb(MsnServConn *servconn, | |
102 void (*failed_read_cb)(gpointer, gint, GaimInputCondition)); | |
103 | |
104 size_t msn_servconn_write(MsnServConn *servconn, const char *buf, | |
105 size_t size); | |
106 | |
107 gboolean msn_servconn_send_command(MsnServConn *servconn, const char *command, | |
108 const char *params); | |
109 | |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
110 void msn_servconn_queue_message(MsnServConn *servconn, const char *command, |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
111 MsnMessage *msg); |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
112 |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
113 void msn_servconn_unqueue_message(MsnServConn *servconn, MsnMessage *msg); |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
114 |
5309 | 115 void msn_servconn_register_command(MsnServConn *servconn, |
116 const char *command, | |
117 MsnServConnCommandCb cb); | |
118 | |
119 void msn_servconn_register_msg_type(MsnServConn *servconn, | |
120 const char *content_type, | |
121 MsnServConnMsgCb cb); | |
122 | |
123 void msn_servconn_parse_data(gpointer data, gint source, | |
124 GaimInputCondition cond); | |
125 | |
126 #endif /* _MSN_SERVCONN_H_ */ |