some fixes to accented characters
[tangerine.git] / rom / dos / dosdoio.c
blobf1e36c1c9ab21bf783e82321c4fbaf4170ff8394
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Start an IO request and wait until it completes.
6 Lang: English
7 */
8 #include <exec/execbase.h>
9 #include <exec/io.h>
10 #include <dos/dos.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 /*****************************************************************************
16 NAME */
18 BYTE DosDoIO(
20 /* SYNOPSIS */
21 struct IORequest * iORequest,
23 /* LOCATION */
24 struct ExecBase * SysBase)
26 /* FUNCTION
27 It's like the exec's DoIO, but this one handles CTRL-C.
29 INPUTS
30 iORequest - Pointer to iorequest structure.
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 OpenDevice(), CloseDevice(), DoIO(), SendIO(), AbortIO(), WaitIO()
43 INTERNALS
45 ******************************************************************************/
47 #if 1
48 return DoIO(iORequest);
49 #else
51 Prepare the message. Tell the device that it is OK to wait in the
52 BeginIO() call by setting the quick bit.
54 iORequest->io_Flags=IOF_QUICK;
55 iORequest->io_Message.mn_Node.ln_Type=0;
57 /* Call BeginIO() vector */
58 AROS_LVO_CALL1NR(void,
59 AROS_LCA(struct IORequest *,iORequest,A1),
60 struct Device *,iORequest->io_Device,5,
63 /* If the quick flag is cleared it wasn't done quick. Wait for completion. */
64 if(!(iORequest->io_Flags&IOF_QUICK))
66 ULONG iosigf = 1<<iORequest->io_Message.mn_ReplyPort->mp_SigBit;
67 ULONG sigs = 0;
70 loop:
71 while
73 !(sigs & SIGBREAKF_CTRL_C) &&
75 !(iORequest->io_Flags&IOF_QUICK) &&
76 iORequest->io_Message.mn_Node.ln_Type==NT_MESSAGE
79 sigs = Wait(iosigf | SIGBREAKF_CTRL_C);
82 if(iORequest->io_Message.mn_Node.ln_Type==NT_REPLYMSG)
84 /* Arbitrate for the message queue. */
85 Disable();
87 /* Remove the message */
88 Remove(&iORequest->io_Message.mn_Node);
89 Enable();
91 else
92 if (sigs & SIGBREAKF_CTRL_C)
94 AbortIO(iORequest);
95 sigs = 0;
97 goto loop;
101 /* All done. Get returncode. */
102 return iORequest->io_Error;
104 #endif
105 } /* DosDoIO */