Commit 7a98d028 authored by claes's avatar claes

Directory db is always berkeleydb

parent 81dc5a2b
/* /*
* Proview $Id: wb_ldh.cpp,v 1.67 2008-02-05 14:53:12 claes Exp $ * Proview $Id: wb_ldh.cpp,v 1.68 2008-04-10 10:39:29 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1970,9 +1970,12 @@ ldh_WbLoad( ldh_tSession session, char *loadfile, int ignore_oix) ...@@ -1970,9 +1970,12 @@ ldh_WbLoad( ldh_tSession session, char *loadfile, int ignore_oix)
char server[80]; char server[80];
pwr_tStatus sts; pwr_tStatus sts;
sts = lfu_GetVolumeCnf( (char *)vwbl->name(), &vid, &cid, &volrep, server); if ( cdh_NoCaseStrcmp( vwbl->name(), "directory") == 0)
if ( EVEN(sts)) return sts; volrep = ldh_eVolRep_Db;
else {
sts = lfu_GetVolumeCnf( (char *)vwbl->name(), &vid, &cid, &volrep, server);
if ( EVEN(sts)) return sts;
}
if ( volrep == ldh_eVolRep_Db) { if ( volrep == ldh_eVolRep_Db) {
cdh_ToLower( vname, vwbl->name()); cdh_ToLower( vname, vwbl->name());
strcpy( db_name, "$pwrp_db/"); strcpy( db_name, "$pwrp_db/");
......
/* /*
* Proview $Id: wb_lfu.cpp,v 1.12 2008-02-27 06:30:57 claes Exp $ * Proview $Id: wb_lfu.cpp,v 1.13 2008-04-10 10:39:29 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -2471,6 +2471,7 @@ pwr_tStatus lfu_GetVolumeCnf( char *name, pwr_tVid *vid, pwr_tCid *cid, ldh_eVol ...@@ -2471,6 +2471,7 @@ pwr_tStatus lfu_GetVolumeCnf( char *name, pwr_tVid *vid, pwr_tCid *cid, ldh_eVol
pwr_tFileName fname; pwr_tFileName fname;
char line[200]; char line[200];
char vol_array[7][80]; char vol_array[7][80];
int found = 0;
strcpy( fname, load_cNameVolumeList); strcpy( fname, load_cNameVolumeList);
dcli_translate_filename( fname, fname); dcli_translate_filename( fname, fname);
...@@ -2478,61 +2479,71 @@ pwr_tStatus lfu_GetVolumeCnf( char *name, pwr_tVid *vid, pwr_tCid *cid, ldh_eVol ...@@ -2478,61 +2479,71 @@ pwr_tStatus lfu_GetVolumeCnf( char *name, pwr_tVid *vid, pwr_tCid *cid, ldh_eVol
*volrep = ldh_eVolRep_Db; *volrep = ldh_eVolRep_Db;
ifstream fpm( fname, ios::in); ifstream fpm( fname, ios::in);
if ( fpm) { if ( !fpm)
return 0;
while ( fpm.getline( line, sizeof(line))) { while ( fpm.getline( line, sizeof(line))) {
int nr; int nr;
if ( line[0] == '#') if ( line[0] == '#')
continue; continue;
nr = dcli_parse( line, " ", "", (char *)vol_array, nr = dcli_parse( line, " ", "", (char *)vol_array,
sizeof(vol_array)/sizeof(vol_array[0]), sizeof(vol_array)/sizeof(vol_array[0]),
sizeof(vol_array[0]), 0); sizeof(vol_array[0]), 0);
sts = cdh_StringToVolumeId( vol_array[1], vid);
if ( EVEN(sts)) return sts;
if ( cdh_NoCaseStrcmp( vol_array[2], "RootVolume") == 0) if ( cdh_NoCaseStrcmp( vol_array[0], name) != 0)
*cid = pwr_eClass_RootVolume; continue;
else if ( cdh_NoCaseStrcmp( vol_array[2], "SubVolume") == 0)
*cid = pwr_eClass_SubVolume; found = 1;
else if ( cdh_NoCaseStrcmp( vol_array[2], "SharedVolume") == 0)
*cid = pwr_eClass_SharedVolume; sts = cdh_StringToVolumeId( vol_array[1], vid);
else if ( cdh_NoCaseStrcmp( vol_array[2], "ClassVolume") == 0) if ( EVEN(sts)) return sts;
*cid = pwr_eClass_ClassVolume;
if ( cdh_NoCaseStrcmp( vol_array[2], "RootVolume") == 0)
switch ( *cid) { *cid = pwr_eClass_RootVolume;
case pwr_eClass_RootVolume: else if ( cdh_NoCaseStrcmp( vol_array[2], "SubVolume") == 0)
case pwr_eClass_SubVolume: *cid = pwr_eClass_SubVolume;
case pwr_eClass_SharedVolume: else if ( cdh_NoCaseStrcmp( vol_array[2], "SharedVolume") == 0)
*volrep = ldh_eVolRep_Db; *cid = pwr_eClass_SharedVolume;
if ( cdh_NoCaseStrcmp( vol_array[0], name) == 0) { else if ( cdh_NoCaseStrcmp( vol_array[2], "ClassVolume") == 0)
if ( nr > 4 && strcmp( vol_array[4], "1") == 0) { *cid = pwr_eClass_ClassVolume;
*volrep = ldh_eVolRep_Dbms;
if ( nr > 5) switch ( *cid) {
strcpy( server, vol_array[5]); case pwr_eClass_RootVolume:
} case pwr_eClass_SubVolume:
break; case pwr_eClass_SharedVolume:
*volrep = ldh_eVolRep_Db;
if ( cdh_NoCaseStrcmp( vol_array[0], name) == 0) {
if ( nr > 4 && strcmp( vol_array[4], "1") == 0) {
*volrep = ldh_eVolRep_Dbms;
if ( nr > 5)
strcpy( server, vol_array[5]);
} }
case pwr_eClass_ClassVolume: }
*volrep = ldh_eVolRep_Wbl; break;
if ( cdh_NoCaseStrcmp( vol_array[0], name) == 0) { case pwr_eClass_ClassVolume:
if ( nr > 4 && strcmp( vol_array[4], "1") == 0) *volrep = ldh_eVolRep_Wbl;
*volrep = ldh_eVolRep_Db; if ( cdh_NoCaseStrcmp( vol_array[0], name) == 0) {
else if ( nr > 4 && strcmp( vol_array[4], "2") == 0) { if ( nr > 4 && strcmp( vol_array[4], "1") == 0)
*volrep = ldh_eVolRep_Dbms; *volrep = ldh_eVolRep_Db;
if ( nr > 5) else if ( nr > 4 && strcmp( vol_array[4], "2") == 0) {
strcpy( server, vol_array[5]); *volrep = ldh_eVolRep_Dbms;
} if ( nr > 5)
break; strcpy( server, vol_array[5]);
} }
default: ;
} }
break;
default: ;
} }
fpm.close(); break;
} }
return LFU__SUCCESS; fpm.close();
if ( found)
return LFU__SUCCESS;
return 0;
} }
pwr_tStatus lfu_ParseDbmsServer( char *server, char *user, char *password, pwr_tStatus lfu_ParseDbmsServer( char *server, char *user, char *password,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment