function extension_warning(ext,str,info)

% extension_warning - produce warning for extension failure
% ---------------------------------------------------------
%
% extension_warning(ext,str,info)
%
% Input:
% ------
%  ext - extension producing message
%  str - message string
%  info - error info (for example as provided by 'lasterror')

%--------------------------------
% Author: Harold Figueroa
%--------------------------------
% $Revision: 1573 $
% $Date: 2005-08-12 12:57:41 -0400 (Fri, 12 Aug 2005) $
%--------------------------------

% TODO: improve display

% TODO: add author and modification date info

% TODO: add some form of logging

%--
% put warning together using extension
%--

type_str = upper(strrep(ext.subtype,'_',' ')); 

name_str = upper(ext.name);

str = [' WARNING: In ', type_str, ' extension ''', name_str, '''. ', str];

n = length(str) + 1; line = str_line(n, '_');

%--
% display warning
%--

disp(' '); 

disp(line);
disp(' '); 
disp(str);
disp(line);
disp(' '); 

disp(' '); 

if (nargin > 2)
	
	% NOTE: ocassionaly this hides important information
	
% 	% NOTE: truncate stack for shorter message
% 	
% 	if isfield(info, 'stack') && (length(info.stack) > 3)
% 		info.stack = info.stack(1:3);
% 	end
	
	xml_disp(info);
	
end

disp(line);

disp(' ');