Python bindings: Add UUID accessors to the Clock class
[babeltrace.git] / bindings / python / python-complements.c
index 55312fff8a1fe444255f182c6b026a2c00b957c7..872512d6848a44d4fa5e24bab8bb8f08f7e6de6e 100644 (file)
@@ -23,6 +23,7 @@
 #include <babeltrace/ctf-ir/event-fields-internal.h>
 #include <babeltrace/ctf-ir/event-types.h>
 #include <babeltrace/ctf-ir/event.h>
+#include <babeltrace/ctf-ir/clock-internal.h>
 
 /* List-related functions
    ----------------------------------------------------
@@ -342,3 +343,39 @@ struct bt_ctf_field_type *_bt_python_ctf_event_class_get_field_type(
        return !ret ? type : NULL;
 }
 
+int _bt_python_ctf_clock_get_uuid_index(struct bt_ctf_clock *clock,
+               size_t index, unsigned char *value)
+{
+       int ret = 0;
+       const unsigned char *uuid;
+
+       if (index >= 16) {
+               ret = -1;
+               goto end;
+       }
+
+       uuid = bt_ctf_clock_get_uuid(clock);
+       if (!uuid) {
+               ret = -1;
+               goto end;
+       }
+
+       *value = uuid[index];
+end:
+       return ret;
+}
+
+int _bt_python_ctf_clock_set_uuid_index(struct bt_ctf_clock *clock,
+               size_t index, unsigned char value)
+{
+       int ret = 0;
+
+       if (index >= 16) {
+               ret = -1;
+               goto end;
+       }
+
+       clock->uuid[index] = value;
+end:
+       return ret;
+}
This page took 0.023977 seconds and 4 git commands to generate.