3.3.4.3 Write the Plug-in Entry Routine

Each plug-in must have an “entry” routine and specified in plug-in registration process. In this routine, the virtual function table and plug-in information structure must be supplied to the plug-in instance handler.

The following listing shows a plug-in routine example

Plug-in Entry Routine

int _TMDLLENTRY
plugin_entry(_TCADEF, const char *pIId,
       const char *pImplId,
       const struct _e_pif_iversion *version,
       const struct _e_pif_data *pData,
       const struct _e_pif_interception_data *pInterceptionData,
       struct _e_pif_instance_handles *pI,
       TM32U flags)
{
const char * const * regData = pData->regdata;
char *logfile = NULL;
       pI->pVtbl = (void *) &Vtblperfapp_1;
       pI->pPluginInfo = (_e_pif_plugin_info *) &perf_mon_1_info;
       pI->pPrivData = NULL;
       return (EE_SUCCESS);
}

Note:

It is recommended that you use the fixed process shown in the sample. The “entry” routine is called only once to instantiate the plug-in.