lib: remove internal stream destroy listener API
[babeltrace.git] / include / babeltrace / ctf-ir / event-class.h
index 314260a5b2f3c0443ba0d793177f42a1da11b86d..12d78015c90be8297fecee8f3f46c4a5f58b492e 100644 (file)
  * http://www.efficios.com/ctf
  */
 
+/* For bt_get() */
+#include <babeltrace/ref.h>
+
 #include <stdint.h>
 #include <stddef.h>
-#include <babeltrace/values.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct bt_ctf_event_class;
-struct bt_ctf_field;
-struct bt_ctf_field_type;
-struct bt_ctf_stream_class;
+struct bt_value;
 
-/*
- * bt_ctf_event_class_create: create an event class.
- *
- * Allocate a new event class of the given name. The creation of an event class
- * sets its reference count to 1. A unique event id is automatically assigned
- * to the event class.
- *
- * @param name Event class name (will be copied).
- *
- * Returns an allocated event class on success, NULL on error.
- */
-extern struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name);
+/**
+@defgroup ctfireventclass CTF IR event class
+@ingroup ctfir
+@brief CTF IR event class.
 
-/*
- * bt_ctf_event_class_get_name: Get an event class' name.
- *
- * @param event_class Event class.
- *
- * Returns the event class' name, NULL on error.
- */
-extern const char *bt_ctf_event_class_get_name(
-               struct bt_ctf_event_class *event_class);
+@code
+#include <babeltrace/ctf-ir/event-class.h>
+@endcode
 
-/*
- * bt_ctf_event_class_get_id: Get an event class' id.
- *
- * @param event_class Event class.
- *
- * Returns the event class' id, a negative value on error.
- */
-extern int64_t bt_ctf_event_class_get_id(
-               struct bt_ctf_event_class *event_class);
+A CTF IR <strong><em>event class</em></strong> is a template that you
+can use to create concrete \link ctfirevent CTF IR events\endlink.
 
-/*
- * bt_ctf_event_class_set_id: Set an event class' id.
- *
- * Set an event class' id. Must be unique stream-wise.
- * Note that event classes are already assigned a unique id when added to a
- * stream class if none was set explicitly.
- *
- * @param event_class Event class.
- * @param id Event class id.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_event_class_set_id(
-               struct bt_ctf_event_class *event_class, uint32_t id);
+An event class has the following properties:
 
-/*
- * bt_ctf_event_class_set_attribute: sets an attribute to the event
- *     class.
- *
- * Sets an attribute to the event class. The name parameter is copied,
- * whereas the value parameter's reference count is incremented
- * (if the function succeeds).
- *
- * If an attribute exists in the event class for the specified name, it
- * is replaced by the new value.
- *
- * Valid attributes and object types are:
- *
- *   - "id":            integer object with a value >= 0
- *   - "name":          string object
- *   - "loglevel":      integer object with a value >= 0
- *   - "model.emf.uri": string object
- *
- * @param event_class Event class.
- * @param name Name of the attribute (will be copied).
- * @param value Value of the attribute.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_event_class_set_attribute(
-               struct bt_ctf_event_class *event_class, const char *name,
-               struct bt_value *value);
+- A \b name.
+- A numeric \b ID (\em must be unique amongst all the event classes
+  contained in the same
+  \link ctfirstreamclass CTF IR stream class\endlink).
+- A optional <strong>log level</strong>.
+- An optional <strong>Eclipse Modeling Framework URI</strong>.
 
-/*
- * bt_ctf_event_class_get_attribute_count: get the number of attributes
- *     in this event class.
- *
- * Get the event class' attribute count.
- *
- * @param event_class Event class.
- *
- * Returns the attribute count, a negative value on error.
- */
-extern int bt_ctf_event_class_get_attribute_count(
-               struct bt_ctf_event_class *event_class);
+A CTF IR event class owns two
+\link ctfirfieldtypes field types\endlink:
 
