write_inf_lib - return text of libraries for builder script of the toolbox
txt = write_inf_lib(u,path,tt,flag)
- u : integer. a file descriptor
- path : string. the path of the target macro library
- tt : string. name of the library
- flag : integer. a flag to set text header
- txt : vector of strings. the text of the information to load modnum library
//write_inf_lib
//Entrée : u file descriptor
// path chemin de la libraire dans MODNUM (ex: macros/util/)
// tt nom de la librairie (ex:mod_num_util)
// flag drapeau pour affichage d'un header dans loader.sce
// (0 : pas de header; 1 : header)
//sortie : txt : Information utile de chargement
// ex : mod_num_scicos_utils=lib(MODNUM+'/macros/scicos_util/');
function txt=write_inf_lib(u,path,tt,flag)
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(MODNUM+'''+path(i)+''');';'';
]
txt(i)=tt_loader(2);
else
tt_loader=tt(i)+'=lib(MODNUM+'''+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
IRCOM Group
Alan Layec