#include #include #include #include "../../etc/etc.h" #include "ostool.h" #include "commun.h" static int near filedir_match ( FILEDIR *fdir, const char *wild, /* Wild card sans path */ char *tb[], int maxtb, /* Nombre maximum d'item dans la table */ const char *addpath,/* Path a inserer devant chaque nom de fichier */ int matchdir) /* Recherche les sous-r‚pertoires */ { int nbtb = 0; //printf ("avant setup\n"); fflush (stdout); //atoi("1"); fflush (stdout); filedir_setup (fdir); //printf ("apres setup\n"); fflush (stdout); { WILD w; VFILE_SPEC *vf = fdir->incl_files; int nb = fdir->fincl_nb; int i; wild_set (wild,&w); for (i=0; ifname; // Le makefile.dat est toujours cach‚, voir spec plus loin. if (strcmp(fname,"makefile.dat")!=0){ /* Certaines entr‚es d'un makefile.dat d‚crivent des ‚l‚ments d'un sous-r‚pertoire. On doit les ignor‚s. */ const char *ptsep = strchr(fname,'/'); int selectd; char fname_tmp[MAXSIZ_NAME]; if (ptsep == NULL) ptsep = strchr(fname,'\\'); selectd = (ptsep != NULL) + matchdir; if (selectd == 2){ char tmp = *ptsep; *(char*)ptsep = '\0'; strcpy (fname_tmp,fname); *(char*)ptsep = tmp; fname = fname_tmp; } if (selectd != 1 && wild_test(fname,&w)){ if (nbtb < maxtb){ /* Les fonctions dir_getlist_ retourne des noms de fichier avec le path original inclus. */ char fpath[MAXSIZ_PATH]; if (addpath[0] != '\0'){ path_make (addpath,fname,fpath); fname = fpath; } tb[nbtb++] = strdup_err (fname); } } } } } return nbtb; } /* fusionne tbreel dans tb en evitant les r‚p‚titions. Les deux tables sont tri‚es. Retourne le nombre d'item dans tb[]. Les ‚l‚ments de tbreel[] sont lib‚r‚s. */ static int near vdir_fusion ( char *tb[], int nbtb, char *tbreel[], int nbreel) { int notb = 0; int i; for (i=0; i