Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xdf_closest_type(3) [debian man page]

XDF_CLOSEST_TYPE(3)					     xdffileio library manual					       XDF_CLOSEST_TYPE(3)

NAME
xdf_closest_type - Returns a compatible data type SYNOPSIS
#include <xdfio.h> int xdf_closest_type(struct xdf* xdf, enum xdftype target); DESCRIPTION
xdf_closest_type() selects among the data types supported by the file referenced by xdf the type that is the closest to the target argu- ment. The selected type can then be safely used in a call to xdf_set_chconf(3) with the XDF_CF_STOTYPE field. The selection algorithm is based on the 3 following criterions (cited by priority, i.e. most important cited first): data size, signed/unsigned type, float/integer value. The data size criterion forces the selected type to have a data size (number of byte to repre- sent the value) equal or bigger than the one of the target type (with a preference with sizes the closest to the size of target). The signed/unsigned criterion tries to select a type that has the same signeness (signed or unsigned data type) as the target. Finally the float/integer criterion tries to select a floating point type if target is float or double or an integer data type if target is an integer type. As a consequence, if target is supported by the underlying file format of xdf, the function is ensured to return target. RETURN VALUE
xdf_closest_type() returns the selected data type in case of success, otherwise -1 and errno is set appropriately. ERRORS
EINVAL the xdf pointer is NULL, or the argument type is not an admissible enum xdftype value. SEE ALSO
xdf_set_chconf(3) EPFL
2010 XDF_CLOSEST_TYPE(3)

Check Out this Related Man Page

XDF_PREPARE_TRANSFER(3) 				     xdffileio library manual					   XDF_PREPARE_TRANSFER(3)

NAME
xdf_prepare_transfer - Setup the internals of the xDF file to be ready to receive or send data. SYNOPSIS
#include <xdfio.h> int xdf_prepare_transfer(struct xdf* xdf); DESCRIPTION
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 suc- cessful 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 underly- ing file will be in a undertermined stated. RETURN VALUE
xdf_define_arrays() returns 0 in case of success. Otherwise -1 is returned and errno is set appropriately. ERRORS
EINVAL xdf is NULL. ENOMEM The system is unable to allocate memory resources. EFBIG An attempt was made to write a file that exceeds the implementation-defined maximum file size or the process's file size limit, or to write at a position past the maximum allowed offset. EINTR The call was interrupted by a signal before any data was written; see signal(7). EIO A low-level I/O error occurred while modifying the inode. ENOSPC The device containing the xDF file has no room for the data. ESTALE Stale file handle. This error can occur for NFS and for other file systems SEE ALSO
xdf_define_arrays(3), xdf_set_conf(3), xdf_set_chconf(3), xdf_read(3), xdf_write(3) EPFL
2010 XDF_PREPARE_TRANSFER(3)
Man Page