| |||||||||
Reference/es_mb_saveSyntaxint es_mbd_save( struct es_mbd *def, struct es_mbio *iofn ); Arguments
Return Codes
DescriptionSerialize database definition 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_mbd_save() repeatedly invokes
The callback function interface for user-defined fields (provided via es_mbc_addfldmbu() ) are not saved and must be re-applied explicitly to any schema de-serialized via es_mbd_load(). There are two wrapper functions over es_mbd_save, provided for convenience. These include es_mbd_savefile() for saving to files and es_mbd_savebuffer() for saving to arbitrary file-descriptors - most notably sockets. | |||||||||
Copyright © 2012 by Richard Brooks |