1 | /** @file
|
---|
2 | * innotek Portable Runtime - Universal Unique Identifiers (UUID).
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
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
|
---|
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.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___iprt_uuid_h
|
---|
27 | #define ___iprt_uuid_h
|
---|
28 |
|
---|
29 | #include <iprt/cdefs.h>
|
---|
30 | #include <iprt/types.h>
|
---|
31 |
|
---|
32 | __BEGIN_DECLS
|
---|
33 |
|
---|
34 | /** @defgroup grp_rt_uuid RTUuid - Universally Unique Identifiers
|
---|
35 | * @ingroup grp_rt
|
---|
36 | * @{
|
---|
37 | */
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Generates new UUID value.
|
---|
41 | *
|
---|
42 | * @returns iprt status code.
|
---|
43 | * @param pUuid Where to store generated uuid.
|
---|
44 | */
|
---|
45 | RTDECL(int) RTUuidCreate(PRTUUID pUuid);
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Makes null UUID value.
|
---|
49 | *
|
---|
50 | * @returns iprt status code.
|
---|
51 | * @param pUuid Where to store generated null uuid.
|
---|
52 | */
|
---|
53 | RTDECL(int) RTUuidClear(PRTUUID pUuid);
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * Checks if UUID is null.
|
---|
57 | *
|
---|
58 | * @returns true if UUID is null.
|
---|
59 | * @param pUuid uuid to check.
|
---|
60 | */
|
---|
61 | RTDECL(int) RTUuidIsNull(PCRTUUID pUuid);
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Compares two UUID values.
|
---|
65 | *
|
---|
66 | * @returns 0 if eq, < 0 or > 0.
|
---|
67 | * @param pUuid1 First value to compare.
|
---|
68 | * @param pUuid2 Second value to compare.
|
---|
69 | */
|
---|
70 | RTDECL(int) RTUuidCompare(PCRTUUID pUuid1, PCRTUUID pUuid2);
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * Converts binary UUID to its string representation.
|
---|
74 | *
|
---|
75 | * @returns iprt status code.
|
---|
76 | * @param pUuid Uuid to convert.
|
---|
77 | * @param pszString Where to store result string.
|
---|
78 | * @param cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
|
---|
79 | */
|
---|
80 | RTDECL(int) RTUuidToStr(PCRTUUID pUuid, char *pszString, unsigned cchString);
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Converts UUID from its string representation to binary format.
|
---|
84 | *
|
---|
85 | * @returns iprt status code.
|
---|
86 | * @param pUuid Where to store result Uuid.
|
---|
87 | * @param pszString String with UUID text data.
|
---|
88 | */
|
---|
89 | RTDECL(int) RTUuidFromStr(PRTUUID pUuid, const char *pszString);
|
---|
90 |
|
---|
91 | /** @} */
|
---|
92 |
|
---|
93 | __END_DECLS
|
---|
94 |
|
---|
95 | #endif
|
---|
96 |
|
---|