ext/iodine/fiobj_json.c
/**
 * Updates a Hash using JSON data.
 *
 * Parsing errors and non-dictionar object JSON data are silently ignored,
 * attempting to update the Hash as much as possible before any errors
 * encountered.
 *
 * Conflicting Hash data is overwritten (prefering the new over the old).
 *
 * Returns the number of bytes consumed. On Error, 0 is returned and no data is
 * consumed.
 */
Updates a Hash using JSON data.
Parsing errors and non-dictionar object JSON data are silently ignored,
attempting to update the Hash as much as possible before any errors
encountered.

Conflicting Hash data is overwritten (prefering the new over the old).

Returns the number of bytes consumed. On Error, 0 is returned and no data is
consumed.
Updates a Hash using JSON data . Parsing errors and non - dictionar object JSON data are silently ignored attempting to update the Hash as much as possible before any errors encountered . Conflicting Hash data is overwritten ( prefering the new over the old ) . Returns the number of bytes consumed . On Error 0 is returned and no data is consumed .
size_t fiobj_hash_update_json(FIOBJ hash, const void *data, size_t len) {
  if (!hash)
    return 0;
  fiobj_json_parser_s p = {.top = FIOBJ_INVALID, .target = hash};
  size_t consumed = fio_json_parse(&p.p, data, len);
  fio_json_stack_free(&p.stack);
  fiobj_free(p.key);
  if (p.top != hash)
    fiobj_free(p.top);
  return consumed;
}
size_t fiobj_hash_update_json ( FIOBJ hash , const void * data , size_t len ) { if ( ! hash ) return 0 ; fiobj_json_parser_s p = { . top = FIOBJ_INVALID , . target = hash } ; size_t consumed = fio_json_parse ( & p . p , data , len ) ; fio_json_stack_free ( & p . stack ) ; fiobj_free ( p . key ) ; if ( p . top != hash ) fiobj_free ( p . top ) ; return consumed ; }
Updates a Hash using JSON data.
Updates a Hash using JSON data .