diff options
Diffstat (limited to '')
-rw-r--r-- | src/locate.h | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/src/locate.h b/src/locate.h index ec20ded24..c012a9c63 100644 --- a/src/locate.h +++ b/src/locate.h @@ -28,65 +28,33 @@ #define LOCATE_TAG_FILE_TYPE TAG_NUM_OF_ITEM_TYPES+10 #define LOCATE_TAG_ANY_TYPE TAG_NUM_OF_ITEM_TYPES+20 +struct locate_item_list; struct song; -/* struct used for search, find, list queries */ -struct locate_item { - int8_t tag; - /* what we are looking for */ - char *needle; -}; - /** - * An array of struct locate_item objects. + * @return #TAG_NUM_OF_ITEM_TYPES on error */ -struct locate_item_list { - /** number of items */ - unsigned length; - - /** this is a variable length array */ - struct locate_item items[1]; -}; - -int +gcc_pure +unsigned locate_parse_type(const char *str); -/** - * Allocates a new struct locate_item_list, and initializes all - * members with zero bytes. - */ +gcc_malloc struct locate_item_list * -locate_item_list_new(unsigned length); +locate_item_list_new_single(unsigned tag, const char *needle); /* return number of items or -1 on error */ gcc_nonnull(1) struct locate_item_list * -locate_item_list_parse(char *argv[], int argc); - -/** - * Duplicate the struct locate_item_list object and convert all - * needles with g_utf8_casefold(). - */ -gcc_nonnull(1) -struct locate_item_list * -locate_item_list_casefold(const struct locate_item_list *list); +locate_item_list_parse(char *argv[], unsigned argc, bool fold_case); gcc_nonnull(1) void locate_item_list_free(struct locate_item_list *list); -gcc_nonnull(1) -void -locate_item_free(struct locate_item *item); - -gcc_nonnull(1,2) -bool -locate_song_search(const struct song *song, - const struct locate_item_list *criteria); - +gcc_pure gcc_nonnull(1,2) bool -locate_song_match(const struct song *song, - const struct locate_item_list *criteria); +locate_list_song_match(const struct song *song, + const struct locate_item_list *criteria); #endif |