1 | /** @file
|
---|
2 | *
|
---|
3 | * innotek Portable Runtime - Universal Unique Identifiers (UUID).
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __iprt_uuid_h__
|
---|
23 | #define __iprt_uuid_h__
|
---|
24 |
|
---|
25 | #include <iprt/cdefs.h>
|
---|
26 | #include <iprt/types.h>
|
---|
27 |
|
---|
28 | __BEGIN_DECLS
|
---|
29 |
|
---|
30 | /** @defgroup grp_rt_uuid RTUuid - Universally Unique Identifiers
|
---|
31 | * @ingroup grp_rt
|
---|
32 | * @{
|
---|
33 | */
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * Generates new UUID value.
|
---|
37 | *
|
---|
38 | * @returns iprt status code.
|
---|
39 | * @param pUuid Where to store generated uuid.
|
---|
40 | */
|
---|
41 | RTDECL(int) RTUuidCreate(PRTUUID pUuid);
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Makes null UUID value.
|
---|
45 | *
|
---|
46 | * @returns iprt status code.
|
---|
47 | * @param pUuid Where to store generated null uuid.
|
---|
48 | */
|
---|
49 | RTDECL(int) RTUuidClear(PRTUUID pUuid);
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Checks if UUID is null.
|
---|
53 | *
|
---|
54 | * @returns true if UUID is null.
|
---|
55 | * @param pUuid uuid to check.
|
---|
56 | */
|
---|
57 | RTDECL(int) RTUuidIsNull(PCRTUUID pUuid);
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * Compares two UUID values.
|
---|
61 | *
|
---|
62 | * @returns 0 if eq, < 0 or > 0.
|
---|
63 | * @param pUuid1 First value to compare.
|
---|
64 | * @param pUuid2 Second value to compare.
|
---|
65 | */
|
---|
66 | RTDECL(int) RTUuidCompare(PCRTUUID pUuid1, PCRTUUID pUuid2);
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * Converts binary UUID to its string representation.
|
---|
70 | *
|
---|
71 | * @returns iprt status code.
|
---|
72 | * @param pUuid Uuid to convert.
|
---|
73 | * @param pszString Where to store result string.
|
---|
74 | * @param cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
|
---|
75 | */
|
---|
76 | RTDECL(int) RTUuidToStr(PCRTUUID pUuid, char *pszString, unsigned cchString);
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * Converts UUID from its string representation to binary format.
|
---|
80 | *
|
---|
81 | * @returns iprt status code.
|
---|
82 | * @param pUuid Where to store result Uuid.
|
---|
83 | * @param pszString String with UUID text data.
|
---|
84 | */
|
---|
85 | RTDECL(int) RTUuidFromStr(PRTUUID pUuid, const char *pszString);
|
---|
86 |
|
---|
87 | /** @} */
|
---|
88 |
|
---|
89 | __END_DECLS
|
---|
90 |
|
---|
91 | #endif
|
---|
92 |
|
---|