buffer-view: introduce lttng_buffer_view_contains_string
[lttng-tools.git] / include / lttng / action / action-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_ACTION_INTERNAL_H
9#define LTTNG_ACTION_INTERNAL_H
10
11#include <lttng/action/action.h>
12#include <common/macros.h>
13#include <common/buffer-view.h>
3647288f 14#include <common/dynamic-buffer.h>
a58c490f 15#include <stdbool.h>
72756a3f 16#include <sys/types.h>
a58c490f
JG
17
18typedef bool (*action_validate_cb)(struct lttng_action *action);
19typedef void (*action_destroy_cb)(struct lttng_action *action);
3647288f
JG
20typedef int (*action_serialize_cb)(struct lttng_action *action,
21 struct lttng_dynamic_buffer *buf);
a58c490f
JG
22
23struct lttng_action {
24 enum lttng_action_type type;
25 action_validate_cb validate;
26 action_serialize_cb serialize;
27 action_destroy_cb destroy;
28};
29
30struct lttng_action_comm {
31 /* enum lttng_action_type */
32 int8_t action_type;
33} LTTNG_PACKED;
34
35LTTNG_HIDDEN
36bool lttng_action_validate(struct lttng_action *action);
37
38LTTNG_HIDDEN
3647288f
JG
39int lttng_action_serialize(struct lttng_action *action,
40 struct lttng_dynamic_buffer *buf);
a58c490f
JG
41
42LTTNG_HIDDEN
43ssize_t lttng_action_create_from_buffer(const struct lttng_buffer_view *view,
44 struct lttng_action **action);
45
9b63a4aa
JG
46LTTNG_HIDDEN
47enum lttng_action_type lttng_action_get_type_const(
48 const struct lttng_action *action);
49
a58c490f 50#endif /* LTTNG_ACTION_INTERNAL_H */
This page took 0.042106 seconds and 4 git commands to generate.