%%
%%
%%Copyright2005-2019TheMathWorks,Inc.
%%
%%Abstract:
%%ThisTLCfilecontainsallthecodeforgeneratingglobalvariables
%%whichareusedbynonreusablefunctionsthatliveinreusablefunctions.
%%
 
%if EXISTS("_STANDALONESYSVAR_") == 0
%assign _STANDALONESYSVAR_ = 1
 
 
%%Function:FcnEmitCoderGroupForStandaloneSystem=========================
%%Abstract:
%%Utilityfunctiontoemitstandalonesubsystemcodergroupstothecorrect
%%header/sourcefile.Iftheheader/definitionfileisemptyforthegroup
%%e.g.forsynthesizedgroups,thenusethesystem'sfile.
%function FcnEmitCoderGroupForStandaloneSystem(system, groupIdx, buffer, definition) void
  %assign varGroupIdx = SLibGetVarGroupIdxForCoderGroup(system.SystemIdx, groupIdx)
  %assign varGroup = ::CompiledModel.VarGroups.VarGroup[varGroupIdx]
 
  %if definition
    %assign fileToEmitTo = FcnVarGroupDefinitionFile(varGroup, system)
    %if ISEMPTY(fileToEmitTo)
      %assign fileToEmitTo = system.SystemSourceFileName
    %endif
    %assign defFile = SLibAddModelFile("SystemBody", "Simulink", fileToEmitTo)
    %if !ISEMPTY(defFile)
      %<SLibSetModelFileAttribute(defFile, "Definitions", buffer)>
      %<SLibSetModelFileAttribute(defFile, "Group", "data")>
      %assign declFile = FcnVarGroupHeaderFile(varGroup, system)
      %if !ISEMPTY(declFile)
        %assign declFile = declFile + ".h"
        %<FcnAddDependentHeaderForCoderGroup(defFile, declFile)>
      %endif
    %endif
  %else
    %assign fileToEmitTo = FcnVarGroupHeaderFile(varGroup, system)
    %if ISEMPTY(fileToEmitTo)
      %assign fileToEmitTo = system.SystemSourceFileName
    %endif
    %assign declFile = SLibAddModelFile("SystemHeader", "Simulink", fileToEmitTo)
    %if !ISEMPTY(declFile)
      %<SLibSetModelFileAttribute(declFile, "Declarations", buffer)>
      %<SLibSetModelFileAttribute(declFile, "Group", "data")>
    %endif
  %endif
 
%endfunction
 
%%Function:SLibDeclareStandaloneVarsForDynamicInitCoderGroups===========
%%Abstract:
%%Declares/definesstandalonesubsystemvariablesfordynamicallyinitialized
%%codergroups
%function SLibDeclareStandaloneVarsForDynamicInitCoderGroups(system, extern) void
  %foreach idx = ::CompiledModel.NumCoderDataGroups
    %assign group = ::CompiledModel.CoderDataGroup[idx]
    %% To fix g2099126
    %% Skip declarations for legacy storage class coder groups
    %% They are handled in SLibDumpCustomClassData
    %if group.IsLegacyStorageClass
      %continue
    %endif
    %% Skip statically initialized groups. They are handled in
    %% SLibDeclareStandloneVarsForStaticInitForCoderGroups
    %if SLibDataGroupStaticInit(group)
      %continue
    %endif
    %openfile tmpBuf
    %assign groupName = group.Name
    %assign grouptoken = "CoderDataGroup" + groupName
    %if system.Has%<grouptoken>Arg
      %<SLibDeclareStandaloneVarType(system, group, grouptoken, extern)>
    %else
      %assign varGroupIndex = FcnSysVarGroupIndex(system, "CoderDataGroup" + group.Name, 0)
      %if varGroupIndex != -1 && !SLibVarGroupIsStruct(varGroupIndex)
        %<SLibDeclareStandaloneUnstructVarType(system, group, varGroupIndex, extern)>
      %endif
    %endif
    %closefile tmpBuf
 
    %if !ISEMPTY(tmpBuf)
      %if ISEMPTY(extern)
        %assign definition = TLC_TRUE
      %else
        %assign definition = TLC_FALSE
      %endif
      %<FcnEmitCoderGroupForStandaloneSystem(system, idx, tmpBuf, definition)>
    %endif
  %endforeach
