Libcouchbase C API without callbacks?

The primary reason we’re not returning the object is that it would normally just require extra memory copying. With the callback method you can pass in the object you want to populate as the command cookie, and in the callback copy the data where you want to do it directly from the internal buffers in libcouchbase.

If libcouchbase should copy the data into another buffer and return that to you we would have a new challenge figuring out who is responsible for maintaining that buffer and do the free. If the application use a special memory manager etc it would also be complex to do that.

Hope this helps.

Cheers,
Trond