Next: bpipe_strerror, Previous: bpipe_proc_def, Up: Utility Functions [Contents]
Format a BPipe
data field for output.
#include <bpipe/bpipe.h> int bpipe_sprintf( char *s, const void *data, BPDataType type, char *const formats[] );
char *s
a buffer to hold the formatted output. it should be large enough to hold any output from any data type
const void *data
a pointer to the data to be formatted
BPDataType type
the data’s
BPipe
datatype code
Possible values for a
BPDataType
are as follows:BPDType_char
,BPDType_double
,BPDType_int
,BPDType_uint
,BPDType_DVector2
,BPDType_DVector3
,BPDType_IVector2
,BPDType_IVector3
,BPDType_UIVector2
,BPDType_UIVector3
,BPDType_DComplex
,BPDType_DCVector2
,BPDType_DCVector3
char *const formats[]
an array of pointers to formats, with
BPDType_num
elements. These should be in the order of theenum
’s (see bpipe.h) The first element (corresponding toBPDType_NOTYPE
, should contain an error message. If this argument isNULL
, the default formats are used
This routine will format a data field for output. It fills a
user-provided array with characters representing the data, in much
the same way that sprintf
does. It uses default output
formats for the various data types, which may be changed by
providing a new array of output formats.
It returns the same value as does sprintf
.