Back

NAME

conf_get_directive, conf_get_directive_count - get directives and subdirectives

LIBRARY

Configuration parser (libconfetti, -lconfetti)

SYNOPSIS

#include <confetti.h>

const conf_directive *conf_get_directive(const conf_directive *dir, long index);
long conf_get_directive_count(const conf_directive *dir);

DESCRIPTION

The conf_get_directive() function returns the subdirective at index for the Confetti directive dir. The pointer returned remains valid until the configuration unit that directive dir was derived from is released with conf_free(3).

The conf_get_directive_count() function returns the number of subdirectives in the Confetti directive dir.

Review the SEE ALSO section for functions that the opaque type conf_directive can be used with.

RETURN VALUE

The conf_get_directive() function returns the subdirective at index for the Confetti directive dir. If index is out-of-bounds or dir is NULL, then NULL is returned.

The conf_get_directive_count() function returns the number of subdirectives for the Confetti directive dir.

SEE ALSO

conf_get_argument(3), conf_get_argument_count(3)

LICENSING

Confetti is Open Source software distributed under the MIT License. Please see the LICENSE file included with the Confetti distribution for details.