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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: exall.c,v 1.7 1997/01/27 00:36:17 ldp Exp $
  4.     $Log: exall.c,v $
  5.     Revision 1.7  1997/01/27 00:36:17  ldp
  6.     Polish
  7.  
  8.     Revision 1.6  1996/12/09 13:53:25  aros
  9.     Added empty templates for all missing functions
  10.  
  11.     Moved #include's into first column
  12.  
  13.     Revision 1.5  1996/10/24 15:50:27  aros
  14.     Use the official AROS macros over the __AROS versions.
  15.  
  16.     Revision 1.4  1996/09/13 17:50:06  digulla
  17.     Use IPTR
  18.  
  19.     Revision 1.3  1996/08/13 13:52:45  digulla
  20.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  21.     Replaced AROS_LA by AROS_LHA
  22.  
  23.     Revision 1.2  1996/08/01 17:40:50  digulla
  24.     Added standard header for all files
  25.  
  26.     Desc:
  27.     Lang: english
  28. */
  29. #include <exec/memory.h>
  30. #include <proto/exec.h>
  31. #include <dos/filesystem.h>
  32. #include <dos/exall.h>
  33. #include "dos_intern.h"
  34.  
  35. /*****************************************************************************
  36.  
  37.     NAME */
  38. #include <proto/dos.h>
  39.  
  40.     AROS_LH5(BOOL, ExAll,
  41.  
  42. /*  SYNOPSIS */
  43.     AROS_LHA(BPTR,                  lock,    D1),
  44.     AROS_LHA(struct ExAllData *,    buffer,  D2),
  45.     AROS_LHA(LONG,                  size,    D3),
  46.     AROS_LHA(LONG,                  data,    D4),
  47.     AROS_LHA(struct ExAllControl *, control, D5),
  48.  
  49. /*  LOCATION */
  50.     struct DosLibrary *, DOSBase, 72, Dos)
  51.  
  52. /*  FUNCTION
  53.  
  54.     INPUTS
  55.  
  56.     RESULT
  57.  
  58.     NOTES
  59.  
  60.     EXAMPLE
  61.  
  62.     BUGS
  63.  
  64.     SEE ALSO
  65.  
  66.     INTERNALS
  67.  
  68.     HISTORY
  69.     29-10-95    digulla automatically created from
  70.                 dos_lib.fd and clib/dos_protos.h
  71.  
  72. *****************************************************************************/
  73. {
  74.     AROS_LIBFUNC_INIT
  75.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  76.  
  77.     /* Get pointer to filehandle */
  78.     struct FileHandle *fh=(struct FileHandle *)BADDR(lock);
  79.  
  80.     /* Get pointer to process structure */
  81.     struct Process *me=(struct Process *)FindTask(NULL);
  82.  
  83.     /* Get pointer to I/O request. Use stackspace for now. */
  84.     struct IOFileSys io,*iofs=&io;
  85.  
  86.     /* Prepare I/O request. */
  87.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  88.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  89.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  90.     iofs->IOFS.io_Device =fh->fh_Device;
  91.     iofs->IOFS.io_Unit     =fh->fh_Unit;
  92.     iofs->IOFS.io_Command=FSA_EXAMINE_ALL;
  93.     iofs->IOFS.io_Flags  =0;
  94.     iofs->io_Args[0]=(IPTR)buffer;
  95.     iofs->io_Args[1]=size;
  96.     iofs->io_Args[2]=data;
  97.  
  98.     /* Send the request. */
  99.     DoIO(&iofs->IOFS);
  100.  
  101.     /* Set error code and return */
  102.     if((me->pr_Result2=iofs->io_DosError)!=0)
  103.     {
  104.     control->eac_Entries=0;
  105.     return 0;
  106.     }
  107.  
  108.     for(size=1;buffer!=NULL;size++)
  109.     {
  110.     buffer->ed_Prot^=0xf;
  111.     buffer=buffer->ed_Next;
  112.     }
  113.     control->eac_Entries=size;
  114.  
  115.     return 1;
  116.     AROS_LIBFUNC_EXIT
  117. } /* ExAll */
  118.