annotate libpurple/protocols/msn/xfer.h @ 31558:ce968e115c95

propagate from branch 'im.pidgin.cpw.masca.p2p' (head 33ca865dacb9e5bcf763d06f6a42cbaca337cc64) to branch 'im.pidgin.pidgin' (head 92f47f4e8b0cbb107fd97e1ab814d1cedbf109ad)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 06 May 2011 06:25:14 +0000
parents d143f52ae28e
children 845885bd5e4d 3828a61c44da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30969
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
1 /**
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
2 * @file xfer.h MSN File Transfer functions
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
3 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
4 * purple
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
5 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
8 * source distribution.
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
9 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
10 * This program is free software; you can redistribute it and/or modify
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
11 * it under the terms of the GNU General Public License as published by
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
13 * (at your option) any later version.
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
14 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
15 * This program is distributed in the hope that it will be useful,
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
18 * GNU General Public License for more details.
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
19 *
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
20 * You should have received a copy of the GNU General Public License
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
21 * along with this program; if not, write to the Free Software
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
23 */
72e6fa6caecc These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30832
diff changeset
24
31119
d143f52ae28e Add missing include guard.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31118
diff changeset
25 #ifndef MSN_XFER_H
d143f52ae28e Add missing include guard.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31118
diff changeset
26 #define MSN_XFER_H
30832
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
27
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
28 #include "slpcall.h"
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
29
31046
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
30 #define MAX_FILE_NAME_LEN 260 /* MAX_PATH in Windows */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
31
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
32 /**
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
33 * The context data for a file transfer request
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
34 */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
35 typedef struct
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
36 {
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
37 guint32 length; /*< Length of header */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
38 guint32 version; /*< MSN version */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
39 guint64 file_size; /*< Size of file */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
40 guint32 type; /*< Transfer type */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
41 gunichar2 file_name[MAX_FILE_NAME_LEN]; /*< Self-explanatory */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
42 gchar unknown1[30]; /*< Used somehow for background sharing */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
43 guint32 unknown2; /*< Possibly for background sharing as well */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
44 gchar *preview; /*< File preview data, 96x96 PNG */
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
45 gsize preview_len;
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
46 } MsnFileContext;
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
47
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
48 #define MSN_FILE_CONTEXT_SIZE (4*4 + 1*8 + 2*MAX_FILE_NAME_LEN + 30)
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
49
30832
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
50 void msn_xfer_init(PurpleXfer *xfer);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
51 void msn_xfer_cancel(PurpleXfer *xfer);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
52
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
53 gssize msn_xfer_write(const guchar *data, gsize len, PurpleXfer *xfer);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
54 gssize msn_xfer_read(guchar **data, PurpleXfer *xfer);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
55
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
56 void msn_xfer_completed_cb(MsnSlpCall *slpcall,
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
57 const guchar *body, gsize size);
eabeba9c823f Move msn_xfer code to it's own module aiming to simplify slp code.
masca@cpw.pidgin.im
parents:
diff changeset
58 void msn_xfer_end_cb(MsnSlpCall *slpcall, MsnSession *session);
31046
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
59
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
60 gchar *
31118
9ccbd0302bb2 Change MsnFileContext variables from "header" to "context". This it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31046
diff changeset
61 msn_file_context_to_wire(MsnFileContext *context);
31046
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
62
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
63 MsnFileContext *
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
64 msn_file_context_from_wire(const char *buf, gsize len);
b4064198e017 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30969
diff changeset
65
31119
d143f52ae28e Add missing include guard.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31118
diff changeset
66 #endif /* MSN_XFER_H */
d143f52ae28e Add missing include guard.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31118
diff changeset
67