Search a key and retrieve the pointer and len of the associated value. * If the key is found the function returns 1, otherwise 0. */
| 336 | /* Search a key and retrieve the pointer and len of the associated value. |
| 337 | * If the key is found the function returns 1, otherwise 0. */ |
| 338 | int zipmapGet(unsigned char *zm, unsigned char *key, unsigned int klen, unsigned char **value, unsigned int *vlen) { |
| 339 | unsigned char *p; |
| 340 | |
| 341 | if ((p = zipmapLookupRaw(zm,key,klen,NULL)) == NULL) return 0; |
| 342 | p += zipmapRawKeyLength(p); |
| 343 | *vlen = zipmapDecodeLength(p); |
| 344 | *value = p + ZIPMAP_LEN_BYTES(*vlen) + 1; |
| 345 | return 1; |
| 346 | } |
| 347 | |
| 348 | /* Return 1 if the key exists, otherwise 0 is returned. */ |
| 349 | int zipmapExists(unsigned char *zm, unsigned char *key, unsigned int klen) { |
no test coverage detected