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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: isfilesystem.c,v 1.4 1997/01/27 00:36:23 ldp Exp $
  4.     $Log: isfilesystem.c,v $
  5.     Revision 1.4  1997/01/27 00:36:23  ldp
  6.     Polish
  7.  
  8.     Revision 1.3  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.2  1996/10/24 15:50:31  aros
  14.     Use the official AROS macros over the __AROS versions.
  15.  
  16.     Revision 1.1  1996/09/11 12:54:46  digulla
  17.     A couple of new DOS functions from M. Fleischer
  18.  
  19.     Desc:
  20.     Lang: english
  21. */
  22. #include <proto/exec.h>
  23. #include <dos/dosextens.h>
  24. #include <dos/filesystem.h>
  25. #include "dos_intern.h"
  26.  
  27. /*****************************************************************************
  28.  
  29.     NAME */
  30. #include <proto/dos.h>
  31.  
  32.     AROS_LH1(BOOL, IsFileSystem,
  33.  
  34. /*  SYNOPSIS */
  35.     AROS_LHA(STRPTR, devicename, D1),
  36.  
  37. /*  LOCATION */
  38.     struct DosLibrary *, DOSBase, 118, Dos)
  39.  
  40. /*  FUNCTION
  41.  
  42.     INPUTS
  43.  
  44.     RESULT
  45.  
  46.     NOTES
  47.  
  48.     EXAMPLE
  49.  
  50.     BUGS
  51.  
  52.     SEE ALSO
  53.  
  54.     INTERNALS
  55.  
  56.     HISTORY
  57.     29-10-95    digulla automatically created from
  58.                 dos_lib.fd and clib/dos_protos.h
  59.  
  60. *****************************************************************************/
  61. {
  62.     AROS_LIBFUNC_INIT
  63.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  64.  
  65.     /* Get pointer to process structure */
  66.     struct Process *me=(struct Process *)FindTask(NULL);
  67.     struct DosList *dl;
  68.     BOOL success=0;
  69.  
  70.     dl=LockDosList(LDF_DEVICES|LDF_READ);
  71.     dl=FindDosEntry(dl,devicename,LDF_DEVICES);
  72.     if(dl!=NULL)
  73.     {
  74.  
  75.         /* Get pointer to I/O request. Use stackspace for now. */
  76.         struct IOFileSys io,*iofs=&io;
  77.  
  78.         /* Prepare I/O request. */
  79.         iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  80.         iofs->IOFS.io_Message.mn_ReplyPort   =&me->pr_MsgPort;
  81.         iofs->IOFS.io_Message.mn_Length      =sizeof(struct IOFileSys);
  82.         iofs->IOFS.io_Device =dl->dol_Device;
  83.         iofs->IOFS.io_Unit   =dl->dol_Unit;
  84.         iofs->IOFS.io_Command=FSA_IS_FILESYSTEM;
  85.         iofs->IOFS.io_Flags  =0;
  86.  
  87.         /* Send the request. */
  88.         DoIO(&iofs->IOFS);
  89.         
  90.         /* Set return code */
  91.         if(!iofs->io_DosError)
  92.             success=iofs->io_Args[0];
  93.     }
  94.     /* All Done. */
  95.     UnLockDosList(LDF_DEVICES|LDF_READ);
  96.     return success;
  97.     AROS_LIBFUNC_EXIT
  98. } /* IsFilesystem */
  99.