2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVALUATION_INTERNAL_H
9 #define LTTNG_EVALUATION_INTERNAL_H
11 #include <lttng/condition/evaluation.h>
12 #include <common/macros.h>
13 #include <common/buffer-view.h>
14 #include <common/dynamic-buffer.h>
16 #include <sys/types.h>
18 typedef void (*evaluation_destroy_cb
)(struct lttng_evaluation
*evaluation
);
19 typedef int (*evaluation_serialize_cb
)(
20 const struct lttng_evaluation
*evaluation
,
21 struct lttng_dynamic_buffer
*buf
);
23 struct lttng_evaluation_comm
{
24 /* enum lttng_condition_type type */
29 struct lttng_evaluation
{
30 enum lttng_condition_type type
;
31 evaluation_serialize_cb serialize
;
32 evaluation_destroy_cb destroy
;
36 void lttng_evaluation_init(struct lttng_evaluation
*evaluation
,
37 enum lttng_condition_type type
);
40 ssize_t
lttng_evaluation_create_from_buffer(const struct lttng_buffer_view
*view
,
41 struct lttng_evaluation
**evaluation
);
44 int lttng_evaluation_serialize(const struct lttng_evaluation
*evaluation
,
45 struct lttng_dynamic_buffer
*buf
);
47 #endif /* LTTNG_EVALUATION_INTERNAL_H */