%endfunction
 
%%Function:SLibDeclareStandloneVarsForStaticInitForCoderGroups==========
%%Abstract:
%%InitializeCoderGroupparameter(staticallyinitialized)declarations
%%forthesystemintheappropriatefile
%function SLibDeclareStandloneVarsForStaticInitForCoderGroups(system) void
  %foreach idx = ::CompiledModel.NumCoderDataGroups
    %assign group = ::CompiledModel.CoderDataGroup[idx]
    %% To fix g2099126
    %% Skip declarations for legacy storage class coder groups
    %% They are handled in SLibDumpCustomClassData
    %if group.IsLegacyStorageClass
      %continue
    %endif
    %if SLibDataGroupStaticInit(group) && !SLibCoderDataGroupIsImported(group)
      %assign groupName = group.Name
      %assign groupToken = "CoderDataGroup" + groupName
      %if system.Has%<groupToken>Arg
        %assign typeName = FcnSysVarGroupType(system, groupToken)
        %assign identifier = FcnSysVarGroupNonreusedName(system, groupToken)
        %<SLibDeclareStandaloneVarStaticInit(system, group, identifier, typeName, idx)>
      %else
        %assign varGroupIndex = FcnSysVarGroupIndex(system, groupToken, 0)
        %if varGroupIndex != -1 && !SLibVarGroupIsStruct(varGroupIndex)
          %assign numVars = SLibVarGroupNumElements(varGroupIndex)
          %foreach varIdx = numVars
            %assign typeIndex = SLibVarGroupElementType(varGroupIndex, varIdx)
            %assign typeName = SLibGetTypeNameFromCGType(typeIndex)
            %assign identifier = SLibVarGroupElementName(varGroupIndex, varIdx) + LibCGTypeSymbolicVectorDims(typeIndex)
            %<SLibDeclareStandaloneVarStaticInit(system, group, identifier, typeName, idx)>
          %endforeach
        %endif
      %endif
    %endif
  %endforeach
%endfunction
 
%%Function:SLibInitializeStandaloneDataForCoderGroups===================
%%Abstract:
%%InitializestructuredCoderGroupparametersforthesysteminthe
%%appropriatefile
%function SLibInitializeStandaloneDataForStructCoderGroups(system, group, groupToken, idx) void
  %assign rtp = LibGetSystemField(system, "Standalone" + groupToken + "Init")
  %assign identifier = FcnSysVarGroupNonreusedName(system,groupToken)
  %if SLibAutosarCompilerAbstractionRequired()
    %openfile definition
    %<SLibAutosarCompilerAbstractionForDataDecl(SLibDataGroupMemorySectionConst(group), FcnSysVarGroupType(system,groupToken), TLC_FALSE, TLC_FALSE, identifier, "DataGlobal")> = { ...
      %<rtp>
      };/
    %closefile definition
  %else
    %openfile definition
    %<FcnSysVarGroupType(system,groupToken)> ...
      %<identifier> = {
      %<rtp>
      };/
    %closefile definition
  %endif
 
  %openfile tmpBuf
  %<SLibApplyMemSecToDataDefnForGroup(definition, group, identifier, system, TLC_FALSE)>/
  %closefile tmpBuf
 
  %% Write this data out to the group definition file if it's not empty
  %if !ISEMPTY(tmpBuf)
    %<FcnEmitCoderGroupForStandaloneSystem(system, idx, tmpBuf, TLC_TRUE)>
  %endif
  %return tmpBuf
%endfunction %% SLibInitializeStandaloneDataForStructCoderGroups
 
