Scilab Function
eng


write_header

File content


//write_header(u,builder_name,tt_path)
//Entrée : u file descriptor
//         builder_name : name of builder
//         tt_path : nom d'une variable globale du chemin de la toolbox
//         (ex tt_path='MODNUMSCI')
//Sortie : txt : le texte à éxecuter pour augmenter la taille de la pile scilab
function txt=write_header(u,builder_name,tt_path)
 tt_loader1=['//Loader Script of modnum for scilab'
             '//Generated by '+builder_name
             '//'+date()+' A.Layec';'';
             '//Redefine stacksize'
             'sz=stacksize(); //default 5e6';
             'while (sz(1)<50e6) then';
             '  ierr=execstr(''stacksize(sz(1)+5e6)'',''errcatch'');';
             '  if ierr<>0 then break, end';
             '  sz=stacksize();';
             'end';
             'clear sz;';
             'clear ierr;';'';
             '//Define modnum root path']
 if MSDOS then
   tt_loader=[tt_loader1;
              tt_path+'=get_absolute_file_path(''loader.sce'');';
              'if part('+tt_path+',length('+tt_path+'))==''\'' then';
              '  '+tt_path+'=part('+tt_path+',1:length('+tt_path+')-1);';
              'end'
              '//Search Scilab Version'
              'getf('+tt_path+'+''\macros\build_util\find_scilab_ver.sci'');'
              '[ok]=find_scilab_ver();'
              'if ~ok then'
              '  printf(""modnum only work with ScicosLab\n"");'
              '  abort;'
              'end']
 else
   tt_loader=[tt_loader1;
              tt_path+'=get_absolute_file_path(''loader.sce'');';
              'if part('+tt_path+',length('+tt_path+'))==''/'' then';
              '   '+tt_path+'=part('+tt_path+',1:length('+tt_path+')-1);';
              'end'
              '//Search Scilab Version'
              'getf('+tt_path+'+''/macros/build_util/find_scilab_ver.sci'');'
              '[ok]=find_scilab_ver();'
              'if ~ok then'
              '  printf(""modnum only work with ScicosLab\n"");'
              '  abort;'
              'end']
 end
 txt=tt_loader1;
 fprintf(u,"%s\n",tt_loader);
endfunction