X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fpayload-view.h;h=9e385842b208f1183c9842b1578fe1f3206c6858;hp=c7501bcdabaed038bea776b9d780f3a709994631;hb=e368fb4396b9bdb22de16f0c93512c9f6d7ab0b4;hpb=ddab38d1659326ae7933319adefc3dff243da352 diff --git a/src/common/payload-view.h b/src/common/payload-view.h index c7501bcda..9e385842b 100644 --- a/src/common/payload-view.h +++ b/src/common/payload-view.h @@ -114,6 +114,21 @@ struct lttng_payload_view lttng_payload_view_from_buffer_view( const struct lttng_buffer_view *view, size_t offset, ptrdiff_t len); +/** + * Return a payload view referencing a subset of the memory referenced by a raw + * pointer. + * + * @src Source buffer to reference + * @offset Offset to apply to the source memory buffer + * @len Length of the memory contents to reference. + * + * Note that a payload view never assumes the ownership of the memory it + * references. + */ +LTTNG_HIDDEN +struct lttng_payload_view lttng_payload_view_init_from_buffer( + const char *src, size_t offset, ptrdiff_t len); + /** * Get the number of file descriptors left in a payload view. *