%% $Revision: 1.2.4.1 $
%% $Date: 2002/12/18 07:55:31 $
%%
%% Copyright 1994-2002 The MathWorks, Inc.
%%
%% Abstract: 
%%
%%   Methods to register target-specific datatyped run-time library 
%%   functions.  The target must register replacement prototypes before 
%%   including codegenentry.tlc.
%%
%if EXISTS("_ERTMATHLIB_") == 0
%assign _ERTMATHLIB_ = 1

%% LibRegisterISOCMathFcnPrototypes ============================================
%% Abstract:
%%
%%    Example of registering target-specific math functions.  This
%%    function registers ISO C math function mappings for a target with 
%%    an ISO C 9x compliant compiler (e.g., gcc 2.9x.yy+ is).
%%
%function LibRegisterISOCMathFcnPrototypes() void

    %if EXISTS(::OrigName)
        %matlab set_param(::OrigName,"RTWMathFcnLibMatFile","ert_math_tmw.mat")
    %else
        %matlab set_param(::CompiledModel.Name,"RTWMathFcnLibMatFile","ert_math_tmw.mat")
    %endif
    
%endfunction


%% LibRegisterGNUMathFcnPrototypes ============================================
%% Abstract:
%%
%%    Example of registering target-specific math functions.  This
%%    one registers GNU C math function mappings for a target with 
%%    a GNU C compiler (e.g., gcc 2.9x.yy+ is compliant).  Compiler
%%    flags may be needed to put the compiler in ISO C 1999 mode.
%%
%function LibRegisterGNUMathFcnPrototypes() void

    %if EXISTS(::OrigName)
        %matlab set_param(::OrigName,"RTWMathFcnLibMatFile","ert_gnu_math_tmw.mat")
    %else
        %matlab set_param(::CompiledModel.Name,"RTWMathFcnLibMatFile","ert_gnu_math_tmw.mat")
    %endif


%endfunction


%% LibRegisterMathFcnPrototype ================================================
%% Abstract:
%%    Set a specific name and input prototype of a given function 
%%    for the current target.  This overrides the default names.
%%
%%    Data types are in string form.
%%
%function LibRegisterMathFcnPrototype(RTWName, RTWType, IsExprOK, IsCplx, NumInputs, FcnName, FcnType, HdrFile) void
  %assign idx = FcnGetMathFcnRecIdx(RTWName, RTWType)
  
  %assign ::MathProtos.R[idx].NumInputs = NumInputs
  %assign ::MathProtos.R[idx].FcnName   = FcnName
  %assign ::MathProtos.R[idx].FcnType   = FcnType
  %assign ::MathProtos.R[idx].HdrFile   = HdrFile
%endfunction



%endif %% _ERTMATHLIB_

%% [EOF] ertmathlib.tlc
