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
815c6b26
Commit
815c6b26
authored
May 20, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
c5df7017
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
136 additions
and
40 deletions
+136
-40
wb/lib/wb/src/wb_attribute.cpp
wb/lib/wb/src/wb_attribute.cpp
+28
-0
wb/lib/wb/src/wb_bdrep.cpp
wb/lib/wb/src/wb_bdrep.cpp
+5
-0
wb/lib/wb/src/wb_bdrep.h
wb/lib/wb/src/wb_bdrep.h
+2
-1
wb/lib/wb/src/wb_cdrep.cpp
wb/lib/wb/src/wb_cdrep.cpp
+1
-1
wb/lib/wb/src/wb_ldh.cpp
wb/lib/wb/src/wb_ldh.cpp
+25
-34
wb/lib/wb/src/wb_name.h
wb/lib/wb/src/wb_name.h
+1
-0
wb/lib/wb/src/wb_nrep.cpp
wb/lib/wb/src/wb_nrep.cpp
+28
-0
wb/lib/wb/src/wb_nrep.h
wb/lib/wb/src/wb_nrep.h
+1
-0
wb/lib/wb/src/wb_volume.cpp
wb/lib/wb/src/wb_volume.cpp
+41
-1
wb/lib/wb/src/wb_volume.h
wb/lib/wb/src/wb_volume.h
+3
-2
wb/lib/wb/src/wb_vrepmem.cpp
wb/lib/wb/src/wb_vrepmem.cpp
+1
-1
No files found.
wb/lib/wb/src/wb_attribute.cpp
View file @
815c6b26
...
@@ -284,13 +284,41 @@ void wb_attribute::check() const
...
@@ -284,13 +284,41 @@ void wb_attribute::check() const
//
//
pwr_sAttrRef
wb_attribute
::
aref
()
const
pwr_sAttrRef
wb_attribute
::
aref
()
const
{
{
check
();
pwr_sAttrRef
aref
;
pwr_sAttrRef
aref
;
memset
(
&
aref
,
0
,
sizeof
(
aref
));
aref
.
Objid
=
m_orep
->
oid
();
aref
.
Offset
=
m_offset
;
aref
.
Size
=
m_size
;
if
(
m_adrep
)
{
wb_bdrep
*
bd
=
m_adrep
->
bdrep
();
aref
.
Body
=
bd
->
bcid
();
delete
bd
;
}
return
aref
;
return
aref
;
}
}
pwr_sAttrRef
*
wb_attribute
::
aref
(
pwr_sAttrRef
*
arp
)
const
pwr_sAttrRef
*
wb_attribute
::
aref
(
pwr_sAttrRef
*
arp
)
const
{
{
check
();
memset
(
arp
,
0
,
sizeof
(
*
arp
));
arp
->
Objid
=
m_orep
->
oid
();
arp
->
Offset
=
m_offset
;
arp
->
Size
=
m_size
;
if
(
m_adrep
)
{
wb_bdrep
*
bd
=
m_adrep
->
bdrep
();
arp
->
Body
=
bd
->
bcid
();
delete
bd
;
}
return
arp
;
return
arp
;
}
}
...
...
wb/lib/wb/src/wb_bdrep.cpp
View file @
815c6b26
...
@@ -101,6 +101,11 @@ pwr_tOid wb_bdrep::boid()
...
@@ -101,6 +101,11 @@ pwr_tOid wb_bdrep::boid()
return
m_orep
->
oid
();
return
m_orep
->
oid
();
}
}
pwr_tCid
wb_bdrep
::
bcid
()
{
return
m_orep
->
cid
();
}
const
char
*
wb_bdrep
::
name
()
const
const
char
*
wb_bdrep
::
name
()
const
{
{
...
...
wb/lib/wb/src/wb_bdrep.h
View file @
815c6b26
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
int
nAttribute
();
int
nAttribute
();
pwr_eBix
bix
();
pwr_eBix
bix
();
pwr_tOid
boid
();
pwr_tOid
boid
();
pwr_tCid
bcid
();
const
char
*
name
()
const
;
// get body name
const
char
*
name
()
const
;
// get body name
wb_name
longName
()
const
;
wb_name
longName
()
const
;
...
@@ -43,3 +43,4 @@ public:
...
@@ -43,3 +43,4 @@ public:
};
};
#endif
#endif
wb/lib/wb/src/wb_cdrep.cpp
View file @
815c6b26
...
@@ -154,7 +154,7 @@ wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, const char *aname)
...
@@ -154,7 +154,7 @@ wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, const char *aname)
orep
->
ref
();
orep
->
ref
();
if
(
orep
->
cid
()
==
pwr_eClass_ObjBodyDef
)
{
if
(
orep
->
cid
()
==
pwr_eClass_ObjBodyDef
)
{
orep_attr
=
orep
->
vrep
()
->
child
(
sts
,
orep
,
n
);
orep_attr
=
orep
->
vrep
()
->
child
(
sts
,
orep
,
n
);
if
(
ODD
(
*
sts
))
{
if
(
ODD
(
*
sts
)
/* && aname.attributeIsEqual( orep_attr->name()) */
)
{
wb_adrep
*
adrep
=
new
wb_adrep
(
*
orep_attr
);
wb_adrep
*
adrep
=
new
wb_adrep
(
*
orep_attr
);
orep
->
unref
();
orep
->
unref
();
return
adrep
;
return
adrep
;
...
...
wb/lib/wb/src/wb_ldh.cpp
View file @
815c6b26
...
@@ -439,23 +439,11 @@ ldh_GetAttrDef(ldh_tSession session, pwr_tCid cid, char *bname, char *aname, ldh
...
@@ -439,23 +439,11 @@ ldh_GetAttrDef(ldh_tSession session, pwr_tCid cid, char *bname, char *aname, ldh
wb_adef
a
=
sp
->
adef
(
cid
,
bname
,
aname
);
wb_adef
a
=
sp
->
adef
(
cid
,
bname
,
aname
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
#if NOT_YET_IMPLEMENTED
a
.
size
();
a
.
offset
();
a
.
name
();
strcpy
(
adef
->
ParName
,
a
.
name
());
strcpy
(
adef
->
ParName
,
a
.
name
());
adef
->
ParLevel
=
1
;
adef
->
ParLevel
=
1
;
adef
->
ParClass
=
a
.
cid
();
adef
->
ParClass
=
(
pwr_eClass
)
a
.
cid
();
adef
->
Par
=
(
pwr_uParDef
*
)
a
.
body
();
adef
->
Par
.
PgmName
;
return
LDH__SUCCESS
;
adef
->
Par
.
Type
=
a
.
type
();
adef
->
Par
.
Offset
=
a
.
offset
();
adef
->
Par
.
Size
=
a
.
size
();
adef
->
Par
.
Flags
=
a
.
flags
();
adef
->
Par
.
Elements
=
a
.
nElement
();
adef
->
Par
.
ParamIndex
=
a
.
index
();
#endif
return
LDH__NYI
;
}
}
pwr_tStatus
pwr_tStatus
...
@@ -463,13 +451,13 @@ ldh_GetAttrRef(ldh_tSession session, pwr_tOid oid, char *aname, pwr_sAttrRef *ar
...
@@ -463,13 +451,13 @@ ldh_GetAttrRef(ldh_tSession session, pwr_tOid oid, char *aname, pwr_sAttrRef *ar
{
{
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_object
o
=
sp
->
object
(
oid
);
wb_object
o
=
sp
->
object
(
oid
);
wb_name
n
(
aname
);
wb_
attr
name
n
(
aname
);
wb_attribute
a
=
sp
->
attribute
(
o
,
n
);
wb_attribute
a
=
sp
->
attribute
(
o
,
n
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
*
aref
=
a
.
aref
();
*
aref
=
a
.
aref
();
return
LDH__
NYI
;
return
LDH__
SUCCESS
;
}
}
pwr_tStatus
pwr_tStatus
...
@@ -479,8 +467,9 @@ ldh_GetAttrXRefDef(ldh_tSession session, pwr_sAttrRef *aref, pwr_sAttrXRef *xref
...
@@ -479,8 +467,9 @@ ldh_GetAttrXRefDef(ldh_tSession session, pwr_sAttrRef *aref, pwr_sAttrXRef *xref
wb_attribute
a
=
sp
->
attribute
(
aref
);
wb_attribute
a
=
sp
->
attribute
(
aref
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
// *xref = a.xref();
a
.
adrep
()
->
body
(
xref
);
return
LDH__NYI
;
return
a
.
sts
();
}
}
/* Get first child of an object. */
/* Get first child of an object. */
...
@@ -690,7 +679,7 @@ ldh_GetObjXRefDef(ldh_tSession session, pwr_sAttrRef *aref, pwr_sObjXRef *ObjXRe
...
@@ -690,7 +679,7 @@ ldh_GetObjXRefDef(ldh_tSession session, pwr_sAttrRef *aref, pwr_sObjXRef *ObjXRe
wb_attribute
a
=
sp
->
attribute
(
aref
);
wb_attribute
a
=
sp
->
attribute
(
aref
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
//pwr_sObjXref *x = a.oxref(
);
a
.
adrep
()
->
body
(
ObjXRef
);
return
a
.
sts
();
return
a
.
sts
();
}
}
...
@@ -1069,7 +1058,10 @@ ldh_AttrRefToName(ldh_tSession session, pwr_sAttrRef *arp, ldh_eName nametype, c
...
@@ -1069,7 +1058,10 @@ ldh_AttrRefToName(ldh_tSession session, pwr_sAttrRef *arp, ldh_eName nametype, c
wb_attribute
a
=
sp
->
attribute
(
arp
);
wb_attribute
a
=
sp
->
attribute
(
arp
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
//wb_name n = a.name(nametype);
wb_name
n
=
a
.
longName
();
strcpy
(
str
,
n
.
name
(
nametype
));
*
aname
=
str
;
*
size
=
strlen
(
str
);
break
;
break
;
}
}
case
ldh_eName_ArefExport
:
case
ldh_eName_ArefExport
:
...
@@ -1178,15 +1170,10 @@ ldh_ReadAttribute(ldh_tSession session, pwr_sAttrRef *arp, void *value, int size
...
@@ -1178,15 +1170,10 @@ ldh_ReadAttribute(ldh_tSession session, pwr_sAttrRef *arp, void *value, int size
wb_attribute
a
=
sp
->
attribute
(
arp
);
wb_attribute
a
=
sp
->
attribute
(
arp
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
#if NOT_YET_IMPLEMENTED
wb_value
v
(
value
,
size
);
if
(
!
v
)
return
v
.
sts
();
v
=
a
.
value
();
a
.
value
(
value
);
return
v
.
sts
();
#else
return
LDH__SUCCESS
;
return
LDH__NYI
;
#endif
}
}
/* Reads a named body of an object into a buffer supplied in the call. */
/* Reads a named body of an object into a buffer supplied in the call. */
...
@@ -1355,11 +1342,15 @@ ldh_WriteAttribute(ldh_tSession session, pwr_sAttrRef *arp, void *value, int siz
...
@@ -1355,11 +1342,15 @@ ldh_WriteAttribute(ldh_tSession session, pwr_sAttrRef *arp, void *value, int siz
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_session
*
sp
=
(
wb_session
*
)
session
;
wb_attribute
a
=
sp
->
attribute
(
arp
);
wb_attribute
a
=
sp
->
attribute
(
arp
);
if
(
!
a
)
return
a
.
sts
();
if
(
!
a
)
return
a
.
sts
();
//wb_value v(value, size);
//if (!v) return v.sts();
try
{
sp
->
writeAttribute
(
a
,
value
);
//return a.value(v);
return
sp
->
sts
();
return
LDH__NYI
;
}
catch
(
wb_error
&
e
)
{
return
e
.
sts
();
}
return
LDH__SUCCESS
;
}
}
/* Returns 1 if object is owned by the volume attached to
/* Returns 1 if object is owned by the volume attached to
...
...
wb/lib/wb/src/wb_name.h
View file @
815c6b26
...
@@ -141,6 +141,7 @@ public:
...
@@ -141,6 +141,7 @@ public:
bool
objectIsEqual
(
const
char
*
n
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
objectIsEqual
(
n
);}
bool
objectIsEqual
(
const
char
*
n
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
objectIsEqual
(
n
);}
bool
segmentIsEqual
(
const
char
*
n
,
int
idx
=
0
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
segmentIsEqual
(
n
,
idx
);}
bool
segmentIsEqual
(
const
char
*
n
,
int
idx
=
0
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
segmentIsEqual
(
n
,
idx
);}
bool
attributeIsEqual
(
const
char
*
n
,
int
idx
=
0
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
attributeIsEqual
(
n
,
idx
);}
bool
attributeIsEqual
(
const
char
*
n
,
int
idx
=
0
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
attributeIsEqual
(
n
,
idx
);}
char
*
wholeAttr
()
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
wholeAttr
();}
// Id representation
// Id representation
char
*
vid
(
char
*
res
=
0
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
volume
(
res
);}
char
*
vid
(
char
*
res
=
0
)
const
throw
(
wb_error
)
{
check
();
return
m_nrep
->
volume
(
res
);}
...
...
wb/lib/wb/src/wb_nrep.cpp
View file @
815c6b26
...
@@ -832,6 +832,32 @@ char *wb_nrep::unatName(const char *name)
...
@@ -832,6 +832,32 @@ char *wb_nrep::unatName(const char *name)
return
result
;
return
result
;
}
}
char
*
wb_nrep
::
wholeAttr
(
char
*
res
)
{
static
char
result
[
256
];
if
(
num_attr
==
0
)
{
if
(
res
)
{
strcpy
(
res
,
""
);
return
res
;
}
else
{
strcpy
(
result
,
""
);
return
result
;
}
}
else
{
if
(
res
)
{
strcpy
(
res
,
oname
+
attr
[
0
].
offs
);
return
res
;
}
else
{
strcpy
(
result
,
oname
+
attr
[
0
].
offs
);
return
result
;
}
}
}
bool
wb_nrep
::
checkObjectName
(
const
char
*
name
)
bool
wb_nrep
::
checkObjectName
(
const
char
*
name
)
{
{
const
char
*
s
;
const
char
*
s
;
...
@@ -847,3 +873,5 @@ bool wb_nrep::checkObjectName( const char *name)
...
@@ -847,3 +873,5 @@ bool wb_nrep::checkObjectName( const char *name)
wb/lib/wb/src/wb_nrep.h
View file @
815c6b26
...
@@ -108,6 +108,7 @@ public:
...
@@ -108,6 +108,7 @@ public:
bool
attributeIsEqual
(
const
char
*
n
,
int
idx
=
0
);
bool
attributeIsEqual
(
const
char
*
n
,
int
idx
=
0
);
int
bodyOffset
()
const
{
return
b_offset
;}
int
bodyOffset
()
const
{
return
b_offset
;}
int
bodySize
()
const
{
return
b_size
;}
int
bodySize
()
const
{
return
b_size
;}
char
*
wholeAttr
(
char
*
res
=
0
);
static
char
*
unatName
(
const
char
*
name
);
static
char
*
unatName
(
const
char
*
name
);
static
bool
checkObjectName
(
const
char
*
name
);
static
bool
checkObjectName
(
const
char
*
name
);
...
...
wb/lib/wb/src/wb_volume.cpp
View file @
815c6b26
...
@@ -157,10 +157,12 @@ wb_adef wb_volume::adef( pwr_tCid cid, const char *bname, const char *aname)
...
@@ -157,10 +157,12 @@ wb_adef wb_volume::adef( pwr_tCid cid, const char *bname, const char *aname)
pwr_tStatus
sts
;
pwr_tStatus
sts
;
wb_cdrep
*
cdrep
=
m_vrep
->
merep
()
->
cdrep
(
&
sts
,
cid
);
wb_cdrep
*
cdrep
=
m_vrep
->
merep
()
->
cdrep
(
&
sts
,
cid
);
if
(
EVEN
(
sts
))
return
0
;
if
(
EVEN
(
sts
))
return
wb_adef
()
;
wb_cdef
cdef
=
wb_cdef
(
cdrep
);
wb_cdef
cdef
=
wb_cdef
(
cdrep
);
wb_bdef
bdef
=
cdef
.
bdef
(
bname
);
wb_bdef
bdef
=
cdef
.
bdef
(
bname
);
if
(
!
bdef
)
return
wb_adef
();
return
bdef
.
adef
(
aname
);
return
bdef
.
adef
(
aname
);
}
}
...
@@ -217,6 +219,44 @@ wb_attribute wb_volume::attribute(pwr_tOid oid, const char *bname, const char *a
...
@@ -217,6 +219,44 @@ wb_attribute wb_volume::attribute(pwr_tOid oid, const char *bname, const char *a
return
a
;
return
a
;
}
}
wb_attribute
wb_volume
::
attribute
(
wb_name
aname
)
{
pwr_tStatus
sts
;
wb_object
o
=
object
(
aname
.
name
());
if
(
!
o
)
return
wb_attribute
();
if
(
!
aname
.
hasAttribute
())
return
wb_attribute
(
LDH__SUCCESS
,
(
wb_orep
*
)
o
);
wb_cdef
cd
=
cdef
(
o
);
if
(
!
cd
)
return
wb_attribute
();
wb_adrep
*
adrep
=
((
wb_cdrep
*
)
cd
)
->
adrep
(
&
sts
,
aname
.
wholeAttr
());
if
(
ODD
(
sts
))
return
wb_attribute
(
sts
,
(
wb_orep
*
)
o
,
adrep
);
return
wb_attribute
();
}
wb_attribute
wb_volume
::
attribute
(
wb_object
o
,
wb_attrname
aname
)
{
pwr_tStatus
sts
;
if
(
!
o
)
return
wb_attribute
();
wb_cdef
cd
=
cdef
(
o
);
if
(
!
cd
)
return
wb_attribute
();
wb_adrep
*
adrep
=
((
wb_cdrep
*
)
cd
)
->
adrep
(
&
sts
,
aname
.
wholeAttr
());
if
(
ODD
(
sts
))
return
wb_attribute
(
sts
,
(
wb_orep
*
)
o
,
adrep
);
return
wb_attribute
();
}
wb_attribute
wb_volume
::
attribute
(
pwr_tOid
oid
,
const
char
*
bname
)
const
wb_attribute
wb_volume
::
attribute
(
pwr_tOid
oid
,
const
char
*
bname
)
const
{
{
pwr_tStatus
sts
;
pwr_tStatus
sts
;
...
...
wb/lib/wb/src/wb_volume.h
View file @
815c6b26
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include "wb_cdef.h"
#include "wb_cdef.h"
#include "wb_tdef.h"
#include "wb_tdef.h"
#include "wb_name.h"
#include "wb_name.h"
#include "wb_attrname.h"
class
wb_env
;
class
wb_env
;
class
wb_vrep
;
class
wb_vrep
;
...
@@ -55,8 +56,8 @@ public:
...
@@ -55,8 +56,8 @@ public:
wb_attribute
attribute
(
pwr_tOid
oid
,
const
char
*
bname
,
const
char
*
aname
)
const
;
wb_attribute
attribute
(
pwr_tOid
oid
,
const
char
*
bname
,
const
char
*
aname
)
const
;
wb_attribute
attribute
(
pwr_tOid
oid
,
const
char
*
bname
)
const
;
wb_attribute
attribute
(
pwr_tOid
oid
,
const
char
*
bname
)
const
;
wb_attribute
attribute
(
wb_object
o
,
wb_adef
adef
)
{
wb_attribute
a
;
return
a
;};
// Fix
wb_attribute
attribute
(
wb_object
o
,
wb_adef
adef
)
{
wb_attribute
a
;
return
a
;};
// Fix
wb_attribute
attribute
(
wb_object
o
,
wb_
name
aname
)
{
wb_attribute
a
;
return
a
;};
// Fix
wb_attribute
attribute
(
wb_object
o
,
wb_
attrname
aname
);
wb_attribute
attribute
(
wb_name
aname
)
{
wb_attribute
a
;
return
a
;};
// Fix
wb_attribute
attribute
(
wb_name
aname
)
;
wb_attribute
attribute
(
const
pwr_sAttrRef
*
arp
)
const
;
wb_attribute
attribute
(
const
pwr_sAttrRef
*
arp
)
const
;
wb_attribute
attribute
()
{
wb_attribute
a
;
return
a
;};
// Fix
wb_attribute
attribute
()
{
wb_attribute
a
;
return
a
;};
// Fix
...
...
wb/lib/wb/src/wb_vrepmem.cpp
View file @
815c6b26
...
@@ -244,7 +244,7 @@ mem_object *wb_vrepmem::find( const char *name)
...
@@ -244,7 +244,7 @@ mem_object *wb_vrepmem::find( const char *name)
{
{
wb_name
oname
=
wb_name
(
name
);
wb_name
oname
=
wb_name
(
name
);
if
(
oname
.
evenSts
()
||
(
oname
.
hasVolume
()
&&
!
oname
.
volumeIsEqual
(
volume_name
)))
if
(
oname
.
evenSts
()
||
(
oname
.
hasVolume
()
&&
!
oname
.
volumeIsEqual
(
this
->
name
()
)))
return
0
;
return
0
;
if
(
root_object
)
if
(
root_object
)
...
...
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