WYRDTEK Home Features Reference Downloads About



int es_mb_loadbuffer( struct es_mb *db, const char *filen, unsigned bufsize );


struct es_mb *db Database to be loaded.
const char *filen File path name prefix.
unsigned bufsize Buffer size used in de-serializing database.

Return Codes

ES_ERROR_NONE Success. No errors.
ES_ERROR_FAILTOLOAD Failed to load. Check errno for any system errors.


es_mb_loadfile is a wrapper function over es_mb_load() for de-serializing a database from a file. The database must have been previously saved via es_mb_savefile().

bufsize is the size of the internal buffer used by es_mb_loadfile in de-serializing the database.

es_mb_loadfile begins by de-serializing from a file with the name filen as a prefix and "_0.mb" as a postfix. If es_mb_loadfile reaches the end of this file before it has finished de-serializing the database, it starts reading from the file with "_1.mb" as the postfix. es_mb_loadfile continues to read files with incremental postfixes until de-serialization is complete.

[Back To Reference] [Back To Reference/es_mb]