Back

NAME

conf_get_comment, conf_get_comment_count - retrieve comments

LIBRARY

Configuration parser (libconfetti, -lconfetti)

SYNOPSIS

#include <confetti.h>

const conf_comment *conf_get_comment(const conf_unit *unit, long index);
long conf_get_comment_count(const conf_unit *unit);

DESCRIPTION

The conf_get_comment() function returns the comment at index for the Confetti configuration unit. The pointer returned remains valid until unit is released with conf_free(3).

The conf_get_comment_count() function returns the number of comments discovered in the Confetti configuration unit.

Comment structure

The conf_comment structure includes the following fields:

size_t offset;
size_t length;

The offset and length fields describe the span of UTF-8 code units of the comment in the Confetti source text.

RETURN VALUE

RETURN VALUE

The conf_get_comment() function returns the comment at index for the Confetti configuration unit. If index is out-of-bounds or unit is NULL, then NULL is returned.

The conf_get_comment_count() function returns the number of comments for the Confetti configuration unit.

LICENSING

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