18.2.108. PMIx_Info_list_get_info

PMIx_Info_list_get_info — Iterate over the pmix_info_t(5) entries of an opaque list

18.2.108.1. SYNOPSIS

#include <pmix.h>

pmix_info_t* PMIx_Info_list_get_info(void *ptr, void *prev, void **next);

18.2.108.1.1. Python Syntax

No Python equivalent

18.2.108.2. INPUT/OUTPUT PARAMETERS

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

  • prev: (IN) Opaque pointer to the current list element, as previously returned in next. Pass NULL to obtain the first element.

  • next: (OUT) Set to an opaque pointer to the following list element, or to NULL when the returned element is the last on the list.

18.2.108.3. DESCRIPTION

Retrieve a pmix_info_t entry from the list identified by ptr and advance an iteration cursor. Passing NULL for prev returns the first entry on the list; otherwise prev must be the opaque element pointer that a previous call returned through next. On return, *next is set to the opaque handle of the following element, or to NULL when the returned element is the last on the list.

Iterate by repeatedly calling PMIx_Info_list_get_info, feeding the next value from one call as the prev argument of the following call, until *next becomes NULL.

The returned pmix_info_t pointer refers to storage owned by the list; the caller must not free it and must not use it after the list has been released.

18.2.108.4. RETURN VALUE

Returns a pointer to the current pmix_info_t entry.

18.2.108.5. NOTES

The prev parameter names the current element to be returned, and next receives the following element — next is the value to feed back as prev on the subsequent call. This routine performs no locking; the list must not be modified while an iteration is in progress.

18.2.108.6. EXAMPLES

pmix_info_t *ip;
void *cur, *nxt;

cur = NULL;
do {
    ip = PMIx_Info_list_get_info(ilist, cur, &nxt);
    /* use ip ... */
    cur = nxt;
} while (NULL != nxt);