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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: nextdosentry.c,v 1.3 1997/01/27 00:36:26 ldp Exp $
  4.     $Log: nextdosentry.c,v $
  5.     Revision 1.3  1997/01/27 00:36:26  ldp
  6.     Polish
  7.  
  8.     Revision 1.2  1996/12/09 13:53:35  aros
  9.     Added empty templates for all missing functions
  10.  
  11.     Moved #include's into first column
  12.  
  13.     Revision 1.1  1996/12/05 15:42:23  aros
  14.     Initial revision
  15.  
  16.  
  17.     Desc:
  18.     Lang: english
  19. */
  20. #include <dos/dosextens.h>
  21. #include "dos_intern.h"
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26. #include <proto/dos.h>
  27.  
  28.     AROS_LH2I(struct DosList *, NextDosEntry,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct DosList *, dlist, D1),
  32.     AROS_LHA(ULONG           , flags, D2),
  33.  
  34. /*  LOCATION */
  35.     struct DosLibrary *, DOSBase, 115, Dos)
  36.  
  37. /*  FUNCTION
  38.     Looks for the next dos list entry with the right type. The list
  39.     must be locked for this.
  40.  
  41.     INPUTS
  42.     dlist - the value given by LockDosList() or the last call to
  43.         FindDosEntry().
  44.     flags - the same flags as given to LockDosList() or a subset
  45.         of them.
  46.  
  47.     RESULT
  48.     Pointer to dos list entry found or NULL if the are no more entries.
  49.  
  50.     NOTES
  51.  
  52.     EXAMPLE
  53.  
  54.     BUGS
  55.  
  56.     SEE ALSO
  57.  
  58.     INTERNALS
  59.  
  60.     HISTORY
  61.     27-11-96    digulla automatically created from
  62.                 dos_lib.fd and clib/dos_protos.h
  63.  
  64. *****************************************************************************/
  65. {
  66.     AROS_LIBFUNC_INIT
  67.  
  68.     static const ULONG flagarray[]=
  69.     { 0, LDF_DEVICES, LDF_ASSIGNS, LDF_VOLUMES, LDF_ASSIGNS, LDF_ASSIGNS };
  70.  
  71.     /* Follow the list */
  72.     for(;;)
  73.     {
  74.         /* Get next entry. Return NULL if there is none. */
  75.         dlist=dlist->dol_Next;
  76.         if(dlist==NULL)
  77.             return NULL;
  78.  
  79.         /* Check type */
  80.         if(flags&flagarray[dlist->dol_Type+1])
  81.             return dlist;
  82.     }
  83.     AROS_LIBFUNC_EXIT
  84. } /* NextDosEntry */
  85.