Specifications for Data Conversion Functions

All data conversion functions must be integer functions returning TRUE if the data or string was successfully converted and FALSE if an error occurred.

All data conversion functions must accept four parameters: a pointer to a string, a pointer to a data variable of the appropriate type for the field, a pointer to a field structure, and a pointer to a conversion buffer.

The complete call for a function that converts data is as follows:

int dc_func(stp, datap, dfldp, cvbufp)
 
UCHAR *stp;
/* Pointer to string
*/
PTR datap;
/* Pointer to data variable
*/
DFIELDPTR dfldp;
/* Pointer to data field to be converted 
*/
UCHAR *cvbufp;
/* Pointer to conversion buffer
*/

The size of the string is based on the length of the field picture. The system passes a conversion buffer so you do not have to allocate memory in your data conversion functions. The conversion buffer is of the size specified in the field type structure for the field type and should be large enough to hold the longest string representation of the underlying variable.


Home Contents Previous Next