Detabbed
[AROS.git] / rom / dos / inhibit.c
blob2d553d1c39866188c1a7f9b5e1a03d89addbf00b
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
5 #include <proto/exec.h>
7 #include "dos_intern.h"
9 /*****************************************************************************
11 NAME */
12 #include <proto/dos.h>
14 AROS_LH2(LONG, Inhibit,
16 /* SYNOPSIS */
17 AROS_LHA(CONST_STRPTR, name, D1),
18 AROS_LHA(LONG, onoff, D2),
20 /* LOCATION */
21 struct DosLibrary *, DOSBase, 121, Dos)
23 /* FUNCTION
25 Stop a filesystem from being used.
27 INPUTS
29 name -- Name of the device to inhibit (including a ':')
30 onoff -- Specify whether to inhibit (DOSTRUE) or uninhibit (DOSFALSE)
31 the device
33 RESULT
35 A boolean telling whether the action was carried out.
37 NOTES
39 After uninhibiting a device anything might have happened like the disk
40 in the drive was removed.
42 EXAMPLE
44 BUGS
46 SEE ALSO
48 INTERNALS
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 struct PacketHelperStruct phs;
55 LONG status = DOSFALSE;
57 if (!getdevpacketinfo(DOSBase, name, NULL, &phs))
58 return DOSFALSE;
60 status = dopacket1(DOSBase, NULL, phs.port, ACTION_INHIBIT, onoff);
62 freepacketinfo(DOSBase, &phs);
64 return status;
66 AROS_LIBFUNC_EXIT
67 } /* Inhibit */