Mercurial > pidgin
annotate src/protocols/msn/servconn.h @ 7072:1350352f5818
[gaim-migrate @ 7637]
Jabber Registration Support
Also, what I think is a bugfix for the request API. If it's not, then
I'm very confused.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 30 Sep 2003 14:37:05 +0000 |
parents | b7e113a59b51 |
children | ff9127038a5a |
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" | |
30 | |
31 typedef gboolean (*MsnServConnCommandCb)(MsnServConn *servconn, | |
32 const char *cmd, const char **params, | |
33 size_t param_count); | |
34 | |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
35 typedef gboolean (*MsnServConnMsgCb)(MsnServConn *servconn, MsnMessage *msg); |
5309 | 36 |
37 #include "session.h" | |
38 | |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
39 typedef enum |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
40 { |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
41 MSN_MULTILINE_MSG, |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
42 MSN_MULTILINE_IPG, |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
43 MSN_MULTILINE_NOT |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
44 |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
45 } MsnMultilineType; |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
46 |
5309 | 47 struct _MsnServConn |
48 { | |
49 MsnSession *session; | |
50 | |
51 gboolean connected; | |
52 | |
53 char *server; | |
54 int port; | |
55 | |
56 int fd; | |
57 int inpa; | |
58 | |
59 char *rxqueue; | |
60 int rxlen; | |
61 | |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
62 GSList *msg_queue; |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
63 |
5309 | 64 GSList *txqueue; |
65 | |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
66 gboolean parsing_multiline; |
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
67 MsnMultilineType multiline_type; |
5309 | 68 char *msg_passport; |
69 char *msg_friendly; | |
5962
115769a4c6fc
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
70 int multiline_len; |
5309 | 71 |
72 GHashTable *commands; | |
73 GHashTable *msg_types; | |
74 | |
75 gboolean (*connect_cb)(gpointer, gint, GaimInputCondition); | |
76 void (*failed_read_cb)(gpointer, gint, GaimInputCondition); | |
77 void (*login_cb)(gpointer, gint, GaimInputCondition); | |
78 | |
79 void *data; | |
80 }; | |
81 | |
82 MsnServConn *msn_servconn_new(MsnSession *session); | |
83 | |
84 void msn_servconn_destroy(MsnServConn *servconn); | |
85 | |
86 gboolean msn_servconn_connect(MsnServConn *servconn); | |
87 void msn_servconn_disconnect(MsnServConn *servconn); | |
88 | |
89 void msn_servconn_set_server(MsnServConn *servconn, const char *server, | |
90 int port); | |
91 | |
92 const char *msn_servconn_get_server(const MsnServConn *servconn); | |
93 int msn_servconn_get_port(const MsnServConn *servconn); | |
94 | |
95 void msn_servconn_set_connect_cb(MsnServConn *servconn, | |
96 gboolean (*connect_cb)(gpointer, gint, GaimInputCondition)); | |
97 | |
98 void msn_servconn_set_failed_read_cb(MsnServConn *servconn, | |
99 void (*failed_read_cb)(gpointer, gint, GaimInputCondition)); | |
100 | |
101 size_t msn_servconn_write(MsnServConn *servconn, const char *buf, | |
102 size_t size); | |
103 | |
104 gboolean msn_servconn_send_command(MsnServConn *servconn, const char *command, | |
105 const char *params); | |
106 | |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
107 void msn_servconn_queue_message(MsnServConn *servconn, const char *command, |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
108 MsnMessage *msg); |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
109 |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
110 void msn_servconn_unqueue_message(MsnServConn *servconn, MsnMessage *msg); |
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
111 |
5309 | 112 void msn_servconn_register_command(MsnServConn *servconn, |
113 const char *command, | |
114 MsnServConnCommandCb cb); | |
115 | |
116 void msn_servconn_register_msg_type(MsnServConn *servconn, | |
117 const char *content_type, | |
118 MsnServConnMsgCb cb); | |
119 | |
120 void msn_servconn_parse_data(gpointer data, gint source, | |
121 GaimInputCondition cond); | |
122 | |
123 #endif /* _MSN_SERVCONN_H_ */ |