%%Function:SLibInitializeStandaloneDataForCoderGroups===================
%%Abstract:
%%InitializeunstructuredCoderGroupparametersforthesysteminthe
%%appropriatefile
%function SLibInitializeStandaloneDataForUnstructCoderGroups(system, group, groupToken, idx) void
  %assign varGroupIndex = FcnSysVarGroupIndex(system, groupToken, 0)
  %if varGroupIndex != -1 && !SLibVarGroupIsStruct(varGroupIndex)
    %assign rtp = LibGetSystemField(system, "Standalone" + groupToken + "Init")
    %assign numVars = SLibVarGroupNumElements(varGroupIndex)
    %foreach varIdx = numVars
      %assign typeIndex = SLibVarGroupElementType(varGroupIndex, varIdx)
      %assign typeName = SLibGetTypeNameFromCGType(typeIndex)
      %assign identifier = SLibVarGroupElementName(varGroupIndex, varIdx) + LibCGTypeSymbolicVectorDims(typeIndex)
      %assign val = rtp[varIdx]
      %if SLibAutosarCompilerAbstractionRequired()
        %openfile definition
        %<SLibAutosarCompilerAbstractionForDataDecl(SLibDataGroupMemorySectionConst(group), typeName, TLC_FALSE, TLC_FALSE, identifier, "DataGlobal")> = ...
          %<val>;/
        %closefile definition
      %else
        %openfile definition
        %<typeName> %<identifier> = %<val>;/
        %closefile definition
      %endif
 
      %openfile tmpBuf
      %<SLibApplyMemSecToDataDefnForGroup(definition, group, identifier, system, TLC_FALSE)>/
      %closefile tmpBuf
 
      %% Write this data out to the group definition file if it's not empty
      %if !ISEMPTY(tmpBuf)
      %<FcnEmitCoderGroupForStandaloneSystem(system, idx, tmpBuf, TLC_TRUE)>
      %endif
    %endforeach
    %return tmpBuf
  %endif
%endfunction %% SLibInitializeStandaloneDataForUnstructCoderGroups
 
%%Function:SLibInitializeStandaloneDataForCoderGroups===================
%%Abstract:
%%InitializeCoderGroupparametersforthesystemintheappropriatefile
%function SLibInitializeStandaloneDataForCoderGroups(system) void
  %foreach idx = ::CompiledModel.NumCoderDataGroups
    %assign group = ::CompiledModel.CoderDataGroup[idx]
    %if SLibDataGroupStaticInit(group) && !SLibCoderDataGroupIsImported(group)
      %assign groupName = group.Name
      %assign groupToken = "CoderDataGroup" + groupName
      %if system.Has%<groupToken>Arg
        %<SLibInitializeStandaloneDataForStructCoderGroups(system, group, groupToken, idx)>
      %else
        %<SLibInitializeStandaloneDataForUnstructCoderGroups(system, group, groupToken, idx)>
      %endif
    %endif
  %endforeach
%endfunction
 
