cwbOBJ_AnalyzeSplFData

Purpose

Analyze data for a spooled file and give a best guess as to what the data type is.

Syntax

 
unsigned int CWB_ENTRY cwbOBJ_AnalyzeSplFData(
                              const char           *data,
                              unsigned long         bufLen,
                              cwbOBJ_SplFDataType  *dataType,
                              cwbSV_ErrHandle       errorHandle);

Parameters

const char *data - input
pointer to data to be analyzed.
unsigned long bufLen - input
The length of the buffer pointed to by data.
cwbOBJ_SplFDataType *dataType - output
On output this will contain the data type. If the data type can not be determined, it defaults to CWBOBJ_DT_USERASCII.
cwbSV_ErrHandle errorHandle - output
Optional, may be 0. Any returned messages will be written to this object. It is created with the cwbSV_CreateErrHandle() API. The messages may be retrieved through the cwbSV_GetErrText() API. If the parameter is set to zero, no messages will be retrievable.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_PARAMETER
Invalid parameter specified.

Usage

This uses the same routine that is used during the creation of spooled files that don't have a data type specified or have a data type of *AUTO specified. The result defaults to *USERASCII if it can not be determined.