Commit ba8439e7 authored by ml's avatar ml

char * to const char *

parent 39d185b2
......@@ -119,7 +119,7 @@ pwr_tOid wb_adef::boid()
return m_adrep->boid();
}
char *wb_adef::name()
const char *wb_adef::name()
{
check();
return m_adrep->name();
......
......@@ -47,7 +47,7 @@ public:
wb_adef next();
wb_adef prev();
char *name();
const char *name();
wb_name longName();
void *body( void *p = 0);
......
......@@ -212,7 +212,7 @@ wb_vrep *wb_adrep::vrep() const
return m_orep->m_vrep;
}
char *wb_adrep::name()
const char *wb_adrep::name() const
{
return m_orep->name();
}
......
......@@ -52,7 +52,7 @@ class wb_adrep
int flags() {return m_flags;}
pwr_tOid boid();
char *name();
const char *name() const;
wb_name longName();
void *body( void *p = 0);
......
......@@ -58,7 +58,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep * const orep, wb_adrep * con
}
}
wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep * const orep, char *aname, char *bname) :
wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep * const orep, const char *aname, const char *bname) :
wb_status(sts), m_orep(orep)
{
if ( orep == 0)
......
......@@ -42,7 +42,7 @@ public:
wb_attribute(const wb_attribute&);
wb_attribute(pwr_tStatus, wb_orep* const );
wb_attribute(pwr_tStatus, wb_orep* const, wb_adrep* const);
wb_attribute(pwr_tStatus, wb_orep* const, char* aname, char* bname = 0);
wb_attribute(pwr_tStatus, wb_orep* const, const char* aname, const char* bname = 0);
~wb_attribute();
wb_attribute& operator=(const wb_attribute&);
......
......@@ -2,7 +2,7 @@
#include <string.h>
#include "wb_attrname.h"
wb_attrname::wb_attrname( char *name)
wb_attrname::wb_attrname( const char *name)
{
try {
char str[80];
......
......@@ -6,7 +6,7 @@
class wb_attrname : public wb_name
{
public:
wb_attrname(char *);
wb_attrname(const char *);
};
#endif
......@@ -83,7 +83,7 @@ wb_adef wb_bdef::adef()
return a;
}
wb_adef wb_bdef::adef( char *aname)
wb_adef wb_bdef::adef( const char *aname)
{
pwr_tStatus sts;
......
......@@ -42,7 +42,7 @@ public:
wb_adef adef(); // Get first attribute
wb_adef adef(pwr_tAix aix);
wb_adef adef(char *aname);
wb_adef adef(const char *aname);
wb_adef adef(wb_name aname);
};
......
......@@ -41,7 +41,7 @@ wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts)
return new wb_adrep(*orep);
}
wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts, char *aname)
wb_adrep *wb_bdrep::adrep( pwr_tStatus *sts, const char *aname)
{
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, aname);
if ( EVEN(*sts))
......
......@@ -36,7 +36,7 @@ public:
wb_name name(ldh_eName type) { wb_name n; return n;} // Fix
wb_adrep *adrep( pwr_tStatus *sts); // Get first attribute
wb_adrep *adrep( pwr_tStatus *sts, char *aname);
wb_adrep *adrep( pwr_tStatus *sts, const char *aname);
pwr_tStatus sts() { return m_sts;}
......
......@@ -103,7 +103,7 @@ wb_name wb_cdef::name(ldh_eName type)
return m_cdrep->name(type);
}
wb_bdef wb_cdef::bdef( char *bname)
wb_bdef wb_cdef::bdef( const char *bname)
{
check();
pwr_tStatus sts;
......
......@@ -42,7 +42,7 @@ class wb_cdef : public wb_status
wb_name name(ldh_eName type);
wb_bdef bdef(pwr_tOix bix);
wb_bdef bdef(char *bname);
wb_bdef bdef(const char *bname);
wb_bdef bdef(wb_name bname);
private:
......
......@@ -81,7 +81,7 @@ wb_cdrep::wb_cdrep( wb_adrep *adrep) : m_nRef(0)
orep->unref();
}
wb_bdrep *wb_cdrep::bdrep( pwr_tStatus *sts, char *bname)
wb_bdrep *wb_cdrep::bdrep( pwr_tStatus *sts, const char *bname)
{
wb_orepdbs *orep = (wb_orepdbs *)m_orep->m_vrep->child( sts, m_orep, bname);
if ( EVEN(*sts))
......@@ -110,7 +110,7 @@ wb_bdrep *wb_cdrep::bdrep( pwr_tStatus *sts, int bix)
return 0;
}
wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, char *aname)
wb_adrep *wb_cdrep::adrep( pwr_tStatus *sts, const char *aname)
{
wb_orepdbs *orep_attr;
wb_orepdbs *orep = (wb_orepdbs *)m_orep->first( sts);
......
......@@ -42,8 +42,8 @@ class wb_cdrep
void name(wb_name *name);
wb_bdrep *bdrep( pwr_tStatus *sts, int bix);
wb_bdrep *bdrep( pwr_tStatus *sts, char *bname);
wb_adrep *adrep( pwr_tStatus *sts, char *aname);
wb_bdrep *bdrep( pwr_tStatus *sts, const char *bname);
wb_adrep *adrep( pwr_tStatus *sts, const char *aname);
void templateBody( pwr_tStatus *sts, cdh_eBix bix, void *p);
......
......@@ -74,7 +74,7 @@ wb_volume wb_env::externVolume(pwr_tVid vid)
return v;
}
wb_volume wb_env::volume( char *name)
wb_volume wb_env::volume(const char *name)
{
wb_volume v( m_erep->volume( &m_sts, name));
return v;
......
......@@ -36,7 +36,7 @@ public:
// Get db volume.
wb_volume volume(pwr_tVid);
wb_volume volume(char *name);
wb_volume volume(const char *name);
wb_volume externVolume(pwr_tVid);
wb_volume snapshot(pwr_tVid);
......
......@@ -74,7 +74,7 @@ wb_vrep *wb_erep::volume(pwr_tStatus *sts, pwr_tVid vid)
return it->second;
}
wb_vrep *wb_erep::volume(pwr_tStatus *sts, char *name) // Fix
wb_vrep *wb_erep::volume(pwr_tStatus *sts, const char *name) // Fix
{
vrep_iterator it;
for ( it = m_vrepdb.begin(); it != m_vrepdb.end(); it++) {
......@@ -440,7 +440,7 @@ wb_orep *wb_erep::object(pwr_tStatus *sts, pwr_tOid oid)
return vrep->object( sts, oid);
}
wb_orep *wb_erep::object(pwr_tStatus *sts, char *name)
wb_orep *wb_erep::object(pwr_tStatus *sts, const char *name)
{
wb_name n = wb_name(name);
......
......@@ -36,7 +36,7 @@ public:
wb_merep *merep() { return m_merep;}
wb_vrep *volume(pwr_tStatus *sts);
wb_vrep *volume(pwr_tStatus *sts, pwr_tVid vid);
wb_vrep *volume(pwr_tStatus *sts, char *name);
wb_vrep *volume(pwr_tStatus *sts, const char *name);
wb_vrep *nextVolume(pwr_tStatus *sts, pwr_tVid vid);
wb_vrep *externVolume(pwr_tStatus *sts, pwr_tVid vid);
void addDb( pwr_tStatus *sts, wb_vrep *vrep);
......@@ -48,7 +48,7 @@ public:
void load( pwr_tStatus *sts);
wb_orep *object( pwr_tStatus *sts, pwr_tOid oid);
wb_orep *object( pwr_tStatus *sts, char *name);
wb_orep *object( pwr_tStatus *sts, const char *name);
wb_cdrep *cdrep( pwr_tStatus *sts, const wb_orep& o);
wb_tdrep *tdrep( pwr_tStatus *sts, const wb_adrep& a);
......
#include "wb_name.h"
wb_name::wb_name( char *name)
wb_name::wb_name( const char *name)
{
try {
m_nrep = new wb_nrep( name);
......
......@@ -101,7 +101,7 @@ protected:
public:
wb_name() : wb_status(LDH__NONAME), m_nrep(0) {}
wb_name(char*);
wb_name(const char*);
wb_name(wb_nrep*);
wb_name(const wb_name&);
......@@ -137,10 +137,10 @@ public:
char *normName() const throw (wb_error) { check(); return m_nrep->normName();}
char *name( int ntype) const throw (wb_error) { check(); return m_nrep->name( ntype);}
char *normName( int ntype) const throw (wb_error) { check(); return m_nrep->normName( ntype);}
bool volumeIsEqual( char *n) const throw (wb_error) { check(); return m_nrep->volumeIsEqual( n);}
bool objectIsEqual( char *n) const throw (wb_error) { check(); return m_nrep->objectIsEqual( n);}
bool volumeIsEqual( const char *n) const throw (wb_error) { check(); return m_nrep->volumeIsEqual( n);}
bool objectIsEqual( const char *n) const throw (wb_error) { check(); return m_nrep->objectIsEqual( n);}
bool segmentIsEqual( char *n, int idx = 0) const throw (wb_error) { check(); return m_nrep->segmentIsEqual( n, idx);}
bool attributeIsEqual( 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);}
// Id representation
char *vid( char *res = 0) const throw (wb_error) { check(); return m_nrep->volume( res);}
......
......@@ -56,11 +56,11 @@ wb_nrep::wb_nrep() : m_nRef(0), num_seg(0), num_attr(0), vol_len(0),
strcpy( oname,"");
}
wb_nrep::wb_nrep( char *n) throw (wb_error) : num_seg(0), num_attr(0), vol_len(0),
wb_nrep::wb_nrep( const char *n) throw (wb_error) : num_seg(0), num_attr(0), vol_len(0),
vol_offs(0), b_size(0), b_offset(0),
seg(0), attr(0)
{
char *s;
const char *s;
int seg_cnt = 1;
int attr_cnt = 0;
int name_len = 0;
......@@ -519,10 +519,10 @@ char *wb_nrep::normAttribute( int idx, char *res)
return attributeName( norm_name, idx, res);
}
bool wb_nrep::objectIsEqual( char *n)
bool wb_nrep::objectIsEqual( const char *n)
{
char *s1 = norm_name + seg[num_seg-1].offs;
char *s2 = n;
const char *s1 = norm_name + seg[num_seg-1].offs;
const char *s2 = n;
char c;
for ( int i = 0; i < seg[num_seg-1].len; i++) {
......@@ -540,10 +540,10 @@ bool wb_nrep::objectIsEqual( char *n)
return true;
}
bool wb_nrep::volumeIsEqual( char *n)
bool wb_nrep::volumeIsEqual(const char *n)
{
char *s1 = norm_name;
char *s2 = n;
const char *s1 = norm_name;
const char *s2 = n;
char c;
for ( int i = 0; i < vol_len; i++) {
......@@ -561,10 +561,10 @@ bool wb_nrep::volumeIsEqual( char *n)
return true;
}
bool wb_nrep::segmentIsEqual( char *n, int idx)
bool wb_nrep::segmentIsEqual(const char *n, int idx)
{
char *s1 = norm_name + seg[idx].offs;
char *s2 = n;
const char *s1 = norm_name + seg[idx].offs;
const char *s2 = n;
char c;
if ( idx < 0 || idx >= num_seg)
......@@ -585,10 +585,10 @@ bool wb_nrep::segmentIsEqual( char *n, int idx)
return true;
}
bool wb_nrep::attributeIsEqual( char *n, int idx)
bool wb_nrep::attributeIsEqual(const char *n, int idx)
{
char *s1 = norm_name + attr[idx].offs;
char *s2 = n;
const char *s1 = norm_name + attr[idx].offs;
const char *s2 = n;
char c;
if ( idx < 0 || idx >= num_attr)
......@@ -609,7 +609,7 @@ bool wb_nrep::attributeIsEqual( char *n, int idx)
return true;
}
char *wb_nrep::objectName( char *n, char *res)
char *wb_nrep::objectName(const char *n, char *res)
{
static char result[80];
......@@ -637,7 +637,7 @@ char *wb_nrep::objectName( char *n, char *res)
}
}
char *wb_nrep::pathName( char *n, char *res)
char *wb_nrep::pathName(const char *n, char *res)
{
static char result[80];
......@@ -667,7 +667,7 @@ char *wb_nrep::pathName( char *n, char *res)
}
}
char *wb_nrep::segmentName( char *n, int idx, char *res)
char *wb_nrep::segmentName(const char *n, int idx, char *res)
{
static char result[80];
......@@ -695,7 +695,7 @@ char *wb_nrep::segmentName( char *n, int idx, char *res)
}
}
char *wb_nrep::attributeName( char *n, int idx, char *res)
char *wb_nrep::attributeName(const char *n, int idx, char *res)
{
static char result[80];
......@@ -723,7 +723,7 @@ char *wb_nrep::attributeName( char *n, int idx, char *res)
}
}
char *wb_nrep::volumeName( char *n, char *res)
char *wb_nrep::volumeName(const char *n, char *res)
{
static char result[80];
if ( vol_len == 0) {
......@@ -761,7 +761,7 @@ char *wb_nrep::normName( int ntype, char *res)
return nameName( norm_name, ntype, res);
}
char *wb_nrep::nameName( char *n, int ntype, char *res)
char *wb_nrep::nameName(const char *n, int ntype, char *res)
{
static char result[200];
int colon_added = 0;
......@@ -814,10 +814,11 @@ char *wb_nrep::nameName( char *n, int ntype, char *res)
return res;
}
char *wb_nrep::unatName( char *name)
char *wb_nrep::unatName(const char *name)
{
static char result[80];
char *s, *su;
const char *s;
char *su;
su = result;
......@@ -831,9 +832,9 @@ char *wb_nrep::unatName( char *name)
return result;
}
bool wb_nrep::checkObjectName( char *name)
bool wb_nrep::checkObjectName( const char *name)
{
char *s;
const char *s;
for ( s = name; *s; s++) {
if ( objname_tab[*(unsigned char *)s] == '!')
......
......@@ -54,12 +54,12 @@ private:
pwr_tStatus status;
void parse() throw (wb_error);
char *objectName( char *n, char *res = 0);
char *segmentName( char *n, int idx = 0, char *res = 0);
char *attributeName( char *n, int idx = 0, char *res = 0);
char *pathName( char *n, char *res = 0);
char *volumeName( char *n, char *res = 0);
char *nameName( char *n, int ntype, char *res);
char *objectName( const char *n, char *res = 0);
char *segmentName( const char *n, int idx = 0, char *res = 0);
char *attributeName( const char *n, int idx = 0, char *res = 0);
char *pathName( const char *n, char *res = 0);
char *volumeName( const char *n, char *res = 0);
char *nameName( const char *n, int ntype, char *res);
public:
......@@ -67,7 +67,7 @@ public:
wb_nrep *ref();
wb_nrep();
wb_nrep( char *n) throw (wb_error);
wb_nrep( const char *n) throw (wb_error);
wb_nrep( const wb_nrep& n);
~wb_nrep();
......@@ -102,15 +102,15 @@ public:
char *normName() { return norm_name;}
char *name( int ntype, char *res = 0);
char *normName( int ntype, char *res = 0);
bool volumeIsEqual( char *n);
bool objectIsEqual( char *n);
bool segmentIsEqual( char *n, int idx = 0);
bool attributeIsEqual( char *n, int idx = 0);
bool volumeIsEqual( const char *n);
bool objectIsEqual( const char *n);
bool segmentIsEqual( const char *n, int idx = 0);
bool attributeIsEqual( const char *n, int idx = 0);
int bodyOffset() const { return b_offset;}
int bodySize() const { return b_size;}
static char *unatName( char *name);
static bool checkObjectName( char *name);
static char *unatName( const char *name);
static bool checkObjectName( const char *name);
};
#endif
......
......@@ -88,7 +88,7 @@ wb_object::operator wb_orep*() const
return m_orep;
}
char *wb_object::name()
const char *wb_object::name()
{
return m_orep->name();
}
......
......@@ -33,7 +33,7 @@ public:
operator wb_orep*() const;
bool operator==(wb_object&);
void uniqueName(char *) {} // Fix
void uniqueName(const char *) {} // Fix
pwr_tStatus checkXref(const char *name);
......@@ -60,7 +60,7 @@ public:
pwr_tOix boix(); //< Object index of object before this object
pwr_tOix aoix(); //< Object index of object after this object
char *name();
const char *name();
wb_name longName();
pwr_tTime ohTime(); //< time when this object was last changed
......@@ -81,7 +81,7 @@ public:
wb_object after(); //< next sibling
wb_object before(); //< previous sibling
wb_object first(); //< first child
wb_object child(char *name);
wb_object child(const char *name);
wb_object last(); //< last child
wb_object next(); //< next in list of objects of same class in one volume
......
......@@ -38,7 +38,7 @@ public:
virtual pwr_tOid boid() const = 0;
virtual pwr_tOid aoid() const = 0;
virtual char * const name() = 0;
virtual const char * name() const = 0;
virtual wb_name longName() = 0;
virtual pwr_tTime ohTime() const = 0;
......@@ -51,7 +51,7 @@ public:
virtual wb_orep *after(pwr_tStatus *sts) const = 0; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const = 0; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const = 0; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, char *name) const = 0; //< get named child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const = 0; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const = 0; //< get last child
virtual wb_orep *next(pwr_tStatus *sts) const = 0; //< get next in list of objects of same class in one volume
virtual wb_orep *previous(pwr_tStatus *sts) const = 0; //< get previous in list of objects of same class in one volume
......
......@@ -48,7 +48,7 @@ pwr_tOid wb_orepdb::aoid() const
return m_ohead.aoid;
}
char *const wb_orepdb::name()
const char * wb_orepdb::name() const
{
return m_ohead.name;
}
......@@ -91,7 +91,7 @@ wb_orep *wb_orepdb::first(pwr_tStatus *sts) const
return m_vrep->first(sts, (wb_orep*)this);
}
wb_orep *wb_orepdb::child(pwr_tStatus *sts, char *name) const
wb_orep *wb_orepdb::child(pwr_tStatus *sts, const char *name) const
{
return m_vrep->child(sts, (wb_orep*)this, name);
}
......
......@@ -55,7 +55,7 @@ public:
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
virtual char * const name();
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
......@@ -68,7 +68,7 @@ public:
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, char *name) const; //< get named child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< get last child
virtual wb_orep *next(pwr_tStatus *sts) const; //< get next in list of objects of same class in one volume
virtual wb_orep *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
......
......@@ -116,7 +116,7 @@ pwr_tCid wb_orepdbs::cid() const
return m_o->cid;
}
char * const wb_orepdbs::name()
const char * wb_orepdbs::name() const
{
if (m_o == 0)
throw wb_error_str("No current object");
......@@ -168,7 +168,7 @@ wb_orep *wb_orepdbs::first(pwr_tStatus *sts) const
return m_vrep->first(sts, (wb_orep*)this);
}
wb_orep *wb_orepdbs::child(pwr_tStatus *sts, char *name) const
wb_orep *wb_orepdbs::child(pwr_tStatus *sts, const char *name) const
{
return m_vrep->child(sts, (wb_orep*)this, name);
}
......
......@@ -36,7 +36,7 @@ public:
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
virtual char * const name();
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
......@@ -49,7 +49,7 @@ public:
virtual wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
virtual wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
virtual wb_orep *first(pwr_tStatus *sts) const; //< get first child
virtual wb_orep *child(pwr_tStatus *sts, char *name) const; //< get named child
virtual wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
virtual wb_orep *last(pwr_tStatus *sts) const; //< get last child
virtual wb_orep *next(pwr_tStatus *sts) const; //< get next in list of objects of same class in one volume
virtual wb_orep *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
......
......@@ -68,7 +68,7 @@ pwr_tOid wb_orepwbl::aoid() const
return pwr_cNOid;
}
char *const wb_orepwbl::name()
const char * wb_orepwbl::name() const
{
return m_wblnode->name;
}
......@@ -119,7 +119,7 @@ wb_orep *wb_orepwbl::first(pwr_tStatus *sts) const
return m_vrep->first(sts, (wb_orep *)this);
}
wb_orep *wb_orepwbl::child(pwr_tStatus *sts, char *name) const
wb_orep *wb_orepwbl::child(pwr_tStatus *sts, const char *name) const
{
return m_vrep->child(sts, (wb_orep *)this, name);
}
......
......@@ -32,7 +32,7 @@ public:
virtual pwr_tOid boid() const;
virtual pwr_tOid aoid() const;
virtual char * const name();
virtual const char * name() const;
virtual wb_name longName();
virtual pwr_tTime ohTime() const;
......@@ -45,7 +45,7 @@ public:
wb_orep *after(pwr_tStatus *sts) const; //< get next sibling
wb_orep *before(pwr_tStatus *sts) const; //< get previous sibling
wb_orep *first(pwr_tStatus *sts) const; //< get first child
wb_orep *child(pwr_tStatus *sts, char *name) const; //< get named child
wb_orep *child(pwr_tStatus *sts, const char *name) const; //< get named child
wb_orep *last(pwr_tStatus *sts) const; //< get last child
wb_orep *next(pwr_tStatus *sts) const; //< get next in list of objects of same class in one volume
wb_orep *previous(pwr_tStatus *sts) const; //< get previous in list of objects of same class in one volume
......
......@@ -118,7 +118,7 @@ wb_object wb_volume::object(pwr_tOid oid) const
return o;
}
wb_object wb_volume::object(char *name) const
wb_object wb_volume::object(const char *name) const
{
pwr_tStatus sts;
wb_orep *orep;
......@@ -137,7 +137,7 @@ wb_object wb_volume::object(char *name) const
return o;
}
wb_adef wb_volume::adef( pwr_tCid cid, char *bname, char *aname)
wb_adef wb_volume::adef( pwr_tCid cid, const char *bname, const char *aname)
{
pwr_tStatus sts;
......@@ -149,12 +149,12 @@ wb_adef wb_volume::adef( pwr_tCid cid, char *bname, char *aname)
return bdef.adef( aname);
}
wb_bdef wb_volume::bdef(wb_cdef cdef, char *bname)
wb_bdef wb_volume::bdef(wb_cdef cdef, const char *bname)
{
return cdef.bdef( bname);
}
wb_bdef wb_volume::bdef(wb_object o, char *bname)
wb_bdef wb_volume::bdef(wb_object o, const char *bname)
{
wb_orep *orep = o;
wb_cdef cdef = wb_cdef(*orep);
......@@ -197,7 +197,7 @@ wb_cdef wb_volume::cdef(wb_name n)
return wb_cdef(m_vrep->merep()->cdrep( &sts, n));
}
wb_attribute wb_volume::attribute(pwr_tOid oid, char *aname, char *bname) const
wb_attribute wb_volume::attribute(pwr_tOid oid, const char *aname, const char *bname) const
{
pwr_tStatus sts;
wb_orep *orep;
......
......@@ -42,16 +42,16 @@ public:
pwr_tVid vid() const { return m_vrep->vid();}
pwr_tCid cid() const { return m_vrep->cid();}
char *name() const { return m_vrep->name();}
const char *name() const { return m_vrep->name();}
wb_volume next() const;
wb_object object() const; // Get root list
wb_object object(pwr_tOid oid) const;
wb_object object(pwr_tCid cid) const { wb_object o; return o;} // Fix
wb_object object(char *name) const;
wb_object object(const char *name) const;
wb_attribute attribute(pwr_tOid oid, char *aname, char *bname) const;
wb_attribute attribute(pwr_tOid oid, const char *aname, 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_name aname) { wb_attribute a; return a;}; // Fix
wb_attribute attribute(wb_name aname) { wb_attribute a; return a;}; // Fix
......@@ -59,10 +59,10 @@ public:
wb_attribute attribute() { wb_attribute a; return a;}; // Fix
wb_adef adef(pwr_sAttrRef *arp) { wb_adef a; return a;}; // Fix
wb_adef adef(pwr_tCid cid, char *bname, char *aname);
wb_adef adef(pwr_tCid cid, const char *bname, const char *aname);
wb_bdef bdef(wb_cdef cdef, char *bname);
wb_bdef bdef(wb_object o, char *bname);
wb_bdef bdef(wb_cdef cdef, const char *bname);
wb_bdef bdef(wb_object o, const char *bname);
wb_cdef cdef(wb_object o);
wb_cdef cdef(pwr_tCid cid);
......@@ -79,7 +79,7 @@ public:
bool isLocal(wb_object &o) const;
bool createSnapshot(char *fileName) { return m_vrep->createSnapshot(fileName);}
bool createSnapshot(const char *fileName) { return m_vrep->createSnapshot(fileName);}
};
......
......@@ -86,11 +86,11 @@ public:
virtual bool isLocal(wb_orep *o) const = 0;
virtual pwr_tVid vid() const = 0;
virtual pwr_tCid cid() const = 0;
virtual void name( char *n) { strcpy( m_name, n);}
virtual char *name() { return m_name;}
virtual void name( const char *n) { strcpy( m_name, n);}
virtual const char *name() { return m_name;}
virtual wb_merep *merep() const = 0;
virtual bool createSnapshot(char *fileName) = 0;
virtual bool createSnapshot(const char *fileName) = 0;
virtual void iterObject(wb_dbs *) = 0;
virtual void iterRbody(wb_dbs *) = 0;
......
......@@ -154,7 +154,7 @@ wb_vrepdb::na_k::na_k(wb_orepdb *o)
set_size(sizeof(m_key));
}
wb_vrepdb::na_k::na_k(wb_orepdb *o, char *name)
wb_vrepdb::na_k::na_k(wb_orepdb *o, const char *name)
{
memset(&m_key, 0, sizeof(m_key));
m_key.poix = o->oix();
......@@ -173,7 +173,7 @@ wb_vrepdb::na_k::na_k(pwr_tOix poix)
set_size(sizeof(m_key));
}
wb_vrepdb::na_k::na_k(pwr_tOix poix, char *name)
wb_vrepdb::na_k::na_k(pwr_tOix poix, const char *name)
{
memset(&m_key, 0, sizeof(m_key));
m_key.poix = poix;
......@@ -914,7 +914,7 @@ wb_vrepdb::first(pwr_tStatus *sts, wb_orep *o) const
return orep;
}
wb_orep *wb_vrepdb::child(pwr_tStatus *sts, wb_orep *o, char *name) const
wb_orep *wb_vrepdb::child(pwr_tStatus *sts, wb_orep *o, const char *name) const
{
return 0;
}
......
......@@ -78,9 +78,9 @@ protected:
na_k();
na_k(wb_orepdb *o);
na_k(wb_orepdb *o, char *name);
na_k(wb_orepdb *o, const char *name);
na_k(pwr_tOix poix);
na_k(pwr_tOix poix, char *name);
na_k(pwr_tOix poix, const char *name);
na_k(pwr_tOix poix, wb_name name);
};
......@@ -100,7 +100,7 @@ protected:
#if 0
int wb_vrepdb::get_ohead(DbTxn *txn, wb_orepdb *o);
int wb_vrepdb::get_ohead(wb_orep **orep, DbTxn *txn, pwr_tOid oid);
int wb_vrepdb::get_ohead(wb_orep **orep, DbTxn *txn, wb_orepdb *o, char *name);
int wb_vrepdb::get_ohead(wb_orep **orep, DbTxn *txn, wb_orepdb *o, const char *name);
int wb_vrepdb::put_ohead(DbTxn *txn, wb_orepdb *o, u_int32_t flags);
......@@ -129,7 +129,7 @@ public:
virtual wb_erep *erep();
virtual wb_orep *object(pwr_tStatus *sts, pwr_tOid oid);
virtual wb_orep *object(pwr_tStatus *sts, char *name);
virtual wb_orep *object(pwr_tStatus *sts, const char *name);
virtual wb_orep *object(pwr_tStatus *sts, wb_orep *parent, wb_name name);
virtual wb_orep *createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination d, wb_name name);
......@@ -167,7 +167,7 @@ public:
virtual wb_orep *first(pwr_tStatus *sts, wb_orep *o) const;
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, char *name) const;
virtual wb_orep *child(pwr_tStatus *sts, wb_orep *o, const char *name) const;
virtual wb_orep *last(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);
virtual void objectName(wb_orep *o, const char *str);
};
#endif
......@@ -432,7 +432,7 @@ wb_vrepdbs::merep() const
}
bool
wb_vrepdbs::createSnapshot(char *)
wb_vrepdbs::createSnapshot(const char *)
{
return false;
}
......
......@@ -97,7 +97,7 @@ public:
virtual bool isLocal (wb_orep *) const;
virtual pwr_tCid cid () const;
virtual wb_merep *merep () const;
virtual bool createSnapshot (char *);
virtual bool createSnapshot (const char *);
virtual void iterObject (wb_dbs *);
virtual void iterRbody (wb_dbs *);
virtual void iterDbody (wb_dbs *);
......
......@@ -63,7 +63,7 @@ wb_vrep *wb_vrepwbl::next() const
return m_erep->nextVolume( &sts, vid());
}
void wb_vrepwbl::error( char *msg, char *file, int line_number)
void wb_vrepwbl::error( const char *msg, const char *file, int line_number)
{
cout << "Wbl error: " << msg << ", " << file << " line: " << line_number << endl;
error_cnt++;
......@@ -100,7 +100,7 @@ void wb_vrepwbl::info()
}
bool
wb_vrepwbl::createSnapshot(char *fileName)
wb_vrepwbl::createSnapshot(const char *fileName)
{
try {
wb_dbs dbs(this);
......@@ -131,7 +131,7 @@ void wb_vrepwbl::iterRbody( wb_dbs *dbs)
root_object->iterRbody( dbs);
}
int wb_vrepwbl::load( char *fname)
int wb_vrepwbl::load( const char *fname)
{
int i;
char file_spec[200];
......@@ -185,7 +185,7 @@ int wb_vrepwbl::load( char *fname)
return 1;
}
int wb_vrepwbl::classNameToCid( char *name, pwr_tCid *cid)
int wb_vrepwbl::classNameToCid( const char *name, pwr_tCid *cid)
{
// cout << "classNameToCid : " << name << endl;
......@@ -205,7 +205,7 @@ ref_wblnode wb_vrepwbl::findObject( pwr_tOix oix)
return it->second;
}
ref_wblnode wb_vrepwbl::findClass( char *name)
ref_wblnode wb_vrepwbl::findClass( const char *name)
{
string sname(name);
iterator_class_list it = m_class_list.find( sname);
......@@ -214,7 +214,7 @@ ref_wblnode wb_vrepwbl::findClass( char *name)
return it->second;
}
ref_wblnode wb_vrepwbl::findType( char *name)
ref_wblnode wb_vrepwbl::findType( const char *name)
{
wb_name wname( name);
......@@ -247,7 +247,7 @@ ref_wblnode wb_vrepwbl::findType( pwr_tTid tid)
}
int wb_vrepwbl::getTypeInfo( char *name, pwr_tTid *tid, pwr_eType *type, int *size,
int wb_vrepwbl::getTypeInfo( const char *name, pwr_tTid *tid, pwr_eType *type, int *size,
int *elements)
{
bool type_extern = false;
......@@ -535,7 +535,7 @@ int wb_vrepwbl::getClassInfo( pwr_tCid cid, int *rsize, int *dsize)
*elements = elem; }
int wb_vrepwbl::getAttrInfo( char *attr, int bix, pwr_tCid cid, int *size,
int wb_vrepwbl::getAttrInfo( const char *attr, int bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements, pwr_eType *type)
{
int a_size;
......@@ -758,7 +758,7 @@ int wb_vrepwbl::getAttrInfoRec( wb_attrname *attr, int bix, pwr_tCid cid, int *s
return 0;
}
int wb_vrepwbl::nameToOid( char *name, pwr_tOid *oid)
int wb_vrepwbl::nameToOid( const char *name, pwr_tOid *oid)
{
if ( strncmp( name, "_O", 2) == 0) {
cdh_StringToObjid( name, oid);
......@@ -895,12 +895,12 @@ int wb_vrepwbl::getTemplateBody( pwr_tCid cid, int bix, int *size, void **body)
return 0;
}
int wb_vrepwbl::load_files( char *file_spec)
int wb_vrepwbl::load_files( const char *file_spec)
{
char found_file[200];
int sts;
sts = dcli_search_file( file_spec, found_file, DCLI_DIR_SEARCH_INIT);
sts = dcli_search_file( (char *)file_spec, found_file, DCLI_DIR_SEARCH_INIT);
while( ODD(sts)) {
ifstream s(found_file);
......@@ -941,9 +941,9 @@ int wb_vrepwbl::load_files( char *file_spec)
return 0;
}
file_cnt++;
sts = dcli_search_file( file_spec, found_file, DCLI_DIR_SEARCH_NEXT);
sts = dcli_search_file( (char *)file_spec, found_file, DCLI_DIR_SEARCH_NEXT);
}
dcli_search_file( file_spec, found_file, DCLI_DIR_SEARCH_END);
dcli_search_file( (char *)file_spec, found_file, DCLI_DIR_SEARCH_END);
return 1;
}
......@@ -966,7 +966,7 @@ bool wb_vrepwbl::registerObject( pwr_tOix oix, ref_wblnode node)
return result.second;
}
void wb_vrepwbl::registerClass( char *name, pwr_tCid cid, ref_wblnode node)
void wb_vrepwbl::registerClass( const char *name, pwr_tCid cid, ref_wblnode node)
{
string sname(name);
......@@ -974,7 +974,7 @@ void wb_vrepwbl::registerClass( char *name, pwr_tCid cid, ref_wblnode node)
m_class_list[sname] = node;
}
void wb_vrepwbl::registerType( char *name, pwr_tTid tid, ref_wblnode node)
void wb_vrepwbl::registerType( const char *name, pwr_tTid tid, ref_wblnode node)
{
string sname(name);
......@@ -982,7 +982,7 @@ void wb_vrepwbl::registerType( char *name, pwr_tTid tid, ref_wblnode node)
m_type_list[sname] = node;
}
void wb_vrepwbl::registerVolume( char *name, pwr_tCid cid, pwr_tVid vid, ref_wblnode node)
void wb_vrepwbl::registerVolume( const char *name, pwr_tCid cid, pwr_tVid vid, ref_wblnode node)
{
m_vid = vid;
strcpy( volume_name, name);
......@@ -992,7 +992,7 @@ void wb_vrepwbl::registerVolume( char *name, pwr_tCid cid, pwr_tVid vid, ref_wbl
}
ref_wblnode wb_vrepwbl::find( char *name)
ref_wblnode wb_vrepwbl::find( const char *name)
{
wb_name oname(name);
......
......@@ -58,7 +58,7 @@ public:
wb_vrep *next() const;
virtual bool createSnapshot(char *fileName);
virtual bool createSnapshot(const char *fileName);
virtual void iterObject(wb_dbs *);
virtual void iterRbody(wb_dbs *);
......@@ -66,43 +66,43 @@ public:
#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 *,
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( char *fname);
int load_files( char *file_spec);
int load( const char *fname);
int load_files( const char *file_spec);
void info();
wb_wblfile *file[WBL_FILEMAX];
wb_wblnode *root_object;
void error( char *msg, char *file, int line_number);
ref_wblnode find( char *name);
void registerClass( char *name, pwr_tCid cid, ref_wblnode node);
void registerType( char *name, pwr_tTid tid, ref_wblnode node);
void registerVolume( char *name, pwr_tCid cid, pwr_tVid vid, ref_wblnode node);
void error( const char *msg, const char *file, int line_number);
ref_wblnode find( const char *name);
void registerClass( const char *name, pwr_tCid cid, ref_wblnode node);
void registerType( const char *name, pwr_tTid tid, ref_wblnode node);
void registerVolume( const char *name, pwr_tCid cid, pwr_tVid vid, ref_wblnode node);
bool registerObject( pwr_tOix oix, ref_wblnode node);
int nextOix() { return ++next_oix; }
int classNameToCid( char *name, pwr_tCid *cid);
int classNameToCid( const char *name, pwr_tCid *cid);
int getTemplateBody( pwr_tCid cid, int bix, int *size, void **body);
int getTypeInfo( pwr_tTid tid, pwr_eType *type, int *size,
int *elements);
int getTypeInfo( char *type, pwr_tTid *tid, pwr_eType *type, int *size,
int getTypeInfo( const char *type, pwr_tTid *tid, pwr_eType *type, int *size,
int *elements);
int getClassInfo( pwr_tCid cid, int *rsize, int *dsize);
int getAttrInfo( char *attr, int bix, pwr_tCid cid, int *size,
int getAttrInfo( const char *attr, int bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements, pwr_eType *type);
int getAttrInfoRec( wb_attrname *attr, int bix, pwr_tCid cid, int *size,
int *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int level);
ref_wblnode findObject( pwr_tOix oix);
ref_wblnode findClass( char *name);
ref_wblnode findType( char *name);
ref_wblnode findClass( const char *name);
ref_wblnode findType( const char *name);
ref_wblnode findClass( pwr_tCid cid);
ref_wblnode findType( pwr_tTid tid);
int nameToOid( char *name, pwr_tOid *oid);
int nameToOid( const char *name, pwr_tOid *oid);
int error_cnt;
int file_cnt;
......
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