Creates an IntEnum containing all the XTT return codes.

    Finds all return codes by scanning the FFI for items whose names match
    the pattern "XTT_RETURN_<X>".  The name of the result enum value is the
    suffix "<X>".

def _build_return_code_enum():
    """
    Creates an IntEnum containing all the XTT return codes.

    Finds all return codes by scanning the FFI for items whose names match
    the pattern "XTT_RETURN_<X>".  The name of the result enum value is the
    suffix "<X>".
    """
    prefix = 'XTT_RETURN_'
    codes = {k[len(prefix):]:v for (k, v) in vars(_lib).items() if k.startswith(prefix)}
    return IntEnum('ReturnCode', codes)