sfparse_parser_dict¶
Synopsis¶
#include <sfparse.h>
-
int sfparse_parser_dict(sfparse_parser *sfp, sfparse_vec *dest_key, sfparse_value *dest_value)¶
sfparse_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
sfparse_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
SFPARSE_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:
SFPARSE_ERR_EOF
All values in the dictionary have read.
SFPARSE_ERR_PARSE
It encountered fatal error while parsing field value.