%% 
%% $Revision: 1.1.6.4 $
%% 
%%
%% Copyright 1994-2003 The MathWorks, Inc.
%%
%% Abstract:
%%      Library to support the obsolete calls that do not
%%      take a "system" argument.  To be used temporarily
%%      in the interim before the system argument is explicitly
%%      added to RTMs* calls.
%%

%% The following function is a utility function for the routines
%% below; it infers the system index if it is not in scope
%function FcnInferredSystemAndAccessRTMArgDef() void
  
  %if !EXISTS(SystemIdx)
    %assign s = NumSystems-1
    %assign d = "by default"
  %else
    %assign s = SystemIdx
    %assign d = "from enclosing scope"
  %endif
  %return System[System[s].HStructDeclSystemIdx]
  
%endfunction 

%function RTMDispatchToAccessFcn(recordName, fcnGetOrSet, optIdx, ...
  optSetVal, rtmName) void
  
  %return RTMsDispatchToAccessFcn(FcnInferredSystemAndAccessRTMArgDef(), recordName, ...
                                  fcnGetOrSet, optIdx, optSetVal, rtmName)
  
%endfunction

%function RTMSet(recordName, initVal) void
  
  %return RTMsSet(FcnInferredSystemAndAccessRTMArgDef(), recordName, initVal)
  
%endfunction

%function RTMuSet(recordName, initVal) void
  
  %return RTMsuSet(FcnInferredSystemAndAccessRTMArgDef(), recordName, initVal)
  
%endfunction

%function RTMSetIdxed(recordName, fldIdx, initVal) void
  
  %return RTMsSetIdxed(FcnInferredSystemAndAccessRTMArgDef(), recordName, fldIdx, initVal)
  
%endfunction

%function RTMuSetIdxed(recordName, fldIdx, initVal) void
  
  %return RTMsuSetIdxed(FcnInferredSystemAndAccessRTMArgDef(), recordName, fldIdx, initVal)

%endfunction

%function RTMGet(recordName) void
  
  %return RTMsGet(FcnInferredSystemAndAccessRTMArgDef(), recordName)
  
%endfunction

%function RTMuGet(recordName) void
  
  %return RTMsuGet(FcnInferredSystemAndAccessRTMArgDef(), recordName)
  
%endfunction

%function RTMGetIdxed(recordName, fldIdx) void
  
  %return RTMsGetIdxed(FcnInferredSystemAndAccessRTMArgDef(), recordName, fldIdx)
  
%endfunction

%function RTMIs(recordName) void
  
  %return RTMsIs(FcnInferredSystemAndAccessRTMArgDef(), recordName)
  
%endfunction

%function RTMGetTaskTimeCounterForTID(tid) void
  
  %return RTMsGetTaskTimeCounterForTID(FcnInferredSystemAndAccessRTMArgDef(), tid)
  
%endfunction

%function RTMGetTaskTimeForTID(tid) void
  
  %return RTMsGetTaskTimeForTID(FcnInferredSystemAndAccessRTMArgDef(), tid)
  
%endfunction

%function RTMGetTaskTimeForTIDGivenRTM(rtm, tid) void
  
  %return RTMsGetTaskTimeForTIDGivenRTM(FcnInferredSystemAndAccessRTMArgDef(), rtm, tid)

%endfunction

