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_ADD_CHANNEL(3)					     xdffileio library manual						XDF_ADD_CHANNEL(3)

NAME
xdf_add_channel - Appends a channel to a XDF file SYNOPSIS
#include <xdfio.h> struct xdfch* xdf_add_channel(struct xdf* xdf, const char* label); DESCRIPTION
xdf_add_channel() appends a channel to the file referenced by the handle xdf. The new channel is initialized with the label argument (if not NULL) and with the default channel values set in the XDF file, i.e. those set using channel configuration fields in xdf_set_conf(3) (See the related manpage). If the call to xdf_add_channel(3) is successful, the default offset value (the field referenced by XDF_CF_ARROFFSET) is incremented by the size of the current default stored type (field referenced by XDF_CF_STOTYPE). As a consequence, if the channel default values have not changed in-between, the next call to xdf_add_channel() will create a channel whose location is the array will be next to the previous one. This type of initialization allows the user to add channels without having to specifically pack them: this is achieved by default. RETURN VALUE
xdf_add_channel() returns the handle to newly created channel descriptor in case of success. Otherwise NULL is returned and errno is set appropriately. ERRORS
EINVAL xdf is NULL. ENOMEM The system is unable to allocate resources. EPERM the file referenced by xdf has been opened with the mode XDF_READ SEE ALSO
xdf_copy_chconf(3), xdf_set_conf(3), xdf_set_chconf(3) EPFL
2010 XDF_ADD_CHANNEL(3)
Man Page