summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/searchengine/parser.c14
-rw-r--r--apps/plugins/searchengine/searchengine.c10
-rw-r--r--apps/plugins/searchengine/token.h2
3 files changed, 20 insertions, 6 deletions
diff --git a/apps/plugins/searchengine/parser.c b/apps/plugins/searchengine/parser.c
index cbedeb3..ad2e4ee 100644
--- a/apps/plugins/searchengine/parser.c
+++ b/apps/plugins/searchengine/parser.c
@@ -148,11 +148,19 @@ unsigned char *parseCompareString() {
rb->snprintf(errormsg,250,"'%d' found where STRING/STRINGID expected\n",currentToken->kind);
return 0;
}
-
- contains=currentToken->kind==TOKEN_CONTAINS;
+
if(currentToken->kind==TOKEN_CONTAINS ||
- currentToken->kind==TOKEN_EQUALS)
+ currentToken->kind==TOKEN_EQUALS) {
+ if(currentToken->kind==TOKEN_CONTAINS) {
+ contains=1;
+ PUTS("Contains");
+ }
+ else {
+ contains=0;
+ PUTS("Equals");
+ }
parser_acceptIt();
+ }
else {
syntaxerror=1;
rb->snprintf(errormsg,250,"'%d' found where CONTAINS/EQUALS expected\n",currentToken->kind);
diff --git a/apps/plugins/searchengine/searchengine.c b/apps/plugins/searchengine/searchengine.c
index 0cb090e..3926b15 100644
--- a/apps/plugins/searchengine/searchengine.c
+++ b/apps/plugins/searchengine/searchengine.c
@@ -54,7 +54,7 @@ void setmallocpos(void *pointer)
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
unsigned char *result,buf[500];
- int parsefd;
+ int parsefd,hits;
/* this macro should be called as the first thing you do in the plugin.
it test that the api version and model the plugin was compiled for
matches the machine it is running on */
@@ -78,14 +78,20 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->snprintf(buf,250,"Retval: 0x%x",result);
PUTS(buf);
rb->close(parsefd);
+ hits=0;
if(result!=0) {
int fd=rb->open("/search.m3u", O_WRONLY|O_CREAT|O_TRUNC);
int i;
for(i=0;i<rb->tagdbheader->filecount;i++)
- if(result[i])
+ if(result[i]) {
+ hits++;
rb->fdprintf(fd,"%s\n",getfilename(i));
+ }
/* rb->write(fd,result,rb->tagdbheader->filecount);*/
rb->close(fd);
}
+ rb->snprintf(buf,250,"Hits: %d",hits);
+ PUTS(buf);
+ rb->sleep(HZ*3);
return PLUGIN_OK;
}
diff --git a/apps/plugins/searchengine/token.h b/apps/plugins/searchengine/token.h
index 0ce2716..0df4a6e 100644
--- a/apps/plugins/searchengine/token.h
+++ b/apps/plugins/searchengine/token.h
@@ -51,7 +51,7 @@
struct token {
unsigned char kind;
char spelling[256];
- int intvalue;
+ long intvalue;
};
char *getstring(struct token *token);