2 Copyright © 1995-2001, 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 *****************************************************************************/
53 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
55 struct IOFileSys iofs
;
56 struct FileHandle
*fha
= (struct FileHandle
*)BADDR(fh
);
58 InitIOFS(&iofs
, FSA_CONSOLE_MODE
, DOSBase
);
60 iofs
.IOFS
.io_Device
= fha
->fh_Device
;
61 iofs
.IOFS
.io_Unit
= fha
->fh_Unit
;
63 iofs
.io_Union
.io_CONSOLE_MODE
.io_ConsoleMode
= mode
;
67 SetIoErr(iofs
.io_DosError
);
69 return iofs
.io_DosError
== 0 ? DOSTRUE
: DOSFALSE
;