Product Documentation

Automatic Data Aggregation

Previous Topic

Next Topic

WhichAutoSysTimeFields()

Retrieve in bufptr the A_STFIELDS fields definition structure.

VRLEN WhichAutoSysTimeFields(COUNT datno, pVOID bufptr, VRLEN bufsiz)

Parameters:

  • datno: the data file number
  • bufptr: pointer to a buffer where to store the definition (after successful return it can be cast to A_STFIELDS)
  • bufsiz: size of bufptr

Return:

  • size of bufptr actually used.
  • uerr_cod needs to be checked if an error condition occurred.
    • A return value of 0 with uerr_cod 0 indicates that no field has been configured.
    • uerr_cod set to VBSZ_ERR indicates bufsiz is too small. Return value contains the required size.

Example:

IFIL vcustomer = {

"vcusti",

-1,

8,

4096,

ctSHARED | ctVLENGTH | ctTRNLOG,

1,

4096,

ctSHARED | ctTRNLOG,

ndxs,

"CustomerNumber",

"City"

};

#define CUSTDAT vcustomer.tfilno /* customer data file */

VRLEN reclen;

reclen = WhichAutoSysTimeFields(CUSTDAT, buf2, sizeof(buf2));

if (uerr_cod != 0)

{

ctrt_printf("Error: WhichAutoSysTimeFields Failed (open ctSHARED): %d\n",

uerr_cod);

goto err_ret;

}

TOCIndex