18.2.157. PMIx_Envar_construct

PMIx_Envar_construct — Initialize a caller-provided pmix_envar_t(5) structure.

18.2.157.1. SYNOPSIS

#include <pmix.h>

void PMIx_Envar_construct(pmix_envar_t *e);

18.2.157.1.1. Python Syntax

No Python equivalent

18.2.157.2. INPUT PARAMETERS

  • e: Pointer to the pmix_envar_t(5) structure to be initialized. The storage for the structure itself must already exist — it is supplied by the caller (typically declared on the stack or embedded within another object).

18.2.157.3. DESCRIPTION

Initialize the fields of a pmix_envar_t that the caller has already allocated. The envar and value string pointers are set to NULL and the separator character is set to '\0'. No heap memory is allocated.

A structure must be constructed (or created with PMIx_Envar_create(3)) before its contents are populated — for example with PMIx_Envar_load(3) — or used in any operation.

Because PMIx_Envar_construct operates on caller-provided storage, it must be paired with PMIx_Envar_destruct(3) to release any strings the structure subsequently acquires. Do not pass a constructed (as opposed to created) structure to PMIx_Envar_free(3), as that would attempt to free storage the library did not allocate.

18.2.157.4. RETURN VALUE

PMIx_Envar_construct returns no value (void).

18.2.157.5. NOTES

PMIx_Envar_construct is an OpenPMIx convenience routine. The equivalent static initializer PMIX_ENVAR_STATIC_INIT may be used where a compile-time initialization is preferred.

18.2.157.6. EXAMPLES

Construct a structure:

pmix_envar_t envar;

PMIx_Envar_construct(&envar);