From 0337ec851c643503afd2287f03ca42b5adf5cad7 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Wed, 10 Nov 2004 20:11:34 +0000 Subject: search/find rewrite git-svn-id: https://svn.musicpd.org/mpd/branches/r2562-metadata-handling-rewrite@2584 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/directory.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/directory.h') 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 #include +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 -- cgit v1.2.3