From 5bdbe39c6e2af7b85482e0003ad52a4bc5a74212 Mon Sep 17 00:00:00 2001 From: "lulf@carrot.studby.ntnu.no" Date: Tue, 29 Apr 2008 15:40:05 +0200 Subject: - Implement query system to select data from data structures. --- include/mnode.h | 7 ++++++- include/mp3fs.h | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/mnode.h b/include/mnode.h index d84c0ad..891ad3d 100644 --- a/include/mnode.h +++ b/include/mnode.h @@ -6,6 +6,11 @@ struct mnode { char *path; TagLib_File *tag; /* Entry in search structure. */ - LIST_ENTRY(mnode) next; + LIST_ENTRY(mnode) coll_next; + LIST_ENTRY(mnode) sel_next; +}; + +struct collection { + LIST_HEAD(, mnode) head; }; #endif diff --git a/include/mp3fs.h b/include/mp3fs.h index 4313cd1..5d17726 100644 --- a/include/mp3fs.h +++ b/include/mp3fs.h @@ -1,10 +1,11 @@ #ifndef _MP3FS_H_ #define _MP3FS_H_ struct fuse_args; -int mp3_run(int, char **); -void mp3_initscan(void); - +struct collection; +struct mnode; +int mp3_run(int, char **); +struct collection *mp3_initscan(void); /* * Data passed to traverse function pointers.' */ @@ -12,10 +13,17 @@ struct filler_data { void *buf; fuse_fill_dir_t filler; }; -/* Traverse files used in mp3_subr.c */ -typedef void traverse_fn_t(char *, void *); -void traverse_hierarchy(char *, traverse_fn_t, void *); -traverse_fn_t mp3_artist; +/* + * Functions traversing the underlying filesystem and do operations on the + * files, for instance scanning the collection. + */ +typedef void traverse_fn_t(char *, struct collection *); +void traverse_hierarchy(char *, traverse_fn_t, struct collection *); traverse_fn_t mp3_scan; + +/* + * Functions performing queries on the collection. + */ +struct collection *mp3_select(char *, char *, char *); #endif -- cgit v1.2.3