| #include "cn-cbor/cn-cbor.h" |
| cn_cbor* cn_cbor_mapget_int(const cn_cbor* cb, int key) { |
| for (cp = cb->first_child; cp && cp->next; cp = cp->next->next) { |
| if (cp->v.uint == (unsigned long)key) { |
| if (cp->v.sint == (long)key) { |
| ; // skip non-integer keys |
| cn_cbor* cn_cbor_mapget_string(const cn_cbor* cb, const char* key) { |
| for (cp = cb->first_child; cp && cp->next; cp = cp->next->next) { |
| case CN_CBOR_TEXT: // fall-through |
| if (keylen != cp->length) { |
| if (memcmp(key, cp->v.str, keylen) == 0) { |
| ; // skip non-string keys |
| cn_cbor* cn_cbor_index(const cn_cbor* cb, unsigned int idx) { |
| for (cp = cb->first_child; cp; cp = cp->next) { |