#include #include "projet.h" #include "projetx.m" void diff_select (USERINFO *user) { DIALOG dia; static SSTRING v1,v2,fres,fcmd,diff,dirs; VERSION_DAT vdat (user); FIELD_COMBO *comb = dia.newf_combo (MSG_U(F_VSTART,"Version de départ") ,v1); vdat.setcombo (comb); dia.last_noempty(); comb = dia.newf_combo (MSG_U(F_VEND,"Version d'arrivée"),v2); dia.last_noempty(); vdat.setcombo (comb); dia.newf_str (MSG_U(F_FILEOUT,"Fichier résultat (diff)"),fres); dia.last_noempty(); dia.newf_str (MSG_U(F_FILECMD,"Fichier résultat (cmds)"),fcmd); diff.setfrom ("diff -c"); dia.newf_str (MSG_U(F_DIFFOPT,"Commande 'diff'"),diff); dia.newf_str (MSG_U(F_DIRS,"Répertoires (opt)"),dirs); dia.waitfor ("verselected"); int nof = 0; while (1){ MENU_STATUS code = dia.edit (MSG_U(T_PATCH,"Production d'un fichier patch") ,MSG_U(I_PATCH ,"Vous pouvez produire un fichier diff entre deux\n" "révision de l'archive") ,help_nil ,nof); if (code == MENU_CANCEL || code == MENU_ESCAPE){ break; }else if (code == MENU_MESSAGE){ }else{ FILE *fileout = stdout; FILE *filecmd = NULL; if (!fres.is_empty()){ fileout = xconf_fopen (fres.get(),"w"); } if (!fcmd.is_empty()){ filecmd = xconf_fopen (fcmd.get(),"w"); } if (fileout != NULL){ SSTRINGS subdirs; str_splitline (dirs.get(),' ',subdirs); diff_findfiles (user,diff.get(),v1.get(),v2.get() ,subdirs,fileout,filecmd,NULL); break; } } } }