20.2.103. PMIx_Info_list_add

PMIx_Info_list_add — Append a key/value entry to an opaque pmix_info_t(5) list

20.2.103.1. SYNOPSIS

#include <pmix.h>

pmix_status_t PMIx_Info_list_add(void *ptr,
                                 const char *key,
                                 const void *value,
                                 pmix_data_type_t type);

20.2.103.1.1. Python Syntax

No Python equivalent

20.2.103.2. INPUT PARAMETERS

  • ptr: Opaque list handle returned by PMIx_Info_list_start(3).

  • key: String key to be loaded. Must be no longer than PMIX_MAX_KEYLEN.

  • value: Pointer to the data value to be loaded.

  • type: The pmix_data_type_t(5) of the provided value.

20.2.103.3. DESCRIPTION

Create a new pmix_info_t entry from the provided key, value, and type, and append it to the end of the list identified by ptr. The key and value are copied into the entry, so the caller’s source key and any data referenced by value may be modified or freed once the function returns without affecting the stored copy.

This routine does not check for a duplicate key; if the same key is added more than once, multiple entries with that key will appear on the list. Use PMIx_Info_list_add_unique(3) when duplicate suppression is required.

20.2.103.4. RETURN VALUE

Returns PMIX_SUCCESS on success, or a negative PMIx error constant on failure — most commonly PMIX_ERR_NOMEM if the entry could not be allocated, PMIX_ERR_BAD_PARAM for a NULL list or key, and PMIX_ERR_NOT_SUPPORTED for a type the library does not store.

Nothing is appended when this fails, and the failure is recorded on the list: a caller that does not test here can test once at the end instead, because PMIx_Info_list_convert(3) reports it.