logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mtbl_source - obtain key-value entries from a data source

Description

       The mtbl_source interface provides an abstraction for reading key-value entries from mtbl data sources.

       mtbl_source_iter() provides an iterator over all of the entries in the data source.

       mtbl_source_get() provides an exact match iterator which returns all entries whose key matches the key
       provided in the arguments key and len_key.

       mtbl_source_get_prefix() provides a prefix iterator which returns all entries whose keys start with
       prefix and are at least len_prefix bytes long.

       mtbl_source_get_range() provides a range iterator which returns all entries whose keys are between key0
       and key1 inclusive.

       mtbl_source_write() is a convenience function for reading all of the entries from a source and writing
       them to an mtbl_writer object. It is equivalent to calling mtbl_writer_add() on all of the entries
       returned from mtbl_source_iter().

Name

       mtbl_source - obtain key-value entries from a data source

Return Value

mtbl_source_iter(), mtbl_source_get(), mtbl_source_get_prefix(), and mtbl_source_get_range() return
       mtbl_iter objects.

       mtbl_source_write() returns mtbl_res_success if all of the entries in the data source were successfully
       written to the mtbl_writer argument, and mtbl_res_failure otherwise.

See Also

mtbl_iter(3)

                                                   11/21/2016                                     MTBL_SOURCE(3)

Synopsis

#include<mtbl.h>structmtbl_iter*mtbl_source_iter(conststructmtbl_source*s);structmtbl_iter*mtbl_source_get(conststructmtbl_source*s,constuint8_t*key,size_tlen_key);structmtbl_iter*mtbl_source_get_prefix(conststructmtbl_source*s,constuint8_t*prefix,size_tlen_prefix);structmtbl_iter*mtbl_source_get_range(conststructmtbl_source*s,constuint8_t*key0,size_tlen_key0,constuint8_t*key1,size_tlen_key1);mtbl_resmtbl_source_write(conststructmtbl_source*s,structmtbl_writer*w);voidmtbl_source_destroy(structmtbl_source**s);

See Also