3.3.2.1 Create Plug-in Source Code

The following listing displays an example of the Oracle TSAM Plus plug-in customplugin.c.

The following code snippet is an example of customplugin.c Plug-in Source Code:

Oracle TSAM Plus Agent customplugin.c Plug-in Source Code Example

#include <e_pif.h>
#include <tpadm.h>
#include <fml32.h>
#include <e_perf_mon.h>

static TM32I _TMDLLENTRY print_app(
       perf_mon_1 *,
       FBFR32 **,
       MONITORCTL *,
       TM32U);

static TM32I _TMDLLENTRY print_svc(
       perf_mon_1 *,
       FBFR32 **,
       MONITORCTL *,
       TM32U);

static TM32I _TMDLLENTRY print_sys(
       perf_mon_1 *,
       FBFR32 **,
       MONITORCTL *,
       TM32U);

static TM32I _TMDLLENTRY print_tran(
       perf_mon_1 *,
       FBFR32 **,
       MONITORCTL *,
       TM32U);

static TM32I _TMDLLENTRY plugin_destroy (
       _TCADEF,
       const struct _e_pif_instance_handles *,
       TM32U);

static TM32I _TMDLLENTRY plugin_copy (_TCADEF,
       void *,
       const struct _e_pif_interception_data *,
       struct _e_pif_instance_handles *,
       TM32U);

static const perf_mon_1 Vtblperfapp_1 = {
       print_app,
       print_svc,
       print_sys,
       print_tran,
};

static const _e_pif_plugin_info perf_mon_1_info = {
       { 1, 0 }, /* interface major version */
       { 1, 0 }, /* implementation */
       "abc/tuxedo/tsam", /* implementation id */
       ED_PERF_MON_INTF_ID, /* interface id */
       4, /* virtual table size */
       "ABC, Inc.", /* vendor */
       "Custom Plug-in for Oracle TSAM", /* product name */
       "1.0", /* vendor version */
       EF_PIF_SINGLETON, /* m_flags */
       plugin_destroy,
       plugin_copy
};

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);
}


static TM32I _TMDLLENTRY
plugin_destroy (_TCADEF, const struct _e_pif_instance_handles *pIhandles,
       TM32U flags)
{
       return(EE_SUCCESS);
}


static TM32I _TMDLLENTRY
plugin_copy (_TCADEF, void *iP,
       const struct _e_pif_interception_data *pInterceptionData,
       struct _e_pif_instance_handles *pIhandles,
       TM32U flags)
{
       return(EE_SUCCESS);
}
static TM32I _TMDLLENTRY print_app(perf_mon_1 * ip,FBFR32 **buf, MONITORCTL * monctl, TM32U flags)
{
       Fprint32(*buf);
       return(0);
}

static TM32I _TMDLLENTRY print_svc(perf_mon_1 * ip,FBFR32 **buf, MONITORCTL * monctl, TM32U flags)
{
       Fprint32(*buf);
       return(0);
}

static TM32I _TMDLLENTRY print_sys(perf_mon_1 * ip,FBFR32 **buf, MONITORCTL * monctl, TM32U flags)
{
       Fprint32(*buf);
       return(0);
}
static TM32I _TMDLLENTRY print_tran(perf_mon_1 * ip,FBFR32 **buf, MONITORCTL * monctl, TM32U flags)
{
       Fprint32(*buf);
       return(0);
}