evio  6.0
All Data Structures Files Functions Variables Typedefs Macros Modules
eviofmtdump.c File Reference
#include <stdio.h>
#include <stdint.h>

Macros

#define MIN(a, b)   ( (a) < (b) ? (a) : (b) )
 
#define SWAP64(x)   (x)
 
#define SWAP32(x)   (x)
 
#define SWAP16(x)   (x)
 
#define PRINT
 
#define NWORDS   1000000
 

Functions

int eviofmtdump (int32_t *arr, int nwrd, unsigned short *ifmt, int nfmt, int nextrabytes, char *xml)
 This function dumps data into an XML array. More...
 

Macro Definition Documentation

◆ MIN

#define MIN (   a,
 
)    ( (a) < (b) ? (a) : (b) )

◆ NWORDS

#define NWORDS   1000000

◆ PRINT

#define PRINT

◆ SWAP16

#define SWAP16 (   x)    (x)

◆ SWAP32

#define SWAP32 (   x)    (x)

◆ SWAP64

#define SWAP64 (   x)    (x)

Function Documentation

◆ eviofmtdump()

int eviofmtdump ( int32_t arr,
int  nwrd,
unsigned short *  ifmt,
int  nfmt,
int  nextrabytes,
char *  xml 
)

This function dumps data into an XML array.

Converts the data of array (iarr[i], i=0...nwrd-1) using the format code ifmt[j], j=0...nfmt-1).

Algorithm description: data processed inside while(ib < nwrd) loop, where 'ib' is iarr[] index; loop breaks when 'ib' reaches the number of elements in iarr[].

Parameters
arrdata array (words).
nwrdlength of data array in words.
ifmtformat (as produced by eviofmt.c)
nfmtthe number of elements in ifmt[]
nextrabytesnumber of extra bytes at the end of the data.
xmlfilled with number of chars printed.
Returns
the number of bytes in 'xml' if everything fine, negative if error.

References NWORDS.