home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / utility / getuniqueid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.4 KB  |  72 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id: getuniqueid.c,v 1.4 1996/10/24 15:51:36 aros Exp $
  4.     $Log: getuniqueid.c,v $
  5.     Revision 1.4  1996/10/24 15:51:36  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.3  1996/09/12 14:52:47  digulla
  9.     Better way to separate public and private parts of the library base
  10.  
  11.     Revision 1.2  1996/08/31 12:58:12  aros
  12.     Merged in/modified for FreeBSD.
  13.  
  14.     Desc:
  15.     Lang: english
  16. */
  17. #include "utility_intern.h"
  18.  
  19. /*****************************************************************************
  20.  
  21.     NAME */
  22.     #include <clib/utility_protos.h>
  23.  
  24.     AROS_LH0(ULONG, GetUniqueID,
  25.  
  26. /*  SYNOPSIS */
  27.     /* void */
  28.  
  29. /*  LOCATION */
  30.     struct UtilityBase *, UtilityBase, 45, Utility)
  31.  
  32. /*  FUNCTION
  33.     Returns a unique id that is different from any other id that is
  34.     obtained from this function call.
  35.  
  36.     INPUTS
  37.  
  38.     RESULT
  39.     an unsigned long id
  40.  
  41.     NOTES
  42.  
  43.     EXAMPLE
  44.  
  45.     BUGS
  46.  
  47.     SEE ALSO
  48.  
  49.     INTERNALS
  50.     Calls Disable()/Enable() to guarentee uniqueness.
  51.  
  52.     HISTORY
  53.     29-10-95    digulla automatically created from
  54.                 utility_lib.fd and clib/utility_protos.h
  55.     17-08-96    iaint   Reimplemented. CVS lost my old one. Well I did.
  56.  
  57. *****************************************************************************/
  58. {
  59.     AROS_LIBFUNC_INIT
  60.     ULONG ret;
  61.  
  62.     Disable();
  63.  
  64.     ret = ++(GetIntUtilityBase(UtilityBase)->ub_LastID);
  65.  
  66.     Enable();
  67.  
  68.     return ret;
  69.  
  70.     AROS_LIBFUNC_EXIT
  71. } /* GetUniqueID */
  72.