fix: isystem: delete global -isystem compile option (v5.16)
[lttng-modules.git] / include / lttng / msgpack.h
CommitLineData
afa8f7a5
MD
1#ifndef _LTTNG_KERNEL_MSGPACK_H
2#define _LTTNG_KERNEL_MSGPACK_H
7ab8c616
FD
3
4/*
5 * msgpack.h
6 *
7 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; only
12 * version 2.1 of the License.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
7ab8c616
FD
24#ifdef __KERNEL__
25#include <linux/types.h>
26#else /* __KERNEL__ */
27#include <stdint.h>
28#endif /* __KERNEL__ */
29
30struct lttng_msgpack_writer {
31 uint8_t *buffer;
32 uint8_t *write_pos;
33 const uint8_t *end_write_pos;
34 uint8_t array_nesting;
35 uint8_t map_nesting;
36};
37
38void lttng_msgpack_writer_init(
39 struct lttng_msgpack_writer *writer,
40 uint8_t *buffer, size_t size);
41
42void lttng_msgpack_writer_fini(struct lttng_msgpack_writer *writer);
43
44int lttng_msgpack_write_nil(struct lttng_msgpack_writer *writer);
45int lttng_msgpack_write_true(struct lttng_msgpack_writer *writer);
46int lttng_msgpack_write_false(struct lttng_msgpack_writer *writer);
47int lttng_msgpack_write_unsigned_integer(
48 struct lttng_msgpack_writer *writer, uint64_t value);
49int lttng_msgpack_write_signed_integer(
50 struct lttng_msgpack_writer *writer, int64_t value);
7ab8c616
FD
51int lttng_msgpack_write_str(struct lttng_msgpack_writer *writer,
52 const char *value);
53int lttng_msgpack_begin_map(struct lttng_msgpack_writer *writer, size_t count);
54int lttng_msgpack_end_map(struct lttng_msgpack_writer *writer);
55int lttng_msgpack_begin_array(
56 struct lttng_msgpack_writer *writer, size_t count);
57int lttng_msgpack_end_array(struct lttng_msgpack_writer *writer);
58
afa8f7a5 59#endif /* _LTTNG_KERNEL_MSGPACK_H */
This page took 0.030785 seconds and 4 git commands to generate.