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
22075623
Commit
22075623
authored
Mar 31, 2004
by
lw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected bugs in wb_volrepdb, finished meta volumes in db and dbs
parent
c2327079
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
86 additions
and
42 deletions
+86
-42
src/lib/co/src/co_dbs.c
src/lib/co/src/co_dbs.c
+3
-3
src/lib/co/src/co_dbs.pdr
src/lib/co/src/co_dbs.pdr
+1
-1
wb/exe/wb_dbcheck/src/wb_dbcheck.cpp
wb/exe/wb_dbcheck/src/wb_dbcheck.cpp
+12
-8
wb/exe/wb_wbltest/src/wb_wbltest.cpp
wb/exe/wb_wbltest/src/wb_wbltest.cpp
+11
-9
wb/lib/wb/src/wb_db.cpp
wb/lib/wb/src/wb_db.cpp
+8
-1
wb/lib/wb/src/wb_db.h
wb/lib/wb/src/wb_db.h
+1
-1
wb/lib/wb/src/wb_dbs.cpp
wb/lib/wb/src/wb_dbs.cpp
+1
-1
wb/lib/wb/src/wb_dbs.h
wb/lib/wb/src/wb_dbs.h
+1
-1
wb/lib/wb/src/wb_import.h
wb/lib/wb/src/wb_import.h
+1
-1
wb/lib/wb/src/wb_ldh.cpp
wb/lib/wb/src/wb_ldh.cpp
+11
-5
wb/lib/wb/src/wb_merep.cpp
wb/lib/wb/src/wb_merep.cpp
+13
-0
wb/lib/wb/src/wb_merep.h
wb/lib/wb/src/wb_merep.h
+3
-0
wb/lib/wb/src/wb_vrepdb.cpp
wb/lib/wb/src/wb_vrepdb.cpp
+14
-9
wb/lib/wb/src/wb_vrepdb.h
wb/lib/wb/src/wb_vrepdb.h
+1
-0
wb/lib/wb/src/wb_vrepdbs.cpp
wb/lib/wb/src/wb_vrepdbs.cpp
+4
-1
wb/lib/wb/src/wb_vrepmem.h
wb/lib/wb/src/wb_vrepmem.h
+1
-1
No files found.
src/lib/co/src/co_dbs.c
View file @
22075623
...
...
@@ -484,7 +484,7 @@ static dbs_sVolRef *findVolref(dbs_sMenv *mep, pwr_tVid vid)
}
void
dbs_Split
(
pwr_tStatus
*
sts
,
dbs_sMenv
*
mep
)
dbs_Split
(
pwr_tStatus
*
sts
,
dbs_sMenv
*
mep
,
char
*
dirName
)
{
int
i
;
...
...
@@ -497,7 +497,7 @@ dbs_Split(pwr_tStatus *sts, dbs_sMenv *mep)
size_t
bytes
;
size_t
size
;
FILE
*
fp
;
char
fileName
[
256
];
char
fileName
[
512
];
char
*
p
;
vep
=
&
mep
->
venv
[
i
+
1
];
...
...
@@ -508,7 +508,7 @@ dbs_Split(pwr_tStatus *sts, dbs_sMenv *mep)
printf
(
" size %d, index %d, nSect %d
\n
"
,
vep
->
size
,
vep
->
index
,
vep
->
nSect
);
size
=
offset
=
vep
->
size
;
sprintf
(
fileName
,
"%s
.dbs"
,
vep
->
vp
->
name
);
sprintf
(
fileName
,
"%s
/%s.dbs"
,
dirName
,
vep
->
vp
->
name
);
cdh_ToLower
(
fileName
,
fileName
);
fp
=
fopen
(
fileName
,
"w+b"
);
...
...
src/lib/co/src/co_dbs.pdr
View file @
22075623
...
...
@@ -616,7 +616,7 @@ struct dbs_sScObject {
%
%dbs_sMenv *dbs_Map(pwr_tStatus*, const char*);
%dbs_sVenv *dbs_Vmap(pwr_tStatus*, int index, dbs_sMenv *);
%void dbs_Split(pwr_tStatus *sts, dbs_sMenv *mep);
%void dbs_Split(pwr_tStatus *sts, dbs_sMenv *mep
, char *dirName
);
%pwr_tBoolean dbs_Unmap(pwr_tStatus *sts, dbs_sMenv *);
%int dbs_nVolRef(pwr_tStatus *sts, const dbs_sMenv *mep);
%
...
...
wb/exe/wb_dbcheck/src/wb_dbcheck.cpp
View file @
22075623
...
...
@@ -109,8 +109,8 @@ int main( int argc, char *argv[])
if
(
!
oep
->
flags
.
b
.
inClass
)
printf
(
"[%d] not in class
\n
"
,
oep
->
o
.
oid
.
oix
);
if
(
!
oep
->
flags
.
b
.
inRbody
&&
oep
->
o
.
body
[
0
].
size
!=
0
)
printf
(
"[%d] not in rbody
\n
"
,
oep
->
o
.
oid
.
oix
);
if
(
!
oep
->
flags
.
b
.
inDbody
&&
oep
->
o
.
body
[
1
].
size
!=
0
)
printf
(
"[%d] not in dbody
\n
"
,
oep
->
o
.
oid
.
oix
);
if
(
oep
->
flags
.
b
.
inRbody
&&
oep
->
o
.
body
[
0
].
size
==
0
)
printf
(
"[%d] in rbody
\n
"
,
oep
->
o
.
oid
.
oix
);
if
(
oep
->
flags
.
b
.
inDbody
&&
oep
->
o
.
body
[
1
].
size
==
0
)
printf
(
"[%d] in dbody
\n
"
,
oep
->
o
.
oid
.
oix
);
//
if (oep->flags.b.inRbody && oep->o.body[0].size == 0) printf("[%d] in rbody\n", oep->o.oid.oix);
//
if (oep->flags.b.inDbody && oep->o.body[1].size == 0) printf("[%d] in dbody\n", oep->o.oid.oix);
if
(
!
oep
->
flags
.
b
.
pOk
)
{
#if 1
if
(
oep
->
poep
!=
NULL
&&
oep
->
poep
->
flags
.
b
.
inOhead
)
{
...
...
@@ -169,8 +169,10 @@ printname(pwr_tOid poid, pwr_tObjName name, pwr_tOid oid)
sOentry
*
oep
;
count_name
++
;
printf
(
"N [%10.10d.%10.10d] %d:%s
\n
"
,
oid
.
vid
,
oid
.
oix
,
strlen
(
name
),
name
);
if
(
cdh_ObjidIsNull
(
poid
)
||
poid
.
oix
==
0
)
{
printf
(
"N [%10.10d.%10.10d] %d:%s
\n
"
,
oid
.
vid
,
oid
.
oix
,
strlen
(
name
),
name
);
}
oep
=
(
sOentry
*
)
tree_Find
(
&
sts
,
oid_th
,
&
oid
);
if
(
EVEN
(
sts
))
{
printf
(
"Name: object not found %d.%d, %s
\n
"
,
oid
.
vid
,
oid
.
oix
,
name
);
...
...
@@ -197,7 +199,7 @@ printclass(pwr_tOid oid, pwr_tCid cid)
sOentry
*
oep
;
count_class
++
;
printf
(
"C [%10.10d.%10.10d] <%d>
\n
"
,
oid
.
vid
,
oid
.
oix
,
cid
);
//
printf("C [%10.10d.%10.10d] <%d>\n", oid.vid, oid.oix, cid);
oep
=
(
sOentry
*
)
tree_Find
(
&
sts
,
oid_th
,
&
oid
);
if
(
EVEN
(
sts
))
{
...
...
@@ -221,10 +223,12 @@ printohead(pwr_tOid oid, db_sObject *op)
if
(
cdh_ObjidIsNotEqual
(
oid
,
op
->
oid
))
printf
(
"Ohead: oid not equal %s oid: %d.%d != %d.%d
\n
"
,
op
->
name
,
oid
.
vid
,
oid
.
oix
,
op
->
oid
.
vid
,
op
->
oid
.
oix
);
// printf("O [%10.10d.%10.10d] [%10.10d.%10.10d] P [%10.10d.%10.10d] %d:%s\n B [%10.10d.%10.10d] A [%10.10d.%10.10d] F [%10.10d.%10.10d] L [%10.10d.%10.10d] \n", oid.vid, oid.oix, op->oid.vid, op->oid.oix, op->poid.vid, op->poid.oix, strlen(op->name), op->name, op->boid.vid, op->boid.oix, op->aoid.vid, op->aoid.oix, op->foid.vid, op->foid.oix, op->loid.vid, op->loid.oix);
printf
(
"P [%6.6d] B [%6.6d] O [%6.6d] A [%6.6d] F [%6.6d] L [%6.6d]
\n
"
,
op
->
poid
.
oix
,
op
->
boid
.
oix
,
op
->
oid
.
oix
,
op
->
aoid
.
oix
,
op
->
foid
.
oix
,
op
->
loid
.
oix
);
// printf("O [%10.10d.%10.10d] [%10.10d.%10.10d] P [%10.10d.%10.10d] %d:%s\n B [%10.10d.%10.10d] A [%10.10d.%10.10d] F [%10.10d.%10.10d] L [%10.10d.%10.10d] \n", oid.vid, oid.oix, op->oid.vid, op->oid.oix, op->poid.vid, op->poid.oix, strlen(op->name), op->name, op->boid.vid, op->boid.oix, op->aoid.vid, op->aoid.oix, op->foid.vid, op->foid.oix, op->loid.vid, op->loid.oix);
if
(
cdh_ObjidIsNull
(
op
->
poid
)
||
op
->
poid
.
oix
==
0
)
{
printf
(
"P [%6.6d] B [%6.6d] O [%6.6d] A [%6.6d] F [%6.6d] L [%6.6d]
\n
"
,
op
->
poid
.
oix
,
op
->
boid
.
oix
,
op
->
oid
.
oix
,
op
->
aoid
.
oix
,
op
->
foid
.
oix
,
op
->
loid
.
oix
);
}
oep
=
(
sOentry
*
)
tree_Insert
(
&
sts
,
oid_th
,
&
oid
);
if
(
sts
==
TREE__INSERTED
)
{
oep
->
flags
.
b
.
inOhead
=
1
;
...
...
wb/exe/wb_wbltest/src/wb_wbltest.cpp
View file @
22075623
#include "pwr.h"
#include "wb_merep.h"
#include "wb_erep.h"
#include "wb_env.h"
#include "wb_vrepdbs.h"
...
...
@@ -17,7 +18,7 @@
#include "co_dbs.h"
#include "co_time.h"
#if
1
#if
0
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
...
...
@@ -125,10 +126,10 @@ int main( int argc, char *argv[])
printf
(
"
\n
Ditt namn baklnges r: %s
\n
"
,
bnamn
);
}
#elif
0
#elif
1
int
main
(
int
argc
,
char
*
argv
[])
{
pwr_tStatus
sts
;
//
pwr_tStatus sts;
//dbs_sEnv env;
//dbs_sEnv *ep;
wb_erep
*
erep
=
new
wb_erep
();
...
...
@@ -150,13 +151,14 @@ int main( int argc, char *argv[])
//db.importVolume(*vdbs);
db
.
close
();
wb_vrepdb
vdb
(
erep
,
argv
[
2
]);
wb_name
n
(
"VHX-NU4-KOM-EVELINA-Transar-W-cn254"
);
wb_orepdb
*
op
=
(
wb_orepdb
*
)
vdb
.
object
(
&
sts
,
n
);
wb_vrepdb
vdb
(
erep
,
1000
,
pwr_eClass_RootVolume
,
"Kalle"
,
"/home/lw/kalle"
);
//wb_vrepdb vdb(erep, argv[2]);
//wb_name n("VHX-NU4-KOM-EVELINA-Transar-W-cn254");
//wb_orepdb *op = (wb_orepdb *)vdb.object(&sts, n);
wb_dbs
adbs
(
vdbs
);
adbs
.
setFileName
(
"alasse.dbs"
);
adbs
.
importVolume
(
vdb
);
//
wb_dbs adbs(vdbs);
//
adbs.setFileName("alasse.dbs");
//
adbs.importVolume(vdb);
}
#elif 0
...
...
wb/lib/wb/src/wb_db.cpp
View file @
22075623
...
...
@@ -1196,7 +1196,14 @@ bool wb_db::importDbody(pwr_tOid oid, size_t size, void *body)
return
true
;
}
bool
wb_db
::
importMeta
(
dbs_s
Env
*
ep
)
bool
wb_db
::
importMeta
(
dbs_s
Menv
*
m
ep
)
{
pwr_tStatus
sts
=
1
;
printf
(
"Import meta, my filename: %s
\n
"
,
m_fileName
);
if
(
mep
!=
0
)
dbs_Split
(
&
sts
,
mep
,
m_fileName
);
return
true
;
}
wb/lib/wb/src/wb_db.h
View file @
22075623
...
...
@@ -99,7 +99,7 @@ public:
bool
importDocBlock
(
pwr_tOid
oid
,
size_t
size
,
char
*
block
)
{
return
true
;}
bool
importMeta
(
dbs_s
Env
*
ep
);
bool
importMeta
(
dbs_s
Menv
*
m
ep
);
};
...
...
wb/lib/wb/src/wb_dbs.cpp
View file @
22075623
...
...
@@ -1142,7 +1142,7 @@ wb_dbs::classInsert(sOentry *oep)
}
bool
wb_dbs
::
importMeta
(
dbs_s
Env
*
ep
)
wb_dbs
::
importMeta
(
dbs_s
Menv
*
m
ep
)
{
return
true
;
}
...
...
wb/lib/wb/src/wb_dbs.h
View file @
22075623
...
...
@@ -155,7 +155,7 @@ public:
virtual
bool
importDocBlock
(
pwr_tOid
oid
,
size_t
size
,
char
*
block
)
{
return
true
;}
virtual
bool
importMeta
(
dbs_s
Env
*
ep
);
virtual
bool
importMeta
(
dbs_s
Menv
*
m
ep
);
private
:
...
...
wb/lib/wb/src/wb_import.h
View file @
22075623
...
...
@@ -24,7 +24,7 @@ public:
virtual
bool
importDocBlock
(
pwr_tOid
oid
,
size_t
size
,
char
*
block
)
=
0
;
virtual
bool
importMeta
(
dbs_s
Env
*
ep
)
=
0
;
virtual
bool
importMeta
(
dbs_s
Menv
*
m
ep
)
=
0
;
};
...
...
wb/lib/wb/src/wb_ldh.cpp
View file @
22075623
...
...
@@ -758,13 +758,19 @@ ldh_GetReferenceInfo(ldh_tSession session, pwr_tOid oid, ldh_sRefInfo *rip)
pwr_tStatus
ldh_GetRootList
(
ldh_tSession
session
,
pwr_tOid
*
oid
)
{
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_object
o
=
sp
->
object
();
if
(
!
o
)
return
o
.
sts
();
try
{
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_object
o
=
sp
->
object
();
if
(
!
o
)
return
o
.
sts
();
*
oid
=
o
.
oid
();
*
oid
=
o
.
oid
();
return
o
.
sts
();
return
o
.
sts
();
}
catch
(
wb_error
&
e
)
{
return
e
.
sts
();
}
}
/* Get first object in root list of volume with volume id 'vid'. */
...
...
wb/lib/wb/src/wb_merep.cpp
View file @
22075623
#include <iostream>
#include <stdlib.h>
#include "wb_merep.h"
#include "wb_cdrep.h"
...
...
@@ -58,6 +59,18 @@ wb_mvrep *wb_merep::volume(pwr_tStatus *sts, const char *name)
return
0
;
}
void
wb_merep
::
copyFiles
(
const
char
*
dirName
)
{
mvrep_iterator
it
;
for
(
it
=
m_mvrepdbs
.
begin
();
it
!=
m_mvrepdbs
.
end
();
it
++
)
{
wb_vrepdbs
*
dp
=
(
wb_vrepdbs
*
)
it
->
second
;
char
cmd
[
512
];
sprintf
(
cmd
,
"cp %s %s"
,
dp
->
fileName
(),
dirName
);
printf
(
"%s
\n
"
,
cmd
);
system
(
cmd
);
}
}
wb_orep
*
wb_merep
::
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
)
{
wb_vrep
*
vrep
=
volume
(
sts
,
oid
.
vid
);
...
...
wb/lib/wb/src/wb_merep.h
View file @
22075623
...
...
@@ -3,6 +3,7 @@
#include "wb_mvrep.h"
#include "wb_attrname.h"
#include "wb_vrepdbs.h"
#include <map>
using
namespace
std
;
...
...
@@ -28,6 +29,8 @@ public:
wb_mvrep
*
volume
(
pwr_tStatus
*
sts
,
pwr_tVid
vid
);
wb_mvrep
*
volume
(
pwr_tStatus
*
sts
,
const
char
*
name
);
void
copyFiles
(
const
char
*
dirname
);
wb_orep
*
object
(
pwr_tStatus
*
sts
,
pwr_tOid
oid
);
void
addDbs
(
pwr_tStatus
*
sts
,
wb_mvrep
*
mvrep
);
void
removeDbs
(
pwr_tStatus
*
sts
,
wb_mvrep
*
mvrep
);
...
...
wb/lib/wb/src/wb_vrepdb.cpp
View file @
22075623
...
...
@@ -9,7 +9,7 @@
#include "wb_dbs.h"
#include "db_cxx.h"
#include "wb_ldh.h"
#include "wb_merep.h"
void
wb_vrepdb
::
unref
()
{
...
...
@@ -52,6 +52,8 @@ wb_vrepdb::wb_vrepdb(wb_erep *erep, pwr_tVid vid, pwr_tCid cid, const char *volu
m_cid
=
m_db
->
cid
();
m_merep
=
m_erep
->
merep
();
m_merep
->
copyFiles
(
fileName
);
}
wb_erep
*
wb_vrepdb
::
erep
()
...
...
@@ -399,6 +401,7 @@ wb_orep* wb_vrepdb::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
printf
(
"wb_vrepdb::createObject, c.put rs %d
\n
"
,
rs
);
rs
=
txn
->
commit
(
0
);
return
new
(
this
)
wb_orepdb
(
&
o
.
m_o
);
}
catch
(
DbException
&
e
)
{
...
...
@@ -451,8 +454,6 @@ bool wb_vrepdb::deleteFamilyMember(pwr_tOid oid, wb_db_txn *txn)
wb_db_ohead
o
(
m_db
,
oid
);
o
.
get
(
txn
);
//if (rs)
//printf("wb_vrepdb::deleteFamilyMember, o.get rs %d\n", rs);
deleteFamilyMember
(
o
.
foid
(),
txn
);
...
...
@@ -472,15 +473,15 @@ bool wb_vrepdb::deleteFamilyMember(pwr_tOid oid, wb_db_txn *txn)
// if (rs)
//printf("wb_vrepdb::deleteFamilyMember, rb.get rs %d\n", rs);
rs
=
o
.
del
(
txn
);
if
(
rs
)
printf
(
"wb_vrepdb::deleteFamilyMember, o.del rs %d
\n
"
,
rs
);
wb_db_name
n
(
m_db
,
o
.
oid
(),
o
.
poid
(),
o
.
normname
());
rs
=
n
.
del
(
txn
);
if
(
rs
)
printf
(
"wb_vrepdb::deleteFamilyMember, n.del rs %d
\n
"
,
rs
);
rs
=
o
.
del
(
txn
);
if
(
rs
)
printf
(
"wb_vrepdb::deleteFamilyMember, o.del rs %d
\n
"
,
rs
);
return
true
;
}
...
...
@@ -1114,7 +1115,7 @@ void wb_vrepdb::unadopt(wb_db_txn *txn, wb_db_ohead &o)
}
wb_db_name
n
(
m_db
,
o
.
oid
(),
o
.
poid
(),
o
.
normname
());
n
.
del
(
txn
);
rc
=
n
.
del
(
txn
);
if
(
rc
)
printf
(
"wb_vrepdb::unadopt, n.del rc %d
\n
"
,
rc
);
...
...
@@ -1122,9 +1123,13 @@ void wb_vrepdb::unadopt(wb_db_txn *txn, wb_db_ohead &o)
o
.
aoid
(
pwr_cNOid
);
o
.
boid
(
pwr_cNOid
);
p
.
put
(
txn
);
rc
=
p
.
put
(
txn
);
if
(
rc
)
printf
(
"wb_vrepdb::unadopt, p.put rc %d
\n
"
,
rc
);
rc
=
o
.
put
(
txn
);
if
(
rc
)
printf
(
"wb_vrepdb::unadopt, o.put rc %d
\n
"
,
rc
);
}
bool
wb_vrepdb
::
exportVolume
(
wb_import
&
i
)
...
...
wb/lib/wb/src/wb_vrepdb.h
View file @
22075623
...
...
@@ -2,6 +2,7 @@
#define wb_vrepdb_h
#include "wb_vrep.h"
#include "wb_vrepdbs.h"
#include "wb_orepdb.h"
#include "wb_db.h"
#include "db_cxx.h"
...
...
wb/lib/wb/src/wb_vrepdbs.cpp
View file @
22075623
#include "wb_vrepdbs.h"
#include "wb_orepdbs.h"
#include "wb_erep.h"
#include "wb_merep.h"
#include "wb_erep.h"
#include "wb_import.h"
#include "wb_treeimport.h"
...
...
@@ -507,11 +507,14 @@ bool wb_vrepdbs::exportDbody(wb_import &i)
bool
wb_vrepdbs
::
exportDocBlock
(
wb_import
&
i
)
{
return
false
;
}
bool
wb_vrepdbs
::
exportMeta
(
wb_import
&
i
)
{
i
.
importMeta
(
dbsenv
()
->
mp
);
return
false
;
}
...
...
wb/lib/wb/src/wb_vrepmem.h
View file @
22075623
...
...
@@ -332,7 +332,7 @@ public:
virtual
bool
importRbody
(
pwr_tOid
oid
,
size_t
size
,
void
*
body
);
virtual
bool
importDbody
(
pwr_tOid
oid
,
size_t
size
,
void
*
body
);
virtual
bool
importDocBlock
(
pwr_tOid
oid
,
size_t
size
,
char
*
block
);
virtual
bool
importMeta
(
dbs_s
Env
*
ep
)
{
return
true
;}
virtual
bool
importMeta
(
dbs_s
Menv
*
m
ep
)
{
return
true
;}
bool
importBuildObject
(
mem_object
*
memo
);
void
loadWbl
(
char
*
filename
,
pwr_tStatus
*
sts
);
void
freeObject
(
mem_object
*
mem
);
...
...
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