Commit dd4cba1c authored by lw's avatar lw

*** empty log message ***

parent e3d93f0b
......@@ -106,7 +106,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, char const* bname, co
m_adrep->ref();
if ( !m_orep->vrep()->merep()->getAttrInfoRec( &n, m_adrep->bix(),
m_orep->cid(), (int *) &m_size,
m_orep->cid(), &m_size,
&m_offset, &m_tid, &m_elements,
&m_type,
&m_flags, 0)) {
......@@ -165,7 +165,7 @@ wb_attribute::wb_attribute(wb_attribute& pa, int idx, const char* aname) :
m_adrep->ref();
if (!m_orep->vrep()->merep()->getAttrInfoRec( &n, m_adrep->bix(),
cid, (int *) &m_size,
cid, &m_size,
&m_offset, &m_tid, &m_elements,
&m_type,
&m_flags, 0)) {
......@@ -265,7 +265,7 @@ size_t wb_attribute::size()
return m_size;
}
int wb_attribute::offset()
size_t wb_attribute::offset()
{
check();
return m_offset;
......
......@@ -31,7 +31,7 @@ class wb_attribute : public wb_status
wb_adrep *m_adrep;
size_t m_size;
int m_offset;
size_t m_offset;
pwr_tTid m_tid;
int m_elements;
pwr_eType m_type;
......@@ -64,7 +64,7 @@ public:
pwr_sAttrRef aref();
pwr_sAttrRef *aref(pwr_sAttrRef *arp);
size_t size();
int offset();
size_t offset();
pwr_eType type();
int nElement();
int index();
......
......@@ -295,7 +295,7 @@ bool wb_db::importVolume(wb_export *e)
bool wb_db::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
pwr_tObjName name, pwr_tObjName normname,
const char *name, const char *normname,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize)
{
......
......@@ -78,7 +78,7 @@ public:
bool importVolume(wb_export *e);
bool importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid,
pwr_tOid loid, pwr_tObjName name, pwr_tObjName normname, pwr_tTime ohTime,
pwr_tOid loid, const char *name, const char *normname, pwr_tTime ohTime,
pwr_tTime rbTime, pwr_tTime dbTime, size_t rbSize, size_t dbSize);
bool importRbody(pwr_tOid oid, size_t size, void *body);
......@@ -105,7 +105,7 @@ public:
wb_db_ohead(wb_db *db, wb_db_txn *txn, pwr_tOid oid);
wb_db_ohead(wb_db *db, pwr_tOid oid, pwr_tCid cid,
pwr_tOid poid, pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
pwr_tObjName name, pwr_tObjName normname,
const char *name, const char *normname,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize);
......
......@@ -171,7 +171,7 @@ wb_dbs::checkObject(sOentry *oep)
bool
wb_dbs::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, pwr_tOid aoid, pwr_tOid boid, pwr_tOid foid,
pwr_tOid loid, pwr_tObjName name, pwr_tObjName normname, pwr_tTime time,
pwr_tOid loid, const char *name, const char *normname, pwr_tTime time,
pwr_tTime rbTime, pwr_tTime dbTime, size_t rbSize, size_t dbSize)
{
sNentry *nep;
......
......@@ -112,11 +112,6 @@ public:
// ldhi_sObjHead *getAliasServer(sLCB *lcbp, ldhi_sObjHead *o, pwr_tOid *soid);
// pwr_tStatus getMountServer(sLCB *lcbp, ldhi_sObjHead *o, pwr_tOid *soid);
pwr_tStatus installObject(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid, pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid,
pwr_tOid loid, pwr_tObjName name, pwr_tObjName normname, pwr_tTime ohTime,
pwr_tTime rbTime, pwr_tTime dbTime, size_t rbSize, size_t dbSize);
pwr_tStatus installRbody(pwr_tOid oid, void *body);
pwr_tStatus installDbody(pwr_tOid oid, void *body);
void classInsert(sOentry *oep);
pwr_tStatus openFile();
pwr_tStatus writeSectFile();
......@@ -135,7 +130,7 @@ public:
virtual bool importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
pwr_tObjName name, pwr_tObjName normname,
const char *name, const char *normname,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize);
......
#ifndef wb_import_h
#define wb_import_h
#include "pwr.h"
#include "co_dbs.h"
class wb_export;
......@@ -13,7 +14,7 @@ public:
virtual bool importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
pwr_tObjName name, pwr_tObjName normname,
const char *name, const char *normname,
pwr_tTime ohTime, pwr_tTime rbTime, pwr_tTime dbTime,
size_t rbSize, size_t dbSize) = 0;
......
......@@ -159,8 +159,8 @@ wb_tdrep *wb_merep::tdrep( pwr_tStatus *sts, wb_name name)
return 0;
}
int wb_merep::getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements,
int wb_merep::getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int *flags, int level)
{
pwr_tStatus sts;
......
......@@ -35,8 +35,8 @@ public:
wb_tdrep *tdrep( pwr_tStatus *sts, pwr_tTid tid);
wb_tdrep *tdrep( pwr_tStatus *sts, wb_name name);
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements,
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int *flags, int level);
};
......
......@@ -11,6 +11,8 @@
#include "wb_orepwbl.h"
#include "wb_ldh_msg.h"
#include "wb_dbs.h"
#include "wb_bdrep.h"
#include "wb_cdrep.h"
#include "wb_erep.h"
#include "wb_merep.h"
#include "wb_tdrep.h"
......@@ -299,7 +301,7 @@ ref_wblnode wb_vrepwbl::findType( pwr_tTid tid)
}
int wb_vrepwbl::getTypeInfo( const char *name, pwr_tTid *tid, pwr_eType *type, int *size,
int wb_vrepwbl::getTypeInfo( const char *name, pwr_tTid *tid, pwr_eType *type, size_t *size,
int *elements)
{
bool type_extern = false;
......@@ -387,7 +389,7 @@ int wb_vrepwbl::getTypeInfo( const char *name, pwr_tTid *tid, pwr_eType *type, i
return 1;
}
int wb_vrepwbl::getTypeInfo( pwr_tTid tid, pwr_eType *type, int *size,
int wb_vrepwbl::getTypeInfo( pwr_tTid tid, pwr_eType *type, size_t *size,
int *elements)
{
switch ( tid) {
......@@ -529,7 +531,7 @@ int wb_vrepwbl::getTypeInfo( pwr_tTid tid, pwr_eType *type, int *size,
return 1;
}
int wb_vrepwbl::getClassInfo( pwr_tCid cid, int *rsize, int *dsize)
int wb_vrepwbl::getClassInfo( pwr_tCid cid, size_t *rsize, size_t *dsize)
{
// Search type in this volume
ref_wblnode n = findClass( cid);
......@@ -589,11 +591,11 @@ int wb_vrepwbl::getClassInfo( pwr_tCid cid, int *rsize, int *dsize)
*elements = elem; }
int wb_vrepwbl::getAttrInfo( const char *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements, pwr_eType *type)
int wb_vrepwbl::getAttrInfo( const char *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements, pwr_eType *type)
{
int a_size;
int a_offset = 0;
size_t a_size;
size_t a_offset = 0;
pwr_tTid a_tid;
int a_elements;
pwr_eType a_type;
......@@ -614,8 +616,8 @@ int wb_vrepwbl::getAttrInfo( const char *attr, pwr_eBix bix, pwr_tCid cid, int *
return 0;
}
int wb_vrepwbl::getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements, pwr_eType *type,
int wb_vrepwbl::getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements, pwr_eType *type,
int level)
{
if ( level > 0)
......@@ -850,8 +852,8 @@ int wb_vrepwbl::nameToAttrRef( const char *name, pwr_sAttrRef *attrref)
{
pwr_tOid oid;
pwr_tStatus sts;
int a_size;
int a_offset;
size_t a_size;
size_t a_offset;
pwr_tTid a_tid;
int a_elements;
pwr_eType a_type;
......@@ -930,7 +932,7 @@ int wb_vrepwbl::nameToAttrRef( const char *name, pwr_sAttrRef *attrref)
return LDH__SUCCESS;
}
int wb_vrepwbl::getTemplateBody( pwr_tCid cid, pwr_eBix bix, int *size, void **body)
int wb_vrepwbl::getTemplateBody( pwr_tCid cid, pwr_eBix bix, size_t *size, void **body)
{
switch ( cid) {
case pwr_eClass_Type:
......
......@@ -55,14 +55,6 @@ public:
virtual bool createSnapshot(const char *fileName);
#if 0
void iterObject( void *udata,
pwr_tStatus (*bc)(void *,pwr_tOid, pwr_tCid, pwr_tOid, pwr_tOid,
pwr_tOid, pwr_tOid, pwr_tOid, const char *,
pwr_tTime, int, int));
void iterBody( void *udata,
pwr_tStatus (*bc)(void *,pwr_tOid, void *, void *));
#endif
int load( const char *fname);
int load_files( const char *file_spec);
void info();
......@@ -78,16 +70,16 @@ public:
bool registerObject( pwr_tOix oix, ref_wblnode node);
int nextOix() { return ++next_oix; }
int classNameToCid( const char *name, pwr_tCid *cid);
int getTemplateBody( pwr_tCid cid, pwr_eBix bix, int *size, void **body);
int getTypeInfo( pwr_tTid tid, pwr_eType *type, int *size,
int getTemplateBody( pwr_tCid cid, pwr_eBix bix, size_t *size, void **body);
int getTypeInfo( pwr_tTid tid, pwr_eType *type, size_t *size,
int *elements);
int getTypeInfo( const char *type, pwr_tTid *tid, pwr_eType *type, int *size,
int getTypeInfo( const char *type, pwr_tTid *tid, pwr_eType *type, size_t *size,
int *elements);
int getClassInfo( pwr_tCid cid, int *rsize, int *dsize);
int getAttrInfo( const char *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements, pwr_eType *type);
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements,
int getClassInfo( pwr_tCid cid, size_t *rsize, size_t *dsize);
int getAttrInfo( const char *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements, pwr_eType *type);
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int level);
ref_wblnode findObject( pwr_tOix oix);
ref_wblnode findClass( const char *name);
......@@ -158,9 +150,9 @@ public:
bool commit(pwr_tStatus *sts) {return false;}
bool abort(pwr_tStatus *sts) {return false;}
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p) {return false;}
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p) {return false;}
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, unsigned int offset, unsigned int size, void *p);
virtual void *readAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
virtual void *readBody(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, void *p);
......
#include "pwr_class.h"
#include "co_cdh.h"
#include "co_time.h"
#include "wb_wblnode.h"
#include "wb_vrepwbl.h"
#include "wb_merep.h"
#include "wb_cdrep.h"
#include "wb_wblvocabTokenTypes.hpp"
#include "wb_dbs.h"
extern "C" {
#include "pwr_class.h"
#include "co_cdh.h"
#include "co_time.h"
}
#include "wb_name.h"
struct wb_wblvocabTokenTypes tokens;
......@@ -541,10 +539,10 @@ void wb_wblnode::buildObjBodyDef( ref_wblnode classdef)
}
void wb_wblnode::buildAttribute( ref_wblnode classdef, ref_wblnode objbodydef,
int *bindex, int *boffset)
int *bindex, size_t *boffset)
{
pwr_eType type;
int size;
size_t size;
int elements;
m_oid.oix = cdh_cixToOix( classdef->c_cix, objbodydef->b_bix, m_oid.oix);
......@@ -594,9 +592,9 @@ void wb_wblnode::buildAttribute( ref_wblnode classdef, ref_wblnode objbodydef,
}
void wb_wblnode::buildBuffer( ref_wblnode classdef, ref_wblnode objbodydef,
int *bindex, int *boffset)
int *bindex, size_t *boffset)
{
int rsize, dsize;
size_t rsize, dsize;
m_oid.oix = cdh_cixToOix( classdef->c_cix, objbodydef->b_bix, m_oid.oix);
if ( !m_vrep->registerObject( m_oid.oix, this))
......@@ -662,7 +660,7 @@ void wb_wblnode::buildTemplate( ref_wblnode classdef)
void wb_wblnode::buildBody( ref_wblnode object)
{
int bix;
pwr_eBix bix;
ref_wblnode first_child;
ref_wblnode next_sibling;
......@@ -694,14 +692,15 @@ void wb_wblnode::buildBody( ref_wblnode object)
}
}
void wb_wblnode::buildAttr( ref_wblnode object, int bix)
void wb_wblnode::buildAttr( ref_wblnode object, pwr_eBix bix)
{
ref_wblnode first_child;
ref_wblnode second_child;
ref_wblnode next_sibling;
int oper;
char value[2048];
int size, offset, elements;
size_t size, offset;
int elements;
pwr_tTypeId tid;
pwr_eType type;
char buf[2048];
......@@ -836,7 +835,7 @@ void wb_wblnode::buildAttr( ref_wblnode object, int bix)
next_sibling->buildAttr( object, bix);
}
void wb_wblnode::buildBuff( ref_wblnode object, int bix, pwr_tCid buffer_cid,
void wb_wblnode::buildBuff( ref_wblnode object, pwr_eBix bix, pwr_tCid buffer_cid,
int buffer_offset, int buffer_size)
{
ref_wblnode first_child;
......@@ -894,15 +893,16 @@ void wb_wblnode::buildBuff( ref_wblnode object, int bix, pwr_tCid buffer_cid,
first_child->buildBuffAttr( object, bix, cid, offset, size);
}
void wb_wblnode::buildBuffAttr( ref_wblnode object, int bix, pwr_tCid buffer_cid,
int buffer_offset, int buffer_size)
void wb_wblnode::buildBuffAttr( ref_wblnode object, pwr_eBix bix, pwr_tCid buffer_cid,
size_t buffer_offset, size_t buffer_size)
{
ref_wblnode first_child;
ref_wblnode second_child;
ref_wblnode next_sibling;
int oper;
char value[2048];
int size, offset, elements;
size_t size, offset;
int elements;
pwr_tTypeId tid;
pwr_eType type;
char buf[2048];
......@@ -1261,7 +1261,7 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
m_vrep->registerType( name(), m_tid, this);
}
else if ( isObjBodyDef()) {
b_bix = m_oid.oix;
b_bix = (pwr_eBix)m_oid.oix;
if ( !(b_bix == pwr_eBix_rt || b_bix == pwr_eBix_sys || b_bix == pwr_eBix_dev))
m_vrep->error( "Bad body index", getFileName(), line_number);
}
......@@ -1427,9 +1427,9 @@ bool wb_wblnode::exportHead(wb_import &i)
pwr_tOid bwsoid = o_bws ? o_bws->m_oid : pwr_cNOid;
pwr_tOid fchoid = o_fch ? o_fch->m_oid : pwr_cNOid;
pwr_tOid lchoid = o_lch ? o_lch->m_oid : pwr_cNOid;
wb_name n = wb_name(name);
wb_name n = wb_name(name());
i.importHead( m_oid, m_cid, fthoid, fwsoid, bwsoid, fchoid, lchoid, name, n.normName(cdh_mName_object),
i.importHead( m_oid, m_cid, fthoid, fwsoid, bwsoid, fchoid, lchoid, name(), n.normName(cdh_mName_object),
getFileTime(), getFileTime(), getFileTime(), rbody_size, dbody_size);
if ( o_fch)
......@@ -1482,7 +1482,7 @@ void wb_wblnode::setFile( wb_wblfile *f)
int wb_wblnode::attrStringToValue( int type_id, char *value_str,
void *buffer_ptr, int buff_size, int attr_size)
void *buffer_ptr, size_t buff_size, size_t attr_size)
{
int sts;
......@@ -1568,7 +1568,7 @@ int wb_wblnode::attrStringToValue( int type_id, char *value_str,
case pwr_eType_Text:
case pwr_eType_String:
{
if ( (int) strlen( value_str) >= attr_size)
if ( strlen( value_str) >= attr_size)
return 0;
strncpy( (char *)buffer_ptr, value_str, min(attr_size, buff_size));
break;
......@@ -1597,7 +1597,8 @@ int wb_wblnode::attrStringToValue( int type_id, char *value_str,
{
pwr_tTypeId val_typeid;
pwr_eType type;
int size, elements;
size_t size;
int elements;
// sts = m_vrep->nameToOid( value_str, &objid);
if ( m_vrep->getTypeInfo( value_str, &val_typeid, &type,
......@@ -1667,10 +1668,3 @@ int wb_wblnode::attrStringToValue( int type_id, char *value_str,
}
return 1;
}
......@@ -48,7 +48,7 @@ public:
rbody_size(0), dbody_size(0), rbody(0), dbody(0), m_cid(0),
m_tid(0), m_oid(pwr_cNOid), m_vrep(0), o_fth(0), o_bws(0), o_fws(0), o_fch(0),
line_number(0), file(0), is_built(0), c_cid(0), c_cix(0), c_template(0),
b_bix(0), a_tid(0), a_size(0), a_offset(0), a_elements(0), a_flags(0)
b_bix(pwr_eBix__), a_tid(0), a_size(0), a_offset(0), a_elements(0), a_flags(0)
{
strcpy( cname, "");
}
......@@ -57,7 +57,7 @@ public:
rbody_size(0), dbody_size(0), rbody(0), dbody(0), m_cid(0),
m_tid(0), m_oid(pwr_cNOid), m_vrep(0), o_fth(0), o_bws(0), o_fws(0), o_fch(0),
line_number(0), file(0), is_built(0), c_cid(0), c_cix(0), c_template(0),
b_bix(0), a_tid(0), a_size(0), a_offset(0), a_elements(0), a_flags(0)
b_bix(pwr_eBix__), a_tid(0), a_size(0), a_offset(0), a_elements(0), a_flags(0)
{
CommonAST::setType(t->getType());
CommonAST::setText(t->getText());
......@@ -165,16 +165,16 @@ public:
void build( bool recursive);
void buildObjBodyDef( ref_wblnode classdef);
void buildAttribute( ref_wblnode classdef, ref_wblnode objbodydef,
int *bindex, int *boffset);
int *bindex, size_t *boffset);
void buildBuffer( ref_wblnode classdef, ref_wblnode objbodydef,
int *bindex, int *boffset);
int *bindex, size_t *boffset);
void buildTemplate( ref_wblnode classdef);
void buildBody( ref_wblnode object);
void buildAttr( ref_wblnode object, int bix);
void buildBuff( ref_wblnode object, int bix, pwr_tCid buffer_cid,
int buffer_offset, int buffer_size);
void buildBuffAttr( ref_wblnode object, int bix, pwr_tCid buffer_cid,
void buildAttr( ref_wblnode object, pwr_eBix bix);
void buildBuff( ref_wblnode object, pwr_eBix bix, pwr_tCid buffer_cid,
int buffer_offset, int buffer_size);
void buildBuffAttr( ref_wblnode object, pwr_eBix bix, pwr_tCid buffer_cid,
size_t buffer_offset, size_t buffer_size);
void link( wb_vrepwbl *vol, ref_wblnode father_node);
void info_link( int level);
ref_wblnode find( wb_name *oname, int level);
......@@ -183,16 +183,17 @@ public:
int stringToOix( const char *buf, pwr_tOix *oix) const;
pwr_tCid Cid() { return c_cid;}
int attrStringToValue( int type_id, char *value_str,
void *buffer_ptr, int buff_size, int attr_size);
void *buffer_ptr, size_t buff_size, size_t attr_size);
bool exportHead(wb_import &i);
bool exportDbody(wb_import &i);
bool exportRbody(wb_import &i);
#if 0
void iterObject(wb_dbs *);
void iterRbody(wb_dbs *);
void iterDbody(wb_dbs *);
#if 0
void iterObject( void *udata,
pwr_tStatus (*bc)(void *, pwr_tOid, pwr_tCid, pwr_tOid, pwr_tOid,
pwr_tOid, pwr_tOid, pwr_tOid, char *,
......@@ -206,8 +207,8 @@ public:
wbl_eNodeType node_type;
int rbody_size;
int dbody_size;
size_t rbody_size;
size_t dbody_size;
void *rbody;
void *dbody;
pwr_tCid m_cid;
......@@ -233,16 +234,16 @@ public:
pwr_tTid ty_tid;
pwr_eType ty_type;
int ty_elements;
int ty_size;
size_t ty_size;
// ObjBodyDef stuff
int b_bix;
int b_size;
pwr_eBix b_bix;
size_t b_size;
// Attribute stuff
pwr_tTid a_tid;
int a_size;
int a_offset;
size_t a_size;
size_t a_offset;
int a_elements;
int a_flags;
int a_index;
......
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