-/*
- * bt_ctf_event_class_get_attribute_name: get attribute name.
- *
- * Get an attribute's name. The string's ownership is not
- * transferred to the caller. The string data is valid as long as
- * this event class' attributes are not modified.
- *
- * @param event_class Event class.
- * @param index Index of the attribute.
- *
- * Returns the attribute's name, NULL on error.
- */
-extern const char *
-bt_ctf_event_class_get_attribute_name(
-               struct bt_ctf_event_class *event_class, int index);
+- An optional <strong>event context</strong> field type, which
+  represents the \c event.context CTF scope.
+- A mandatory <strong>event payload</strong> field type, which
+  represents the \c event.fields CTF scope.
 
-/*
- * bt_ctf_event_class_get_attribute_value: get attribute value (an object).
- *
- * Get an attribute's value (an object). The returned object's
- * reference count is incremented. When done with the object, the caller
- * must call bt_value_put() on it.
- *
- * @param event_class Event class.
- * @param index Index of the attribute.
- *
- * Returns the attribute's object value, NULL on error.
- */
-extern struct bt_value *
-bt_ctf_event_class_get_attribute_value(struct bt_ctf_event_class *event_class,
-               int index);
+Both field types \em must be structure field types as of
+Babeltrace \btversion.
+The event payload field type <em>must not</em> be empty.
 
-/*
- * bt_ctf_event_class_get_attribute_value_by_name: get attribute
- *     value (an object) by name.
- *
- * Get an attribute's value (an object) by its name. The returned object's
- * reference count is incremented. When done with the object, the caller
- * must call bt_value_put() on it.
- *
- * @param event_class Event class.
- * @param name Attribute's name
- *
- * Returns the attribute's object value, NULL on error.
- */
-extern struct bt_value *
-bt_ctf_event_class_get_attribute_value_by_name(
-               struct bt_ctf_event_class *event_class, const char *name);
+As a reminder, here's the structure of a CTF packet:
 
-/*
- * bt_ctf_event_class_get_stream_class: Get an event class' stream class.
- *
- * @param event_class Event class.
- *
- * Returns the event class' stream class, NULL on error or if the event class
- * is not associated with a stream class.
- */
-extern struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class(
-               struct bt_ctf_event_class *event_class);
+@imgpacketstructure
 
-/*
- * bt_ctf_event_class_get_payload_type: get an event class' payload.
- *
- * Get an event class' payload type.
- *
- * @param event_class Event class.
- *
- * Returns the event class' payload, NULL on error.
- */
-extern struct bt_ctf_field_type *bt_ctf_event_class_get_payload_type(
-               struct bt_ctf_event_class *event_class);
+In the Babeltrace CTF IR system, a \link ctfirtraceclass trace
+class\endlink contains zero or more \link ctfirstreamclass stream
+classes\endlink, and a stream class contains zero or more event classes.
 
-/*
- * bt_ctf_event_class_set_payload_type: set an event class' payload.
- *
- * Set an event class' payload type.
- *
- * @param event_class Event class.
- * @param payload The payload's type (must be a structure).
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_event_class_set_payload_type(
-               struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *payload);
+Before you can create an event from an event class with
+bt_event_create(), you \em must add the prepared event class to a
+stream class by calling bt_stream_class_add_event_class(). This
+function, when successful, \em freezes the event class, disallowing any
+future modification of its properties and field types by the user.
 
-/*
- * bt_ctf_event_class_add_field: add a field to an event class.
- *
- * Add a field of type "type" to the event class. The event class will share
- * type's ownership by increasing its reference count. The "name" will be
- * copied.
- *
- * @param event_class Event class.
- * @param type Field type to add to the event class.
- * @param name Name of the new field.
- *
- * Returns 0 on success, a negative value on error.
- *
- * Note: Returns an error if the payload is not a structure.
- */
-extern int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *type,
-               const char *name);
+As with any Babeltrace object, CTF IR event class objects have
+<a href="https://en.wikipedia.org/wiki/Reference_counting">reference
+counts</a>. See \ref refs to learn more about the reference counting
+management of Babeltrace objects.
 
