diff insert.cpp @ 256:4dcb09f5fe85

Commit patch deprecating the --size argument, replacing it with --ntracks, --datadims and --datasize. These names are not ideal, but will serve for now.
author mas01cr
date Wed, 16 Apr 2008 09:59:43 +0000
parents a6c9a1c68646
children 34ce7f7a177d
line wrap: on
line diff
--- a/insert.cpp	Sat Apr 12 13:28:30 2008 +0000
+++ b/insert.cpp	Wed Apr 16 09:59:43 2008 +0000
@@ -4,8 +4,8 @@
   unsigned int fmaxfiles, tmaxfiles;
   unsigned int maxfiles;
 
-  fmaxfiles = fileTableLength / O2_FILETABLESIZE;
-  tmaxfiles = trackTableLength / O2_TRACKTABLESIZE;
+  fmaxfiles = fileTableLength / O2_FILETABLE_ENTRY_SIZE;
+  tmaxfiles = trackTableLength / O2_TRACKTABLE_ENTRY_SIZE;
   maxfiles = fmaxfiles > tmaxfiles ? tmaxfiles : fmaxfiles;
   return(dbH->numFiles < maxfiles);
 }
@@ -42,7 +42,7 @@
   // Linear scan of filenames check for pre-existing feature
   unsigned alreadyInserted=0;
   for(unsigned k=0; k<dbH->numFiles; k++)
-    if(strncmp(fileTable + k*O2_FILETABLESIZE, key, strlen(key)+1)==0){
+    if(strncmp(fileTable + k*O2_FILETABLE_ENTRY_SIZE, key, strlen(key)+1)==0){
       alreadyInserted=1;
       break;
     }
@@ -64,7 +64,7 @@
     return;
   }
 
-  strncpy(fileTable + dbH->numFiles*O2_FILETABLESIZE, key, strlen(key));
+  strncpy(fileTable + dbH->numFiles*O2_FILETABLE_ENTRY_SIZE, key, strlen(key));
 
   off_t insertoffset = dbH->length;// Store current state
 
@@ -236,7 +236,7 @@
     unsigned alreadyInserted=0;
   
     for(unsigned k=0; k<dbH->numFiles; k++)
-      if(strncmp(fileTable + k*O2_FILETABLESIZE, thisKey, strlen(thisKey)+1)==0){
+      if(strncmp(fileTable + k*O2_FILETABLE_ENTRY_SIZE, thisKey, strlen(thisKey)+1)==0){
 	alreadyInserted=1;
 	break;
       }
@@ -285,7 +285,7 @@
             close(thispowerfd);
           }
         }
-	strncpy(fileTable + dbH->numFiles*O2_FILETABLESIZE, thisKey, strlen(thisKey));
+	strncpy(fileTable + dbH->numFiles*O2_FILETABLE_ENTRY_SIZE, thisKey, strlen(thisKey));
   
 	off_t insertoffset = dbH->length;// Store current state