API functions

Depending on the value of the HPLAPIVERSION parameter in the plconfig file, onpload expects your custom-conversion function to have one of the following prototypes.

If the HPLAPIVERSION parameter is set to 0 or HPLAPIVERSION is not present in the plconfig file, use the following prototype:
/*
 * input::  char* outbuffer:  where to put your output.
 *  intbuflen: size you have for your output.
 *  char* value:  the input value to work on.
 * return:: 0 to indicate ok.
 *  non-zero  to discard entire record.
 */

int your_func(outbuffer, buflen, value)
char *outbuffer;
intbuflen;
char *value;
{
/* your processing here */
}
If the HPLAPIVERSION parameter is set to 1, use the following prototype:
/*
 * input::  char* outbuffer:  where to put your output.
 *  intbuflen: size you have for your output.
 *  char* value:  the input value to work on.
 *  intvallen: size of the input value.
 * return:: 0 to indicate ok.
 *  non-zero  to discard entire record.
 */

int your_func(outbuffer, buflen, value, vallen)
char *outbuffer;
intbuflen;
char *value;
intvallen;
{
/* your processing here */
}

To discard an entire record, return a nonzero value. Otherwise, return a zero value.

The following functions support your access to data in the source and destination buffers.