summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-13 12:33:34 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-13 12:33:34 +0000
commit33d91040785d679c40a44f3127eee54d6adb2ad3 (patch)
tree26d33c3e8fb21d7a54a2a9dbd001d8da588ddaac
parent0a7ded3e29b302a83b61279128962b829817e4cb (diff)
downloadrockbox-33d91040785d679c40a44f3127eee54d6adb2ad3.tar.gz
rockbox-33d91040785d679c40a44f3127eee54d6adb2ad3.zip
FS#5805 NOT operator for tagnavi.config by Jochen Kemnade.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10558 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tagcache.c13
-rw-r--r--apps/tagcache.h7
-rw-r--r--apps/tagtree.c4
-rw-r--r--docs/CREDITS1
4 files changed, 21 insertions, 4 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 4c324c8da3..87810da93b 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -588,7 +588,12 @@ static bool check_against_clause(long numeric, const char *str,
return numeric == clause->numeric_data;
else
return !strcasecmp(clause->str, str);
-
+ case clause_is_not:
+ if (clause->numeric)
+ return numeric != clause->numeric_data;
+ else
+ return strcasecmp(clause->str, str);
+
case clause_gt:
return numeric > clause->numeric_data;
case clause_gteq:
@@ -600,10 +605,16 @@ static bool check_against_clause(long numeric, const char *str,
case clause_contains:
return (strcasestr(str, clause->str) != NULL);
+ case clause_not_contains:
+ return (strcasestr(str, clause->str) == NULL);
case clause_begins_with:
return (strcasestr(str, clause->str) == str);
+ case clause_not_begins_with:
+ return (strcasestr(str, clause->str) != str);
case clause_ends_with: /* Not supported yet */
return false;
+ case clause_not_ends_with: /* Not supported yet */
+ return false;
}
return false;
diff --git a/apps/tagcache.h b/apps/tagcache.h
index b27d804792..e43414cba5 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -71,9 +71,10 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
#define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */
#define FLAG_DIRTYNUM 0x0004 /* Numeric data has been modified */
-enum clause { clause_none, clause_is, clause_gt, clause_gteq, clause_lt,
- clause_lteq, clause_contains, clause_begins_with, clause_ends_with };
-enum modifiers { clause_mod_none, clause_mod_not };
+enum clause { clause_none, clause_is, clause_is_not, clause_gt, clause_gteq,
+ clause_lt, clause_lteq, clause_contains, clause_not_contains,
+ clause_begins_with, clause_not_begins_with, clause_ends_with,
+ clause_not_ends_with };
struct tagcache_stat {
bool initialized; /* Is tagcache currently busy? */
diff --git a/apps/tagtree.c b/apps/tagtree.c
index daa52646fa..0565b62981 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -176,13 +176,17 @@ static int get_clause(int *condition)
MATCH(condition, buf, "=", clause_is);
MATCH(condition, buf, "==", clause_is);
+ MATCH(condition, buf, "!=", clause_is_not);
MATCH(condition, buf, ">", clause_gt);
MATCH(condition, buf, ">=", clause_gteq);
MATCH(condition, buf, "<", clause_lt);
MATCH(condition, buf, "<=", clause_lteq);
MATCH(condition, buf, "~", clause_contains);
+ MATCH(condition, buf, "!~", clause_not_contains);
MATCH(condition, buf, "^", clause_begins_with);
+ MATCH(condition, buf, "!^", clause_not_begins_with);
MATCH(condition, buf, "$", clause_ends_with);
+ MATCH(condition, buf, "!$", clause_not_ends_with);
return 0;
}
diff --git a/docs/CREDITS b/docs/CREDITS
index 0b907024ce..4029cebe2a 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -223,3 +223,4 @@ Alexander Levin
Barry Wardell
Lars van de Klomp
Philippe Miossec
+Jochen Kemnade