static void ana_cluster(FILE *out, t_xrama *xr,real **dih,real time[], t_topology *top,int nframes,int mult) { t_cluster *cl=NULL,*scl; char *minimum; int i,j,nx; /* Number of dihedrals + terminating NULL * this allows for using string routines */ snew(minimum,xr->ndih+1); for(i=0; (i<nframes); i++) { nx=0; for(j=0; (j<xr->ndih); j++) { minimum[j] = vphi(&xr->dih[j],dih[j][i], mult == -1 ? xr->dih[j].mult : mult); if (minimum[j] == NOMIN) nx++; } if (nx == 0) { if ((scl=search_cluster(cl,minimum)) == NULL) add_cluster(&cl,xr->ndih,minimum); else scl->freq++; } } p_cluster(out,cl); sfree(minimum); }
static struct dirent *search_dir(char *name, struct fat_part_desc *desc, int start_cluster, int dircount, char *cl) { struct dirent *dir; int current_cluster = start_cluster; while (current_cluster < CLUSTER_END) { cluster_read(current_cluster, cl, desc->bootrecord.spc, desc); dir = search_cluster(name, cl, dircount); if (dir == NULL) { current_cluster = next_cluster(desc->fat, current_cluster, desc); } else return dir; } return NULL; }