+ * Public LTTng control API
+ *
+ * For functions having an lttng domain type as parameter, if a bad value is
+ * given, NO default is applied and an error is returned.
+ *
+ * On success, all functions of the API return 0 or the size of the allocated
+ * array (in bytes).
+ *
+ * On error, a negative value is returned being a specific lttng-tools error
+ * code which can be humanly interpreted with lttng_strerror(err).
+ *
+ * Exceptions to this are noted below.
+ */
+
+/*
+ * Create a handle used as a context for every request made to the library.
+ *
+ * This handle contains the session name and lttng domain on which the command
+ * will be executed.
+ * The returned pointer will be NULL in case of malloc() error.
+ */
+extern struct lttng_handle *lttng_create_handle(const char *session_name,
+ struct lttng_domain *domain);
+
+/*
+ * Destroy an handle.
+ *
+ * It free(3) the data pointer returned by lttng_create_handle(), rendering it
+ * unusable.
+ */
+extern void lttng_destroy_handle(struct lttng_handle *handle);
+
+/*
+ * Create a tracing session using a name and an optional URL.
+ *
+ * If _url_ is NULL, no consumer is created for the session. The name can't be
+ * NULL here.
+ */
+extern int lttng_create_session(const char *name, const char *url);
+
+/*
+ * Create a tracing session that will exclusively be used for snapshot meaning
+ * the session will be in no output mode and every channel enabled for that
+ * session will be set in overwrite mode and in mmap output since splice is not
+ * supported.
+ *
+ * If an url is given, it will be used to create a default snapshot output
+ * using it as a destination. If NULL, no output will be defined and an
+ * add-output call will be needed.
+ *
+ * Name can't be NULL.
+ */
+extern int lttng_create_session_snapshot(const char *name,
+ const char *snapshot_url);
+
+/*
+ * Create a session exclusively used for live reading.
+ *
+ * In this mode, the switch-timer parameter is forced for each UST channel, a
+ * live-switch-timer is enabled for kernel channels, manually setting
+ * switch-timer is forbidden. Synchronization beacons are sent to the relayd,
+ * indexes are sent and metadata is checked for each packet.
+ *
+ * Returns LTTNG_OK on success or a negative error code.
+ */
+extern int lttng_create_session_live(const char *name, const char *url,
+ unsigned int timer_interval);
+
+/*
+ * Destroy a tracing session.
+ *
+ * The session will not be usable anymore, tracing will be stopped for all
+ * registered traces, and the tracing buffers will be flushed.
+ *
+ * The name can't be NULL here.
+ */
+extern int lttng_destroy_session(const char *name);
+
+/*
+ * List all the tracing sessions.
+ *
+ * Return the size (number of entries) of the "lttng_session" array. Caller
+ * must free(3).