2 * Copyright (C) 2019 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_TRACKER_INTERNAL_H
9 #define LTTNG_TRACKER_INTERNAL_H
11 #include <common/macros.h>
12 #include <common/dynamic-buffer.h>
13 #include <lttng/constant.h>
14 #include <lttng/tracker.h>
17 struct lttng_tracker_id
{
18 enum lttng_tracker_id_type type
;
23 struct lttng_tracker_ids
{
24 struct lttng_tracker_id
*id_array
;
29 bool lttng_tracker_id_is_equal(const struct lttng_tracker_id
*left
,
30 const struct lttng_tracker_id
*right
);
33 * A copy acts like memcpy. It does not allocate new memory.
36 int lttng_tracker_id_copy(struct lttng_tracker_id
*dest
,
37 const struct lttng_tracker_id
*src
);
40 * Duplicate an lttng_tracker_id.
41 * The returned object must be freed via lttng_tracker_id_destroy.
44 struct lttng_tracker_id
*lttng_tracker_id_duplicate(
45 const struct lttng_tracker_id
*src
);
48 * Allocate a new list of lttng_tracker_id.
49 * The returned object must be freed via lttng_tracker_ids_destroy.
52 struct lttng_tracker_ids
*lttng_tracker_ids_create(unsigned int base_count
);
55 * Return the non-const pointer of an element at index "index" of a
58 * The ownership of the lttng_tracker_id element is NOT transfered.
59 * The returned object can NOT be freed via lttng_tracker_id_destroy.
62 struct lttng_tracker_id
*lttng_tracker_ids_get_pointer_of_index(
63 const struct lttng_tracker_ids
*list
, unsigned int index
);
66 * Serialize a ids collection to a lttng_dynamic_buffer.
67 * Return LTTNG_OK on success, negative lttng error code on error.
70 int lttng_tracker_ids_serialize(const struct lttng_tracker_ids
*ids
,
71 struct lttng_dynamic_buffer
*buffer
);
73 #endif /* LTTNG_TRACKER_INTERNAL_H */