home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / exec / doio.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.8 KB  |  84 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: doio.c,v 1.5 1996/10/24 15:50:47 aros Exp $
  4.     $Log: doio.c,v $
  5.     Revision 1.5  1996/10/24 15:50:47  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:01  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:09  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include <exec/execbase.h>
  20. #include <exec/io.h>
  21. #include <aros/libcall.h>
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26.     #include <clib/exec_protos.h>
  27.  
  28.     AROS_LH1(BYTE, DoIO,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct IORequest *, iORequest, A1),
  32.  
  33. /*  LOCATION */
  34.     struct ExecBase *, SysBase, 76, Exec)
  35.  
  36. /*  FUNCTION
  37.     Start an I/O request by calling the devices's BeginIO() vector.
  38.     It waits until the request is complete.
  39.  
  40.     INPUTS
  41.     iORequest - Pointer to iorequest structure.
  42.  
  43.     RESULT
  44.  
  45.     NOTES
  46.  
  47.     EXAMPLE
  48.  
  49.     BUGS
  50.  
  51.     SEE ALSO
  52.     OpenDevice(), CloseDevice(), DoIO(), SendIO(), AbortIO(), WaitIO()
  53.  
  54.     INTERNALS
  55.  
  56.     HISTORY
  57.  
  58. ******************************************************************************/
  59. {
  60.     AROS_LIBFUNC_INIT
  61.  
  62.     /*
  63.     Prepare the message. Tell the device that it is OK to wait in the
  64.     BeginIO() call by setting the quick bit.
  65.     */
  66.     iORequest->io_Flags=IOF_QUICK;
  67.     iORequest->io_Message.mn_Node.ln_Type=0;
  68.  
  69.     /* Call BeginIO() vector */
  70.     AROS_LVO_CALL1(void,
  71.     AROS_LCA(struct IORequest *,iORequest,A1),
  72.     struct Device *,iORequest->io_Device,5,
  73.     );
  74.  
  75.     /* It the quick flag is cleared it wasn't done quick. Wait for completion. */
  76.     if(!(iORequest->io_Flags&IOF_QUICK))
  77.     WaitIO(iORequest);
  78.  
  79.     /* All done. Get returncode. */
  80.     return iORequest->io_Error;
  81.     AROS_LIBFUNC_EXIT
  82. } /* DoIO */
  83.  
  84.