18.2.136. PMIx_Pdata_xfer
PMIx_Pdata_xfer — Copy the contents of one
pmix_pdata_t(5) structure into another.
18.2.136.1. SYNOPSIS
#include <pmix.h>
void PMIx_Pdata_xfer(pmix_pdata_t *dest,
pmix_pdata_t *src);
18.2.136.1.1. Python Syntax
No Python equivalent
18.2.136.2. INPUT/OUTPUT PARAMETERS
dest: Pointer to the destination pmix_pdata_t(5) structure. Any prior contents are overwritten without being released.
18.2.136.3. INPUT PARAMETERS
src: Pointer to the source pmix_pdata_t(5) structure whose contents are copied intodest.
18.2.136.4. DESCRIPTION
Copy the process identifier, key, and value from src into dest. The
function first zeroes dest, then copies the namespace and rank of
src->proc, copies the src->key string, and performs a deep copy of
src->value into dest->value.
The transfer is a copy, not a move: src is left unmodified, and
dest receives its own independently allocated storage for any value payload
that requires it. As a result dest and src may afterward be destructed
independently.
If dest is NULL, the function does nothing.
18.2.136.5. RETURN VALUE
PMIx_Pdata_xfer returns no value (void).
18.2.136.6. NOTES
Because PMIx_Pdata_xfer overwrites dest without releasing any previous
contents, only call it on a freshly constructed or otherwise empty structure to
avoid leaking a prior payload. Both dest and src should ultimately be
released with PMIx_Pdata_destruct(3) or
PMIx_Pdata_free(3).
18.2.136.7. EXAMPLES
Copy one structure into another:
pmix_pdata_t dest;
PMIx_Pdata_construct(&dest);
PMIx_Pdata_xfer(&dest, &src);
/* dest and src may now be destructed independently */
PMIx_Pdata_destruct(&dest);