There are some cases where the librarires provided to create ring items are not well suited for the job. Specifically, sometimes you'd like to create ring items to be emitted on stdout.
A simple set of functions that can be called by either C or C++ programs allows you to format ring items that can be dealt with however you might wish.
The functions provided are prototyped in DataFormat.h. The functions are also part of libdataformat.so.
The reference section provides full documentation. All functions
return a pointer to storage allocated with malloc(3)
that contains the ring item. It is the caller's responsibility
to invoke free(3) to release this storage.
The
function names you will need are:
formatEventItemFormats the data read from a physics trigger into a ring item.
formatTriggerCountItemFormats a trigger count item.
formatScalerItemCreates an incremental scaler ring item.
formatTextItemFormats a text string item. Text string items are items whose payload contains, among other things, a set of null terminated strings.
formatStateChangeCreates a state change ring item. State change ring items indicate that the run state has changed.