The pl_driver_inherit(method) function

This function returns a pointer to the function that currently supports the passed method and advances the method chain so that the next request returns the next function in the method list.

Function information Description of arguments
Function type: int  
Input argument: int method Method ID
Return values: PL_RTN_OK, PL_RTN_FAIL  

When you inherit a driver and use the pl_set_method_function to override a method, you can assume all processing functionality for method.

However, if you want to add to the existing processing functionality, pl_driver_inherit returns the function that was installed in the function table before the call to pl_set_method_function.

Example

You are processing a file in which the context of the data determines the record fields present. You want to analyze the records and reformat the data into a delimited format that the onpload data converter recognizes.

In the driver setup, specify that your function should inherit the Delimited driver and add your custom function to the PL_MTH_READREC method.

When your function is called, get the inherited function with pl_driver_inherit(). Invoke this function, which returns a pointer to the start of a record and its length.

Apply your changes to the data in the buffer that is returned by the call to the inherited function.


Copyright© 2018 HCL Technologies Limited