Fix: condition: buffer-usage: use double instead of fixed point
[lttng-tools.git] / include / lttng / condition / condition-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_CONDITION_INTERNAL_H
9#define LTTNG_CONDITION_INTERNAL_H
10
11#include <lttng/condition/condition.h>
12#include <common/macros.h>
9e620ea7
JG
13#include <common/payload-view.h>
14#include <common/payload.h>
a58c490f
JG
15#include <stdbool.h>
16#include <urcu/list.h>
4655b864 17#include <urcu/ref.h>
a58c490f 18#include <stdint.h>
3897deca 19#include <sys/types.h>
a58c490f
JG
20
21typedef void (*condition_destroy_cb)(struct lttng_condition *condition);
22typedef bool (*condition_validate_cb)(const struct lttng_condition *condition);
3647288f
JG
23typedef int (*condition_serialize_cb)(
24 const struct lttng_condition *condition,
c0a66c84 25 struct lttng_payload *payload);
a58c490f
JG
26typedef bool (*condition_equal_cb)(const struct lttng_condition *a,
27 const struct lttng_condition *b);
c0a66c84
JG
28typedef ssize_t (*condition_create_from_payload_cb)(
29 struct lttng_payload_view *view,
a58c490f
JG
30 struct lttng_condition **condition);
31
32struct lttng_condition {
4655b864
JR
33 /* Reference counting is only exposed to internal users. */
34 struct urcu_ref ref;
a58c490f
JG
35 enum lttng_condition_type type;
36 condition_validate_cb validate;
37 condition_serialize_cb serialize;
38 condition_equal_cb equal;
39 condition_destroy_cb destroy;
40};
41
42struct lttng_condition_comm {
43 /* enum lttng_condition_type */
44 int8_t condition_type;
45 char payload[];
46};
47
4655b864
JR
48LTTNG_HIDDEN
49void lttng_condition_get(struct lttng_condition *condition);
50
51LTTNG_HIDDEN
52void lttng_condition_put(struct lttng_condition *condition);
53
a58c490f
JG
54LTTNG_HIDDEN
55void lttng_condition_init(struct lttng_condition *condition,
56 enum lttng_condition_type type);
57
58LTTNG_HIDDEN
59bool lttng_condition_validate(const struct lttng_condition *condition);
60
61LTTNG_HIDDEN
c0a66c84
JG
62ssize_t lttng_condition_create_from_payload(
63 struct lttng_payload_view *view,
a58c490f
JG
64 struct lttng_condition **condition);
65
66LTTNG_HIDDEN
3647288f 67int lttng_condition_serialize(const struct lttng_condition *condition,
c0a66c84 68 struct lttng_payload *payload);
a58c490f
JG
69
70LTTNG_HIDDEN
71bool lttng_condition_is_equal(const struct lttng_condition *a,
72 const struct lttng_condition *b);
73
0de2479d
SM
74LTTNG_HIDDEN
75const char *lttng_condition_type_str(enum lttng_condition_type type);
76
a58c490f 77#endif /* LTTNG_CONDITION_INTERNAL_H */
This page took 0.033155 seconds and 4 git commands to generate.