%% Provides the paths for functions relating to blocks that 
%% are 'links' to TLC or C files.


%   Copyright 2002-2012 The MathWorks, Inc.

function x = sfundemo_helper(root)
    
  shortFileName = get_param(gcb, 'filename');
  
  [path,name,ext] = fileparts(shortFileName);
  
  switch ext
   case '.tlc'
    midpath = fullfile('toolbox','simulink','simdemos','simfeatures','tlc_c','');
   case {'.c', '.cpp'}
    switch name
     case 'sfun_atmos'
      midpath = fullfile('toolbox','simulink','simdemos','simfeatures','srcFortran','');
     otherwise
      midpath = fullfile('toolbox','simulink','simdemos','simfeatures','src','');
    end
   case {'.F'}
    midpath = fullfile('toolbox','simulink','simdemos','simfeatures','srcFortran','');
   case '.m'
    midpath = fullfile('toolbox','simulink','simdemos','simfeatures','');
   case {'.h', '.hpp'}
    midpath = fullfile('toolbox','simulink','simdemos','simfeatures','include','');
   case '.adb'
    midpath = fullfile('toolbox','simulink','simdemos','simfeatures','src_ada',name,'');
   otherwise
    midpath = '???';
  end
  
  x = fullfile(root, midpath, shortFileName);
  
