| |||||||||
Reference/es_mb_saveSyntaxint es_mb_save( struct es_mb *db, struct es_mbio *iofn ); Arguments
Return Codes
DescriptionSerialize database into binary stream and pass to user-provided "write" function. 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_save() repeatedly invokes
User-defined fields (see es_mbc_addfldmbu()) must have an associated "save" function defined in order to be serialized as part of es_mb_save. Node reference fields (i.e. fields of type There are two wrapper functions over es_mb_save, provided for convenience. These include es_mb_savefile() for saving to files and es_mb_savebuffer() for saving to arbitrary file-descriptors - most notably sockets. | |||||||||
Copyright © 2012 by Richard Brooks |