write_inf_rout_lib - return text of routines for builder script of the toolbox
txt = write_inf_rout_lib(u,libname,path,files,flag)
- u : integer. a file descriptor
- libname : string. the name of the target routine library
- path : string. the path of the target routine library
- files : vector of strings. the names of the object files
- flag : integer. a flag to set the type of routines
- 0 : only for the library
- 1 : library + C modules
- 2 : library + fortran modules
- txt : vector of strings. the text of the information to load modnum routine
//write_inf_rout_lib
//Entrée : u : file descriptor
// libname : nom de la libraire (sans extension)
// path : chemin de la libraire dans MODNUM ex /routines/mod_num_lib/
// files : nom des modules à inclure (sans extension)
// flag : drapeau 0 : seulement la librairie
// 1 : librairie + modules 'c'
// 2 : librairie + modules 'f'
function txt=write_inf_rout_lib(u,libname,path,files,flag)
if MSDOS then
mylibname=libname+'.dll';
else
mylibname=libname+'.so';
end
if flag==0 then
tt_loader=['//Link '+libname+' library'
'Id_'+libname+'=link(MODNUM+""'+path+'/'+mylibname+'"");';'';
]
elseif flag==1 then
var=[];
for i=1:size(files,'*')
var=var+''''+files(i)+''',';
end
var=part(var,1:length(var)-1);
tt_loader=['//Link '+libname+' library'
'Id_'+libname+'=link(MODNUM+""'+path+'/'+mylibname+'"",['+var+'],''c'');';
'';
];
elseif flag==2 then
var=[];
for i=1:size(files,'*')
var=var+''''+files(i)+''',';
end
var=part(var,1:length(var)-1);
tt_loader=['//Link '+libname+' library';
'Id_'+libname+'=link(MODNUM+""'+path+'/'+mylibname+'"",['+var+']);';
'';
];
end
txt=tt_loader(2);
fprintf(u,"%s\n",tt_loader);
endfunction
IRCOM Group
Alan Layec