function [status, errors,warnings] = generate(name,name_out)
% PURPOSE:	 generates FOC and jacobian for a model specified in file [name]
% INPUT:
%     name       - path to the text file that contains model equations, i.e.
%                  'model.g', 'C:\test\model.m'
%     name_out   - path to the output files;
%                   output files names: 
%                  [name_out]_FOC.m, [name_out]_JAC.m, [name_out]_INFO.m
% OUTPUT:
%	  status     - 1 if parsing is succesful, 0 if errors stopped parsing
%     errors     - contains error messages
%     warnings   - contains warning messages
%
% LOADING THE LIBRARY:
%     this library can be called in Matlab version at least 7.0.
%     the library may also be called in Matlab 6.5 after installing 
%     LOADLIBRARY (path is available at
%     http://www.mathworks.com/support/solutions/data/33513.shtml)        
%
% INFO:
%	 This file is a part of GEML Toolbox
%	 Copyright c) Pawel Kowal
%	 The GEML Toolkbox is available free for academic use only (see included license file)
%	 Businesses and central institutions wishing to obtain a copy of the software should
%	 contact thrunduil@wp.pl for commercial licensing information.
%	 This version is restricted to models with at most 50 equations.
%	 Less restrictive version is available upon request.

if ~libisloaded('GEMLLIB')
    loadlibrary('GEMLLIB','GEMLLIB.h');
end

try
    status      = calllib('GEMLLIB','parseFile',name,name_out);
    errors      = calllib('GEMLLIB','getError');
    warnings    = calllib('GEMLLIB','getWarning');
catch
    error('error in file generate.m');
end