strm_string_modify()

Updated: April 19, 2023

Modify the string stored in a shareable string

Synopsis:

#include <sys/strm.h>
strm_string_t* strm_string_modify(strm_string_t *sstr,
                                  const char *cstring)

Arguments:

sstr
A handle to an existing shareable string.
cstring
A pointer to a null-terminated string to store in the new shareable string.

Library:

libstrm

Description:

This function modifies the string stored in a shareable string, by destroying the original object referenced by sstr and creating a new object containing the string in cstring.

Calling this function is equivalent to calling strm_string_destroy() and strm_string_make() except that it may reuse the memory of the original object. Note that the passed-in shareable string handle is consumed, even on failure.

Returns:

On success, a handle to the new shareable string. On failure, a null pointer (errno is set).