18.2.100. PMIx_Value_true

PMIx_Value_true — Determine the boolean interpretation of a pmix_value_t(5) structure.

18.2.100.1. SYNOPSIS

#include <pmix.h>

pmix_boolean_t PMIx_Value_true(const pmix_value_t *v);

18.2.100.1.1. Python Syntax

No Python equivalent

18.2.100.2. INPUT PARAMETERS

18.2.100.3. DESCRIPTION

Examine a pmix_value_t(5) and report whether it represents a boolean “true” or “false”, handling the several ways a boolean can be encoded:

  • A type of PMIX_UNDEF is taken to mean “true” — the mere presence of the attribute implies the value is set.

  • A type of PMIX_BOOL returns the state of the stored flag.

  • A type of PMIX_STRING is parsed for a boolean interpretation. A NULL or empty (whitespace-only) string is treated as “true”. A leading numeric string is “false” when it evaluates to zero and “true” otherwise. The words yes, true, y, t, and enable (case insensitive) are “true”; no, false, n, f, and disable are “false”.

Any value that cannot be interpreted as a boolean is reported as such rather than being forced to true or false.

18.2.100.4. RETURN VALUE

Returns a pmix_boolean_t(5):

  • PMIX_BOOL_TRUE The value represents boolean true.

  • PMIX_BOOL_FALSE The value represents boolean false.

  • PMIX_NON_BOOL The value cannot be interpreted as a boolean.

18.2.100.5. NOTES

PMIx_Value_true is an OpenPMIx convenience routine.