Add support for floating point fields in the Python bindings
[babeltrace.git] / formats / ctf / events.c
index af376a4412b8c8b0c807cf432748302cda5301a8..15d5a7dcde0147205a585baff63e7422cd596c20 100644 (file)
@@ -608,6 +608,19 @@ char *bt_ctf_get_string(const struct bt_definition *field)
        return ret;
 }
 
+double bt_ctf_get_float(const struct bt_definition *field)
+{
+       double ret = 0.0;
+
+       if (field && bt_ctf_field_type(bt_ctf_get_decl_from_def(field)) == CTF_TYPE_FLOAT) {
+               ret = bt_get_float(field);
+       } else {
+               bt_ctf_field_set_error(-EINVAL);
+       }
+
+       return ret;
+}
+
 int bt_ctf_get_event_decl_list(int handle_id, struct bt_context *ctx,
                struct bt_ctf_event_decl * const **list,
                unsigned int *count)
This page took 0.0237 seconds and 4 git commands to generate.