summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-03-28 23:59:20 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-03-28 23:59:20 +0000
commita1c94fece82f2445e538de0c93345d34c4abdf17 (patch)
tree5e1f771efae1c221db8ecc3efaa4eb00632e19d8 /include
parent71206544a770eb4004294ed13613a7cde6e0e056 (diff)
Add uuid wrapper API call ast_uuid_generate_str().
* Updated test_uuid.c to test the new API call. * Made system use the new API call to eliminate "10's of lines" where used. * Fixed untested ast_strdup() return in stasis_subscribe() by eliminating the need for it. struct stasis_subscription now contains the uniqueid[] string. * Fixed some issues in exchangecal_write_event(): Create uid with enough space for a UUID string to avoid a realloc. Fix off by one error if the calendar event provided a UUID string. There is no need to check for NULL before calling ast_free(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/uuid.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/asterisk/uuid.h b/include/asterisk/uuid.h
index c10268d8c..223ad18c9 100644
--- a/include/asterisk/uuid.h
+++ b/include/asterisk/uuid.h
@@ -24,7 +24,7 @@
#define _ASTERISK_UUID_H
/* Size of an RFC 4122 UUID string plus terminating null byte */
-#define AST_UUID_STR_LEN 37
+#define AST_UUID_STR_LEN (36 + 1)
struct ast_uuid;
@@ -50,11 +50,22 @@ struct ast_uuid *ast_uuid_generate(void);
* \param uuid The UUID to convert to a string
* \param[out] buf The buffer where the UUID string will be stored
* \param size The size of the buffer. Must be at least AST_UUID_STR_LEN.
- * \returns The UUID string (a pointer to buf)
+ * \return The UUID string (a pointer to buf)
*/
char *ast_uuid_to_str(const struct ast_uuid *uuid, char *buf, size_t size);
/*!
+ * \brief Generate a UUID string.
+ * \since 12.0.0
+ *
+ * \param buf The buffer where the UUID string will be stored
+ * \param size The size of the buffer. Must be at least AST_UUID_STR_LEN.
+ *
+ * \return The UUID string (a pointer to buf)
+ */
+char *ast_uuid_generate_str(char *buf, size_t size);
+
+/*!
* \brief Convert a string to a UUID
*
* This function allocates memory on the heap. The returned