| 487 | } |
| 488 | |
| 489 | int pni_decoder_single_described(pn_decoder_t *decoder, pn_data_t *data) |
| 490 | { |
| 491 | if (!pn_decoder_remaining(decoder)) { |
| 492 | return PN_UNDERFLOW; |
| 493 | } |
| 494 | |
| 495 | uint8_t code = *decoder->position++;; |
| 496 | |
| 497 | if (!pni_allowed_descriptor_code(code)) { |
| 498 | return PN_ARG_ERR; |
| 499 | } |
| 500 | |
| 501 | int err = pni_decoder_decode_value(decoder, data, code); |
| 502 | if (err) return err; |
| 503 | |
| 504 | if (pni_data_parent_type(data) == PN_DESCRIBED && pn_data_siblings(data) > 1) { |
| 505 | pn_data_exit(data); |
| 506 | } |
| 507 | return 0; |
| 508 | } |
| 509 | |
| 510 | int pni_decoder_single(pn_decoder_t *decoder, pn_data_t *data) |
| 511 | { |
no test coverage detected