idset_encode(3)

SYNOPSIS

#include <flux/idset.h>

char *idset_encode (const struct idset *idset, int flags);

Link with -lflux-idset.

DESCRIPTION

Refer to idset_create(3) for a general description of idsets.

idset_encode() creates a string from idset. The string contains a comma-separated list of ids, potentially modified by flags (see FLAGS below).

FLAGS

IDSET_FLAG_BRACKETS

If set, the encoded string will be enclosed in brackets, unless the idset is a singleton (contains only one id).

IDSET_FLAG_RANGE

If set, any consecutive ids are compressed into hyphenated ranges in the encoded string.

RETURN VALUE

idset_encode() returns a string on success which must be freed with free(3). On error, NULL is returned with errno set.

ERRORS

EINVAL

One or more arguments were invalid.

ENOMEM

Out of memory.

RESOURCES

Flux: http://flux-framework.org

Flux RFC: https://flux-framework.readthedocs.io/projects/flux-rfc

FLUX RFC

22/Idset String Representation

SEE ALSO

idset_create(3)