summaryrefslogtreecommitdiff
path: root/apps/plugins/searchengine/searchengine.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/searchengine/searchengine.c')
-rw-r--r--apps/plugins/searchengine/searchengine.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/plugins/searchengine/searchengine.c b/apps/plugins/searchengine/searchengine.c
index 0cb090e141..3926b15eac 100644
--- a/apps/plugins/searchengine/searchengine.c
+++ b/apps/plugins/searchengine/searchengine.c
@@ -54,7 +54,7 @@ void setmallocpos(void *pointer)
54enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 54enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
55{ 55{
56 unsigned char *result,buf[500]; 56 unsigned char *result,buf[500];
57 int parsefd; 57 int parsefd,hits;
58 /* this macro should be called as the first thing you do in the plugin. 58 /* this macro should be called as the first thing you do in the plugin.
59 it test that the api version and model the plugin was compiled for 59 it test that the api version and model the plugin was compiled for
60 matches the machine it is running on */ 60 matches the machine it is running on */
@@ -78,14 +78,20 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
78 rb->snprintf(buf,250,"Retval: 0x%x",result); 78 rb->snprintf(buf,250,"Retval: 0x%x",result);
79 PUTS(buf); 79 PUTS(buf);
80 rb->close(parsefd); 80 rb->close(parsefd);
81 hits=0;
81 if(result!=0) { 82 if(result!=0) {
82 int fd=rb->open("/search.m3u", O_WRONLY|O_CREAT|O_TRUNC); 83 int fd=rb->open("/search.m3u", O_WRONLY|O_CREAT|O_TRUNC);
83 int i; 84 int i;
84 for(i=0;i<rb->tagdbheader->filecount;i++) 85 for(i=0;i<rb->tagdbheader->filecount;i++)
85 if(result[i]) 86 if(result[i]) {
87 hits++;
86 rb->fdprintf(fd,"%s\n",getfilename(i)); 88 rb->fdprintf(fd,"%s\n",getfilename(i));
89 }
87/* rb->write(fd,result,rb->tagdbheader->filecount);*/ 90/* rb->write(fd,result,rb->tagdbheader->filecount);*/
88 rb->close(fd); 91 rb->close(fd);
89 } 92 }
93 rb->snprintf(buf,250,"Hits: %d",hits);
94 PUTS(buf);
95 rb->sleep(HZ*3);
90 return PLUGIN_OK; 96 return PLUGIN_OK;
91} 97}