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) ...@@ -908,10 +908,31 @@ dbs_VolumeObject(pwr_tStatus *sts, const dbs_sEnv *ep)
return (dbs_sObject *)(ep->base + ep->sect[dbs_eSect_object].offset); 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); dbs_sObject *op = dbs_VolumeObject(sts, ep);
if (op == NULL) if (op == NULL)
return NULL; return NULL;
return dbs_First(sts, ep, op); 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 { ...@@ -578,6 +578,7 @@ struct dbs_sName {
%dbs_sObject *dbs_VolumeObject(pwr_tStatus *sts, const dbs_sEnv *ep); %dbs_sObject *dbs_VolumeObject(pwr_tStatus *sts, const dbs_sEnv *ep);
%dbs_sObject *dbs_Object(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_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 %#ifdef __cplusplus
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define wb_vrep_h #define wb_vrep_h
#include "pwr.h" #include "pwr.h"
//#include "wb_erep.h" #include "co_cdh.h"
#include "wb_srep.h" #include "wb_srep.h"
#include "wb_orep.h" #include "wb_orep.h"
#include "wb_oset.h" #include "wb_oset.h"
...@@ -55,13 +55,13 @@ public: ...@@ -55,13 +55,13 @@ public:
virtual bool commit(pwr_tStatus *sts) = 0; virtual bool commit(pwr_tStatus *sts) = 0;
virtual bool abort(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; virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) = 0;
...@@ -95,6 +95,7 @@ public: ...@@ -95,6 +95,7 @@ public:
virtual void iterObject(wb_dbs *) = 0; virtual void iterObject(wb_dbs *) = 0;
virtual void iterRbody(wb_dbs *) = 0; virtual void iterRbody(wb_dbs *) = 0;
virtual void iterDbody(wb_dbs *) = 0; virtual void iterDbody(wb_dbs *) = 0;
virtual void objectName(wb_orep *o, char *str) = 0;
}; };
#endif #endif
...@@ -803,7 +803,7 @@ bool wb_vrepdb::renameObject(pwr_tStatus *sts, wb_orep *o, wb_name name) ...@@ -803,7 +803,7 @@ bool wb_vrepdb::renameObject(pwr_tStatus *sts, wb_orep *o, wb_name name)
return true; 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.oix = ?;
//body.bix = ?; //body.bix = ?;
...@@ -819,7 +819,8 @@ bool wb_vrepdb::writeAttribute() ...@@ -819,7 +819,8 @@ bool wb_vrepdb::writeAttribute()
return true; 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_k obk(o->oix(), bix);
//ob_d obd; //ob_d obd;
...@@ -852,25 +853,29 @@ bool wb_vrepdb::readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, uns ...@@ -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 // ?? 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; 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; 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; wb_orep *orep = 0;
...@@ -879,7 +884,8 @@ wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *o) const ...@@ -879,7 +884,8 @@ wb_orep *wb_vrepdb::parent(pwr_tStatus *sts, wb_orep *o) const
return orep; 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; wb_orep *orep = 0;
...@@ -888,7 +894,8 @@ wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *o) const ...@@ -888,7 +894,8 @@ wb_orep *wb_vrepdb::after(pwr_tStatus *sts, wb_orep *o) const
return orep; 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; wb_orep *orep = 0;
...@@ -897,7 +904,8 @@ wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *o) const ...@@ -897,7 +904,8 @@ wb_orep *wb_vrepdb::before(pwr_tStatus *sts, wb_orep *o) const
return orep; 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; wb_orep *orep = 0;
......
...@@ -149,13 +149,13 @@ public: ...@@ -149,13 +149,13 @@ public:
virtual bool commit(pwr_tStatus *sts); virtual bool commit(pwr_tStatus *sts);
virtual bool abort(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; virtual wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o) const;
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
virtual bool isLocal(wb_orep *o) const; virtual bool isLocal(wb_orep *o) const;
virtual pwr_tVid vid() const; virtual pwr_tVid vid() const;
virtual void objectName(wb_orep *o, char *str);
}; };
#endif #endif
...@@ -176,34 +176,44 @@ wb_vrepdbs::abort(pwr_tStatus *sts) ...@@ -176,34 +176,44 @@ wb_vrepdbs::abort(pwr_tStatus *sts)
bool 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; //*sts = LDH__NYI;
return false; return false;
} }
bool void *
wb_vrepdbs::readAttribute(wb_orep *o, pwr_tOix bix, unsigned int offset, unsigned int size) wb_vrepdbs::readAttribute(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, unsigned int offset, unsigned int size, void *p)
{ {
//*sts = LDH__NYI; //*sts = LDH__NYI;
return true; return 0;
} }
bool void *
wb_vrepdbs::readBody() wb_vrepdbs::readBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p)
{ {
//*sts = LDH__NYI; dbs_sObject *op = ((wb_orepdbs *)o)->o();
return true; 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 bool
wb_vrepdbs::writeBody() wb_vrepdbs::writeBody(pwr_tStatus *sts, wb_orep *o, cdh_eBix bix, void *p)
{ {
//*sts = LDH__NYI; *sts = LDH__NYI;
return true; return false;
} }
...@@ -437,34 +447,11 @@ wb_vrepdbs::delete_wb_orepdbs(void *p) ...@@ -437,34 +447,11 @@ wb_vrepdbs::delete_wb_orepdbs(void *p)
} }
void void
wb_vrepdbs::objectName(wb_orep *o, char *str) const wb_vrepdbs::objectName(wb_orep *o, char *str)
{ {
#if 0 pwr_tStatus sts;
*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));
n = ((wb_orepwbl *)o)->wblNode(); *str = 0;
for ( int i = 0; i < cnt; i++) {
vect[i] = n;
n = n->o_fth;
}
for ( int i = cnt - 1; i >= 0; i--) { dbs_ObjectToName(&sts, dbsenv(), ((wb_orepdbs *)o)->o(), str);
strcat( str, vect[i]->name);
if ( i == cnt - 1)
strcat( str, ":");
else if ( i != 0)
strcat( str, "-");
}
free( vect);
#endif
} }
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
dbs_sEnv *dbsenv(); dbs_sEnv *dbsenv();
bool load(); bool load();
void objectName(wb_orep *o, char *str) const; void objectName(wb_orep *o, char *str);
virtual void unref(); virtual void unref();
...@@ -57,13 +57,13 @@ public: ...@@ -57,13 +57,13 @@ public:
virtual bool commit(pwr_tStatus *sts); virtual bool commit(pwr_tStatus *sts);
virtual bool abort(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); 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) ...@@ -1049,7 +1049,7 @@ wb_orep *wb_vrepwbl::previous(pwr_tStatus *sts, wb_orep *o)
return 0; return 0;
} }
void wb_vrepwbl::objectName(wb_orep *o, char *str) const void wb_vrepwbl::objectName(wb_orep *o, char *str)
{ {
*str = 0; *str = 0;
......
...@@ -142,13 +142,13 @@ public: ...@@ -142,13 +142,13 @@ public:
bool commit(pwr_tStatus *sts) {return false;}; bool commit(pwr_tStatus *sts) {return false;};
bool abort(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); wb_orep *ancestor(pwr_tStatus *sts, wb_orep *o);
...@@ -173,7 +173,7 @@ public: ...@@ -173,7 +173,7 @@ public:
bool isLocal(wb_orep *o) const {return false;}; 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