libpurple/protocols/msnp9/slpmsg.h

branch
cpw.masca.webkit
changeset 32503
ab886d3a38ae
parent 32502
e64e49502c79
parent 31944
77d17906f1c3
child 32504
8243b910ed4c
equal deleted inserted replaced
32502:e64e49502c79 32503:ab886d3a38ae
1 /**
2 * @file slpmsg.h SLP Message functions
3 *
4 * purple
5 *
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * source distribution.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 */
24 #ifndef _MSN_SLPMSG_H_
25 #define _MSN_SLPMSG_H_
26
27 typedef struct _MsnSlpMessage MsnSlpMessage;
28
29 #include "imgstore.h"
30
31 #include "slpsession.h"
32 #include "slpcall.h"
33 #include "slplink.h"
34 #include "session.h"
35 #include "msg.h"
36
37 #include "slp.h"
38
39 /**
40 * A SLP Message This contains everything that we will need to send a SLP
41 * Message even if has to be sent in several parts.
42 */
43 struct _MsnSlpMessage
44 {
45 MsnSlpSession *slpsession;
46 MsnSlpCall *slpcall; /**< The slpcall to which this slp message belongs (if applicable). */
47 MsnSlpLink *slplink; /**< The slplink through which this slp message is being sent. */
48 MsnSession *session;
49
50 long session_id;
51 long id;
52 long ack_id;
53 long ack_sub_id;
54 long long ack_size;
55 long app_id;
56
57 gboolean sip; /**< A flag that states if this is a SIP slp message. */
58 int ref_count; /**< The reference count. */
59 long flags;
60
61 FILE *fp;
62 PurpleStoredImage *img;
63 guchar *buffer;
64 long long offset;
65 long long size;
66
67 GList *msgs; /**< The real messages. */
68
69 #if 1
70 MsnMessage *msg; /**< The temporary real message that will be sent. */
71 #endif
72
73 #ifdef MSN_DEBUG_SLP
74 char *info;
75 gboolean text_body;
76 #endif
77 };
78
79 /**
80 * Creates a new slp message
81 *
82 * @param slplink The slplink through which this slp message will be sent.
83 * @return The created slp message.
84 */
85 MsnSlpMessage *msn_slpmsg_new(MsnSlpLink *slplink);
86
87 /**
88 * Destroys a slp message
89 *
90 * @param slpmsg The slp message to destory.
91 */
92 void msn_slpmsg_destroy(MsnSlpMessage *slpmsg);
93
94 void msn_slpmsg_set_body(MsnSlpMessage *slpmsg, const char *body,
95 long long size);
96 void msn_slpmsg_set_image(MsnSlpMessage *slpmsg, PurpleStoredImage *img);
97 void msn_slpmsg_open_file(MsnSlpMessage *slpmsg,
98 const char *file_name);
99 MsnSlpMessage * msn_slpmsg_sip_new(MsnSlpCall *slpcall, int cseq,
100 const char *header,
101 const char *branch,
102 const char *content_type,
103 const char *content);
104
105 #ifdef MSN_DEBUG_SLP
106 void msn_slpmsg_show(MsnMessage *msg);
107 #endif
108
109 #endif /* _MSN_SLPMSG_H_ */

mercurial