Update to lasso handling. Adjust scroll amount based on difference between mouse...
[AROS.git] / rom / dos / relabel.c
blobdb8c77975b1766547783f14025729353cadc46b5
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
8 #include <proto/exec.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH2(LONG, Relabel,
19 /* SYNOPSIS */
20 AROS_LHA(CONST_STRPTR, drive, D1),
21 AROS_LHA(CONST_STRPTR, newname, D2),
23 /* LOCATION */
24 struct DosLibrary *, DOSBase, 120, Dos)
26 /* FUNCTION
28 Change names of a volume.
30 INPUTS
32 drive -- The name of the device to rename (including the ':').
33 newname -- The new name for the device (without the ':').
35 RESULT
37 A boolean telling whether the name change was successful or not.
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct IOFileSys iofs;
54 struct DevProc *dvp;
55 LONG err;
57 /* Prepare I/O request. */
58 InitIOFS(&iofs, FSA_RELABEL, DOSBase);
59 iofs.io_Union.io_RELABEL.io_NewName = newname;
60 iofs.io_Union.io_RELABEL.io_Result = FALSE;
62 /* get the device */
63 if ((dvp = GetDeviceProc(drive, NULL)) == NULL)
64 return DOSFALSE;
66 /* we're only interested in real devices */
67 if (dvp->dvp_DevNode->dol_Type != DLT_DEVICE) {
68 FreeDeviceProc(dvp);
69 SetIoErr(ERROR_DEVICE_NOT_MOUNTED);
70 return DOSFALSE;
73 err = DoIOFS(&iofs, dvp, NULL, DOSBase);
75 FreeDeviceProc(dvp);
77 if (err != 0)
78 return DOSFALSE;
80 return iofs.io_Union.io_RELABEL.io_Result ? DOSTRUE : DOSFALSE;
82 AROS_LIBFUNC_EXIT
83 } /* Relabel */