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 | ||
11 | #include <lttng/condition/evaluation.h> | |
7c920b63 | 12 | #include <lttng/condition/condition.h> |
a58c490f | 13 | #include <common/macros.h> |
a58c490f | 14 | #include <stdbool.h> |
3897deca | 15 | #include <sys/types.h> |
a58c490f | 16 | |
c0a66c84 JG |
17 | struct lttng_payload; |
18 | struct lttng_payload_view; | |
19 | ||
a58c490f | 20 | typedef void (*evaluation_destroy_cb)(struct lttng_evaluation *evaluation); |
9b63a4aa JG |
21 | typedef int (*evaluation_serialize_cb)( |
22 | const struct lttng_evaluation *evaluation, | |
c0a66c84 | 23 | struct lttng_payload *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 | ||
c19092cd JG |
37 | LTTNG_HIDDEN |
38 | void lttng_evaluation_init(struct lttng_evaluation *evaluation, | |
39 | enum lttng_condition_type type); | |
40 | ||
a58c490f | 41 | LTTNG_HIDDEN |
7c920b63 PP |
42 | ssize_t lttng_evaluation_create_from_payload( |
43 | const struct lttng_condition *condition, | |
44 | struct lttng_payload_view *view, | |
a58c490f JG |
45 | struct lttng_evaluation **evaluation); |
46 | ||
47 | LTTNG_HIDDEN | |
9b63a4aa | 48 | int lttng_evaluation_serialize(const struct lttng_evaluation *evaluation, |
c0a66c84 | 49 | struct lttng_payload *payload); |
a58c490f JG |
50 | |
51 | #endif /* LTTNG_EVALUATION_INTERNAL_H */ |