/* Return pointer to View with same 'label', or null. */ View * data_find(char*label) { Data *d; Stat buf; Path path; /* Search for data with same label */ for(d=dataroot; d; d=d->next) { if (STRSAME(d->label, label)) return text_view(d->t); } /* Search for data with same stat buffer */ label2path(path,label); if(stat(path,&buf)) return 0; for(d=dataroot; d; d=d->next) { data_restat(d); if (d->has_stat && !statcmp(&buf, &d->stat)) return text_view(d->t); } return 0; }
int revstatcmp(const FTSENT *a, const FTSENT *b) { return (statcmp(b, a)); }