Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
c-utility/inc/azure_c_shared_utility/uuid.h@0:f7f1f0d76dd6, 2018-08-23 (annotated)
- Committer:
- XinZhangMS
- Date:
- Thu Aug 23 06:52:14 2018 +0000
- Revision:
- 0:f7f1f0d76dd6
azure-c-sdk for mbed os supporting NUCLEO_F767ZI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
XinZhangMS | 0:f7f1f0d76dd6 | 1 | // Copyright (c) Microsoft. All rights reserved. |
XinZhangMS | 0:f7f1f0d76dd6 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
XinZhangMS | 0:f7f1f0d76dd6 | 3 | |
XinZhangMS | 0:f7f1f0d76dd6 | 4 | #ifndef UUID_H |
XinZhangMS | 0:f7f1f0d76dd6 | 5 | #define UUID_H |
XinZhangMS | 0:f7f1f0d76dd6 | 6 | |
XinZhangMS | 0:f7f1f0d76dd6 | 7 | #ifdef __cplusplus |
XinZhangMS | 0:f7f1f0d76dd6 | 8 | #include <cstddef> |
XinZhangMS | 0:f7f1f0d76dd6 | 9 | #include <cstdint> |
XinZhangMS | 0:f7f1f0d76dd6 | 10 | extern "C" { |
XinZhangMS | 0:f7f1f0d76dd6 | 11 | #else |
XinZhangMS | 0:f7f1f0d76dd6 | 12 | #include <stddef.h> |
XinZhangMS | 0:f7f1f0d76dd6 | 13 | #include <stdint.h> |
XinZhangMS | 0:f7f1f0d76dd6 | 14 | #include <stdbool.h> |
XinZhangMS | 0:f7f1f0d76dd6 | 15 | #endif /* __cplusplus */ |
XinZhangMS | 0:f7f1f0d76dd6 | 16 | |
XinZhangMS | 0:f7f1f0d76dd6 | 17 | #include "azure_c_shared_utility/umock_c_prod.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 18 | |
XinZhangMS | 0:f7f1f0d76dd6 | 19 | typedef unsigned char UUID[16]; |
XinZhangMS | 0:f7f1f0d76dd6 | 20 | |
XinZhangMS | 0:f7f1f0d76dd6 | 21 | /* @brief Generates a true UUID |
XinZhangMS | 0:f7f1f0d76dd6 | 22 | * @param uuid A pre-allocated buffer for the bytes of the generated UUID |
XinZhangMS | 0:f7f1f0d76dd6 | 23 | * @returns Zero if no failures occur, non-zero otherwise. |
XinZhangMS | 0:f7f1f0d76dd6 | 24 | */ |
XinZhangMS | 0:f7f1f0d76dd6 | 25 | MOCKABLE_FUNCTION(, int, UUID_generate, UUID*, uuid); |
XinZhangMS | 0:f7f1f0d76dd6 | 26 | |
XinZhangMS | 0:f7f1f0d76dd6 | 27 | /* @brief Gets the UUID value (byte sequence) of an well-formed UUID string. |
XinZhangMS | 0:f7f1f0d76dd6 | 28 | * @param uuid_string A null-terminated well-formed UUID string (e.g., "7f907d75-5e13-44cf-a1a3-19a01a2b4528"). |
XinZhangMS | 0:f7f1f0d76dd6 | 29 | * @param uuid Sequence of bytes representing an UUID. |
XinZhangMS | 0:f7f1f0d76dd6 | 30 | * @returns Zero if no failures occur, non-zero otherwise. |
XinZhangMS | 0:f7f1f0d76dd6 | 31 | */ |
XinZhangMS | 0:f7f1f0d76dd6 | 32 | MOCKABLE_FUNCTION(, int, UUID_from_string, const char*, uuid_string, UUID*, uuid); |
XinZhangMS | 0:f7f1f0d76dd6 | 33 | |
XinZhangMS | 0:f7f1f0d76dd6 | 34 | /* @brief Gets the string representation of the UUID value. |
XinZhangMS | 0:f7f1f0d76dd6 | 35 | * @param uuid Sequence of bytes representing an UUID. |
XinZhangMS | 0:f7f1f0d76dd6 | 36 | * @returns A null-terminated string representation of the UUID value provided (e.g., "7f907d75-5e13-44cf-a1a3-19a01a2b4528"). |
XinZhangMS | 0:f7f1f0d76dd6 | 37 | */ |
XinZhangMS | 0:f7f1f0d76dd6 | 38 | MOCKABLE_FUNCTION(, char*, UUID_to_string, UUID*, uuid); |
XinZhangMS | 0:f7f1f0d76dd6 | 39 | |
XinZhangMS | 0:f7f1f0d76dd6 | 40 | #ifdef __cplusplus |
XinZhangMS | 0:f7f1f0d76dd6 | 41 | } |
XinZhangMS | 0:f7f1f0d76dd6 | 42 | #endif |
XinZhangMS | 0:f7f1f0d76dd6 | 43 | |
XinZhangMS | 0:f7f1f0d76dd6 | 44 | #endif /* UUID_H */ |