Asterisk - The Open Source Telephony Project
21.4.1
|
Universally unique identifier support. More...
Go to the source code of this file.
Macros | |
#define | AST_UUID_STR_LEN (36 + 1) |
Functions | |
struct ast_uuid * | ast_str_to_uuid (char *str) |
Convert a string to a UUID. More... | |
void | ast_uuid_clear (struct ast_uuid *uuid) |
Clear a UUID by setting it to be a nil UUID (all 0s) More... | |
int | ast_uuid_compare (struct ast_uuid *left, struct ast_uuid *right) |
Compare two UUIDs. More... | |
struct ast_uuid * | ast_uuid_copy (struct ast_uuid *src) |
Make a copy of a UUID. More... | |
struct ast_uuid * | ast_uuid_generate (void) |
Generate a UUID. More... | |
char * | ast_uuid_generate_str (char *buf, size_t size) |
Generate a UUID string. More... | |
void | ast_uuid_init (void) |
Initialize the UUID system. | |
int | ast_uuid_is_nil (struct ast_uuid *uuid) |
Check if a UUID is a nil UUID (all 0s) More... | |
char * | ast_uuid_to_str (struct ast_uuid *uuid, char *buf, size_t size) |
Convert a UUID to a string. More... | |
Universally unique identifier support.
Definition in file uuid.h.
struct ast_uuid* ast_str_to_uuid | ( | char * | str | ) |
Convert a string to a UUID.
This function allocates memory on the heap. The returned pointer must be freed using ast_free()
str | The string to convert to a UUID |
NULL | Failed to convert |
non-NULL | The heap-allocated converted UUID |
Definition at line 149 of file uuid.c.
References ast_malloc.
void ast_uuid_clear | ( | struct ast_uuid * | uuid | ) |
Compare two UUIDs.
left | First UUID to compare |
right | Second UUID to compare |
<0 | left is lexicographically less than right |
0 | left and right are the same |
>0 | left is lexicographically greater than right |
Make a copy of a UUID.
This function allocates memory on the heap. The returned pointer must be freed using ast_free()
src | The source UUID to copy |
NULL | Failed to copy |
non-NULL | The heap-allocated duplicate UUID |
Definition at line 166 of file uuid.c.
References ast_malloc.
struct ast_uuid* ast_uuid_generate | ( | void | ) |
Generate a UUID.
This function allocates memory on the heap. The returned pointer must be freed using ast_free()
NULL | Generation failed |
non-NULL | heap-allocated UUID |
Definition at line 123 of file uuid.c.
References ast_malloc.
char* ast_uuid_generate_str | ( | char * | buf, |
size_t | size | ||
) |
Generate a UUID string.
buf | The buffer where the UUID string will be stored |
size | The size of the buffer. Must be at least AST_UUID_STR_LEN. |
Definition at line 141 of file uuid.c.
References ast_uuid_to_str().
Referenced by ast_aeap_message_id_generate(), ast_datastores_alloc_datastore(), ast_rtp_new(), ast_sorcery_alloc(), and bridge_base_init().
int ast_uuid_is_nil | ( | struct ast_uuid * | uuid | ) |
char* ast_uuid_to_str | ( | struct ast_uuid * | uuid, |
char * | buf, | ||
size_t | size | ||
) |
Convert a UUID to a string.
uuid | The UUID to convert to a string | |
[out] | buf | The buffer where the UUID string will be stored |
size | The size of the buffer. Must be at least AST_UUID_STR_LEN. |
Definition at line 134 of file uuid.c.
References ast_str_to_lower().
Referenced by ast_uuid_generate_str().