%%Function:SLibInitializeStandaloneData======================================
%%Abstract:
%%WeneedtoinitializertCandrtP,weshoulddothisinsubsystem_data
%%ifthestandalonesubsystemisnotbeinggeneratedintomodel.c
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibInitializeStandaloneData(system) void
  %openfile tmpbuf
  %with system.Interface
    %if system.HasParametersArg
      %assign rtp = LibGetSystemField(system, "StandaloneParameterInit")
      %assign identifier = FcnSysVarGroupNonreusedName(system,"Parameter")
      %if SLibAutosarCompilerAbstractionRequired()
        %openfile definition
        %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, FcnSysVarGroupType(system,"Parameter"), TLC_FALSE, TLC_FALSE, identifier, "DataGlobal")> = { ...
          %<rtp>
        };/
        %closefile definition
      %else
        %openfile definition
        %<FcnSysVarGroupType(system,"Parameter")> ...
          %<identifier> = {
          %<rtp>
        };/
      %closefile definition
      %endif
      %<SLibApplyMemSecToDataDefnForSystem(definition, "MemSecDataParameters", identifier, system, TLC_FALSE)>/
    %endif
    %if system.HasConstBlockIOArg
      %assign constbo = LibGetSystemField(system, "StandaloneConstBlockIOInit")
      %assign identifier = FcnSysVarGroupNonreusedName(system,"ConstBlockIO")
      %if SLibAutosarCompilerAbstractionRequired()
        %openfile definition
        %assign canBeConst = SLibCanConstBlockIOBeConst()
        %<SLibAutosarCompilerAbstractionForDataDecl(canBeConst, FcnSysVarGroupType(system,"ConstBlockIO"), TLC_FALSE, TLC_FALSE, identifier, "DataGlobal")> = { ...
          %<constbo>
        };/
        %closefile definition
      %else
        %assign qualifiers = SLibGetConstBlockIOForSystemQualifiers(system)
        %openfile definition
        %<qualifiers> %<FcnSysVarGroupType(system,"ConstBlockIO")>
        %<identifier> = {
          %<constbo>
        };/
        %closefile definition
      %endif
      %<SLibApplyMemSecToDataDefnForSystem(definition, "MemSecDataConstants", identifier, system, TLC_FALSE)>/
    %endif
  %endwith
  %closefile tmpbuf
  
  %% Write this data out to subsystem_data.c if it is nonempty.
  %if NotRootFileName(system) && !ISEMPTY(tmpbuf)
    %% Check if someone already created this file
    %assign fileName = SLibGetSystemOutputSrcFileBaseName(system)
    %assign dataFile = SLibDoesModelFileExist("SystemBody", "%<fileName>_data")
    %if ISEMPTY(dataFile)
      %openfile dataBanBuf
      /*
      * %<fileName>_data.%<LangFileExt>
      *
      %<SLibCommonHeaderInfo()>/
      */
      %closefile dataBanBuf
       
      %assign rootFileName = GetRootSystemHeaderFileName()
      %openfile inclBuf
      #include "%<rootFileName>.h"
      %<SLibIncludePrivateHeader()>
      %closefile inclBuf
      %<SLibCacheSystemCodeToFile("sysdata_src_ban", system, dataBanBuf)>
      %undef dataBanBuf
      %<SLibCacheSystemCodeToFile("sysdata_src_incl", system, inclBuf)>
      %undef inclBuf
    %endif
    %<SLibCacheSystemCodeToFile("sysdata_data_defn", system, tmpbuf)>
  %else
    %% If the subsystem is generating into model.c, then we need
    %% to cache the initialization so we can dump into model_data.c
    %if !ISEMPTY(tmpbuf)
      %<LibSetSystemField(system, "StandaloneDataInit", tmpbuf)>
    %endif
  %endif
 
  %<SLibInitializeStandaloneDataForCoderGroups(system)>
   
%endfunction %% SLibInitializeStandaloneData
 
%%Function:SLibDeclareStandaloneVarType======================================
%%Abstract:
%%Forthegivensystemandvargrouptype,declaretheglobalvariable.
%%Thefunctionmaybepassedastringtoprependthedeclaration(suchas
%%"extern")
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibDeclareStandaloneVarType(system, group, aVarGroupType, extern) void
  %openfile tmpbuf
  %assign typeName = FcnSysVarGroupType(system, aVarGroupType)
  %assign identifier = FcnSysVarGroupNonreusedName(system, aVarGroupType)
  %<SLibDeclareStandaloneVarDynamicInit(system, group, identifier, typeName, extern)>
  %closefile tmpbuf
  %return tmpbuf
%endfunction
 
%%Function:SLibDeclareStandaloneUnstructVarType==============================
%%Abstract:
%%Forthegivensystemandvargrouptype,declaretheunstructuredvariables
%%inthestandalonesubsytem.
%%Thefunctionmaybepassedastringtoprependthedeclaration(suchas
%%"extern")
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibDeclareStandaloneUnstructVarType(system, group, varGroupIndex, extern) void
  %openfile tmpbuf
  %assign numVars = SLibVarGroupNumElements(varGroupIndex)
    %foreach varIdx = numVars
    %assign typeIndex = SLibVarGroupElementType(varGroupIndex, varIdx)
    %assign typeName = SLibGetTypeNameFromCGType(typeIndex)
    %assign identifier = SLibVarGroupElementName(varGroupIndex, varIdx) + LibCGTypeSymbolicVectorDims(typeIndex)
    %<SLibDeclareStandaloneVarDynamicInit(system, group, identifier, typeName, extern)>
  %endforeach
  %closefile tmpbuf
  %return tmpbuf
%endfunction %%SLibDeclareStandaloneUnstructVarType
 
