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 <lttng/condition/condition.h>
13 #include <common/macros.h>
15 #include <sys/types.h>
18 struct lttng_payload_view
;
20 typedef void (*evaluation_destroy_cb
)(struct lttng_evaluation
*evaluation
);
21 typedef int (*evaluation_serialize_cb
)(
22 const struct lttng_evaluation
*evaluation
,
23 struct lttng_payload
*payload
);
25 struct lttng_evaluation_comm
{
26 /* enum lttng_condition_type type */
31 struct lttng_evaluation
{
32 enum lttng_condition_type type
;
33 evaluation_serialize_cb serialize
;
34 evaluation_destroy_cb destroy
;
38 void lttng_evaluation_init(struct lttng_evaluation
*evaluation
,
39 enum lttng_condition_type type
);
42 ssize_t
lttng_evaluation_create_from_payload(
43 const struct lttng_condition
*condition
,
44 struct lttng_payload_view
*view
,
45 struct lttng_evaluation
**evaluation
);
48 int lttng_evaluation_serialize(const struct lttng_evaluation
*evaluation
,
49 struct lttng_payload
*payload
);
51 #endif /* LTTNG_EVALUATION_INTERNAL_H */