Depending on the value of the HPLAPIVERSION parameter in the plconfig file, onpload expects your custom-conversion function to have one of the prototypes listed below.
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. * int buflen: 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; int buflen; 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. * int buflen: size you have for your output. * char* value: the input value to work on. * int vallen: 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; int buflen; char *value; int vallen; { /* 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.
This routine retrieves the source value that is associated with fldname and copies the value to the specified buffer.
Arguments | I/O | Description |
---|---|---|
char *fldname | Input | Name of source field, as defined in ipload map |
char *buffer | Input | Address where fldname value is placed |
int buflen | Input | Buffer size in bytes |
This routine retrieves the destination value that is associated with fldname and copies the value to the specified buffer.
Arguments | I/O | Description |
---|---|---|
char *fldname | Input | Name of destination field, as defined in ipload map |
char *buffer | Input | Address where fldname value is placed |
int buflen | Input | Buffer size in bytes |
If a previous conversion has not set the destination value, this routine sets the destination value that is passed to the buffer. The ipload utility automatically clips the data value if it is too long.
Arguments | I/O | Description |
---|---|---|
char *fldname | Input | Name of destination field, as defined in ipload map |
char *buffer | Input | Address where fldname value is placed |
This routine returns the maximum length of the data buffer that is associated with fldname.
Arguments | I/O | Description |
---|---|---|
char *fldname | Input | Name of destination field, as defined in ipload map |