cpp-common: add `begin()` and `end()` to Variant and Struct FC
[babeltrace.git] / src / common / uuid.c
index d59f750ca0bab0a2aabac414b7c9c462db30d4a5..5c709f73e2eca890550b5f8666327323fbdad3bf 100644 (file)
@@ -1,23 +1,7 @@
 /*
- * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * SPDX-License-Identifier: MIT
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
  */
 
 #include <glib.h>
@@ -32,7 +16,6 @@
 /*
  * Generate a random UUID according to RFC4122, section 4.4.
  */
-BT_HIDDEN
 void bt_uuid_generate(bt_uuid_t uuid_out)
 {
        int i;
@@ -67,16 +50,14 @@ void bt_uuid_generate(bt_uuid_t uuid_out)
        g_rand_free(rand);
 }
 
-BT_HIDDEN
 void bt_uuid_to_str(const bt_uuid_t uuid_in, char *str_out)
 {
        BT_ASSERT_DBG(uuid_in);
        BT_ASSERT_DBG(str_out);
 
-       sprintf(str_out, BT_UUID_FMT, BT_UUID_FMT_VALUES(uuid_in));
+       snprintf(str_out, BT_UUID_STR_LEN + 1, BT_UUID_FMT, BT_UUID_FMT_VALUES(uuid_in));
 }
 
-BT_HIDDEN
 int bt_uuid_from_str(const char *str_in, bt_uuid_t uuid_out)
 {
        int ret = 0;
@@ -100,13 +81,11 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int bt_uuid_compare(const bt_uuid_t uuid_a, const bt_uuid_t uuid_b)
 {
        return memcmp(uuid_a, uuid_b, BT_UUID_LEN);
 }
 
-BT_HIDDEN
 void bt_uuid_copy(bt_uuid_t uuid_dest, const bt_uuid_t uuid_src)
 {
        BT_ASSERT(uuid_dest);
This page took 0.024212 seconds and 4 git commands to generate.