diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-11-10 20:11:34 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-11-10 20:11:34 +0000 |
commit | 0337ec851c643503afd2287f03ca42b5adf5cad7 (patch) | |
tree | 0b6ead2f83f5b9e390cdff163bafb5fe9e6e4bfc /src/directory.h | |
parent | 0e8aa9674f10a6ca1ad69b3846b5a4b5e9188928 (diff) | |
download | mpd-0337ec851c643503afd2287f03ca42b5adf5cad7.tar.gz mpd-0337ec851c643503afd2287f03ca42b5adf5cad7.tar.xz mpd-0337ec851c643503afd2287f03ca42b5adf5cad7.zip |
search/find rewrite
git-svn-id: https://svn.musicpd.org/mpd/branches/r2562-metadata-handling-rewrite@2584 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/directory.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/directory.h b/src/directory.h index b11f18ffb..b0b2c843c 100644 --- a/src/directory.h +++ b/src/directory.h @@ -27,6 +27,21 @@ #include <stdio.h> #include <sys/param.h> +typedef List DirectoryList; + +typedef struct _DirectoryStat { + ino_t inode; + dev_t device; +} DirectoryStat; + +typedef struct _Directory { + char * utf8name; + DirectoryList * subDirectories; + SongList * songs; + struct _Directory * parent; + DirectoryStat * stat; +} Directory; + extern char * directory_db; void readDirectoryDBIfUpdateIsFinished(); @@ -51,22 +66,12 @@ int readDirectoryDB(); void updateMp3Directory(); -int printAllIn(FILE * fp, char * name); - -int addAllIn(FILE * fp, char * name); - -int printInfoForAllIn(FILE * fp, char * name); - -int searchForSongsIn(FILE * fp, char * name, char * item, char * string); - -int findSongsIn(FILE * fp, char * name, char * item, char * string); - -int countSongsIn(FILE * fp, char * name); - -unsigned long sumSongTimesIn(FILE * fp, char * name); - Song * getSongFromDB(char * file); time_t getDbModTime(); +int traverseAllIn(FILE * fp, char * name, + int (*forEachSong)(FILE *, Song *, void *), + int (*forEachDir)(FILE *, Directory *, void *), + void * data); #endif |