ctf plugin: add bt_ctf_notif_iter_get_packet_header_context_fields()
[babeltrace.git] / plugins / ctf / common / notif-iter / notif-iter.h
index fd56575a2cc915411b43f6b017a3d35ce4c3a111..23277754a759b0d863bef1726a34757adb9572a0 100644 (file)
@@ -32,6 +32,7 @@
 #include <babeltrace/ctf-ir/trace.h>
 #include <babeltrace/ctf-ir/fields.h>
 #include <babeltrace/ctf-ir/event.h>
+#include <babeltrace/graph/clock-class-priority-map.h>
 #include <babeltrace/babeltrace-internal.h>
 
 /**
@@ -67,7 +68,7 @@ enum bt_ctf_notif_iter_medium_status {
        BT_CTF_NOTIF_ITER_MEDIUM_STATUS_ERROR = -1,
 
        /** Everything okay. */
-       BT_CTF_NOTIF_ITER_MEDIUM_STATUS_OK =            0,
+       BT_CTF_NOTIF_ITER_MEDIUM_STATUS_OK =    0,
 };
 
 /**
@@ -80,7 +81,7 @@ enum bt_ctf_notif_iter_status {
         * The medium function called by the notification iterator
         * function reached the end of the file.
         */
-       BT_CTF_NOTIF_ITER_STATUS_EOF =  -4,
+       BT_CTF_NOTIF_ITER_STATUS_EOF = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_EOF,
 
        /**
         * There is no data available right now, try again later.
@@ -91,13 +92,13 @@ enum bt_ctf_notif_iter_status {
         * last called notification iterator function once the situation
         * is resolved.
         */
-       BT_CTF_NOTIF_ITER_STATUS_AGAIN =        -3,
+       BT_CTF_NOTIF_ITER_STATUS_AGAIN = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_AGAIN,
 
        /** Invalid argument. */
-       BT_CTF_NOTIF_ITER_STATUS_INVAL =        -2,
+       BT_CTF_NOTIF_ITER_STATUS_INVAL = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_INVAL,
 
        /** General error. */
-       BT_CTF_NOTIF_ITER_STATUS_ERROR =        -1,
+       BT_CTF_NOTIF_ITER_STATUS_ERROR = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_ERROR,
 
        /** Everything okay. */
        BT_CTF_NOTIF_ITER_STATUS_OK =   0,
@@ -271,6 +272,8 @@ void bt_ctf_notif_iter_destroy(struct bt_ctf_notif_iter *notif_iter);
  * call this function again, until another status is returned.
  *
  * @param notif_iter           CTF notification iterator
+ * @param cc_prio_map          Clock class priority map to use when
+ *                             creating an event notification
  * @param notification         Returned notification if the function's
  *                             return value is #BT_CTF_NOTIF_ITER_STATUS_OK
  * @returns                    One of #bt_ctf_notif_iter_status values
@@ -278,6 +281,25 @@ void bt_ctf_notif_iter_destroy(struct bt_ctf_notif_iter *notif_iter);
 BT_HIDDEN
 enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
                struct bt_ctf_notif_iter *notit,
+               struct bt_clock_class_priority_map *cc_prio_map,
                struct bt_notification **notification);
 
+/**
+ * Returns the first packet header and context fields. This function
+ * never needs to call the `get_stream()` medium operation because
+ * it does not create packet or event objects.
+ *
+ * @param notif_iter           CTF notification iterator
+ * @param packet_header_field  Packet header field (\c NULL if there's
+ *                             no packet header field)
+ * @param packet_context_field Packet context field (\c NULL if there's
+ *                             no packet context field)
+ * @returns                    One of #bt_ctf_notif_iter_status values
+ */
+BT_HIDDEN
+enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_packet_header_context_fields(
+               struct bt_ctf_notif_iter *notit,
+               struct bt_ctf_field **packet_header_field,
+               struct bt_ctf_field **packet_context_field);
+
 #endif /* CTF_NOTIF_ITER_H */
This page took 0.030796 seconds and 4 git commands to generate.