Exemplo n.º 1
0
void
queue_search(struct client *client, const struct queue *queue,
	     const struct locate_item_list *criteria)
{
	unsigned i;
	struct locate_item_list *new_list =
		locate_item_list_casefold(criteria);

	for (i = 0; i < queue_length(queue); i++) {
		const struct song *song = queue_get(queue, i);

		if (locate_song_search(song, new_list))
			queue_print_song_info(client, queue, i);
	}

	locate_item_list_free(new_list);
}
Exemplo n.º 2
0
bool
searchForSongsIn(struct client *client, const char *name,
		 const struct locate_item_list *criteria,
		 GError **error_r)
{
	struct locate_item_list *new_list
		= locate_item_list_casefold(criteria);
	struct search_data data;

	data.client = client;
	data.criteria = new_list;

	bool success = db_walk(name, &search_visitor, &data, error_r);

	locate_item_list_free(new_list);

	return success;
}
Exemplo n.º 3
0
int
searchForSongsIn(struct client *client, const char *name,
		 const struct locate_item_list *criteria)
{
	int ret;
	struct locate_item_list *new_list
		= locate_item_list_casefold(criteria);
	struct search_data data;

	data.client = client;
	data.criteria = new_list;

	ret = db_walk(name, searchInDirectory, NULL, &data);

	locate_item_list_free(new_list);

	return ret;
}