Move to kernel style SPDX license identifiers
[lttng-tools.git] / include / lttng / condition / condition-internal.h
CommitLineData
a58c490f 1/*
ab5be9fa 2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
a58c490f 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
a58c490f 5 *
a58c490f
JG
6 */
7
8#ifndef LTTNG_CONDITION_INTERNAL_H
9#define LTTNG_CONDITION_INTERNAL_H
10
11#include <lttng/condition/condition.h>
12#include <common/macros.h>
13#include <common/buffer-view.h>
3647288f 14#include <common/dynamic-buffer.h>
a58c490f
JG
15#include <stdbool.h>
16#include <urcu/list.h>
17#include <stdint.h>
3897deca 18#include <sys/types.h>
a58c490f
JG
19
20typedef void (*condition_destroy_cb)(struct lttng_condition *condition);
21typedef bool (*condition_validate_cb)(const struct lttng_condition *condition);
3647288f
JG
22typedef int (*condition_serialize_cb)(
23 const struct lttng_condition *condition,
24 struct lttng_dynamic_buffer *buf);
a58c490f
JG
25typedef bool (*condition_equal_cb)(const struct lttng_condition *a,
26 const struct lttng_condition *b);
27typedef ssize_t (*condition_create_from_buffer_cb)(
28 const struct lttng_buffer_view *view,
29 struct lttng_condition **condition);
30
31struct lttng_condition {
32 enum lttng_condition_type type;
33 condition_validate_cb validate;
34 condition_serialize_cb serialize;
35 condition_equal_cb equal;
36 condition_destroy_cb destroy;
37};
38
39struct lttng_condition_comm {
40 /* enum lttng_condition_type */
41 int8_t condition_type;
42 char payload[];
43};
44
45LTTNG_HIDDEN
46void lttng_condition_init(struct lttng_condition *condition,
47 enum lttng_condition_type type);
48
49LTTNG_HIDDEN
50bool lttng_condition_validate(const struct lttng_condition *condition);
51
52LTTNG_HIDDEN
53ssize_t lttng_condition_create_from_buffer(
54 const struct lttng_buffer_view *buffer,
55 struct lttng_condition **condition);
56
57LTTNG_HIDDEN
3647288f
JG
58int lttng_condition_serialize(const struct lttng_condition *condition,
59 struct lttng_dynamic_buffer *buf);
a58c490f
JG
60
61LTTNG_HIDDEN
62bool lttng_condition_is_equal(const struct lttng_condition *a,
63 const struct lttng_condition *b);
64
65#endif /* LTTNG_CONDITION_INTERNAL_H */
This page took 0.030336 seconds and 4 git commands to generate.