home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / devices / src / doio.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.5 KB  |  72 lines

  1. /*
  2.     (C) 1995, 96 AROS - The Amiga Replacement OS
  3.     $Id$
  4.     $Log$
  5.     Desc:
  6.     Lang: english
  7. */
  8. #include "exec_intern.h"
  9. #include <exec/io.h>
  10. #include <aros/libcall.h>
  11.  
  12. /*****************************************************************************
  13.  
  14.     NAME */
  15.     #include <clib/exec_protos.h>
  16.  
  17.     __AROS_LH1(BYTE, DoIO,
  18.  
  19. /*  SYNOPSIS */
  20.     __AROS_LA(struct IORequest *, iORequest, A1),
  21.  
  22. /*  LOCATION */
  23.     struct ExecBase *, SysBase, 76, Exec)
  24.  
  25. /*  FUNCTION
  26.     Start an I/O request by calling the devices's BeginIO() vector.
  27.     It waits until the request is complete.
  28.  
  29.     INPUTS
  30.     iORequest - Pointer to iorequest structure.
  31.  
  32.     RESULT
  33.  
  34.     NOTES
  35.  
  36.     EXAMPLE
  37.  
  38.     BUGS
  39.  
  40.     SEE ALSO
  41.     OpenDevice(), CloseDevice(), DoIO(), SendIO(), AbortIO(), WaitIO()
  42.  
  43.     INTERNALS
  44.  
  45.     HISTORY
  46.  
  47. ******************************************************************************/
  48. {
  49.     __AROS_FUNC_INIT
  50.  
  51.     /*
  52.     Prepare the message. Tell the device that it is OK to wait in the
  53.     BeginIO() call by setting the quick bit.
  54.     */
  55.     iORequest->io_Flags=IOF_QUICK;
  56.     iORequest->io_Message.mn_Node.ln_Type=0;
  57.  
  58.     /* Call BeginIO() vector */
  59.     __AROS_LC1 (LONG, beginIO,
  60.     __AROS_LCA(struct IORequest *, iORequest, A1),
  61.     struct Device *, iORequest->io_Device, 5, Device);
  62.  
  63.     /* It the quick flag is cleared it wasn't done quick. Wait for completion. */
  64.     if(!(iORequest->io_Flags&IOF_QUICK))
  65.     WaitIO(iORequest);
  66.  
  67.     /* All done. Get returncode. */
  68.     return iORequest->io_Error;
  69.     __AROS_FUNC_EXIT
  70. } /* DoIO */
  71.  
  72.