diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-04-29 21:02:17 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-04-29 21:02:17 +0000 |
commit | ec407a86a758925e7ba0c994ae17d29e19dc4b39 (patch) | |
tree | cc2fb9c032aad91a786ecb1dd47c730298efeb37 /apps/plugins/searchengine/dbinterface.c | |
parent | 388d9ff6a3229149c4b37f52321d10b460acc382 (diff) | |
download | rockbox-ec407a86a758925e7ba0c994ae17d29e19dc4b39.tar.gz rockbox-ec407a86a758925e7ba0c994ae17d29e19dc4b39.zip |
Code policy...
Removed tokentool for now since this is not the proper place, but what is?
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6383 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/searchengine/dbinterface.c')
-rw-r--r-- | apps/plugins/searchengine/dbinterface.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/apps/plugins/searchengine/dbinterface.c b/apps/plugins/searchengine/dbinterface.c index c9bbc12c02..7cded01642 100644 --- a/apps/plugins/searchengine/dbinterface.c +++ b/apps/plugins/searchengine/dbinterface.c | |||
@@ -44,7 +44,7 @@ int database_init() { | |||
44 | p=(char *)entryarray; | 44 | p=(char *)entryarray; |
45 | // zero all entries. | 45 | // zero all entries. |
46 | for(i=0;i<sizeof(struct entry)*rb->tagdbheader->filecount;i++) | 46 | for(i=0;i<sizeof(struct entry)*rb->tagdbheader->filecount;i++) |
47 | *(p++)=0; | 47 | *(p++)=0; |
48 | if(*rb->tagdb_initialized!=1) { | 48 | if(*rb->tagdb_initialized!=1) { |
49 | if(!rb->tagdb_init()) { | 49 | if(!rb->tagdb_init()) { |
50 | // failed loading db | 50 | // failed loading db |
@@ -55,21 +55,21 @@ int database_init() { | |||
55 | } | 55 | } |
56 | 56 | ||
57 | long readlong(int fd) { | 57 | long readlong(int fd) { |
58 | long num; | 58 | long num; |
59 | rb->read(fd,&num,4); | 59 | rb->read(fd,&num,4); |
60 | #ifdef ROCKBOX_LITTLE_ENDIAN | 60 | #ifdef ROCKBOX_LITTLE_ENDIAN |
61 | num=BE32(num); | 61 | num=BE32(num); |
62 | #endif | 62 | #endif |
63 | return num; | 63 | return num; |
64 | } | 64 | } |
65 | 65 | ||
66 | short readshort(int fd) { | 66 | short readshort(int fd) { |
67 | short num; | 67 | short num; |
68 | rb->read(fd,&num,2); | 68 | rb->read(fd,&num,2); |
69 | #ifdef ROCKBOX_LITTLE_ENDIAN | 69 | #ifdef ROCKBOX_LITTLE_ENDIAN |
70 | num=BE16(num); | 70 | num=BE16(num); |
71 | #endif | 71 | #endif |
72 | return num; | 72 | return num; |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
@@ -77,11 +77,11 @@ void loadentry(int filerecord) { | |||
77 | if(entryarray[filerecord].loadedfiledata==0) { | 77 | if(entryarray[filerecord].loadedfiledata==0) { |
78 | rb->lseek(*rb->tagdb_fd,FILERECORD2OFFSET(filerecord),SEEK_SET); | 78 | rb->lseek(*rb->tagdb_fd,FILERECORD2OFFSET(filerecord),SEEK_SET); |
79 | entryarray[filerecord].filename=(char *)my_malloc(rb->tagdbheader->filelen); | 79 | entryarray[filerecord].filename=(char *)my_malloc(rb->tagdbheader->filelen); |
80 | rb->read(*rb->tagdb_fd,entryarray[filerecord].filename,rb->tagdbheader->filelen); | 80 | rb->read(*rb->tagdb_fd,entryarray[filerecord].filename,rb->tagdbheader->filelen); |
81 | entryarray[filerecord].hash=readlong(*rb->tagdb_fd); | 81 | entryarray[filerecord].hash=readlong(*rb->tagdb_fd); |
82 | entryarray[filerecord].songentry=readlong(*rb->tagdb_fd); | 82 | entryarray[filerecord].songentry=readlong(*rb->tagdb_fd); |
83 | entryarray[filerecord].rundbentry=readlong(*rb->tagdb_fd); | 83 | entryarray[filerecord].rundbentry=readlong(*rb->tagdb_fd); |
84 | entryarray[filerecord].loadedfiledata=1; | 84 | entryarray[filerecord].loadedfiledata=1; |
85 | } | 85 | } |
86 | currententry=&entryarray[filerecord]; | 86 | currententry=&entryarray[filerecord]; |
87 | } | 87 | } |
@@ -103,7 +103,7 @@ void loadsongdata() { | |||
103 | } | 103 | } |
104 | 104 | ||
105 | void loadrundbdata() { | 105 | void loadrundbdata() { |
106 | // we don't do this yet. | 106 | // we don't do this yet. |
107 | currententry->loadedrundbdata=1; | 107 | currententry->loadedrundbdata=1; |
108 | } | 108 | } |
109 | 109 | ||
@@ -112,7 +112,7 @@ void loadartistname() { | |||
112 | * write that pointer to the entrys using it. | 112 | * write that pointer to the entrys using it. |
113 | */ | 113 | */ |
114 | if(currententry->loadedartistname) | 114 | if(currententry->loadedartistname) |
115 | return; | 115 | return; |
116 | loadsongdata(); | 116 | loadsongdata(); |
117 | currententry->artistname=(char *)my_malloc(rb->tagdbheader->artistlen); | 117 | currententry->artistname=(char *)my_malloc(rb->tagdbheader->artistlen); |
118 | rb->lseek(*rb->tagdb_fd,currententry->artistoffset,SEEK_SET); | 118 | rb->lseek(*rb->tagdb_fd,currententry->artistoffset,SEEK_SET); |
@@ -123,7 +123,7 @@ void loadartistname() { | |||
123 | void loadalbumname() { | 123 | void loadalbumname() { |
124 | /* see the note at loadartistname */ | 124 | /* see the note at loadartistname */ |
125 | if(currententry->loadedalbumname) | 125 | if(currententry->loadedalbumname) |
126 | return; | 126 | return; |
127 | loadsongdata(); | 127 | loadsongdata(); |
128 | currententry->albumname=(char *)my_malloc(rb->tagdbheader->albumlen); | 128 | currententry->albumname=(char *)my_malloc(rb->tagdbheader->albumlen); |
129 | rb->lseek(*rb->tagdb_fd,currententry->albumoffset,SEEK_SET); | 129 | rb->lseek(*rb->tagdb_fd,currententry->albumoffset,SEEK_SET); |
@@ -133,7 +133,7 @@ void loadalbumname() { | |||
133 | 133 | ||
134 | char *getfilename(int entry) { | 134 | char *getfilename(int entry) { |
135 | if(entryarray[entry].loadedfiledata==0) | 135 | if(entryarray[entry].loadedfiledata==0) |
136 | return "error O.o;;;"; | 136 | return "error O.o;;;"; |
137 | else | 137 | else |
138 | return entryarray[entry].filename; | 138 | return entryarray[entry].filename; |
139 | } | 139 | } |