%%Function:SLibDeclareStandaloneVarDynamicInit===============================
%%Abstract:
%%Forthegivensystemandvariablenameandtype,declarethe(dynamically
%%initialized)globalvariable.
%%Thefunctionmaybepassedastringtoprependthedeclaration(suchas
%%"extern")
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibDeclareStandaloneVarDynamicInit(system, group, identifier, typeName, extern) void
  %openfile tmpbuf
  %openfile definition
  %if SLibAutosarCompilerAbstractionRequired()
    %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ...
      typeName, TLC_FALSE, TLC_FALSE, identifier,"DataGlobal")>;/
  %else
    %<typeName> %<identifier>;/
  %endif
  %closefile definition
   
  %if ISEMPTY(group)
    %<FcnApplyMemSecToDataDefnForSystem(definition, ...
      "MemSecDataInternal", identifier, system, TLC_FALSE, !ISEMPTY(extern))>
  %else
    %<FcnApplyMemSecToDataDefnForGroup(definition, group, identifier, system, TLC_FALSE, !ISEMPTY(extern), TLC_TRUE, TLC_TRUE)>
  %endif
  %closefile tmpbuf
  %return tmpbuf
%endfunction %%SLibDeclareStandaloneVarDynamicInit
 
%%Function:SLibDeclareStandaloneVarStaticInit================================
%%Abstract:
%%Forthegivensystemandvariablenameandtype,declarethe(statically
%%initialized)globalvariable.
%%Thefunctionmaybepassedastringtoprependthedeclaration(suchas
%%"extern")
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibDeclareStandaloneVarStaticInit(system, group, identifier, typeName, idx) void
  %openfile decls
  %if SLibAutosarCompilerAbstractionRequired()
    %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ...
    typeName, TLC_FALSE, TLC_FALSE, ...
    identifier,"DataGlobal")>;/
  %else
    %<typeName> %<identifier>;/
  %endif
  %closefile decls
 
  %openfile tmpBuf
  %<SLibApplyMemSecToDataDeclForGroup(decls, group, ...
    identifier, ::CompiledModel.ConfigSet, TLC_TRUE)>
  %closefile tmpBuf
 
  %if !ISEMPTY(tmpBuf)
    %<FcnEmitCoderGroupForStandaloneSystem(system, idx, tmpBuf, TLC_FALSE)>
  %endif
%endfunction %%SLibDeclareStandaloneVarStaticInit
 
