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
03bf7fa6
Commit
03bf7fa6
authored
Feb 12, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
1364c5c3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
43 deletions
+98
-43
wb/lib/wb/src/wb_bdrep.cpp
wb/lib/wb/src/wb_bdrep.cpp
+15
-0
wb/lib/wb/src/wb_bdrep.h
wb/lib/wb/src/wb_bdrep.h
+2
-2
wb/lib/wb/src/wb_cdef.h
wb/lib/wb/src/wb_cdef.h
+2
-1
wb/lib/wb/src/wb_cdrep.cpp
wb/lib/wb/src/wb_cdrep.cpp
+18
-0
wb/lib/wb/src/wb_cdrep.h
wb/lib/wb/src/wb_cdrep.h
+2
-0
wb/lib/wb/src/wb_vrepwbl.cpp
wb/lib/wb/src/wb_vrepwbl.cpp
+38
-19
wb/lib/wb/src/wb_wblnode.cpp
wb/lib/wb/src/wb_wblnode.cpp
+21
-21
No files found.
wb/lib/wb/src/wb_bdrep.cpp
View file @
03bf7fa6
...
...
@@ -50,3 +50,18 @@ wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts, char *aname)
return
adrep
;
}
cdh_eBix
wb_bdrep
::
bix
()
{
return
(
cdh_eBix
)
cdh_oixToBix
(
m_orep
->
oid
().
oix
);
}
size_t
wb_bdrep
::
size
()
{
pwr_tStatus
sts
;
pwr_sObjBodyDef
body
;
m_orep
->
m_vrep
->
readBody
(
&
sts
,
m_orep
,
bix
(),
(
void
*
)
&
body
);
if
(
EVEN
(
sts
))
throw
wb_error
(
sts
);
return
body
.
Size
;
}
wb/lib/wb/src/wb_bdrep.h
View file @
03bf7fa6
...
...
@@ -26,9 +26,9 @@ public:
wb_bdrep
*
ref
();
pwr_sAttrRef
aref
()
{
pwr_sAttrRef
a
;
return
a
;}
// Fix
size_t
size
()
{
return
0
;}
// Fix // get objects runtime body size
size_t
size
()
;
int
nAttribute
()
{
return
0
;}
// Fix
int
bix
()
{
return
0
;}
// Fix
cdh_eBix
bix
();
pwr_tOid
boid
()
{
pwr_tOid
o
;
return
o
;}
// Fix
...
...
wb/lib/wb/src/wb_cdef.h
View file @
03bf7fa6
...
...
@@ -17,9 +17,10 @@ class wb_mvrep;
class
wb_cdef
:
public
wb_status
{
wb_cdrep
*
m_cdrep
;
public:
wb_cdrep
*
m_cdrep
;
wb_cdef
();
wb_cdef
(
wb_cdrep
*
cdrep
);
wb_cdef
(
wb_adef
&
);
// x = other_object
...
...
wb/lib/wb/src/wb_cdrep.cpp
View file @
03bf7fa6
...
...
@@ -137,3 +137,21 @@ pwr_tCid wb_cdrep::cid()
{
return
cdh_ClassObjidToId
(
m_orep
->
oid
());
}
void
wb_cdrep
::
templateBody
(
pwr_tStatus
*
sts
,
cdh_eBix
bix
,
void
*
p
)
{
// Get objid for template object
pwr_tOid
oid
;
int
cix
=
cdh_oixToCix
(
m_orep
->
oid
().
oix
);
oid
.
vid
=
m_orep
->
oid
().
vid
;
oid
.
oix
=
cdh_cixToOix
(
cix
,
cdh_eBix_template
,
0
);
wb_orepdbs
*
orep
=
(
wb_orepdbs
*
)
m_orep
->
m_vrep
->
object
(
sts
,
oid
);
if
(
EVEN
(
*
sts
))
return
;
m_orep
->
m_vrep
->
readBody
(
sts
,
orep
,
bix
,
p
);
// Delete
orep
->
ref
();
orep
->
unref
();
}
wb/lib/wb/src/wb_cdrep.h
View file @
03bf7fa6
...
...
@@ -45,6 +45,8 @@ class wb_cdrep
wb_bdrep
*
bdrep
(
pwr_tStatus
*
sts
,
char
*
bname
);
wb_adrep
*
adrep
(
pwr_tStatus
*
sts
,
char
*
aname
);
void
templateBody
(
pwr_tStatus
*
sts
,
cdh_eBix
bix
,
void
*
p
);
pwr_tStatus
sts
()
{
return
m_sts
;}
};
...
...
wb/lib/wb/src/wb_vrepwbl.cpp
View file @
03bf7fa6
...
...
@@ -501,7 +501,7 @@ int wb_vrepwbl::getClassInfo( pwr_tCid cid, int *rsize, int *dsize)
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
&
sts
,
cid
);
if
(
EVEN
(
sts
))
return
0
;
wb_bdrep
*
bdrep
=
cdrep
->
bdrep
(
&
sts
,
cdh_eBix_
RtBody
);
wb_bdrep
*
bdrep
=
cdrep
->
bdrep
(
&
sts
,
cdh_eBix_
rt
);
if
(
ODD
(
sts
))
{
*
rsize
=
bdrep
->
size
();
delete
bdrep
;
...
...
@@ -509,7 +509,7 @@ int wb_vrepwbl::getClassInfo( pwr_tCid cid, int *rsize, int *dsize)
else
*
rsize
=
0
;
bdrep
=
cdrep
->
bdrep
(
&
sts
,
cdh_eBix_
DevBody
);
bdrep
=
cdrep
->
bdrep
(
&
sts
,
cdh_eBix_
dev
);
if
(
ODD
(
sts
))
{
*
dsize
=
bdrep
->
size
();
delete
bdrep
;
...
...
@@ -566,7 +566,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_name *attr, int bix, pwr_tCid cid, int *size,
{
pwr_sType
o
;
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
if
(
attr
->
attributeIsEqual
(
"Type"
,
level
))
{
*
size
=
sizeof
(
o
.
Type
);
...
...
@@ -586,7 +586,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_name *attr, int bix, pwr_tCid cid, int *size,
{
pwr_sTypeDef
o
;
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
IF_ATTR
(
Type
,
pwr_eType_UInt32
,
1
,
level
)
else
IF_ATTR
(
Size
,
pwr_eType_Int32
,
1
,
level
)
...
...
@@ -598,7 +598,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_name *attr, int bix, pwr_tCid cid, int *size,
{
pwr_sClassDef
o
;
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
IF_ATTR
(
Editor
,
pwr_eType_UInt32
,
1
,
level
)
else
IF_ATTR
(
Method
,
pwr_eType_UInt32
,
1
,
level
)
...
...
@@ -611,7 +611,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_name *attr, int bix, pwr_tCid cid, int *size,
{
pwr_sClassVolume
o
;
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
IF_ATTR
(
Description
,
pwr_eType_String
,
1
,
level
)
else
IF_ATTR
(
NextOix
,
pwr_eType_ObjectIx
,
1
,
level
)
...
...
@@ -630,7 +630,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_name *attr, int bix, pwr_tCid cid, int *size,
{
pwr_sObjBodyDef
o
;
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
IF_ATTR
(
StructName
,
pwr_eType_String
,
1
,
level
)
else
IF_ATTR
(
NumOfParams
,
pwr_eType_UInt32
,
1
,
level
)
...
...
@@ -643,7 +643,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_name *attr, int bix, pwr_tCid cid, int *size,
{
pwr_sParam
o
;
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
if
(
attr
->
attributeIsEqual
(
"PgmName"
,
level
))
{
*
size
=
sizeof
(
o
.
Info
.
PgmName
);
...
...
@@ -762,49 +762,49 @@ int wb_vrepwbl::getTemplateBody( pwr_tCid cid, int bix, int *size, void **body)
{
switch
(
cid
)
{
case
pwr_eClass_Type
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
sizeof
(
pwr_sType
);
*
body
=
calloc
(
1
,
*
size
);
return
1
;
case
pwr_eClass_TypeDef
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
sizeof
(
pwr_sTypeDef
);
*
body
=
calloc
(
1
,
*
size
);
return
1
;
case
pwr_eClass_ClassDef
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
sizeof
(
pwr_sClassDef
);
*
body
=
calloc
(
1
,
*
size
);
return
1
;
case
pwr_eClass_ClassVolume
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
sizeof
(
pwr_sClassVolume
);
*
body
=
calloc
(
1
,
*
size
);
return
1
;
case
pwr_eClass_ClassHier
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
0
;
*
body
=
0
;
return
1
;
case
pwr_eClass_TypeHier
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
0
;
*
body
=
0
;
return
1
;
case
pwr_eClass_ObjBodyDef
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
sizeof
(
pwr_sObjBodyDef
);
*
body
=
calloc
(
1
,
*
size
);
return
1
;
case
pwr_eClass_Param
:
if
(
bix
!=
cdh_eBix_
SysBody
)
if
(
bix
!=
cdh_eBix_
sys
)
return
0
;
*
size
=
sizeof
(
pwr_sParam
);
*
body
=
calloc
(
1
,
*
size
);
...
...
@@ -820,14 +820,14 @@ int wb_vrepwbl::getTemplateBody( pwr_tCid cid, int bix, int *size, void **body)
if
(
!
n
->
c_template
)
return
0
;
if
(
bix
==
cdh_eBix_
SysBody
||
bix
==
cdh_eBix_RtBody
)
{
if
(
bix
==
cdh_eBix_
sys
||
bix
==
cdh_eBix_rt
)
{
*
size
=
n
->
c_template
->
rbody_size
;
if
(
*
size
)
{
*
body
=
calloc
(
1
,
*
size
);
memcpy
(
*
body
,
n
->
c_template
->
rbody
,
*
size
);
}
}
else
if
(
bix
==
cdh_eBix_
DevBody
)
{
else
if
(
bix
==
cdh_eBix_
dev
)
{
*
size
=
n
->
c_template
->
dbody_size
;
if
(
*
size
)
{
*
body
=
calloc
(
1
,
*
size
);
...
...
@@ -838,7 +838,26 @@ int wb_vrepwbl::getTemplateBody( pwr_tCid cid, int bix, int *size, void **body)
}
else
{
// Search type in other volumes TODO...
return
0
;
pwr_tStatus
sts
;
wb_cdrep
*
cdrep
=
m_merep
->
cdrep
(
&
sts
,
cid
);
if
(
EVEN
(
sts
))
return
0
;
wb_bdrep
*
bdrep
=
cdrep
->
bdrep
(
&
sts
,
bix
);
if
(
EVEN
(
sts
))
return
0
;
*
size
=
bdrep
->
size
();
delete
bdrep
;
*
body
=
calloc
(
1
,
*
size
);
cdrep
->
templateBody
(
&
sts
,
(
cdh_eBix
)
bix
,
body
);
delete
cdrep
;
if
(
EVEN
(
sts
))
{
free
(
body
);
return
0
;
}
return
1
;
}
}
}
...
...
wb/lib/wb/src/wb_wblnode.cpp
View file @
03bf7fa6
...
...
@@ -378,10 +378,10 @@ void wb_wblnode::build( bool recursive)
m_oid
.
vid
=
m_vrep
->
vid
();
if
(
isClassDef
())
{
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
SysBody
,
&
rbody_size
,
&
rbody
);
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
sys
,
&
rbody_size
,
&
rbody
);
}
else
if
(
isType
()
||
isTypeDef
())
{
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
SysBody
,
&
rbody_size
,
&
rbody
);
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
sys
,
&
rbody_size
,
&
rbody
);
}
else
if
(
isTemplate
())
{
// Build later by classdef
...
...
@@ -390,8 +390,8 @@ void wb_wblnode::build( bool recursive)
return
;
}
else
{
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
RtBody
,
&
rbody_size
,
&
rbody
);
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
DevBody
,
&
dbody_size
,
&
dbody
);
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
rt
,
&
rbody_size
,
&
rbody
);
m_vrep
->
getTemplateBody
(
m_cid
,
cdh_eBix_
dev
,
&
dbody_size
,
&
dbody
);
}
ref_wblnode
first_child
;
...
...
@@ -558,20 +558,20 @@ void wb_wblnode::buildBuffer( ref_wblnode classdef, ref_wblnode objbodydef,
void
wb_wblnode
::
buildTemplate
(
ref_wblnode
classdef
)
{
wb_wblnode
*
objbodydef
=
classdef
->
o_fch
;
m_oid
.
oix
=
cdh_cixToOix
(
classdef
->
c_cix
,
7
,
0
);
m_oid
.
oix
=
cdh_cixToOix
(
classdef
->
c_cix
,
cdh_eBix_template
,
0
);
if
(
!
m_vrep
->
registerObject
(
m_oid
.
oix
,
this
))
m_vrep
->
error
(
"Duplicate template oix"
,
getFileName
(),
line_number
);
while
(
objbodydef
)
{
if
(
objbodydef
->
isObjBodyDef
())
{
if
(
objbodydef
->
b_bix
==
cdh_eBix_
SysBody
||
objbodydef
->
b_bix
==
cdh_eBix_
RtBody
)
{
if
(
objbodydef
->
b_bix
==
cdh_eBix_
sys
||
objbodydef
->
b_bix
==
cdh_eBix_
rt
)
{
rbody_size
=
objbodydef
->
b_size
;
if
(
rbody_size
)
{
rbody
=
calloc
(
1
,
rbody_size
);
}
}
if
(
objbodydef
->
b_bix
==
cdh_eBix_
DevBody
)
{
if
(
objbodydef
->
b_bix
==
cdh_eBix_
dev
)
{
dbody_size
=
objbodydef
->
b_size
;
if
(
dbody_size
)
dbody
=
calloc
(
1
,
dbody_size
);
...
...
@@ -594,11 +594,11 @@ void wb_wblnode::buildBody( ref_wblnode object)
switch
(
getType
())
{
case
tokens
.
BODY
:
if
(
strcmp
(
name
,
"SysBody"
)
==
0
)
bix
=
cdh_eBix_
SysBody
;
bix
=
cdh_eBix_
sys
;
else
if
(
strcmp
(
name
,
"RtBody"
)
==
0
)
bix
=
cdh_eBix_
RtBody
;
bix
=
cdh_eBix_
rt
;
else
if
(
strcmp
(
name
,
"DevBody"
)
==
0
)
bix
=
cdh_eBix_
SysBody
;
bix
=
cdh_eBix_
sys
;
else
{
// Body exception
m_vrep
->
error
(
"Bad body name"
,
getFileName
(),
line_number
);
...
...
@@ -652,16 +652,16 @@ void wb_wblnode::buildAttr( ref_wblnode object, int bix)
m_vrep
->
error
(
"Attribute syntax"
,
getFileName
(),
line_number
);
}
else
{
if
(
((
bix
==
cdh_eBix_
RtBody
||
bix
==
cdh_eBix_SysBody
)
&&
if
(
((
bix
==
cdh_eBix_
rt
||
bix
==
cdh_eBix_sys
)
&&
object
->
rbody_size
==
0
)
||
(
bix
==
cdh_eBix_
DevBody
&&
object
->
dbody_size
==
0
))
{
(
bix
==
cdh_eBix_
dev
&&
object
->
dbody_size
==
0
))
{
m_vrep
->
error
(
"Attribute body"
,
getFileName
(),
line_number
);
return
;
}
if
(
((
bix
==
cdh_eBix_
RtBody
||
bix
==
cdh_eBix_SysBody
)
&&
if
(
((
bix
==
cdh_eBix_
rt
||
bix
==
cdh_eBix_sys
)
&&
offset
+
size
/
elements
>
object
->
rbody_size
)
||
(
bix
==
cdh_eBix_
RtBody
&&
(
bix
==
cdh_eBix_
rt
&&
offset
+
size
/
elements
>
object
->
rbody_size
))
{
m_vrep
->
error
(
"Mismatch in attribute offset"
,
getFileName
(),
line_number
);
return
;
...
...
@@ -670,21 +670,21 @@ void wb_wblnode::buildAttr( ref_wblnode object, int bix)
// printf( "Attr %s %s %d %d %s\n", object->name, name, size, offset, value);
if
(
size
/
elements
==
sizeof
(
int_val
)
&&
convconst
(
&
int_val
,
value
))
{
if
(
oper
==
tokens
.
EQ
)
{
if
(
bix
==
cdh_eBix_
RtBody
||
bix
==
cdh_eBix_SysBody
)
if
(
bix
==
cdh_eBix_
rt
||
bix
==
cdh_eBix_sys
)
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
rbody
+
offset
),
&
int_val
,
size
/
elements
);
else
if
(
bix
==
cdh_eBix_
DevBody
)
else
if
(
bix
==
cdh_eBix_
dev
)
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
dbody
+
offset
),
&
int_val
,
size
/
elements
);
}
else
if
(
oper
==
tokens
.
OREQ
)
{
if
(
bix
==
cdh_eBix_
RtBody
||
bix
==
cdh_eBix_SysBody
)
{
if
(
bix
==
cdh_eBix_
rt
||
bix
==
cdh_eBix_sys
)
{
current_int_val
=
*
(
int
*
)
((
unsigned
int
)
object
->
rbody
+
offset
);
int_val
|=
current_int_val
;
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
rbody
+
offset
),
&
int_val
,
size
/
elements
);
}
else
if
(
bix
==
cdh_eBix_
DevBody
)
{
else
if
(
bix
==
cdh_eBix_
dev
)
{
current_int_val
=
*
(
int
*
)
((
unsigned
int
)
object
->
dbody
+
offset
);
int_val
|=
current_int_val
;
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
dbody
+
offset
),
...
...
@@ -693,10 +693,10 @@ void wb_wblnode::buildAttr( ref_wblnode object, int bix)
}
}
else
if
(
attrStringToValue
(
tid
,
value
,
buf
,
sizeof
(
buf
),
size
))
{
if
(
bix
==
cdh_eBix_
RtBody
||
bix
==
cdh_eBix_SysBody
)
if
(
bix
==
cdh_eBix_
rt
||
bix
==
cdh_eBix_sys
)
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
rbody
+
offset
),
buf
,
size
/
elements
);
else
if
(
bix
==
cdh_eBix_
DevBody
)
else
if
(
bix
==
cdh_eBix_
dev
)
memcpy
(
(
char
*
)((
unsigned
int
)
object
->
dbody
+
offset
),
buf
,
size
/
elements
);
}
...
...
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