comparison audioDB.cpp @ 393:fd9b65e5ca95 api-inversion

There can be only one (again). I think I see how it arose, but there's in fact no need to have two separate status structures ("struct adbstatus" and "struct cppstatus"). Delete "struct cppstatus" and simplify audioDB::status accordingly.
author mas01cr
date Tue, 25 Nov 2008 16:40:59 +0000
parents 78fed0d4c108
children bc7a821004bb
comparison
equal deleted inserted replaced
392:78fed0d4c108 393:fd9b65e5ca95
229 return; 229 return;
230 230
231 } 231 }
232 232
233 //for API status 233 //for API status
234 audioDB::audioDB(const unsigned argc, const char *argv[], cppstatusptr stat, int * apierror): O2_AUDIODB_INITIALIZERS 234 audioDB::audioDB(const unsigned argc, const char *argv[], adb_status_t *stat, int * apierror): O2_AUDIODB_INITIALIZERS
235 { 235 {
236 236
237 try { 237 try {
238 UseApiError=1; 238 UseApiError=1;
239 239
789 adbStatusResponse->result.flags = dbH->flags; 789 adbStatusResponse->result.flags = dbH->flags;
790 } 790 }
791 } 791 }
792 792
793 ///used by lib/API 793 ///used by lib/API
794 void audioDB::status(const char* dbName, cppstatusptr status){ 794 void audioDB::status(const char* dbName, adb_status_t *status){
795 if(!dbH) { 795 if(!dbH) {
796 initTables(dbName, 0); 796 initTables(dbName, 0);
797 } 797 }
798 798
799 unsigned dudCount=0; 799 unsigned dudCount=0;
1191 return apierror; 1191 return apierror;
1192 } 1192 }
1193 1193
1194 ///* status command */ 1194 ///* status command */
1195 int audiodb_status(adb_ptr mydb, adb_status_ptr status){ 1195 int audiodb_status(adb_ptr mydb, adb_status_ptr status){
1196
1197 cppstatus sss;
1198 int apierror=0; 1196 int apierror=0;
1199 1197
1200 const char *argv[5]; 1198 const char *argv[5];
1201 1199
1202 apierror=0; 1200 apierror=0;
1204 argv[1]="--STATUS"; 1202 argv[1]="--STATUS";
1205 argv[2]="-d"; 1203 argv[2]="-d";
1206 argv[3]=mydb->path; 1204 argv[3]=mydb->path;
1207 argv[4]='\0'; 1205 argv[4]='\0';
1208 1206
1209 audioDB::audioDB(4,argv,&sss ,&apierror); 1207 audioDB::audioDB(4,argv,status ,&apierror);
1210 1208
1211 status->numFiles=sss.numFiles;
1212 status->dim=sss.dim;
1213 status->length=sss.length;
1214 status->dudCount=sss.dudCount;
1215 status->nullCount=sss.nullCount;
1216 status->flags=sss.flags;
1217
1218 return apierror; 1209 return apierror;
1219 } 1210 }
1220 1211
1221 int audiodb_dump(adb_ptr mydb){ 1212 int audiodb_dump(adb_ptr mydb){
1222 return audiodb_dump_withdir(mydb,"audioDB.dump"); 1213 return audiodb_dump_withdir(mydb,"audioDB.dump");