Home » Archimedes archive » Archimedes World » archimedes_world_volume_14_issue_12_scp.adf » !AcornAns_AcornAns » !Brolly/c/xfersend
!Brolly/c/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/c/xfersend |
Read OK: | ✔ |
File size: | 4D02 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
/************************************************************************/ /* � Acorn Computers Ltd, 1992. */ /* */ /* This file forms part of an unsupported source release of RISC_OSLib. */ /* */ /* It may be freely used to create executable images for saleable */ /* products but cannot be sold in source form or as an object library */ /* without the prior written consent of Acorn Computers Ltd. */ /* */ /* If this file is re-distributed (even if modified) it should retain */ /* this copyright notice. */ /* */ /************************************************************************/ /* Title: c.xfersend * Purpose: generalised data transfer to a concurrent wimp program. * History: IDJ: 07-Feb-92: prepared for source release * */ /************************************************************************/ /* */ /* Modified 14/2/93 by Michael Rozdoba. */ /* */ /* inclusion of function to perform a check on existence of os 3.10 */ /* or greater, using_os3, */ /* plus modification of xfersend, xfersend__unknowns & addition of */ /* xfersend__using_dragasprite, dragasprite_start & dragasprite_stop */ /* to permit use of os 3.10 DragASprite module when saving files etc */ /* (if the relevant CMOS location has been set to select this) */ /* */ /* NB using_os3 is used here to prevent calling DragASprite under os 2 */ /* should the Acorn reserved CMOS location have been corrupted, giving */ /* the false impression that os is 3.10 & drag sprite option has been */ /* selected. */ /* */ /* Note this file does not contain all functions from the original; */ /* it is intended only to supplement the original functions provided */ /* by RISC_OSLib */ /* xfersend_pipe has been removed from this file & the associated */ /* header file - IMPORTANT to use this file to compile an updated */ /* version of RISC_OSLib, you must modify this file & associated header */ /* by putting back this function. */ /* */ /************************************************************************/ #define BOOL int #define TRUE 1 #define FALSE 0 #include <string.h> #include <stdio.h> #include <stdlib.h> #include "xfersend.h" #include "trace.h" #include "os.h" #include "bbc.h" #include "wimp.h" #include "wimpt.h" #include "win.h" #include "dbox.h" #include "fileicon.h" #include "werr.h" #include "menu.h" #include "event.h" #include "msgs.h" #include "sprite.h" static BOOL xfersend__used_dragasprite = FALSE; static int rcvbufsize ; static int xfersend__msgid = 0; /* my_ref of last DataSave message */ static xfersend_saveproc xfersend__saveproc; static xfersend_sendproc xfersend__sendproc; static xfersend_printproc xfersend__printproc; static int xfersend__filetype; static void *xfersend__savehandle; static int xfersend__estsize = 0; static wimp_t xfersend__receiver ; static BOOL xfersend__fileissafe ; static char *xfersend__filename; /*[256]*/ static wimp_mousestr xfersend__mousestr; static wimp_msgstr xfersend__msg; static BOOL xfersend__close = FALSE; static wimp_w xfersend__w; #define OS_File 8 #define OS_Module 0x1e #define DragASprite_Start 0x42400 #define DragASprite_Stop 0x42401 BOOL using_os3(void) { os_regset r; char *c; int v; r.r[0]=18; r.r[1]=(int)"UtilityModule"; if (os_swix(OS_Module, &r)) return FALSE; if ( (c=strstr( (char *)(r.r[3]+*(int *)(r.r[3]+20)), "." )) == 0 ) return FALSE; v=100*(c[-1]-'0')+10*(c[1]-'0')+(c[2]-'0'); return (v>=310); } static int xfersend__using_dragasprite(void) { int x=28, y; if (os_byte(161, &x, &y)) return FALSE; return (y&2) >> 1 ; } os_error *dragasprite_start(int flags, sprite_area *area, char *name, wimp_box *box) { os_regset r; r.r[0]=flags; r.r[1]=(int)area; r.r[2]=(int)name; r.r[3]=(int)box; r.r[4]=0; /*nb not sure whether this is a required parameter which does something - in !Squash, code contains APCS*/ /*fn called dragasprite_start (presumably from an unreleased version of RISC_OSLib) which seems to take */ /*5 parameters, & when called this is passed as zero, however examination of DragASprite module & trials*/ /*fail to show any purpose/effect, so for the time being, in this fn set r4 to 0*/ return os_swix(DragASprite_Start, &r); } os_error *dragasprite_stop(void) { return os_swix(DragASprite_Stop, 0); } void xfersend_close_on_xfer(BOOL do_we_close, wimp_w w) { xfersend__close = do_we_close; xfersend__w = w; } static void xfersend__winclose(void) { wimp_eventdata e; e.o.w = xfersend__w; wimpt_noerr(wimp_sendwmessage(wimp_ECLOSE, (wimp_msgstr*) &e, e.o.w, -1)); } static BOOL xfersend__unknowns(wimp_eventstr *e, void *handle) { handle = handle ; tracef1("xfersend raw event %i.\n", e->e); switch (e->e) { case wimp_EUSERDRAG: tracef0("drag event received.\n"); { if (xfersend__used_dragasprite) dragasprite_stop(); wimp_get_point_info(&xfersend__mousestr); if (xfersend__mousestr.w == -1) { tracef0("drag to no window: has no effect.\n"); /* do nothing */ } else { wimp_msgstr msg; tracef1("drag to window %i: offer data.\n", xfersend__mousestr.w); msg.hdr.size = sizeof(wimp_msghdr) + sizeof(wimp_msgdatasave); msg.hdr.task = xfersend__mousestr.w; msg.hdr.your_ref = 0; msg.hdr.action = wimp_MDATASAVE; msg.data.datasave.w = xfersend__mousestr.w; msg.data.datasave.i = xfersend__mousestr.i; msg.data.datasave.x = xfersend__mousestr.x; msg.data.datasave.y = xfersend__mousestr.y; msg.data.datasave.type = xfersend__filetype; msg.data.datasave.estsize = xfersend__estsize; { int i, tail; char name[256]; strncpy(name,xfersend__filename, 256); tail = strlen(name); /* point at the zero */ while (tail > 0 && name[tail-1] != '.' && name[tail-1] != ':') tail--; for (i = 0; i <= 10; i++) msg.data.datasave.leaf[i] = name[tail++]; msg.data.datasave.leaf[11] = '\0' ; /* force termination */ tracef1("suggest leaf '%s'.\n", (int) &msg.data.datasave.leaf[0]); } wimpt_noerr(wimp_sendwmessage( wimp_ESEND, &msg, xfersend__mousestr.w, xfersend__mousestr.i)); xfersend__msgid = msg.hdr.my_ref; /* filled in by wimp. */ /* We still get unknown events, so we'll get the reply sometime. */ } } return TRUE; case wimp_ESEND: case wimp_ESENDWANTACK: tracef3 ("xfersend msg %x received: %i %i.\n", e->data.msg.hdr.action,e->data.msg.hdr.your_ref,xfersend__msgid); if (e->data.msg.hdr.your_ref == xfersend__msgid) switch (e->data.msg.hdr.action) { case wimp_MRAMFETCH: if (xfersend__sendproc != 0) { xfersend__fileissafe = FALSE ; /* He wants to do an in-core transfer, and we can do this. */ /* Note that this can't be other than the first response, as others are grabbed by sendbuf */ tracef0("ram transfer starting.\n"); /* Prepare the reply record. */ xfersend__msg = e->data.msg; xfersend__msg.hdr.your_ref = xfersend__msg.hdr.my_ref; xfersend__msg.hdr.action = wimp_MRAMTRANSMIT; xfersend__msg.data.ramtransmit.addr = e->data.msg.data.ramfetch.addr; xfersend__msg.data.ramtransmit.nbyteswritten = 0; /* so far. */ rcvbufsize = e->data.msg.data.ramfetch.nbytes; xfersend__receiver = e->data.msg.hdr.task ; /* the copy in xfersend__msg.hdr.task is overwritten by the Wimp message sending */ if (xfersend__sendproc(xfersend__savehandle, &rcvbufsize)) { /* See sendbuf for all the real work for this case... */ tracef0("The send succeeded; send final RAMTRANSMIT.\n"); /* We may have transferred some data but not yet told the other end about it. xfersend__msg contains a final RAMTRANSMIT, which does not quite fill his buffer (or we'd have sent it already) thus signalling to him that the transfer is over. */ wimpt_noerr(wimp_sendmessage ( wimp_ESEND, &xfersend__msg, xfersend__receiver)); if(xfersend__close) xfersend__winclose(); } else { tracef0("the send failed.\n"); } return TRUE; } break ; case wimp_MPrintFile: /* was dropped on a printer application */ if (xfersend__printproc != 0) { int res ; wimp_t xfersend__printer = 0; tracef0("print request acceptable\n"); xfersend__fileissafe = FALSE ; res = xfersend__printproc(&e->data.msg.data.print.name[0], xfersend__savehandle) ; xfersend__printer = e->data.msg.hdr.task ; xfersend__msg = e->data.msg; xfersend__msg.hdr.your_ref = xfersend__msg.hdr.my_ref; xfersend__msg.hdr.action = res >= 0 ? wimp_MDATALOAD : wimp_MWillPrint; xfersend__msg.data.print.type = res ; /* in case it's been saved */ wimpt_noerr(wimp_sendmessage( wimp_ESEND, &xfersend__msg, xfersend__printer)); if(xfersend__close && res) xfersend__winclose(); return TRUE; } break ; case wimp_MDATASAVEOK: { tracef4("datasaveok %i %i %i %i.\n", e->data.msg.hdr.size, e->data.msg.hdr.task, e->data.msg.hdr.your_ref, e->data.msg.hdr.my_ref); tracef4("datasaveok %x %x %x %x.\n", e->data.msg.data.words[0], e->data.msg.data.words[1], e->data.msg.data.words[2], e->data.msg.data.words[3]); tracef1("it's the datasaveok, to file '%s'.\n", (int) &e->data.msg.data.datasaveok.name[0]); win_remove_unknown_event_processor(xfersend__unknowns, 0); tracef1("save to filename '%s'.\n", (int) &e->data.msg.data.datasaveok.name[0]); xfersend__fileissafe = e->data.msg.data.datasaveok.estsize >= 0 ; if (xfersend__saveproc != NULL && xfersend__saveproc(&e->data.msg.data.datasaveok.name[0], xfersend__savehandle)) { tracef0("the save succeeded: send dataload\n"); xfersend__msg = e->data.msg; /* sets hdr.size, data.w,i,x,y, size, name */ xfersend__msg.hdr.your_ref = e->data.msg.hdr.my_ref; xfersend__msg.hdr.action = wimp_MDATALOAD; xfersend__msg.data.dataload.type = xfersend__filetype ; wimpt_noerr(wimp_sendmessage( wimp_ESENDWANTACK, &xfersend__msg, e->data.msg.hdr.task)); if(xfersend__close) xfersend__winclose(); } else { /* he has already reported the error: nothing more to do. */ tracef0("save was not successful.\n"); } return (xfersend__saveproc == NULL) ? FALSE : TRUE; } } return FALSE ; /* unknown not dealt with */ default: return FALSE ; } } static int sendbuf__state ; static BOOL sendbuf__unknowns(wimp_eventstr *e, void *h) { h = h ; tracef4("sendbuf__unknowns %d %d %d %d\n", e->data.msg.hdr.my_ref, e->data.msg.hdr.your_ref, xfersend__msg.hdr.your_ref, xfersend__msg.hdr.my_ref) ; if ((e->e == wimp_ESENDWANTACK || e->e == wimp_ESEND) && e->data.msg.hdr.your_ref == xfersend__msg.hdr.my_ref && e->data.msg.hdr.action == wimp_MRAMFETCH) { /* Prepare xfersend__msg as the next RAMTRANSMIT. Most of the fields are already set up. */ xfersend__msg.data.ramtransmit.addr = e->data.msg.data.ramfetch.addr; xfersend__msg.data.ramtransmit.nbyteswritten = 0; xfersend__msg.hdr.your_ref = e->data.msg.hdr.my_ref ; rcvbufsize = e->data.msg.data.ramfetch.nbytes; tracef2("RAMFETCH received: continue with buffer at %x, size %d\n", (int) xfersend__msg.data.ramtransmit.addr, rcvbufsize) ; sendbuf__state = 1 ; return TRUE ; /* We've had another RAMFETCH: off we go again */ } if (e->e == wimp_EACK && e->data.msg.hdr.my_ref == xfersend__msg.hdr.my_ref) { sendbuf__state = 2 ; tracef0("xfersend RAMTRANSMIT bounced; set failed state\n") ; return TRUE ;/* our message bounced back; give up */ } return FALSE ; /* we don't want it */ } BOOL xfersend_sendbuf(char *buffer, int size) { /* Called by his sendproc when sending things in memory. The reply record is in xfersend__msg. */ tracef2("xfersend_sendbuf %i %i\n", (int) buffer, size); /* Make the data transfer */ tracef3("transfer block of %d from %x to %x\n", size, (int) buffer, (int) (xfersend__msg.data.ramtransmit.addr + xfersend__msg.data.ramtransmit.nbyteswritten)) ; wimpt_noerr(wimp_transferblock( wimpt_task(), buffer, xfersend__receiver, xfersend__msg.data.ramtransmit.addr + xfersend__msg.data.ramtransmit.nbyteswritten, size)); /* record bytes to be sent to the other end */ xfersend__msg.data.ramtransmit.nbyteswritten += size; rcvbufsize -= size ; /* if size != 0, there are still bytes to send. */ if (rcvbufsize > 0) return TRUE; tracef1("xfersend message has put %d into buffer\n",size) ; /* Tell him that you've done it */ wimpt_noerr(wimp_sendmessage( wimp_ESENDWANTACK, &xfersend__msg, xfersend__receiver)); /* Get his reply. Poll and despatch events until get nack or message */ sendbuf__state = 0 ; win_add_unknown_event_processor(sendbuf__unknowns, 0) ; do { event_process() ; } while (sendbuf__state == 0) ; win_remove_unknown_event_processor(sendbuf__unknowns, 0) ; /* This exit happens in the cases where the buffers at each end are of identical size. So, return for another call to sendbuf, or so that the sendbuf procedure can return. */ return sendbuf__state != 2 ; /* OK unless state = broken */ } BOOL xfersend (int filetype, char *filename, int estsize, xfersend_saveproc saver, xfersend_sendproc sender, xfersend_printproc printer, wimp_eventstr *e, void *handle) { wimp_dragstr dr; wimp_wstate wstate; wimp_icon icon; wimp_w w = e->data.but.m.w; wimp_mousestr mouse_str; int x_limit = bbc_vduvar (bbc_XWindLimit) << bbc_vduvar (bbc_XEigFactor), y_limit = bbc_vduvar (bbc_YWindLimit) << bbc_vduvar (bbc_YEigFactor), screen_x0, screen_y0, mouse_x, mouse_y; char *name; sprite_area *area; xfersend__saveproc = saver; xfersend__sendproc = sender; xfersend__printproc = printer; xfersend__filetype = filetype; xfersend__estsize = estsize; xfersend__savehandle = handle; if (xfersend__filename == 0) xfersend__filename = malloc(256); if(filename == 0) strcpy(xfersend__filename, msgs_lookup("xfersend2:Selection")); else strncpy(xfersend__filename,filename,256); tracef0("Initiate a drag.\n"); /*Find screen origin*/ wimp_get_wind_state (w, &wstate); screen_x0 = wstate.o.box.x0 - wstate.o.x; screen_y0 = wstate.o.box.y1 - wstate.o.y; /*Get initial icon position*/ wimp_get_icon_info (w, e->data.but.m.i, &icon); icon.box.x0+=screen_x0; icon.box.y0+=screen_y0; icon.box.x1+=screen_x0; icon.box.y1+=screen_y0; if (xfersend__using_dragasprite() && using_os3()) { xfersend__used_dragasprite=TRUE; if ( (icon.flags & (wimp_INDIRECT|wimp_ISPRITE)) != (wimp_INDIRECT|wimp_ISPRITE)) { name="file_xxx"; area=(sprite_area *)1; } else if ( !(icon.flags&wimp_ITEXT) && !icon.data.indirectsprite.nameisname ) { name="file_xxx"; area=(sprite_area *)1; } else { if (icon.flags & wimp_ITEXT) { area=(sprite_area *)1; name=icon.data.indirecttext.validstring; if (*name=='s') name++; else { name=strstr(name, ";s"); name = (name==0) ? "file_xxx" : name+2 ; } } else { name=icon.data.indirectsprite.name; area=icon.data.indirectsprite.spritearea; } } wimpt_complain(dragasprite_start(0xc5, area, name, &icon.box)); } else { xfersend__used_dragasprite=FALSE; /*Get pointer position to allow icon to be dragged partially off-screen */ wimp_get_point_info (&mouse_str); mouse_x = mouse_str.x; mouse_y = mouse_str.y; /*Set up drag*/ dr.window = w; /*not relevant*/ dr.type = wimp_USER_FIXED; dr.box.x0 = icon.box.x0; dr.box.y0 = icon.box.y0; dr.box.x1 = icon.box.x1; dr.box.y1 = icon.box.y1; dr.parent.x0 = icon.box.x0 - mouse_x; /*Expanded parent by box overlap*/ dr.parent.y0 = icon.box.y0 - mouse_y; dr.parent.x1 = icon.box.x1 - mouse_x + x_limit; dr.parent.y1 = icon.box.y1 - mouse_y + y_limit; wimp_drag_box (&dr); } win_add_unknown_event_processor (xfersend__unknowns, NULL); return TRUE; } BOOL xfersend_file_is_safe() { return xfersend__fileissafe; } void xfersend_set_fileissafe(BOOL value) { xfersend__fileissafe = value; } void xfersend_clear_unknowns(void) { win_remove_unknown_event_processor(sendbuf__unknowns, 0); win_remove_unknown_event_processor(xfersend__unknowns, 0); } int xfersend_read_last_ref(void) { return(xfersend__msgid); /* my_ref of last DataSave message */ } /* end xfersend.c */
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 2f 0a 2f 2a 20 a9 20 |*********/./* . | 00000050 41 63 6f 72 6e 20 43 6f 6d 70 75 74 65 72 73 20 |Acorn Computers | 00000060 4c 74 64 2c 20 31 39 39 32 2e 20 20 20 20 20 20 |Ltd, 1992. | 00000070 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000090 20 20 20 2a 2f 0a 2f 2a 20 20 20 20 20 20 20 20 | */./* | 000000a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000000d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 2f | */| 000000e0 0a 2f 2a 20 54 68 69 73 20 66 69 6c 65 20 66 6f |./* This file fo| 000000f0 72 6d 73 20 70 61 72 74 20 6f 66 20 61 6e 20 75 |rms part of an u| 00000100 6e 73 75 70 70 6f 72 74 65 64 20 73 6f 75 72 63 |nsupported sourc| 00000110 65 20 72 65 6c 65 61 73 65 20 6f 66 20 52 49 53 |e release of RIS| 00000120 43 5f 4f 53 4c 69 62 2e 20 2a 2f 0a 2f 2a 20 20 |C_OSLib. */./* | 00000130 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000170 20 20 20 20 2a 2f 0a 2f 2a 20 49 74 20 6d 61 79 | */./* It may| 00000180 20 62 65 20 66 72 65 65 6c 79 20 75 73 65 64 20 | be freely used | 00000190 74 6f 20 63 72 65 61 74 65 20 65 78 65 63 75 74 |to create execut| 000001a0 61 62 6c 65 20 69 6d 61 67 65 73 20 66 6f 72 20 |able images for | 000001b0 73 61 6c 65 61 62 6c 65 20 20 20 20 20 20 20 2a |saleable *| 000001c0 2f 0a 2f 2a 20 70 72 6f 64 75 63 74 73 20 62 75 |/./* products bu| 000001d0 74 20 63 61 6e 6e 6f 74 20 62 65 20 73 6f 6c 64 |t cannot be sold| 000001e0 20 69 6e 20 73 6f 75 72 63 65 20 66 6f 72 6d 20 | in source form | 000001f0 6f 72 20 61 73 20 61 6e 20 6f 62 6a 65 63 74 20 |or as an object | 00000200 6c 69 62 72 61 72 79 20 20 20 2a 2f 0a 2f 2a 20 |library */./* | 00000210 77 69 74 68 6f 75 74 20 74 68 65 20 70 72 69 6f |without the prio| 00000220 72 20 77 72 69 74 74 65 6e 20 63 6f 6e 73 65 6e |r written consen| 00000230 74 20 6f 66 20 41 63 6f 72 6e 20 43 6f 6d 70 75 |t of Acorn Compu| 00000240 74 65 72 73 20 4c 74 64 2e 20 20 20 20 20 20 20 |ters Ltd. | 00000250 20 20 20 20 20 2a 2f 0a 2f 2a 20 20 20 20 20 20 | */./* | 00000260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000002a0 2a 2f 0a 2f 2a 20 49 66 20 74 68 69 73 20 66 69 |*/./* If this fi| 000002b0 6c 65 20 69 73 20 72 65 2d 64 69 73 74 72 69 62 |le is re-distrib| 000002c0 75 74 65 64 20 28 65 76 65 6e 20 69 66 20 6d 6f |uted (even if mo| 000002d0 64 69 66 69 65 64 29 20 69 74 20 73 68 6f 75 6c |dified) it shoul| 000002e0 64 20 72 65 74 61 69 6e 20 20 20 2a 2f 0a 2f 2a |d retain */./*| 000002f0 20 74 68 69 73 20 63 6f 70 79 72 69 67 68 74 20 | this copyright | 00000300 6e 6f 74 69 63 65 2e 20 20 20 20 20 20 20 20 20 |notice. | 00000310 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000330 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 20 20 20 20 | */./* | 00000340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000380 20 2a 2f 0a 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a | */./***********| 00000390 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 000003c0 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2f 0a 0a |*************/..| 000003d0 2f 2a 20 54 69 74 6c 65 3a 20 63 2e 78 66 65 72 |/* Title: c.xfer| 000003e0 73 65 6e 64 0a 20 2a 20 50 75 72 70 6f 73 65 3a |send. * Purpose:| 000003f0 20 67 65 6e 65 72 61 6c 69 73 65 64 20 64 61 74 | generalised dat| 00000400 61 20 74 72 61 6e 73 66 65 72 20 74 6f 20 61 20 |a transfer to a | 00000410 63 6f 6e 63 75 72 72 65 6e 74 20 77 69 6d 70 20 |concurrent wimp | 00000420 70 72 6f 67 72 61 6d 2e 0a 20 2a 20 48 69 73 74 |program.. * Hist| 00000430 6f 72 79 3a 20 49 44 4a 3a 20 30 37 2d 46 65 62 |ory: IDJ: 07-Feb| 00000440 2d 39 32 3a 20 70 72 65 70 61 72 65 64 20 66 6f |-92: prepared fo| 00000450 72 20 73 6f 75 72 63 65 20 72 65 6c 65 61 73 65 |r source release| 00000460 20 0a 20 2a 0a 20 2a 2f 0a 0a 2f 2a 2a 2a 2a 2a | . *. */../*****| 00000470 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 000004b0 2a 2a 2a 2f 0a 2f 2a 20 20 20 20 20 20 20 20 20 |***/./* | 000004c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000004f0 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 2f 0a | */.| 00000500 2f 2a 20 4d 6f 64 69 66 69 65 64 20 31 34 2f 32 |/* Modified 14/2| 00000510 2f 39 33 20 62 79 20 4d 69 63 68 61 65 6c 20 52 |/93 by Michael R| 00000520 6f 7a 64 6f 62 61 2e 20 20 20 20 20 20 20 20 20 |ozdoba. | 00000530 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000540 20 20 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 20 20 | */./* | 00000550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000590 20 20 20 2a 2f 0a 2f 2a 20 69 6e 63 6c 75 73 69 | */./* inclusi| 000005a0 6f 6e 20 6f 66 20 66 75 6e 63 74 69 6f 6e 20 74 |on of function t| 000005b0 6f 20 70 65 72 66 6f 72 6d 20 61 20 63 68 65 63 |o perform a chec| 000005c0 6b 20 6f 6e 20 65 78 69 73 74 65 6e 63 65 20 6f |k on existence o| 000005d0 66 20 6f 73 20 33 2e 31 30 20 20 20 20 20 2a 2f |f os 3.10 */| 000005e0 0a 2f 2a 20 6f 72 20 67 72 65 61 74 65 72 2c 20 |./* or greater, | 000005f0 75 73 69 6e 67 5f 6f 73 33 2c 20 20 20 20 20 20 |using_os3, | 00000600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000620 20 20 20 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 70 | */./* p| 00000630 6c 75 73 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e |lus modification| 00000640 20 6f 66 20 78 66 65 72 73 65 6e 64 2c 20 78 66 | of xfersend, xf| 00000650 65 72 73 65 6e 64 5f 5f 75 6e 6b 6e 6f 77 6e 73 |ersend__unknowns| 00000660 20 26 20 61 64 64 69 74 69 6f 6e 20 6f 66 20 20 | & addition of | 00000670 20 20 20 20 2a 2f 0a 2f 2a 20 78 66 65 72 73 65 | */./* xferse| 00000680 6e 64 5f 5f 75 73 69 6e 67 5f 64 72 61 67 61 73 |nd__using_dragas| 00000690 70 72 69 74 65 2c 20 64 72 61 67 61 73 70 72 69 |prite, dragaspri| 000006a0 74 65 5f 73 74 61 72 74 20 26 20 64 72 61 67 61 |te_start & draga| 000006b0 73 70 72 69 74 65 5f 73 74 6f 70 20 20 20 20 2a |sprite_stop *| 000006c0 2f 0a 2f 2a 20 74 6f 20 70 65 72 6d 69 74 20 75 |/./* to permit u| 000006d0 73 65 20 6f 66 20 6f 73 20 33 2e 31 30 20 44 72 |se of os 3.10 Dr| 000006e0 61 67 41 53 70 72 69 74 65 20 6d 6f 64 75 6c 65 |agASprite module| 000006f0 20 77 68 65 6e 20 73 61 76 69 6e 67 20 66 69 6c | when saving fil| 00000700 65 73 20 65 74 63 20 20 20 20 2a 2f 0a 2f 2a 20 |es etc */./* | 00000710 28 69 66 20 74 68 65 20 72 65 6c 65 76 61 6e 74 |(if the relevant| 00000720 20 43 4d 4f 53 20 6c 6f 63 61 74 69 6f 6e 20 68 | CMOS location h| 00000730 61 73 20 62 65 65 6e 20 73 65 74 20 74 6f 20 73 |as been set to s| 00000740 65 6c 65 63 74 20 74 68 69 73 29 20 20 20 20 20 |elect this) | 00000750 20 20 20 20 20 2a 2f 0a 2f 2a 20 20 20 20 20 20 | */./* | 00000760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000007a0 2a 2f 0a 2f 2a 20 4e 42 20 75 73 69 6e 67 5f 6f |*/./* NB using_o| 000007b0 73 33 20 69 73 20 75 73 65 64 20 68 65 72 65 20 |s3 is used here | 000007c0 74 6f 20 70 72 65 76 65 6e 74 20 63 61 6c 6c 69 |to prevent calli| 000007d0 6e 67 20 44 72 61 67 41 53 70 72 69 74 65 20 75 |ng DragASprite u| 000007e0 6e 64 65 72 20 6f 73 20 32 20 20 2a 2f 0a 2f 2a |nder os 2 */./*| 000007f0 20 73 68 6f 75 6c 64 20 74 68 65 20 41 63 6f 72 | should the Acor| 00000800 6e 20 72 65 73 65 72 76 65 64 20 43 4d 4f 53 20 |n reserved CMOS | 00000810 6c 6f 63 61 74 69 6f 6e 20 68 61 76 65 20 62 65 |location have be| 00000820 65 6e 20 63 6f 72 72 75 70 74 65 64 2c 20 67 69 |en corrupted, gi| 00000830 76 69 6e 67 20 20 2a 2f 0a 2f 2a 20 74 68 65 20 |ving */./* the | 00000840 66 61 6c 73 65 20 69 6d 70 72 65 73 73 69 6f 6e |false impression| 00000850 20 74 68 61 74 20 6f 73 20 69 73 20 33 2e 31 30 | that os is 3.10| 00000860 20 26 20 64 72 61 67 20 73 70 72 69 74 65 20 6f | & drag sprite o| 00000870 70 74 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 20 |ption has been | 00000880 20 2a 2f 0a 2f 2a 20 73 65 6c 65 63 74 65 64 2e | */./* selected.| 00000890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000008c0 20 20 20 20 20 20 20 20 20 20 20 20 2a 2f 0a 2f | */./| 000008d0 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |* | 000008e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000910 20 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 4e 6f 74 | */./* Not| 00000920 65 20 74 68 69 73 20 66 69 6c 65 20 64 6f 65 73 |e this file does| 00000930 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 61 6c 6c | not contain all| 00000940 20 66 75 6e 63 74 69 6f 6e 73 20 66 72 6f 6d 20 | functions from | 00000950 74 68 65 20 6f 72 69 67 69 6e 61 6c 3b 20 20 20 |the original; | 00000960 20 20 2a 2f 0a 2f 2a 20 69 74 20 69 73 20 69 6e | */./* it is in| 00000970 74 65 6e 64 65 64 20 6f 6e 6c 79 20 74 6f 20 73 |tended only to s| 00000980 75 70 70 6c 65 6d 65 6e 74 20 74 68 65 20 6f 72 |upplement the or| 00000990 69 67 69 6e 61 6c 20 66 75 6e 63 74 69 6f 6e 73 |iginal functions| 000009a0 20 70 72 6f 76 69 64 65 64 20 20 20 20 2a 2f 0a | provided */.| 000009b0 2f 2a 20 62 79 20 52 49 53 43 5f 4f 53 4c 69 62 |/* by RISC_OSLib| 000009c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000009f0 20 20 20 20 20 20 20 20 2a 2f 0a 2f 2a 20 78 66 | */./* xf| 00000a00 65 72 73 65 6e 64 5f 70 69 70 65 20 68 61 73 20 |ersend_pipe has | 00000a10 62 65 65 6e 20 72 65 6d 6f 76 65 64 20 66 72 6f |been removed fro| 00000a20 6d 20 74 68 69 73 20 66 69 6c 65 20 26 20 74 68 |m this file & th| 00000a30 65 20 61 73 73 6f 63 69 61 74 65 64 20 20 20 20 |e associated | 00000a40 20 20 20 2a 2f 0a 2f 2a 20 68 65 61 64 65 72 20 | */./* header | 00000a50 66 69 6c 65 20 2d 20 49 4d 50 4f 52 54 41 4e 54 |file - IMPORTANT| 00000a60 20 74 6f 20 75 73 65 20 74 68 69 73 20 66 69 6c | to use this fil| 00000a70 65 20 74 6f 20 63 6f 6d 70 69 6c 65 20 61 6e 20 |e to compile an | 00000a80 75 70 64 61 74 65 64 20 20 20 20 20 20 20 2a 2f |updated */| 00000a90 0a 2f 2a 20 76 65 72 73 69 6f 6e 20 6f 66 20 52 |./* version of R| 00000aa0 49 53 43 5f 4f 53 4c 69 62 2c 20 79 6f 75 20 6d |ISC_OSLib, you m| 00000ab0 75 73 74 20 6d 6f 64 69 66 79 20 74 68 69 73 20 |ust modify this | 00000ac0 66 69 6c 65 20 26 20 61 73 73 6f 63 69 61 74 65 |file & associate| 00000ad0 64 20 68 65 61 64 65 72 20 2a 2f 0a 2f 2a 20 62 |d header */./* b| 00000ae0 79 20 70 75 74 74 69 6e 67 20 62 61 63 6b 20 74 |y putting back t| 00000af0 68 69 73 20 66 75 6e 63 74 69 6f 6e 2e 20 20 20 |his function. | 00000b00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000b20 20 20 20 20 2a 2f 0a 2f 2a 20 20 20 20 20 20 20 | */./* | 00000b30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a | *| 00000b70 2f 0a 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |/./*************| 00000b80 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000bb0 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2f 0a 0a 23 64 |***********/..#d| 00000bc0 65 66 69 6e 65 20 42 4f 4f 4c 20 69 6e 74 0a 23 |efine BOOL int.#| 00000bd0 64 65 66 69 6e 65 20 54 52 55 45 20 31 0a 23 64 |define TRUE 1.#d| 00000be0 65 66 69 6e 65 20 46 41 4c 53 45 20 30 0a 0a 23 |efine FALSE 0..#| 00000bf0 69 6e 63 6c 75 64 65 20 3c 73 74 72 69 6e 67 2e |include <string.| 00000c00 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 |h>.#include <std| 00000c10 69 6f 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c |io.h>.#include <| 00000c20 73 74 64 6c 69 62 2e 68 3e 0a 0a 23 69 6e 63 6c |stdlib.h>..#incl| 00000c30 75 64 65 20 22 78 66 65 72 73 65 6e 64 2e 68 22 |ude "xfersend.h"| 00000c40 0a 0a 23 69 6e 63 6c 75 64 65 20 22 74 72 61 63 |..#include "trac| 00000c50 65 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 6f |e.h".#include "o| 00000c60 73 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 62 |s.h".#include "b| 00000c70 62 63 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 |bc.h".#include "| 00000c80 77 69 6d 70 2e 68 22 0a 23 69 6e 63 6c 75 64 65 |wimp.h".#include| 00000c90 20 22 77 69 6d 70 74 2e 68 22 0a 23 69 6e 63 6c | "wimpt.h".#incl| 00000ca0 75 64 65 20 22 77 69 6e 2e 68 22 0a 23 69 6e 63 |ude "win.h".#inc| 00000cb0 6c 75 64 65 20 22 64 62 6f 78 2e 68 22 0a 23 69 |lude "dbox.h".#i| 00000cc0 6e 63 6c 75 64 65 20 22 66 69 6c 65 69 63 6f 6e |nclude "fileicon| 00000cd0 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 77 65 |.h".#include "we| 00000ce0 72 72 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 |rr.h".#include "| 00000cf0 6d 65 6e 75 2e 68 22 0a 23 69 6e 63 6c 75 64 65 |menu.h".#include| 00000d00 20 22 65 76 65 6e 74 2e 68 22 0a 23 69 6e 63 6c | "event.h".#incl| 00000d10 75 64 65 20 22 6d 73 67 73 2e 68 22 0a 23 69 6e |ude "msgs.h".#in| 00000d20 63 6c 75 64 65 20 22 73 70 72 69 74 65 2e 68 22 |clude "sprite.h"| 00000d30 0a 0a 73 74 61 74 69 63 20 42 4f 4f 4c 20 78 66 |..static BOOL xf| 00000d40 65 72 73 65 6e 64 5f 5f 75 73 65 64 5f 64 72 61 |ersend__used_dra| 00000d50 67 61 73 70 72 69 74 65 20 3d 20 46 41 4c 53 45 |gasprite = FALSE| 00000d60 3b 0a 0a 73 74 61 74 69 63 20 69 6e 74 20 72 63 |;..static int rc| 00000d70 76 62 75 66 73 69 7a 65 20 3b 0a 73 74 61 74 69 |vbufsize ;.stati| 00000d80 63 20 69 6e 74 20 78 66 65 72 73 65 6e 64 5f 5f |c int xfersend__| 00000d90 6d 73 67 69 64 20 3d 20 30 3b 20 20 20 20 20 20 |msgid = 0; | 00000da0 20 20 20 20 20 2f 2a 20 6d 79 5f 72 65 66 20 6f | /* my_ref o| 00000db0 66 20 6c 61 73 74 20 44 61 74 61 53 61 76 65 20 |f last DataSave | 00000dc0 6d 65 73 73 61 67 65 20 2a 2f 0a 73 74 61 74 69 |message */.stati| 00000dd0 63 20 78 66 65 72 73 65 6e 64 5f 73 61 76 65 70 |c xfersend_savep| 00000de0 72 6f 63 20 78 66 65 72 73 65 6e 64 5f 5f 73 61 |roc xfersend__sa| 00000df0 76 65 70 72 6f 63 3b 0a 73 74 61 74 69 63 20 78 |veproc;.static x| 00000e00 66 65 72 73 65 6e 64 5f 73 65 6e 64 70 72 6f 63 |fersend_sendproc| 00000e10 20 78 66 65 72 73 65 6e 64 5f 5f 73 65 6e 64 70 | xfersend__sendp| 00000e20 72 6f 63 3b 0a 73 74 61 74 69 63 20 78 66 65 72 |roc;.static xfer| 00000e30 73 65 6e 64 5f 70 72 69 6e 74 70 72 6f 63 20 78 |send_printproc x| 00000e40 66 65 72 73 65 6e 64 5f 5f 70 72 69 6e 74 70 72 |fersend__printpr| 00000e50 6f 63 3b 0a 73 74 61 74 69 63 20 69 6e 74 20 78 |oc;.static int x| 00000e60 66 65 72 73 65 6e 64 5f 5f 66 69 6c 65 74 79 70 |fersend__filetyp| 00000e70 65 3b 0a 73 74 61 74 69 63 20 76 6f 69 64 20 2a |e;.static void *| 00000e80 78 66 65 72 73 65 6e 64 5f 5f 73 61 76 65 68 61 |xfersend__saveha| 00000e90 6e 64 6c 65 3b 0a 73 74 61 74 69 63 20 69 6e 74 |ndle;.static int| 00000ea0 20 78 66 65 72 73 65 6e 64 5f 5f 65 73 74 73 69 | xfersend__estsi| 00000eb0 7a 65 20 3d 20 30 3b 0a 73 74 61 74 69 63 20 77 |ze = 0;.static w| 00000ec0 69 6d 70 5f 74 20 78 66 65 72 73 65 6e 64 5f 5f |imp_t xfersend__| 00000ed0 72 65 63 65 69 76 65 72 20 3b 0a 73 74 61 74 69 |receiver ;.stati| 00000ee0 63 20 42 4f 4f 4c 20 78 66 65 72 73 65 6e 64 5f |c BOOL xfersend_| 00000ef0 5f 66 69 6c 65 69 73 73 61 66 65 20 3b 0a 73 74 |_fileissafe ;.st| 00000f00 61 74 69 63 20 63 68 61 72 20 2a 78 66 65 72 73 |atic char *xfers| 00000f10 65 6e 64 5f 5f 66 69 6c 65 6e 61 6d 65 3b 20 20 |end__filename; | 00000f20 2f 2a 5b 32 35 36 5d 2a 2f 0a 0a 73 74 61 74 69 |/*[256]*/..stati| 00000f30 63 20 77 69 6d 70 5f 6d 6f 75 73 65 73 74 72 20 |c wimp_mousestr | 00000f40 78 66 65 72 73 65 6e 64 5f 5f 6d 6f 75 73 65 73 |xfersend__mouses| 00000f50 74 72 3b 0a 73 74 61 74 69 63 20 77 69 6d 70 5f |tr;.static wimp_| 00000f60 6d 73 67 73 74 72 20 78 66 65 72 73 65 6e 64 5f |msgstr xfersend_| 00000f70 5f 6d 73 67 3b 0a 0a 0a 73 74 61 74 69 63 20 42 |_msg;...static B| 00000f80 4f 4f 4c 20 78 66 65 72 73 65 6e 64 5f 5f 63 6c |OOL xfersend__cl| 00000f90 6f 73 65 20 3d 20 46 41 4c 53 45 3b 0a 73 74 61 |ose = FALSE;.sta| 00000fa0 74 69 63 20 77 69 6d 70 5f 77 20 78 66 65 72 73 |tic wimp_w xfers| 00000fb0 65 6e 64 5f 5f 77 3b 0a 0a 23 64 65 66 69 6e 65 |end__w;..#define| 00000fc0 20 4f 53 5f 46 69 6c 65 20 38 0a 23 64 65 66 69 | OS_File 8.#defi| 00000fd0 6e 65 20 4f 53 5f 4d 6f 64 75 6c 65 20 30 78 31 |ne OS_Module 0x1| 00000fe0 65 0a 23 64 65 66 69 6e 65 20 44 72 61 67 41 53 |e.#define DragAS| 00000ff0 70 72 69 74 65 5f 53 74 61 72 74 20 30 78 34 32 |prite_Start 0x42| 00001000 34 30 30 0a 23 64 65 66 69 6e 65 20 44 72 61 67 |400.#define Drag| 00001010 41 53 70 72 69 74 65 5f 53 74 6f 70 20 30 78 34 |ASprite_Stop 0x4| 00001020 32 34 30 31 0a 0a 0a 42 4f 4f 4c 20 75 73 69 6e |2401...BOOL usin| 00001030 67 5f 6f 73 33 28 76 6f 69 64 29 0a 7b 0a 20 20 |g_os3(void).{. | 00001040 6f 73 5f 72 65 67 73 65 74 20 72 3b 0a 20 20 63 |os_regset r;. c| 00001050 68 61 72 20 2a 63 3b 0a 20 20 69 6e 74 20 76 3b |har *c;. int v;| 00001060 0a 20 20 72 2e 72 5b 30 5d 3d 31 38 3b 0a 20 20 |. r.r[0]=18;. | 00001070 72 2e 72 5b 31 5d 3d 28 69 6e 74 29 22 55 74 69 |r.r[1]=(int)"Uti| 00001080 6c 69 74 79 4d 6f 64 75 6c 65 22 3b 0a 20 20 69 |lityModule";. i| 00001090 66 20 28 6f 73 5f 73 77 69 78 28 4f 53 5f 4d 6f |f (os_swix(OS_Mo| 000010a0 64 75 6c 65 2c 20 26 72 29 29 20 72 65 74 75 72 |dule, &r)) retur| 000010b0 6e 20 46 41 4c 53 45 3b 0a 20 20 69 66 20 28 20 |n FALSE;. if ( | 000010c0 28 63 3d 73 74 72 73 74 72 28 20 28 63 68 61 72 |(c=strstr( (char| 000010d0 20 2a 29 28 72 2e 72 5b 33 5d 2b 2a 28 69 6e 74 | *)(r.r[3]+*(int| 000010e0 20 2a 29 28 72 2e 72 5b 33 5d 2b 32 30 29 29 2c | *)(r.r[3]+20)),| 000010f0 20 22 2e 22 20 29 29 20 3d 3d 20 30 20 29 20 72 | "." )) == 0 ) r| 00001100 65 74 75 72 6e 20 46 41 4c 53 45 3b 0a 20 20 76 |eturn FALSE;. v| 00001110 3d 31 30 30 2a 28 63 5b 2d 31 5d 2d 27 30 27 29 |=100*(c[-1]-'0')| 00001120 2b 31 30 2a 28 63 5b 31 5d 2d 27 30 27 29 2b 28 |+10*(c[1]-'0')+(| 00001130 63 5b 32 5d 2d 27 30 27 29 3b 0a 20 20 72 65 74 |c[2]-'0');. ret| 00001140 75 72 6e 20 28 76 3e 3d 33 31 30 29 3b 0a 7d 0a |urn (v>=310);.}.| 00001150 0a 73 74 61 74 69 63 20 69 6e 74 20 78 66 65 72 |.static int xfer| 00001160 73 65 6e 64 5f 5f 75 73 69 6e 67 5f 64 72 61 67 |send__using_drag| 00001170 61 73 70 72 69 74 65 28 76 6f 69 64 29 0a 7b 0a |asprite(void).{.| 00001180 20 20 69 6e 74 20 78 3d 32 38 2c 20 79 3b 0a 20 | int x=28, y;. | 00001190 20 69 66 20 28 6f 73 5f 62 79 74 65 28 31 36 31 | if (os_byte(161| 000011a0 2c 20 26 78 2c 20 26 79 29 29 20 72 65 74 75 72 |, &x, &y)) retur| 000011b0 6e 20 46 41 4c 53 45 3b 0a 20 20 72 65 74 75 72 |n FALSE;. retur| 000011c0 6e 20 28 79 26 32 29 20 3e 3e 20 31 20 3b 0a 7d |n (y&2) >> 1 ;.}| 000011d0 0a 0a 6f 73 5f 65 72 72 6f 72 20 2a 64 72 61 67 |..os_error *drag| 000011e0 61 73 70 72 69 74 65 5f 73 74 61 72 74 28 69 6e |asprite_start(in| 000011f0 74 20 66 6c 61 67 73 2c 20 73 70 72 69 74 65 5f |t flags, sprite_| 00001200 61 72 65 61 20 2a 61 72 65 61 2c 20 63 68 61 72 |area *area, char| 00001210 20 2a 6e 61 6d 65 2c 20 77 69 6d 70 5f 62 6f 78 | *name, wimp_box| 00001220 20 2a 62 6f 78 29 0a 7b 0a 20 20 6f 73 5f 72 65 | *box).{. os_re| 00001230 67 73 65 74 20 72 3b 0a 20 20 72 2e 72 5b 30 5d |gset r;. r.r[0]| 00001240 3d 66 6c 61 67 73 3b 0a 20 20 72 2e 72 5b 31 5d |=flags;. r.r[1]| 00001250 3d 28 69 6e 74 29 61 72 65 61 3b 0a 20 20 72 2e |=(int)area;. r.| 00001260 72 5b 32 5d 3d 28 69 6e 74 29 6e 61 6d 65 3b 0a |r[2]=(int)name;.| 00001270 20 20 72 2e 72 5b 33 5d 3d 28 69 6e 74 29 62 6f | r.r[3]=(int)bo| 00001280 78 3b 0a 20 20 72 2e 72 5b 34 5d 3d 30 3b 20 20 |x;. r.r[4]=0; | 00001290 20 20 20 20 20 20 20 20 20 20 20 2f 2a 6e 62 20 | /*nb | 000012a0 6e 6f 74 20 73 75 72 65 20 77 68 65 74 68 65 72 |not sure whether| 000012b0 20 74 68 69 73 20 69 73 20 61 20 72 65 71 75 69 | this is a requi| 000012c0 72 65 64 20 70 61 72 61 6d 65 74 65 72 20 77 68 |red parameter wh| 000012d0 69 63 68 20 64 6f 65 73 20 73 6f 6d 65 74 68 69 |ich does somethi| 000012e0 6e 67 20 2d 20 69 6e 20 21 53 71 75 61 73 68 2c |ng - in !Squash,| 000012f0 20 63 6f 64 65 20 63 6f 6e 74 61 69 6e 73 20 41 | code contains A| 00001300 50 43 53 2a 2f 0a 20 20 20 20 20 20 20 20 20 20 |PCS*/. | 00001310 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a | /*| 00001320 66 6e 20 63 61 6c 6c 65 64 20 64 72 61 67 61 73 |fn called dragas| 00001330 70 72 69 74 65 5f 73 74 61 72 74 20 28 70 72 65 |prite_start (pre| 00001340 73 75 6d 61 62 6c 79 20 66 72 6f 6d 20 61 6e 20 |sumably from an | 00001350 75 6e 72 65 6c 65 61 73 65 64 20 76 65 72 73 69 |unreleased versi| 00001360 6f 6e 20 6f 66 20 52 49 53 43 5f 4f 53 4c 69 62 |on of RISC_OSLib| 00001370 29 20 77 68 69 63 68 20 73 65 65 6d 73 20 74 6f |) which seems to| 00001380 20 74 61 6b 65 20 2a 2f 0a 20 20 20 20 20 20 20 | take */. | 00001390 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000013a0 20 2f 2a 35 20 70 61 72 61 6d 65 74 65 72 73 2c | /*5 parameters,| 000013b0 20 26 20 77 68 65 6e 20 63 61 6c 6c 65 64 20 74 | & when called t| 000013c0 68 69 73 20 69 73 20 70 61 73 73 65 64 20 61 73 |his is passed as| 000013d0 20 7a 65 72 6f 2c 20 68 6f 77 65 76 65 72 20 65 | zero, however e| 000013e0 78 61 6d 69 6e 61 74 69 6f 6e 20 6f 66 20 44 72 |xamination of Dr| 000013f0 61 67 41 53 70 72 69 74 65 20 6d 6f 64 75 6c 65 |agASprite module| 00001400 20 26 20 74 72 69 61 6c 73 2a 2f 0a 20 20 20 20 | & trials*/. | 00001410 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001420 20 20 20 20 2f 2a 66 61 69 6c 20 74 6f 20 73 68 | /*fail to sh| 00001430 6f 77 20 61 6e 79 20 70 75 72 70 6f 73 65 2f 65 |ow any purpose/e| 00001440 66 66 65 63 74 2c 20 73 6f 20 66 6f 72 20 74 68 |ffect, so for th| 00001450 65 20 74 69 6d 65 20 62 65 69 6e 67 2c 20 69 6e |e time being, in| 00001460 20 74 68 69 73 20 66 6e 20 73 65 74 20 72 34 20 | this fn set r4 | 00001470 74 6f 20 30 2a 2f 0a 20 20 72 65 74 75 72 6e 20 |to 0*/. return | 00001480 6f 73 5f 73 77 69 78 28 44 72 61 67 41 53 70 72 |os_swix(DragASpr| 00001490 69 74 65 5f 53 74 61 72 74 2c 20 26 72 29 3b 0a |ite_Start, &r);.| 000014a0 7d 0a 0a 6f 73 5f 65 72 72 6f 72 20 2a 64 72 61 |}..os_error *dra| 000014b0 67 61 73 70 72 69 74 65 5f 73 74 6f 70 28 76 6f |gasprite_stop(vo| 000014c0 69 64 29 0a 7b 0a 20 20 72 65 74 75 72 6e 20 6f |id).{. return o| 000014d0 73 5f 73 77 69 78 28 44 72 61 67 41 53 70 72 69 |s_swix(DragASpri| 000014e0 74 65 5f 53 74 6f 70 2c 20 30 29 3b 0a 7d 0a 0a |te_Stop, 0);.}..| 000014f0 0a 76 6f 69 64 20 78 66 65 72 73 65 6e 64 5f 63 |.void xfersend_c| 00001500 6c 6f 73 65 5f 6f 6e 5f 78 66 65 72 28 42 4f 4f |lose_on_xfer(BOO| 00001510 4c 20 64 6f 5f 77 65 5f 63 6c 6f 73 65 2c 20 77 |L do_we_close, w| 00001520 69 6d 70 5f 77 20 77 29 0a 7b 20 20 0a 20 20 20 |imp_w w).{ . | 00001530 78 66 65 72 73 65 6e 64 5f 5f 63 6c 6f 73 65 20 |xfersend__close | 00001540 3d 20 64 6f 5f 77 65 5f 63 6c 6f 73 65 3b 0a 20 |= do_we_close;. | 00001550 20 20 78 66 65 72 73 65 6e 64 5f 5f 77 20 3d 20 | xfersend__w = | 00001560 77 3b 0a 7d 0a 0a 73 74 61 74 69 63 20 76 6f 69 |w;.}..static voi| 00001570 64 20 78 66 65 72 73 65 6e 64 5f 5f 77 69 6e 63 |d xfersend__winc| 00001580 6c 6f 73 65 28 76 6f 69 64 29 0a 7b 20 20 0a 20 |lose(void).{ . | 00001590 20 20 77 69 6d 70 5f 65 76 65 6e 74 64 61 74 61 | wimp_eventdata| 000015a0 20 65 3b 0a 20 20 20 65 2e 6f 2e 77 20 3d 20 78 | e;. e.o.w = x| 000015b0 66 65 72 73 65 6e 64 5f 5f 77 3b 0a 20 20 20 77 |fersend__w;. w| 000015c0 69 6d 70 74 5f 6e 6f 65 72 72 28 77 69 6d 70 5f |impt_noerr(wimp_| 000015d0 73 65 6e 64 77 6d 65 73 73 61 67 65 28 77 69 6d |sendwmessage(wim| 000015e0 70 5f 45 43 4c 4f 53 45 2c 20 28 77 69 6d 70 5f |p_ECLOSE, (wimp_| 000015f0 6d 73 67 73 74 72 2a 29 20 26 65 2c 20 65 2e 6f |msgstr*) &e, e.o| 00001600 2e 77 2c 20 2d 31 29 29 3b 0a 7d 0a 0a 0a 73 74 |.w, -1));.}...st| 00001610 61 74 69 63 20 42 4f 4f 4c 20 78 66 65 72 73 65 |atic BOOL xferse| 00001620 6e 64 5f 5f 75 6e 6b 6e 6f 77 6e 73 28 77 69 6d |nd__unknowns(wim| 00001630 70 5f 65 76 65 6e 74 73 74 72 20 2a 65 2c 20 76 |p_eventstr *e, v| 00001640 6f 69 64 20 2a 68 61 6e 64 6c 65 29 0a 0a 7b 0a |oid *handle)..{.| 00001650 20 20 20 68 61 6e 64 6c 65 20 3d 20 68 61 6e 64 | handle = hand| 00001660 6c 65 20 3b 0a 20 20 20 74 72 61 63 65 66 31 28 |le ;. tracef1(| 00001670 22 78 66 65 72 73 65 6e 64 20 72 61 77 20 65 76 |"xfersend raw ev| 00001680 65 6e 74 20 25 69 2e 5c 6e 22 2c 20 65 2d 3e 65 |ent %i.\n", e->e| 00001690 29 3b 0a 20 20 20 73 77 69 74 63 68 20 28 65 2d |);. switch (e-| 000016a0 3e 65 29 0a 20 20 20 7b 20 0a 20 20 20 20 20 20 |>e). { . | 000016b0 63 61 73 65 20 77 69 6d 70 5f 45 55 53 45 52 44 |case wimp_EUSERD| 000016c0 52 41 47 3a 0a 20 20 20 20 20 20 20 74 72 61 63 |RAG:. trac| 000016d0 65 66 30 28 22 64 72 61 67 20 65 76 65 6e 74 20 |ef0("drag event | 000016e0 72 65 63 65 69 76 65 64 2e 5c 6e 22 29 3b 0a 20 |received.\n");. | 000016f0 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 | {. | 00001700 20 20 69 66 20 28 78 66 65 72 73 65 6e 64 5f 5f | if (xfersend__| 00001710 75 73 65 64 5f 64 72 61 67 61 73 70 72 69 74 65 |used_dragasprite| 00001720 29 20 64 72 61 67 61 73 70 72 69 74 65 5f 73 74 |) dragasprite_st| 00001730 6f 70 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 |op();. | 00001740 77 69 6d 70 5f 67 65 74 5f 70 6f 69 6e 74 5f 69 |wimp_get_point_i| 00001750 6e 66 6f 28 26 78 66 65 72 73 65 6e 64 5f 5f 6d |nfo(&xfersend__m| 00001760 6f 75 73 65 73 74 72 29 3b 0a 20 20 20 20 20 20 |ousestr);. | 00001770 20 20 20 20 69 66 20 28 78 66 65 72 73 65 6e 64 | if (xfersend| 00001780 5f 5f 6d 6f 75 73 65 73 74 72 2e 77 20 3d 3d 20 |__mousestr.w == | 00001790 2d 31 29 0a 20 20 20 20 20 20 20 20 20 20 7b 0a |-1). {.| 000017a0 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 61 | tra| 000017b0 63 65 66 30 28 22 64 72 61 67 20 74 6f 20 6e 6f |cef0("drag to no| 000017c0 20 77 69 6e 64 6f 77 3a 20 68 61 73 20 6e 6f 20 | window: has no | 000017d0 65 66 66 65 63 74 2e 5c 6e 22 29 3b 0a 20 20 20 |effect.\n");. | 000017e0 20 20 20 20 20 20 20 20 20 20 2f 2a 20 64 6f 20 | /* do | 000017f0 6e 6f 74 68 69 6e 67 20 2a 2f 0a 20 20 20 20 20 |nothing */. | 00001800 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 | }. | 00001810 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 | else. | 00001820 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 77 |{. w| 00001830 69 6d 70 5f 6d 73 67 73 74 72 20 6d 73 67 3b 0a |imp_msgstr msg;.| 00001840 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 |. tr| 00001850 61 63 65 66 31 28 22 64 72 61 67 20 74 6f 20 77 |acef1("drag to w| 00001860 69 6e 64 6f 77 20 25 69 3a 20 6f 66 66 65 72 20 |indow %i: offer | 00001870 64 61 74 61 2e 5c 6e 22 2c 20 78 66 65 72 73 65 |data.\n", xferse| 00001880 6e 64 5f 5f 6d 6f 75 73 65 73 74 72 2e 77 29 3b |nd__mousestr.w);| 00001890 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 73 |. ms| 000018a0 67 2e 68 64 72 2e 73 69 7a 65 20 3d 20 73 69 7a |g.hdr.size = siz| 000018b0 65 6f 66 28 77 69 6d 70 5f 6d 73 67 68 64 72 29 |eof(wimp_msghdr)| 000018c0 20 2b 20 73 69 7a 65 6f 66 28 77 69 6d 70 5f 6d | + sizeof(wimp_m| 000018d0 73 67 64 61 74 61 73 61 76 65 29 3b 0a 20 20 20 |sgdatasave);. | 000018e0 20 20 20 20 20 20 20 20 20 20 6d 73 67 2e 68 64 | msg.hd| 000018f0 72 2e 74 61 73 6b 20 3d 20 78 66 65 72 73 65 6e |r.task = xfersen| 00001900 64 5f 5f 6d 6f 75 73 65 73 74 72 2e 77 3b 0a 20 |d__mousestr.w;. | 00001910 20 20 20 20 20 20 20 20 20 20 20 20 6d 73 67 2e | msg.| 00001920 68 64 72 2e 79 6f 75 72 5f 72 65 66 20 3d 20 30 |hdr.your_ref = 0| 00001930 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 6d |;. m| 00001940 73 67 2e 68 64 72 2e 61 63 74 69 6f 6e 20 3d 20 |sg.hdr.action = | 00001950 77 69 6d 70 5f 4d 44 41 54 41 53 41 56 45 3b 0a |wimp_MDATASAVE;.| 00001960 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 73 67 | msg| 00001970 2e 64 61 74 61 2e 64 61 74 61 73 61 76 65 2e 77 |.data.datasave.w| 00001980 20 3d 20 78 66 65 72 73 65 6e 64 5f 5f 6d 6f 75 | = xfersend__mou| 00001990 73 65 73 74 72 2e 77 3b 0a 20 20 20 20 20 20 20 |sestr.w;. | 000019a0 20 20 20 20 20 20 6d 73 67 2e 64 61 74 61 2e 64 | msg.data.d| 000019b0 61 74 61 73 61 76 65 2e 69 20 3d 20 78 66 65 72 |atasave.i = xfer| 000019c0 73 65 6e 64 5f 5f 6d 6f 75 73 65 73 74 72 2e 69 |send__mousestr.i| 000019d0 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 6d |;. m| 000019e0 73 67 2e 64 61 74 61 2e 64 61 74 61 73 61 76 65 |sg.data.datasave| 000019f0 2e 78 20 3d 20 78 66 65 72 73 65 6e 64 5f 5f 6d |.x = xfersend__m| 00001a00 6f 75 73 65 73 74 72 2e 78 3b 0a 20 20 20 20 20 |ousestr.x;. | 00001a10 20 20 20 20 20 20 20 20 6d 73 67 2e 64 61 74 61 | msg.data| 00001a20 2e 64 61 74 61 73 61 76 65 2e 79 20 3d 20 78 66 |.datasave.y = xf| 00001a30 65 72 73 65 6e 64 5f 5f 6d 6f 75 73 65 73 74 72 |ersend__mousestr| 00001a40 2e 79 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 |.y;. | 00001a50 20 6d 73 67 2e 64 61 74 61 2e 64 61 74 61 73 61 | msg.data.datasa| 00001a60 76 65 2e 74 79 70 65 20 3d 20 78 66 65 72 73 65 |ve.type = xferse| 00001a70 6e 64 5f 5f 66 69 6c 65 74 79 70 65 3b 0a 20 20 |nd__filetype;. | 00001a80 20 20 20 20 20 20 20 20 20 20 20 6d 73 67 2e 64 | msg.d| 00001a90 61 74 61 2e 64 61 74 61 73 61 76 65 2e 65 73 74 |ata.datasave.est| 00001aa0 73 69 7a 65 20 3d 20 78 66 65 72 73 65 6e 64 5f |size = xfersend_| 00001ab0 5f 65 73 74 73 69 7a 65 3b 0a 20 20 20 20 20 20 |_estsize;. | 00001ac0 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 | {. | 00001ad0 20 20 20 20 20 20 20 20 20 69 6e 74 20 69 2c 20 | int i, | 00001ae0 74 61 69 6c 3b 0a 20 20 20 20 20 20 20 20 20 20 |tail;. | 00001af0 20 20 20 20 20 20 63 68 61 72 20 6e 61 6d 65 5b | char name[| 00001b00 32 35 36 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 |256];. | 00001b10 20 20 20 20 20 20 73 74 72 6e 63 70 79 28 6e 61 | strncpy(na| 00001b20 6d 65 2c 78 66 65 72 73 65 6e 64 5f 5f 66 69 6c |me,xfersend__fil| 00001b30 65 6e 61 6d 65 2c 20 20 32 35 36 29 3b 0a 20 20 |ename, 256);. | 00001b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 61 | ta| 00001b50 69 6c 20 3d 20 73 74 72 6c 65 6e 28 6e 61 6d 65 |il = strlen(name| 00001b60 29 3b 20 2f 2a 20 70 6f 69 6e 74 20 61 74 20 74 |); /* point at t| 00001b70 68 65 20 7a 65 72 6f 20 2a 2f 0a 20 20 20 20 20 |he zero */. | 00001b80 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 | while| 00001b90 20 28 74 61 69 6c 20 3e 20 30 20 26 26 20 6e 61 | (tail > 0 && na| 00001ba0 6d 65 5b 74 61 69 6c 2d 31 5d 20 21 3d 20 27 2e |me[tail-1] != '.| 00001bb0 27 20 26 26 20 6e 61 6d 65 5b 74 61 69 6c 2d 31 |' && name[tail-1| 00001bc0 5d 20 21 3d 20 27 3a 27 29 0a 20 20 20 20 20 20 |] != ':'). | 00001bd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 | t| 00001be0 61 69 6c 2d 2d 3b 0a 0a 20 20 20 20 20 20 20 20 |ail--;.. | 00001bf0 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 20 3d | for (i =| 00001c00 20 30 3b 20 69 20 3c 3d 20 31 30 3b 20 69 2b 2b | 0; i <= 10; i++| 00001c10 29 20 6d 73 67 2e 64 61 74 61 2e 64 61 74 61 73 |) msg.data.datas| 00001c20 61 76 65 2e 6c 65 61 66 5b 69 5d 20 3d 20 6e 61 |ave.leaf[i] = na| 00001c30 6d 65 5b 74 61 69 6c 2b 2b 5d 3b 0a 20 20 20 20 |me[tail++];. | 00001c40 20 20 20 20 20 20 20 20 20 20 20 20 6d 73 67 2e | msg.| 00001c50 64 61 74 61 2e 64 61 74 61 73 61 76 65 2e 6c 65 |data.datasave.le| 00001c60 61 66 5b 31 31 5d 20 3d 20 27 5c 30 27 20 3b 20 |af[11] = '\0' ; | 00001c70 20 20 20 20 2f 2a 20 66 6f 72 63 65 20 74 65 72 | /* force ter| 00001c80 6d 69 6e 61 74 69 6f 6e 20 2a 2f 0a 20 20 20 20 |mination */. | 00001c90 20 20 20 20 20 20 20 20 20 20 20 20 74 72 61 63 | trac| 00001ca0 65 66 31 28 22 73 75 67 67 65 73 74 20 6c 65 61 |ef1("suggest lea| 00001cb0 66 20 27 25 73 27 2e 5c 6e 22 2c 20 28 69 6e 74 |f '%s'.\n", (int| 00001cc0 29 20 26 6d 73 67 2e 64 61 74 61 2e 64 61 74 61 |) &msg.data.data| 00001cd0 73 61 76 65 2e 6c 65 61 66 5b 30 5d 29 3b 0a 20 |save.leaf[0]);. | 00001ce0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 | }. | 00001cf0 20 20 20 20 20 20 20 20 20 20 20 77 69 6d 70 74 | wimpt| 00001d00 5f 6e 6f 65 72 72 28 77 69 6d 70 5f 73 65 6e 64 |_noerr(wimp_send| 00001d10 77 6d 65 73 73 61 67 65 28 0a 20 20 20 20 20 20 |wmessage(. | 00001d20 20 20 20 20 20 20 20 20 20 20 77 69 6d 70 5f 45 | wimp_E| 00001d30 53 45 4e 44 2c 20 26 6d 73 67 2c 20 78 66 65 72 |SEND, &msg, xfer| 00001d40 73 65 6e 64 5f 5f 6d 6f 75 73 65 73 74 72 2e 77 |send__mousestr.w| 00001d50 2c 20 78 66 65 72 73 65 6e 64 5f 5f 6d 6f 75 73 |, xfersend__mous| 00001d60 65 73 74 72 2e 69 29 29 3b 0a 20 20 20 20 20 20 |estr.i));. | 00001d70 20 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f | xfersend_| 00001d80 5f 6d 73 67 69 64 20 3d 20 6d 73 67 2e 68 64 72 |_msgid = msg.hdr| 00001d90 2e 6d 79 5f 72 65 66 3b 20 2f 2a 20 66 69 6c 6c |.my_ref; /* fill| 00001da0 65 64 20 69 6e 20 62 79 20 77 69 6d 70 2e 20 2a |ed in by wimp. *| 00001db0 2f 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 2f |/. /| 00001dc0 2a 20 57 65 20 73 74 69 6c 6c 20 67 65 74 20 75 |* We still get u| 00001dd0 6e 6b 6e 6f 77 6e 20 65 76 65 6e 74 73 2c 20 73 |nknown events, s| 00001de0 6f 20 77 65 27 6c 6c 20 67 65 74 20 74 68 65 20 |o we'll get the | 00001df0 72 65 70 6c 79 20 73 6f 6d 65 74 69 6d 65 2e 20 |reply sometime. | 00001e00 2a 2f 0a 20 20 20 20 20 20 20 20 20 20 7d 0a 20 |*/. }. | 00001e10 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 72 | }. r| 00001e20 65 74 75 72 6e 20 54 52 55 45 3b 0a 0a 20 20 20 |eturn TRUE;.. | 00001e30 20 63 61 73 65 20 77 69 6d 70 5f 45 53 45 4e 44 | case wimp_ESEND| 00001e40 3a 0a 20 20 20 20 63 61 73 65 20 77 69 6d 70 5f |:. case wimp_| 00001e50 45 53 45 4e 44 57 41 4e 54 41 43 4b 3a 0a 0a 20 |ESENDWANTACK:.. | 00001e60 20 20 20 20 20 74 72 61 63 65 66 33 20 28 22 78 | tracef3 ("x| 00001e70 66 65 72 73 65 6e 64 20 6d 73 67 20 25 78 20 72 |fersend msg %x r| 00001e80 65 63 65 69 76 65 64 3a 20 25 69 20 25 69 2e 5c |eceived: %i %i.\| 00001e90 6e 22 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 |n",. | 00001ea0 20 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 64 | e->data.msg.hd| 00001eb0 72 2e 61 63 74 69 6f 6e 2c 65 2d 3e 64 61 74 61 |r.action,e->data| 00001ec0 2e 6d 73 67 2e 68 64 72 2e 79 6f 75 72 5f 72 65 |.msg.hdr.your_re| 00001ed0 66 2c 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 69 |f,xfersend__msgi| 00001ee0 64 29 3b 0a 0a 20 20 20 20 20 20 69 66 20 28 65 |d);.. if (e| 00001ef0 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 79 |->data.msg.hdr.y| 00001f00 6f 75 72 5f 72 65 66 20 3d 3d 20 78 66 65 72 73 |our_ref == xfers| 00001f10 65 6e 64 5f 5f 6d 73 67 69 64 29 0a 20 20 20 20 |end__msgid). | 00001f20 20 20 20 73 77 69 74 63 68 20 28 65 2d 3e 64 61 | switch (e->da| 00001f30 74 61 2e 6d 73 67 2e 68 64 72 2e 61 63 74 69 6f |ta.msg.hdr.actio| 00001f40 6e 29 0a 20 20 20 20 20 20 20 7b 0a 20 20 20 20 |n). {. | 00001f50 20 20 20 20 20 20 63 61 73 65 20 77 69 6d 70 5f | case wimp_| 00001f60 4d 52 41 4d 46 45 54 43 48 3a 0a 20 20 20 20 20 |MRAMFETCH:. | 00001f70 20 20 20 20 20 20 20 69 66 20 28 78 66 65 72 73 | if (xfers| 00001f80 65 6e 64 5f 5f 73 65 6e 64 70 72 6f 63 20 21 3d |end__sendproc !=| 00001f90 20 30 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 | 0). | 00001fa0 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |{. | 00001fb0 20 78 66 65 72 73 65 6e 64 5f 5f 66 69 6c 65 69 | xfersend__filei| 00001fc0 73 73 61 66 65 20 3d 20 46 41 4c 53 45 20 3b 0a |ssafe = FALSE ;.| 00001fd0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00001fe0 2f 2a 20 48 65 20 77 61 6e 74 73 20 74 6f 20 64 |/* He wants to d| 00001ff0 6f 20 61 6e 20 69 6e 2d 63 6f 72 65 20 74 72 61 |o an in-core tra| 00002000 6e 73 66 65 72 2c 20 61 6e 64 20 77 65 20 63 61 |nsfer, and we ca| 00002010 6e 20 64 6f 20 74 68 69 73 2e 20 2a 2f 0a 20 20 |n do this. */. | 00002020 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 | /* | 00002030 4e 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 63 |Note that this c| 00002040 61 6e 27 74 20 62 65 20 6f 74 68 65 72 20 74 68 |an't be other th| 00002050 61 6e 20 74 68 65 20 66 69 72 73 74 20 72 65 73 |an the first res| 00002060 70 6f 6e 73 65 2c 20 61 73 20 6f 74 68 65 72 73 |ponse, as others| 00002070 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002080 20 20 20 61 72 65 20 67 72 61 62 62 65 64 20 62 | are grabbed b| 00002090 79 20 73 65 6e 64 62 75 66 20 2a 2f 0a 0a 20 20 |y sendbuf */.. | 000020a0 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 61 | tra| 000020b0 63 65 66 30 28 22 72 61 6d 20 74 72 61 6e 73 66 |cef0("ram transf| 000020c0 65 72 20 73 74 61 72 74 69 6e 67 2e 5c 6e 22 29 |er starting.\n")| 000020d0 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |;.. | 000020e0 20 20 2f 2a 20 50 72 65 70 61 72 65 20 74 68 65 | /* Prepare the| 000020f0 20 72 65 70 6c 79 20 72 65 63 6f 72 64 2e 20 2a | reply record. *| 00002100 2f 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |/. | 00002110 20 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 20 3d | xfersend__msg =| 00002120 20 65 2d 3e 64 61 74 61 2e 6d 73 67 3b 0a 20 20 | e->data.msg;. | 00002130 20 20 20 20 20 20 20 20 20 20 20 20 20 78 66 65 | xfe| 00002140 72 73 65 6e 64 5f 5f 6d 73 67 2e 68 64 72 2e 79 |rsend__msg.hdr.y| 00002150 6f 75 72 5f 72 65 66 20 3d 20 78 66 65 72 73 65 |our_ref = xferse| 00002160 6e 64 5f 5f 6d 73 67 2e 68 64 72 2e 6d 79 5f 72 |nd__msg.hdr.my_r| 00002170 65 66 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 |ef;. | 00002180 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 | xfersend__msg| 00002190 2e 68 64 72 2e 61 63 74 69 6f 6e 20 3d 20 77 69 |.hdr.action = wi| 000021a0 6d 70 5f 4d 52 41 4d 54 52 41 4e 53 4d 49 54 3b |mp_MRAMTRANSMIT;| 000021b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000021c0 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 |xfersend__msg.da| 000021d0 74 61 2e 72 61 6d 74 72 61 6e 73 6d 69 74 2e 61 |ta.ramtransmit.a| 000021e0 64 64 72 20 3d 20 65 2d 3e 64 61 74 61 2e 6d 73 |ddr = e->data.ms| 000021f0 67 2e 64 61 74 61 2e 72 61 6d 66 65 74 63 68 2e |g.data.ramfetch.| 00002200 61 64 64 72 3b 0a 20 20 20 20 20 20 20 20 20 20 |addr;. | 00002210 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 6d | xfersend__m| 00002220 73 67 2e 64 61 74 61 2e 72 61 6d 74 72 61 6e 73 |sg.data.ramtrans| 00002230 6d 69 74 2e 6e 62 79 74 65 73 77 72 69 74 74 65 |mit.nbyteswritte| 00002240 6e 20 3d 20 30 3b 20 2f 2a 20 73 6f 20 66 61 72 |n = 0; /* so far| 00002250 2e 20 2a 2f 0a 20 20 20 20 20 20 20 20 20 20 20 |. */. | 00002260 20 20 20 20 72 63 76 62 75 66 73 69 7a 65 20 3d | rcvbufsize =| 00002270 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 64 61 74 | e->data.msg.dat| 00002280 61 2e 72 61 6d 66 65 74 63 68 2e 6e 62 79 74 65 |a.ramfetch.nbyte| 00002290 73 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 |s;.. | 000022a0 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 72 65 63 | xfersend__rec| 000022b0 65 69 76 65 72 20 3d 20 65 2d 3e 64 61 74 61 2e |eiver = e->data.| 000022c0 6d 73 67 2e 68 64 72 2e 74 61 73 6b 20 3b 0a 20 |msg.hdr.task ;. | 000022d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a | /*| 000022e0 20 74 68 65 20 63 6f 70 79 20 69 6e 20 78 66 65 | the copy in xfe| 000022f0 72 73 65 6e 64 5f 5f 6d 73 67 2e 68 64 72 2e 74 |rsend__msg.hdr.t| 00002300 61 73 6b 20 69 73 20 6f 76 65 72 77 72 69 74 74 |ask is overwritt| 00002310 65 6e 20 62 79 20 74 68 65 20 57 69 6d 70 0a 20 |en by the Wimp. | 00002320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002330 20 6d 65 73 73 61 67 65 20 73 65 6e 64 69 6e 67 | message sending| 00002340 20 2a 2f 0a 0a 20 20 20 20 20 20 20 20 20 20 20 | */.. | 00002350 20 20 20 20 69 66 20 28 78 66 65 72 73 65 6e 64 | if (xfersend| 00002360 5f 5f 73 65 6e 64 70 72 6f 63 28 78 66 65 72 73 |__sendproc(xfers| 00002370 65 6e 64 5f 5f 73 61 76 65 68 61 6e 64 6c 65 2c |end__savehandle,| 00002380 20 26 72 63 76 62 75 66 73 69 7a 65 29 29 0a 20 | &rcvbufsize)). | 00002390 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0a | {.| 000023a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000023b0 20 20 2f 2a 20 53 65 65 20 73 65 6e 64 62 75 66 | /* See sendbuf| 000023c0 20 66 6f 72 20 61 6c 6c 20 74 68 65 20 72 65 61 | for all the rea| 000023d0 6c 20 77 6f 72 6b 20 66 6f 72 20 74 68 69 73 20 |l work for this | 000023e0 63 61 73 65 2e 2e 2e 20 2a 2f 0a 20 20 20 20 20 |case... */. | 000023f0 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 61 | tra| 00002400 63 65 66 30 28 22 54 68 65 20 73 65 6e 64 20 73 |cef0("The send s| 00002410 75 63 63 65 65 64 65 64 3b 20 73 65 6e 64 20 66 |ucceeded; send f| 00002420 69 6e 61 6c 20 52 41 4d 54 52 41 4e 53 4d 49 54 |inal RAMTRANSMIT| 00002430 2e 5c 6e 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 |.\n");.. | 00002440 20 20 20 20 20 20 20 20 20 20 2f 2a 20 57 65 20 | /* We | 00002450 6d 61 79 20 68 61 76 65 20 74 72 61 6e 73 66 65 |may have transfe| 00002460 72 72 65 64 20 73 6f 6d 65 20 64 61 74 61 20 62 |rred some data b| 00002470 75 74 20 6e 6f 74 20 79 65 74 20 74 6f 6c 64 20 |ut not yet told | 00002480 74 68 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 |the. | 00002490 20 20 20 20 20 20 6f 74 68 65 72 20 65 6e 64 20 | other end | 000024a0 61 62 6f 75 74 20 69 74 2e 20 78 66 65 72 73 65 |about it. xferse| 000024b0 6e 64 5f 5f 6d 73 67 20 63 6f 6e 74 61 69 6e 73 |nd__msg contains| 000024c0 20 61 20 66 69 6e 61 6c 20 52 41 4d 54 52 41 4e | a final RAMTRAN| 000024d0 53 4d 49 54 2c 0a 20 20 20 20 20 20 20 20 20 20 |SMIT,. | 000024e0 20 20 20 20 20 20 20 20 77 68 69 63 68 20 64 6f | which do| 000024f0 65 73 20 6e 6f 74 20 71 75 69 74 65 20 66 69 6c |es not quite fil| 00002500 6c 20 68 69 73 20 62 75 66 66 65 72 20 28 6f 72 |l his buffer (or| 00002510 20 77 65 27 64 20 68 61 76 65 20 73 65 6e 74 20 | we'd have sent | 00002520 69 74 20 61 6c 72 65 61 64 79 29 0a 20 20 20 20 |it already). | 00002530 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 | th| 00002540 75 73 20 73 69 67 6e 61 6c 6c 69 6e 67 20 74 6f |us signalling to| 00002550 20 68 69 6d 20 74 68 61 74 20 74 68 65 20 74 72 | him that the tr| 00002560 61 6e 73 66 65 72 20 69 73 20 6f 76 65 72 2e 20 |ansfer is over. | 00002570 2a 2f 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 |*/.. | 00002580 20 20 20 20 20 20 77 69 6d 70 74 5f 6e 6f 65 72 | wimpt_noer| 00002590 72 28 77 69 6d 70 5f 73 65 6e 64 6d 65 73 73 61 |r(wimp_sendmessa| 000025a0 67 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |ge. | 000025b0 20 20 20 20 20 28 20 77 69 6d 70 5f 45 53 45 4e | ( wimp_ESEN| 000025c0 44 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |D,. | 000025d0 20 20 20 20 20 20 20 26 78 66 65 72 73 65 6e 64 | &xfersend| 000025e0 5f 5f 6d 73 67 2c 0a 20 20 20 20 20 20 20 20 20 |__msg,. | 000025f0 20 20 20 20 20 20 20 20 20 20 20 78 66 65 72 73 | xfers| 00002600 65 6e 64 5f 5f 72 65 63 65 69 76 65 72 29 29 3b |end__receiver));| 00002610 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002620 20 20 20 69 66 28 78 66 65 72 73 65 6e 64 5f 5f | if(xfersend__| 00002630 63 6c 6f 73 65 29 20 78 66 65 72 73 65 6e 64 5f |close) xfersend_| 00002640 5f 77 69 6e 63 6c 6f 73 65 28 29 3b 0a 0a 20 20 |_winclose();.. | 00002650 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 | }. | 00002660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c | el| 00002670 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |se. | 00002680 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | {. | 00002690 20 20 20 20 20 20 74 72 61 63 65 66 30 28 22 74 | tracef0("t| 000026a0 68 65 20 73 65 6e 64 20 66 61 69 6c 65 64 2e 5c |he send failed.\| 000026b0 6e 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 |n");. | 000026c0 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 20 | }.. | 000026d0 20 20 20 20 20 20 72 65 74 75 72 6e 20 54 52 55 | return TRU| 000026e0 45 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d |E;. }| 000026f0 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 |. bre| 00002700 61 6b 20 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 |ak ;.. | 00002710 63 61 73 65 20 77 69 6d 70 5f 4d 50 72 69 6e 74 |case wimp_MPrint| 00002720 46 69 6c 65 3a 20 20 20 20 20 20 20 2f 2a 20 77 |File: /* w| 00002730 61 73 20 64 72 6f 70 70 65 64 20 6f 6e 20 61 20 |as dropped on a | 00002740 70 72 69 6e 74 65 72 20 61 70 70 6c 69 63 61 74 |printer applicat| 00002750 69 6f 6e 20 2a 2f 0a 20 20 20 20 20 20 20 20 20 |ion */. | 00002760 20 20 20 69 66 20 28 78 66 65 72 73 65 6e 64 5f | if (xfersend_| 00002770 5f 70 72 69 6e 74 70 72 6f 63 20 21 3d 20 30 29 |_printproc != 0)| 00002780 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0a 20 |. {. | 00002790 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e | in| 000027a0 74 20 72 65 73 20 3b 0a 20 20 20 20 20 20 20 20 |t res ;. | 000027b0 20 20 20 20 20 20 20 77 69 6d 70 5f 74 20 78 66 | wimp_t xf| 000027c0 65 72 73 65 6e 64 5f 5f 70 72 69 6e 74 65 72 20 |ersend__printer | 000027d0 3d 20 30 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 |= 0;.. | 000027e0 20 20 20 20 20 74 72 61 63 65 66 30 28 22 70 72 | tracef0("pr| 000027f0 69 6e 74 20 72 65 71 75 65 73 74 20 61 63 63 65 |int request acce| 00002800 70 74 61 62 6c 65 5c 6e 22 29 3b 0a 20 20 20 20 |ptable\n");. | 00002810 20 20 20 20 20 20 20 20 20 20 20 78 66 65 72 73 | xfers| 00002820 65 6e 64 5f 5f 66 69 6c 65 69 73 73 61 66 65 20 |end__fileissafe | 00002830 3d 20 46 41 4c 53 45 20 3b 0a 0a 20 20 20 20 20 |= FALSE ;.. | 00002840 20 20 20 20 20 20 20 20 20 20 72 65 73 20 3d 20 | res = | 00002850 78 66 65 72 73 65 6e 64 5f 5f 70 72 69 6e 74 70 |xfersend__printp| 00002860 72 6f 63 28 26 65 2d 3e 64 61 74 61 2e 6d 73 67 |roc(&e->data.msg| 00002870 2e 64 61 74 61 2e 70 72 69 6e 74 2e 6e 61 6d 65 |.data.print.name| 00002880 5b 30 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 |[0],. | 00002890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000028b0 20 20 78 66 65 72 73 65 6e 64 5f 5f 73 61 76 65 | xfersend__save| 000028c0 68 61 6e 64 6c 65 29 20 3b 0a 0a 20 20 20 20 20 |handle) ;.. | 000028d0 20 20 20 20 20 20 20 20 20 20 78 66 65 72 73 65 | xferse| 000028e0 6e 64 5f 5f 70 72 69 6e 74 65 72 20 3d 20 65 2d |nd__printer = e-| 000028f0 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 74 61 |>data.msg.hdr.ta| 00002900 73 6b 20 3b 0a 20 20 20 20 20 20 20 20 20 20 20 |sk ;. | 00002910 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 6d 73 | xfersend__ms| 00002920 67 20 3d 20 65 2d 3e 64 61 74 61 2e 6d 73 67 3b |g = e->data.msg;| 00002930 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002940 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 68 64 |xfersend__msg.hd| 00002950 72 2e 79 6f 75 72 5f 72 65 66 20 3d 20 78 66 65 |r.your_ref = xfe| 00002960 72 73 65 6e 64 5f 5f 6d 73 67 2e 68 64 72 2e 6d |rsend__msg.hdr.m| 00002970 79 5f 72 65 66 3b 0a 20 20 20 20 20 20 20 20 20 |y_ref;. | 00002980 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f | xfersend__| 00002990 6d 73 67 2e 68 64 72 2e 61 63 74 69 6f 6e 20 3d |msg.hdr.action =| 000029a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000029b0 20 20 20 72 65 73 20 3e 3d 20 30 20 3f 20 77 69 | res >= 0 ? wi| 000029c0 6d 70 5f 4d 44 41 54 41 4c 4f 41 44 20 3a 20 77 |mp_MDATALOAD : w| 000029d0 69 6d 70 5f 4d 57 69 6c 6c 50 72 69 6e 74 3b 0a |imp_MWillPrint;.| 000029e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 78 | x| 000029f0 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 74 |fersend__msg.dat| 00002a00 61 2e 70 72 69 6e 74 2e 74 79 70 65 20 3d 20 72 |a.print.type = r| 00002a10 65 73 20 3b 20 20 2f 2a 20 69 6e 20 63 61 73 65 |es ; /* in case| 00002a20 20 69 74 27 73 20 62 65 65 6e 20 73 61 76 65 64 | it's been saved| 00002a30 20 2a 2f 0a 20 20 20 20 20 20 20 20 20 20 20 20 | */. | 00002a40 20 20 20 77 69 6d 70 74 5f 6e 6f 65 72 72 28 77 | wimpt_noerr(w| 00002a50 69 6d 70 5f 73 65 6e 64 6d 65 73 73 61 67 65 28 |imp_sendmessage(| 00002a60 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002a70 20 20 20 77 69 6d 70 5f 45 53 45 4e 44 2c 0a 20 | wimp_ESEND,. | 00002a80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002a90 20 26 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2c | &xfersend__msg,| 00002aa0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002ab0 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 70 72 69 | xfersend__pri| 00002ac0 6e 74 65 72 29 29 3b 0a 20 20 20 20 20 20 20 20 |nter));. | 00002ad0 20 20 20 20 20 20 20 69 66 28 78 66 65 72 73 65 | if(xferse| 00002ae0 6e 64 5f 5f 63 6c 6f 73 65 20 26 26 20 72 65 73 |nd__close && res| 00002af0 29 20 78 66 65 72 73 65 6e 64 5f 5f 77 69 6e 63 |) xfersend__winc| 00002b00 6c 6f 73 65 28 29 3b 0a 20 20 20 20 20 20 20 20 |lose();. | 00002b10 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 54 52 | return TR| 00002b20 55 45 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 |UE;. | 00002b30 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 72 |}. br| 00002b40 65 61 6b 20 3b 0a 0a 20 20 20 20 20 20 20 20 20 |eak ;.. | 00002b50 20 63 61 73 65 20 77 69 6d 70 5f 4d 44 41 54 41 | case wimp_MDATA| 00002b60 53 41 56 45 4f 4b 3a 0a 20 20 20 20 20 20 20 20 |SAVEOK:. | 00002b70 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | {. | 00002b80 74 72 61 63 65 66 34 28 22 64 61 74 61 73 61 76 |tracef4("datasav| 00002b90 65 6f 6b 20 25 69 20 25 69 20 25 69 20 25 69 2e |eok %i %i %i %i.| 00002ba0 5c 6e 22 2c 0a 20 20 20 20 20 20 20 20 20 20 20 |\n",. | 00002bb0 20 20 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 | e->data.msg.h| 00002bc0 64 72 2e 73 69 7a 65 2c 0a 20 20 20 20 20 20 20 |dr.size,. | 00002bd0 20 20 20 20 20 20 20 65 2d 3e 64 61 74 61 2e 6d | e->data.m| 00002be0 73 67 2e 68 64 72 2e 74 61 73 6b 2c 0a 20 20 20 |sg.hdr.task,. | 00002bf0 20 20 20 20 20 20 20 20 20 20 20 65 2d 3e 64 61 | e->da| 00002c00 74 61 2e 6d 73 67 2e 68 64 72 2e 79 6f 75 72 5f |ta.msg.hdr.your_| 00002c10 72 65 66 2c 0a 20 20 20 20 20 20 20 20 20 20 20 |ref,. | 00002c20 20 20 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 | e->data.msg.h| 00002c30 64 72 2e 6d 79 5f 72 65 66 29 3b 0a 20 20 20 20 |dr.my_ref);. | 00002c40 20 20 20 20 20 20 20 20 74 72 61 63 65 66 34 28 | tracef4(| 00002c50 22 64 61 74 61 73 61 76 65 6f 6b 20 25 78 20 25 |"datasaveok %x %| 00002c60 78 20 25 78 20 25 78 2e 5c 6e 22 2c 0a 20 20 20 |x %x %x.\n",. | 00002c70 20 20 20 20 20 20 20 20 20 20 20 65 2d 3e 64 61 | e->da| 00002c80 74 61 2e 6d 73 67 2e 64 61 74 61 2e 77 6f 72 64 |ta.msg.data.word| 00002c90 73 5b 30 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 |s[0],. | 00002ca0 20 20 20 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e | e->data.msg.| 00002cb0 64 61 74 61 2e 77 6f 72 64 73 5b 31 5d 2c 0a 20 |data.words[1],. | 00002cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 65 2d 3e | e->| 00002cd0 64 61 74 61 2e 6d 73 67 2e 64 61 74 61 2e 77 6f |data.msg.data.wo| 00002ce0 72 64 73 5b 32 5d 2c 0a 20 20 20 20 20 20 20 20 |rds[2],. | 00002cf0 20 20 20 20 20 20 65 2d 3e 64 61 74 61 2e 6d 73 | e->data.ms| 00002d00 67 2e 64 61 74 61 2e 77 6f 72 64 73 5b 33 5d 29 |g.data.words[3])| 00002d10 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 72 |;. tr| 00002d20 61 63 65 66 31 28 22 69 74 27 73 20 74 68 65 20 |acef1("it's the | 00002d30 64 61 74 61 73 61 76 65 6f 6b 2c 20 74 6f 20 66 |datasaveok, to f| 00002d40 69 6c 65 20 27 25 73 27 2e 5c 6e 22 2c 0a 20 20 |ile '%s'.\n",. | 00002d50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002d60 20 20 20 28 69 6e 74 29 20 26 65 2d 3e 64 61 74 | (int) &e->dat| 00002d70 61 2e 6d 73 67 2e 64 61 74 61 2e 64 61 74 61 73 |a.msg.data.datas| 00002d80 61 76 65 6f 6b 2e 6e 61 6d 65 5b 30 5d 29 3b 0a |aveok.name[0]);.| 00002d90 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 69 6e |. win| 00002da0 5f 72 65 6d 6f 76 65 5f 75 6e 6b 6e 6f 77 6e 5f |_remove_unknown_| 00002db0 65 76 65 6e 74 5f 70 72 6f 63 65 73 73 6f 72 28 |event_processor(| 00002dc0 78 66 65 72 73 65 6e 64 5f 5f 75 6e 6b 6e 6f 77 |xfersend__unknow| 00002dd0 6e 73 2c 20 30 29 3b 0a 0a 20 20 20 20 20 20 20 |ns, 0);.. | 00002de0 20 20 20 20 20 74 72 61 63 65 66 31 28 22 73 61 | tracef1("sa| 00002df0 76 65 20 74 6f 20 66 69 6c 65 6e 61 6d 65 20 27 |ve to filename '| 00002e00 25 73 27 2e 5c 6e 22 2c 0a 20 20 20 20 20 20 20 |%s'.\n",. | 00002e10 20 20 20 20 20 20 20 20 20 20 20 20 20 28 69 6e | (in| 00002e20 74 29 20 26 65 2d 3e 64 61 74 61 2e 6d 73 67 2e |t) &e->data.msg.| 00002e30 64 61 74 61 2e 64 61 74 61 73 61 76 65 6f 6b 2e |data.datasaveok.| 00002e40 6e 61 6d 65 5b 30 5d 29 3b 0a 0a 20 20 20 20 20 |name[0]);.. | 00002e50 20 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f | xfersend_| 00002e60 5f 66 69 6c 65 69 73 73 61 66 65 20 3d 20 65 2d |_fileissafe = e-| 00002e70 3e 64 61 74 61 2e 6d 73 67 2e 64 61 74 61 2e 64 |>data.msg.data.d| 00002e80 61 74 61 73 61 76 65 6f 6b 2e 65 73 74 73 69 7a |atasaveok.estsiz| 00002e90 65 20 3e 3d 20 30 20 3b 0a 0a 20 20 20 20 20 20 |e >= 0 ;.. | 00002ea0 20 20 20 20 20 20 69 66 20 28 78 66 65 72 73 65 | if (xferse| 00002eb0 6e 64 5f 5f 73 61 76 65 70 72 6f 63 20 21 3d 20 |nd__saveproc != | 00002ec0 4e 55 4c 4c 20 26 26 0a 20 20 20 20 20 20 20 20 |NULL &&. | 00002ed0 20 20 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 | xfersend| 00002ee0 5f 5f 73 61 76 65 70 72 6f 63 28 26 65 2d 3e 64 |__saveproc(&e->d| 00002ef0 61 74 61 2e 6d 73 67 2e 64 61 74 61 2e 64 61 74 |ata.msg.data.dat| 00002f00 61 73 61 76 65 6f 6b 2e 6e 61 6d 65 5b 30 5d 2c |asaveok.name[0],| 00002f10 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002f30 20 20 78 66 65 72 73 65 6e 64 5f 5f 73 61 76 65 | xfersend__save| 00002f40 68 61 6e 64 6c 65 29 29 0a 20 20 20 20 20 20 20 |handle)). | 00002f50 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 | {. | 00002f60 20 20 20 20 20 20 74 72 61 63 65 66 30 28 22 74 | tracef0("t| 00002f70 68 65 20 73 61 76 65 20 73 75 63 63 65 65 64 65 |he save succeede| 00002f80 64 3a 20 73 65 6e 64 20 64 61 74 61 6c 6f 61 64 |d: send dataload| 00002f90 5c 6e 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 |\n");.. | 00002fa0 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f | xfersend__| 00002fb0 6d 73 67 20 3d 20 65 2d 3e 64 61 74 61 2e 6d 73 |msg = e->data.ms| 00002fc0 67 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |g;. | 00002fd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002fe0 20 20 20 20 20 20 20 20 20 2f 2a 20 73 65 74 73 | /* sets| 00002ff0 20 68 64 72 2e 73 69 7a 65 2c 20 64 61 74 61 2e | hdr.size, data.| 00003000 77 2c 69 2c 78 2c 79 2c 20 73 69 7a 65 2c 20 6e |w,i,x,y, size, n| 00003010 61 6d 65 20 2a 2f 0a 20 20 20 20 20 20 20 20 20 |ame */. | 00003020 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f | xfersend__| 00003030 6d 73 67 2e 68 64 72 2e 79 6f 75 72 5f 72 65 66 |msg.hdr.your_ref| 00003040 20 3d 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 | = e->data.msg.h| 00003050 64 72 2e 6d 79 5f 72 65 66 3b 0a 20 20 20 20 20 |dr.my_ref;. | 00003060 20 20 20 20 20 20 20 20 20 20 78 66 65 72 73 65 | xferse| 00003070 6e 64 5f 5f 6d 73 67 2e 68 64 72 2e 61 63 74 69 |nd__msg.hdr.acti| 00003080 6f 6e 20 3d 20 77 69 6d 70 5f 4d 44 41 54 41 4c |on = wimp_MDATAL| 00003090 4f 41 44 3b 0a 20 20 20 20 20 20 20 20 20 20 20 |OAD;. | 000030a0 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 6d 73 | xfersend__ms| 000030b0 67 2e 64 61 74 61 2e 64 61 74 61 6c 6f 61 64 2e |g.data.dataload.| 000030c0 74 79 70 65 20 3d 20 78 66 65 72 73 65 6e 64 5f |type = xfersend_| 000030d0 5f 66 69 6c 65 74 79 70 65 20 3b 0a 20 20 20 20 |_filetype ;. | 000030e0 20 20 20 20 20 20 20 20 20 20 20 77 69 6d 70 74 | wimpt| 000030f0 5f 6e 6f 65 72 72 28 77 69 6d 70 5f 73 65 6e 64 |_noerr(wimp_send| 00003100 6d 65 73 73 61 67 65 28 0a 20 20 20 20 20 20 20 |message(. | 00003110 20 20 20 20 20 20 20 20 20 20 77 69 6d 70 5f 45 | wimp_E| 00003120 53 45 4e 44 57 41 4e 54 41 43 4b 2c 0a 20 20 20 |SENDWANTACK,. | 00003130 20 20 20 20 20 20 20 20 20 20 20 20 20 20 26 78 | &x| 00003140 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2c 0a 20 20 |fersend__msg,. | 00003150 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 | e| 00003160 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 74 |->data.msg.hdr.t| 00003170 61 73 6b 29 29 3b 0a 20 20 20 20 20 20 20 20 20 |ask));. | 00003180 20 20 20 20 20 20 69 66 28 78 66 65 72 73 65 6e | if(xfersen| 00003190 64 5f 5f 63 6c 6f 73 65 29 20 78 66 65 72 73 65 |d__close) xferse| 000031a0 6e 64 5f 5f 77 69 6e 63 6c 6f 73 65 28 29 3b 0a |nd__winclose();.| 000031b0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 | }. | 000031c0 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 | else. | 000031d0 20 20 20 20 20 20 20 20 20 20 20 7b 0a 20 20 20 | {. | 000031e0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 68 | /* h| 000031f0 65 20 68 61 73 20 61 6c 72 65 61 64 79 20 72 65 |e has already re| 00003200 70 6f 72 74 65 64 20 74 68 65 20 65 72 72 6f 72 |ported the error| 00003210 3a 20 6e 6f 74 68 69 6e 67 20 6d 6f 72 65 20 74 |: nothing more t| 00003220 6f 20 64 6f 2e 20 2a 2f 0a 20 20 20 20 20 20 20 |o do. */. | 00003230 20 20 20 20 20 20 20 20 74 72 61 63 65 66 30 28 | tracef0(| 00003240 22 73 61 76 65 20 77 61 73 20 6e 6f 74 20 73 75 |"save was not su| 00003250 63 63 65 73 73 66 75 6c 2e 5c 6e 22 29 3b 0a 20 |ccessful.\n");. | 00003260 20 20 20 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 | }.. | 00003270 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | return| 00003280 20 28 78 66 65 72 73 65 6e 64 5f 5f 73 61 76 65 | (xfersend__save| 00003290 70 72 6f 63 20 3d 3d 20 4e 55 4c 4c 29 20 3f 20 |proc == NULL) ? | 000032a0 46 41 4c 53 45 20 3a 20 54 52 55 45 3b 0a 20 20 |FALSE : TRUE;. | 000032b0 20 20 20 20 20 20 20 20 7d 20 0a 20 20 20 20 20 | } . | 000032c0 20 20 7d 0a 20 20 20 20 20 20 72 65 74 75 72 6e | }. return| 000032d0 20 46 41 4c 53 45 20 3b 20 20 20 20 20 20 2f 2a | FALSE ; /*| 000032e0 20 75 6e 6b 6e 6f 77 6e 20 6e 6f 74 20 64 65 61 | unknown not dea| 000032f0 6c 74 20 77 69 74 68 20 2a 2f 0a 0a 20 20 20 20 |lt with */.. | 00003300 64 65 66 61 75 6c 74 3a 0a 20 20 20 20 20 20 72 |default:. r| 00003310 65 74 75 72 6e 20 46 41 4c 53 45 20 3b 0a 20 20 |eturn FALSE ;. | 00003320 20 7d 0a 7d 0a 0a 0a 73 74 61 74 69 63 20 69 6e | }.}...static in| 00003330 74 20 73 65 6e 64 62 75 66 5f 5f 73 74 61 74 65 |t sendbuf__state| 00003340 20 3b 0a 0a 0a 73 74 61 74 69 63 20 42 4f 4f 4c | ;...static BOOL| 00003350 20 73 65 6e 64 62 75 66 5f 5f 75 6e 6b 6e 6f 77 | sendbuf__unknow| 00003360 6e 73 28 77 69 6d 70 5f 65 76 65 6e 74 73 74 72 |ns(wimp_eventstr| 00003370 20 2a 65 2c 20 76 6f 69 64 20 2a 68 29 0a 7b 0a | *e, void *h).{.| 00003380 20 20 20 68 20 3d 20 68 20 3b 0a 0a 20 20 20 74 | h = h ;.. t| 00003390 72 61 63 65 66 34 28 22 73 65 6e 64 62 75 66 5f |racef4("sendbuf_| 000033a0 5f 75 6e 6b 6e 6f 77 6e 73 20 25 64 20 25 64 20 |_unknowns %d %d | 000033b0 25 64 20 25 64 5c 6e 22 2c 0a 20 20 20 20 20 20 |%d %d\n",. | 000033c0 20 20 20 20 20 20 65 2d 3e 64 61 74 61 2e 6d 73 | e->data.ms| 000033d0 67 2e 68 64 72 2e 6d 79 5f 72 65 66 2c 20 65 2d |g.hdr.my_ref, e-| 000033e0 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 79 6f |>data.msg.hdr.yo| 000033f0 75 72 5f 72 65 66 2c 0a 20 20 20 20 20 20 20 20 |ur_ref,. | 00003400 20 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 6d 73 | xfersend__ms| 00003410 67 2e 68 64 72 2e 79 6f 75 72 5f 72 65 66 2c 20 |g.hdr.your_ref, | 00003420 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 68 64 |xfersend__msg.hd| 00003430 72 2e 6d 79 5f 72 65 66 29 20 3b 0a 0a 20 20 20 |r.my_ref) ;.. | 00003440 69 66 20 28 28 65 2d 3e 65 20 3d 3d 20 77 69 6d |if ((e->e == wim| 00003450 70 5f 45 53 45 4e 44 57 41 4e 54 41 43 4b 20 7c |p_ESENDWANTACK || 00003460 7c 20 65 2d 3e 65 20 3d 3d 20 77 69 6d 70 5f 45 || e->e == wimp_E| 00003470 53 45 4e 44 29 20 26 26 0a 20 20 20 20 20 20 20 |SEND) &&. | 00003480 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e |e->data.msg.hdr.| 00003490 79 6f 75 72 5f 72 65 66 20 3d 3d 20 78 66 65 72 |your_ref == xfer| 000034a0 73 65 6e 64 5f 5f 6d 73 67 2e 68 64 72 2e 6d 79 |send__msg.hdr.my| 000034b0 5f 72 65 66 20 26 26 0a 20 20 20 20 20 20 20 65 |_ref &&. e| 000034c0 2d 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 61 |->data.msg.hdr.a| 000034d0 63 74 69 6f 6e 20 3d 3d 20 77 69 6d 70 5f 4d 52 |ction == wimp_MR| 000034e0 41 4d 46 45 54 43 48 29 0a 20 20 20 7b 0a 20 20 |AMFETCH). {. | 000034f0 20 20 20 20 2f 2a 20 50 72 65 70 61 72 65 20 78 | /* Prepare x| 00003500 66 65 72 73 65 6e 64 5f 5f 6d 73 67 20 61 73 20 |fersend__msg as | 00003510 74 68 65 20 6e 65 78 74 20 52 41 4d 54 52 41 4e |the next RAMTRAN| 00003520 53 4d 49 54 2e 20 4d 6f 73 74 20 6f 66 0a 20 20 |SMIT. Most of. | 00003530 20 20 20 20 74 68 65 20 66 69 65 6c 64 73 20 61 | the fields a| 00003540 72 65 20 61 6c 72 65 61 64 79 20 73 65 74 20 75 |re already set u| 00003550 70 2e 20 2a 2f 0a 0a 20 20 20 20 20 20 78 66 65 |p. */.. xfe| 00003560 72 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 74 61 2e |rsend__msg.data.| 00003570 72 61 6d 74 72 61 6e 73 6d 69 74 2e 61 64 64 72 |ramtransmit.addr| 00003580 20 3d 20 65 2d 3e 64 61 74 61 2e 6d 73 67 2e 64 | = e->data.msg.d| 00003590 61 74 61 2e 72 61 6d 66 65 74 63 68 2e 61 64 64 |ata.ramfetch.add| 000035a0 72 3b 0a 20 20 20 20 20 20 78 66 65 72 73 65 6e |r;. xfersen| 000035b0 64 5f 5f 6d 73 67 2e 64 61 74 61 2e 72 61 6d 74 |d__msg.data.ramt| 000035c0 72 61 6e 73 6d 69 74 2e 6e 62 79 74 65 73 77 72 |ransmit.nbyteswr| 000035d0 69 74 74 65 6e 20 3d 20 30 3b 0a 20 20 20 20 20 |itten = 0;. | 000035e0 20 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 68 | xfersend__msg.h| 000035f0 64 72 2e 79 6f 75 72 5f 72 65 66 20 3d 20 65 2d |dr.your_ref = e-| 00003600 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 6d 79 |>data.msg.hdr.my| 00003610 5f 72 65 66 20 3b 0a 20 20 20 20 20 20 72 63 76 |_ref ;. rcv| 00003620 62 75 66 73 69 7a 65 20 3d 20 65 2d 3e 64 61 74 |bufsize = e->dat| 00003630 61 2e 6d 73 67 2e 64 61 74 61 2e 72 61 6d 66 65 |a.msg.data.ramfe| 00003640 74 63 68 2e 6e 62 79 74 65 73 3b 0a 0a 20 20 20 |tch.nbytes;.. | 00003650 20 20 20 74 72 61 63 65 66 32 28 22 52 41 4d 46 | tracef2("RAMF| 00003660 45 54 43 48 20 72 65 63 65 69 76 65 64 3a 20 63 |ETCH received: c| 00003670 6f 6e 74 69 6e 75 65 20 77 69 74 68 20 62 75 66 |ontinue with buf| 00003680 66 65 72 20 61 74 20 25 78 2c 20 73 69 7a 65 20 |fer at %x, size | 00003690 25 64 5c 6e 22 2c 0a 20 20 20 20 20 20 20 20 20 |%d\n",. | 000036a0 20 20 20 20 20 20 28 69 6e 74 29 20 78 66 65 72 | (int) xfer| 000036b0 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 74 61 2e 72 |send__msg.data.r| 000036c0 61 6d 74 72 61 6e 73 6d 69 74 2e 61 64 64 72 2c |amtransmit.addr,| 000036d0 20 72 63 76 62 75 66 73 69 7a 65 29 20 3b 0a 0a | rcvbufsize) ;..| 000036e0 20 20 20 20 20 20 73 65 6e 64 62 75 66 5f 5f 73 | sendbuf__s| 000036f0 74 61 74 65 20 3d 20 31 20 3b 0a 20 20 20 20 20 |tate = 1 ;. | 00003700 20 72 65 74 75 72 6e 20 54 52 55 45 20 3b 20 20 | return TRUE ; | 00003710 20 20 20 20 2f 2a 20 57 65 27 76 65 20 68 61 64 | /* We've had| 00003720 20 61 6e 6f 74 68 65 72 20 52 41 4d 46 45 54 43 | another RAMFETC| 00003730 48 3a 20 6f 66 66 20 77 65 20 67 6f 20 61 67 61 |H: off we go aga| 00003740 69 6e 20 2a 2f 0a 20 20 20 7d 0a 0a 20 20 20 69 |in */. }.. i| 00003750 66 20 28 65 2d 3e 65 20 3d 3d 20 77 69 6d 70 5f |f (e->e == wimp_| 00003760 45 41 43 4b 20 26 26 0a 20 20 20 20 20 20 65 2d |EACK &&. e-| 00003770 3e 64 61 74 61 2e 6d 73 67 2e 68 64 72 2e 6d 79 |>data.msg.hdr.my| 00003780 5f 72 65 66 20 3d 3d 20 78 66 65 72 73 65 6e 64 |_ref == xfersend| 00003790 5f 5f 6d 73 67 2e 68 64 72 2e 6d 79 5f 72 65 66 |__msg.hdr.my_ref| 000037a0 29 0a 20 20 20 7b 0a 20 20 20 20 20 20 73 65 6e |). {. sen| 000037b0 64 62 75 66 5f 5f 73 74 61 74 65 20 3d 20 32 20 |dbuf__state = 2 | 000037c0 3b 0a 20 20 20 20 20 20 74 72 61 63 65 66 30 28 |;. tracef0(| 000037d0 22 78 66 65 72 73 65 6e 64 20 52 41 4d 54 52 41 |"xfersend RAMTRA| 000037e0 4e 53 4d 49 54 20 62 6f 75 6e 63 65 64 3b 20 73 |NSMIT bounced; s| 000037f0 65 74 20 66 61 69 6c 65 64 20 73 74 61 74 65 5c |et failed state\| 00003800 6e 22 29 20 3b 0a 20 20 20 20 20 20 72 65 74 75 |n") ;. retu| 00003810 72 6e 20 54 52 55 45 20 3b 2f 2a 20 6f 75 72 20 |rn TRUE ;/* our | 00003820 6d 65 73 73 61 67 65 20 62 6f 75 6e 63 65 64 20 |message bounced | 00003830 62 61 63 6b 3b 20 67 69 76 65 20 75 70 20 2a 2f |back; give up */| 00003840 0a 20 20 20 7d 0a 0a 20 20 20 72 65 74 75 72 6e |. }.. return| 00003850 20 46 41 4c 53 45 20 3b 20 20 20 20 2f 2a 20 77 | FALSE ; /* w| 00003860 65 20 64 6f 6e 27 74 20 77 61 6e 74 20 69 74 20 |e don't want it | 00003870 2a 2f 0a 7d 0a 0a 0a 42 4f 4f 4c 20 78 66 65 72 |*/.}...BOOL xfer| 00003880 73 65 6e 64 5f 73 65 6e 64 62 75 66 28 63 68 61 |send_sendbuf(cha| 00003890 72 20 2a 62 75 66 66 65 72 2c 20 69 6e 74 20 73 |r *buffer, int s| 000038a0 69 7a 65 29 0a 7b 0a 0a 20 20 20 2f 2a 20 43 61 |ize).{.. /* Ca| 000038b0 6c 6c 65 64 20 62 79 20 68 69 73 20 73 65 6e 64 |lled by his send| 000038c0 70 72 6f 63 20 77 68 65 6e 20 73 65 6e 64 69 6e |proc when sendin| 000038d0 67 20 74 68 69 6e 67 73 20 69 6e 20 6d 65 6d 6f |g things in memo| 000038e0 72 79 2e 20 54 68 65 0a 20 20 20 72 65 70 6c 79 |ry. The. reply| 000038f0 20 72 65 63 6f 72 64 20 69 73 20 69 6e 20 78 66 | record is in xf| 00003900 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 20 2a 2f 0a |ersend__msg. */.| 00003910 0a 20 20 20 74 72 61 63 65 66 32 28 22 78 66 65 |. tracef2("xfe| 00003920 72 73 65 6e 64 5f 73 65 6e 64 62 75 66 20 25 69 |rsend_sendbuf %i| 00003930 20 25 69 5c 6e 22 2c 20 28 69 6e 74 29 20 62 75 | %i\n", (int) bu| 00003940 66 66 65 72 2c 20 73 69 7a 65 29 3b 0a 0a 20 20 |ffer, size);.. | 00003950 20 2f 2a 20 4d 61 6b 65 20 74 68 65 20 64 61 74 | /* Make the dat| 00003960 61 20 74 72 61 6e 73 66 65 72 20 2a 2f 0a 20 20 |a transfer */. | 00003970 20 74 72 61 63 65 66 33 28 22 74 72 61 6e 73 66 | tracef3("transf| 00003980 65 72 20 62 6c 6f 63 6b 20 6f 66 20 25 64 20 66 |er block of %d f| 00003990 72 6f 6d 20 25 78 20 74 6f 20 25 78 5c 6e 22 2c |rom %x to %x\n",| 000039a0 20 73 69 7a 65 2c 20 28 69 6e 74 29 20 62 75 66 | size, (int) buf| 000039b0 66 65 72 2c 0a 20 20 20 20 20 20 20 20 20 20 20 |fer,. | 000039c0 20 20 28 69 6e 74 29 20 28 78 66 65 72 73 65 6e | (int) (xfersen| 000039d0 64 5f 5f 6d 73 67 2e 64 61 74 61 2e 72 61 6d 74 |d__msg.data.ramt| 000039e0 72 61 6e 73 6d 69 74 2e 61 64 64 72 20 2b 0a 20 |ransmit.addr +. | 000039f0 20 20 20 20 20 20 20 20 20 20 20 20 20 78 66 65 | xfe| 00003a00 72 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 74 61 2e |rsend__msg.data.| 00003a10 72 61 6d 74 72 61 6e 73 6d 69 74 2e 6e 62 79 74 |ramtransmit.nbyt| 00003a20 65 73 77 72 69 74 74 65 6e 29 29 20 3b 0a 0a 20 |eswritten)) ;.. | 00003a30 20 20 77 69 6d 70 74 5f 6e 6f 65 72 72 28 77 69 | wimpt_noerr(wi| 00003a40 6d 70 5f 74 72 61 6e 73 66 65 72 62 6c 6f 63 6b |mp_transferblock| 00003a50 28 0a 20 20 20 20 20 20 20 20 77 69 6d 70 74 5f |(. wimpt_| 00003a60 74 61 73 6b 28 29 2c 0a 20 20 20 20 20 20 20 20 |task(),. | 00003a70 62 75 66 66 65 72 2c 0a 20 20 20 20 20 20 20 20 |buffer,. | 00003a80 78 66 65 72 73 65 6e 64 5f 5f 72 65 63 65 69 76 |xfersend__receiv| 00003a90 65 72 2c 0a 20 20 20 20 20 20 20 20 78 66 65 72 |er,. xfer| 00003aa0 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 74 61 2e 72 |send__msg.data.r| 00003ab0 61 6d 74 72 61 6e 73 6d 69 74 2e 61 64 64 72 20 |amtransmit.addr | 00003ac0 2b 0a 20 20 20 20 20 20 20 20 20 20 78 66 65 72 |+. xfer| 00003ad0 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 74 61 2e 72 |send__msg.data.r| 00003ae0 61 6d 74 72 61 6e 73 6d 69 74 2e 6e 62 79 74 65 |amtransmit.nbyte| 00003af0 73 77 72 69 74 74 65 6e 2c 0a 20 20 20 20 20 20 |swritten,. | 00003b00 20 20 73 69 7a 65 29 29 3b 0a 0a 20 20 20 2f 2a | size));.. /*| 00003b10 20 72 65 63 6f 72 64 20 62 79 74 65 73 20 74 6f | record bytes to| 00003b20 20 62 65 20 73 65 6e 74 20 74 6f 20 74 68 65 20 | be sent to the | 00003b30 6f 74 68 65 72 20 65 6e 64 20 2a 2f 0a 20 20 20 |other end */. | 00003b40 78 66 65 72 73 65 6e 64 5f 5f 6d 73 67 2e 64 61 |xfersend__msg.da| 00003b50 74 61 2e 72 61 6d 74 72 61 6e 73 6d 69 74 2e 6e |ta.ramtransmit.n| 00003b60 62 79 74 65 73 77 72 69 74 74 65 6e 20 2b 3d 20 |byteswritten += | 00003b70 73 69 7a 65 3b 0a 20 20 20 72 63 76 62 75 66 73 |size;. rcvbufs| 00003b80 69 7a 65 20 2d 3d 20 73 69 7a 65 20 3b 0a 0a 20 |ize -= size ;.. | 00003b90 20 20 2f 2a 20 69 66 20 73 69 7a 65 20 21 3d 20 | /* if size != | 00003ba0 30 2c 20 74 68 65 72 65 20 61 72 65 20 73 74 69 |0, there are sti| 00003bb0 6c 6c 20 62 79 74 65 73 20 74 6f 20 73 65 6e 64 |ll bytes to send| 00003bc0 2e 20 2a 2f 0a 0a 20 20 20 20 69 66 20 28 72 63 |. */.. if (rc| 00003bd0 76 62 75 66 73 69 7a 65 20 3e 20 30 29 20 72 65 |vbufsize > 0) re| 00003be0 74 75 72 6e 20 54 52 55 45 3b 0a 0a 20 20 20 74 |turn TRUE;.. t| 00003bf0 72 61 63 65 66 31 28 22 78 66 65 72 73 65 6e 64 |racef1("xfersend| 00003c00 20 6d 65 73 73 61 67 65 20 68 61 73 20 70 75 74 | message has put| 00003c10 20 25 64 20 69 6e 74 6f 20 62 75 66 66 65 72 5c | %d into buffer\| 00003c20 6e 22 2c 73 69 7a 65 29 20 3b 0a 20 20 20 2f 2a |n",size) ;. /*| 00003c30 20 54 65 6c 6c 20 68 69 6d 20 74 68 61 74 20 79 | Tell him that y| 00003c40 6f 75 27 76 65 20 64 6f 6e 65 20 69 74 20 2a 2f |ou've done it */| 00003c50 0a 20 20 20 77 69 6d 70 74 5f 6e 6f 65 72 72 28 |. wimpt_noerr(| 00003c60 77 69 6d 70 5f 73 65 6e 64 6d 65 73 73 61 67 65 |wimp_sendmessage| 00003c70 28 0a 20 20 20 20 20 20 20 20 77 69 6d 70 5f 45 |(. wimp_E| 00003c80 53 45 4e 44 57 41 4e 54 41 43 4b 2c 0a 20 20 20 |SENDWANTACK,. | 00003c90 20 20 20 20 20 26 78 66 65 72 73 65 6e 64 5f 5f | &xfersend__| 00003ca0 6d 73 67 2c 0a 20 20 20 20 20 20 20 20 78 66 65 |msg,. xfe| 00003cb0 72 73 65 6e 64 5f 5f 72 65 63 65 69 76 65 72 29 |rsend__receiver)| 00003cc0 29 3b 0a 0a 20 20 20 20 2f 2a 20 47 65 74 20 68 |);.. /* Get h| 00003cd0 69 73 20 72 65 70 6c 79 2e 20 50 6f 6c 6c 20 61 |is reply. Poll a| 00003ce0 6e 64 20 64 65 73 70 61 74 63 68 20 65 76 65 6e |nd despatch even| 00003cf0 74 73 20 75 6e 74 69 6c 20 67 65 74 20 6e 61 63 |ts until get nac| 00003d00 6b 20 6f 72 20 6d 65 73 73 61 67 65 20 2a 2f 0a |k or message */.| 00003d10 0a 20 20 20 73 65 6e 64 62 75 66 5f 5f 73 74 61 |. sendbuf__sta| 00003d20 74 65 20 3d 20 30 20 3b 0a 0a 20 20 20 77 69 6e |te = 0 ;.. win| 00003d30 5f 61 64 64 5f 75 6e 6b 6e 6f 77 6e 5f 65 76 65 |_add_unknown_eve| 00003d40 6e 74 5f 70 72 6f 63 65 73 73 6f 72 28 73 65 6e |nt_processor(sen| 00003d50 64 62 75 66 5f 5f 75 6e 6b 6e 6f 77 6e 73 2c 20 |dbuf__unknowns, | 00003d60 30 29 20 3b 0a 20 20 20 64 6f 20 7b 20 65 76 65 |0) ;. do { eve| 00003d70 6e 74 5f 70 72 6f 63 65 73 73 28 29 20 3b 20 7d |nt_process() ; }| 00003d80 20 77 68 69 6c 65 20 28 73 65 6e 64 62 75 66 5f | while (sendbuf_| 00003d90 5f 73 74 61 74 65 20 3d 3d 20 30 29 20 3b 0a 20 |_state == 0) ;. | 00003da0 20 20 77 69 6e 5f 72 65 6d 6f 76 65 5f 75 6e 6b | win_remove_unk| 00003db0 6e 6f 77 6e 5f 65 76 65 6e 74 5f 70 72 6f 63 65 |nown_event_proce| 00003dc0 73 73 6f 72 28 73 65 6e 64 62 75 66 5f 5f 75 6e |ssor(sendbuf__un| 00003dd0 6b 6e 6f 77 6e 73 2c 20 30 29 20 3b 0a 0a 20 20 |knowns, 0) ;.. | 00003de0 20 20 2f 2a 20 54 68 69 73 20 65 78 69 74 20 68 | /* This exit h| 00003df0 61 70 70 65 6e 73 20 69 6e 20 74 68 65 20 63 61 |appens in the ca| 00003e00 73 65 73 20 77 68 65 72 65 20 74 68 65 20 62 75 |ses where the bu| 00003e10 66 66 65 72 73 20 61 74 20 65 61 63 68 20 65 6e |ffers at each en| 00003e20 64 0a 20 20 20 20 20 20 20 20 61 72 65 20 6f 66 |d. are of| 00003e30 20 69 64 65 6e 74 69 63 61 6c 20 73 69 7a 65 2e | identical size.| 00003e40 20 53 6f 2c 20 72 65 74 75 72 6e 20 66 6f 72 20 | So, return for | 00003e50 61 6e 6f 74 68 65 72 20 63 61 6c 6c 20 74 6f 20 |another call to | 00003e60 73 65 6e 64 62 75 66 2c 20 6f 72 0a 20 20 20 20 |sendbuf, or. | 00003e70 20 20 20 20 73 6f 20 74 68 61 74 20 74 68 65 20 | so that the | 00003e80 73 65 6e 64 62 75 66 20 70 72 6f 63 65 64 75 72 |sendbuf procedur| 00003e90 65 20 63 61 6e 20 72 65 74 75 72 6e 2e 20 2a 2f |e can return. */| 00003ea0 0a 0a 20 20 20 72 65 74 75 72 6e 20 73 65 6e 64 |.. return send| 00003eb0 62 75 66 5f 5f 73 74 61 74 65 20 21 3d 20 32 20 |buf__state != 2 | 00003ec0 3b 20 20 2f 2a 20 4f 4b 20 75 6e 6c 65 73 73 20 |; /* OK unless | 00003ed0 73 74 61 74 65 20 3d 20 62 72 6f 6b 65 6e 20 2a |state = broken *| 00003ee0 2f 0a 7d 0a 0a 0a 0a 42 4f 4f 4c 20 78 66 65 72 |/.}....BOOL xfer| 00003ef0 73 65 6e 64 20 28 69 6e 74 20 66 69 6c 65 74 79 |send (int filety| 00003f00 70 65 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 |pe,. | 00003f10 20 20 20 63 68 61 72 20 2a 66 69 6c 65 6e 61 6d | char *filenam| 00003f20 65 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |e,. | 00003f30 20 20 69 6e 74 20 65 73 74 73 69 7a 65 2c 0a 20 | int estsize,. | 00003f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 78 66 | xf| 00003f50 65 72 73 65 6e 64 5f 73 61 76 65 70 72 6f 63 20 |ersend_saveproc | 00003f60 73 61 76 65 72 2c 0a 20 20 20 20 20 20 20 20 20 |saver,. | 00003f70 20 20 20 20 20 20 78 66 65 72 73 65 6e 64 5f 73 | xfersend_s| 00003f80 65 6e 64 70 72 6f 63 20 73 65 6e 64 65 72 2c 0a |endproc sender,.| 00003f90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 78 | x| 00003fa0 66 65 72 73 65 6e 64 5f 70 72 69 6e 74 70 72 6f |fersend_printpro| 00003fb0 63 20 70 72 69 6e 74 65 72 2c 0a 20 20 20 20 20 |c printer,. | 00003fc0 20 20 20 20 20 20 20 20 20 20 77 69 6d 70 5f 65 | wimp_e| 00003fd0 76 65 6e 74 73 74 72 20 2a 65 2c 0a 20 20 20 20 |ventstr *e,. | 00003fe0 20 20 20 20 20 20 20 20 20 20 20 76 6f 69 64 20 | void | 00003ff0 2a 68 61 6e 64 6c 65 29 0a 7b 20 20 0a 20 20 20 |*handle).{ . | 00004000 77 69 6d 70 5f 64 72 61 67 73 74 72 20 64 72 3b |wimp_dragstr dr;| 00004010 0a 20 20 20 77 69 6d 70 5f 77 73 74 61 74 65 20 |. wimp_wstate | 00004020 77 73 74 61 74 65 3b 0a 20 20 20 77 69 6d 70 5f |wstate;. wimp_| 00004030 69 63 6f 6e 20 69 63 6f 6e 3b 0a 20 20 20 77 69 |icon icon;. wi| 00004040 6d 70 5f 77 20 77 20 3d 20 65 2d 3e 64 61 74 61 |mp_w w = e->data| 00004050 2e 62 75 74 2e 6d 2e 77 3b 0a 20 20 20 77 69 6d |.but.m.w;. wim| 00004060 70 5f 6d 6f 75 73 65 73 74 72 20 6d 6f 75 73 65 |p_mousestr mouse| 00004070 5f 73 74 72 3b 0a 20 20 20 69 6e 74 0a 20 20 20 |_str;. int. | 00004080 20 20 20 78 5f 6c 69 6d 69 74 20 3d 20 62 62 63 | x_limit = bbc| 00004090 5f 76 64 75 76 61 72 20 28 62 62 63 5f 58 57 69 |_vduvar (bbc_XWi| 000040a0 6e 64 4c 69 6d 69 74 29 20 3c 3c 20 62 62 63 5f |ndLimit) << bbc_| 000040b0 76 64 75 76 61 72 20 28 62 62 63 5f 58 45 69 67 |vduvar (bbc_XEig| 000040c0 46 61 63 74 6f 72 29 2c 0a 20 20 20 20 20 20 79 |Factor),. y| 000040d0 5f 6c 69 6d 69 74 20 3d 20 62 62 63 5f 76 64 75 |_limit = bbc_vdu| 000040e0 76 61 72 20 28 62 62 63 5f 59 57 69 6e 64 4c 69 |var (bbc_YWindLi| 000040f0 6d 69 74 29 20 3c 3c 20 62 62 63 5f 76 64 75 76 |mit) << bbc_vduv| 00004100 61 72 20 28 62 62 63 5f 59 45 69 67 46 61 63 74 |ar (bbc_YEigFact| 00004110 6f 72 29 2c 0a 20 20 20 20 20 20 73 63 72 65 65 |or),. scree| 00004120 6e 5f 78 30 2c 20 73 63 72 65 65 6e 5f 79 30 2c |n_x0, screen_y0,| 00004130 0a 20 20 20 20 20 20 6d 6f 75 73 65 5f 78 2c 20 |. mouse_x, | 00004140 6d 6f 75 73 65 5f 79 3b 0a 20 20 20 63 68 61 72 |mouse_y;. char| 00004150 20 2a 6e 61 6d 65 3b 0a 20 20 20 73 70 72 69 74 | *name;. sprit| 00004160 65 5f 61 72 65 61 20 2a 61 72 65 61 3b 0a 0a 20 |e_area *area;.. | 00004170 20 20 78 66 65 72 73 65 6e 64 5f 5f 73 61 76 65 | xfersend__save| 00004180 70 72 6f 63 20 3d 20 73 61 76 65 72 3b 0a 20 20 |proc = saver;. | 00004190 20 78 66 65 72 73 65 6e 64 5f 5f 73 65 6e 64 70 | xfersend__sendp| 000041a0 72 6f 63 20 3d 20 73 65 6e 64 65 72 3b 0a 20 20 |roc = sender;. | 000041b0 20 78 66 65 72 73 65 6e 64 5f 5f 70 72 69 6e 74 | xfersend__print| 000041c0 70 72 6f 63 20 3d 20 70 72 69 6e 74 65 72 3b 0a |proc = printer;.| 000041d0 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 66 69 6c | xfersend__fil| 000041e0 65 74 79 70 65 20 3d 20 66 69 6c 65 74 79 70 65 |etype = filetype| 000041f0 3b 0a 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 65 |;. xfersend__e| 00004200 73 74 73 69 7a 65 20 3d 20 65 73 74 73 69 7a 65 |stsize = estsize| 00004210 3b 0a 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 73 |;. xfersend__s| 00004220 61 76 65 68 61 6e 64 6c 65 20 3d 20 68 61 6e 64 |avehandle = hand| 00004230 6c 65 3b 0a 20 20 20 69 66 20 28 78 66 65 72 73 |le;. if (xfers| 00004240 65 6e 64 5f 5f 66 69 6c 65 6e 61 6d 65 20 3d 3d |end__filename ==| 00004250 20 30 29 20 78 66 65 72 73 65 6e 64 5f 5f 66 69 | 0) xfersend__fi| 00004260 6c 65 6e 61 6d 65 20 3d 20 6d 61 6c 6c 6f 63 28 |lename = malloc(| 00004270 32 35 36 29 3b 0a 20 20 20 69 66 28 66 69 6c 65 |256);. if(file| 00004280 6e 61 6d 65 20 3d 3d 20 30 29 0a 20 20 20 20 20 |name == 0). | 00004290 20 73 74 72 63 70 79 28 78 66 65 72 73 65 6e 64 | strcpy(xfersend| 000042a0 5f 5f 66 69 6c 65 6e 61 6d 65 2c 20 6d 73 67 73 |__filename, msgs| 000042b0 5f 6c 6f 6f 6b 75 70 28 22 78 66 65 72 73 65 6e |_lookup("xfersen| 000042c0 64 32 3a 53 65 6c 65 63 74 69 6f 6e 22 29 29 3b |d2:Selection"));| 000042d0 0a 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 73 |. else. s| 000042e0 74 72 6e 63 70 79 28 78 66 65 72 73 65 6e 64 5f |trncpy(xfersend_| 000042f0 5f 66 69 6c 65 6e 61 6d 65 2c 66 69 6c 65 6e 61 |_filename,filena| 00004300 6d 65 2c 32 35 36 29 3b 0a 20 20 20 74 72 61 63 |me,256);. trac| 00004310 65 66 30 28 22 49 6e 69 74 69 61 74 65 20 61 20 |ef0("Initiate a | 00004320 64 72 61 67 2e 5c 6e 22 29 3b 0a 0a 20 20 20 2f |drag.\n");.. /| 00004330 2a 46 69 6e 64 20 73 63 72 65 65 6e 20 6f 72 69 |*Find screen ori| 00004340 67 69 6e 2a 2f 0a 20 20 20 77 69 6d 70 5f 67 65 |gin*/. wimp_ge| 00004350 74 5f 77 69 6e 64 5f 73 74 61 74 65 20 28 77 2c |t_wind_state (w,| 00004360 20 26 77 73 74 61 74 65 29 3b 0a 20 20 20 73 63 | &wstate);. sc| 00004370 72 65 65 6e 5f 78 30 20 3d 20 77 73 74 61 74 65 |reen_x0 = wstate| 00004380 2e 6f 2e 62 6f 78 2e 78 30 20 2d 20 77 73 74 61 |.o.box.x0 - wsta| 00004390 74 65 2e 6f 2e 78 3b 0a 20 20 20 73 63 72 65 65 |te.o.x;. scree| 000043a0 6e 5f 79 30 20 3d 20 77 73 74 61 74 65 2e 6f 2e |n_y0 = wstate.o.| 000043b0 62 6f 78 2e 79 31 20 2d 20 77 73 74 61 74 65 2e |box.y1 - wstate.| 000043c0 6f 2e 79 3b 0a 0a 20 20 20 2f 2a 47 65 74 20 69 |o.y;.. /*Get i| 000043d0 6e 69 74 69 61 6c 20 69 63 6f 6e 20 70 6f 73 69 |nitial icon posi| 000043e0 74 69 6f 6e 2a 2f 0a 20 20 20 77 69 6d 70 5f 67 |tion*/. wimp_g| 000043f0 65 74 5f 69 63 6f 6e 5f 69 6e 66 6f 20 28 77 2c |et_icon_info (w,| 00004400 20 65 2d 3e 64 61 74 61 2e 62 75 74 2e 6d 2e 69 | e->data.but.m.i| 00004410 2c 20 26 69 63 6f 6e 29 3b 0a 20 20 20 69 63 6f |, &icon);. ico| 00004420 6e 2e 62 6f 78 2e 78 30 2b 3d 73 63 72 65 65 6e |n.box.x0+=screen| 00004430 5f 78 30 3b 0a 20 20 20 69 63 6f 6e 2e 62 6f 78 |_x0;. icon.box| 00004440 2e 79 30 2b 3d 73 63 72 65 65 6e 5f 79 30 3b 0a |.y0+=screen_y0;.| 00004450 20 20 20 69 63 6f 6e 2e 62 6f 78 2e 78 31 2b 3d | icon.box.x1+=| 00004460 73 63 72 65 65 6e 5f 78 30 3b 0a 20 20 20 69 63 |screen_x0;. ic| 00004470 6f 6e 2e 62 6f 78 2e 79 31 2b 3d 73 63 72 65 65 |on.box.y1+=scree| 00004480 6e 5f 79 30 3b 0a 0a 20 20 20 69 66 20 28 78 66 |n_y0;.. if (xf| 00004490 65 72 73 65 6e 64 5f 5f 75 73 69 6e 67 5f 64 72 |ersend__using_dr| 000044a0 61 67 61 73 70 72 69 74 65 28 29 20 26 26 20 75 |agasprite() && u| 000044b0 73 69 6e 67 5f 6f 73 33 28 29 29 20 7b 0a 20 20 |sing_os3()) {. | 000044c0 20 20 20 78 66 65 72 73 65 6e 64 5f 5f 75 73 65 | xfersend__use| 000044d0 64 5f 64 72 61 67 61 73 70 72 69 74 65 3d 54 52 |d_dragasprite=TR| 000044e0 55 45 3b 0a 0a 20 20 20 20 20 69 66 20 28 20 28 |UE;.. if ( (| 000044f0 69 63 6f 6e 2e 66 6c 61 67 73 20 26 20 28 77 69 |icon.flags & (wi| 00004500 6d 70 5f 49 4e 44 49 52 45 43 54 7c 77 69 6d 70 |mp_INDIRECT|wimp| 00004510 5f 49 53 50 52 49 54 45 29 29 20 21 3d 20 28 77 |_ISPRITE)) != (w| 00004520 69 6d 70 5f 49 4e 44 49 52 45 43 54 7c 77 69 6d |imp_INDIRECT|wim| 00004530 70 5f 49 53 50 52 49 54 45 29 29 20 7b 0a 20 20 |p_ISPRITE)) {. | 00004540 20 20 20 20 20 6e 61 6d 65 3d 22 66 69 6c 65 5f | name="file_| 00004550 78 78 78 22 3b 0a 20 20 20 20 20 20 20 61 72 65 |xxx";. are| 00004560 61 3d 28 73 70 72 69 74 65 5f 61 72 65 61 20 2a |a=(sprite_area *| 00004570 29 31 3b 0a 20 20 20 20 20 7d 0a 20 20 20 20 20 |)1;. }. | 00004580 65 6c 73 65 0a 20 20 20 20 20 20 20 69 66 20 28 |else. if (| 00004590 20 21 28 69 63 6f 6e 2e 66 6c 61 67 73 26 77 69 | !(icon.flags&wi| 000045a0 6d 70 5f 49 54 45 58 54 29 20 26 26 20 21 69 63 |mp_ITEXT) && !ic| 000045b0 6f 6e 2e 64 61 74 61 2e 69 6e 64 69 72 65 63 74 |on.data.indirect| 000045c0 73 70 72 69 74 65 2e 6e 61 6d 65 69 73 6e 61 6d |sprite.nameisnam| 000045d0 65 20 29 20 7b 0a 20 20 20 20 20 20 20 20 20 6e |e ) {. n| 000045e0 61 6d 65 3d 22 66 69 6c 65 5f 78 78 78 22 3b 0a |ame="file_xxx";.| 000045f0 20 20 20 20 20 20 20 20 20 61 72 65 61 3d 28 73 | area=(s| 00004600 70 72 69 74 65 5f 61 72 65 61 20 2a 29 31 3b 0a |prite_area *)1;.| 00004610 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | }. | 00004620 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 |else {. | 00004630 69 66 20 28 69 63 6f 6e 2e 66 6c 61 67 73 20 26 |if (icon.flags &| 00004640 20 77 69 6d 70 5f 49 54 45 58 54 29 20 7b 0a 20 | wimp_ITEXT) {. | 00004650 20 20 20 20 20 20 20 20 20 20 61 72 65 61 3d 28 | area=(| 00004660 73 70 72 69 74 65 5f 61 72 65 61 20 2a 29 31 3b |sprite_area *)1;| 00004670 0a 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 |. name| 00004680 3d 69 63 6f 6e 2e 64 61 74 61 2e 69 6e 64 69 72 |=icon.data.indir| 00004690 65 63 74 74 65 78 74 2e 76 61 6c 69 64 73 74 72 |ecttext.validstr| 000046a0 69 6e 67 3b 0a 20 20 20 20 20 20 20 20 20 20 20 |ing;. | 000046b0 69 66 20 28 2a 6e 61 6d 65 3d 3d 27 73 27 29 20 |if (*name=='s') | 000046c0 6e 61 6d 65 2b 2b 3b 0a 20 20 20 20 20 20 20 20 |name++;. | 000046d0 20 20 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 | else {. | 000046e0 20 20 20 20 20 20 20 6e 61 6d 65 3d 73 74 72 73 | name=strs| 000046f0 74 72 28 6e 61 6d 65 2c 20 22 3b 73 22 29 3b 0a |tr(name, ";s");.| 00004700 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d | nam| 00004710 65 20 3d 20 28 6e 61 6d 65 3d 3d 30 29 20 3f 20 |e = (name==0) ? | 00004720 22 66 69 6c 65 5f 78 78 78 22 20 3a 20 6e 61 6d |"file_xxx" : nam| 00004730 65 2b 32 20 3b 0a 20 20 20 20 20 20 20 20 20 20 |e+2 ;. | 00004740 20 7d 0a 20 20 20 20 20 20 20 20 20 7d 0a 20 20 | }. }. | 00004750 20 20 20 20 20 20 20 65 6c 73 65 20 7b 0a 20 20 | else {. | 00004760 20 20 20 20 20 20 20 20 20 6e 61 6d 65 3d 69 63 | name=ic| 00004770 6f 6e 2e 64 61 74 61 2e 69 6e 64 69 72 65 63 74 |on.data.indirect| 00004780 73 70 72 69 74 65 2e 6e 61 6d 65 3b 0a 20 20 20 |sprite.name;. | 00004790 20 20 20 20 20 20 20 20 61 72 65 61 3d 69 63 6f | area=ico| 000047a0 6e 2e 64 61 74 61 2e 69 6e 64 69 72 65 63 74 73 |n.data.indirects| 000047b0 70 72 69 74 65 2e 73 70 72 69 74 65 61 72 65 61 |prite.spritearea| 000047c0 3b 0a 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 |;. }. | 000047d0 20 20 20 20 7d 0a 0a 20 20 20 20 20 77 69 6d 70 | }.. wimp| 000047e0 74 5f 63 6f 6d 70 6c 61 69 6e 28 64 72 61 67 61 |t_complain(draga| 000047f0 73 70 72 69 74 65 5f 73 74 61 72 74 28 30 78 63 |sprite_start(0xc| 00004800 35 2c 20 61 72 65 61 2c 20 6e 61 6d 65 2c 20 26 |5, area, name, &| 00004810 69 63 6f 6e 2e 62 6f 78 29 29 3b 0a 20 20 20 7d |icon.box));. }| 00004820 0a 20 20 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 |. else {. | 00004830 78 66 65 72 73 65 6e 64 5f 5f 75 73 65 64 5f 64 |xfersend__used_d| 00004840 72 61 67 61 73 70 72 69 74 65 3d 46 41 4c 53 45 |ragasprite=FALSE| 00004850 3b 0a 20 20 20 20 20 2f 2a 47 65 74 20 70 6f 69 |;. /*Get poi| 00004860 6e 74 65 72 20 70 6f 73 69 74 69 6f 6e 20 74 6f |nter position to| 00004870 20 61 6c 6c 6f 77 20 69 63 6f 6e 20 74 6f 20 62 | allow icon to b| 00004880 65 20 64 72 61 67 67 65 64 0a 20 20 20 20 20 20 |e dragged. | 00004890 20 20 70 61 72 74 69 61 6c 6c 79 20 6f 66 66 2d | partially off-| 000048a0 73 63 72 65 65 6e 20 2a 2f 0a 20 20 20 20 20 77 |screen */. w| 000048b0 69 6d 70 5f 67 65 74 5f 70 6f 69 6e 74 5f 69 6e |imp_get_point_in| 000048c0 66 6f 20 28 26 6d 6f 75 73 65 5f 73 74 72 29 3b |fo (&mouse_str);| 000048d0 0a 20 20 20 20 20 6d 6f 75 73 65 5f 78 20 3d 20 |. mouse_x = | 000048e0 6d 6f 75 73 65 5f 73 74 72 2e 78 3b 0a 20 20 20 |mouse_str.x;. | 000048f0 20 20 6d 6f 75 73 65 5f 79 20 3d 20 6d 6f 75 73 | mouse_y = mous| 00004900 65 5f 73 74 72 2e 79 3b 0a 0a 20 20 20 20 20 2f |e_str.y;.. /| 00004910 2a 53 65 74 20 75 70 20 64 72 61 67 2a 2f 0a 20 |*Set up drag*/. | 00004920 20 20 20 20 64 72 2e 77 69 6e 64 6f 77 20 20 20 | dr.window | 00004930 20 3d 20 77 3b 20 2f 2a 6e 6f 74 20 72 65 6c 65 | = w; /*not rele| 00004940 76 61 6e 74 2a 2f 0a 20 20 20 20 20 64 72 2e 74 |vant*/. dr.t| 00004950 79 70 65 20 20 20 20 20 20 3d 20 77 69 6d 70 5f |ype = wimp_| 00004960 55 53 45 52 5f 46 49 58 45 44 3b 0a 20 20 20 20 |USER_FIXED;. | 00004970 20 64 72 2e 62 6f 78 2e 78 30 20 20 20 20 3d 20 | dr.box.x0 = | 00004980 69 63 6f 6e 2e 62 6f 78 2e 78 30 3b 0a 20 20 20 |icon.box.x0;. | 00004990 20 20 64 72 2e 62 6f 78 2e 79 30 20 20 20 20 3d | dr.box.y0 =| 000049a0 20 69 63 6f 6e 2e 62 6f 78 2e 79 30 3b 0a 20 20 | icon.box.y0;. | 000049b0 20 20 20 64 72 2e 62 6f 78 2e 78 31 20 20 20 20 | dr.box.x1 | 000049c0 3d 20 69 63 6f 6e 2e 62 6f 78 2e 78 31 3b 0a 20 |= icon.box.x1;. | 000049d0 20 20 20 20 64 72 2e 62 6f 78 2e 79 31 20 20 20 | dr.box.y1 | 000049e0 20 3d 20 69 63 6f 6e 2e 62 6f 78 2e 79 31 3b 0a | = icon.box.y1;.| 000049f0 20 20 20 20 20 64 72 2e 70 61 72 65 6e 74 2e 78 | dr.parent.x| 00004a00 30 20 3d 20 69 63 6f 6e 2e 62 6f 78 2e 78 30 20 |0 = icon.box.x0 | 00004a10 2d 20 6d 6f 75 73 65 5f 78 3b 20 2f 2a 45 78 70 |- mouse_x; /*Exp| 00004a20 61 6e 64 65 64 20 70 61 72 65 6e 74 20 62 79 20 |anded parent by | 00004a30 62 6f 78 20 6f 76 65 72 6c 61 70 2a 2f 0a 20 20 |box overlap*/. | 00004a40 20 20 20 64 72 2e 70 61 72 65 6e 74 2e 79 30 20 | dr.parent.y0 | 00004a50 3d 20 69 63 6f 6e 2e 62 6f 78 2e 79 30 20 2d 20 |= icon.box.y0 - | 00004a60 6d 6f 75 73 65 5f 79 3b 0a 20 20 20 20 20 64 72 |mouse_y;. dr| 00004a70 2e 70 61 72 65 6e 74 2e 78 31 20 3d 20 69 63 6f |.parent.x1 = ico| 00004a80 6e 2e 62 6f 78 2e 78 31 20 2d 20 6d 6f 75 73 65 |n.box.x1 - mouse| 00004a90 5f 78 20 2b 20 78 5f 6c 69 6d 69 74 3b 0a 20 20 |_x + x_limit;. | 00004aa0 20 20 20 64 72 2e 70 61 72 65 6e 74 2e 79 31 20 | dr.parent.y1 | 00004ab0 3d 20 69 63 6f 6e 2e 62 6f 78 2e 79 31 20 2d 20 |= icon.box.y1 - | 00004ac0 6d 6f 75 73 65 5f 79 20 2b 20 79 5f 6c 69 6d 69 |mouse_y + y_limi| 00004ad0 74 3b 0a 20 20 20 20 20 77 69 6d 70 5f 64 72 61 |t;. wimp_dra| 00004ae0 67 5f 62 6f 78 20 28 26 64 72 29 3b 0a 20 20 20 |g_box (&dr);. | 00004af0 7d 0a 0a 20 20 20 77 69 6e 5f 61 64 64 5f 75 6e |}.. win_add_un| 00004b00 6b 6e 6f 77 6e 5f 65 76 65 6e 74 5f 70 72 6f 63 |known_event_proc| 00004b10 65 73 73 6f 72 20 28 78 66 65 72 73 65 6e 64 5f |essor (xfersend_| 00004b20 5f 75 6e 6b 6e 6f 77 6e 73 2c 20 4e 55 4c 4c 29 |_unknowns, NULL)| 00004b30 3b 0a 20 20 20 72 65 74 75 72 6e 20 54 52 55 45 |;. return TRUE| 00004b40 3b 0a 7d 0a 0a 0a 42 4f 4f 4c 20 78 66 65 72 73 |;.}...BOOL xfers| 00004b50 65 6e 64 5f 66 69 6c 65 5f 69 73 5f 73 61 66 65 |end_file_is_safe| 00004b60 28 29 0a 7b 20 20 0a 20 20 20 72 65 74 75 72 6e |().{ . return| 00004b70 20 78 66 65 72 73 65 6e 64 5f 5f 66 69 6c 65 69 | xfersend__filei| 00004b80 73 73 61 66 65 3b 0a 7d 0a 0a 76 6f 69 64 20 78 |ssafe;.}..void x| 00004b90 66 65 72 73 65 6e 64 5f 73 65 74 5f 66 69 6c 65 |fersend_set_file| 00004ba0 69 73 73 61 66 65 28 42 4f 4f 4c 20 76 61 6c 75 |issafe(BOOL valu| 00004bb0 65 29 0a 7b 20 20 0a 20 20 20 78 66 65 72 73 65 |e).{ . xferse| 00004bc0 6e 64 5f 5f 66 69 6c 65 69 73 73 61 66 65 20 3d |nd__fileissafe =| 00004bd0 20 76 61 6c 75 65 3b 0a 7d 0a 0a 76 6f 69 64 20 | value;.}..void | 00004be0 78 66 65 72 73 65 6e 64 5f 63 6c 65 61 72 5f 75 |xfersend_clear_u| 00004bf0 6e 6b 6e 6f 77 6e 73 28 76 6f 69 64 29 0a 7b 0a |nknowns(void).{.| 00004c00 20 20 20 77 69 6e 5f 72 65 6d 6f 76 65 5f 75 6e | win_remove_un| 00004c10 6b 6e 6f 77 6e 5f 65 76 65 6e 74 5f 70 72 6f 63 |known_event_proc| 00004c20 65 73 73 6f 72 28 73 65 6e 64 62 75 66 5f 5f 75 |essor(sendbuf__u| 00004c30 6e 6b 6e 6f 77 6e 73 2c 20 30 29 3b 0a 20 20 20 |nknowns, 0);. | 00004c40 77 69 6e 5f 72 65 6d 6f 76 65 5f 75 6e 6b 6e 6f |win_remove_unkno| 00004c50 77 6e 5f 65 76 65 6e 74 5f 70 72 6f 63 65 73 73 |wn_event_process| 00004c60 6f 72 28 78 66 65 72 73 65 6e 64 5f 5f 75 6e 6b |or(xfersend__unk| 00004c70 6e 6f 77 6e 73 2c 20 30 29 3b 0a 7d 0a 0a 69 6e |nowns, 0);.}..in| 00004c80 74 20 78 66 65 72 73 65 6e 64 5f 72 65 61 64 5f |t xfersend_read_| 00004c90 6c 61 73 74 5f 72 65 66 28 76 6f 69 64 29 0a 7b |last_ref(void).{| 00004ca0 0a 20 20 20 72 65 74 75 72 6e 28 78 66 65 72 73 |. return(xfers| 00004cb0 65 6e 64 5f 5f 6d 73 67 69 64 29 3b 20 20 20 20 |end__msgid); | 00004cc0 20 20 20 20 2f 2a 20 6d 79 5f 72 65 66 20 6f 66 | /* my_ref of| 00004cd0 20 6c 61 73 74 20 44 61 74 61 53 61 76 65 20 6d | last DataSave m| 00004ce0 65 73 73 61 67 65 20 2a 2f 0a 7d 0a 0a 2f 2a 20 |essage */.}../* | 00004cf0 65 6e 64 20 78 66 65 72 73 65 6e 64 2e 63 20 2a |end xfersend.c *| 00004d00 2f 0a |/.| 00004d02