The following parallels exist between the IRAPI and TAS scripts:
Any TAS script irExec'ed or irSubProg'ed from an IRAPI application has access to data passed via the IRP_EXEC_BUF parameter through the X.0 code.
The TAS script registers are preloaded with the values found in IRP_REGISTER, assuming that the data for this parameter is arranged as a block of 16 continuous integer values.
The following example shows how a TAS application is started from an IRAPI process. The registers are set with the data supplied through the register argument and the buf and buf_len arguments set the exec buffer. Note that IRP_EXEC_BUF and IRP_EXEC_BUF length are set automatically by the irExecp (or irSubProgp) function. The define symbol "TSM'' is defined in /att/include/mesg.h.
int exec_tas(channel_id cid, const int *register, const char *buf,
int buf_len, const char *service)
{
(void) irSetParamStr(cid, IRP_REGISTER, register);
if ( irExecp(cid, service, TSM, buf, buf_len) == IRR_FAIL ) {
return(0);
}
return(1);
}