Scilab Function
eng


write_inf_doc

File content


//write_inf_doc
//Entrée : u : file descriptor
//Sortie : txt : Information utile de chargement
//         flag :
function txt=write_inf_doc(u)
  txt=[];
  tt='myhelps=[MODNUM+''/man/''+lang+''/htm'',""Modnum communication toolbox""];';
  tt2=['add_demo(''Modnum'',MODNUM+''/man/demos/modnum.dem'');']
  if MSDOS then
    tt=pathconvert(tt,%f,%t,'w')
    tt2=pathconvert(tt2,%f,%t,'w')
  end

  tt_loader=['//Add demos and man pages'
             'if fileinfo(MODNUM+''/man'')<>[] then'
             '  //find the LANGUAGE'
             '  if ~exists(''LANGUAGE'') then'
             '   global LANGUAGE;lang=LANGUAGE;clear LANGUAGE;'
             '  else'
             '   lang=LANGUAGE;'
             '  end'
             '  if lang<>''fr''&lang<>''eng'' then'
             '    printf(""Documentation: Unsupported language %s, switch to eng.\n"",lang);'
             '    lang=''eng'';'
             '  end'
             '  if fileinfo(MODNUM+''/man/''+lang+''/htm/whatis.htm'')<>[] then'
             '    //Add modnum help chapter'
             '    '+tt
             '    kk = find(myhelps(1,2)==%helps(:,2));'
             '    if kk<>[] then'
             '      %helps(kk,1)=myhelps(1,1);'
             '    else'
             '      %helps=[%helps;myhelps];'
             '    end'
             '    clear kk;'
             '    clear myhelps;'
             '  end'
             '  //Add modnum demo'
             '  prot=funcprot(); //to disable warning'
             '  funcprot(0);'
             '  '+tt2
             '  funcprot(prot)'
             '  clear prot'
             '  clear lang'
             'end'
             ]
  txt=[tt_loader];
  if exists('u') then
   fprintf(u,"%s\n",tt_loader);
  end

endfunction