Home » Archimedes archive » Archimedes World » archimedes_world_volume_14_issue_12_scp.adf » !AcornAns_AcornAns » !Brolly/h/xfersend

!Brolly/h/xfersend

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » archimedes_world_volume_14_issue_12_scp.adf » !AcornAns_AcornAns
Filename: !Brolly/h/xfersend
Read OK:
File size: 2B13 bytes
Load address: 0000
Exec address: 0000
File contents
/****************************************************************************
 * This source file was written by Acorn Computers Limited. It is part of   *
 * the RISCOS library for writing applications in C for RISC OS. It may be  *
 * used freely in the creation of programs for Archimedes. It should be     *
 * used with Acorn's C Compiler Release 3 or later.                         *
 *                                                                          *
 ***************************************************************************/

/************************************************************************/
/*                                                                      */
/* Modified 14/2/93 by Michael Rozdoba.                                 */
/*                                                                      */
/* See c.xfersend for details of alterations                            */
/* IMPORTANT: if using this file as a supplement to old version of lib  */
/* when #including this file elsewhere ensure that it has high position */
/* in the list of includes such that this file is included & not the    */
/* old lib header file (eg if you place this below an include to saveas */
/* then saveas itself will include xfersend, & as a result of the search*/
/* rules, the lib version will be included rather than this one).       */
/*                                                                      */
/************************************************************************/

/* Title:   xfersend.h
 * Purpose: general purpose export of data by dragging icon
 *
 */

#ifndef __xfersend_h
#define __xfersend_h

#ifndef BOOL
#define BOOL int
#define TRUE 1
#define FALSE 0
#endif

#ifndef __wimp_h
#include "wimp.h"
#endif
                                      

/************************ ADDITIONAL FUNCTIONS *****************************/

BOOL using_os3(void);
os_error *dragasprite_start(int flags, sprite_area *area, char *name, wimp_box *box);
os_error *dragasprite_stop(void);

/******************* CALLER-SUPPLIED FUNCTION TYPES ************************/

/* ------------------------ xfersend_saveproc ------------------------------
 * Description:   A function of this type should save to the given file and
 *                return TRUE if successful. Handle is passed to the
 *                function by xfersend().
 *
 * Parameters:    char *filename -- file to be saved
 *                void *handle -- the handle you passed to xfersend()
 * Returns:       The function must return TRUE if save was successful.
 * Other Info:    none.
 *
 */

typedef BOOL (*xfersend_saveproc)(char *filename, void *handle);


/* ----------------------- xfersend_sendproc -------------------------------
 * Description:   A function of this type should call xfersend_sendbuf() 
 *                to send one "buffer-full" of data no bigger than
 *                *maxbuf.
 *
 * Parameters:    void *handle -- handle which was passed to xfersend
 *                int *maxbuf -- size of receiver's buffer
 * Returns:       The function must return TRUE if data was successfully 
 *                transmitted.
 * Other Info:    Note: Your sendproc will be called by functions in the
 *                xfersend module to do an in-core data transfer, on 
 *                receipt of MRAMFetch messages from the receiving 
 *                application. If xfersend_sendbuf() returns FALSE, then
 *                return FALSE **IMMEDIATELY**.
 *
 */
 
typedef BOOL (*xfersend_sendproc)(void *handle, int *maxbuf);


/* --------------------------- xfersend_printproc --------------------------
 * Description:   A function of this type should either print the file
 *                directly, or save it into the given filename, from
 *                where it will be printed by the printer application.
 *
 * Parameters:    char *filename -- file to save into, for printing
 *                void *handle -- handle that was passed to xfersend()
 * Returns:       The function should return either the file type of the
 *                file it saved, or one of the reason codes #defined below.
 *               
 * Other Info:    This is called if the file icon has been dragged onto a
 *                printer application.
 *
 */

typedef int (*xfersend_printproc)(char *filename, void *handle);

#define xfersend_printPrinted -1    /* file dealt with internally */
#define xfersend_printFailed  -2    /* had an error along the way */

/* The saveproc should report any errors it encounters itself. If saving
   to a file, it should convert the data into a type that can be printed by
   the printer application (i.e. text). */


/*************************** LIBRARY FUNCTIONS *****************************/


/* ----------------------------- xfersend ----------------------------------
 * Description:   Allows the user to export application data, by icon drag.
 *
 * Parameters:    int filetype -- type of file to save to
 *                char *name -- suggested file name
 *                int estsize -- estimated size of the file
 *                xfersend_saveproc -- caller-supplied function for saving
 *                                     application data to a file
 *                xfersend_sendproc -- caller-supplied function for in-core
 *                                     data transfer (if application is able
 *                                     to do this)
 *                xfersend_printproc -- caller-supplied function for printing
 *                                      application data, if "icon" is
 *                                      dragged onto printer application
 *                wimp_eventstr *e --  the event which started the export
 *                                     (usually mouse drag)
 *                void *handle -- handle to be passed to handler functions.
 * Returns:       TRUE if data exported successfully.
 * Other Info:    You should typically call this function in a window's
 *                event handler, when you get a "mouse drag" event.
 *                See the "saveas.c" code for an example of this.
 *                xfersend deals with the complexities of message-passing
 *                protocols to achieve the data transfer. Refer to the above
 *                typedefs for an explanation of what the three 
 *                caller-supplied functions should do.
 *                If "name" is 0 then a default name of "Selection" is
 *                supplied.
 *                If you pass 0 as the xfersend_sendproc, then no in-core
 *                data transfer will be attempted
 *                If you pass 0 as the xfersend_printproc, then the file
 *                format for printing is assumed to be the same as for saving
 *                The estimated file size is not essential, but may improve
 *                performance.
 *
 */
  
BOOL xfersend(int filetype, char *name, int estsize,
              xfersend_saveproc, xfersend_sendproc, xfersend_printproc,
              wimp_eventstr *e, void *handle);


/* ------------------------ xfersend_sendbuf -------------------------------
 * Description:   Sends the given buffer to a receiver.
 *
 * Parameters:    char *buffer -- the buffer to be sent
 *                int size -- the number of characters placed in the buffer
 * Returns:       TRUE if send was successful.
 * Other Info:    This function should be called by the caller-supplied
 *                xfersend_sendproc (if such exists) to do in-core data
 *                transfer (see notes on xfersend_sendproc above).
 *
 */

BOOL xfersend_sendbuf(char *buffer, int size);


/* ------------------------ xfersend_file_is_safe --------------------------
 * Description:   Informs caller if the file's name can be reliably assumed
 *                not to change (during data transfer!!)
 *
 * Parameters:    void
 * Returns:       TRUE if file is "safe".
 * Other Info:    See also the xferrecv module.
 *
 */

BOOL xfersend_file_is_safe(void) ;

/* Returns TRUE if file recipient will not modify it; changing the
   window title of the file can be done conditionally on this result. This
   can be called within your xfersend_saveproc,sendproc, or printproc,
   or immediately after the main xfersend. */

/* ---------------------------- xfersend_set_fileissafe --------------------
 * Description:   Allows caller to set an indication of whether a file's
 *                name will remain unchanged during data transfer.
 *
 * Parameters:    BOOL value -- TRUE means file is safe.
 * Returns:       void.
 * Other Info:    none.
 *
 */

void xfersend_set_fileissafe(BOOL value);

/* --------------------------- xfersend_close_on_xfer ----------------------
 * Description:   Tells xfersend whether to close "parent" window after
 *                icon-drag export.
 *
 * Parameters:    BOOL do_we_close -- TRUE means close window after export.
 *                wimp_w w -- handle of window to close (presumably "parent"
 *                            window.
 * Returns:       void.
 * Other Info:    The default is to not close the window after export.
 *                Once used, this function should be called before each
 *                call to xfersend().
 *
 */

void xfersend_close_on_xfer(BOOL do_we_close, wimp_w w);


/* --------------------------- xfersend_clear_unknowns ----------------------
 * Description:   Removes any unknown event processors registered by xfersend
 *                or xfersend_pipe.
 *
 * Parameters:    void.
 * Returns:       void.
 * Other Info:    xfersend and xfersend_pipe use unknown event processors to
 *                deal with inter-application data transfer.  These may be
 *                left around after completion of the transfer (especially if
 *                the transfer failed).  This function should be called when it
 *                is known that the transfer has ended.
 *
 */

void xfersend_clear_unknowns(void);


/* --------------------------- xfersend_read_last_ref -----------------------
 * Description:   Returns the my_ref value of the last wimp_MDATASAVE or
 *                wimp_MDATALOAD message sent by xfersend or xfersend_pipe.
 *
 * Parameters:    void.
 * Returns:       integer message reference
 * Other Info:    After saving a file to another application (ie. where the
 *                resulting file is not 'safe', the my_ref value of the
 *                final wimp_MDATALOAD should be stored with the document
 *                data, so that if a wimp_MDATASAVED is received, the
 *                document can be marked unmodified.  If the document is
 *                modified after being saved, the last_ref value should be
 *                reset to 0, so that a subsequent wimp_MDATASAVED message
 *                will not cause the document to be marked unmodified.
 *                NB: If RAM transfer is used, the my_ref of the datasave
 *                message should be stored instead.
 */

int xfersend_read_last_ref(void);

#endif

