home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / exec / remdevice.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  2.0 KB  |  88 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: remdevice.c,v 1.7 1997/01/01 03:46:14 ldp Exp $
  4.     $Log: remdevice.c,v $
  5.     Revision 1.7  1997/01/01 03:46:14  ldp
  6.     Committed Amiga native (support) code
  7.  
  8.     Changed clib to proto
  9.  
  10.     Revision 1.6  1996/12/10 13:51:51  aros
  11.     Moved all #include's in the first column so makedepend can see it.
  12.  
  13.     Revision 1.5  1996/10/24 15:50:55  aros
  14.     Use the official AROS macros over the __AROS versions.
  15.  
  16.     Revision 1.4  1996/08/13 13:56:06  digulla
  17.     Replaced AROS_LA by AROS_LHA
  18.     Replaced some AROS_LH*I by AROS_LH*
  19.     Sorted and added includes
  20.  
  21.     Revision 1.3  1996/08/01 17:41:16  digulla
  22.     Added standard header for all files
  23.  
  24.     Desc:
  25.     Lang: english
  26. */
  27. #include <exec/devices.h>
  28. #include <exec/execbase.h>
  29. #include <aros/libcall.h>
  30. #include <dos/dos.h>
  31. #include <proto/exec.h>
  32.  
  33. /*****************************************************************************
  34.  
  35.     NAME */
  36.  
  37.     AROS_LH1(void, RemDevice,
  38.  
  39. /*  SYNOPSIS */
  40.     AROS_LHA(struct Device *, device,A1),
  41.  
  42. /*  LOCATION */
  43.     struct ExecBase *, SysBase, 73, Exec)
  44.  
  45. /*  FUNCTION
  46.     Calls the given device's expunge vector, thus trying to delete it.
  47.     The device may refuse to do so and still be open after this call.
  48.  
  49.     INPUTS
  50.     device - Pointer to the device structure.
  51.  
  52.     RESULT
  53.  
  54.     NOTES
  55.  
  56.     EXAMPLE
  57.  
  58.     BUGS
  59.  
  60.     SEE ALSO
  61.     AddDevice(), OpenDevice(), CloseDevice().
  62.  
  63.     INTERNALS
  64.  
  65.     HISTORY
  66.  
  67. ******************************************************************************/
  68. {
  69.     AROS_LIBFUNC_INIT
  70.  
  71.     /* Arbitrate for the device list */
  72.     Forbid();
  73.  
  74.     /* Call expunge vector */
  75.     (void)AROS_LVO_CALL0(BPTR,struct Device *,device,3,);
  76.     /*
  77.     Normally you'd expect the device to be expunged if this returns
  78.     non-zero, but this is only exec which doesn't know anything about
  79.     seglists - therefore dos.library has to SetFunction() into this
  80.     vector for the additional functionality.
  81.     */
  82.  
  83.     /* All done. */
  84.     Permit();
  85.     AROS_LIBFUNC_EXIT
  86. } /* RemDevice */
  87.  
  88.