1 #ifndef _LTTNG_UST_MSGPACK_H
2 #define _LTTNG_UST_MSGPACK_H
7 * Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
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.
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.
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
26 #include <linux/types.h>
27 #else /* __KERNEL__ */
29 #endif /* __KERNEL__ */
31 struct lttng_msgpack_writer
{
34 const uint8_t *end_write_pos
;
35 uint8_t array_nesting
;
39 void lttng_msgpack_writer_init(
40 struct lttng_msgpack_writer
*writer
,
41 uint8_t *buffer
, size_t size
);
43 void lttng_msgpack_writer_fini(struct lttng_msgpack_writer
*writer
);
45 int lttng_msgpack_write_nil(struct lttng_msgpack_writer
*writer
);
46 int lttng_msgpack_write_true(struct lttng_msgpack_writer
*writer
);
47 int lttng_msgpack_write_false(struct lttng_msgpack_writer
*writer
);
48 int lttng_msgpack_write_unsigned_integer(
49 struct lttng_msgpack_writer
*writer
, uint64_t value
);
50 int lttng_msgpack_write_signed_integer(
51 struct lttng_msgpack_writer
*writer
, int64_t value
);
52 int lttng_msgpack_write_str(struct lttng_msgpack_writer
*writer
,
54 int lttng_msgpack_begin_map(struct lttng_msgpack_writer
*writer
, size_t count
);
55 int lttng_msgpack_end_map(struct lttng_msgpack_writer
*writer
);
56 int lttng_msgpack_begin_array(
57 struct lttng_msgpack_writer
*writer
, size_t count
);
58 int lttng_msgpack_end_array(struct lttng_msgpack_writer
*writer
);
60 #endif /* _LTTNG_UST_MSGPACK_H */
This page took 0.035132 seconds and 5 git commands to generate.