grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / dos / remdosentry.c
blob262c5e1f293623f97b409a674a68b58e75d52ac1
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <dos/dosextens.h>
9 #include <proto/exec.h>
11 /*****************************************************************************
13 NAME */
14 #include <proto/dos.h>
16 AROS_LH1(LONG, RemDosEntry,
18 /* SYNOPSIS */
19 AROS_LHA(struct DosList *, dlist, D1),
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 112, Dos)
24 /* FUNCTION
25 Removes a given dos list entry from the dos list. Automatically
26 locks the list for writing.
28 INPUTS
29 dlist - pointer to dos list entry.
31 RESULT
32 !=0 if all went well, 0 otherwise.
34 NOTES
35 Since anybody who wants to use a device or volume node in the
36 dos list has to lock the list, filesystems may be called with
37 the dos list locked. So if you want to add a dos list entry
38 out of a filesystem don't just wait on the lock but serve all
39 incoming requests until the dos list is free instead.
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
52 struct DosList *dl;
54 if(dlist == NULL)
55 return 0;
57 dl = LockDosList(LDF_ALL | LDF_WRITE);
59 while(TRUE)
61 struct DosList *dl2 = BADDR(dl->dol_Next);
63 if(dl2 == dlist)
65 dl->dol_Next = dlist->dol_Next;
66 break;
69 dl = dl2;
72 UnLockDosList(LDF_ALL | LDF_WRITE);
74 return 1;
76 AROS_LIBFUNC_EXIT
77 } /* RemDosEntry */