Fix for the (stupid) case of app (always) passing
[tangerine.git] / rom / dos / isinteractive.c
blobc1c79285025c1b34f06879568fb10b247a05188c
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Query a filesystem for interactiveness.
6 Lang: English
7 */
8 #include <proto/exec.h>
9 #include <dos/filesystem.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH1(BOOL, IsInteractive,
19 /* SYNOPSIS */
20 AROS_LHA(BPTR, file, D1),
22 /* LOCATION */
23 struct DosLibrary *, DOSBase, 36, Dos)
25 /* FUNCTION
26 Check if file is bound to an interactive device such as a console
27 or shell window.
29 INPUTS
30 file - filehandle
32 RESULT
33 != 0 if the file is interactive, 0 if it is not.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 *****************************************************************************/
47 AROS_LIBFUNC_INIT
48 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
50 /* Get pointer to filehandle */
51 struct FileHandle *fh=(struct FileHandle *)BADDR(file);
53 /* Get pointer to I/O request. Use stackspace for now. */
54 struct IOFileSys iofs;
56 /* Prepare I/O request. */
57 InitIOFS(&iofs, FSA_IS_INTERACTIVE, DOSBase);
59 iofs.IOFS.io_Device = fh->fh_Device;
60 iofs.IOFS.io_Unit = fh->fh_Unit;
62 /* Send the request. */
63 DosDoIO(&iofs.IOFS);
65 /* Return */
66 if(iofs.io_DosError != 0)
67 return 0;
68 else
69 return iofs.io_Union.io_IS_INTERACTIVE.io_IsInteractive;
71 AROS_LIBFUNC_EXIT
72 } /* IsInteractive */