Initial revision 6759
[qball-mpd.git] / src / locate.h
blobc165a310a54dde5f54a302e7f73e7df79c72c938
1 /* the Music Player Daemon (MPD)
2 * (c)2007 by Warren Dukes (warren.dukes@gmail.com)
3 * This project's homepage is: http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "song.h"
21 #define LOCATE_TAG_FILE_TYPE TAG_NUM_OF_ITEM_TYPES+10
22 #define LOCATE_TAG_ANY_TYPE TAG_NUM_OF_ITEM_TYPES+20
24 /* struct used for search, find, list queries */
25 typedef struct _LocateTagItem {
26 mpd_sint8 tagType;
27 /* what we are looking for */
28 char *needle;
29 } LocateTagItem;
31 int getLocateTagItemType(char *str);
33 /* returns NULL if not a known type */
34 LocateTagItem *newLocateTagItem(char *typeString, char *needle);
36 /* return number of items or -1 on error */
37 int newLocateTagItemArrayFromArgArray(char *argArray[], int numArgs,
38 LocateTagItem ** arrayRet);
40 void freeLocateTagItemArray(int count, LocateTagItem * array);
42 void freeLocateTagItem(LocateTagItem * item);
44 int strstrSearchTags(Song * song, int numItems, LocateTagItem * items);
46 int tagItemsFoundAndMatches(Song * song, int numItems, LocateTagItem * items);