2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Set the current mode of a console device.
8 #include "dos_intern.h"
10 /*****************************************************************************
13 #include <proto/dos.h>
15 AROS_LH2(LONG
, SetMode
,
18 AROS_LHA(BPTR
, fh
, D1
),
19 AROS_LHA(LONG
, mode
, D2
),
22 struct DosLibrary
*, DOSBase
, 71, Dos
)
25 SetMode() can be used to change a console handler between
26 RAW: mode and CON: mode.
29 fh - The filehandle describing the console.
30 mode - The new mode of the console:
35 This function will return whether it succeeded:
37 == DOSTRUE console mode changed
38 != DOSTRUE console mode change failed.
50 *****************************************************************************/
54 struct IOFileSys iofs
;
55 struct FileHandle
*fha
= (struct FileHandle
*)BADDR(fh
);
57 InitIOFS(&iofs
, FSA_CONSOLE_MODE
, DOSBase
);
59 iofs
.IOFS
.io_Device
= fha
->fh_Device
;
60 iofs
.IOFS
.io_Unit
= fha
->fh_Unit
;
62 iofs
.io_Union
.io_CONSOLE_MODE
.io_ConsoleMode
= mode
;
66 SetIoErr(iofs
.io_DosError
);
68 return iofs
.io_DosError
== 0 ? DOSTRUE
: DOSFALSE
;