[1] | 1 | /** @file
|
---|
[2981] | 2 | * innotek Portable Runtime - Universal Unique Identifiers (UUID).
|
---|
[1] | 3 | */
|
---|
| 4 |
|
---|
| 5 | /*
|
---|
[8155] | 6 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
[1] | 7 | *
|
---|
| 8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
| 9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
| 10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
[5999] | 11 | * General Public License (GPL) as published by the Free Software
|
---|
| 12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
| 13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
| 14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
| 15 | *
|
---|
| 16 | * The contents of this file may alternatively be used under the terms
|
---|
| 17 | * of the Common Development and Distribution License Version 1.0
|
---|
| 18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
| 19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
| 20 | * CDDL are applicable instead of those of the GPL.
|
---|
| 21 | *
|
---|
| 22 | * You may elect to license modified versions of this file under the
|
---|
| 23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[8155] | 24 | *
|
---|
| 25 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
| 26 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
| 27 | * additional information or have any questions.
|
---|
[1] | 28 | */
|
---|
| 29 |
|
---|
[3630] | 30 | #ifndef ___iprt_uuid_h
|
---|
| 31 | #define ___iprt_uuid_h
|
---|
[1] | 32 |
|
---|
| 33 | #include <iprt/cdefs.h>
|
---|
| 34 | #include <iprt/types.h>
|
---|
| 35 |
|
---|
| 36 | __BEGIN_DECLS
|
---|
| 37 |
|
---|
| 38 | /** @defgroup grp_rt_uuid RTUuid - Universally Unique Identifiers
|
---|
| 39 | * @ingroup grp_rt
|
---|
| 40 | * @{
|
---|
| 41 | */
|
---|
| 42 |
|
---|
| 43 | /**
|
---|
| 44 | * Generates new UUID value.
|
---|
| 45 | *
|
---|
| 46 | * @returns iprt status code.
|
---|
| 47 | * @param pUuid Where to store generated uuid.
|
---|
| 48 | */
|
---|
[204] | 49 | RTDECL(int) RTUuidCreate(PRTUUID pUuid);
|
---|
[1] | 50 |
|
---|
| 51 | /**
|
---|
| 52 | * Makes null UUID value.
|
---|
| 53 | *
|
---|
| 54 | * @returns iprt status code.
|
---|
| 55 | * @param pUuid Where to store generated null uuid.
|
---|
| 56 | */
|
---|
[204] | 57 | RTDECL(int) RTUuidClear(PRTUUID pUuid);
|
---|
[1] | 58 |
|
---|
| 59 | /**
|
---|
| 60 | * Checks if UUID is null.
|
---|
| 61 | *
|
---|
| 62 | * @returns true if UUID is null.
|
---|
| 63 | * @param pUuid uuid to check.
|
---|
| 64 | */
|
---|
[204] | 65 | RTDECL(int) RTUuidIsNull(PCRTUUID pUuid);
|
---|
[1] | 66 |
|
---|
| 67 | /**
|
---|
| 68 | * Compares two UUID values.
|
---|
| 69 | *
|
---|
| 70 | * @returns 0 if eq, < 0 or > 0.
|
---|
| 71 | * @param pUuid1 First value to compare.
|
---|
| 72 | * @param pUuid2 Second value to compare.
|
---|
| 73 | */
|
---|
[204] | 74 | RTDECL(int) RTUuidCompare(PCRTUUID pUuid1, PCRTUUID pUuid2);
|
---|
[1] | 75 |
|
---|
| 76 | /**
|
---|
| 77 | * Converts binary UUID to its string representation.
|
---|
| 78 | *
|
---|
| 79 | * @returns iprt status code.
|
---|
| 80 | * @param pUuid Uuid to convert.
|
---|
| 81 | * @param pszString Where to store result string.
|
---|
| 82 | * @param cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
|
---|
| 83 | */
|
---|
[204] | 84 | RTDECL(int) RTUuidToStr(PCRTUUID pUuid, char *pszString, unsigned cchString);
|
---|
[1] | 85 |
|
---|
| 86 | /**
|
---|
| 87 | * Converts UUID from its string representation to binary format.
|
---|
| 88 | *
|
---|
| 89 | * @returns iprt status code.
|
---|
| 90 | * @param pUuid Where to store result Uuid.
|
---|
| 91 | * @param pszString String with UUID text data.
|
---|
| 92 | */
|
---|
[204] | 93 | RTDECL(int) RTUuidFromStr(PRTUUID pUuid, const char *pszString);
|
---|
[1] | 94 |
|
---|
| 95 | /** @} */
|
---|
| 96 |
|
---|
| 97 | __END_DECLS
|
---|
| 98 |
|
---|
| 99 | #endif
|
---|
| 100 |
|
---|