21.2.236. PMIx_Check_key

PMIx_Check_key — Compare a pmix_key_t(5) against a string for equality

21.2.236.1. SYNOPSIS

#include <pmix.h>

bool PMIx_Check_key(const char *key, const char *str);

21.2.236.1.1. Python Syntax

No Python equivalent

21.2.236.2. INPUT PARAMETERS

  • key: Pointer to the key (typically a pmix_key_t(5)) to be tested.

  • str: Pointer to the string to compare against.

21.2.236.3. DESCRIPTION

Compare a key against a given string for equality. The comparison examines at most PMIX_MAX_KEYLEN characters, which is the maximum length a pmix_key_t can hold. This provides a safe, bounded way to test whether a key matches an expected attribute string without risking a read past the end of the fixed-size key array.

21.2.236.4. RETURN VALUE

Returns true if the first PMIX_MAX_KEYLEN characters of key and str match, and false otherwise.

21.2.236.5. NOTES

PMIx_Check_key is an OpenPMIx convenience routine and is the backing implementation of the PMIX_CHECK_KEY macro. Both arguments must point to valid, NULL-terminated strings; the routine performs no NULL checking.