Fix: doc: action: wrong function documented for action_list destroy
[lttng-tools.git] / include / lttng / action / list.h
CommitLineData
0c51e8f3
SM
1/*
2 * Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
702f26c8
JR
8#ifndef LTTNG_ACTION_LIST_H
9#define LTTNG_ACTION_LIST_H
0c51e8f3 10
4bd69c5f
SM
11#include <lttng/lttng-export.h>
12
0c51e8f3 13struct lttng_action;
0c51e8f3
SM
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/*
702f26c8 20 * Create a newly allocated action list object.
0c51e8f3 21 *
702f26c8 22 * Returns a new action list on success, NULL on failure. This action list
0ae88630 23 * must be destroyed using lttng_action_destroy().
0c51e8f3 24 */
4bd69c5f 25LTTNG_EXPORT extern struct lttng_action *lttng_action_list_create(void);
0c51e8f3
SM
26
27/*
702f26c8 28 * Add an action to an lttng_action object of type LTTNG_ACTION_LIST.
0c51e8f3 29 *
702f26c8 30 * The action list acquires a reference to the action. The action can be
0c51e8f3 31 * safely destroyed after calling this function. An action must not be
a8940c5e 32 * modified after adding it to a list.
0c51e8f3 33 *
702f26c8 34 * Adding an action list to an action list is not supported.
0c51e8f3 35 */
4bd69c5f 36LTTNG_EXPORT extern enum lttng_action_status lttng_action_list_add_action(
a8940c5e 37 struct lttng_action *list, struct lttng_action *action);
0c51e8f3
SM
38
39/*
702f26c8 40 * Get the number of actions in an action list.
0c51e8f3 41 */
4bd69c5f 42LTTNG_EXPORT extern enum lttng_action_status lttng_action_list_get_count(
a8940c5e 43 const struct lttng_action *list, unsigned int *count);
0c51e8f3
SM
44
45/*
702f26c8 46 * Get an action from the action list at a given index.
0c51e8f3 47 *
a8940c5e 48 * Note that the list maintains the ownership of the returned action.
0c51e8f3 49 * It must not be destroyed by the user, nor should it be held beyond
702f26c8 50 * the lifetime of the action list.
0c51e8f3
SM
51 *
52 * Returns an action, or NULL on error.
53 */
4bd69c5f 54LTTNG_EXPORT extern const struct lttng_action *lttng_action_list_get_at_index(
a8940c5e 55 const struct lttng_action *list,
0c51e8f3
SM
56 unsigned int index);
57
58#ifdef __cplusplus
59}
60#endif
61
702f26c8 62#endif /* LTTNG_ACTION_LIST_H */
This page took 0.032147 seconds and 4 git commands to generate.