ir: add public bt_ctf_field_path object
[babeltrace.git] / include / babeltrace / ctf-ir / event-types.h
index 059a5b84b821a3a1a3faa5ec34475d2a5da137a1..2bffe88ab879e450f2dbb57e12f17281e87f6630 100644 (file)
@@ -41,6 +41,7 @@ struct bt_ctf_event_class;
 struct bt_ctf_event;
 struct bt_ctf_field_type;
 struct bt_ctf_field;
+struct bt_ctf_field_path;
 
 enum bt_ctf_integer_base {
        BT_CTF_INTEGER_BASE_UNKNOWN = -1,
@@ -63,6 +64,17 @@ enum bt_ctf_byte_order {
        BT_CTF_BYTE_ORDER_NETWORK,
 };
 
+enum bt_ctf_node {
+       CTF_NODE_UNKNOWN = -1,
+       CTF_NODE_ENV = 0,
+       CTF_NODE_TRACE_PACKET_HEADER = 1,
+       CTF_NODE_STREAM_PACKET_CONTEXT = 2,
+       CTF_NODE_STREAM_EVENT_HEADER = 3,
+       CTF_NODE_STREAM_EVENT_CONTEXT = 4,
+       CTF_NODE_EVENT_CONTEXT = 5,
+       CTF_NODE_EVENT_FIELDS = 6,
+};
+
 /*
  * bt_ctf_field_type_integer_create: create an integer field type.
  *
@@ -741,6 +753,49 @@ extern enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
 extern int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type,
                enum bt_ctf_byte_order byte_order);
 
+/*
+ * bt_ctf_field_type_variant_get_tag_field_path: get a variant's tag's field
+ *     path.
+ *
+ * Get the variant's tag's field path.
+ *
+ * @param type Field type.
+ *
+ * Returns the field path on success, NULL on error or if no field path is set.
+ */
+extern struct bt_ctf_field_path *bt_ctf_field_type_variant_get_tag_field_path(
+               struct bt_ctf_field_type *type);
+
+/*
+ * bt_ctf_field_type_sequence_get_length_field_path: get a sequence's length's
+ *     field path.
+ *
+ * Get the sequence's length's field path.
+ *
+ * @param type Field type.
+ *
+ * Returns the field path on success, NULL on error or if no field path is set.
+ */
+extern struct bt_ctf_field_path *bt_ctf_field_type_sequence_get_length_field_path(
+               struct bt_ctf_field_type *type);
+
+/*
+ * bt_ctf_field_type_compare: compare two field types recursively
+ *
+ * Compare two field types recursively.
+ *
+ * The registered tag field type of a variant field type is ignored:
+ * only the tag strings are compared.
+ *
+ * @param type_a Field type A.
+ * @param type_b Field type B.
+ *
+ * Returns 0 if both field types are semantically equivalent, a positive
+ * value if they are not equivalent, or a negative value on error.
+ */
+extern int bt_ctf_field_type_compare(struct bt_ctf_field_type *type_a,
+               struct bt_ctf_field_type *type_b);
+
 /*
  * bt_ctf_field_type_get_type_id: get a field type's ctf_type_id.
  *
This page took 0.025164 seconds and 4 git commands to generate.