Mercurial > hg > audiodb
comparison dump.cpp @ 334:100cf66a5825
Added command-line and WS methods to (LI)st key-(S)trings and si(Z)es of (T)racks --LISZT --lisztOffset offset --lisztLength len
author | mas01mc |
---|---|
date | Tue, 02 Sep 2008 16:16:59 +0000 |
parents | c93be2f3a674 |
children | 7d6dd067d12e |
comparison
equal
deleted
inserted
replaced
333:cc3f9d1ca2cd | 334:100cf66a5825 |
---|---|
182 fclose(kLFile); | 182 fclose(kLFile); |
183 delete[] fName; | 183 delete[] fName; |
184 | 184 |
185 status(dbName); | 185 status(dbName); |
186 } | 186 } |
187 | |
188 void audioDB::liszt(const char* dbName, unsigned offset, unsigned numLines, adb__lisztResponse* adbLisztResponse){ | |
189 if(!dbH) { | |
190 initTables(dbName, 0); | |
191 } | |
192 | |
193 assert(trackTable && fileTable); | |
194 | |
195 if(offset>dbH->numFiles){ | |
196 char tmpStr[MAXSTR]; | |
197 sprintf(tmpStr, "numFiles=%u, lisztOffset=%u", dbH->numFiles, offset); | |
198 error("listKeys offset out of range", tmpStr); | |
199 } | |
200 | |
201 if(!adbLisztResponse){ | |
202 for(Uns32T k=0; k<numLines && offset+k<dbH->numFiles; k++){ | |
203 fprintf(stdout, "[%d] %s (%d)\n", offset+k, fileTable+(offset+k)*O2_FILETABLE_ENTRY_SIZE, trackTable[offset+k]); | |
204 } | |
205 } | |
206 else{ | |
207 adbLisztResponse->result.Rkey = new char*[numLines]; | |
208 adbLisztResponse->result.Rlen = new unsigned int[numLines]; | |
209 Uns32T k = 0; | |
210 for( ; k<numLines && offset+k<dbH->numFiles; k++){ | |
211 adbLisztResponse->result.Rkey[k] = new char[MAXSTR]; | |
212 snprintf(adbLisztResponse->result.Rkey[k], O2_MAXFILESTR, "%s", fileTable+(offset+k)*O2_FILETABLE_ENTRY_SIZE); | |
213 adbLisztResponse->result.Rlen[k] = trackTable[offset+k]; | |
214 } | |
215 adbLisztResponse->result.__sizeRkey = k; | |
216 adbLisztResponse->result.__sizeRlen = k; | |
217 } | |
218 | |
219 } |