home *** CD-ROM | disk | FTP | other *** search
- /* XferRecv.c */
- /*
-
- ##### # #
- # # # # #
- # # #
- # ## #### #### # ## ####
- # # # # # # # # # #
- # # # # # ### # # # #
- # # # # # # # # # #
- # ### # # # #### ##### ### ####
-
- -----------------------------------------------------------------------------
-
- This is source for use with the 'DeskLib' Wimp C programming library for
- Risc OS. I currently use v1.04 of DeskLib. This source is FreeWare, which
- means you can use it to write commercial applications, but you may not charge
- *in any way* for the distribution of this source. I (Tim Browse) retain
- all copyright on this source.
-
- This source is provided 'as is' and I offer no guarantees that is useful,
- bug-free, commented, that it will compile, or even that it exists.
-
- If it breaks in half, you own both pieces.
-
- All source © Tim Browse 1993
-
- -----------------------------------------------------------------------------
-
- */
-
- /* ANSI includes */
- #include <string.h>
-
- /* DeskLib includes */
- #include "DeskLib.Wimp.h"
- #include "DeskLib.WimpSWIs.h"
- #include "DeskLib.Event.h"
-
- /* Message structures */
- static message_block msg;
- static message_destinee destinee;
- static event_type type;
-
- void XferRecv_Prolog(int *filetype, char *filename)
- {
- /* Take a copy of the message so we can send one back */
- memcpy(&msg, &event_lastevent.data.message, sizeof(message_block));
-
- /* Set up the message to send a DataLoadAck when we're done */
- msg.header.size = sizeof(message_header); /* No data in DataLoadAck */
- msg.header.action = message_DATALOADACK;
- msg.header.yourref = msg.header.myref;
-
- /* Get the sender of the DataLoad message */
- destinee.value = msg.header.sender;
-
- /* Remember what kind of message it was */
- type = event_lastevent.type;
-
- /* Get the filename and filetype for the caller */
- *filetype = msg.data.dataload.filetype;
- strcpy(filename, msg.data.dataload.filename);
- }
-
-
- void XferRecv_Epilog(void)
- {
- /* Send the DataLoadAck message set up by XferRecv_Prolog() */
- Wimp_SendMessage(type, &msg, destinee, 0);
- }
-
-