Scilab Function
eng


write_inf_lib

File content


//write_inf_lib
//Entrée : u file descriptor
//         path chemin de la libraire dans MODNUMSCI (ex: macros/util/)
//         tt nom de la librairie (ex:modnum_util)
//         flag drapeau pour affichage d'un header dans loader.sce
//              (0 : pas de header; 1 : header)
//         tt_path nom d'une variable globale du chemin de la toolbox
//         (ex tt_path='MODNUMSCI')
//sortie : txt : Information utile de chargement
//               ex : modnum_scicos_utils=lib(MODNUMSCI+'/macros/scicos_util/');
function txt=write_inf_lib(u,path,tt,flag,tt_path)
 if size(path,'*')==size(tt,'*') then
   if MSDOS then
    path=pathconvert(path,%f,%t,'w')+'\';
   else
    path=path+'/';
   end
   for i=1:size(path,'*') 
    if flag then
      tt_loader=['//Load '+tt(i)+' library' 
                 tt(i)+'=lib('+tt_path+'+'''+path(i)+''');';'';
                ]
      txt(i)=tt_loader(2);
    else
     tt_loader=tt(i)+'=lib('+tt_path+'+'''+path(i)+''');'
     txt(i)=tt_loader;
    end
    fprintf(u,"%s\n",tt_loader);
   end
 else
  //Affiche un message d'erreur
  printf("path and tt must have the same size");
  abort
 end
endfunction