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

  1. /*
  2.     $Id: attemptremnamedobject.c,v 1.2 1997/01/27 00:32:30 ldp Exp $
  3.     $Log: attemptremnamedobject.c,v $
  4.     Revision 1.2  1997/01/27 00:32:30  ldp
  5.     Polish
  6.  
  7.     Revision 1.1  1996/12/18 01:27:35  iaint
  8.     NamedObjects
  9.  
  10.     Desc: AttemptRemNamedObject() - attempt to remove a NamedObject
  11.     Lang: english
  12. */
  13. #include "utility_intern.h"
  14.  
  15. /*****************************************************************************
  16.  
  17.     NAME */
  18.         #include <proto/utility.h>
  19.  
  20.         AROS_LH1(LONG, AttemptRemNamedObject,
  21.  
  22. /*  SYNOPSIS */
  23.         AROS_LHA(struct NamedObject *, object, A0),
  24.  
  25. /*  LOCATION */
  26.         struct Library *, UtilityBase, 39, Utility)
  27.  
  28. /*  FUNCTION
  29.         Checks to see whether a NamedObject can be removed. If the object
  30.         is in use, or in the process of being removed, this function will
  31.         return a failure code. If the object can be removed, this function
  32.         will remove it and the object will be available for freeing.
  33.         You must have previously have called FindNamedObject() on this
  34.         object.
  35.  
  36.     INPUTS
  37.         object      - NamedObject to attempt to remove. The address of the
  38.                         NameSpace is contained within the NamedObject.
  39.  
  40.     RESULT
  41.         If the NamedObject can be removed, then it will be removed from
  42.         the list. Otherwise the routine will just return.
  43.  
  44.         If the NamedObject has a removal message associated with it that
  45.         message will be returned to the owner of the NamedObject.
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.         utility/name.h RemNamedObject(), AddNamedObject()
  55.  
  56.     INTERNALS
  57.  
  58.     HISTORY
  59.         29-10-95    digulla automatically created from
  60.                             utility_lib.fd and clib/utility_protos.h
  61.         11-08-96    iaint   Adapted from stuff I did.
  62.  
  63. *****************************************************************************/
  64. {
  65.     AROS_LIBFUNC_INIT
  66.  
  67.     struct IntNamedObject *no = GetIntNamedObject(object);
  68.  
  69.     if(no->no_UseCount > 1)
  70.     {
  71.         return FALSE;
  72.     }
  73.     else
  74.     {
  75.         RemNamedObject( object, NULL );
  76.         return TRUE;
  77.     }
  78.  
  79.     AROS_LIBFUNC_EXIT
  80.  
  81. } /* AttemptRemNamedObject */
  82.