The pl_set_method_function() registers a passed function to the passed method ID. For a description of the method IDs (defined in $INFORMIXDIR/incl/plcustom/pldriver.h) applicable to your driver implementation, refer to the Available API Support Functions. The following table shows the available methods.
You do not need to register a function for any of the methods IDs (although presumably you register at least one, or there is no point in writing the driver).
Use the pl_driver_inherit() function to get the standard function for the passed method. For example, to find and execute the function currently registered for reading data from the load input, you would code as follows:
int my_rawread_function(bufptr, bufsize, bytesread) char *bufptr; int bufsize; int *bytesread; { int (*funcptr)(); int rtn; funcptr = pl_driver_inherit(PL_MTH_RAWREAD); rtn = (*funcptr)(bufptr, bufsize, &bytesread); if (rtn) return(rtn); /* error */ /* * Now you have a buffer of data in bufptr, of * size bytesread. So you can process data in * this buffer here before it is converted */ return(rtn); }
For performance reasons, system calls are strongly discouraged. System calls cause the VP on which the driver thread is running to be blocked for the duration of the system call. This blockage prevents the VP from doing other work, causing onpload to run less efficiently.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]