Mercurial > pidgin
annotate src/protocols/msn/slplink.h @ 13634:8872789902a1
[gaim-migrate @ 16032]
Fix Coverity CID 135, don't dereference before the NULL check
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 15 Apr 2006 13:39:26 +0000 |
parents | 442b23efba54 |
children |
rev | line source |
---|---|
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1 /** |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
2 * @file slplink.h MSNSLP Link support |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
3 * |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
4 * gaim |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
5 * |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
6 * Gaim is the legal property of its developers, whose names are too numerous |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 * source distribution. |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
9 * |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
13 * (at your option) any later version. |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
14 * |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
18 * GNU General Public License for more details. |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
19 * |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
23 */ |
9193 | 24 #ifndef _MSN_SLPLINK_H_ |
25 #define _MSN_SLPLINK_H_ | |
26 | |
27 typedef struct _MsnSlpLink MsnSlpLink; | |
28 | |
29 #include "directconn.h" | |
30 #include "slpcall.h" | |
31 #include "slpmsg.h" | |
32 | |
10345 | 33 #include "switchboard.h" |
34 | |
9193 | 35 #include "ft.h" |
36 | |
13125 | 37 #include "session.h" |
38 | |
39 typedef void (*MsnSlpCb)(MsnSlpCall *slpcall, | |
40 const guchar *data, gsize size); | |
41 typedef void (*MsnSlpEndCb)(MsnSlpCall *slpcall, MsnSession *session); | |
42 | |
9193 | 43 struct _MsnSlpLink |
44 { | |
45 MsnSession *session; | |
10345 | 46 MsnSwitchBoard *swboard; |
9193 | 47 |
48 char *local_user; | |
49 char *remote_user; | |
50 | |
51 int slp_seq_id; | |
52 | |
53 MsnDirectConn *directconn; | |
54 | |
55 GList *slp_calls; | |
56 GList *slp_sessions; | |
57 GList *slp_msgs; | |
58 | |
59 GQueue *slp_msg_queue; | |
60 }; | |
61 | |
62 MsnSlpLink *msn_slplink_new(MsnSession *session, const char *username); | |
63 void msn_slplink_destroy(MsnSlpLink *slplink); | |
64 MsnSlpLink *msn_session_find_slplink(MsnSession *session, | |
10345 | 65 const char *who); |
9193 | 66 MsnSlpLink *msn_session_get_slplink(MsnSession *session, const char *username); |
67 MsnSlpSession *msn_slplink_find_slp_session(MsnSlpLink *slplink, | |
10345 | 68 long session_id); |
10602 | 69 void msn_slplink_add_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall); |
70 void msn_slplink_remove_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall); | |
9193 | 71 MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink, |
10345 | 72 const char *id); |
9193 | 73 MsnSlpCall *msn_slplink_find_slp_call_with_session_id(MsnSlpLink *slplink, long id); |
74 void msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg); | |
10345 | 75 void msn_slplink_release_slpmsg(MsnSlpLink *slplink, |
76 MsnSlpMessage *slpmsg); | |
9193 | 77 void msn_slplink_queue_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); |
78 void msn_slplink_send_slpmsg(MsnSlpLink *slplink, | |
10345 | 79 MsnSlpMessage *slpmsg); |
9193 | 80 void msn_slplink_unleash(MsnSlpLink *slplink); |
81 void msn_slplink_send_ack(MsnSlpLink *slplink, MsnMessage *msg); | |
82 void msn_slplink_process_msg(MsnSlpLink *slplink, MsnMessage *msg); | |
10092 | 83 MsnSlpMessage *msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id); |
9193 | 84 void msn_slplink_append_slp_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); |
85 void msn_slplink_remove_slp_msg(MsnSlpLink *slplink, | |
10345 | 86 MsnSlpMessage *slpmsg); |
9193 | 87 void msn_slplink_request_ft(MsnSlpLink *slplink, GaimXfer *xfer); |
88 | |
89 void msn_slplink_request_object(MsnSlpLink *slplink, | |
10345 | 90 const char *info, |
91 MsnSlpCb cb, | |
92 MsnSlpEndCb end_cb, | |
93 const MsnObject *obj); | |
9193 | 94 |
95 MsnSlpCall *msn_slp_process_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg); | |
96 | |
97 #endif /* _MSN_SLPLINK_H_ */ |