Preparing the plcstdrv.c file

About this task

To prepare the plcstdrv.c file:

Procedure

  1. Use the following code as a template to create the plcstdrv.c file.
    You can copy a template for plcstdrv.c from the $INFORMIXDIR/incl/hpl directory.
    /*******************************************************
     * Start of plcstdrv.c 
     */
    
    /* plcstdrv.h is in $INFORMIXDIR/incl/hpl */
    #include "plcstdrv.h"
    
    /* Your driver configuration function */
    int your_driver_config_function(); 
    
    (*pl_get_user_method(driver, method)) ()
    char *driver;
    intmethod;
    {
    /*
     * your_driver_name is the name of your driver 
     */
    if (strcmp(driver, "your_driver_name") == 0)
    {
    /*
     * If onpload is trying to configure the driver, 
     * return the function that will handle the 
     * initialization.
     */
    if (method == PL_MTH_CONFIGURE)
    return(your_driver_config_function);
    }
    /*
     * YYYY is the name of another driver
     * This is how additional custom drivers are configured
     */
    if (strcmp(driver, "YYYY") == 0)
    {
    if (method == PL_MTH_CONFIGURE)
    return(YYYY_driver_config_function);
    }
    }
    /***************** end of plcstdrv.c *******************/
  2. Replace your_driver_name with the name of the driver that you chose in step 1 of Adding the driver name to the onpload database.
  3. Replace your_driver_config_function with the function name of the driver-configuration function that you coded in your_custom_driver.c.
  4. To add multiple custom drivers, repeat the main if statement for each driver.