configure: when detecting linux include directory for kernel compiler use target...
[AROS.git] / rom / utility / attemptremnamedobject.c
blob0ee5a69a6907524b3b906f472664368aa7aa9229
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: AttemptRemNamedObject() - attempt to remove a NamedObject
6 Lang: english
7 */
8 #include "intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/utility.h>
15 AROS_LH1(LONG, AttemptRemNamedObject,
17 /* SYNOPSIS */
18 AROS_LHA(struct NamedObject *, object, A0),
20 /* LOCATION */
21 struct Library *, UtilityBase, 39, Utility)
23 /* FUNCTION
24 Checks to see whether a NamedObject can be removed. If the object
25 is in use, or in the process of being removed, this function will
26 return a failure code. If the object can be removed, this function
27 will remove it and the object will be available for freeing.
28 You must have previously have called FindNamedObject() on this
29 object.
31 INPUTS
32 object - NamedObject to attempt to remove. The address of the
33 NameSpace is contained within the NamedObject.
35 RESULT
36 If the NamedObject can be removed, then it will be removed from
37 the list. Otherwise the routine will just return.
39 If the NamedObject has a removal message associated with it that
40 message will be returned to the owner of the NamedObject.
42 NOTES
44 EXAMPLE
46 BUGS
48 SEE ALSO
49 utility/name.h, RemNamedObject(), AddNamedObject()
51 INTERNALS
53 HISTORY
54 29-10-95 digulla automatically created from
55 utility_lib.fd and clib/utility_protos.h
56 11-08-96 iaint Adapted from stuff I did.
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 struct IntNamedObject *no = GetIntNamedObject(object);
64 if(no->no_UseCount > 1)
66 return FALSE;
68 else
70 RemNamedObject( object, NULL );
71 return TRUE;
74 AROS_LIBFUNC_EXIT
76 } /* AttemptRemNamedObject */