Remove extern "C" from internal headers
[lttng-tools.git] / include / lttng / error-query-internal.h
... / ...
CommitLineData
1/*
2 * error-query-internal.h
3 *
4 * Copyright (C) 2021 Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 *
6 * SPDX-License-Identifier: GPL-2.1-only
7 *
8 */
9
10#ifndef LTTNG_ERROR_QUERY_INTERNAL_H
11#define LTTNG_ERROR_QUERY_INTERNAL_H
12
13#include <lttng/lttng.h>
14#include <common/macros.h>
15#include <common/payload.h>
16#include <common/payload-view.h>
17
18struct mi_writer;
19
20enum lttng_error_query_target_type {
21 LTTNG_ERROR_QUERY_TARGET_TYPE_TRIGGER,
22 LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION,
23 LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION,
24};
25
26enum lttng_error_query_target_type lttng_error_query_get_target_type(
27 const struct lttng_error_query *query);
28
29const struct lttng_trigger *lttng_error_query_trigger_borrow_target(
30 const struct lttng_error_query *query);
31
32const struct lttng_trigger *lttng_error_query_condition_borrow_target(
33 const struct lttng_error_query *query);
34
35const struct lttng_trigger *lttng_error_query_action_borrow_trigger_target(
36 const struct lttng_error_query *query);
37
38struct lttng_action *lttng_error_query_action_borrow_action_target(
39 const struct lttng_error_query *query,
40 struct lttng_trigger *trigger);
41
42int lttng_error_query_serialize(const struct lttng_error_query *query,
43 struct lttng_payload *payload);
44
45ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view,
46 struct lttng_error_query **query);
47
48int lttng_error_query_result_serialize(
49 const struct lttng_error_query_result *result,
50 struct lttng_payload *payload);
51
52ssize_t lttng_error_query_result_create_from_payload(
53 struct lttng_payload_view *view,
54 struct lttng_error_query_result **result);
55
56int lttng_error_query_results_serialize(
57 const struct lttng_error_query_results *results,
58 struct lttng_payload *payload);
59
60ssize_t lttng_error_query_results_create_from_payload(
61 struct lttng_payload_view *view,
62 struct lttng_error_query_results **results);
63
64struct lttng_error_query_result *
65lttng_error_query_result_counter_create(
66 const char *name, const char *description, uint64_t value);
67
68void lttng_error_query_result_destroy(struct lttng_error_query_result *result);
69
70struct lttng_error_query_results *lttng_error_query_results_create(void);
71
72/* Ownership of `result` is transferred on success. */
73int lttng_error_query_results_add_result(
74 struct lttng_error_query_results *results,
75 struct lttng_error_query_result *result);
76
77enum lttng_error_code lttng_error_query_results_mi_serialize(
78 const struct lttng_error_query_results *results,
79 struct mi_writer *writer);
80
81#endif /* LTTNG_ERROR_QUERY_INTERNAL_H */
This page took 0.022994 seconds and 4 git commands to generate.