-/*
- * bt_ctf_event_class_get_field_count: Get an event class' field count.
- *
- * @param event_class Event class.
- *
- * Returns the event class' field count, a negative value on error.
- *
- * Note: Returns an error if the payload is not a structure.
- */
-extern int bt_ctf_event_class_get_field_count(
-               struct bt_ctf_event_class *event_class);
+bt_stream_class_add_event_class() \em freezes its event class
+parameter on success. You cannot modify a frozen event class: it is
+considered immutable, except for \link refs reference counting\endlink.
 
-/*
- * bt_ctf_event_class_get_field: Get event class' field type and name by index.
- *
- * @param event_class Event class.
- * @param field_name Pointer to a const char* where the field's name will
- *     be returned.
- * @param field_type Pointer to a bt_ctf_field_type* where the field's type will
- *     be returned.
- * @param index Index of field.
- *
- * Returns 0 on success, a negative error on value.
- *
- * Note: Returns an error if the payload is not a structure.
- */
-extern int bt_ctf_event_class_get_field(struct bt_ctf_event_class *event_class,
-               const char **field_name, struct bt_ctf_field_type **field_type,
-               int index);
+@sa ctfirevent
+@sa ctfirstreamclass
 
-/*
- * bt_ctf_event_class_get_field_type_by_name: Get an event class's field by name
- *
- * @param event_class Event class.
- * @param name Name of the field.
- *
- * Returns a field type on success, NULL on error.
- *
- * Note: Returns an error if the payload is not a structure.
- */
-extern struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name(
-               struct bt_ctf_event_class *event_class, const char *name);
+@file
+@brief CTF IR event class type and functions.
+@sa ctfireventclass
 
