Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/xfer.h
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
equal deleted inserted replaced
5941:307f53385811 6014:fcb71cb71a3d
     1 /**
       
     2  * @file xfer.h MSN File Transfer 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 
       
    25 #ifndef MSN_XFER_H
       
    26 #define MSN_XFER_H
       
    27 
       
    28 #include "slpcall.h"
       
    29 
       
    30 #define MAX_FILE_NAME_LEN 260 /* MAX_PATH in Windows */
       
    31 
       
    32 /**
       
    33  * The context data for a file transfer request
       
    34  */
       
    35 typedef struct
       
    36 {
       
    37 	guint32   length;       /*< Length of header */
       
    38 	guint32   version;      /*< MSN version */
       
    39 	guint64   file_size;    /*< Size of file */
       
    40 	guint32   type;         /*< Transfer type */
       
    41 	gunichar2 file_name[MAX_FILE_NAME_LEN]; /*< Self-explanatory */
       
    42 	gchar     unknown1[30]; /*< Used somehow for background sharing */
       
    43 	guint32   unknown2;     /*< Possibly for background sharing as well */
       
    44 	gchar     *preview;     /*< File preview data, 96x96 PNG */
       
    45 	gsize     preview_len;
       
    46 } MsnFileContext;
       
    47 
       
    48 #define MSN_FILE_CONTEXT_SIZE (4*4 + 1*8 + 2*MAX_FILE_NAME_LEN + 30)
       
    49 
       
    50 void msn_xfer_init(PurpleXfer *xfer);
       
    51 void msn_xfer_cancel(PurpleXfer *xfer);
       
    52 
       
    53 gssize msn_xfer_write(const guchar *data, gsize len, PurpleXfer *xfer);
       
    54 gssize msn_xfer_read(guchar **data, PurpleXfer *xfer);
       
    55 
       
    56 void msn_xfer_completed_cb(MsnSlpCall *slpcall,
       
    57 						   const guchar *body, gsize size);
       
    58 void msn_xfer_end_cb(MsnSlpCall *slpcall, MsnSession *session);
       
    59 
       
    60 gchar *
       
    61 msn_file_context_to_wire(MsnFileContext *context);
       
    62 
       
    63 MsnFileContext *
       
    64 msn_file_context_from_wire(const char *buf, gsize len);
       
    65 
       
    66 #endif /* MSN_XFER_H */
       
    67