Rename C++ header files to .hpp
[lttng-tools.git] / include / lttng / log-level-rule-internal.hpp
CommitLineData
85b05318
JR
1/*
2 * Copyright (C) 2020 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_LOG_LEVEL_RULE_INTERNAL_H
9#define LTTNG_LOG_LEVEL_RULE_INTERNAL_H
10
11#include <stdint.h>
12
c9e313bc
SM
13#include <common/buffer-view.hpp>
14#include <common/dynamic-array.hpp>
15#include <common/macros.hpp>
16#include <common/payload-view.hpp>
17#include <common/payload.hpp>
85b05318
JR
18#include <lttng/event.h>
19#include <lttng/log-level-rule.h>
740da7d5 20#include <lttng/lttng-error.h>
85b05318 21
6a751b95
JR
22struct mi_writer;
23
85b05318
JR
24/*
25 * For now only a single backing struct is used for both type of log level
26 * rule (exactly, as_severe) since both only have require "level" as property.
27 */
28struct lttng_log_level_rule {
29 enum lttng_log_level_rule_type type;
30 int level;
31};
32
33struct lttng_log_level_rule_comm {
34 /* enum lttng_log_level_rule_type */
35 int8_t type;
36 int32_t level;
37};
38
85b05318
JR
39ssize_t lttng_log_level_rule_create_from_payload(
40 struct lttng_payload_view *view,
41 struct lttng_log_level_rule **rule);
42
85b05318
JR
43int lttng_log_level_rule_serialize(const struct lttng_log_level_rule *rule,
44 struct lttng_payload *payload);
45
85b05318
JR
46bool lttng_log_level_rule_is_equal(const struct lttng_log_level_rule *a,
47 const struct lttng_log_level_rule *b);
48
85b05318
JR
49struct lttng_log_level_rule *lttng_log_level_rule_copy(
50 const struct lttng_log_level_rule *source);
51
85b05318
JR
52void lttng_log_level_rule_to_loglevel(
53 const struct lttng_log_level_rule *log_level_rule,
54 enum lttng_loglevel_type *loglevel_type,
55 int *loglevel_value);
56
85b05318
JR
57unsigned long lttng_log_level_rule_hash(
58 const struct lttng_log_level_rule *log_level_rule);
59
6a751b95
JR
60enum lttng_error_code lttng_log_level_rule_mi_serialize(
61 const struct lttng_log_level_rule *rule,
62 struct mi_writer *writer);
63
85b05318 64#endif /* LTTNG_LOG_LEVEL_RULE_INTERNAL_H */
This page took 0.034713 seconds and 4 git commands to generate.