-/*
- * bt_ctf_event_class_get_context_type: Get an event class's context type
- *
- * @param event_class Event class.
- *
- * Returns a field type (a structure) on success, NULL on error.
- */
-extern struct bt_ctf_field_type *bt_ctf_event_class_get_context_type(
-               struct bt_ctf_event_class *event_class);
+@addtogroup ctfireventclass
+@{
+*/
 
-/*
- * bt_ctf_event_class_set_context_type: Set an event class's context type
- *
- * @param event_class Event class.
- * @param context Event context field type (must be a structure).
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_event_class_set_context_type(
-               struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *context);
+/**
+@struct bt_event_class
+@brief A CTF IR event class.
+@sa ctfireventclass
+*/
+struct bt_event_class;
+struct bt_field;
+struct bt_field_type;
+struct bt_stream_class;
+
+/**
+@brief Log level of an event class.
+*/
+enum bt_event_class_log_level {
+       /// Unknown, used for errors.
+       BT_EVENT_CLASS_LOG_LEVEL_UNKNOWN        = -1,
+
+       /// Unspecified log level.
+       BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED    = 255,
+
+       /// System is unusable.
+       BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY      = 0,
+
+       /// Action must be taken immediately.
+       BT_EVENT_CLASS_LOG_LEVEL_ALERT          = 1,
+
+       /// Critical conditions.
+       BT_EVENT_CLASS_LOG_LEVEL_CRITICAL       = 2,
+
+       /// Error conditions.
+       BT_EVENT_CLASS_LOG_LEVEL_ERROR          = 3,
+
+       /// Warning conditions.
+       BT_EVENT_CLASS_LOG_LEVEL_WARNING        = 4,
+
+       /// Normal, but significant, condition.
+       BT_EVENT_CLASS_LOG_LEVEL_NOTICE         = 5,
+
+       /// Informational message.
+       BT_EVENT_CLASS_LOG_LEVEL_INFO           = 6,
+
+       /// Debug information with system-level scope (set of programs).
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM   = 7,
+
+       /// Debug information with program-level scope (set of processes).
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM  = 8,
+
+       /// Debug information with process-level scope (set of modules).
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS  = 9,
+
+       /// Debug information with module (executable/library) scope (set of units).
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE   = 10,
+
+       /// Debug information with compilation unit scope (set of functions).
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT     = 11,
+
+       /// Debug information with function-level scope.
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION = 12,
+
+       /// Debug information with line-level scope (default log level).
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE     = 13,
+
+       /// Debug-level message.
+       BT_EVENT_CLASS_LOG_LEVEL_DEBUG          = 14,
+};
+
+/**
+@name Creation and parent access functions
+@{
+*/
+
+/**
+@brief Creates a default CTF IR event class named \p nameĀ­.
+
+On success, the context and payload field types are empty structure
+field types. You can modify those default field types after the
+event class is created with
+bt_event_class_set_context_field_type() and
+bt_event_class_set_payload_field_type().
+
+Upon creation, the event class's ID is <em>not set</em>. You
+can set it to a specific value with bt_event_class_set_id(). If it
+is still unset when you call bt_stream_class_add_event_class(), then
+the stream class assigns a unique ID to this event class before
+freezing it.
+
+The created event class's log level is initially set to
+#BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED and it has no Eclipse Modeling
+Framework URI.
+
+@param[in] name        Name of the event class to create (copied on success).
+@returns       Created event class, or \c NULL on error.
+
+@prenotnull{name}
+@postsuccessrefcountret1
+*/
+extern struct bt_event_class *bt_event_class_create(const char *name);
+
+extern struct bt_stream_class *bt_event_class_borrow_stream_class(
+               struct bt_event_class *event_class);
+
+/**
+@brief Returns the parent CTF IR stream class of the CTF IR event
+       class \p event_class.
+
+It is possible that the event class was not added to a stream class
+yet, in which case this function returns \c NULL. You can add an
+event class to a stream class with
+bt_stream_class_add_event_class().
+
+@param[in] event_class Event class of which to get the parent
+                       stream class.
+@returns               Parent stream class of \p event_class,
+                       or \c NULL if \p event_class was not
+                       added to a stream class yet or on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+@postsuccessrefcountretinc
+
+@sa bt_stream_class_add_event_class(): Add an event class to
+       a stream class.
+*/
+static inline
+struct bt_stream_class *bt_event_class_get_stream_class(
+               struct bt_event_class *event_class)
+{
+       return bt_get(bt_event_class_borrow_stream_class(event_class));
+}
+
+/** @} */
+
+/**
+@name Attribute functions
+@{
+*/
+
+/**
+@brief Returns the name of the CTF IR event class \p event_class.
+
+On success, \p event_class remains the sole owner of the returned
+string.
+
+@param[in] event_class Event class of which to get the name.
+@returns               Name of event class \p event_class, or
+                       \c NULL on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+*/
+extern const char *bt_event_class_get_name(
+               struct bt_event_class *event_class);
+
+/**
+@brief Returns the numeric ID of the CTF IR event class \p event_class.
+
+@param[in] event_class Event class of which to get the numeric ID.
+@returns               ID of event class \p event_class, or a
+                       negative value on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+
+@sa bt_event_class_set_id(): Sets the numeric ID of a given
+       event class.
+*/
+extern int64_t bt_event_class_get_id(
+               struct bt_event_class *event_class);
+
+/**
+@brief Sets the numeric ID of the CTF IR event class
+       \p event_class to \p id.
+
+\p id must be unique amongst the IDs of all the event classes
+of the stream class to which you eventually add \p event_class.
+
+@param[in] event_class Event class of which to set the numeric ID.
+@param[in] id          ID of the event class.
+@returns               0 on success, or a negative value on error.
+
+@prenotnull{event_class}
+@prehot{event_class}
+@pre \p id is lesser than or equal to 9223372036854775807 (\c INT64_MAX).
+@postrefcountsame{event_class}
+
+@sa bt_event_class_get_id(): Returns the numeric ID of a given
+       event class.
+*/
+extern int bt_event_class_set_id(
+               struct bt_event_class *event_class, uint64_t id);
+
+/**
+@brief Returns the log level of the CTF IR event class \p event_class.
+
+@param[in] event_class Event class of which to get the log level.
+@returns               Log level of event class \p event_class,
+                       #BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED if
+                       not specified, or
+                       #BT_EVENT_CLASS_LOG_LEVEL_UNKNOWN on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+
+@sa bt_event_class_set_log_level(): Sets the log level of a given
+       event class.
+*/
+extern enum bt_event_class_log_level bt_event_class_get_log_level(
+               struct bt_event_class *event_class);
+
+/**
+@brief Sets the log level of the CTF IR event class
+       \p event_class to \p log_level.
+
+@param[in] event_class Event class of which to set the log level.
+@param[in] log_level   Log level of the event class.
+@returns               0 on success, or a negative value on error.
+
+@prenotnull{event_class}
+@prehot{event_class}
+@pre \p log_level is #BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED,
+       #BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY,
+       #BT_EVENT_CLASS_LOG_LEVEL_ALERT,
+       #BT_EVENT_CLASS_LOG_LEVEL_CRITICAL,
+       #BT_EVENT_CLASS_LOG_LEVEL_ERROR,
+       #BT_EVENT_CLASS_LOG_LEVEL_WARNING,
+       #BT_EVENT_CLASS_LOG_LEVEL_NOTICE,
+       #BT_EVENT_CLASS_LOG_LEVEL_INFO,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION,
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE, or
+       #BT_EVENT_CLASS_LOG_LEVEL_DEBUG.
+@postrefcountsame{event_class}
+
+@sa bt_event_class_get_log_level(): Returns the log level of a given
+       event class.
+*/
+extern int bt_event_class_set_log_level(
+               struct bt_event_class *event_class,
+               enum bt_event_class_log_level log_level);
+
+/**
+@brief  Returns the Eclipse Modeling Framework URI of the CTF IR event
+       class \p event_class.
+
+@param[in] event_class Event class of which to get the
+                       Eclipse Modeling Framework URI.
+@returns               Eclipse Modeling Framework URI of event
+                       class \p event_class, or \c NULL on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+
+@sa bt_event_class_set_emf_uri(): Sets the Eclipse Modeling
+       Framework URI of a given event class.
+*/
+extern const char *bt_event_class_get_emf_uri(
+               struct bt_event_class *event_class);
+
+/**
+@brief Sets the Eclipse Modeling Framework URI of the CTF IR event class
+       \p event_class to \p emf_uri, or unsets the event class's EMF URI.
+
+@param[in] event_class Event class of which to set the
+                       Eclipse Modeling Framework URI.
+@param[in] emf_uri     Eclipse Modeling Framework URI of the
+                       event class (copied on success), or \c NULL
+                       to unset the current EMF URI.
+@returns               0 on success, or a negative value if there's
+                       no EMF URI or on error.
+
+@prenotnull{event_class}
+@prenotnull{emf_uri}
+@prehot{event_class}
+@postrefcountsame{event_class}
+
+@sa bt_event_class_get_emf_uri(): Returns the Eclipse Modeling
+       Framework URI of a given event class.
+*/
+extern int bt_event_class_set_emf_uri(
+               struct bt_event_class *event_class,
+               const char *emf_uri);
+
+/** @} */
+
+/**
+@name Contained field types functions
+@{
+*/
+
+extern struct bt_field_type *bt_event_class_borrow_context_field_type(
+               struct bt_event_class *event_class);
+
+/**
+@brief Returns the context field type of the CTF IR event class
+       \p event_class.
+
+@param[in] event_class Event class of which to get the context field type.
+@returns               Context field type of \p event_class, or \c NULL if
+                       \p event_class has no context field type or on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+@post <strong>On success, if the return value is a field type</strong>, its
+       reference count is incremented.
+
+@sa bt_event_class_set_context_field_type(): Sets the context field type of a
+       given event class.
+*/
+static inline
+struct bt_field_type *bt_event_class_get_context_field_type(
+               struct bt_event_class *event_class)
+{
+       return bt_get(bt_event_class_borrow_context_field_type(event_class));
+}
+
+/**
+@brief Sets the context field type of the CTF IR event class \p event_class to
+       \p context_type, or unsets the current context field type from
+       \p event_class.
+
+If \p context_type is \c NULL, then this function unsets the current context
+field type from \p event_class, effectively making \p event_class an event class
+without a context field type.
+
+As of Babeltrace \btversion, if \p context_type is not \c NULL,
+\p context_type \em must be a CTF IR structure field type object.
+
+@param[in] event_class         Event class of which to set the context field
+                               type.
+@param[in] context_type                Context field type, or \c NULL to unset the
+                               current context field type.
+@returns                       0 on success, or a negative value on error.
+
+@prenotnull{event_class}
+@prehot{event_class}
+@pre <strong>If \p context_type is not \c NULL</strong>, \p context_type is a
+       CTF IR structure field type.
+@postrefcountsame{event_class}
+@post <strong>On success, if \p context_type is not \c NULL</strong>,
+       the reference count of \p context_type is incremented.
+
+@sa bt_event_class_get_context_field_type(): Returns the context field type of a
+       given event class.
+*/
+extern int bt_event_class_set_context_field_type(
+               struct bt_event_class *event_class,
+               struct bt_field_type *context_type);
+
+extern struct bt_field_type *bt_event_class_borrow_payload_field_type(
+               struct bt_event_class *event_class);
+
+/**
+@brief Returns the payload field type of the CTF IR event class
+       \p event_class.
+
+@param[in] event_class Event class of which to get the payload field type.
+@returns               Payload field type of \p event_class, or \c NULL if
+                       \p event_class has no payload field type or on error.
+
+@prenotnull{event_class}
+@postrefcountsame{event_class}
+@post <strong>On success, if the return value is a field type</strong>, its
+       reference count is incremented.
+
+@sa bt_event_class_set_payload_field_type(): Sets the payload field type of a
+       given event class.
+*/
+static inline
+struct bt_field_type *bt_event_class_get_payload_field_type(
+               struct bt_event_class *event_class)
+{
+       return bt_get(bt_event_class_borrow_payload_field_type(event_class));
+}
+
+/**
+@brief Sets the payload field type of the CTF IR event class \p event_class to
+       \p payload_type, or unsets the current payload field type from
+       \p event_class.
+
+If \p payload_type is \c NULL, then this function unsets the current payload
+field type from \p event_class, effectively making \p event_class an event class
+without a payload field type.
+
+As of Babeltrace \btversion, if \p payload_type is not \c NULL,
+\p payload_type \em must be a CTF IR structure field type object.
+
+@param[in] event_class         Event class of which to set the payload field
+                               type.
+@param[in] payload_type                Payload field type, or \c NULL to unset the
+                               current payload field type.
+@returns                       0 on success, or a negative value on error.
+
+@prenotnull{event_class}
+@prehot{event_class}
+@pre <strong>If \p payload_type is not \c NULL</strong>, \p payload_type is a
+       CTF IR structure field type.
+@postrefcountsame{event_class}
+@post <strong>On success, if \p payload_type is not \c NULL</strong>,
+       the reference count of \p payload_type is incremented.
+
+@sa bt_event_class_get_payload_field_type(): Returns the payload field type of a
+       given event class.
+*/
+extern int bt_event_class_set_payload_field_type(
+               struct bt_event_class *event_class,
+               struct bt_field_type *payload_type);
+
+/** @} */
+
+/** @} */
 
 #ifdef __cplusplus
 }
This page took 0.030417 seconds and 4 git commands to generate.