/* Copyright 2019 The MathWorks, Inc. */
%if EXISTS("_BLKIO_INTERNALAPI_") == 0
%assign _BLKIO_INTERNALAPI_ = 1
 
%%Function:LibGetInputPortRecordIsValid=================================
%%Abstract:
%%IftheportIdxisastring,thefunctionthrowsanerror.The
%%portIdxhastoalwaysbeanumber.
%%
%function LibGetInputPortRecordIsValid(portIdx) void
  %if TYPE(portIdx) == "String"
    %assign errTxt = "portIdx cannot be a string"
    %<LibBlockReportError([],errTxt)>
  %endif
%endfunction
 
 
%%Function{BlockFunctions}:SLibBlockTypeSetupName
%%Abstract:
%%ReturntheBlockTypeSetupmethod'sname
%%
%function SLibBlockTypeSetupName(sysIdx, blkIdx) void
  %assign BlockTypeSetupName = ""
  %if Type == "Opaque"
    %assign BlockTypeSetupName = "BlockTypeSetupForBlockType_Opaque"
  %else
    %assign BlockTypeSetupName = CGMODEL_ACCESS("Block.BlockTypeSetupName", sysIdx, blkIdx)
  %endif
   
  %return BlockTypeSetupName
%endfunction
 
%%Function{InputSignalFunctions}:SLibBlockInputAllowScalarsExpandedExpr
%%Abstract:
%%Allowstheinputsignaltobeanexpression,evenwhenanyofthe
%%outputsignalsarewide.IscalledinBlockSetupAndCompatiblityCheck.
%%
%function SLibBlockInputSignalAllowScalarExpandedExpr(block, ipIdx) void
  %return CGMODEL_ACCESS("Block.GetInputAllowScalarExpandedExpr", ...
    block.BlockIdx[0], block.BlockIdx[2], ipIdx)
%endfunction
 
%%Function{OutputSignalFunctions}:SLibSetBlockOutputSignalsAreNotExpr
%%Abstract:
%%Forceeachblockoutputintoavariable.
%%ThisroutineisusedtoturnoffoutputexpressionsinTLC
%%whentheTLCimplementationofthisblockdoesn'tsupportoutput
%%expressions,orultimatelywhentheTLCimplementationofa
%%destinationblockdoesnotacceptoutputexpressions
%%
%function SLibSetBlockOutputSignalsAreNotExpr(block) void
  %% NOTICE: Constant expressions are predetermined in the Simulink
  %% engine and can not be switched off using TLC. This is due to
  %% significant code generation speed penalty if the constant
  %% expressions would be configurable in TLC.
  %%
  %    block.BlockIdx[0], block.BlockIdx[2])>
%endfunction
 
%%Function{InputSignalFunctions}:SLibSetBlockInputSignalIsNotExpr
%%Abstract:
%%Forcethisblockinputsignalintoavariable,andupdateitssource
%%blockaccordingly;thesourcecannolongerbeanonconstoutput
%%expression(constisofcoursealwaysallowed)
%%
%function SLibSetBlockInputSignalIsNotExpr(block, portIdx) void
  %if LibBlockInputSignalIsExpr(portIdx)
    %
  %endif
%endfunction
 
%%Function{InputSignalFunctions}:SLibBlockInputSignalDimensions==========
%%Abstract:
%%Returnsthedimensionsvectorofspecifiedblockinputport,e.g.[2,3]
%%
%function SLibBlockInputSignalDimensions(portIdx) void
  %% See Also:
  %% LibBlockInputSignalNumDimensions
  %%
  %return CGMODEL_ACCESS("Block.SLibInputSignalDimensions", BlockIdx[0], BlockIdx[2], portIdx)
%endfunction %% SLibBlockInputSignalDimensions
 
%endif %% _BLKIO_INTERNALAPI_