Commit 119ad19a authored by lw's avatar lw

*** empty log message ***

parent 68916bcc
......@@ -908,10 +908,31 @@ dbs_VolumeObject(pwr_tStatus *sts, const dbs_sEnv *ep)
return (dbs_sObject *)(ep->base + ep->sect[dbs_eSect_object].offset);
}
dbs_sObject *dbs_Object(pwr_tStatus *sts, const dbs_sEnv *ep)
dbs_sObject *
dbs_Object(pwr_tStatus *sts, const dbs_sEnv *ep)
{
dbs_sObject *op = dbs_VolumeObject(sts, ep);
if (op == NULL)
return NULL;
return dbs_First(sts, ep, op);
}
void *
dbs_Body(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op, cdh_eBix bix)
{
char *p = NULL;
switch (bix) {
case cdh_eBix_rt:
p = dbs_Address(sts, ep, op->rbody.ref);
break;
case cdh_eBix_dev:
p = dbs_Address(sts, ep, op->dbody.ref);
break;
default:
*sts = DBS__NOSUCHBODY;
break;
}
return p;
}
......@@ -578,6 +578,7 @@ struct dbs_sName {
%dbs_sObject *dbs_VolumeObject(pwr_tStatus *sts, const dbs_sEnv *ep);
%dbs_sObject *dbs_Object(pwr_tStatus *sts, const dbs_sEnv *ep);
%void dbs_ObjectToName(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op, char *name);
%void *dbs_Body(pwr_tStatus *sts, const dbs_sEnv *ep, dbs_sObject *op, cdh_eBix bix);
%
%
%#ifdef __cplusplus
......
......@@ -2,7 +2,7 @@
#define wb_vrep_h
#include "pwr.h"
//#include "wb_erep.h"
#include "co_cdh.h"
#include "wb_srep.h"
#include "wb_orep.h"
#include "wb_oset.h"
......@@ -55,13 +55,13 @@ public:
virtual bool commit(pwr_tStatus *sts) = 0;
virtual bool abort(pwr_tStatus *sts) = 0;
virtual bool writeAttribute() = 0;
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p) = 0;
virtual bool readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size) = 0;
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p) = 0;
virtual bool readBody() = 0;
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p) = 0;
virtual bool writeBody() = 0;
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p) = 0;
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) = 0;
......@@ -95,6 +95,7 @@ public:
virtual void iterObject(wb_dbs *) = 0;
virtual void iterRbody(wb_dbs *) = 0;
virtual void iterDbody(wb_dbs *) = 0;
virtual void objectName(wb_orep *o, char *str) = 0;
};
#endif
......@@ -803,7 +803,7 @@ bool wb_vrepdb::renameObject(pwr_tStatus *sts, wb_orep *o, wb_name name)
return true;
}
bool wb_vrepdb::writeAttribute()
bool wb_vrepdb::writeAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p)
{
//body.oix = ?;
//body.bix = ?;
......@@ -819,7 +819,8 @@ bool wb_vrepdb::writeAttribute()
return true;
}
bool wb_vrepdb::readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size)
void *
wb_vrepdb::readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p)
{
ob_k obk(o->oix(), bix);
//ob_d obd;
......@@ -852,25 +853,29 @@ bool wb_vrepdb::readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, uns
}
// ?? How do we reset the Orep ???, the name was changed
}
return true;
return 0;
}
bool wb_vrepdb::readBody()
void *
wb_vrepdb::readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p)
{
return true;
return 0;
}
bool wb_vrepdb::writeBody()
bool
wb_vrepdb::writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p)
{
return true;
}
wb_orep *wb_vrepdb::ancestor(pwr_tStatus *sts, wb_orep *o) const
wb_orep *
wb_vrepdb::ancestor(pwr_tStatus *sts, wb_orep *o) const
{
return 0;
}
wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *o) const
wb_orep *
wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *o) const
{
wb_orep *orep = 0;
......@@ -879,7 +884,8 @@ wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *o) const
wb_orep *
wb_vrepdb::after(pwr_tStatus *sts, wb_orep *o) const
{
wb_orep *orep = 0;
......@@ -888,7 +894,8 @@ wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *o) const
wb_orep *
wb_vrepdb::before(pwr_tStatus *sts, wb_orep *o) const
{
wb_orep *orep = 0;
......@@ -897,7 +904,8 @@ wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepdb::first(pwr_tStatus *sts, wb_orep *o) const
wb_orep *
wb_vrepdb::first(pwr_tStatus *sts, wb_orep *o) const
{
wb_orep *orep = 0;
......
......@@ -149,13 +149,13 @@ public:
virtual bool commit(pwr_tStatus *sts);
virtual bool abort(pwr_tStatus *sts);
virtual bool writeAttribute();
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p);
virtual bool readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size);
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p);
virtual bool readBody();
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p);
virtual bool writeBody();
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p);
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) const;
......@@ -179,7 +179,7 @@ public:
virtual bool isLocal(wb_orep *o) const;
virtual pwr_tVid vid() const;
virtual void objectName(wb_orep *o, char *str);
};
#endif
......@@ -176,34 +176,44 @@ wb_vrepdbs::abort(pwr_tStatus *sts)
bool
wb_vrepdbs::writeAttribute()
wb_vrepdbs::writeAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p)
{
//*sts = LDH__NYI;
return false;
}
bool
wb_vrepdbs::readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size)
void *
wb_vrepdbs::readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p)
{
//*sts = LDH__NYI;
return true;
return 0;
}
bool
wb_vrepdbs::readBody()
void *
wb_vrepdbs::readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p)
{
//*sts = LDH__NYI;
return true;
dbs_sObject *op = ((wb_orepdbs *)o)->o();
void *bp = dbs_Body(sts, dbsenv(), op, bix);
if (bp == 0)
return 0;
if (p) {
memcpy(p, bp, op->rbody.size);
return p;
}
return bp;
}
bool
wb_vrepdbs::writeBody()
wb_vrepdbs::writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p)
{
//*sts = LDH__NYI;
return true;
*sts = LDH__NYI;
return false;
}
......@@ -437,34 +447,11 @@ wb_vrepdbs::delete_wb_orepdbs(void *p)
}
void
wb_vrepdbs::objectName(wb_orep *o, char *str) const
wb_vrepdbs::objectName(wb_orep *o, char *str)
{
#if 0
*str = 0;
// Count ancestors
int cnt = 0;
wb_wblnode *n = ((wb_orepwbl *)o)->wblNode();
while ( n) {
cnt++;
n = n->o_fth;
}
wb_wblnode **vect = (wb_wblnode **) calloc( cnt, sizeof(vect));
pwr_tStatus sts;
n = ((wb_orepwbl *)o)->wblNode();
for ( int i = 0; i < cnt; i++) {
vect[i] = n;
n = n->o_fth;
}
*str = 0;
for ( int i = cnt - 1; i >= 0; i--) {
strcat( str, vect[i]->name);
if ( i == cnt - 1)
strcat( str, ":");
else if ( i != 0)
strcat( str, "-");
}
free( vect);
#endif
dbs_ObjectToName(&sts, dbsenv(), ((wb_orepdbs *)o)->o(), str);
}
......@@ -28,7 +28,7 @@ public:
dbs_sEnv *dbsenv();
bool load();
void objectName(wb_orep *o, char *str) const;
void objectName(wb_orep *o, char *str);
virtual void unref();
......@@ -57,13 +57,13 @@ public:
virtual bool commit(pwr_tStatus *sts);
virtual bool abort(pwr_tStatus *sts);
virtual bool writeAttribute();
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p);
virtual bool readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size);
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p);
virtual bool readBody();
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p);
virtual bool writeBody();
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p);
virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o);
......
......@@ -1049,7 +1049,7 @@ wb_orep *wb_vrepwbl::previous(pwr_tStatus *sts, wb_orep *o)
return 0;
}
void wb_vrepwbl::objectName(wb_orep *o, char *str) const
void wb_vrepwbl::objectName(wb_orep *o, char *str)
{
*str = 0;
......
......@@ -142,13 +142,13 @@ public:
bool commit(pwr_tStatus *sts) {return false;};
bool abort(pwr_tStatus *sts) {return false;};
bool writeAttribute() {return false;};
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p) {return false;};
bool readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size) {return false;};
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p) {return 0;};
bool readBody() {return false;};
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p) {return 0;};
bool writeBody() {return false;};
virtual bool writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p) {return false;};
wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o);
......@@ -173,7 +173,7 @@ public:
bool isLocal(wb_orep *o) const {return false;};
void objectName(wb_orep *o, char *str) const;
void objectName(wb_orep *o, char *str);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment