XDF_PREPARE_TRANSFER(3) | xdffileio library manual | XDF_PREPARE_TRANSFER(3) |
xdf_prepare_transfer - Setup the internals of the xDF file to be ready to receive or send data.
#include <xdfio.h>
int xdf_prepare_transfer(struct xdf* xdf);
xdf_prepare_transfer() set up the internal structures of the xDF file referenced by xdf to be ready to receive or send data. After a successful call to it, you can call xdf_write(3) or xdf_read(3) depending of the mode of the xDF file.
Since this function prepares the transfer, no call to any function which configures it will be allowed anymore after xdf_define_arrays(3) succeed. In particular, xdf_set_conf(3), xdf_setchconf(3) and xdf_define_arrays(3) will fail afterwards.
In case of failure due to I/O (file to big, connection to file system lost...), the best procedure is to close the file since the underlying file will be in a undertermined stated.
xdf_define_arrays() returns 0 in case of success. Otherwise -1 is returned and errno is set appropriately.
xdf_define_arrays(3), xdf_set_conf(3), xdf_set_chconf(3), xdf_read(3), xdf_write(3)
2010 | EPFL |