2 * innotek Portable Runtime - Universal Unique Identifiers (UUID).
6 * Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 #ifndef ___iprt_uuid_h
18 #define ___iprt_uuid_h
25 /** @defgroup grp_rt_uuid RTUuid - Universally Unique Identifiers
31 * Generates new UUID value.
33 * @returns iprt status code.
34 * @param pUuid Where to store generated uuid.
36 int RTUuidCreate(PRTUUID pUuid
);
39 * Makes null UUID value.
41 * @returns iprt status code.
42 * @param pUuid Where to store generated null uuid.
44 int RTUuidClear(PRTUUID pUuid
);
47 * Checks if UUID is null.
49 * @returns true if UUID is null.
50 * @param pUuid uuid to check.
52 int RTUuidIsNull(PCRTUUID pUuid
);
55 * Compares two UUID values.
57 * @returns 0 if eq, < 0 or > 0.
58 * @param pUuid1 First value to compare.
59 * @param pUuid2 Second value to compare.
61 int RTUuidCompare(PCRTUUID pUuid1
, PCRTUUID pUuid2
);
64 * Converts binary UUID to its string representation.
66 * @returns iprt status code.
67 * @param pUuid Uuid to convert.
68 * @param pszString Where to store result string.
69 * @param cchString pszString buffer length, must be >= RTUUID_STR_LENGTH.
71 int RTUuidToStr(PCRTUUID pUuid
, char *pszString
, unsigned cchString
);
74 * Converts UUID from its string representation to binary format.
76 * @returns iprt status code.
77 * @param pUuid Where to store result Uuid.
78 * @param pszString String with UUID text data.
80 int RTUuidFromStr(PRTUUID pUuid
, const char *pszString
);