1#ifndef AWS_COMMON_UUID_H
2#define AWS_COMMON_UUID_H
3
4/*
5 * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License").
8 * You may not use this file except in compliance with the License.
9 * A copy of the License is located at
10 *
11 * http://aws.amazon.com/apache2.0
12 *
13 * or in the "license" file accompanying this file. This file is distributed
14 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
15 * express or implied. See the License for the specific language governing
16 * permissions and limitations under the License.
17 */
18#include <aws/common/common.h>
19
20struct aws_byte_cursor;
21struct aws_byte_buf;
22
23struct aws_uuid {
24 uint8_t uuid_data[16];
25};
26
27/* 36 bytes for the UUID plus one more for the null terminator. */
28#define AWS_UUID_STR_LEN 37
29
30AWS_EXTERN_C_BEGIN
31
32AWS_COMMON_API int aws_uuid_init(struct aws_uuid *uuid);
33AWS_COMMON_API int aws_uuid_init_from_str(struct aws_uuid *uuid, const struct aws_byte_cursor *uuid_str);
34AWS_COMMON_API int aws_uuid_to_str(const struct aws_uuid *uuid, struct aws_byte_buf *output);
35AWS_COMMON_API bool aws_uuid_equals(const struct aws_uuid *a, const struct aws_uuid *b);
36
37AWS_EXTERN_C_END
38
39#endif /* AWS_COMMON_UUID_H */
40