Move to kernel style SPDX license identifiers
[lttng-tools.git] / include / lttng / condition / evaluation-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_EVALUATION_INTERNAL_H
9#define LTTNG_EVALUATION_INTERNAL_H
10
11#include <lttng/condition/evaluation.h>
12#include <common/macros.h>
13#include <common/buffer-view.h>
3647288f 14#include <common/dynamic-buffer.h>
a58c490f 15#include <stdbool.h>
3897deca 16#include <sys/types.h>
a58c490f
JG
17
18typedef void (*evaluation_destroy_cb)(struct lttng_evaluation *evaluation);
9b63a4aa
JG
19typedef int (*evaluation_serialize_cb)(
20 const struct lttng_evaluation *evaluation,
3647288f 21 struct lttng_dynamic_buffer *buf);
a58c490f
JG
22
23struct lttng_evaluation_comm {
24 /* enum lttng_condition_type type */
25 int8_t type;
26 char payload[];
27} LTTNG_PACKED;
28
29struct lttng_evaluation {
30 enum lttng_condition_type type;
31 evaluation_serialize_cb serialize;
32 evaluation_destroy_cb destroy;
33};
34
c19092cd
JG
35LTTNG_HIDDEN
36void lttng_evaluation_init(struct lttng_evaluation *evaluation,
37 enum lttng_condition_type type);
38
a58c490f
JG
39LTTNG_HIDDEN
40ssize_t lttng_evaluation_create_from_buffer(const struct lttng_buffer_view *view,
41 struct lttng_evaluation **evaluation);
42
43LTTNG_HIDDEN
9b63a4aa 44int lttng_evaluation_serialize(const struct lttng_evaluation *evaluation,
3647288f 45 struct lttng_dynamic_buffer *buf);
a58c490f
JG
46
47#endif /* LTTNG_EVALUATION_INTERNAL_H */
This page took 0.028708 seconds and 4 git commands to generate.