Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
d1cb910c
Commit
d1cb910c
authored
Feb 27, 2003
by
lw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
2b392528
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
271 additions
and
41 deletions
+271
-41
wb/lib/wb/src/wb_db.cpp
wb/lib/wb/src/wb_db.cpp
+42
-13
wb/lib/wb/src/wb_db.h
wb/lib/wb/src/wb_db.h
+11
-3
wb/lib/wb/src/wb_dbs.cpp
wb/lib/wb/src/wb_dbs.cpp
+4
-7
wb/lib/wb/src/wb_erep.cpp
wb/lib/wb/src/wb_erep.cpp
+3
-3
wb/lib/wb/src/wb_orepdb.cpp
wb/lib/wb/src/wb_orepdb.cpp
+28
-1
wb/lib/wb/src/wb_orepdb.h
wb/lib/wb/src/wb_orepdb.h
+3
-0
wb/lib/wb/src/wb_vrep.h
wb/lib/wb/src/wb_vrep.h
+2
-2
wb/lib/wb/src/wb_vrepdb.cpp
wb/lib/wb/src/wb_vrepdb.cpp
+171
-12
wb/lib/wb/src/wb_vrepdb.h
wb/lib/wb/src/wb_vrepdb.h
+6
-0
wb/lib/wb/src/wb_vrepdbs.cpp
wb/lib/wb/src/wb_vrepdbs.cpp
+1
-0
No files found.
wb/lib/wb/src/wb_db.cpp
View file @
d1cb910c
...
...
@@ -20,19 +20,27 @@ wb_db_info::wb_db_info(wb_db *db) :
void
wb_db_info
::
get
(
wb_db_txn
*
txn
)
{
int
index
=
0
;
int
ret
;
m_key
.
set_data
(
&
index
);
m_key
.
set_size
(
sizeof
(
index
));
m_data
.
set_ulen
(
sizeof
(
m_volume
));
m_data
.
set_flags
(
DB_DBT_USERMEM
);
m_db
->
m_t_info
->
get
(
txn
,
&
m_key
,
&
m_data
,
0
);
ret
=
m_db
->
m_t_info
->
get
(
txn
,
&
m_key
,
&
m_data
,
0
);
printf
(
"info get: %d
\n
"
,
ret
);
}
void
wb_db_info
::
put
(
wb_db_txn
*
txn
)
{
int
index
=
0
;
int
ret
;
m_key
.
set_data
(
&
index
);
m_key
.
set_size
(
sizeof
(
index
));
m_db
->
m_t_info
->
put
(
txn
,
&
m_key
,
&
m_data
,
0
);
ret
=
m_db
->
m_t_info
->
put
(
txn
,
&
m_key
,
&
m_data
,
0
);
printf
(
"info put: %d
\n
"
,
ret
);
}
wb_db_class
::
wb_db_class
(
wb_db
*
db
,
wb_db_txn
*
txn
,
pwr_tCid
cid
)
:
...
...
@@ -161,24 +169,29 @@ void wb_db_name::name(wb_name &name)
}
wb_db_ohead
::
wb_db_ohead
()
:
m_db
(
0
),
m_key
(
&
m_o
.
oid
,
sizeof
(
m_o
.
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
m_db
(
0
),
m_key
(
&
m_o
id
,
sizeof
(
m_
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
{
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
}
wb_db_ohead
::
wb_db_ohead
(
wb_db
*
db
)
:
m_db
(
db
),
m_key
(
&
m_o
.
oid
,
sizeof
(
m_o
.
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
m_db
(
db
),
m_key
(
&
m_o
id
,
sizeof
(
m_
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
{
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
}
wb_db_ohead
::
wb_db_ohead
(
wb_db
*
db
,
pwr_tOid
oid
)
:
m_db
(
db
),
m_key
(
&
m_o
.
oid
,
sizeof
(
m_o
.
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
m_db
(
db
),
m_key
(
&
m_o
id
,
sizeof
(
m_
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
{
m_o
.
oid
=
oid
;
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
m_oid
=
oid
;
}
wb_db_ohead
::
wb_db_ohead
(
wb_db
*
db
,
wb_db_txn
*
txn
,
pwr_tOid
oid
)
:
m_db
(
db
),
m_key
(
&
m_o
.
oid
,
sizeof
(
m_o
.
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
m_db
(
db
),
m_key
(
&
m_o
id
,
sizeof
(
m_
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
{
m_o
.
oid
=
oid
;
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
m_oid
=
oid
;
get
(
txn
);
}
...
...
@@ -187,10 +200,11 @@ wb_db_ohead::wb_db_ohead(wb_db *db, pwr_tOid oid, pwr_tCid cid,
const
char
*
name
,
const
char
*
normname
,
pwr_tTime
ohTime
,
pwr_tTime
rbTime
,
pwr_tTime
dbTime
,
size_t
rbSize
,
size_t
dbSize
)
:
m_db
(
db
),
m_key
(
&
m_o
.
oid
,
sizeof
(
m_o
.
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
m_db
(
db
),
m_key
(
&
m_o
id
,
sizeof
(
m_
oid
)),
m_data
(
&
m_o
,
sizeof
(
m_o
))
{
m_o
.
oid
=
oid
;
memset
(
&
m_o
,
0
,
sizeof
(
m_o
));
m_oid
=
m_o
.
oid
=
oid
;
m_o
.
cid
=
cid
;
m_o
.
poid
=
poid
;
strcpy
(
m_o
.
name
,
name
);
...
...
@@ -212,7 +226,10 @@ wb_db_ohead::wb_db_ohead(wb_db *db, pwr_tOid oid, pwr_tCid cid,
wb_db_ohead
&
wb_db_ohead
::
get
(
wb_db_txn
*
txn
)
{
m_db
->
m_t_ohead
->
get
(
txn
,
&
m_key
,
&
m_data
,
0
);
m_data
.
set_ulen
(
sizeof
(
m_o
));
m_data
.
set_flags
(
DB_DBT_USERMEM
);
int
ret
=
m_db
->
m_t_ohead
->
get
(
txn
,
&
m_key
,
&
m_data
,
0
);
return
*
this
;
}
...
...
@@ -223,8 +240,11 @@ void wb_db_ohead::put(wb_db_txn *txn)
wb_db_ohead
&
wb_db_ohead
::
get
(
wb_db_txn
*
txn
,
pwr_tOid
oid
)
{
m_o
.
oid
=
oid
;
m_db
->
m_t_ohead
->
get
(
txn
,
&
m_key
,
&
m_data
,
0
);
m_oid
=
oid
;
m_data
.
set_ulen
(
sizeof
(
m_o
));
m_data
.
set_flags
(
DB_DBT_USERMEM
);
int
ret
=
m_db
->
m_t_ohead
->
get
(
txn
,
&
m_key
,
&
m_data
,
0
);
return
*
this
;
}
...
...
@@ -524,6 +544,7 @@ bool wb_db::importVolume(wb_export &e)
}
}
bool
wb_db
::
importHead
(
pwr_tOid
oid
,
pwr_tCid
cid
,
pwr_tOid
poid
,
pwr_tOid
boid
,
pwr_tOid
aoid
,
pwr_tOid
foid
,
pwr_tOid
loid
,
const
char
*
name
,
const
char
*
normname
,
...
...
@@ -536,6 +557,14 @@ bool wb_db::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
n
.
put
(
m_txn
);
wb_db_class
c
(
this
,
cid
,
oid
);
c
.
put
(
m_txn
);
if
(
oid
.
oix
==
pwr_cNOix
)
{
// This is the volume object
wb_db_info
i
(
this
);
i
.
cid
(
cid
);
i
.
vid
(
oid
.
vid
);
i
.
name
(
name
);
i
.
put
(
m_txn
);
}
return
true
;
}
...
...
wb/lib/wb/src/wb_db.h
View file @
d1cb910c
...
...
@@ -54,6 +54,11 @@ public:
wb_db
(
pwr_tVid
vid
);
//~wb_db();
pwr_tCid
cid
()
{
return
m_cid
;}
pwr_tVid
vid
()
{
return
m_vid
;}
//pwr_tTime time() { return m_volume.time;}
char
*
volumeName
()
{
return
m_volumeName
;}
pwr_tOid
new_oid
(
wb_db_txn
*
txn
);
void
close
();
...
...
@@ -131,7 +136,8 @@ class wb_db_ohead
{
public:
db_sObject
m_o
;
pwr_tOid
m_oid
;
wb_db
*
m_db
;
Dbt
m_key
;
Dbt
m_data
;
...
...
@@ -149,6 +155,8 @@ public:
wb_db_ohead
&
get
(
wb_db_txn
*
txn
);
wb_db_ohead
&
get
(
wb_db_txn
*
txn
,
pwr_tOid
oid
);
void
setDb
(
wb_db
*
db
)
{
m_db
=
db
;}
void
put
(
wb_db_txn
*
txn
);
void
del
(
wb_db_txn
*
txn
);
...
...
@@ -163,9 +171,9 @@ public:
pwr_tOid
aoid
()
{
return
m_o
.
aoid
;}
pwr_tTime
ohTime
()
{
return
m_o
.
time
;}
char
*
name
()
{
return
m_o
.
name
;}
c
onst
c
har
*
name
()
{
return
m_o
.
name
;}
char
*
normname
()
{
return
m_o
.
normname
;}
c
onst
c
har
*
normname
()
{
return
m_o
.
normname
;}
size_t
rbSize
()
{
return
m_o
.
body
[
0
].
size
;}
size_t
dbSize
()
{
return
m_o
.
body
[
1
].
size
;}
...
...
wb/lib/wb/src/wb_dbs.cpp
View file @
d1cb910c
...
...
@@ -143,15 +143,12 @@ wb_dbs::checkObject(sOentry *oep)
switch
(
oep
->
o
.
cid
)
{
case
pwr_eClass_LibHier
:
if
(
m_volume
.
cid
==
pwr_eClass_ClassVolume
)
break
;
oep
->
o
.
flags
.
b
.
devOnly
=
1
;
if
(
m_volume
.
cid
!=
pwr_eClass_ClassVolume
)
oep
->
o
.
flags
.
b
.
devOnly
=
1
;
break
;
case
pwr_eClass_Alias
:
if
(
m_volume
.
cid
==
pwr_eClass_ClassVolume
)
break
;
oep
->
o
.
flags
.
b
.
isAliasClient
=
1
;
if
(
m_volume
.
cid
!=
pwr_eClass_ClassVolume
)
oep
->
o
.
flags
.
b
.
isAliasClient
=
1
;
break
;
case
pwr_eClass_MountVolume
:
case
pwr_eClass_CreateVolume
:
...
...
wb/lib/wb/src/wb_erep.cpp
View file @
d1cb910c
...
...
@@ -419,9 +419,9 @@ void wb_erep::loadMeta( pwr_tStatus *status)
strcat
(
vname
,
".db"
);
dcli_translate_filename
(
vname
,
vname
);
//
wb_vrepdb *vrepdb = new wb_vrepdb( this, vname);
//
vrepdb->name(vol_array[0]);
//
addDbs( &sts, vrepdb);
wb_vrepdb
*
vrepdb
=
new
wb_vrepdb
(
this
,
vname
);
vrepdb
->
name
(
vol_array
[
0
]);
addDbs
(
&
sts
,
vrepdb
);
vol_cnt
++
;
}
}
...
...
wb/lib/wb/src/wb_orepdb.cpp
View file @
d1cb910c
...
...
@@ -21,6 +21,22 @@ wb_orepdb::~wb_orepdb()
{
}
void
*
wb_orepdb
::
operator
new
(
size_t
size
,
wb_vrepdb
*
v
)
{
return
(
void
*
)
v
->
new_wb_orepdb
(
size
);
}
#if 1
void
wb_orepdb
::
operator
delete
(
void
*
p
)
{
wb_orepdb
*
o
=
(
wb_orepdb
*
)
p
;
((
wb_vrepdb
*
)
o
->
m_vrep
)
->
delete_wb_orepdb
(
p
);
}
#endif
//
// Operations declared in wb_orep
//
...
...
@@ -29,7 +45,13 @@ pwr_tOid wb_orepdb::oid() const
{
pwr_tStatus
sts
;
return
m_vrep
->
oid
(
&
sts
,
(
wb_orep
*
)
this
);
return
m_oid
;
}
pwr_tVid
wb_orepdb
::
cid
()
const
{
pwr_tStatus
sts
;
return
m_vrep
->
cid
(
&
sts
,
(
wb_orep
*
)
this
);
}
pwr_tVid
wb_orepdb
::
vid
()
const
...
...
@@ -74,6 +96,11 @@ pwr_tOid wb_orepdb::aoid() const
return
m_vrep
->
aoid
(
&
sts
,
(
wb_orep
*
)
this
);
}
wb_name
wb_orepdb
::
longName
()
{
return
wb_name
();
}
const
char
*
wb_orepdb
::
name
()
const
{
pwr_tStatus
sts
;
...
...
wb/lib/wb/src/wb_orepdb.h
View file @
d1cb910c
...
...
@@ -19,6 +19,9 @@ public:
wb_orepdb
(
db_sObject
*
o
);
~
wb_orepdb
();
void
*
operator
new
(
size_t
size
,
wb_vrepdb
*
v
);
void
operator
delete
(
void
*
p
);
virtual
pwr_tOid
oid
()
const
;
virtual
pwr_tVid
vid
()
const
;
virtual
pwr_tOix
oix
()
const
;
...
...
wb/lib/wb/src/wb_vrep.h
View file @
d1cb910c
...
...
@@ -110,8 +110,8 @@ public:
virtual
bool
isLocal
(
const
wb_orep
*
o
)
=
0
;
pwr_tVid
vid
()
const
{
return
m_vid
;}
pwr_tCid
cid
()
const
{
return
m_cid
;}
pwr_tV
id
vid
(
pwr_tVid
vid
)
{
m_vid
=
vid
;}
pwr_tC
id
cid
(
pwr_tCid
cid
)
{
m_cid
=
cid
;}
vo
id
vid
(
pwr_tVid
vid
)
{
m_vid
=
vid
;}
vo
id
cid
(
pwr_tCid
cid
)
{
m_cid
=
cid
;}
virtual
void
name
(
const
char
*
n
)
{
strcpy
(
m_name
,
n
);}
virtual
const
char
*
name
()
{
return
m_name
;}
...
...
wb/lib/wb/src/wb_vrepdb.cpp
View file @
d1cb910c
This diff is collapsed.
Click to expand it.
wb/lib/wb/src/wb_vrepdb.h
View file @
d1cb910c
...
...
@@ -13,6 +13,8 @@ protected:
//wb_session m_wsession;
wb_erep
*
m_erep
;
wb_merep
*
m_merep
;
unsigned
int
m_nSession
;
unsigned
int
m_nRef
;
...
...
@@ -125,6 +127,10 @@ public:
#endif
void
unadopt
(
wb_db_txn
*
txn
,
wb_db_ohead
&
o
);
void
adopt
(
wb_db_txn
*
txn
,
wb_db_ohead
&
o
,
wb_destination
&
dest
);
wb_orepdb
*
new_wb_orepdb
(
size_t
size
);
void
delete_wb_orepdb
(
void
*
p
);
};
#endif
wb/lib/wb/src/wb_vrepdbs.cpp
View file @
d1cb910c
...
...
@@ -39,6 +39,7 @@ dbs_sEnv *wb_vrepdbs::dbsenv()
m_isDbsenvLoaded
=
true
;
strcpy
(
m_name
,
m_dbsenv
.
vp
->
name
);
m_vid
=
m_dbsenv
.
vp
->
vid
;
m_cid
=
m_dbsenv
.
vp
->
cid
;
}
else
{
ep
=
&
m_dbsenv
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment