19.2.64. PMIx_Value_string

PMIx_Value_string — Return an allocated string representation of a pmix_value_t(5).

19.2.64.1. SYNOPSIS

#include <pmix.h>

char* PMIx_Value_string(const pmix_value_t *value);

19.2.64.1.1. Python Syntax

from pmix import *

foo = PMIxClient()
# the value is a Python ``pmix_value_t`` dictionary
pyval = {'value': 42, 'val_type': PMIX_INT32}
rc, txt = foo.value_string(pyval)

19.2.64.2. INPUT PARAMETERS

19.2.64.3. DESCRIPTION

Build a human-readable rendering of the supplied pmix_value_t(5), reporting both its data type and its contents. The rendering is produced by the library’s internal print routine for the value’s declared type.

Unlike the const char* converter routines (such as PMIx_Error_string(3)), which return a pointer to storage owned by the library, PMIx_Value_string returns a freshly heap-allocated buffer. The buffer is allocated internally with malloc/the library’s asprintf wrapper, so the caller is responsible for releasing it with the standard C library free() when it is no longer needed.

19.2.64.4. RETURN VALUE

Returns a pointer to an allocated, NULL-terminated string that the caller must release with free().

Returns NULL if the value could not be rendered — for example, if value is NULL or references an unknown data type.

19.2.64.5. NOTES

The returned buffer must be freed with free(); do not pass it to PMIX_RELEASE or any other PMIx destructor macro. This routine is a library convenience function and is not part of the PMIx Standard.