Detabbed
[AROS.git] / rom / dos / format.c
blobd13c7cbda28e0ea3f96f7d0dfde633cfc84951ea
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Format a device.
6 */
7 #include <proto/exec.h>
8 #include <dos/dosextens.h>
9 #include "dos_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/dos.h>
16 AROS_LH3(BOOL, Format,
18 /* SYNOPSIS */
19 AROS_LHA(CONST_STRPTR, devicename, D1),
20 AROS_LHA(CONST_STRPTR, volumename, D2),
21 AROS_LHA(ULONG, dostype, D3),
23 /* LOCATION */
24 struct DosLibrary *, DOSBase, 119, Dos)
26 /* FUNCTION
27 Initialise a filesystem for use by the system. This instructs
28 a filesystem to write out the data that it uses to describe the
29 device.
31 The device should already have been formatted.
33 INPUTS
34 devicename - Name of the device to format.
35 volumename - The name you wish the volume to be called.
36 dostype - The DOS type you wish on the disk.
38 RESULT
39 != 0 if the format was successful, 0 otherwise.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 struct PacketHelperStruct phs;
56 LONG status = DOSFALSE;
58 if (!getdevpacketinfo(DOSBase, devicename, volumename, &phs))
59 return DOSFALSE;
61 status = dopacket2(DOSBase, NULL, phs.port, ACTION_FORMAT, phs.name, (IPTR)dostype);
63 freepacketinfo(DOSBase, &phs);
65 return status;
67 AROS_LIBFUNC_EXIT
68 } /* Format */