sf_parser_dict

Synopsis

#include <sfparse.h>

int sf_parser_dict(sf_parser *sfp, sf_vec *dest_key, sf_value *dest_value)

sf_parser_dict() reads the next dictionary key and value pair. If this function returns 0, it stores the key and value in dest_key and dest_value respectively, if they are not NULL.

Caller can optionally read parameters attached to the pair by calling sf_parser_param().

This function does no effort to find duplicated keys. Same key may be reported more than once.

Caller should keep calling this function until it returns negative error code. If it returns SF_ERR_EOF, all key and value pairs have been read, and there is nothing left to read.

This function returns 0 if it succeeds, or one of the following negative error codes:

SF_ERR_EOF

All values in the dictionary have read.

SF_ERR_PARSE_ERROR

It encountered fatal error while parsing field value.