| 499 | } |
| 500 | |
| 501 | static inline bencode_item_t *bencode_dictionary_get_expect(bencode_item_t *dict, const char *key, bencode_type_t expect) { |
| 502 | bencode_item_t *ret; |
| 503 | ret = bencode_dictionary_get(dict, key); |
| 504 | if (!ret || ret->type != expect) |
| 505 | return NULL; |
| 506 | return ret; |
| 507 | } |
| 508 | static inline str *bencode_collapse_str(bencode_item_t *root, str *out) { |
| 509 | out->s = bencode_collapse(root, &out->len); |
| 510 | return out; |
no test coverage detected