%%Function:SLibDeclareStandaloneVars=========================================
%%Abstract:
%%Forthegivensystem,declaretheglobalvariablesthatareusedbyany
%%nonreusablefunctionsthatlivebelowthissystem.Thefunctionmaybe
%%passedastringtoprependthedeclaration(suchas"extern")
%%TopTester:test/toolbox/simulink/variants/inlineVariants/variantSource/codeGen/tg1375551.m
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibDeclareStandaloneVars(system, extern) void
  %assert system.StandaloneSubsystem
  %openfile tmpbuf
  %with system.Interface
    %if system.HasBlockIOArg
      %<SLibDeclareStandaloneVarType(system, [], "BlockIO", extern)>
    %endif
    %if system.HasDWorkArg
      %<SLibDeclareStandaloneVarType(system, [], "DWork", extern)>
    %endif
 
    %<SLibDeclareStandaloneVarsForDynamicInitCoderGroups(system, extern)>
 
    %%
    %% For rtP and constBlockIO, we may need to write out the
    %% initialization into a subsystem_data.c file.
    %if ISEMPTY(extern)
      %<SLibInitializeStandaloneData(system)>
    %else
      %if system.HasParametersArg
        %openfile decls
        %if SLibAutosarCompilerAbstractionRequired()
          %<SLibAutosarCompilerAbstractionForDataDecl(TLC_FALSE, ...
            FcnSysVarGroupType(system, "Parameter"), TLC_FALSE, TLC_FALSE, ...
            FcnSysVarGroupNonreusedName(system,"Parameter"),"DataGlobal")>;
        %else
          %<FcnSysVarGroupType(system, "Parameter")> ...
            %<FcnSysVarGroupNonreusedName(system,"Parameter")>;
        %endif
        %closefile decls
        %<SLibApplyMemSecToDataDeclForSystem(decls, ...
        "MemSecDataParameters", FcnSysVarGroupNonreusedName(system,"Parameter"), system, TLC_FALSE)>
      %endif
 
      %<SLibDeclareStandloneVarsForStaticInitForCoderGroups(system)>
 
      %if system.HasConstBlockIOArg
        %assign qualifiers = SLibGetConstBlockIOForSystemQualifiers(system)
        %openfile decls
        %if SLibAutosarCompilerAbstractionRequired()
          %<SLibAutosarCompilerAbstractionForDataDecl(SLibCanConstBlockIOForSystemBeConst(system), ...
            FcnSysVarGroupType(system, "ConstBlockIO"), TLC_FALSE, TLC_FALSE, ...
            FcnSysVarGroupNonreusedName(system,"ConstBlockIO"),"DataGlobal")>;
        %else
          %<qualifiers> %<FcnSysVarGroupType(system,"ConstBlockIO")> ...
            %<FcnSysVarGroupNonreusedName(system,"ConstBlockIO")>;
        %endif
        %closefile decls
        %<SLibApplyMemSecToDataDeclForSystem(decls, ...
        "MemSecDataConstants", FcnSysVarGroupNonreusedName(system,"ConstBlockIO"), system, TLC_FALSE)>
      %endif
    %endif
    %if system.HasZCEventArg
      %<SLibDeclareStandaloneVarType(system, [], "ZCEvent", extern)>
    %endif
    %% All canonical inputs and outputs have been turned into external globals
    %assert (NumCanonicalInputArgDefs == 0 || ISFIELD(system,"RTWSystemCodeOptIntf"))
    %assert (NumCanonicalOutputArgDefs == 0 || ISFIELD(system,"RTWSystemCodeOptIntf"))
    %% There should be no canonical parameters since these are created
    %% only for reused systems
    %assert (NumCanonicalPrmArgDefs == 0)
  %endwith
  %closefile tmpbuf
   
  %% Each of the functions above already have the ppIf guarding inside of them.
  %% Hence, we do not need this here.If there is a build error due to this function
  %% figure out which function missed the ppIF guarding and fix that.
  %%if !WHITE_SPACE(tmpbuf)
    %%assign tmpbuf = SLibWrapBody(SLibIfSystemVariantCondition(system),tmpbuf, SLibEndIfSystemVariantCondition(system))
  %%endif
 
  %return tmpbuf
%endfunction %% SLibDeclareStandaloneVars
 
 
%%Function:SLibExternStandaloneData==========================================
%%Abstract:
%%Externanyinternalvariablesusedbystandalonesubsystems
%%
%function SLibExternStandaloneData() void
  %foreach idx = NumSystems
    %assign system = System[idx]
    %if system.StandaloneSubsystem
      %assign externBuf = SLibDeclareStandaloneVars(system, "extern")
      %if !WHITE_SPACE(externBuf)
        %openfile tmpBuf
        %assign sysInfo = GetSystemNameForComments(system)
        %<GetHideChildDefineSymbol("ifndef")>/
        /* Extern declarations of internal data for %<sysInfo> */
        %<externBuf>
        %<GetHideChildDefineSymbol("endif")>/
        %closefile tmpBuf
        %<SLibCacheSystemCodeToFile("sys_standalone_extern_data_decl", system, tmpBuf)>
      %endif
    %endif
  %endforeach
%endfunction
 
%%Function:SLibDumpStandaloneVarDeclarationForSystem=========================
%%Abstract:
%%Dumpstandalonevariabledeclarationintoabufferinthesystem.
%%TopTester:test/toolbox/rtw/targets/ert/tcodevariants.m
%%
%function SLibDumpStandaloneVarDeclarationsForSystem(system) void
  %assign globalBuf = ""
  %if system.StandaloneSubsystem
    %assert (StandaloneSSSupported)
    %assign buf = SLibDeclareStandaloneVars(system,"")
    %if !WHITE_SPACE(buf)
      %assign sysInfo = GetSystemNameForComments(system)
      %openfile globalBuf
       
      /* Declare variables for internal data of %<sysInfo> */
      %<buf>/
      %closefile globalBuf
    %endif
  %endif
  %return globalBuf
%endfunction
 
%endif %% _STANDALONESYSVAR_
 
%%[EOF]standalonesysvar.tlc