| 72 | } |
| 73 | |
| 74 | unsigned char **raxKeys(rax *rax) { |
| 75 | // Instantiate an array to hold all of the keys in the rax. |
| 76 | unsigned char **keys = array_new(unsigned char *, raxSize(rax)); |
| 77 | raxIterator it; |
| 78 | raxStart(&it, rax); |
| 79 | // Iterate over all keys in the rax. |
| 80 | raxSeek(&it, "^", NULL, 0); |
| 81 | while(raxNext(&it)) { |
| 82 | // Copy the key into the array. |
| 83 | array_append(keys, (unsigned char *)rm_strndup((const char *)it.key, (int)it.key_len)); |
| 84 | } |
| 85 | raxStop(&it); |
| 86 | return keys; |
| 87 | } |
| 88 |
no test coverage detected