Commit | Line | Data |
---|---|---|
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 | ||
c9e313bc | 11 | #include <common/macros.hpp> |
28f23191 JG |
12 | |
13 | #include <lttng/condition/condition.h> | |
14 | #include <lttng/condition/evaluation.h> | |
15 | ||
a58c490f | 16 | #include <stdbool.h> |
3897deca | 17 | #include <sys/types.h> |
a58c490f | 18 | |
c0a66c84 JG |
19 | struct lttng_payload; |
20 | struct lttng_payload_view; | |
21 | ||
e665dfbc JG |
22 | using evaluation_destroy_cb = void (*)(struct lttng_evaluation *); |
23 | using evaluation_serialize_cb = int (*)(const struct lttng_evaluation *, struct lttng_payload *); | |
a58c490f JG |
24 | |
25 | struct lttng_evaluation_comm { | |
26 | /* enum lttng_condition_type type */ | |
27 | int8_t type; | |
28 | char payload[]; | |
29 | } LTTNG_PACKED; | |
30 | ||
31 | struct lttng_evaluation { | |
32 | enum lttng_condition_type type; | |
33 | evaluation_serialize_cb serialize; | |
34 | evaluation_destroy_cb destroy; | |
35 | }; | |
36 | ||
28f23191 | 37 | void lttng_evaluation_init(struct lttng_evaluation *evaluation, enum lttng_condition_type type); |
c19092cd | 38 | |
28f23191 JG |
39 | ssize_t lttng_evaluation_create_from_payload(const struct lttng_condition *condition, |
40 | struct lttng_payload_view *view, | |
41 | struct lttng_evaluation **evaluation); | |
a58c490f | 42 | |
9b63a4aa | 43 | int lttng_evaluation_serialize(const struct lttng_evaluation *evaluation, |
28f23191 | 44 | struct lttng_payload *payload); |
a58c490f JG |
45 | |
46 | #endif /* LTTNG_EVALUATION_INTERNAL_H */ |