Hide mew 'lttng_msgpack_*' private symbols
[lttng-ust.git] / libmsgpack / msgpack.h
CommitLineData
49705576
FD
1#ifndef _LTTNG_UST_MSGPACK_H
2#define _LTTNG_UST_MSGPACK_H
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
24#include <stddef.h>
25#ifdef __KERNEL__
26#include <linux/types.h>
27#else /* __KERNEL__ */
28#include <stdint.h>
cce1f4b6 29#include "helper.h"
49705576
FD
30#endif /* __KERNEL__ */
31
32struct lttng_msgpack_writer {
33 uint8_t *buffer;
34 uint8_t *write_pos;
35 const uint8_t *end_write_pos;
36 uint8_t array_nesting;
37 uint8_t map_nesting;
38};
39
cce1f4b6 40LTTNG_HIDDEN
49705576
FD
41void lttng_msgpack_writer_init(
42 struct lttng_msgpack_writer *writer,
43 uint8_t *buffer, size_t size);
44
cce1f4b6 45LTTNG_HIDDEN
49705576
FD
46void lttng_msgpack_writer_fini(struct lttng_msgpack_writer *writer);
47
cce1f4b6 48LTTNG_HIDDEN
49705576 49int lttng_msgpack_write_nil(struct lttng_msgpack_writer *writer);
cce1f4b6 50LTTNG_HIDDEN
49705576 51int lttng_msgpack_write_true(struct lttng_msgpack_writer *writer);
cce1f4b6 52LTTNG_HIDDEN
49705576 53int lttng_msgpack_write_false(struct lttng_msgpack_writer *writer);
cce1f4b6 54LTTNG_HIDDEN
49705576
FD
55int lttng_msgpack_write_unsigned_integer(
56 struct lttng_msgpack_writer *writer, uint64_t value);
cce1f4b6 57LTTNG_HIDDEN
49705576
FD
58int lttng_msgpack_write_signed_integer(
59 struct lttng_msgpack_writer *writer, int64_t value);
cce1f4b6 60LTTNG_HIDDEN
49705576 61int lttng_msgpack_write_double(struct lttng_msgpack_writer *writer, double value);
cce1f4b6 62LTTNG_HIDDEN
49705576
FD
63int lttng_msgpack_write_str(struct lttng_msgpack_writer *writer,
64 const char *value);
cce1f4b6 65LTTNG_HIDDEN
49705576 66int lttng_msgpack_begin_map(struct lttng_msgpack_writer *writer, size_t count);
cce1f4b6 67LTTNG_HIDDEN
49705576 68int lttng_msgpack_end_map(struct lttng_msgpack_writer *writer);
cce1f4b6 69LTTNG_HIDDEN
49705576
FD
70int lttng_msgpack_begin_array(
71 struct lttng_msgpack_writer *writer, size_t count);
cce1f4b6 72LTTNG_HIDDEN
49705576
FD
73int lttng_msgpack_end_array(struct lttng_msgpack_writer *writer);
74
75#endif /* _LTTNG_UST_MSGPACK_H */
This page took 0.02521 seconds and 4 git commands to generate.