2 * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef LTTNG_BUFFER_VIEW_H
19 #define LTTNG_BUFFER_VIEW_H
23 #include <common/macros.h>
25 struct lttng_dynamic_buffer
;
27 struct lttng_buffer_view
{
33 * Return a buffer view referencing a subset of the memory referenced by a raw
36 * @src Source buffer to reference
37 * @offset Offset to apply to the source memory buffer
38 * @len Length of the memory contents to reference.
40 * Note that a buffer view never assumes the ownership of the memory it
44 struct lttng_buffer_view
lttng_buffer_view_init(
45 const char *src
, size_t offset
, ptrdiff_t len
);
48 * Return a buffer view referencing a subset of the memory referenced by another
51 * @src Source view to reference
52 * @offset Offset to apply to the source memory content
53 * @len Length of the memory contents to reference. Passing -1 will
54 * cause the view to reference the whole view from the offset
57 * Note that a buffer view never assumes the ownership of the memory it
61 struct lttng_buffer_view
lttng_buffer_view_from_view(
62 const struct lttng_buffer_view
*src
, size_t offset
,
66 * Return a buffer view referencing a subset of the memory referenced by a
69 * @src Source dynamic buffer to reference
70 * @offset Offset to apply to the source memory content
71 * @len Length of the memory contents to reference. Passing -1 will
72 * cause the view to reference the whole dynamic buffer from the
75 * Note that a buffer view never assumes the ownership of the memory it
79 struct lttng_buffer_view
lttng_buffer_view_from_dynamic_buffer(
80 const struct lttng_dynamic_buffer
*src
, size_t offset
,
83 #endif /* LTTNG_BUFFER_VIEW_H */
This page took 0.0397 seconds and 4 git commands to generate.