diff options
-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 @@ # INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ - -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers + -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ -DMEM=${MEMORYSIZE} -DPLUGIN 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Michiel van der Kolk + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ #include "searchengine.h" #include "dbinterface.h" @@ -44,6 +62,11 @@ void loadentry(int filerecord) { rb->read(*rb->tagdb_fd,&entryarray[filerecord].hash,4); rb->read(*rb->tagdb_fd,&entryarray[filerecord].songentry,4); rb->read(*rb->tagdb_fd,&entryarray[filerecord].rundbentry,4); +#ifdef ROCKBOX_LITTLE_ENDIAN + entryarray[filerecord].hash=BE32(entryarray[filerecord].hash); + entryarray[filerecord].songentry=BE32(entryarray[filerecord].songentry); + entryarray[filerecord].rundbentry=BE32(entryarray[filerecord].rundbentry); +#endif entryarray[filerecord].loadedfiledata=1; } currententry=&entryarray[filerecord]; @@ -63,6 +86,12 @@ void loadsongdata() { rb->read(*rb->tagdb_fd,currententry->genre,rb->tagdbheader->genrelen); rb->read(*rb->tagdb_fd,¤tentry->bitrate,2); rb->read(*rb->tagdb_fd,¤tentry->year,2); +#ifdef ROCKBOX_LITTLE_ENDIAN + currententry->artistoffset=BE32(currententry->artistoffset); + currententry->albumoffset=BE32(currententry->albumoffset); + currententry->bitrate=BE16(currententry->bitrate); + currententry->year=BE16(currententry->year); +#endif currententry->loadedsongdata=1; } 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Michiel van der Kolk + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ struct entry { int loadedfiledata, loadedsongdata, @@ -5,17 +23,17 @@ struct entry { loadedalbumname, loadedartistname; char *filename; - int hash; - int songentry; - int rundbentry; + long hash; + long songentry; + long rundbentry; short year; short bitrate; - int rating; - int playcount; + long rating; + long playcount; char *title; char *genre; - int artistoffset; - int albumoffset; + long artistoffset; + long albumoffset; char *artistname; char *albumname; }; 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Michiel van der Kolk + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ #include "searchengine.h" #include "token.h" #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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Michiel van der Kolk + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ extern struct token *tokenbuffer,*currentToken; 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 @@ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ - * $Id + * $Id$ * * Copyright (C) 2005 by Michiel van der Kolk * @@ -20,6 +20,7 @@ #define SEARCHENGINE_H #include <plugin.h> #include <database.h> +#include <autoconf.h> extern int w, h, y; #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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Michiel van der Kolk + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ #include "token.h" #include "dbinterface.h" 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Michiel van der Kolk + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ #define TOKEN_INVALID -1 #define TOKEN_EOF 0 // EOF #define TOKEN_NOT 1 // "not" @@ -27,8 +45,8 @@ #define INTVALUE_GENRE 7 #define INTVALUE_FILENAME 8 -static char *spelling[] = { "not", "and", "or",">",">=","<", "<=","==","!=", - "contains","(",")" }; +/* static char *spelling[] = { "not", "and", "or",">",">=","<", "<=","==","!=", + "contains","(",")" }; */ struct token { unsigned char kind; |