Commit a4cfdf9e authored by lw's avatar lw

*** empty log message ***

parent fef5ed6b
#ifndef co_ccm_h #ifndef co_ccm_h
#define co_ccm_h #define co_ccm_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_ccm.h -- script interpreter /* co_ccm.h -- script interpreter
PROVIEW/R PROVIEW/R
...@@ -67,4 +71,8 @@ int ccm_set_external_var( ...@@ -67,4 +71,8 @@ int ccm_set_external_var(
char *value_string char *value_string
); );
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_cdh_h #ifndef co_cdh_h
#define co_cdh_h #define co_cdh_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_cdh.h -- class definition handler /* co_cdh.h -- class definition handler
PROVIEW/R PROVIEW/R
...@@ -845,4 +849,8 @@ cdh_NoCaseStrcmp ( ...@@ -845,4 +849,8 @@ cdh_NoCaseStrcmp (
const char *t const char *t
); );
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
%#ifndef co_dbs_h %#ifndef co_dbs_h
%#define co_dbs_h %#define co_dbs_h
% %
%#ifdef __cplusplus
%extern "C" {
%#endif
%
%/* co_dbs.h -- database snapshop files %/* co_dbs.h -- database snapshop files
% %
% PROVIEW/R % PROVIEW/R
...@@ -190,8 +194,8 @@ enum dbs_eSect { ...@@ -190,8 +194,8 @@ enum dbs_eSect {
dbs_eSect_oix = 3, dbs_eSect_oix = 3,
dbs_eSect_name = 6, dbs_eSect_name = 6,
dbs_eSect_dbody = 8, dbs_eSect_dbody = 8,
dbs_eSect_cref = 20, dbs_eSect_class = 10,
dbs_eSect_fixup = 9, dbs_eSect_fixup = 14,
dbs_eSect_ dbs_eSect_
}; };
...@@ -202,7 +206,7 @@ enum dbs_eSect { ...@@ -202,7 +206,7 @@ enum dbs_eSect {
%#define dbs_mSect_object pwr_Bit(dbs_eSect_object) %#define dbs_mSect_object pwr_Bit(dbs_eSect_object)
%#define dbs_mSect_rbody pwr_Bit(dbs_eSect_rbody) %#define dbs_mSect_rbody pwr_Bit(dbs_eSect_rbody)
%#define dbs_mSect_name pwr_Bit(dbs_eSect_name) %#define dbs_mSect_name pwr_Bit(dbs_eSect_name)
%#define dbs_mSect_cref pwr_Bit(dbs_eSect_cref) %#define dbs_mSect_class pwr_Bit(dbs_eSect_class)
%#define dbs_mSect_dbody pwr_Bit(dbs_eSect_dbody) %#define dbs_mSect_dbody pwr_Bit(dbs_eSect_dbody)
%#define dbs_mSect_fixup pwr_Bit(dbs_eSect_fixup) %#define dbs_mSect_fixup pwr_Bit(dbs_eSect_fixup)
% %
...@@ -432,7 +436,11 @@ struct dbs_sObject { ...@@ -432,7 +436,11 @@ struct dbs_sObject {
* Class Reference. * Class Reference.
*/ */
struct dbs_sCref { #ifdef PDR_HDR
%#define dbs_cVersionClass 1
#endif
struct dbs_sClass {
pwr_tCid cid; /**< class identifier */ pwr_tCid cid; /**< class identifier */
dbs_sQlink o_lh; /**< root of list of all object dbs_sQlink o_lh; /**< root of list of all object
of this class within this volume */ of this class within this volume */
...@@ -543,5 +551,9 @@ struct dbs_sName { ...@@ -543,5 +551,9 @@ struct dbs_sName {
%dbs_sEnv *dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename); %dbs_sEnv *dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename);
% %
% %
%#ifdef __cplusplus
%}
%#endif
%
%#endif %#endif
#endif #endif
#ifndef co_dcli_h #ifndef co_dcli_h
#define co_dcli_h #define co_dcli_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_dcli.c -- <short description> /* co_dcli.c -- <short description>
PROVIEW/R PROVIEW/R
...@@ -102,5 +106,8 @@ void dcli_readstruct_free( dcli_sStructElement *e_list); ...@@ -102,5 +106,8 @@ void dcli_readstruct_free( dcli_sStructElement *e_list);
int dcli_readstruct_get_message( char **message); int dcli_readstruct_get_message( char **message);
#ifdef __cplusplus
}
#endif #endif
#endif
#ifndef co_dcli_input_h #ifndef co_dcli_input_h
#define co_dcli_input_h #define co_dcli_input_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_dcli_input.h -- <short description> /* co_dcli_input.h -- <short description>
PROVIEW/R PROVIEW/R
...@@ -53,5 +57,8 @@ int dcli_qio_writew( dcli_sChannel *chn, char *buf, int len); ...@@ -53,5 +57,8 @@ int dcli_qio_writew( dcli_sChannel *chn, char *buf, int len);
int dcli_qio_write( dcli_sChannel *chn, int tmo, char *buf, int len); int dcli_qio_write( dcli_sChannel *chn, int tmo, char *buf, int len);
#ifdef __cplusplus
}
#endif #endif
#endif
#ifndef co_errno_h #ifndef co_errno_h
#define co_errno_h #define co_errno_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_errno.h -- Translate UNIX errno error codes. /* co_errno.h -- Translate UNIX errno error codes.
PROVIEW/R PROVIEW/R
...@@ -27,4 +32,8 @@ pwr_tStatus errno_Pstatus(int); ...@@ -27,4 +32,8 @@ pwr_tStatus errno_Pstatus(int);
pwr_tStatus errno_Status(int); pwr_tStatus errno_Status(int);
pwr_tStatus errno_GetStatus(); pwr_tStatus errno_GetStatus();
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_float_h
#define co_float_h
#ifdef __cplusplus
extern "C" {
#endif
/** /**
@file co_float.h @file co_float.h
Converts an IEEE float to a VAX float and vice verca. Converts an IEEE float to a VAX float and vice verca.
*/ */
#ifndef co_float_h
#define co_float_h
#include "co_pdr.h" #include "co_pdr.h"
...@@ -22,4 +26,8 @@ void co_ieee2vaxf(co_eBO sbo, /**< Source byte order, IEEE float */ ...@@ -22,4 +26,8 @@ void co_ieee2vaxf(co_eBO sbo, /**< Source byte order, IEEE float */
char *tp); /**< Address to the target, VAX float */ char *tp); /**< Address to the target, VAX float */
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_pdr_h #ifndef co_pdr_h
#define co_pdr_h #define co_pdr_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_pdr.h -- pdr routines /* co_pdr.h -- pdr routines
PROVIEW/R PROVIEW/R
...@@ -278,4 +283,8 @@ pdr_pwr_mAttrRef(PDR *pdrs, pwr_mAttrRef *objp); ...@@ -278,4 +283,8 @@ pdr_pwr_mAttrRef(PDR *pdrs, pwr_mAttrRef *objp);
pwr_tBoolean pwr_tBoolean
pdr_pwr_sAttrRef(PDR *pdrs, pwr_sAttrRef *objp); pdr_pwr_sAttrRef(PDR *pdrs, pwr_sAttrRef *objp);
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_platform_h #ifndef co_platform_h
#define co_platform_h #define co_platform_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_platform.h -- platform routines /* co_platform.h -- platform routines
PROVIEW/R PROVIEW/R
...@@ -191,4 +195,8 @@ co_mFormat *co_GetOwnFormat(co_mFormat *format); ...@@ -191,4 +195,8 @@ co_mFormat *co_GetOwnFormat(co_mFormat *format);
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_time_h #ifndef co_time_h
#define co_time_h #define co_time_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_time.h -- Time utilities /* co_time.h -- Time utilities
PROVIEW/R PROVIEW/R
...@@ -118,4 +123,8 @@ int eln_clock_getres (clockid_t, struct timespec*); ...@@ -118,4 +123,8 @@ int eln_clock_getres (clockid_t, struct timespec*);
#define clock_getres eln_clock_getres #define clock_getres eln_clock_getres
#endif #endif
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_tree_h #ifndef co_tree_h
#define co_tree_h #define co_tree_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_tree.h -- <short description> /* co_tree.h -- <short description>
PROVIEW/R PROVIEW/R
...@@ -156,4 +160,8 @@ tree_Comp_strncmp(tree_sTable *tp, tree_sNode *x, tree_sNode *y); ...@@ -156,4 +160,8 @@ tree_Comp_strncmp(tree_sTable *tp, tree_sNode *x, tree_sNode *y);
int int
tree_Comp_int32(tree_sTable *tp, tree_sNode *x, tree_sNode *y); tree_Comp_int32(tree_sTable *tp, tree_sNode *x, tree_sNode *y);
#ifdef __cplusplus
}
#endif
#endif #endif
#ifndef co_xdr_h #ifndef co_xdr_h
#define co_xdr_h #define co_xdr_h
#ifdef __cplusplus
extern "C" {
#endif
/* co_xdr.h -- xdr routines /* co_xdr.h -- xdr routines
PROVIEW/R PROVIEW/R
...@@ -213,4 +218,8 @@ xdr_pwr_mAttrRef(XDR *xdrs, pwr_mAttrRef *objp); ...@@ -213,4 +218,8 @@ xdr_pwr_mAttrRef(XDR *xdrs, pwr_mAttrRef *objp);
bool_t bool_t
xdr_pwr_sAttrRef(XDR *xdrs, pwr_sAttrRef *objp); xdr_pwr_sAttrRef(XDR *xdrs, pwr_sAttrRef *objp);
#ifdef __cplusplus
}
#endif
#endif #endif
This diff is collapsed.
#ifndef wb_dbs_h
#define wb_dbs_h
#include "pwr.h"
#include "co_pdr.h"
#include "co_dbs.h"
#include "co_tree.h"
#include "wb_status.h"
#include "wb_ldh.h"
typedef union {
struct {
pwr_tBit devOnly : 1;
pwr_tBit exist : 1;
} b;
pwr_tBitMask m;
#define mOentry_devOnly 1
#define mOentry_exist 2
} mOentry;
typedef struct sOentry sOentry;
typedef struct sNentry sNentry;
typedef struct sCentry sCentry;
struct sOentry {
tree_sNode node;
dbs_sObject o;
dbs_sBody rbody;
dbs_sBody dbody;
mOentry flags;
dbs_tRef ref;
sOentry *poep;
sOentry *boep;
sOentry *aoep;
sOentry *foep;
sOentry *loep;
sOentry *o_ll;
};
/* Name entry, used in name table. */
struct sNentry {
tree_sNode node;
dbs_sName n;
sOentry *oep;
};
struct sCentry {
tree_sNode node;
dbs_sClass c;
sOentry *o_lh; // Header of object list
sOentry *o_lt; // Tail of object list
};
class wb_vrep;
class wb_dbs : public wb_status
{
public:
FILE *m_fp; /**< file pointer */
char m_name[100]; /**< name of load file */
// wb_object *m_o; /* Volume object header. */
wb_vrep *m_v;
dbs_sVolume m_volume;
pwr_tOid m_oid;
dbs_sSect m_sect[dbs_eSect_]; /**< section header */
unsigned int m_warnings;
unsigned int m_errors;
sOentry *m_oep; /* object entry of volume object */
tree_sTable *m_oix_th;
tree_sTable *m_name_th;
tree_sTable *m_class_th;
wb_dbs();
wb_dbs(wb_vrep *);
~wb_dbs();
//wb_dbs& operator=(const wb_object&);
operator bool() const;
bool operator==(wb_dbs&);
void buildFile();
void buildSectName();
void buildSectClass();
void checkObject(sOentry *oep);
pwr_tStatus closeFile(pwr_tBoolean doDelete);
pwr_tBoolean createFile();
// 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();
pwr_tStatus writeSectDirectory();
pwr_tStatus writeSectVolume();
pwr_tStatus writeSectVolref();
pwr_tStatus writeSectOix();
pwr_tStatus writeSectObject();
pwr_tStatus writeSectRbody();
pwr_tStatus writeSectName();
pwr_tStatus writeSectClass();
pwr_tStatus writeSectDbody();
private:
};
#endif
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
bool isLocal(wb_object &o) const; bool isLocal(wb_object &o) const;
bool createSnapshot(char *fileName) { return false;} // Fix bool createSnapshot(char *fileName) { return m_vrep->createSnapshot(fileName);}
}; };
......
...@@ -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 "wb_erep.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"
...@@ -15,6 +15,7 @@ class wb_erep; ...@@ -15,6 +15,7 @@ class wb_erep;
class wb_srep; class wb_srep;
class wb_cdef; class wb_cdef;
class wb_destination; class wb_destination;
class wb_dbs;
class wb_vrep class wb_vrep
{ {
...@@ -85,6 +86,12 @@ public: ...@@ -85,6 +86,12 @@ public:
virtual pwr_tCid cid() const = 0; virtual pwr_tCid cid() const = 0;
virtual void name( char *n) { strcpy( m_name, n);} virtual void name( char *n) { strcpy( m_name, n);}
virtual char *name() { return m_name;} virtual char *name() { return m_name;}
virtual bool createSnapshot(char *fileName) = 0;
virtual void iterObject(wb_dbs *) = 0;
virtual void iterRbody(wb_dbs *) = 0;
virtual void iterDbody(wb_dbs *) = 0;
}; };
#endif #endif
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "wb_vrepwbl.h" #include "wb_vrepwbl.h"
#include "wb_orepwbl.h" #include "wb_orepwbl.h"
#include "wb_ldh_msg.h" #include "wb_ldh_msg.h"
#include "wb_dbs.h"
#include "wb_erep.h"
extern "C" { extern "C" {
#include "co_dcli.h" #include "co_dcli.h"
...@@ -67,21 +69,36 @@ void wb_vrepwbl::info() ...@@ -67,21 +69,36 @@ void wb_vrepwbl::info()
// rootAST[i]->info(0); // rootAST[i]->info(0);
} }
void wb_vrepwbl::iterObject( void *udata, bool
pwr_tStatus (*bc)( void *, wb_vrepwbl::createSnapshot(char *fileName)
pwr_tOid, pwr_tCid, pwr_tOid, pwr_tOid, {
pwr_tOid, pwr_tOid, pwr_tOid, char *, try {
pwr_tTime, int, int)) wb_dbs dbs(this);
dbs.buildFile();
return true;
} catch (wb_error e) {
return false;
}
}
void wb_vrepwbl::iterObject( wb_dbs *dbs)
{
if ( root_object)
root_object->iterObject( dbs);
}
void wb_vrepwbl::iterDbody( wb_dbs *dbs)
{ {
if ( root_object) if ( root_object)
root_object->iterObject( udata, bc); root_object->iterDbody( dbs);
} }
void wb_vrepwbl::iterBody( void *udata, void wb_vrepwbl::iterRbody( wb_dbs *dbs)
pwr_tStatus (*bc)( void *, pwr_tOid, void *, void *))
{ {
if ( root_object) if ( root_object)
root_object->iterBody( udata, bc); root_object->iterRbody( dbs);
} }
int wb_vrepwbl::load( char *fname) int wb_vrepwbl::load( char *fname)
......
...@@ -55,12 +55,19 @@ public: ...@@ -55,12 +55,19 @@ public:
wb_vrep *next() const; wb_vrep *next() const;
virtual bool createSnapshot(char *fileName);
virtual void iterObject(wb_dbs *);
virtual void iterRbody(wb_dbs *);
virtual void iterDbody(wb_dbs *);
#if 0
void iterObject( void *udata, void iterObject( void *udata,
pwr_tStatus (*bc)(void *,pwr_tOid, pwr_tCid, pwr_tOid, pwr_tOid, 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, char *,
pwr_tTime, int, int)); pwr_tTime, int, int));
void iterBody( void *udata, void iterBody( void *udata,
pwr_tStatus (*bc)(void *,pwr_tOid, void *, void *)); pwr_tStatus (*bc)(void *,pwr_tOid, void *, void *));
#endif
int load( char *fname); int load( char *fname);
int load_files( char *file_spec); int load_files( char *file_spec);
void info(); void info();
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include "wb_wblnode.h" #include "wb_wblnode.h"
#include "wb_vrepwbl.h" #include "wb_vrepwbl.h"
#include "wb_wblvocabTokenTypes.hpp" #include "wb_wblvocabTokenTypes.hpp"
#include "wb_dbs.h"
extern "C" { extern "C" {
#include "pwr_class.h" #include "pwr_class.h"
...@@ -1014,11 +1015,7 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol) ...@@ -1014,11 +1015,7 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
} }
void wb_wblnode::iterObject( void *udata, void wb_wblnode::iterObject( wb_dbs *dbs)
pwr_tStatus (*bc)(void *,
pwr_tOid, pwr_tCid, pwr_tOid, pwr_tOid,
pwr_tOid, pwr_tOid, pwr_tOid, char *,
pwr_tTime, int, int))
{ {
ref_wblnode o_lch = get_o_lch(); ref_wblnode o_lch = get_o_lch();
pwr_tOid fthoid = o_fth ? o_fth->m_oid : pwr_cNOid; pwr_tOid fthoid = o_fth ? o_fth->m_oid : pwr_cNOid;
...@@ -1027,26 +1024,36 @@ void wb_wblnode::iterObject( void *udata, ...@@ -1027,26 +1024,36 @@ void wb_wblnode::iterObject( void *udata,
pwr_tOid fchoid = o_fch ? o_fch->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; pwr_tOid lchoid = o_lch ? o_lch->m_oid : pwr_cNOid;
(bc)( udata, m_oid, m_cid, fthoid, fwsoid, bwsoid, fchoid, lchoid, name, dbs->installObject( m_oid, m_cid, fthoid, fwsoid, bwsoid, fchoid, lchoid, name, 0,
getFileTime(), rbody_size, dbody_size); getFileTime(), getFileTime(), getFileTime(), rbody_size, dbody_size);
if ( o_fch) if ( o_fch)
o_fch->iterObject( udata, bc); o_fch->iterObject( dbs);
if ( o_fws) if ( o_fws)
o_fws->iterObject( udata, bc); o_fws->iterObject( dbs);
} }
void wb_wblnode::iterBody( void *udata, void wb_wblnode::iterDbody( wb_dbs *dbs)
pwr_tStatus (*bc)(void *, pwr_tOid, void *, void *))
{ {
(bc)( udata, m_oid, rbody, dbody); dbs->installDbody( m_oid, dbody);
if ( o_fch) if ( o_fch)
o_fch->iterBody( udata, bc); o_fch->iterDbody( dbs);
if ( o_fws) if ( o_fws)
o_fws->iterBody( udata, bc); o_fws->iterDbody( dbs);
}
void wb_wblnode::iterRbody( wb_dbs *dbs)
{
dbs->installRbody( m_oid, rbody);
if ( o_fch)
o_fch->iterRbody( dbs);
if ( o_fws)
o_fws->iterRbody( dbs);
} }
void wb_wblnode::setFile( wb_wblfile *f) void wb_wblnode::setFile( wb_wblfile *f)
......
...@@ -13,6 +13,7 @@ ANTLR_USING_NAMESPACE(antlr) ...@@ -13,6 +13,7 @@ ANTLR_USING_NAMESPACE(antlr)
class wb_wblnode; class wb_wblnode;
class wb_vrepwbl; class wb_vrepwbl;
class wb_dbs;
#define wbl_cixToCid( Vid, Cix) (0 + (Vid << 16) + (Cix << 3)) #define wbl_cixToCid( Vid, Cix) (0 + (Vid << 16) + (Cix << 3))
#define wbl_tixToTid( Vid, Tyg, Tix) (0 + (Vid << 16) + (1 << 15) + (Tyg << 11) + Tix) #define wbl_tixToTid( Vid, Tyg, Tix) (0 + (Vid << 16) + (1 << 15) + (Tyg << 11) + Tix)
...@@ -172,12 +173,17 @@ public: ...@@ -172,12 +173,17 @@ public:
pwr_tCid Cid() { return c_cid;} pwr_tCid Cid() { return c_cid;}
int attrStringToValue( int type_id, char *value_str, int attrStringToValue( int type_id, char *value_str,
void *buffer_ptr, int buff_size, int attr_size); void *buffer_ptr, int buff_size, int attr_size);
void iterObject(wb_dbs *);
void iterRbody(wb_dbs *);
void iterDbody(wb_dbs *);
#if 0
void iterObject( void *udata, void iterObject( void *udata,
pwr_tStatus (*bc)(void *, pwr_tOid, pwr_tCid, pwr_tOid, pwr_tOid, 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, char *,
pwr_tTime, int, int)); pwr_tTime, int, int));
void iterBody( void *udata, void iterBody( void *udata,
pwr_tStatus (*bc)(void *, pwr_tOid, void *, void *)); pwr_tStatus (*bc)(void *, pwr_tOid, void *, void *));
#endif
static int lookup( int *type, const char *keyword, wbl_sSym *table); static int lookup( int *type, const char *keyword, wbl_sSym *table);
static int convconst( int *val, char *str); static int convconst( int *val, 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