2005-04-28 14:06:20 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 by Michiel van der Kolk
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-04-28 14:06:20 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2005-05-10 23:44:22 +00:00
|
|
|
#define TOKEN_INVALID -1
|
|
|
|
#define TOKEN_EOF 0 // EOF
|
|
|
|
#define TOKEN_NOT 1 // "not"
|
|
|
|
#define TOKEN_AND 2 // "and"
|
|
|
|
#define TOKEN_OR 3 // "or"
|
|
|
|
#define TOKEN_GT 4 // '>'
|
|
|
|
#define TOKEN_GTE 5 // '>='
|
|
|
|
#define TOKEN_LT 6 // '<'
|
|
|
|
#define TOKEN_LTE 7 // '<='
|
|
|
|
#define TOKEN_EQ 8 // '=='
|
|
|
|
#define TOKEN_NE 9 // '!='
|
|
|
|
#define TOKEN_CONTAINS 10 // "contains"
|
|
|
|
#define TOKEN_EQUALS 11 // "equals"
|
|
|
|
#define TOKEN_STARTSWITH 12
|
|
|
|
#define TOKEN_ENDSWITH 13
|
|
|
|
#define TOKEN_LPAREN 14 // '('
|
|
|
|
#define TOKEN_RPAREN 15 // ')'
|
|
|
|
#define TOKEN_NUM 16 // (0..9)+
|
|
|
|
#define TOKEN_NUMIDENTIFIER 17 // year, trackid, bpm, etc.
|
|
|
|
#define TOKEN_STRING 18 // (?)+
|
|
|
|
#define TOKEN_STRINGIDENTIFIER 19 // album, artist, title, genre ...
|
|
|
|
#define TOKEN_SHUFFLE 20
|
|
|
|
#define TOKEN_PLAYTIMELIMIT 21
|
2005-04-28 12:33:38 +00:00
|
|
|
|
2005-05-10 23:44:22 +00:00
|
|
|
#define INTVALUE_YEAR 1
|
2005-04-29 21:02:17 +00:00
|
|
|
#define INTVALUE_RATING 2
|
2005-05-10 23:44:22 +00:00
|
|
|
#define INTVALUE_PLAYCOUNT 3
|
|
|
|
#define INTVALUE_AUTORATING 4
|
2005-06-06 19:34:35 +00:00
|
|
|
#define INTVALUE_PLAYTIME 5
|
|
|
|
#define INTVALUE_TRACKNUM 6
|
|
|
|
#define INTVALUE_SAMPLERATE 7
|
|
|
|
#define INTVALUE_BITRATE 8
|
2005-05-10 23:44:22 +00:00
|
|
|
#define INTVALUE_TITLE 14
|
|
|
|
#define INTVALUE_ARTIST 15
|
|
|
|
#define INTVALUE_ALBUM 16
|
|
|
|
#define INTVALUE_GENRE 17
|
|
|
|
#define INTVALUE_FILENAME 18
|
2005-04-28 12:33:38 +00:00
|
|
|
|
2005-07-01 17:29:44 +00:00
|
|
|
#define SPELLING_LENGTH 100
|
2005-04-28 12:33:38 +00:00
|
|
|
|
|
|
|
struct token {
|
2005-07-01 17:29:44 +00:00
|
|
|
char kind;
|
|
|
|
char spelling[SPELLING_LENGTH + 3];
|
|
|
|
long intvalue;
|
2005-04-28 12:33:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
char *getstring(struct token *token);
|
|
|
|
int getvalue(struct token *token);
|