2 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #include <common/buffer-view.h>
9 #include "payload-view.h"
14 struct lttng_payload_view
lttng_payload_view_from_payload(
15 const struct lttng_payload
*payload
, size_t offset
,
18 return (struct lttng_payload_view
) {
19 .buffer
= lttng_buffer_view_from_dynamic_buffer(
20 &payload
->buffer
, offset
, len
),
21 ._fds
= payload
->_fds
,
26 struct lttng_payload_view
lttng_payload_view_from_view(
27 struct lttng_payload_view
*view
, size_t offset
,
30 return (struct lttng_payload_view
) {
31 .buffer
= lttng_buffer_view_from_view(
32 &view
->buffer
, offset
, len
),
34 ._iterator
.p_fds_position
= &view
->_iterator
.fds_position
,
39 struct lttng_payload_view
lttng_payload_view_from_dynamic_buffer(
40 const struct lttng_dynamic_buffer
*buffer
, size_t offset
,
43 return (struct lttng_payload_view
) {
44 .buffer
= lttng_buffer_view_from_dynamic_buffer(
50 int lttng_payload_view_pop_fd(struct lttng_payload_view
*view
)
61 fd_count
= lttng_dynamic_array_get_count(&view
->_fds
);
62 pos
= view
->_iterator
.p_fds_position
? view
->_iterator
.p_fds_position
:
63 &view
->_iterator
.fds_position
;
65 if (*pos
>= fd_count
) {
70 ret
= *((int *) lttng_dynamic_array_get_element(
This page took 0.060456 seconds and 4 git commands to generate.