home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / dos / isinteractive.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  2.3 KB  |  101 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: isinteractive.c,v 1.6 1997/01/27 00:36:23 ldp Exp $
  4.     $Log: isinteractive.c,v $
  5.     Revision 1.6  1997/01/27 00:36:23  ldp
  6.     Polish
  7.  
  8.     Revision 1.5  1996/12/09 13:53:32  aros
  9.     Added empty templates for all missing functions
  10.  
  11.     Moved #include's into first column
  12.  
  13.     Revision 1.4  1996/10/24 15:50:31  aros
  14.     Use the official AROS macros over the __AROS versions.
  15.  
  16.     Revision 1.3  1996/08/13 13:52:48  digulla
  17.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  18.     Replaced AROS_LA by AROS_LHA
  19.  
  20.     Revision 1.2  1996/08/01 17:40:53  digulla
  21.     Added standard header for all files
  22.  
  23.     Desc:
  24.     Lang: english
  25. */
  26. #include <proto/exec.h>
  27. #include <dos/filesystem.h>
  28. #include "dos_intern.h"
  29.  
  30. /*****************************************************************************
  31.  
  32.     NAME */
  33. #include <proto/dos.h>
  34.  
  35.     AROS_LH1(BOOL, IsInteractive,
  36.  
  37. /*  SYNOPSIS */
  38.     AROS_LHA(BPTR, file, D1),
  39.  
  40. /*  LOCATION */
  41.     struct DosLibrary *, DOSBase, 36, Dos)
  42.  
  43. /*  FUNCTION
  44.     Check if file is bound to an interactive device such as a console
  45.     or shell window.
  46.  
  47.     INPUTS
  48.     file   - filehandle
  49.  
  50.     RESULT
  51.     !=0 if the file is interactive, 0 if it is not.
  52.  
  53.     NOTES
  54.  
  55.     EXAMPLE
  56.  
  57.     BUGS
  58.  
  59.     SEE ALSO
  60.  
  61.     INTERNALS
  62.  
  63.     HISTORY
  64.     29-10-95    digulla automatically created from
  65.                 dos_lib.fd and clib/dos_protos.h
  66.  
  67. *****************************************************************************/
  68. {
  69.     AROS_LIBFUNC_INIT
  70.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  71.  
  72.     /* Get pointer to filehandle */
  73.     struct FileHandle *fh=(struct FileHandle *)BADDR(file);
  74.  
  75.     /* Get pointer to process structure */
  76.     struct Process *me=(struct Process *)FindTask(NULL);
  77.  
  78.     /* Get pointer to I/O request. Use stackspace for now. */
  79.     struct IOFileSys io,*iofs=&io;
  80.  
  81.     /* Prepare I/O request. */
  82.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  83.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  84.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  85.     iofs->IOFS.io_Device =fh->fh_Device;
  86.     iofs->IOFS.io_Unit     =fh->fh_Unit;
  87.     iofs->IOFS.io_Command=FSA_IS_INTERACTIVE;
  88.     iofs->IOFS.io_Flags  =0;
  89.  
  90.     /* Send the request. */
  91.     DoIO(&iofs->IOFS);
  92.  
  93.     /* Return */
  94.     if(iofs->io_DosError)
  95.     return 0;
  96.     else
  97.     return iofs->io_Args[0];
  98.  
  99.     AROS_LIBFUNC_EXIT
  100. } /* IsInteractive */
  101.