| |||||||||
Reference/es_mb_loadSyntaxint es_mb_load( struct es_mb *db, struct es_mbio *iofn ); Arguments
Return Codes
DescriptionRead and deserialize database with using user-supplied "read" function. The The /* read/write function prototype */ typedef int (*es_mb_io_t)( void *fndata, void *buf, unsigned numbytes ); /* handle for read/write functions and static-data */ struct es_mbio { void *fndata; /* user-specific data */ es_mb_io_t writefn; /* write function */ es_mb_io_t readfn; /* read function */ }; es_mb_load() repeatedly invokes
User-defined fields (see es_mbc_addfldmbu()) must have an associated "load" function defined in order to be de-serialized as part of es_mb_load. There are two wrapper functions over es_mb_load, provided for convenience. These include es_mb_loadfile() for loading from a file and es_mb_loadbuffer() for loading from an arbitrary file-descriptor - most notably a socket. | |||||||||
Copyright © 2012 by Richard Brooks |