+enum lttng_trigger_status {
+ LTTNG_TRIGGER_STATUS_OK = 0,
+ LTTNG_TRIGGER_STATUS_ERROR = -1,
+ LTTNG_TRIGGER_STATUS_UNKNOWN = -2,
+ LTTNG_TRIGGER_STATUS_INVALID = -3,
+ LTTNG_TRIGGER_STATUS_UNSET = -4,
+ LTTNG_TRIGGER_STATUS_UNSUPPORTED = -5,
+ LTTNG_TRIGGER_STATUS_PERMISSION_DENIED = -6,
+};
+
+/*
+ * Create a trigger object associating a condition and an action.
+ *
+ * A trigger associates a condition and an action to take whenever the
+ * condition evaluates to true. Such actions can, for example, consist
+ * in the emission of a notification to clients listening through
+ * notification channels.
+ *
+ * Prior to 2.13, the caller had to retain the ownership of both the condition
+ * and action. Both objects had to be kept alive for the lifetime of the trigger
+ * object. This is no longer the case as the condition and action objects are
+ * internally reference counted. It is safe to destroy a condition and an action
+ * after using them to create a trigger. However, they should no longer be used.
+ *
+ * If the action is a notification action with capture descriptors,
+ * the condition must be an event rule condition.
+ *
+ * A trigger must be registered in order to become activate and can
+ * be destroyed after its registration.
+ *
+ * Returns a trigger object on success, NULL on error.
+ * Trigger objects must be destroyed using the lttng_trigger_destroy()
+ * function.
+ */
+LTTNG_EXPORT extern struct lttng_trigger *lttng_trigger_create(struct lttng_condition *condition,
+ struct lttng_action *action);
+
+/*
+ * Set the user identity (uid) of a trigger.
+ *
+ * Only available for the root user (uid 0).
+ *
+ * Returns LTTNG_TRIGGER_STATUS_OK on success,
+ * LTTNG_TRIGGER_STATUS_EPERM if not authorized,
+ * LTTNG_TRIGGER_STATUS_INVALID if invalid parameters are passed.
+ */
+LTTNG_EXPORT extern enum lttng_trigger_status
+lttng_trigger_set_owner_uid(struct lttng_trigger *trigger, uid_t uid);
+
+/*
+ * Get the user identity (uid) of a trigger.
+ *
+ * Returns LTTNG_TRIGGER_STATUS_OK on success,
+ * LTTNG_TRIGGER_STATUS_UNSET if unset,
+ * LTTNG_TRIGGER_STATUS_INVALID if invalid parameters are passed.
+ */
+LTTNG_EXPORT extern enum lttng_trigger_status
+lttng_trigger_get_owner_uid(const struct lttng_trigger *trigger, uid_t *uid);
+
+/*
+ * Get the condition of a trigger.
+ *
+ * The caller acquires no ownership of the returned condition.
+ *
+ * Returns a condition on success, NULL on error.
+ */
+LTTNG_EXPORT extern struct lttng_condition *
+lttng_trigger_get_condition(struct lttng_trigger *trigger);