%function RTMGetTaskTime() void
  
  %return RTMsGetTaskTime(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMIsContinuousTask() void
  
  %return RTMsIsContinuousTask(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMIsSampleHit(tid) void
  
  %return RTMsIsSampleHit(FcnInferredSystemAndAccessRTMArgDef(), tid)
  
%endfunction

%function RTMIsSpecialSampleHit(sti, tid) void
  
  %return RTMsIsSpecialSampleHit(FcnInferredSystemAndAccessRTMArgDef(), sti, tid)
  
%endfunction

%function RTMChkMemAndReturnIfErr(ptr) void
  
  %return RTMsChkMemAndReturnIfErr(FcnInferredSystemAndAccessRTMArgDef(), ptr)
  
%endfunction

%function RTMSetBlkStateChange() void
  
  %return RTMsSetBlkStateChange(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMGetErrStat() void
  
  %return RTMsGetErrStat(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMSetErrStat(errStat) void
  
  %return RTMsSetErrStat(FcnInferredSystemAndAccessRTMArgDef(), errStat)
  
%endfunction

%function RTMSetSolverNeedsReset() void
  
  %return RTMsSetSolverNeedsReset(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMModelMthsSet(fldName, sVal) void
  
  %return RTMsModelMthsSet(FcnInferredSystemAndAccessRTMArgDef(), fldName, sVal)

%endfunction

%function RTMSolverSet(fldName,sVal) void
  
  %return RTMsSolverSet(FcnInferredSystemAndAccessRTMArgDef(), fldName,sVal)

%endfunction

%function RTMSolverGet(fldName) void

  %return RTMsSolverGet(FcnInferredSystemAndAccessRTMArgDef(), fldName)

%endfunction

%function RTMSolverAssertCheck() void
  
  %return RTMsSolverAssertCheck(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMLoggingSet(recordName, initVal) void
  
  %return RTMsLoggingSet(FcnInferredSystemAndAccessRTMArgDef(), recordName, initVal)
  
%endfunction
  
%function RTMLoggingGet(recordName) void
  
  %return RTMsLoggingGet(FcnInferredSystemAndAccessRTMArgDef(), recordName)
  
%endfunction
  
%function RTMGetModelSS() void
  
  %return RTMsGetModelSS(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMUpdateIntegerAbsoluteTime() void
  
  %return RTMsUpdateIntegerAbsoluteTime(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMUpdateRealAbsoluteTime() void
  
  %return RTMsUpdateRealAbsoluteTime(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMUpdateRealAbsoluteTimeForTID(tid) void
  
  %return RTMsUpdateRealAbsoluteTimeForTID(FcnInferredSystemAndAccessRTMArgDef(),tid)
  
%endfunction

%function RTMUpdateIntegerAbsoluteTimeForTID(tid) void
  
  %return RTMsUpdateIntegerAbsoluteTimeForTID(FcnInferredSystemAndAccessRTMArgDef(),tid)
  
%endfunction


%function RTMUpdateSubrateTaskTime(subRateIdx) void
  
  %return RTMsUpdateSubrateTaskTime(FcnInferredSystemAndAccessRTMArgDef(), subRateIdx)
  
%endfunction

%function RTMTaskRunsThisBaseStep(subRateIdx) void
  
  %return RTMsTaskRunsThisBaseStep(FcnInferredSystemAndAccessRTMArgDef(), subRateIdx)
  
%endfunction

%function RTMGetStopRequested() void
  
  %return RTMsGetStopRequested(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMSetStopRequested(srq) void
  
  %return RTMsSetStopRequested(FcnInferredSystemAndAccessRTMArgDef(), srq)
  
%endfunction

%function RTMStopReqAccessed() void
  
  %return RTMsStopReqAccessed(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMRegisterDataType(dtypeName) void
  
  %return RTMsRegisterDataType(FcnInferredSystemAndAccessRTMArgDef(), dtypeName)
  
%endfunction

%function RTMGenOpaqueTypedef() void
  
  %return RTMsGenOpaqueTypedef(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMGenRtMdlTypedef() void
  
  %return RTMsGenRtMdlTypedef(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMGenMacroDefines(macroLoc) void
  
  %return RTMsGenMacroDefines(FcnInferredSystemAndAccessRTMArgDef(), macroLoc)
  
%endfunction

%function RTMGenSfcnFwdingMacros() void
  
  %return RTMsGenSfcnFwdingMacros(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction

%function RTMAddExternRTModelDecl() Output
  
  %return RTMsAddExternRTModelDecl(FcnInferredSystemAndAccessRTMArgDef())
  
%endfunction
