diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-04-28 14:06:20 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-04-28 14:06:20 +0000 |
commit | 4350eec6bb2e87ee4b777911dbb2dbbf2a27ab7a (patch) | |
tree | b725cbe68978df0e7a395b0a34576b4eb9fc098d | |
parent | 8c4e2be4806a2271a5dddc4e1efc5599d588b414 (diff) | |
download | rockbox-4350eec6bb2e87ee4b777911dbb2dbbf2a27ab7a.tar.gz rockbox-4350eec6bb2e87ee4b777911dbb2dbbf2a27ab7a.zip |
Proper headers, simulator support should (emphasis on should) work.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6370 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/searchengine/Makefile | 2 | ||||
-rw-r--r-- | apps/plugins/searchengine/dbinterface.c | 29 | ||||
-rw-r--r-- | apps/plugins/searchengine/dbinterface.h | 32 | ||||
-rw-r--r-- | apps/plugins/searchengine/parser.c | 18 | ||||
-rw-r--r-- | apps/plugins/searchengine/parser.h | 18 | ||||
-rw-r--r-- | apps/plugins/searchengine/searchengine.h | 3 | ||||
-rw-r--r-- | apps/plugins/searchengine/token.c | 18 | ||||
-rw-r--r-- | apps/plugins/searchengine/token.h | 22 |
8 files changed, 131 insertions, 11 deletions
diff --git a/apps/plugins/searchengine/Makefile b/apps/plugins/searchengine/Makefile index d7253e2e10..1ecd12803b 100644 --- a/apps/plugins/searchengine/Makefile +++ b/apps/plugins/searchengine/Makefile | |||
@@ -8,7 +8,7 @@ | |||
8 | # | 8 | # |
9 | 9 | ||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | 10 | INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ |
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers | 11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) |
12 | CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ | 12 | CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ |
13 | -DMEM=${MEMORYSIZE} -DPLUGIN | 13 | -DMEM=${MEMORYSIZE} -DPLUGIN |
14 | 14 | ||
diff --git a/apps/plugins/searchengine/dbinterface.c b/apps/plugins/searchengine/dbinterface.c index bf2a6cfa5c..9ab52ad103 100644 --- a/apps/plugins/searchengine/dbinterface.c +++ b/apps/plugins/searchengine/dbinterface.c | |||
@@ -1,3 +1,21 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Michiel van der Kolk | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
1 | #include "searchengine.h" | 19 | #include "searchengine.h" |
2 | #include "dbinterface.h" | 20 | #include "dbinterface.h" |
3 | 21 | ||
@@ -44,6 +62,11 @@ void loadentry(int filerecord) { | |||
44 | rb->read(*rb->tagdb_fd,&entryarray[filerecord].hash,4); | 62 | rb->read(*rb->tagdb_fd,&entryarray[filerecord].hash,4); |
45 | rb->read(*rb->tagdb_fd,&entryarray[filerecord].songentry,4); | 63 | rb->read(*rb->tagdb_fd,&entryarray[filerecord].songentry,4); |
46 | rb->read(*rb->tagdb_fd,&entryarray[filerecord].rundbentry,4); | 64 | rb->read(*rb->tagdb_fd,&entryarray[filerecord].rundbentry,4); |
65 | #ifdef ROCKBOX_LITTLE_ENDIAN | ||
66 | entryarray[filerecord].hash=BE32(entryarray[filerecord].hash); | ||
67 | entryarray[filerecord].songentry=BE32(entryarray[filerecord].songentry); | ||
68 | entryarray[filerecord].rundbentry=BE32(entryarray[filerecord].rundbentry); | ||
69 | #endif | ||
47 | entryarray[filerecord].loadedfiledata=1; | 70 | entryarray[filerecord].loadedfiledata=1; |
48 | } | 71 | } |
49 | currententry=&entryarray[filerecord]; | 72 | currententry=&entryarray[filerecord]; |
@@ -63,6 +86,12 @@ void loadsongdata() { | |||
63 | rb->read(*rb->tagdb_fd,currententry->genre,rb->tagdbheader->genrelen); | 86 | rb->read(*rb->tagdb_fd,currententry->genre,rb->tagdbheader->genrelen); |
64 | rb->read(*rb->tagdb_fd,¤tentry->bitrate,2); | 87 | rb->read(*rb->tagdb_fd,¤tentry->bitrate,2); |
65 | rb->read(*rb->tagdb_fd,¤tentry->year,2); | 88 | rb->read(*rb->tagdb_fd,¤tentry->year,2); |
89 | #ifdef ROCKBOX_LITTLE_ENDIAN | ||
90 | currententry->artistoffset=BE32(currententry->artistoffset); | ||
91 | currententry->albumoffset=BE32(currententry->albumoffset); | ||
92 | currententry->bitrate=BE16(currententry->bitrate); | ||
93 | currententry->year=BE16(currententry->year); | ||
94 | #endif | ||
66 | currententry->loadedsongdata=1; | 95 | currententry->loadedsongdata=1; |
67 | } | 96 | } |
68 | 97 | ||
diff --git a/apps/plugins/searchengine/dbinterface.h b/apps/plugins/searchengine/dbinterface.h index 32363b11c6..ef90d63483 100644 --- a/apps/plugins/searchengine/dbinterface.h +++ b/apps/plugins/searchengine/dbinterface.h | |||
@@ -1,3 +1,21 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Michiel van der Kolk | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
1 | struct entry { | 19 | struct entry { |
2 | int loadedfiledata, | 20 | int loadedfiledata, |
3 | loadedsongdata, | 21 | loadedsongdata, |
@@ -5,17 +23,17 @@ struct entry { | |||
5 | loadedalbumname, | 23 | loadedalbumname, |
6 | loadedartistname; | 24 | loadedartistname; |
7 | char *filename; | 25 | char *filename; |
8 | int hash; | 26 | long hash; |
9 | int songentry; | 27 | long songentry; |
10 | int rundbentry; | 28 | long rundbentry; |
11 | short year; | 29 | short year; |
12 | short bitrate; | 30 | short bitrate; |
13 | int rating; | 31 | long rating; |
14 | int playcount; | 32 | long playcount; |
15 | char *title; | 33 | char *title; |
16 | char *genre; | 34 | char *genre; |
17 | int artistoffset; | 35 | long artistoffset; |
18 | int albumoffset; | 36 | long albumoffset; |
19 | char *artistname; | 37 | char *artistname; |
20 | char *albumname; | 38 | char *albumname; |
21 | }; | 39 | }; |
diff --git a/apps/plugins/searchengine/parser.c b/apps/plugins/searchengine/parser.c index fe10452c17..501450c562 100644 --- a/apps/plugins/searchengine/parser.c +++ b/apps/plugins/searchengine/parser.c | |||
@@ -1,3 +1,21 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Michiel van der Kolk | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
1 | #include "searchengine.h" | 19 | #include "searchengine.h" |
2 | #include "token.h" | 20 | #include "token.h" |
3 | #include "dbinterface.h" | 21 | #include "dbinterface.h" |
diff --git a/apps/plugins/searchengine/parser.h b/apps/plugins/searchengine/parser.h index e63f15f39b..e9c36d3b54 100644 --- a/apps/plugins/searchengine/parser.h +++ b/apps/plugins/searchengine/parser.h | |||
@@ -1,3 +1,21 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Michiel van der Kolk | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
1 | extern struct token *tokenbuffer,*currentToken; | 19 | extern struct token *tokenbuffer,*currentToken; |
2 | 20 | ||
3 | extern int syntaxerror; | 21 | extern int syntaxerror; |
diff --git a/apps/plugins/searchengine/searchengine.h b/apps/plugins/searchengine/searchengine.h index 3f7e4c609e..752e9ad0e4 100644 --- a/apps/plugins/searchengine/searchengine.h +++ b/apps/plugins/searchengine/searchengine.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Michiel van der Kolk | 10 | * Copyright (C) 2005 by Michiel van der Kolk |
11 | * | 11 | * |
@@ -20,6 +20,7 @@ | |||
20 | #define SEARCHENGINE_H | 20 | #define SEARCHENGINE_H |
21 | #include <plugin.h> | 21 | #include <plugin.h> |
22 | #include <database.h> | 22 | #include <database.h> |
23 | #include <autoconf.h> | ||
23 | 24 | ||
24 | extern int w, h, y; | 25 | extern int w, h, y; |
25 | #define PUTS(str) do { \ | 26 | #define PUTS(str) do { \ |
diff --git a/apps/plugins/searchengine/token.c b/apps/plugins/searchengine/token.c index d2da94ab52..cc4f5b3224 100644 --- a/apps/plugins/searchengine/token.c +++ b/apps/plugins/searchengine/token.c | |||
@@ -1,3 +1,21 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Michiel van der Kolk | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
1 | #include "token.h" | 19 | #include "token.h" |
2 | #include "dbinterface.h" | 20 | #include "dbinterface.h" |
3 | 21 | ||
diff --git a/apps/plugins/searchengine/token.h b/apps/plugins/searchengine/token.h index b858f4f217..0ce27162d3 100644 --- a/apps/plugins/searchengine/token.h +++ b/apps/plugins/searchengine/token.h | |||
@@ -1,3 +1,21 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Michiel van der Kolk | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
1 | #define TOKEN_INVALID -1 | 19 | #define TOKEN_INVALID -1 |
2 | #define TOKEN_EOF 0 // EOF | 20 | #define TOKEN_EOF 0 // EOF |
3 | #define TOKEN_NOT 1 // "not" | 21 | #define TOKEN_NOT 1 // "not" |
@@ -27,8 +45,8 @@ | |||
27 | #define INTVALUE_GENRE 7 | 45 | #define INTVALUE_GENRE 7 |
28 | #define INTVALUE_FILENAME 8 | 46 | #define INTVALUE_FILENAME 8 |
29 | 47 | ||
30 | static char *spelling[] = { "not", "and", "or",">",">=","<", "<=","==","!=", | 48 | /* static char *spelling[] = { "not", "and", "or",">",">=","<", "<=","==","!=", |
31 | "contains","(",")" }; | 49 | "contains","(",")" }; */ |
32 | 50 | ||
33 | struct token { | 51 | struct token { |
34 | unsigned char kind; | 52 | unsigned char kind; |