ir: move writer-specific declarations to writer header
[babeltrace.git] / include / babeltrace / ctf-ir / event.h
index 4b061d62f4eebb214a95c1f8c30befacee6f47c3..f2e809e98fbc9ad5f49cd8f778d817b90339542c 100644 (file)
@@ -43,6 +43,7 @@ struct bt_ctf_event;
 struct bt_ctf_field;
 struct bt_ctf_field_type;
 struct bt_ctf_stream_class;
+struct bt_ctf_packet;
 
 /*
  * bt_ctf_event_create: instanciate an event.
@@ -220,36 +221,42 @@ extern int bt_ctf_event_set_event_context(struct bt_ctf_event *event,
                struct bt_ctf_field *context);
 
 /*
- * bt_ctf_event_copy: Deep-copy an event.
+ * bt_ctf_event_get_stream_event_context: Get an event's stream event context
  *
- * Get an event's deep copy.
+ * @param event_class Event class.
  *
- * On success, the returned copy has its reference count set to 1.
+ * Returns a field on success (a structure), NULL on error.
+ */
+extern struct bt_ctf_field *bt_ctf_event_get_stream_event_context(
+               struct bt_ctf_event *event);
+
+/*
+ * bt_ctf_event_set_stream_event_context: Set an event's stream event context
  *
- * @param event Event to copy.
+ * @param event Event.
+ * @param context Event stream context field (must match the stream class'
+ *     stream event context type).
  *
- * Returns the deep-copied event on success, NULL on error.
+ * Returns 0 on success, a negative value on error.
  */
-extern struct bt_ctf_event *bt_ctf_event_copy(struct bt_ctf_event *event);
+extern int bt_ctf_event_set_stream_event_context(struct bt_ctf_event *event,
+               struct bt_ctf_field *context);
 
 /*
- * bt_ctf_event_get and bt_ctf_event_put: increment and decrement
- * the event's reference count.
+ * bt_ctf_event_copy: Deep-copy an event.
  *
- * You may also use bt_ctf_get() and bt_ctf_put() with event objects.
+ * Get an event's deep copy.
  *
- * These functions ensure that the event won't be destroyed while it
- * is in use. The same number of get and put (plus one extra put to
- * release the initial reference done at creation) have to be done to
- * destroy an event.
+ * On success, the returned copy has its reference count set to 1.
  *
- * When the event's reference count is decremented to 0 by a
- * bt_ctf_event_put, the event is freed.
+ * @param event Event to copy.
  *
- * @param event Event instance.
+ * Returns the deep-copied event on success, NULL on error.
  */
-extern void bt_ctf_event_get(struct bt_ctf_event *event);
-extern void bt_ctf_event_put(struct bt_ctf_event *event);
+extern struct bt_ctf_event *bt_ctf_event_copy(struct bt_ctf_event *event);
+
+extern int bt_ctf_event_set_packet(struct bt_ctf_event *event,
+               struct bt_ctf_packet *packet);
 
 #ifdef __cplusplus
 }
This page took 0.027783 seconds and 4 git commands to generate.