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
27b1d679
Commit
27b1d679
authored
Dec 17, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CreateVolume implemented
parent
4bf2349b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
32 deletions
+75
-32
wb/lib/wb/src/wb_env.cpp
wb/lib/wb/src/wb_env.cpp
+2
-2
wb/lib/wb/src/wb_env.h
wb/lib/wb/src/wb_env.h
+1
-2
wb/lib/wb/src/wb_erep.cpp
wb/lib/wb/src/wb_erep.cpp
+47
-5
wb/lib/wb/src/wb_erep.h
wb/lib/wb/src/wb_erep.h
+1
-0
wb/lib/wb/src/wb_ldh.cpp
wb/lib/wb/src/wb_ldh.cpp
+22
-23
wb/lib/wb/src/wb_ldh.h
wb/lib/wb/src/wb_ldh.h
+2
-0
No files found.
wb/lib/wb/src/wb_env.cpp
View file @
27b1d679
...
...
@@ -89,9 +89,9 @@ wb_volume wb_env::volume(const char *name)
return
v
;
}
wb_volume
wb_env
::
createVolume
(
wb_cdef
cdef
,
pwr_tVid
vid
,
wb_name
name
)
// Fix
wb_volume
wb_env
::
createVolume
(
pwr_tVid
vid
,
pwr_tCid
cid
,
const
char
*
name
)
{
wb_volume
v
;
wb_volume
v
(
m_erep
->
createVolume
(
&
m_sts
,
vid
,
cid
,
name
))
;
return
v
;
}
...
...
wb/lib/wb/src/wb_env.h
View file @
27b1d679
...
...
@@ -42,8 +42,7 @@ public:
wb_volume
snapshot
(
pwr_tVid
);
wb_volume
createVolume
(
wb_cdef
cdef
,
pwr_tVid
vid
,
wb_name
name
);
wb_volume
createVolume
(
pwr_tVid
vid
,
pwr_tCid
cid
,
const
char
*
name
);
int
nextVolatileVid
(
char
*
name
)
{
return
m_erep
->
nextVolatileVid
(
&
m_sts
,
name
);
}
...
...
wb/lib/wb/src/wb_erep.cpp
View file @
27b1d679
...
...
@@ -343,7 +343,9 @@ void wb_erep::load( pwr_tStatus *sts)
*
sts
=
status
;
return
;
}
loadMeta
(
sts
);
bindMethods
();
loadLocalWb
(
sts
);
return
;
}
loadCommonMeta
(
sts
);
...
...
@@ -465,6 +467,20 @@ void wb_erep::loadMeta( pwr_tStatus *status)
ifstream
fpm
(
fname
,
ios
::
in
);
if
(
!
fpm
)
{
*
status
=
LDH__PROJCONFIG
;
// Load directory volume
strcpy
(
vname
,
"$pwrp_db/directory.db"
);
dcli_translate_filename
(
vname
,
vname
);
sts
=
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
ODD
(
sts
))
{
wb_vrepdb
*
vrepdb
=
new
wb_vrepdb
(
this
,
vname
);
vrepdb
->
name
(
"directory"
);
addDb
(
&
sts
,
vrepdb
);
MsgWindow
::
message
(
'I'
,
"Database opened"
,
vname
);
}
return
;
}
...
...
@@ -543,11 +559,17 @@ 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
]);
addDb
(
&
sts
,
vrepdb
);
MsgWindow
::
message
(
'I'
,
"Database opened"
,
vname
);
vol_cnt
++
;
sts
=
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_INIT
);
dcli_search_file
(
vname
,
found_file
,
DCLI_DIR_SEARCH_END
);
if
(
ODD
(
sts
))
{
wb_vrepdb
*
vrepdb
=
new
wb_vrepdb
(
this
,
vname
);
vrepdb
->
name
(
vol_array
[
0
]);
addDb
(
&
sts
,
vrepdb
);
MsgWindow
::
message
(
'I'
,
"Database opened"
,
vname
);
vol_cnt
++
;
}
else
MsgWindow
::
message
(
'E'
,
"Database not found"
,
vname
);
}
}
fpm
.
close
();
...
...
@@ -728,6 +750,26 @@ int wb_erep::nextVolatileVid( pwr_tStatus *sts, char *name)
return
vid
;
}
wb_vrep
*
wb_erep
::
createVolume
(
pwr_tStatus
*
sts
,
pwr_tVid
vid
,
pwr_tCid
cid
,
const
char
*
name
)
{
char
vname
[
200
];
sprintf
(
vname
,
"$pwrp_db/%s.db"
,
cdh_Low
(
name
));
dcli_translate_filename
(
vname
,
vname
);
vrep_iterator
it
=
m_vrepdb
.
find
(
vid
);
if
(
it
!=
m_vrepdb
.
end
())
{
*
sts
=
LDH__VOLIDALREXI
;
return
0
;
}
wb_vrepdb
*
vrepdb
=
new
wb_vrepdb
(
this
,
vid
,
cid
,
name
,
vname
);
addDb
(
sts
,
vrepdb
);
MsgWindow
::
message
(
'I'
,
"Database created"
,
vname
);
return
vrepdb
;
}
...
...
wb/lib/wb/src/wb_erep.h
View file @
27b1d679
...
...
@@ -46,6 +46,7 @@ public:
wb_vrep
*
volume
(
pwr_tStatus
*
sts
);
wb_vrep
*
volume
(
pwr_tStatus
*
sts
,
pwr_tVid
vid
);
wb_vrep
*
volume
(
pwr_tStatus
*
sts
,
const
char
*
name
);
wb_vrep
*
createVolume
(
pwr_tStatus
*
sts
,
pwr_tVid
vid
,
pwr_tCid
cid
,
const
char
*
name
);
wb_vrep
*
nextVolume
(
pwr_tStatus
*
sts
,
pwr_tVid
vid
);
wb_vrep
*
externVolume
(
pwr_tStatus
*
sts
,
pwr_tVid
vid
);
wb_vrep
*
bufferVolume
(
pwr_tStatus
*
sts
);
...
...
wb/lib/wb/src/wb_ldh.cpp
View file @
27b1d679
...
...
@@ -297,6 +297,8 @@ ldh_ClassNameToId(ldh_tSession session, pwr_tCid *cid, char *name)
{
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_name
n
(
name
);
if
(
EVEN
(
n
.
sts
()))
return
n
.
sts
();
wb_cdef
c
=
sp
->
cdef
(
n
);
if
(
!
c
)
return
c
.
sts
();
...
...
@@ -390,9 +392,8 @@ ldh_CreateVolume(ldh_tWorkbench workbench, ldh_tSession *session, pwr_tVid vid,
wb_env
*
ep
=
(
wb_env
*
)
workbench
;
wb_name
n
(
name
);
wb_cdef
cdef
;
wb_volume
v
=
ep
->
createVolume
(
cdef
,
v
id
,
name
);
wb_volume
v
=
ep
->
createVolume
(
vid
,
c
id
,
name
);
if
(
!
v
)
return
v
.
sts
();
// wb_srep *srep = new wb_srep(v);
...
...
@@ -771,24 +772,18 @@ ldh_GetRootList(ldh_tSession session, pwr_tOid *oid)
pwr_tStatus
ldh_GetVolumeRootList
(
ldh_tSession
session
,
pwr_tVid
vid
,
pwr_tOid
*
oid
)
{
#if NOT_YET_IMPLEMENTED
pwr_tStatus
sts
;
ldhi_sVidEntry
*
vtp
;
if
(
!
hasAccess
(
sp
,
ldh_eAccess_ReadOnly
,
&
sts
))
return
sts
;
if
(
objid
==
NULL
)
return
LDH__BADPARAM
;
vtp
=
(
ldhi_sVidEntry
*
)
ldh_TreeFind
(
sp
->
wb
->
vidtab
,
&
vid
);
if
(
vtp
==
NULL
)
return
LDH__NOSUCHVOL
;
wb_session
*
sp
=
(
wb_session
*
)
session
;
if
(
vtp
->
vhp
->
ohp
->
chhp
==
NULL
)
return
LDH__NOSUCHOBJ
;
wb_env
env
=
sp
->
env
();
wb_volume
v
=
env
.
volume
(
vid
);
if
(
!
v
)
return
v
.
sts
();
wb_object
o
=
v
.
object
();
if
(
!
o
)
return
o
.
sts
();
*
o
bjid
=
vtp
->
vhp
->
ohp
->
chhp
->
db
.
oid
;
*
o
id
=
o
.
oid
()
;
return
LDH__SUCCESS
;
#endif
return
LDH__NYI
;
return
o
.
sts
();
}
extern
"C"
pwr_tStatus
...
...
@@ -1495,15 +1490,17 @@ ldh_WbLoad( ldh_tSession session, char *loadfile)
wb_vrepdbs
*
vdbs
=
new
wb_vrepdbs
(
erep
,
fname
);
vdbs
->
load
();
wb_db
db
(
vdbs
->
vid
());
cdh_ToLower
(
vname
,
vdbs
->
name
());
strcpy
(
db_name
,
"$pwrp_db/"
);
strcat
(
db_name
,
vname
);
strcat
(
db_name
,
".db"
);
dcli_translate_filename
(
db_name
,
db_name
);
db
.
create
(
vdbs
->
vid
(),
vdbs
->
cid
(),
vdbs
->
name
(),
db_name
);
db
.
importVolume
(
*
vdbs
);
// wb_db db( vdbs->vid());
// db.create( vdbs->vid(), vdbs->cid(), vdbs->name(), db_name);
// db.importVolume( *vdbs);
wb_db
db
(
pwr_cNVid
);
db
.
copy
(
*
vdbs
,
db_name
);
db
.
close
();
delete
vdbs
;
...
...
@@ -1519,15 +1516,17 @@ ldh_WbLoad( ldh_tSession session, char *loadfile)
wb_vrepwbl
*
vwbl
=
new
wb_vrepwbl
(
erep
);
vwbl
->
load
(
fname
);
wb_db
db
(
vwbl
->
vid
());
cdh_ToLower
(
vname
,
vwbl
->
name
());
strcpy
(
db_name
,
"$pwrp_db/"
);
strcat
(
db_name
,
vname
);
strcat
(
db_name
,
".db"
);
dcli_translate_filename
(
db_name
,
db_name
);
db
.
create
(
vwbl
->
vid
(),
vwbl
->
cid
(),
vwbl
->
name
(),
db_name
);
db
.
importVolume
(
*
vwbl
);
// wb_db db( vwbl->vid());
// db.create( vwbl->vid(), vwbl->cid(), vwbl->name(), db_name);
// db.importVolume( *vwbl);
wb_db
db
(
pwr_cNVid
);
db
.
copy
(
*
vwbl
,
db_name
);
db
.
close
();
delete
vwbl
;
...
...
wb/lib/wb/src/wb_ldh.h
View file @
27b1d679
...
...
@@ -27,6 +27,8 @@ extern "C" {
#define ldh_cDirectoryVolume (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 253)
#define ldh_cVolatileVolMin (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 0)
#define ldh_cVolatileVolMax (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 100)
#define ldh_cUserVolMin (0 + ((pwr_tVolumeId)0 << 24) + (1 << 16) + (254 << 1) + 1)
#define ldh_cUserVolMax (0 + ((pwr_tVolumeId)0 << 24) + (254 << 16) + (254 << 8) + 254)
#if 0
#ifndef 0
...
...
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