2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
9 #include <dos/dosextens.h>
10 #include <proto/utility.h>
11 #include "dos_intern.h"
15 # include <aros/debug.h>
17 /*****************************************************************************
20 #include <proto/dos.h>
22 AROS_LH3(struct DosList
*, FindDosEntry
,
25 AROS_LHA(struct DosList
*, dlist
, D1
),
26 AROS_LHA(CONST_STRPTR
, name
, D2
),
27 AROS_LHA(ULONG
, flags
, D3
),
30 struct DosLibrary
*, DOSBase
, 114, Dos
)
33 Looks for the next dos list entry with the right name. The list
34 must be locked for this. There may be not more than one device
35 or assign node of the same name. There are no restrictions on
39 dlist - the value given by LockDosList() or the last call to
41 name - logical device name without colon. Case insensitive.
42 flags - the same flags as given to LockDosList() or a subset
46 Pointer to dos list entry found or NULL if the are no more entries.
58 *****************************************************************************/
62 static const ULONG flagarray
[]=
63 { 0, LDF_DEVICES
, LDF_ASSIGNS
, LDF_VOLUMES
, LDF_ASSIGNS
, LDF_ASSIGNS
};
65 /* Determine the size of the name (-1 if the last character is a ':') */
66 CONST_STRPTR end
= name
;
77 if (size
&& end
[-2] == ':')
85 /* Get next entry. Return NULL if there is none. */
86 dlist
= dlist
->dol_Next
;
93 D(bug("Found list entry %s\n", dlist
->dol_Ext
.dol_AROS
.dol_DevName
));
95 /* Check type and name */
96 if (flags
& flagarray
[dlist
->dol_Type
+ 1] &&
97 !Strnicmp(name
, dlist
->dol_Ext
.dol_AROS
.dol_DevName
, size
) &&
98 !dlist
->dol_Ext
.dol_AROS
.dol_DevName
[size
])