/* end xfersend.h */
00000000  2f 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/***************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000040  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 0a 20 2a  |*************. *|
00000050  20 54 68 69 73 20 73 6f  75 72 63 65 20 66 69 6c  | This source fil|
00000060  65 20 77 61 73 20 77 72  69 74 74 65 6e 20 62 79  |e was written by|
00000070  20 41 63 6f 72 6e 20 43  6f 6d 70 75 74 65 72 73  | Acorn Computers|
00000080  20 4c 69 6d 69 74 65 64  2e 20 49 74 20 69 73 20  | Limited. It is |
00000090  70 61 72 74 20 6f 66 20  20 20 2a 0a 20 2a 20 74  |part of   *. * t|
000000a0  68 65 20 52 49 53 43 4f  53 20 6c 69 62 72 61 72  |he RISCOS librar|
000000b0  79 20 66 6f 72 20 77 72  69 74 69 6e 67 20 61 70  |y for writing ap|
000000c0  70 6c 69 63 61 74 69 6f  6e 73 20 69 6e 20 43 20  |plications in C |
000000d0  66 6f 72 20 52 49 53 43  20 4f 53 2e 20 49 74 20  |for RISC OS. It |
000000e0  6d 61 79 20 62 65 20 20  2a 0a 20 2a 20 75 73 65  |may be  *. * use|
000000f0  64 20 66 72 65 65 6c 79  20 69 6e 20 74 68 65 20  |d freely in the |
00000100  63 72 65 61 74 69 6f 6e  20 6f 66 20 70 72 6f 67  |creation of prog|
00000110  72 61 6d 73 20 66 6f 72  20 41 72 63 68 69 6d 65  |rams for Archime|
00000120  64 65 73 2e 20 49 74 20  73 68 6f 75 6c 64 20 62  |des. It should b|
00000130  65 20 20 20 20 20 2a 0a  20 2a 20 75 73 65 64 20  |e     *. * used |
00000140  77 69 74 68 20 41 63 6f  72 6e 27 73 20 43 20 43  |with Acorn's C C|
00000150  6f 6d 70 69 6c 65 72 20  52 65 6c 65 61 73 65 20  |ompiler Release |
00000160  33 20 6f 72 20 6c 61 74  65 72 2e 20 20 20 20 20  |3 or later.     |
00000170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000180  20 20 20 20 2a 0a 20 2a  20 20 20 20 20 20 20 20  |    *. *        |
00000190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000001d0  20 20 2a 0a 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |  *. ***********|
000001e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000220  2f 0a 0a 2f 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/../************|
00000230  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000260  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2f 0a 2f 2a  |************/./*|
00000270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000002b0  20 20 20 20 20 20 2a 2f  0a 2f 2a 20 4d 6f 64 69  |      */./* Modi|
000002c0  66 69 65 64 20 31 34 2f  32 2f 39 33 20 62 79 20  |fied 14/2/93 by |
000002d0  4d 69 63 68 61 65 6c 20  52 6f 7a 64 6f 62 61 2e  |Michael Rozdoba.|
000002e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000300  20 2a 2f 0a 2f 2a 20 20  20 20 20 20 20 20 20 20  | */./*          |
00000310  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000340  20 20 20 20 20 20 20 20  20 20 20 20 2a 2f 0a 2f  |            */./|
00000350  2a 20 53 65 65 20 63 2e  78 66 65 72 73 65 6e 64  |* See c.xfersend|
00000360  20 66 6f 72 20 64 65 74  61 69 6c 73 20 6f 66 20  | for details of |
00000370  61 6c 74 65 72 61 74 69  6f 6e 73 20 20 20 20 20  |alterations     |
00000380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000390  20 20 20 20 20 20 20 2a  2f 0a 2f 2a 20 49 4d 50  |       */./* IMP|
000003a0  4f 52 54 41 4e 54 3a 20  69 66 20 75 73 69 6e 67  |ORTANT: if using|
000003b0  20 74 68 69 73 20 66 69  6c 65 20 61 73 20 61 20  | this file as a |
000003c0  73 75 70 70 6c 65 6d 65  6e 74 20 74 6f 20 6f 6c  |supplement to ol|
000003d0  64 20 76 65 72 73 69 6f  6e 20 6f 66 20 6c 69 62  |d version of lib|
000003e0  20 20 2a 2f 0a 2f 2a 20  77 68 65 6e 20 23 69 6e  |  */./* when #in|
000003f0  63 6c 75 64 69 6e 67 20  74 68 69 73 20 66 69 6c  |cluding this fil|
00000400  65 20 65 6c 73 65 77 68  65 72 65 20 65 6e 73 75  |e elsewhere ensu|
00000410  72 65 20 74 68 61 74 20  69 74 20 68 61 73 20 68  |re that it has h|
00000420  69 67 68 20 70 6f 73 69  74 69 6f 6e 20 2a 2f 0a  |igh position */.|
00000430  2f 2a 20 69 6e 20 74 68  65 20 6c 69 73 74 20 6f  |/* in the list o|
00000440  66 20 69 6e 63 6c 75 64  65 73 20 73 75 63 68 20  |f includes such |
00000450  74 68 61 74 20 74 68 69  73 20 66 69 6c 65 20 69  |that this file i|
00000460  73 20 69 6e 63 6c 75 64  65 64 20 26 20 6e 6f 74  |s included & not|
00000470  20 74 68 65 20 20 20 20  2a 2f 0a 2f 2a 20 6f 6c  | the    */./* ol|
00000480  64 20 6c 69 62 20 68 65  61 64 65 72 20 66 69 6c  |d lib header fil|
00000490  65 20 28 65 67 20 69 66  20 79 6f 75 20 70 6c 61  |e (eg if you pla|
000004a0  63 65 20 74 68 69 73 20  62 65 6c 6f 77 20 61 6e  |ce this below an|
000004b0  20 69 6e 63 6c 75 64 65  20 74 6f 20 73 61 76 65  | include to save|
000004c0  61 73 20 2a 2f 0a 2f 2a  20 74 68 65 6e 20 73 61  |as */./* then sa|
000004d0  76 65 61 73 20 69 74 73  65 6c 66 20 77 69 6c 6c  |veas itself will|
000004e0  20 69 6e 63 6c 75 64 65  20 78 66 65 72 73 65 6e  | include xfersen|
000004f0  64 2c 20 26 20 61 73 20  61 20 72 65 73 75 6c 74  |d, & as a result|
00000500  20 6f 66 20 74 68 65 20  73 65 61 72 63 68 2a 2f  | of the search*/|
00000510  0a 2f 2a 20 72 75 6c 65  73 2c 20 74 68 65 20 6c  |./* rules, the l|
00000520  69 62 20 76 65 72 73 69  6f 6e 20 77 69 6c 6c 20  |ib version will |
00000530  62 65 20 69 6e 63 6c 75  64 65 64 20 72 61 74 68  |be included rath|
00000540  65 72 20 74 68 61 6e 20  74 68 69 73 20 6f 6e 65  |er than this one|
00000550  29 2e 20 20 20 20 20 20  20 2a 2f 0a 2f 2a 20 20  |).       */./*  |
00000560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000005a0  20 20 20 20 2a 2f 0a 2f  2a 2a 2a 2a 2a 2a 2a 2a  |    */./********|
000005b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000005f0  2f 0a 0a 2f 2a 20 54 69  74 6c 65 3a 20 20 20 78  |/../* Title:   x|
00000600  66 65 72 73 65 6e 64 2e  68 0a 20 2a 20 50 75 72  |fersend.h. * Pur|
00000610  70 6f 73 65 3a 20 67 65  6e 65 72 61 6c 20 70 75  |pose: general pu|
00000620  72 70 6f 73 65 20 65 78  70 6f 72 74 20 6f 66 20  |rpose export of |
00000630  64 61 74 61 20 62 79 20  64 72 61 67 67 69 6e 67  |data by dragging|
00000640  20 69 63 6f 6e 0a 20 2a  0a 20 2a 2f 0a 0a 23 69  | icon. *. */..#i|
00000650  66 6e 64 65 66 20 5f 5f  78 66 65 72 73 65 6e 64  |fndef __xfersend|
00000660  5f 68 0a 23 64 65 66 69  6e 65 20 5f 5f 78 66 65  |_h.#define __xfe|
00000670  72 73 65 6e 64 5f 68 0a  0a 23 69 66 6e 64 65 66  |rsend_h..#ifndef|
00000680  20 42 4f 4f 4c 0a 23 64  65 66 69 6e 65 20 42 4f  | BOOL.#define BO|
00000690  4f 4c 20 69 6e 74 0a 23  64 65 66 69 6e 65 20 54  |OL int.#define T|
000006a0  52 55 45 20 31 0a 23 64  65 66 69 6e 65 20 46 41  |RUE 1.#define FA|
000006b0  4c 53 45 20 30 0a 23 65  6e 64 69 66 0a 0a 23 69  |LSE 0.#endif..#i|
000006c0  66 6e 64 65 66 20 5f 5f  77 69 6d 70 5f 68 0a 23  |fndef __wimp_h.#|
000006d0  69 6e 63 6c 75 64 65 20  22 77 69 6d 70 2e 68 22  |include "wimp.h"|
000006e0  0a 23 65 6e 64 69 66 0a  20 20 20 20 20 20 20 20  |.#endif.        |
000006f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 0a 0a  |              ..|
00000710  2f 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/***************|
00000720  2a 2a 2a 2a 2a 2a 2a 2a  2a 20 41 44 44 49 54 49  |********* ADDITI|
00000730  4f 4e 41 4c 20 46 55 4e  43 54 49 4f 4e 53 20 2a  |ONAL FUNCTIONS *|
00000740  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000750  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2f 0a 0a 42  |************/..B|
00000760  4f 4f 4c 20 75 73 69 6e  67 5f 6f 73 33 28 76 6f  |OOL using_os3(vo|
00000770  69 64 29 3b 0a 6f 73 5f  65 72 72 6f 72 20 2a 64  |id);.os_error *d|
00000780  72 61 67 61 73 70 72 69  74 65 5f 73 74 61 72 74  |ragasprite_start|
00000790  28 69 6e 74 20 66 6c 61  67 73 2c 20 73 70 72 69  |(int flags, spri|
000007a0  74 65 5f 61 72 65 61 20  2a 61 72 65 61 2c 20 63  |te_area *area, c|
000007b0  68 61 72 20 2a 6e 61 6d  65 2c 20 77 69 6d 70 5f  |har *name, wimp_|
000007c0  62 6f 78 20 2a 62 6f 78  29 3b 0a 6f 73 5f 65 72  |box *box);.os_er|
000007d0  72 6f 72 20 2a 64 72 61  67 61 73 70 72 69 74 65  |ror *dragasprite|
000007e0  5f 73 74 6f 70 28 76 6f  69 64 29 3b 0a 0a 2f 2a  |_stop(void);../*|
000007f0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000800  2a 2a 20 43 41 4c 4c 45  52 2d 53 55 50 50 4c 49  |** CALLER-SUPPLI|
00000810  45 44 20 46 55 4e 43 54  49 4f 4e 20 54 59 50 45  |ED FUNCTION TYPE|
00000820  53 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |S **************|
00000830  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2f 0a 0a 2f 2a 20  |**********/../* |
00000840  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000850  2d 2d 2d 2d 2d 2d 2d 2d  20 78 66 65 72 73 65 6e  |-------- xfersen|
00000860  64 5f 73 61 76 65 70 72  6f 63 20 2d 2d 2d 2d 2d  |d_saveproc -----|
00000870  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000880  2d 2d 2d 2d 2d 2d 2d 2d  2d 0a 20 2a 20 44 65 73  |---------. * Des|
00000890  63 72 69 70 74 69 6f 6e  3a 20 20 20 41 20 66 75  |cription:   A fu|
000008a0  6e 63 74 69 6f 6e 20 6f  66 20 74 68 69 73 20 74  |nction of this t|
000008b0  79 70 65 20 73 68 6f 75  6c 64 20 73 61 76 65 20  |ype should save |
000008c0  74 6f 20 74 68 65 20 67  69 76 65 6e 20 66 69 6c  |to the given fil|
000008d0  65 20 61 6e 64 0a 20 2a  20 20 20 20 20 20 20 20  |e and. *        |
000008e0  20 20 20 20 20 20 20 20  72 65 74 75 72 6e 20 54  |        return T|
000008f0  52 55 45 20 69 66 20 73  75 63 63 65 73 73 66 75  |RUE if successfu|
00000900  6c 2e 20 48 61 6e 64 6c  65 20 69 73 20 70 61 73  |l. Handle is pas|
00000910  73 65 64 20 74 6f 20 74  68 65 0a 20 2a 20 20 20  |sed to the. *   |
00000920  20 20 20 20 20 20 20 20  20 20 20 20 20 66 75 6e  |             fun|
00000930  63 74 69 6f 6e 20 62 79  20 78 66 65 72 73 65 6e  |ction by xfersen|
00000940  64 28 29 2e 0a 20 2a 0a  20 2a 20 50 61 72 61 6d  |d().. *. * Param|
00000950  65 74 65 72 73 3a 20 20  20 20 63 68 61 72 20 2a  |eters:    char *|
00000960  66 69 6c 65 6e 61 6d 65  20 2d 2d 20 66 69 6c 65  |filename -- file|
00000970  20 74 6f 20 62 65 20 73  61 76 65 64 0a 20 2a 20  | to be saved. * |
00000980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 76  |               v|
00000990  6f 69 64 20 2a 68 61 6e  64 6c 65 20 2d 2d 20 74  |oid *handle -- t|
000009a0  68 65 20 68 61 6e 64 6c  65 20 79 6f 75 20 70 61  |he handle you pa|
000009b0  73 73 65 64 20 74 6f 20  78 66 65 72 73 65 6e 64  |ssed to xfersend|
000009c0  28 29 0a 20 2a 20 52 65  74 75 72 6e 73 3a 20 20  |(). * Returns:  |
000009d0  20 20 20 20 20 54 68 65  20 66 75 6e 63 74 69 6f  |     The functio|
000009e0  6e 20 6d 75 73 74 20 72  65 74 75 72 6e 20 54 52  |n must return TR|
000009f0  55 45 20 69 66 20 73 61  76 65 20 77 61 73 20 73  |UE if save was s|
00000a00  75 63 63 65 73 73 66 75  6c 2e 0a 20 2a 20 4f 74  |uccessful.. * Ot|
00000a10  68 65 72 20 49 6e 66 6f  3a 20 20 20 20 6e 6f 6e  |her Info:    non|
00000a20  65 2e 0a 20 2a 0a 20 2a  2f 0a 0a 74 79 70 65 64  |e.. *. */..typed|
00000a30  65 66 20 42 4f 4f 4c 20  28 2a 78 66 65 72 73 65  |ef BOOL (*xferse|
00000a40  6e 64 5f 73 61 76 65 70  72 6f 63 29 28 63 68 61  |nd_saveproc)(cha|
00000a50  72 20 2a 66 69 6c 65 6e  61 6d 65 2c 20 76 6f 69  |r *filename, voi|
00000a60  64 20 2a 68 61 6e 64 6c  65 29 3b 0a 0a 0a 2f 2a  |d *handle);.../*|
00000a70  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
00000a80  2d 2d 2d 2d 2d 2d 2d 2d  20 78 66 65 72 73 65 6e  |-------- xfersen|
00000a90  64 5f 73 65 6e 64 70 72  6f 63 20 2d 2d 2d 2d 2d  |d_sendproc -----|
00000aa0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000ab0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 20 2a 20 44 65  |----------. * De|
00000ac0  73 63 72 69 70 74 69 6f  6e 3a 20 20 20 41 20 66  |scription:   A f|
00000ad0  75 6e 63 74 69 6f 6e 20  6f 66 20 74 68 69 73 20  |unction of this |
00000ae0  74 79 70 65 20 73 68 6f  75 6c 64 20 63 61 6c 6c  |type should call|
00000af0  20 78 66 65 72 73 65 6e  64 5f 73 65 6e 64 62 75  | xfersend_sendbu|
00000b00  66 28 29 20 0a 20 2a 20  20 20 20 20 20 20 20 20  |f() . *         |
00000b10  20 20 20 20 20 20 20 74  6f 20 73 65 6e 64 20 6f  |       to send o|
00000b20  6e 65 20 22 62 75 66 66  65 72 2d 66 75 6c 6c 22  |ne "buffer-full"|
00000b30  20 6f 66 20 64 61 74 61  20 6e 6f 20 62 69 67 67  | of data no bigg|
00000b40  65 72 20 74 68 61 6e 0a  20 2a 20 20 20 20 20 20  |er than. *      |
00000b50  20 20 20 20 20 20 20 20  20 20 2a 6d 61 78 62 75  |          *maxbu|
00000b60  66 2e 0a 20 2a 0a 20 2a  20 50 61 72 61 6d 65 74  |f.. *. * Paramet|
00000b70  65 72 73 3a 20 20 20 20  76 6f 69 64 20 2a 68 61  |ers:    void *ha|
00000b80  6e 64 6c 65 20 2d 2d 20  68 61 6e 64 6c 65 20 77  |ndle -- handle w|
00000b90  68 69 63 68 20 77 61 73  20 70 61 73 73 65 64 20  |hich was passed |
00000ba0  74 6f 20 78 66 65 72 73  65 6e 64 0a 20 2a 20 20  |to xfersend. *  |
00000bb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 69 6e  |              in|
00000bc0  74 20 2a 6d 61 78 62 75  66 20 2d 2d 20 73 69 7a  |t *maxbuf -- siz|
00000bd0  65 20 6f 66 20 72 65 63  65 69 76 65 72 27 73 20  |e of receiver's |
00000be0  62 75 66 66 65 72 0a 20  2a 20 52 65 74 75 72 6e  |buffer. * Return|
00000bf0  73 3a 20 20 20 20 20 20  20 54 68 65 20 66 75 6e  |s:       The fun|
00000c00  63 74 69 6f 6e 20 6d 75  73 74 20 72 65 74 75 72  |ction must retur|
00000c10  6e 20 54 52 55 45 20 69  66 20 64 61 74 61 20 77  |n TRUE if data w|
00000c20  61 73 20 73 75 63 63 65  73 73 66 75 6c 6c 79 20  |as successfully |
00000c30  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
00000c40  20 20 20 74 72 61 6e 73  6d 69 74 74 65 64 2e 0a  |   transmitted..|
00000c50  20 2a 20 4f 74 68 65 72  20 49 6e 66 6f 3a 20 20  | * Other Info:  |
00000c60  20 20 4e 6f 74 65 3a 20  59 6f 75 72 20 73 65 6e  |  Note: Your sen|
00000c70  64 70 72 6f 63 20 77 69  6c 6c 20 62 65 20 63 61  |dproc will be ca|
00000c80  6c 6c 65 64 20 62 79 20  66 75 6e 63 74 69 6f 6e  |lled by function|
00000c90  73 20 69 6e 20 74 68 65  0a 20 2a 20 20 20 20 20  |s in the. *     |
00000ca0  20 20 20 20 20 20 20 20  20 20 20 78 66 65 72 73  |           xfers|
00000cb0  65 6e 64 20 6d 6f 64 75  6c 65 20 74 6f 20 64 6f  |end module to do|
00000cc0  20 61 6e 20 69 6e 2d 63  6f 72 65 20 64 61 74 61  | an in-core data|
00000cd0  20 74 72 61 6e 73 66 65  72 2c 20 6f 6e 20 0a 20  | transfer, on . |
00000ce0  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00000cf0  20 72 65 63 65 69 70 74  20 6f 66 20 4d 52 41 4d  | receipt of MRAM|
00000d00  46 65 74 63 68 20 6d 65  73 73 61 67 65 73 20 66  |Fetch messages f|
00000d10  72 6f 6d 20 74 68 65 20  72 65 63 65 69 76 69 6e  |rom the receivin|
00000d20  67 20 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |g . *           |
00000d30  20 20 20 20 20 61 70 70  6c 69 63 61 74 69 6f 6e  |     application|
00000d40  2e 20 49 66 20 78 66 65  72 73 65 6e 64 5f 73 65  |. If xfersend_se|
00000d50  6e 64 62 75 66 28 29 20  72 65 74 75 72 6e 73 20  |ndbuf() returns |
00000d60  46 41 4c 53 45 2c 20 74  68 65 6e 0a 20 2a 20 20  |FALSE, then. *  |
00000d70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 65  |              re|
00000d80  74 75 72 6e 20 46 41 4c  53 45 20 2a 2a 49 4d 4d  |turn FALSE **IMM|
00000d90  45 44 49 41 54 45 4c 59  2a 2a 2e 0a 20 2a 0a 20  |EDIATELY**.. *. |
00000da0  2a 2f 0a 20 0a 74 79 70  65 64 65 66 20 42 4f 4f  |*/. .typedef BOO|
00000db0  4c 20 28 2a 78 66 65 72  73 65 6e 64 5f 73 65 6e  |L (*xfersend_sen|
00000dc0  64 70 72 6f 63 29 28 76  6f 69 64 20 2a 68 61 6e  |dproc)(void *han|
00000dd0  64 6c 65 2c 20 69 6e 74  20 2a 6d 61 78 62 75 66  |dle, int *maxbuf|
00000de0  29 3b 0a 0a 0a 2f 2a 20  2d 2d 2d 2d 2d 2d 2d 2d  |);.../* --------|
00000df0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000e00  2d 2d 2d 20 78 66 65 72  73 65 6e 64 5f 70 72 69  |--- xfersend_pri|
00000e10  6e 74 70 72 6f 63 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ntproc ---------|
00000e20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000e30  2d 0a 20 2a 20 44 65 73  63 72 69 70 74 69 6f 6e  |-. * Description|
00000e40  3a 20 20 20 41 20 66 75  6e 63 74 69 6f 6e 20 6f  |:   A function o|
00000e50  66 20 74 68 69 73 20 74  79 70 65 20 73 68 6f 75  |f this type shou|
00000e60  6c 64 20 65 69 74 68 65  72 20 70 72 69 6e 74 20  |ld either print |
00000e70  74 68 65 20 66 69 6c 65  0a 20 2a 20 20 20 20 20  |the file. *     |
00000e80  20 20 20 20 20 20 20 20  20 20 20 64 69 72 65 63  |           direc|
00000e90  74 6c 79 2c 20 6f 72 20  73 61 76 65 20 69 74 20  |tly, or save it |
00000ea0  69 6e 74 6f 20 74 68 65  20 67 69 76 65 6e 20 66  |into the given f|
00000eb0  69 6c 65 6e 61 6d 65 2c  20 66 72 6f 6d 0a 20 2a  |ilename, from. *|
00000ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ed0  77 68 65 72 65 20 69 74  20 77 69 6c 6c 20 62 65  |where it will be|
00000ee0  20 70 72 69 6e 74 65 64  20 62 79 20 74 68 65 20  | printed by the |
00000ef0  70 72 69 6e 74 65 72 20  61 70 70 6c 69 63 61 74  |printer applicat|
00000f00  69 6f 6e 2e 0a 20 2a 0a  20 2a 20 50 61 72 61 6d  |ion.. *. * Param|
00000f10  65 74 65 72 73 3a 20 20  20 20 63 68 61 72 20 2a  |eters:    char *|
00000f20  66 69 6c 65 6e 61 6d 65  20 2d 2d 20 66 69 6c 65  |filename -- file|
00000f30  20 74 6f 20 73 61 76 65  20 69 6e 74 6f 2c 20 66  | to save into, f|
00000f40  6f 72 20 70 72 69 6e 74  69 6e 67 0a 20 2a 20 20  |or printing. *  |
00000f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 76 6f  |              vo|
00000f60  69 64 20 2a 68 61 6e 64  6c 65 20 2d 2d 20 68 61  |id *handle -- ha|
00000f70  6e 64 6c 65 20 74 68 61  74 20 77 61 73 20 70 61  |ndle that was pa|
00000f80  73 73 65 64 20 74 6f 20  78 66 65 72 73 65 6e 64  |ssed to xfersend|
00000f90  28 29 0a 20 2a 20 52 65  74 75 72 6e 73 3a 20 20  |(). * Returns:  |
00000fa0  20 20 20 20 20 54 68 65  20 66 75 6e 63 74 69 6f  |     The functio|
00000fb0  6e 20 73 68 6f 75 6c 64  20 72 65 74 75 72 6e 20  |n should return |
00000fc0  65 69 74 68 65 72 20 74  68 65 20 66 69 6c 65 20  |either the file |
00000fd0  74 79 70 65 20 6f 66 20  74 68 65 0a 20 2a 20 20  |type of the. *  |
00000fe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 66 69  |              fi|
00000ff0  6c 65 20 69 74 20 73 61  76 65 64 2c 20 6f 72 20  |le it saved, or |
00001000  6f 6e 65 20 6f 66 20 74  68 65 20 72 65 61 73 6f  |one of the reaso|
00001010  6e 20 63 6f 64 65 73 20  23 64 65 66 69 6e 65 64  |n codes #defined|
00001020  20 62 65 6c 6f 77 2e 0a  20 2a 20 20 20 20 20 20  | below.. *      |
00001030  20 20 20 20 20 20 20 20  20 0a 20 2a 20 4f 74 68  |         . * Oth|
00001040  65 72 20 49 6e 66 6f 3a  20 20 20 20 54 68 69 73  |er Info:    This|
00001050  20 69 73 20 63 61 6c 6c  65 64 20 69 66 20 74 68  | is called if th|
00001060  65 20 66 69 6c 65 20 69  63 6f 6e 20 68 61 73 20  |e file icon has |
00001070  62 65 65 6e 20 64 72 61  67 67 65 64 20 6f 6e 74  |been dragged ont|
00001080  6f 20 61 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |o a. *          |
00001090  20 20 20 20 20 20 70 72  69 6e 74 65 72 20 61 70  |      printer ap|
000010a0  70 6c 69 63 61 74 69 6f  6e 2e 0a 20 2a 0a 20 2a  |plication.. *. *|
000010b0  2f 0a 0a 74 79 70 65 64  65 66 20 69 6e 74 20 28  |/..typedef int (|
000010c0  2a 78 66 65 72 73 65 6e  64 5f 70 72 69 6e 74 70  |*xfersend_printp|
000010d0  72 6f 63 29 28 63 68 61  72 20 2a 66 69 6c 65 6e  |roc)(char *filen|
000010e0  61 6d 65 2c 20 76 6f 69  64 20 2a 68 61 6e 64 6c  |ame, void *handl|
000010f0  65 29 3b 0a 0a 23 64 65  66 69 6e 65 20 78 66 65  |e);..#define xfe|
00001100  72 73 65 6e 64 5f 70 72  69 6e 74 50 72 69 6e 74  |rsend_printPrint|
00001110  65 64 20 2d 31 20 20 20  20 2f 2a 20 66 69 6c 65  |ed -1    /* file|
00001120  20 64 65 61 6c 74 20 77  69 74 68 20 69 6e 74 65  | dealt with inte|
00001130  72 6e 61 6c 6c 79 20 2a  2f 0a 23 64 65 66 69 6e  |rnally */.#defin|
00001140  65 20 78 66 65 72 73 65  6e 64 5f 70 72 69 6e 74  |e xfersend_print|
00001150  46 61 69 6c 65 64 20 20  2d 32 20 20 20 20 2f 2a  |Failed  -2    /*|
00001160  20 68 61 64 20 61 6e 20  65 72 72 6f 72 20 61 6c  | had an error al|
00001170  6f 6e 67 20 74 68 65 20  77 61 79 20 2a 2f 0a 0a  |ong the way */..|
00001180  2f 2a 20 54 68 65 20 73  61 76 65 70 72 6f 63 20  |/* The saveproc |
00001190  73 68 6f 75 6c 64 20 72  65 70 6f 72 74 20 61 6e  |should report an|
000011a0  79 20 65 72 72 6f 72 73  20 69 74 20 65 6e 63 6f  |y errors it enco|
000011b0  75 6e 74 65 72 73 20 69  74 73 65 6c 66 2e 20 49  |unters itself. I|
000011c0  66 20 73 61 76 69 6e 67  0a 20 20 20 74 6f 20 61  |f saving.   to a|
000011d0  20 66 69 6c 65 2c 20 69  74 20 73 68 6f 75 6c 64  | file, it should|
000011e0  20 63 6f 6e 76 65 72 74  20 74 68 65 20 64 61 74  | convert the dat|
000011f0  61 20 69 6e 74 6f 20 61  20 74 79 70 65 20 74 68  |a into a type th|
00001200  61 74 20 63 61 6e 20 62  65 20 70 72 69 6e 74 65  |at can be printe|
00001210  64 20 62 79 0a 20 20 20  74 68 65 20 70 72 69 6e  |d by.   the prin|
00001220  74 65 72 20 61 70 70 6c  69 63 61 74 69 6f 6e 20  |ter application |
00001230  28 69 2e 65 2e 20 74 65  78 74 29 2e 20 2a 2f 0a  |(i.e. text). */.|
00001240  0a 0a 2f 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |../*************|
00001250  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 20 4c  |************** L|
00001260  49 42 52 41 52 59 20 46  55 4e 43 54 49 4f 4e 53  |IBRARY FUNCTIONS|
00001270  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00001280  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2f 0a  |**************/.|
00001290  0a 0a 2f 2a 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |../* -----------|
000012a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000012b0  2d 2d 20 78 66 65 72 73  65 6e 64 20 2d 2d 2d 2d  |-- xfersend ----|
000012c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000012d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0a 20  |--------------. |
000012e0  2a 20 44 65 73 63 72 69  70 74 69 6f 6e 3a 20 20  |* Description:  |
000012f0  20 41 6c 6c 6f 77 73 20  74 68 65 20 75 73 65 72  | Allows the user|
00001300  20 74 6f 20 65 78 70 6f  72 74 20 61 70 70 6c 69  | to export appli|
00001310  63 61 74 69 6f 6e 20 64  61 74 61 2c 20 62 79 20  |cation data, by |
00001320  69 63 6f 6e 20 64 72 61  67 2e 0a 20 2a 0a 20 2a  |icon drag.. *. *|
00001330  20 50 61 72 61 6d 65 74  65 72 73 3a 20 20 20 20  | Parameters:    |
00001340  69 6e 74 20 66 69 6c 65  74 79 70 65 20 2d 2d 20  |int filetype -- |
00001350  74 79 70 65 20 6f 66 20  66 69 6c 65 20 74 6f 20  |type of file to |
00001360  73 61 76 65 20 74 6f 0a  20 2a 20 20 20 20 20 20  |save to. *      |
00001370  20 20 20 20 20 20 20 20  20 20 63 68 61 72 20 2a  |          char *|
00001380  6e 61 6d 65 20 2d 2d 20  73 75 67 67 65 73 74 65  |name -- suggeste|
00001390  64 20 66 69 6c 65 20 6e  61 6d 65 0a 20 2a 20 20  |d file name. *  |
000013a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 69 6e  |              in|
000013b0  74 20 65 73 74 73 69 7a  65 20 2d 2d 20 65 73 74  |t estsize -- est|
000013c0  69 6d 61 74 65 64 20 73  69 7a 65 20 6f 66 20 74  |imated size of t|
000013d0  68 65 20 66 69 6c 65 0a  20 2a 20 20 20 20 20 20  |he file. *      |
000013e0  20 20 20 20 20 20 20 20  20 20 78 66 65 72 73 65  |          xferse|
000013f0  6e 64 5f 73 61 76 65 70  72 6f 63 20 2d 2d 20 63  |nd_saveproc -- c|
00001400  61 6c 6c 65 72 2d 73 75  70 70 6c 69 65 64 20 66  |aller-supplied f|
00001410  75 6e 63 74 69 6f 6e 20  66 6f 72 20 73 61 76 69  |unction for savi|
00001420  6e 67 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |ng. *           |
00001430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001440  20 20 20 20 20 20 20 20  20 20 61 70 70 6c 69 63  |          applic|
00001450  61 74 69 6f 6e 20 64 61  74 61 20 74 6f 20 61 20  |ation data to a |
00001460  66 69 6c 65 0a 20 2a 20  20 20 20 20 20 20 20 20  |file. *         |
00001470  20 20 20 20 20 20 20 78  66 65 72 73 65 6e 64 5f  |       xfersend_|
00001480  73 65 6e 64 70 72 6f 63  20 2d 2d 20 63 61 6c 6c  |sendproc -- call|
00001490  65 72 2d 73 75 70 70 6c  69 65 64 20 66 75 6e 63  |er-supplied func|
000014a0  74 69 6f 6e 20 66 6f 72  20 69 6e 2d 63 6f 72 65  |tion for in-core|
000014b0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
000014c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000014d0  20 20 20 20 20 20 20 20  64 61 74 61 20 74 72 61  |        data tra|
000014e0  6e 73 66 65 72 20 28 69  66 20 61 70 70 6c 69 63  |nsfer (if applic|
000014f0  61 74 69 6f 6e 20 69 73  20 61 62 6c 65 0a 20 2a  |ation is able. *|
00001500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001520  20 20 20 20 20 74 6f 20  64 6f 20 74 68 69 73 29  |     to do this)|
00001530  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
00001540  20 20 20 78 66 65 72 73  65 6e 64 5f 70 72 69 6e  |   xfersend_prin|
00001550  74 70 72 6f 63 20 2d 2d  20 63 61 6c 6c 65 72 2d  |tproc -- caller-|
00001560  73 75 70 70 6c 69 65 64  20 66 75 6e 63 74 69 6f  |supplied functio|
00001570  6e 20 66 6f 72 20 70 72  69 6e 74 69 6e 67 0a 20  |n for printing. |
00001580  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00001590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015a0  20 20 20 20 20 20 20 61  70 70 6c 69 63 61 74 69  |       applicati|
000015b0  6f 6e 20 64 61 74 61 2c  20 69 66 20 22 69 63 6f  |on data, if "ico|
000015c0  6e 22 20 69 73 0a 20 2a  20 20 20 20 20 20 20 20  |n" is. *        |
000015d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 64 72  |              dr|
000015f0  61 67 67 65 64 20 6f 6e  74 6f 20 70 72 69 6e 74  |agged onto print|
00001600  65 72 20 61 70 70 6c 69  63 61 74 69 6f 6e 0a 20  |er application. |
00001610  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00001620  20 77 69 6d 70 5f 65 76  65 6e 74 73 74 72 20 2a  | wimp_eventstr *|
00001630  65 20 2d 2d 20 20 74 68  65 20 65 76 65 6e 74 20  |e --  the event |
00001640  77 68 69 63 68 20 73 74  61 72 74 65 64 20 74 68  |which started th|
00001650  65 20 65 78 70 6f 72 74  0a 20 2a 20 20 20 20 20  |e export. *     |
00001660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001680  28 75 73 75 61 6c 6c 79  20 6d 6f 75 73 65 20 64  |(usually mouse d|
00001690  72 61 67 29 0a 20 2a 20  20 20 20 20 20 20 20 20  |rag). *         |
000016a0  20 20 20 20 20 20 20 76  6f 69 64 20 2a 68 61 6e  |       void *han|
000016b0  64 6c 65 20 2d 2d 20 68  61 6e 64 6c 65 20 74 6f  |dle -- handle to|
000016c0  20 62 65 20 70 61 73 73  65 64 20 74 6f 20 68 61  | be passed to ha|
000016d0  6e 64 6c 65 72 20 66 75  6e 63 74 69 6f 6e 73 2e  |ndler functions.|
000016e0  0a 20 2a 20 52 65 74 75  72 6e 73 3a 20 20 20 20  |. * Returns:    |
000016f0  20 20 20 54 52 55 45 20  69 66 20 64 61 74 61 20  |   TRUE if data |
00001700  65 78 70 6f 72 74 65 64  20 73 75 63 63 65 73 73  |exported success|
00001710  66 75 6c 6c 79 2e 0a 20  2a 20 4f 74 68 65 72 20  |fully.. * Other |
00001720  49 6e 66 6f 3a 20 20 20  20 59 6f 75 20 73 68 6f  |Info:    You sho|
00001730  75 6c 64 20 74 79 70 69  63 61 6c 6c 79 20 63 61  |uld typically ca|
00001740  6c 6c 20 74 68 69 73 20  66 75 6e 63 74 69 6f 6e  |ll this function|
00001750  20 69 6e 20 61 20 77 69  6e 64 6f 77 27 73 0a 20  | in a window's. |
00001760  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00001770  20 65 76 65 6e 74 20 68  61 6e 64 6c 65 72 2c 20  | event handler, |
00001780  77 68 65 6e 20 79 6f 75  20 67 65 74 20 61 20 22  |when you get a "|
00001790  6d 6f 75 73 65 20 64 72  61 67 22 20 65 76 65 6e  |mouse drag" even|
000017a0  74 2e 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |t.. *           |
000017b0  20 20 20 20 20 53 65 65  20 74 68 65 20 22 73 61  |     See the "sa|
000017c0  76 65 61 73 2e 63 22 20  63 6f 64 65 20 66 6f 72  |veas.c" code for|
000017d0  20 61 6e 20 65 78 61 6d  70 6c 65 20 6f 66 20 74  | an example of t|
000017e0  68 69 73 2e 0a 20 2a 20  20 20 20 20 20 20 20 20  |his.. *         |
000017f0  20 20 20 20 20 20 20 78  66 65 72 73 65 6e 64 20  |       xfersend |
00001800  64 65 61 6c 73 20 77 69  74 68 20 74 68 65 20 63  |deals with the c|
00001810  6f 6d 70 6c 65 78 69 74  69 65 73 20 6f 66 20 6d  |omplexities of m|
00001820  65 73 73 61 67 65 2d 70  61 73 73 69 6e 67 0a 20  |essage-passing. |
00001830  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00001840  20 70 72 6f 74 6f 63 6f  6c 73 20 74 6f 20 61 63  | protocols to ac|
00001850  68 69 65 76 65 20 74 68  65 20 64 61 74 61 20 74  |hieve the data t|
00001860  72 61 6e 73 66 65 72 2e  20 52 65 66 65 72 20 74  |ransfer. Refer t|
00001870  6f 20 74 68 65 20 61 62  6f 76 65 0a 20 2a 20 20  |o the above. *  |
00001880  20 20 20 20 20 20 20 20  20 20 20 20 20 20 74 79  |              ty|
00001890  70 65 64 65 66 73 20 66  6f 72 20 61 6e 20 65 78  |pedefs for an ex|
000018a0  70 6c 61 6e 61 74 69 6f  6e 20 6f 66 20 77 68 61  |planation of wha|
000018b0  74 20 74 68 65 20 74 68  72 65 65 20 0a 20 2a 20  |t the three . * |
000018c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 63  |               c|
000018d0  61 6c 6c 65 72 2d 73 75  70 70 6c 69 65 64 20 66  |aller-supplied f|
000018e0  75 6e 63 74 69 6f 6e 73  20 73 68 6f 75 6c 64 20  |unctions should |
000018f0  64 6f 2e 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |do.. *          |
00001900  20 20 20 20 20 20 49 66  20 22 6e 61 6d 65 22 20  |      If "name" |
00001910  69 73 20 30 20 74 68 65  6e 20 61 20 64 65 66 61  |is 0 then a defa|
00001920  75 6c 74 20 6e 61 6d 65  20 6f 66 20 22 53 65 6c  |ult name of "Sel|
00001930  65 63 74 69 6f 6e 22 20  69 73 0a 20 2a 20 20 20  |ection" is. *   |
00001940  20 20 20 20 20 20 20 20  20 20 20 20 20 73 75 70  |             sup|
00001950  70 6c 69 65 64 2e 0a 20  2a 20 20 20 20 20 20 20  |plied.. *       |
00001960  20 20 20 20 20 20 20 20  20 49 66 20 79 6f 75 20  |         If you |
00001970  70 61 73 73 20 30 20 61  73 20 74 68 65 20 78 66  |pass 0 as the xf|
00001980  65 72 73 65 6e 64 5f 73  65 6e 64 70 72 6f 63 2c  |ersend_sendproc,|
00001990  20 74 68 65 6e 20 6e 6f  20 69 6e 2d 63 6f 72 65  | then no in-core|
000019a0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
000019b0  20 20 20 64 61 74 61 20  74 72 61 6e 73 66 65 72  |   data transfer|
000019c0  20 77 69 6c 6c 20 62 65  20 61 74 74 65 6d 70 74  | will be attempt|
000019d0  65 64 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |ed. *           |
000019e0  20 20 20 20 20 49 66 20  79 6f 75 20 70 61 73 73  |     If you pass|
000019f0  20 30 20 61 73 20 74 68  65 20 78 66 65 72 73 65  | 0 as the xferse|
00001a00  6e 64 5f 70 72 69 6e 74  70 72 6f 63 2c 20 74 68  |nd_printproc, th|
00001a10  65 6e 20 74 68 65 20 66  69 6c 65 0a 20 2a 20 20  |en the file. *  |
00001a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 66 6f  |              fo|
00001a30  72 6d 61 74 20 66 6f 72  20 70 72 69 6e 74 69 6e  |rmat for printin|
00001a40  67 20 69 73 20 61 73 73  75 6d 65 64 20 74 6f 20  |g is assumed to |
00001a50  62 65 20 74 68 65 20 73  61 6d 65 20 61 73 20 66  |be the same as f|
00001a60  6f 72 20 73 61 76 69 6e  67 0a 20 2a 20 20 20 20  |or saving. *    |
00001a70  20 20 20 20 20 20 20 20  20 20 20 20 54 68 65 20  |            The |
00001a80  65 73 74 69 6d 61 74 65  64 20 66 69 6c 65 20 73  |estimated file s|
00001a90  69 7a 65 20 69 73 20 6e  6f 74 20 65 73 73 65 6e  |ize is not essen|
00001aa0  74 69 61 6c 2c 20 62 75  74 20 6d 61 79 20 69 6d  |tial, but may im|
00001ab0  70 72 6f 76 65 0a 20 2a  20 20 20 20 20 20 20 20  |prove. *        |
00001ac0  20 20 20 20 20 20 20 20  70 65 72 66 6f 72 6d 61  |        performa|
00001ad0  6e 63 65 2e 0a 20 2a 0a  20 2a 2f 0a 20 20 0a 42  |nce.. *. */.  .B|
00001ae0  4f 4f 4c 20 78 66 65 72  73 65 6e 64 28 69 6e 74  |OOL xfersend(int|
00001af0  20 66 69 6c 65 74 79 70  65 2c 20 63 68 61 72 20  | filetype, char |
00001b00  2a 6e 61 6d 65 2c 20 69  6e 74 20 65 73 74 73 69  |*name, int estsi|
00001b10  7a 65 2c 0a 20 20 20 20  20 20 20 20 20 20 20 20  |ze,.            |
00001b20  20 20 78 66 65 72 73 65  6e 64 5f 73 61 76 65 70  |  xfersend_savep|
00001b30  72 6f 63 2c 20 78 66 65  72 73 65 6e 64 5f 73 65  |roc, xfersend_se|
00001b40  6e 64 70 72 6f 63 2c 20  78 66 65 72 73 65 6e 64  |ndproc, xfersend|
00001b50  5f 70 72 69 6e 74 70 72  6f 63 2c 0a 20 20 20 20  |_printproc,.    |
00001b60  20 20 20 20 20 20 20 20  20 20 77 69 6d 70 5f 65  |          wimp_e|
00001b70  76 65 6e 74 73 74 72 20  2a 65 2c 20 76 6f 69 64  |ventstr *e, void|
00001b80  20 2a 68 61 6e 64 6c 65  29 3b 0a 0a 0a 2f 2a 20  | *handle);.../* |
00001b90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001ba0  2d 2d 2d 2d 2d 2d 2d 2d  20 78 66 65 72 73 65 6e  |-------- xfersen|
00001bb0  64 5f 73 65 6e 64 62 75  66 20 2d 2d 2d 2d 2d 2d  |d_sendbuf ------|
00001bc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001bd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0a 20 2a 20 44 65 73  |---------. * Des|
00001be0  63 72 69 70 74 69 6f 6e  3a 20 20 20 53 65 6e 64  |cription:   Send|
00001bf0  73 20 74 68 65 20 67 69  76 65 6e 20 62 75 66 66  |s the given buff|
00001c00  65 72 20 74 6f 20 61 20  72 65 63 65 69 76 65 72  |er to a receiver|
00001c10  2e 0a 20 2a 0a 20 2a 20  50 61 72 61 6d 65 74 65  |.. *. * Paramete|
00001c20  72 73 3a 20 20 20 20 63  68 61 72 20 2a 62 75 66  |rs:    char *buf|
00001c30  66 65 72 20 2d 2d 20 74  68 65 20 62 75 66 66 65  |fer -- the buffe|
00001c40  72 20 74 6f 20 62 65 20  73 65 6e 74 0a 20 2a 20  |r to be sent. * |
00001c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 69  |               i|
00001c60  6e 74 20 73 69 7a 65 20  2d 2d 20 74 68 65 20 6e  |nt size -- the n|
00001c70  75 6d 62 65 72 20 6f 66  20 63 68 61 72 61 63 74  |umber of charact|
00001c80  65 72 73 20 70 6c 61 63  65 64 20 69 6e 20 74 68  |ers placed in th|
00001c90  65 20 62 75 66 66 65 72  0a 20 2a 20 52 65 74 75  |e buffer. * Retu|
00001ca0  72 6e 73 3a 20 20 20 20  20 20 20 54 52 55 45 20  |rns:       TRUE |
00001cb0  69 66 20 73 65 6e 64 20  77 61 73 20 73 75 63 63  |if send was succ|
00001cc0  65 73 73 66 75 6c 2e 0a  20 2a 20 4f 74 68 65 72  |essful.. * Other|
00001cd0  20 49 6e 66 6f 3a 20 20  20 20 54 68 69 73 20 66  | Info:    This f|
00001ce0  75 6e 63 74 69 6f 6e 20  73 68 6f 75 6c 64 20 62  |unction should b|
00001cf0  65 20 63 61 6c 6c 65 64  20 62 79 20 74 68 65 20  |e called by the |
00001d00  63 61 6c 6c 65 72 2d 73  75 70 70 6c 69 65 64 0a  |caller-supplied.|
00001d10  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00001d20  20 20 78 66 65 72 73 65  6e 64 5f 73 65 6e 64 70  |  xfersend_sendp|
00001d30  72 6f 63 20 28 69 66 20  73 75 63 68 20 65 78 69  |roc (if such exi|
00001d40  73 74 73 29 20 74 6f 20  64 6f 20 69 6e 2d 63 6f  |sts) to do in-co|
00001d50  72 65 20 64 61 74 61 0a  20 2a 20 20 20 20 20 20  |re data. *      |
00001d60  20 20 20 20 20 20 20 20  20 20 74 72 61 6e 73 66  |          transf|
00001d70  65 72 20 28 73 65 65 20  6e 6f 74 65 73 20 6f 6e  |er (see notes on|
00001d80  20 78 66 65 72 73 65 6e  64 5f 73 65 6e 64 70 72  | xfersend_sendpr|
00001d90  6f 63 20 61 62 6f 76 65  29 2e 0a 20 2a 0a 20 2a  |oc above).. *. *|
00001da0  2f 0a 0a 42 4f 4f 4c 20  78 66 65 72 73 65 6e 64  |/..BOOL xfersend|
00001db0  5f 73 65 6e 64 62 75 66  28 63 68 61 72 20 2a 62  |_sendbuf(char *b|
00001dc0  75 66 66 65 72 2c 20 69  6e 74 20 73 69 7a 65 29  |uffer, int size)|
00001dd0  3b 0a 0a 0a 2f 2a 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;.../* ---------|
00001de0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 20  |--------------- |
00001df0  78 66 65 72 73 65 6e 64  5f 66 69 6c 65 5f 69 73  |xfersend_file_is|
00001e00  5f 73 61 66 65 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |_safe ----------|
00001e10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001e20  0a 20 2a 20 44 65 73 63  72 69 70 74 69 6f 6e 3a  |. * Description:|
00001e30  20 20 20 49 6e 66 6f 72  6d 73 20 63 61 6c 6c 65  |   Informs calle|
00001e40  72 20 69 66 20 74 68 65  20 66 69 6c 65 27 73 20  |r if the file's |
00001e50  6e 61 6d 65 20 63 61 6e  20 62 65 20 72 65 6c 69  |name can be reli|
00001e60  61 62 6c 79 20 61 73 73  75 6d 65 64 0a 20 2a 20  |ably assumed. * |
00001e70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 6e  |               n|
00001e80  6f 74 20 74 6f 20 63 68  61 6e 67 65 20 28 64 75  |ot to change (du|
00001e90  72 69 6e 67 20 64 61 74  61 20 74 72 61 6e 73 66  |ring data transf|
00001ea0  65 72 21 21 29 0a 20 2a  0a 20 2a 20 50 61 72 61  |er!!). *. * Para|
00001eb0  6d 65 74 65 72 73 3a 20  20 20 20 76 6f 69 64 0a  |meters:    void.|
00001ec0  20 2a 20 52 65 74 75 72  6e 73 3a 20 20 20 20 20  | * Returns:     |
00001ed0  20 20 54 52 55 45 20 69  66 20 66 69 6c 65 20 69  |  TRUE if file i|
00001ee0  73 20 22 73 61 66 65 22  2e 0a 20 2a 20 4f 74 68  |s "safe".. * Oth|
00001ef0  65 72 20 49 6e 66 6f 3a  20 20 20 20 53 65 65 20  |er Info:    See |
00001f00  61 6c 73 6f 20 74 68 65  20 78 66 65 72 72 65 63  |also the xferrec|
00001f10  76 20 6d 6f 64 75 6c 65  2e 0a 20 2a 0a 20 2a 2f  |v module.. *. */|
00001f20  0a 0a 42 4f 4f 4c 20 78  66 65 72 73 65 6e 64 5f  |..BOOL xfersend_|
00001f30  66 69 6c 65 5f 69 73 5f  73 61 66 65 28 76 6f 69  |file_is_safe(voi|
00001f40  64 29 20 3b 0a 0a 2f 2a  20 52 65 74 75 72 6e 73  |d) ;../* Returns|
00001f50  20 54 52 55 45 20 69 66  20 66 69 6c 65 20 72 65  | TRUE if file re|
00001f60  63 69 70 69 65 6e 74 20  77 69 6c 6c 20 6e 6f 74  |cipient will not|
00001f70  20 6d 6f 64 69 66 79 20  69 74 3b 20 63 68 61 6e  | modify it; chan|
00001f80  67 69 6e 67 20 74 68 65  0a 20 20 20 77 69 6e 64  |ging the.   wind|
00001f90  6f 77 20 74 69 74 6c 65  20 6f 66 20 74 68 65 20  |ow title of the |
00001fa0  66 69 6c 65 20 63 61 6e  20 62 65 20 64 6f 6e 65  |file can be done|
00001fb0  20 63 6f 6e 64 69 74 69  6f 6e 61 6c 6c 79 20 6f  | conditionally o|
00001fc0  6e 20 74 68 69 73 20 72  65 73 75 6c 74 2e 20 54  |n this result. T|
00001fd0  68 69 73 0a 20 20 20 63  61 6e 20 62 65 20 63 61  |his.   can be ca|
00001fe0  6c 6c 65 64 20 77 69 74  68 69 6e 20 79 6f 75 72  |lled within your|
00001ff0  20 78 66 65 72 73 65 6e  64 5f 73 61 76 65 70 72  | xfersend_savepr|
00002000  6f 63 2c 73 65 6e 64 70  72 6f 63 2c 20 6f 72 20  |oc,sendproc, or |
00002010  70 72 69 6e 74 70 72 6f  63 2c 0a 20 20 20 6f 72  |printproc,.   or|
00002020  20 69 6d 6d 65 64 69 61  74 65 6c 79 20 61 66 74  | immediately aft|
00002030  65 72 20 74 68 65 20 6d  61 69 6e 20 78 66 65 72  |er the main xfer|
00002040  73 65 6e 64 2e 20 2a 2f  0a 0a 2f 2a 20 2d 2d 2d  |send. */../* ---|
00002050  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00002060  2d 2d 2d 2d 2d 2d 2d 2d  2d 20 78 66 65 72 73 65  |--------- xferse|
00002070  6e 64 5f 73 65 74 5f 66  69 6c 65 69 73 73 61 66  |nd_set_fileissaf|
00002080  65 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |e --------------|
00002090  2d 2d 2d 2d 2d 2d 0a 20  2a 20 44 65 73 63 72 69  |------. * Descri|
000020a0  70 74 69 6f 6e 3a 20 20  20 41 6c 6c 6f 77 73 20  |ption:   Allows |
000020b0  63 61 6c 6c 65 72 20 74  6f 20 73 65 74 20 61 6e  |caller to set an|
000020c0  20 69 6e 64 69 63 61 74  69 6f 6e 20 6f 66 20 77  | indication of w|
000020d0  68 65 74 68 65 72 20 61  20 66 69 6c 65 27 73 0a  |hether a file's.|
000020e0  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
000020f0  20 20 6e 61 6d 65 20 77  69 6c 6c 20 72 65 6d 61  |  name will rema|
00002100  69 6e 20 75 6e 63 68 61  6e 67 65 64 20 64 75 72  |in unchanged dur|
00002110  69 6e 67 20 64 61 74 61  20 74 72 61 6e 73 66 65  |ing data transfe|
00002120  72 2e 0a 20 2a 0a 20 2a  20 50 61 72 61 6d 65 74  |r.. *. * Paramet|
00002130  65 72 73 3a 20 20 20 20  42 4f 4f 4c 20 76 61 6c  |ers:    BOOL val|
00002140  75 65 20 2d 2d 20 54 52  55 45 20 6d 65 61 6e 73  |ue -- TRUE means|
00002150  20 66 69 6c 65 20 69 73  20 73 61 66 65 2e 0a 20  | file is safe.. |
00002160  2a 20 52 65 74 75 72 6e  73 3a 20 20 20 20 20 20  |* Returns:      |
00002170  20 76 6f 69 64 2e 0a 20  2a 20 4f 74 68 65 72 20  | void.. * Other |
00002180  49 6e 66 6f 3a 20 20 20  20 6e 6f 6e 65 2e 0a 20  |Info:    none.. |
00002190  2a 0a 20 2a 2f 0a 0a 76  6f 69 64 20 78 66 65 72  |*. */..void xfer|
000021a0  73 65 6e 64 5f 73 65 74  5f 66 69 6c 65 69 73 73  |send_set_fileiss|
000021b0  61 66 65 28 42 4f 4f 4c  20 76 61 6c 75 65 29 3b  |afe(BOOL value);|
000021c0  0a 0a 2f 2a 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |../* -----------|
000021d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000021e0  20 78 66 65 72 73 65 6e  64 5f 63 6c 6f 73 65 5f  | xfersend_close_|
000021f0  6f 6e 5f 78 66 65 72 20  2d 2d 2d 2d 2d 2d 2d 2d  |on_xfer --------|
00002200  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0a 20  |--------------. |
00002210  2a 20 44 65 73 63 72 69  70 74 69 6f 6e 3a 20 20  |* Description:  |
00002220  20 54 65 6c 6c 73 20 78  66 65 72 73 65 6e 64 20  | Tells xfersend |
00002230  77 68 65 74 68 65 72 20  74 6f 20 63 6c 6f 73 65  |whether to close|
00002240  20 22 70 61 72 65 6e 74  22 20 77 69 6e 64 6f 77  | "parent" window|
00002250  20 61 66 74 65 72 0a 20  2a 20 20 20 20 20 20 20  | after. *       |
00002260  20 20 20 20 20 20 20 20  20 69 63 6f 6e 2d 64 72  |         icon-dr|
00002270  61 67 20 65 78 70 6f 72  74 2e 0a 20 2a 0a 20 2a  |ag export.. *. *|
00002280  20 50 61 72 61 6d 65 74  65 72 73 3a 20 20 20 20  | Parameters:    |
00002290  42 4f 4f 4c 20 64 6f 5f  77 65 5f 63 6c 6f 73 65  |BOOL do_we_close|
000022a0  20 2d 2d 20 54 52 55 45  20 6d 65 61 6e 73 20 63  | -- TRUE means c|
000022b0  6c 6f 73 65 20 77 69 6e  64 6f 77 20 61 66 74 65  |lose window afte|
000022c0  72 20 65 78 70 6f 72 74  2e 0a 20 2a 20 20 20 20  |r export.. *    |
000022d0  20 20 20 20 20 20 20 20  20 20 20 20 77 69 6d 70  |            wimp|
000022e0  5f 77 20 77 20 2d 2d 20  68 61 6e 64 6c 65 20 6f  |_w w -- handle o|
000022f0  66 20 77 69 6e 64 6f 77  20 74 6f 20 63 6c 6f 73  |f window to clos|
00002300  65 20 28 70 72 65 73 75  6d 61 62 6c 79 20 22 70  |e (presumably "p|
00002310  61 72 65 6e 74 22 0a 20  2a 20 20 20 20 20 20 20  |arent". *       |
00002320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002330  20 20 20 20 20 77 69 6e  64 6f 77 2e 0a 20 2a 20  |     window.. * |
00002340  52 65 74 75 72 6e 73 3a  20 20 20 20 20 20 20 76  |Returns:       v|
00002350  6f 69 64 2e 0a 20 2a 20  4f 74 68 65 72 20 49 6e  |oid.. * Other In|
00002360  66 6f 3a 20 20 20 20 54  68 65 20 64 65 66 61 75  |fo:    The defau|
00002370  6c 74 20 69 73 20 74 6f  20 6e 6f 74 20 63 6c 6f  |lt is to not clo|
00002380  73 65 20 74 68 65 20 77  69 6e 64 6f 77 20 61 66  |se the window af|
00002390  74 65 72 20 65 78 70 6f  72 74 2e 0a 20 2a 20 20  |ter export.. *  |
000023a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4f 6e  |              On|
000023b0  63 65 20 75 73 65 64 2c  20 74 68 69 73 20 66 75  |ce used, this fu|
000023c0  6e 63 74 69 6f 6e 20 73  68 6f 75 6c 64 20 62 65  |nction should be|
000023d0  20 63 61 6c 6c 65 64 20  62 65 66 6f 72 65 20 65  | called before e|
000023e0  61 63 68 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |ach. *          |
000023f0  20 20 20 20 20 20 63 61  6c 6c 20 74 6f 20 78 66  |      call to xf|
00002400  65 72 73 65 6e 64 28 29  2e 0a 20 2a 0a 20 2a 2f  |ersend().. *. */|
00002410  0a 0a 76 6f 69 64 20 78  66 65 72 73 65 6e 64 5f  |..void xfersend_|
00002420  63 6c 6f 73 65 5f 6f 6e  5f 78 66 65 72 28 42 4f  |close_on_xfer(BO|
00002430  4f 4c 20 64 6f 5f 77 65  5f 63 6c 6f 73 65 2c 20  |OL do_we_close, |
00002440  77 69 6d 70 5f 77 20 77  29 3b 0a 0a 0a 2f 2a 20  |wimp_w w);.../* |
00002450  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00002460  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 20 78 66 65 72  |----------- xfer|
00002470  73 65 6e 64 5f 63 6c 65  61 72 5f 75 6e 6b 6e 6f  |send_clear_unkno|
00002480  77 6e 73 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |wns ------------|
00002490  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 20 2a 20 44 65  |----------. * De|
000024a0  73 63 72 69 70 74 69 6f  6e 3a 20 20 20 52 65 6d  |scription:   Rem|
000024b0  6f 76 65 73 20 61 6e 79  20 75 6e 6b 6e 6f 77 6e  |oves any unknown|
000024c0  20 65 76 65 6e 74 20 70  72 6f 63 65 73 73 6f 72  | event processor|
000024d0  73 20 72 65 67 69 73 74  65 72 65 64 20 62 79 20  |s registered by |
000024e0  78 66 65 72 73 65 6e 64  0a 20 2a 20 20 20 20 20  |xfersend. *     |
000024f0  20 20 20 20 20 20 20 20  20 20 20 6f 72 20 78 66  |           or xf|
00002500  65 72 73 65 6e 64 5f 70  69 70 65 2e 0a 20 2a 0a  |ersend_pipe.. *.|
00002510  20 2a 20 50 61 72 61 6d  65 74 65 72 73 3a 20 20  | * Parameters:  |
00002520  20 20 76 6f 69 64 2e 0a  20 2a 20 52 65 74 75 72  |  void.. * Retur|
00002530  6e 73 3a 20 20 20 20 20  20 20 76 6f 69 64 2e 0a  |ns:       void..|
00002540  20 2a 20 4f 74 68 65 72  20 49 6e 66 6f 3a 20 20  | * Other Info:  |
00002550  20 20 78 66 65 72 73 65  6e 64 20 61 6e 64 20 78  |  xfersend and x|
00002560  66 65 72 73 65 6e 64 5f  70 69 70 65 20 75 73 65  |fersend_pipe use|
00002570  20 75 6e 6b 6e 6f 77 6e  20 65 76 65 6e 74 20 70  | unknown event p|
00002580  72 6f 63 65 73 73 6f 72  73 20 74 6f 0a 20 2a 20  |rocessors to. * |
00002590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 64  |               d|
000025a0  65 61 6c 20 77 69 74 68  20 69 6e 74 65 72 2d 61  |eal with inter-a|
000025b0  70 70 6c 69 63 61 74 69  6f 6e 20 64 61 74 61 20  |pplication data |
000025c0  74 72 61 6e 73 66 65 72  2e 20 20 54 68 65 73 65  |transfer.  These|
000025d0  20 6d 61 79 20 62 65 0a  20 2a 20 20 20 20 20 20  | may be. *      |
000025e0  20 20 20 20 20 20 20 20  20 20 6c 65 66 74 20 61  |          left a|
000025f0  72 6f 75 6e 64 20 61 66  74 65 72 20 63 6f 6d 70  |round after comp|
00002600  6c 65 74 69 6f 6e 20 6f  66 20 74 68 65 20 74 72  |letion of the tr|
00002610  61 6e 73 66 65 72 20 28  65 73 70 65 63 69 61 6c  |ansfer (especial|
00002620  6c 79 20 69 66 0a 20 2a  20 20 20 20 20 20 20 20  |ly if. *        |
00002630  20 20 20 20 20 20 20 20  74 68 65 20 74 72 61 6e  |        the tran|
00002640  73 66 65 72 20 66 61 69  6c 65 64 29 2e 20 20 54  |sfer failed).  T|
00002650  68 69 73 20 66 75 6e 63  74 69 6f 6e 20 73 68 6f  |his function sho|
00002660  75 6c 64 20 62 65 20 63  61 6c 6c 65 64 20 77 68  |uld be called wh|
00002670  65 6e 20 69 74 0a 20 2a  20 20 20 20 20 20 20 20  |en it. *        |
00002680  20 20 20 20 20 20 20 20  69 73 20 6b 6e 6f 77 6e  |        is known|
00002690  20 74 68 61 74 20 74 68  65 20 74 72 61 6e 73 66  | that the transf|
000026a0  65 72 20 68 61 73 20 65  6e 64 65 64 2e 0a 20 2a  |er has ended.. *|
000026b0  0a 20 2a 2f 0a 0a 76 6f  69 64 20 78 66 65 72 73  |. */..void xfers|
000026c0  65 6e 64 5f 63 6c 65 61  72 5f 75 6e 6b 6e 6f 77  |end_clear_unknow|
000026d0  6e 73 28 76 6f 69 64 29  3b 0a 0a 0a 2f 2a 20 2d  |ns(void);.../* -|
000026e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000026f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 20 78 66 65 72 73  |---------- xfers|
00002700  65 6e 64 5f 72 65 61 64  5f 6c 61 73 74 5f 72 65  |end_read_last_re|
00002710  66 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |f --------------|
00002720  2d 2d 2d 2d 2d 2d 2d 2d  2d 0a 20 2a 20 44 65 73  |---------. * Des|
00002730  63 72 69 70 74 69 6f 6e  3a 20 20 20 52 65 74 75  |cription:   Retu|
00002740  72 6e 73 20 74 68 65 20  6d 79 5f 72 65 66 20 76  |rns the my_ref v|
00002750  61 6c 75 65 20 6f 66 20  74 68 65 20 6c 61 73 74  |alue of the last|
00002760  20 77 69 6d 70 5f 4d 44  41 54 41 53 41 56 45 20  | wimp_MDATASAVE |
00002770  6f 72 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |or. *           |
00002780  20 20 20 20 20 77 69 6d  70 5f 4d 44 41 54 41 4c  |     wimp_MDATAL|
00002790  4f 41 44 20 6d 65 73 73  61 67 65 20 73 65 6e 74  |OAD message sent|
000027a0  20 62 79 20 78 66 65 72  73 65 6e 64 20 6f 72 20  | by xfersend or |
000027b0  78 66 65 72 73 65 6e 64  5f 70 69 70 65 2e 0a 20  |xfersend_pipe.. |
000027c0  2a 0a 20 2a 20 50 61 72  61 6d 65 74 65 72 73 3a  |*. * Parameters:|
000027d0  20 20 20 20 76 6f 69 64  2e 0a 20 2a 20 52 65 74  |    void.. * Ret|
000027e0  75 72 6e 73 3a 20 20 20  20 20 20 20 69 6e 74 65  |urns:       inte|
000027f0  67 65 72 20 6d 65 73 73  61 67 65 20 72 65 66 65  |ger message refe|
00002800  72 65 6e 63 65 0a 20 2a  20 4f 74 68 65 72 20 49  |rence. * Other I|
00002810  6e 66 6f 3a 20 20 20 20  41 66 74 65 72 20 73 61  |nfo:    After sa|
00002820  76 69 6e 67 20 61 20 66  69 6c 65 20 74 6f 20 61  |ving a file to a|
00002830  6e 6f 74 68 65 72 20 61  70 70 6c 69 63 61 74 69  |nother applicati|
00002840  6f 6e 20 28 69 65 2e 20  77 68 65 72 65 20 74 68  |on (ie. where th|
00002850  65 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |e. *            |
00002860  20 20 20 20 72 65 73 75  6c 74 69 6e 67 20 66 69  |    resulting fi|
00002870  6c 65 20 69 73 20 6e 6f  74 20 27 73 61 66 65 27  |le is not 'safe'|
00002880  2c 20 74 68 65 20 6d 79  5f 72 65 66 20 76 61 6c  |, the my_ref val|
00002890  75 65 20 6f 66 20 74 68  65 0a 20 2a 20 20 20 20  |ue of the. *    |
000028a0  20 20 20 20 20 20 20 20  20 20 20 20 66 69 6e 61  |            fina|
000028b0  6c 20 77 69 6d 70 5f 4d  44 41 54 41 4c 4f 41 44  |l wimp_MDATALOAD|
000028c0  20 73 68 6f 75 6c 64 20  62 65 20 73 74 6f 72 65  | should be store|
000028d0  64 20 77 69 74 68 20 74  68 65 20 64 6f 63 75 6d  |d with the docum|
000028e0  65 6e 74 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |ent. *          |
000028f0  20 20 20 20 20 20 64 61  74 61 2c 20 73 6f 20 74  |      data, so t|
00002900  68 61 74 20 69 66 20 61  20 77 69 6d 70 5f 4d 44  |hat if a wimp_MD|
00002910  41 54 41 53 41 56 45 44  20 69 73 20 72 65 63 65  |ATASAVED is rece|
00002920  69 76 65 64 2c 20 74 68  65 0a 20 2a 20 20 20 20  |ived, the. *    |
00002930  20 20 20 20 20 20 20 20  20 20 20 20 64 6f 63 75  |            docu|
00002940  6d 65 6e 74 20 63 61 6e  20 62 65 20 6d 61 72 6b  |ment can be mark|
00002950  65 64 20 75 6e 6d 6f 64  69 66 69 65 64 2e 20 20  |ed unmodified.  |
00002960  49 66 20 74 68 65 20 64  6f 63 75 6d 65 6e 74 20  |If the document |
00002970  69 73 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |is. *           |
00002980  20 20 20 20 20 6d 6f 64  69 66 69 65 64 20 61 66  |     modified af|
00002990  74 65 72 20 62 65 69 6e  67 20 73 61 76 65 64 2c  |ter being saved,|
000029a0  20 74 68 65 20 6c 61 73  74 5f 72 65 66 20 76 61  | the last_ref va|
000029b0  6c 75 65 20 73 68 6f 75  6c 64 20 62 65 0a 20 2a  |lue should be. *|
000029c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000029d0  72 65 73 65 74 20 74 6f  20 30 2c 20 73 6f 20 74  |reset to 0, so t|
000029e0  68 61 74 20 61 20 73 75  62 73 65 71 75 65 6e 74  |hat a subsequent|
000029f0  20 77 69 6d 70 5f 4d 44  41 54 41 53 41 56 45 44  | wimp_MDATASAVED|
00002a00  20 6d 65 73 73 61 67 65  0a 20 2a 20 20 20 20 20  | message. *     |
00002a10  20 20 20 20 20 20 20 20  20 20 20 77 69 6c 6c 20  |           will |
00002a20  6e 6f 74 20 63 61 75 73  65 20 74 68 65 20 64 6f  |not cause the do|
00002a30  63 75 6d 65 6e 74 20 74  6f 20 62 65 20 6d 61 72  |cument to be mar|
00002a40  6b 65 64 20 75 6e 6d 6f  64 69 66 69 65 64 2e 0a  |ked unmodified..|
00002a50  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00002a60  20 20 4e 42 3a 20 49 66  20 52 41 4d 20 74 72 61  |  NB: If RAM tra|
00002a70  6e 73 66 65 72 20 69 73  20 75 73 65 64 2c 20 74  |nsfer is used, t|
00002a80  68 65 20 6d 79 5f 72 65  66 20 6f 66 20 74 68 65  |he my_ref of the|
00002a90  20 64 61 74 61 73 61 76  65 0a 20 2a 20 20 20 20  | datasave. *    |
00002aa0  20 20 20 20 20 20 20 20  20 20 20 20 6d 65 73 73  |            mess|
00002ab0  61 67 65 20 73 68 6f 75  6c 64 20 62 65 20 73 74  |age should be st|
00002ac0  6f 72 65 64 20 69 6e 73  74 65 61 64 2e 0a 20 2a  |ored instead.. *|
00002ad0  2f 0a 0a 69 6e 74 20 78  66 65 72 73 65 6e 64 5f  |/..int xfersend_|
00002ae0  72 65 61 64 5f 6c 61 73  74 5f 72 65 66 28 76 6f  |read_last_ref(vo|
00002af0  69 64 29 3b 0a 0a 23 65  6e 64 69 66 0a 0a 2f 2a  |id);..#endif../*|
00002b00  20 65 6e 64 20 78 66 65  72 73 65 6e 64 2e 68 20  | end xfersend.h |
00002b10  2a 2f 0a                                          |*/.|
00002b13