18.2.221. PMIx_Argv_append_nosize
PMIx_Argv_append_nosize — Append a copy of a string to the end of
a NULL-terminated argv-style array.
18.2.221.1. SYNOPSIS
#include <pmix.h>
pmix_status_t PMIx_Argv_append_nosize(char ***argv, const char *arg);
18.2.221.1.1. Python Syntax
No Python equivalent
18.2.221.2. INPUT/OUTPUT PARAMETERS
argv: Address of a pointer to a NULL-terminatedargv-style array. On input,*argvmay beNULL(in which case a new array is created) or point to an existing array. On output,*argvis updated to point at the (possibly reallocated) array.
18.2.221.3. INPUT PARAMETERS
arg: The string to append. The routine stores a private copy; the caller retains ownership ofarg.
18.2.221.4. DESCRIPTION
Append the string arg to the end of the array referenced by *argv.
If *argv is NULL, a new two-element array is allocated: element zero
holds the copied string and element one is the terminating NULL. If
*argv already points to an array, the array is reallocated one entry
larger, a copy of arg (made with strdup) is stored in the newly
opened slot, and a fresh terminating NULL is written after it. In both
cases *argv is updated to the resulting array pointer, which the caller
must use in place of any prior value because reallocation may move the array.
Only the string arg is duplicated; the routine takes ownership of the
copy it makes, and that copy is released when the array is later passed to
PMIx_Argv_free(3).
18.2.221.5. RETURN VALUE
Returns one of:
PMIX_SUCCESSThe string was appended successfully.PMIX_ERR_OUT_OF_RESOURCEMemory could not be allocated for the array or the copied string.
18.2.221.6. NOTES
The _nosize suffix indicates that, unlike the internal
pmix_argv_append routine, this function does not accept or update a
separate element-count argument. Use PMIx_Argv_count(3) when the current number of entries is needed.
18.2.221.7. EXAMPLES
char **argv = NULL;
PMIx_Argv_append_nosize(&argv, "first");
PMIx_Argv_append_nosize(&argv, "second");
/* argv == { "first", "second", NULL } */
PMIx_Argv_free(argv);