]> git.treefish.org Git - phys/latlib.git/blobdiff - configcache.cpp
Implemented rw-cache. Made general options uppercase. Formatted options.
[phys/latlib.git] / configcache.cpp
index c6f90821090240d9f9e36ae68b691e2f92c7d132..34789ee71b4dbdf0ef1af5b9aa4451567c346908 100644 (file)
@@ -191,7 +191,7 @@ void configcache::readConfig(bool *readnewconfig, int *nequileft, vector<unsigne
 {
   *readnewconfig = false;
 
 {
   *readnewconfig = false;
 
-  if(DATADIR == "" || MODE == CACHE_MODE_DISABLED) return;
+  if( DATADIR == "" || !(MODE==CACHE_MODE_RO||MODE==CACHE_MODE_RW) ) return;
 
   if(refetchDataFiles){
     refetchDataFiles = false;
 
   if(refetchDataFiles){
     refetchDataFiles = false;
@@ -288,7 +288,7 @@ void configcache::openOutFile(int actnequi)
 void configcache::writeHeader(const string& headerid, const char *header, long unsigned int size, int actnequi) {
   unsigned long headeridhash;
 
 void configcache::writeHeader(const string& headerid, const char *header, long unsigned int size, int actnequi) {
   unsigned long headeridhash;
 
-  if( DATADIR == "" || MODE < 2 ) return;
+  if( DATADIR == "" || !(MODE==CACHE_MODE_WO||MODE==CACHE_MODE_RW) ) return;
 
   if(!outFile.is_open())
     openOutFile(actnequi);
 
   if(!outFile.is_open())
     openOutFile(actnequi);
@@ -304,7 +304,7 @@ void configcache::writeConfig(int actnequi)
 {
   long unsigned int zeroheader=0;
 
 {
   long unsigned int zeroheader=0;
 
-  if ( DATADIR == "" || MODE < 2 ) return;
+  if ( DATADIR == "" || !(MODE==CACHE_MODE_WO||MODE==CACHE_MODE_RW) ) return;
 
   if ( ! outFile.is_open() )
     openOutFile(actnequi);
 
   if ( ! outFile.is_open() )
     openOutFile(actnequi);