Getting all bucket keys using the C library

I’m using the C library to store and get data.
Couldn’t find a way to retrieve all bucket data from the API. I would like to either get all keys (and values) or get all keys that start with a specific string.
Can anybody please help?

best way is to create a primary index on the bucket.
something like
emit(, null);
you can then use this to iterate around the results and do a mget to actually fetch the keys.