changeset 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 64b2bf35d30b
files audioDB.cpp audioDB.h
diffstat 2 files changed, 5 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/audioDB.cpp	Mon Nov 24 15:42:15 2008 +0000
+++ b/audioDB.cpp	Tue Nov 25 16:40:59 2008 +0000
@@ -231,7 +231,7 @@
 }
 
 //for API status
-audioDB::audioDB(const unsigned argc, const char *argv[], cppstatusptr stat, int * apierror): O2_AUDIODB_INITIALIZERS
+audioDB::audioDB(const unsigned argc, const char *argv[], adb_status_t *stat, int * apierror): O2_AUDIODB_INITIALIZERS
 {
 
     try {
@@ -791,7 +791,7 @@
 }
 
 ///used by lib/API
-void audioDB::status(const char* dbName, cppstatusptr status){
+void audioDB::status(const char* dbName, adb_status_t *status){
     if(!dbH) {
         initTables(dbName, 0);
     }
@@ -1193,8 +1193,6 @@
 
   ///* status command */
   int audiodb_status(adb_ptr mydb, adb_status_ptr status){
-
-      cppstatus sss;
       int apierror=0;
 
       const char *argv[5];
@@ -1206,15 +1204,8 @@
       argv[3]=mydb->path;
       argv[4]='\0';
 
-      audioDB::audioDB(4,argv,&sss ,&apierror);
+      audioDB::audioDB(4,argv,status ,&apierror);
       
-      status->numFiles=sss.numFiles;
-      status->dim=sss.dim;
-      status->length=sss.length;
-      status->dudCount=sss.dudCount;
-      status->nullCount=sss.nullCount;
-      status->flags=sss.flags;
-
       return apierror;
   }
 
--- a/audioDB.h	Mon Nov 24 15:42:15 2008 +0000
+++ b/audioDB.h	Tue Nov 25 16:40:59 2008 +0000
@@ -204,18 +204,6 @@
   off_t dbSize;
 } dbTableHeaderT, *dbTableHeaderPtr;
 
-typedef struct {
-
-    unsigned numFiles;
-    unsigned dim;
-    unsigned length;
-    unsigned dudCount;
-    unsigned nullCount;
-    unsigned flags;
-
-
-} cppstatus, *cppstatusptr;
-
 class PointPair{
  public:
   Uns32T trackID;
@@ -360,7 +348,7 @@
   audioDB(const unsigned argc, const char *argv[], adb__statusResponse *adbStatusResponse);
   audioDB(const unsigned argc, const char *argv[], adb__lisztResponse *adbLisztResponse);
   audioDB(const unsigned argc, const char *argv[], int * apierror);
-  audioDB(const unsigned argc, const char *argv[], cppstatusptr stat, int * apierror);
+  audioDB(const unsigned argc, const char *argv[], struct adbstatus *status, int * apierror);
   audioDB(const unsigned argc, const char *argv[],adb__queryResponse *adbQueryResponse, int * apierror);
 
 
@@ -378,7 +366,7 @@
   void batchinsert_large_adb(const char* dbName, const char* inFile);
   void query(const char* dbName, const char* inFile, adb__queryResponse *adbQueryResponse=0);
   void status(const char* dbName, adb__statusResponse *adbStatusResponse=0);
-  void status(const char* dbName, cppstatusptr status);
+  void status(const char* dbName, struct adbstatus *status);
 
   unsigned random_track(unsigned *propTable, unsigned total);
   void sample(const char *dbName);