00001 /* 00002 ** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. 00003 ** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & 00004 ** Digital Equipment Corporation, Maynard, Mass. 00005 ** Copyright (c) 1998 Microsoft. 00006 ** To anyone who acknowledges that this file is provided "AS IS" 00007 ** without any express or implied warranty: permission to use, copy, 00008 ** modify, and distribute this file for any purpose is hereby 00009 ** granted without fee, provided that the above copyright notices and 00010 ** this notice appears in all source code copies, and that none of 00011 ** the names of Open Software Foundation, Inc., Hewlett-Packard 00012 ** Company, or Digital Equipment Corporation be used in advertising 00013 ** or publicity pertaining to distribution of the software without 00014 ** specific, written prior permission. Neither Open Software 00015 ** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment 00016 ** Corporation makes any representations about the suitability of 00017 ** this software for any purpose. 00018 */ 00019 00020 typedef struct _uuid_upnp { 00021 unsigned32 time_low; 00022 unsigned16 time_mid; 00023 unsigned16 time_hi_and_version; 00024 unsigned8 clock_seq_hi_and_reserved; 00025 unsigned8 clock_seq_low; 00026 byte node[6]; 00027 } uuid_upnp; 00028 00029 /* uuid_create -- generate a UUID */ 00030 int uuid_create(uuid_upnp * id); 00031 void uuid_unpack(uuid_upnp *u, char *out); // out will be xxxx-xx-xx-xx-xxxxxx format 00032 00033 /* uuid_create_from_name -- create a UUID using a "name" 00034 from a "name space" */ 00035 void uuid_create_from_name( 00036 uuid_upnp * uid, /* resulting UUID */ 00037 uuid_upnp nsid, /* UUID to serve as context, so identical 00038 names from different name spaces generate 00039 different UUIDs */ 00040 void * name, /* the name from which to generate a UUID */ 00041 int namelen /* the length of the name */ 00042 ); 00043 00044 /* uuid_compare -- Compare two UUID's "lexically" and return 00045 -1 u1 is lexically before u2 00046 0 u1 is equal to u2 00047 1 u1 is lexically after u2 00048 Note: lexical ordering is not temporal ordering! 00049 */ 00050 int uuid_compare(uuid_upnp *u1, uuid_upnp *u2);
1.6.1