80391fd4f66e266ae5ac2b0bddcffbce9c5390e8 kent Fri Jun 2 14:39:06 2017 -0700 Moving pathsInDirAndSubdirs to library. diff --git src/inc/portable.h src/inc/portable.h index 53aacfa..27d989c 100644 --- src/inc/portable.h +++ src/inc/portable.h @@ -7,30 +7,33 @@ #ifndef PORTABLE_H #define PORTABLE_H #include <sys/types.h> #include <sys/stat.h> struct slName *listDir(char *dir, char *pattern); /* Return an alphabetized list of all files that match * the wildcard pattern in directory. */ struct slName *listDirRegEx(char *dir, char *regEx, int flags); /* Return an alphabetized list of all files that match * the regular expression pattern in directory. * See REGCOMP(3) for flags (e.g. REG_ICASE) */ +struct slName *pathsInDirAndSubdirs(char *dir, char *wildcard); +/* Return list of all non-directory files in dir and it's + * subdirs. Returns path to files including dir and subdir. */ struct fileInfo /* Info about a file. */ { struct fileInfo *next; /* Next in list. */ off_t size; /* Size in bytes. */ bool isDir; /* True if file is a directory. */ int statErrno; /* Result of stat (e.g. bad symlink). */ time_t lastAccess; /* Last access time. */ char name[1]; /* Allocated at run time. */ }; struct fileInfo *newFileInfo(char *name, off_t size, bool isDir, int statErrno, time_t lastAccess); /* Return a new fileInfo. */