mode(-1);
// 
// -------------------------------------------------------------------------
// SIP - Scilab Image Processing toolbox
// Copyright (C) 2002  Ricardo Fabbri
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// -------------------------------------------------------------------------
//

// specific part
libname='siplib'
libtitle='SIP - Scilab Image Processing Toolbox @PACKAGE_VERSION@';

// get the absolute path 
SIPDIR=get_absolute_file_path('loader.sce') + '/'; 
SIPDEMO=SIPDIR+'macros/sipdemo_gui.dem';

// resets the default image viewer 
SIPVIEWER = 'sci';

// load the library macros
execstr(libname+'=lib(""'+SIPDIR+'macros/'+'"")')
// XXX TODO PREDEF ALL???

// add the help chapter and some utilities
scilab_version=getversion();
if scilab_version=="scilab-2.7" then
   %helps = [%helps; SIPDIR+'man', libtitle]
else
  if (str2code( part(scilab_version, 8)) <= 4) then //version <= 4.x.x
     add_help_chapter(libtitle, SIPDIR + 'man');
  else
     // Scilab 5
     path_addchapter = SIPDIR + "jar/";
     if ( fileinfo(path_addchapter) <> [] ) then
        add_help_chapter(libtitle, path_addchapter, %F);
        clear add_help_chapter;
     end
     // load utilities (aliases etc)
     exec(SIPDIR+'macros/sip_init.sce');
  end
end

// ADD C routines
exec (SIPDIR+'loader_include.sce');

mess=[libtitle+' loaded';
    'Enter ""exec(SIPDEMO);"" for demonstrations.'; ''];

write(%io(2),'--------------------------------------------');
write(%io(2),mess);

clear libtitle mess
