Port the SB128 code to AROS.
[AROS.git] / workbench / c / DiskChange.c
blob723168395d1e6c013d5776baa76088ddd71067a7
1 /*
2 Copyright © 2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: DiskChange CLI command
6 Lang: English
7 */
8 /******************************************************************************
10 NAME
12 Diskchange
14 FORMAT
16 Diskchange DEVICE
18 SYNOPSIS
20 DEVICE/A
22 LOCATION
26 FUNCTION
28 Diskchange is intended only for removable media. For example if
29 you have a internal floppy disk dive set to noclick AROS will not
30 perform disk presence check. So you have to manually update any
31 disk change made.
33 INPUTS
35 DEVICE -- The disk device unit.
37 RESULT
39 NOTES
41 EXAMPLE
43 Diskchange df0:
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
53 ******************************************************************************//*****************************************************************************************/
55 #include <proto/dos.h>
57 #include <dos/dos.h>
58 #include <exec/types.h>
60 const TEXT __version__[] = "\0$VER: DiskChange 41.1 (8.12.2007)";
61 int __nocommandline;
63 int main(void)
65 struct RDArgs *ra;
66 STRPTR dev;
67 int rc = RETURN_FAIL;
69 ra = ReadArgs("DEVICE/A", (IPTR *)&dev, NULL);
70 if (ra) {
71 if (Inhibit(dev, DOSTRUE) && Inhibit(dev, DOSFALSE))
72 rc = RETURN_OK;
73 FreeArgs(ra);
75 if (rc != RETURN_OK);
76 PrintFault(IoErr(), "DiskChange");
77 return rc;