%include "sfcnutil.tlc"
%with ::CompiledModel
%assign thisSystem = System[GetBaseSystemIdx()]
%assign sFunctionName = GetModelrefSFunctionName(Name)
%openfile tmpBuf
#if !defined(S_FUNCTION_NAME)
#define S_FUNCTION_NAME %<sFunctionName>
#endif
#define S_FUNCTION_LEVEL 2
/* So mdlEnable and mdlDisable will be defined in the simstruc.h */
#if !defined(RTW_GENERATED_S_FUNCTION)
#define RTW_GENERATED_S_FUNCTION
#endif
%if LibIsSystemField(thisSystem, "FcnCallInputInfo")
#define S_FUNCTION_EXPORTS_FUNCTION_CALLS
#define MODELREF_EXPORTS_FUNCTION_CALLS
%endif
#include
#include
#include "simstruc.h"
#include "fixedpoint.h"
#define rt_logging_h
%assign mdlTypesHdrFileName = SLibGetFileNameForCode("mdl_types_hdr")
%if !WHITE_SPACE(mdlTypesHdrFileName)
#include "%<mdlTypesHdrFileName>.h"
%endif
%assign fileName = SLibGetSystemOutputHdrFileBaseName(thisSystem)
#include "%<fileName>.h"
%<SLibIncludePrivateHeader()>
%closefile tmpBuf
%<SLibCacheCodeToFile("mdlsfcn_src_incl", tmpBuf)>
%if !SLibPrmBufferIsEmpty("UnstructuredSimulinkGlobal", "Instance")
%openfile tmpBuf
/* Model block global parameters (%<::AutoOrDefaultStorageClass> storage) */
%<SLibGetPrmBuffer("UnstructuredSimulinkGlobal", "Instance")>
%closefile tmpBuf
%<SLibCacheCodeToFile("mdlsfcn_data_defn", tmpBuf)>
%endif
%if !SLibPrmBufferIsEmpty("UnstructuredSimulinkGlobalProtInlined", "Instance")
%assert SLibIsGeneratingSimTargetForProtectedModel()
%assign instance = SLibGetPrmBuffer("UnstructuredSimulinkGlobalProtInlined", "Instance")
%<SLibCacheCodeToFile("mdl_data_defn", instance)>
%endif
%<SLibWriteMdlRefExportedMdlInfo()>
%endwith