libpurple/protocols/msn/ft.h

Mon, 10 Feb 2014 16:22:00 +0530

author
Ankit Vani <a@nevitus.org>
date
Mon, 10 Feb 2014 16:22:00 +0530
branch
soc.2013.gobjectification.plugins
changeset 37108
73c5fb6d78b3
parent 35115
ba7dbf5e91d3
permissions
-rw-r--r--

Merged default branch

31180
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
1 /**
34914
d5f0fbacfbc8 Refactored msn to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents: 32661
diff changeset
2 * @file ft.h MSN File Transfer functions
31180
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
3 *
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
4 * purple
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
5 *
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
8 * source distribution.
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
9 *
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
11 * it under the terms of the GNU General Public License as published by
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
13 * (at your option) any later version.
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
14 *
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
15 * This program is distributed in the hope that it will be useful,
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
18 * GNU General Public License for more details.
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
19 *
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
20 * You should have received a copy of the GNU General Public License
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
21 * along with this program; if not, write to the Free Software
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
23 */
3f527ea0d2ea These new files are missing GPL headers. And fix a couple incorrect
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31034
diff changeset
24
34914
d5f0fbacfbc8 Refactored msn to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents: 32661
diff changeset
25 #ifndef MSN_FT_H
d5f0fbacfbc8 Refactored msn to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents: 32661
diff changeset
26 #define MSN_FT_H
31034
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
27
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
28 #include "slpcall.h"
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
29
31249
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
30 #define MAX_FILE_NAME_LEN 260 /* MAX_PATH in Windows */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
31
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
32 /**
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
33 * The context data for a file transfer request
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
34 */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
35 typedef struct
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
36 {
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
37 guint32 length; /*< Length of header */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
38 guint32 version; /*< MSN version */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
39 guint64 file_size; /*< Size of file */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
40 guint32 type; /*< Transfer type */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
41 gunichar2 file_name[MAX_FILE_NAME_LEN]; /*< Self-explanatory */
32659
a0c5b6db8ee5 Since we don't know what these fields are, and we don't use them,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31337
diff changeset
42 #if 0
31249
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
43 gchar unknown1[30]; /*< Used somehow for background sharing */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
44 guint32 unknown2; /*< Possibly for background sharing as well */
32659
a0c5b6db8ee5 Since we don't know what these fields are, and we don't use them,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31337
diff changeset
45 #endif
31249
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
46 gchar *preview; /*< File preview data, 96x96 PNG */
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
47 gsize preview_len;
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
48 } MsnFileContext;
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
49
32661
267de0b8a2cc Add support for file context v0, which is used by older official MSN
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32659
diff changeset
50 #define MSN_FILE_CONTEXT_SIZE_V0 (4*3 + 1*8 + 2*MAX_FILE_NAME_LEN)
267de0b8a2cc Add support for file context v0, which is used by older official MSN
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32659
diff changeset
51 #define MSN_FILE_CONTEXT_SIZE_V2 (MSN_FILE_CONTEXT_SIZE_V0 + 4*1 + 30)
267de0b8a2cc Add support for file context v0, which is used by older official MSN
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32659
diff changeset
52 #define MSN_FILE_CONTEXT_SIZE_V3 (MSN_FILE_CONTEXT_SIZE_V2 + 63)
31249
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
53
31034
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
54 void msn_xfer_init(PurpleXfer *xfer);
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
55 void msn_xfer_cancel(PurpleXfer *xfer);
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
56
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
57 gssize msn_xfer_write(const guchar *data, gsize len, PurpleXfer *xfer);
35115
ba7dbf5e91d3 PurpleXfer API: Added a buffer size parameter to the 'read' callback
Ankit Vani <a@nevitus.org>
parents: 34914
diff changeset
58 gssize msn_xfer_read(guchar **data, gsize size, PurpleXfer *xfer);
31034
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
59
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
60 void msn_xfer_completed_cb(MsnSlpCall *slpcall,
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
61 const guchar *body, gsize size);
d5bc0b03e482 Move msn_xfer code to it's own module aiming to simplify slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents:
diff changeset
62 void msn_xfer_end_cb(MsnSlpCall *slpcall, MsnSession *session);
31249
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
63
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
64 gchar *
31336
1a91c541c5c5 Change MsnFileContext variables from "header" to "context". This it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31249
diff changeset
65 msn_file_context_to_wire(MsnFileContext *context);
31249
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
66
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
67 MsnFileContext *
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
68 msn_file_context_from_wire(const char *buf, gsize len);
b6c1a0a39131 Add functions for reading and writing a MsnFileContext which negates
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31180
diff changeset
69
34914
d5f0fbacfbc8 Refactored msn to use the GObject xfer API.
Ankit Vani <a@nevitus.org>
parents: 32661
diff changeset
70 #endif /* MSN_FT_H */
31337
c05045a12302 Add missing include guard.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31336
diff changeset
71

mercurial