Mercurial > pidgin
annotate src/protocols/msn/servconn.h @ 5718:c19cc2a3d65e
[gaim-migrate @ 6140]
Connecting using the checkbox works again. Sean broke it. Tsk tsk.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Tue, 03 Jun 2003 20:25:21 +0000 |
| parents | 4f72b611f0ee |
| children | 115769a4c6fc |
| 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> | |
| 7 * | |
| 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 | |
| 25 typedef struct _MsnServConn MsnServConn; | |
| 26 | |
| 27 #include "msg.h" | |
| 28 | |
| 29 typedef gboolean (*MsnServConnCommandCb)(MsnServConn *servconn, | |
| 30 const char *cmd, const char **params, | |
| 31 size_t param_count); | |
| 32 | |
|
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
33 typedef gboolean (*MsnServConnMsgCb)(MsnServConn *servconn, MsnMessage *msg); |
| 5309 | 34 |
| 35 #include "session.h" | |
| 36 | |
| 37 struct _MsnServConn | |
| 38 { | |
| 39 MsnSession *session; | |
| 40 | |
| 41 gboolean connected; | |
| 42 | |
| 43 char *server; | |
| 44 int port; | |
| 45 | |
| 46 int fd; | |
| 47 int inpa; | |
| 48 | |
| 49 char *rxqueue; | |
| 50 int rxlen; | |
| 51 | |
|
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
52 GSList *msg_queue; |
|
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
53 |
| 5309 | 54 GSList *txqueue; |
| 55 | |
| 56 gboolean parsing_msg; | |
| 57 char *msg_passport; | |
| 58 char *msg_friendly; | |
| 59 int msg_len; | |
| 60 | |
| 61 GHashTable *commands; | |
| 62 GHashTable *msg_types; | |
| 63 | |
| 64 gboolean (*connect_cb)(gpointer, gint, GaimInputCondition); | |
| 65 void (*failed_read_cb)(gpointer, gint, GaimInputCondition); | |
| 66 void (*login_cb)(gpointer, gint, GaimInputCondition); | |
| 67 | |
| 68 void *data; | |
| 69 }; | |
| 70 | |
| 71 MsnServConn *msn_servconn_new(MsnSession *session); | |
| 72 | |
| 73 void msn_servconn_destroy(MsnServConn *servconn); | |
| 74 | |
| 75 gboolean msn_servconn_connect(MsnServConn *servconn); | |
| 76 void msn_servconn_disconnect(MsnServConn *servconn); | |
| 77 | |
| 78 void msn_servconn_set_server(MsnServConn *servconn, const char *server, | |
| 79 int port); | |
| 80 | |
| 81 const char *msn_servconn_get_server(const MsnServConn *servconn); | |
| 82 int msn_servconn_get_port(const MsnServConn *servconn); | |
| 83 | |
| 84 void msn_servconn_set_connect_cb(MsnServConn *servconn, | |
| 85 gboolean (*connect_cb)(gpointer, gint, GaimInputCondition)); | |
| 86 | |
| 87 void msn_servconn_set_failed_read_cb(MsnServConn *servconn, | |
| 88 void (*failed_read_cb)(gpointer, gint, GaimInputCondition)); | |
| 89 | |
| 90 size_t msn_servconn_write(MsnServConn *servconn, const char *buf, | |
| 91 size_t size); | |
| 92 | |
| 93 gboolean msn_servconn_send_command(MsnServConn *servconn, const char *command, | |
| 94 const char *params); | |
| 95 | |
|
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
96 void msn_servconn_queue_message(MsnServConn *servconn, const char *command, |
|
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
97 MsnMessage *msg); |
|
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
98 |
|
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
99 void msn_servconn_unqueue_message(MsnServConn *servconn, MsnMessage *msg); |
|
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
100 |
| 5309 | 101 void msn_servconn_register_command(MsnServConn *servconn, |
| 102 const char *command, | |
| 103 MsnServConnCommandCb cb); | |
| 104 | |
| 105 void msn_servconn_register_msg_type(MsnServConn *servconn, | |
| 106 const char *content_type, | |
| 107 MsnServConnMsgCb cb); | |
| 108 | |
| 109 void msn_servconn_parse_data(gpointer data, gint source, | |
| 110 GaimInputCondition cond); | |
| 111 | |
| 112 #endif /* _MSN_SERVCONN_H_ */ |
