NAME
          IrEXTEND - IRAPI extension function dynamic switch tables


     SYNOPSIS
          #include <irapi.h>


     DESCRIPTION
          The IRAPI dynamic switch function tables
          Iri_ExtendInit_table , Iri_ExtendStart_table ,
          Iri_ExtendExecute_table , Iri_ExtendExit_table ,
          Iri_ExtendQuit_table , Iri_ExtendTrace_table , and
          Iri_Extend_Name_table support the TSM extend instruction,
          and the IRAPI function irXName.

          By default, these tables are empty.  Customer written C
          language extension functions may be added to them via
          irSPIRegister(3SPI) .

          When the TSM process initializes TSM calls irExtendInit( 0
          ), and in turn all functions in the Iri_ExtendInit_table are
          executed.

          When the TSM process starts executing a script TSM calls
          irExtendStart( 0, cid, scriptname ), and in turn all func-
          tions in the Iri_ExtendStart_table are executed.

          When TSM executes the extend( id ) instruction TSM calls
          irExtendExecute( id, cid, scriptname, reg ) and in turn the
          function in the Iri_ExtendExecute_table which corresponds to
          extension function id is executed.

          When a script exits TSM calls irExtendExit( 0, cid,
          scriptname ), and in turn all functions in the
          Iri_ExtendExit_table are executed.

          When the TSM process receives a signal SIGQUIT TSM calls
          irExtendQuit( 0 ), and in turn all functions in the
          Iri_ExtendQuit_table are executed.

          When the TSM process receives a signal SIGUSR1 TSM calls
          irExtendTrace( 0 ), and in turn all functions in the
          Iri_ExtendTrace_table are executed.

          When an IRAPI program calls irXName(id) the function in the
          Iri_Extend_Name_table which corresonds to the extension
          library number for id is executed.

          See irExtend(3IRAPI) for more information on how these func-
          tions operate.

     EXAMPLE
          See /vs/examples/IRAPI/util_fcns.c for a sample extension
          library which implements simple utility functions for TSM.
          The following from util_fcns.c demonstrates how to add
          entries to these IRAPI dynamic switch tables:


          int irSPIRegister( void )
          {
              static const char *fnName = "irSPIRegister";
              int ret = IRR_OK;

              irQTraceP(IRD_INVALID, TEE, TAREA,
               vfmtstr( "%s: ENTER: libirUTIL.so", fnName ));

              if (irDynSwitchAdd(Iri_Extend_Name_table, IRD_EXT_LIBA,
               iri_XNameA) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendInit_table, IRX_UTIL,
               iri_IRX_UTIL_init) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendStart_table, IRX_UTIL,
               iri_IRX_UTIL_start) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendExecute_table, IRX_LBOLT,
               iri_IRX_LBOLT_execute) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendExecute_table, IRX_TIME,
               iri_IRX_TIME_execute) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendExecute_table, IRX_RAND,
               iri_IRX_RAND_execute) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendExecute_table, IRX_CTIME,
               iri_IRX_CTIME_execute) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendExit_table, IRX_UTIL,
               iri_IRX_UTIL_exit) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendQuit_table, IRX_UTIL,
               iri_IRX_UTIL_quit) == IRR_FAIL) ret = IRR_FAIL;

              if (irVADynSwitchAdd(Iri_ExtendTrace_table, IRX_UTIL,
               iri_IRX_UTIL_trace) == IRR_FAIL) ret = IRR_FAIL;

              return(ret);
          }



     FILES
          /att/include/irExtend.h, /att/include/irStructure.h,
          /vs/data/irSPI.libs, /vs/examples/IRAPI/util_fcns.c


     ERROR
          irError may be set by the functions called through the IRAPI
          dynamic switch tables.


     SEE ALSO
          irDefine(3IRAPI), irErrorStr(3IRAPI), irExtend(3IRAPI)
          irName(3IRAPI), irRegister(3IRAPI), irSPIRegister(3IRAPI),
          IrDEFINES(4IRAPI), IrEXTEND(4IRAPI), IrPARAMETERS(4IRAPI),
          irSPI.libs(4IRAPI)


     VERSION
          This is version 8/31/00 of this man page.