Commit a2237ffd authored by claes's avatar claes

*** empty log message ***

parent aba29ae0
......@@ -133,7 +133,7 @@ void *wnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
if ( strcmp( link, "") != 0) {
char fname[200];
if ( (strstr( link, ".htm") == 0) || (strstr( link, ".pdf") == 0)) {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
strcpy( fname, link);
}
else {
......@@ -181,7 +181,7 @@ void *wnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
{
char fname[200];
if ( strcmp( link, "") != 0) {
if ( (strstr( link, ".htm") == 0) || (strstr( link, ".pdf") == 0)) {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
strcpy( fname, link);
}
else {
......
......@@ -12,12 +12,7 @@ Volume wb pwr_eClass_WorkBenchVolume 254.254.254.254
EndVolume
SObject wb:
Object layout $PlantHier
EndObject
EndSObject
SObject wb:layout
Object Lists $DocHier
Object Lists $PlantHier
Object ListConfig ListConfig
EndObject
Object ChannelList ListDescriptor
......
......@@ -3,3 +3,4 @@ pwrb 0.0.0.2
nmps 0.0.1.1
tlog 0.0.1.2
ssab 0.0.1.3
wb 254.254.254.254
\ No newline at end of file
......@@ -353,7 +353,7 @@ pwr_eBix wb_attribute::bix() const
{
check();
if (m_flags & PWR_MASK_SUBCLASS)
if (!m_adrep || m_flags & PWR_MASK_SUBCLASS)
return m_bix;
return m_adrep->bix();
......
......@@ -811,6 +811,8 @@ static void foe_destroy(
if ( foectx->set_focus_disabled)
XtRemoveTimeOut( foectx->focus_timerid);
foectx->grectx->window_object->hw.foectx = 0;
/* Delete controled modules */
gre_del( foectx->grectx);
pal_del( foectx->node_palctx);
......
......@@ -11,6 +11,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include <time.h>
#include <assert.h>
#include <stdarg.h>
#include <fstream.h>
#ifdef OS_VMS
#include <descrip.h>
#include <libdef.h>
......@@ -24,6 +25,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include "pwr_class.h"
#include "wb_ldh_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "pwr_vararg.h"
#include "co_ver.h"
#include "rt_gdh.h"
......@@ -37,6 +39,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include "wb_volume.h"
#include "wb_error.h"
#include "wb_vrepmem.h"
#include "wb_print_wbl.h"
#include "pwr_baseclasses.h"
#include <X11/Intrinsic.h>
......@@ -363,7 +366,7 @@ ldh_CreateObject(ldh_tSession session, pwr_tOid *oid, char *name, pwr_tCid cid,
wb_object d_o = wb_object();
wb_destination d = wb_destination( doid, dest);
wb_object o = sp->createObject(cdef, d, n);
if (!o) return o.sts();
if (!o) return sp->sts();
*oid = o.oid();
return o.sts();
......@@ -372,7 +375,7 @@ ldh_CreateObject(ldh_tSession session, pwr_tOid *oid, char *name, pwr_tCid cid,
wb_object d_o = sp->object(doid);
wb_destination d = d_o.destination(dest);
wb_object o = sp->createObject(cdef, d, n);
if (!o) return o.sts();
if (!o) return sp->sts();
*oid = o.oid();
return o.sts();
......@@ -409,7 +412,8 @@ ldh_DeleteObject(ldh_tSession session, pwr_tOid oid)
wb_object o = sp->object(oid);
if (!o) return o.sts();
return sp->deleteObject(o);
sp->deleteObject(o);
return sp->sts();
}
pwr_tStatus
......@@ -895,7 +899,8 @@ ldh_MoveObject(ldh_tSession session, pwr_tOid oid, pwr_tOid doid, ldh_eDest dest
if (!o) return o.sts();
wb_destination d = d_o.destination(dest);
return sp->moveObject(o, d);
sp->moveObject(o, d);
return sp->sts();
}
pwr_tStatus
......@@ -917,10 +922,8 @@ pwr_tStatus
ldh_NameToObjid(ldh_tSession session, pwr_tOid *oid, char *name)
{
wb_session *sp = (wb_session *)session;
wb_name n = wb_name(name);
if ( n.evenSts()) return n.sts();
wb_object o = sp->object(n);
wb_object o = sp->object(name);
if (!o) return o.sts();
*oid = o.oid();
......@@ -1237,8 +1240,8 @@ pwr_tStatus
ldh_SetObjectBody(ldh_tSession session, pwr_tOid oid, char *bname, char *value, int size)
{
wb_session *sp = (wb_session *)session;
wb_object o = sp->object(oid);
wb_attribute a = sp->attribute(o, bname);
wb_attribute a = sp->attribute( oid, bname);
if ( !a) return a.sts();
try {
sp->writeAttribute(a, value);
......@@ -1441,6 +1444,52 @@ ldh_Paste(ldh_tSession session, pwr_tOid doid, ldh_eDest dest, int keepoid, char
pwr_tStatus
ldh_CreateLoadFile(ldh_tSession session)
{
return LDH__NYI;
wb_session *sp = (wb_session*)session;
try {
sp->createSnapshot( 0);
}
catch (wb_error& e) {
return e.sts();
}
return sp->sts();
}
pwr_tStatus
ldh_WbDump (
ldh_tSession session,
char *objname,
char *dumpfile
)
{
wb_session *sp = (wb_session*)session;
char fname[200];
dcli_translate_filename( fname, dumpfile);
ofstream fp( fname);
if ( !fp) return LDH__FILEOPEN;
try {
wb_print_wbl wprint( fp);
if ( !objname)
wprint.printVolume( *sp);
else {
wb_object o = sp->object( objname);
wprint.printHierarchy( *sp, o);
}
}
catch ( wb_error& e) {
return e.sts();
}
return LDH__SUCCESS;
}
#endif
......@@ -954,6 +954,13 @@ ldh_CreateLoadFile(
ldh_tSession session
);
pwr_tStatus
ldh_WbDump(
ldh_tSesContext ldhses,
char *objname,
char *dumpfile
);
#ifdef __cplusplus
}
#endif
......
......@@ -68,13 +68,32 @@ wb_object wb_session::createObject(wb_cdef cdef, wb_destination d, wb_name name)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
wb_object parent;
switch ( d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
m_sts = triggAnteCreate( parent, cdef.cid());
if ( evenSts()) return wb_object();
m_sts = triggAnteAdopt( parent, cdef.cid());
if ( evenSts()) return wb_object();
orep = m_vrep->createObject(&m_sts, cdef, d, name);
wb_object o = wb_object(m_sts, orep);
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily( ep, o);
// sts = triggPostCreate( orep);
// sts = triggPostAdopt( father, orep);
triggPostCreate( o);
triggPostAdopt( parent, o);
m_srep->eventSend( ep);
return o;
}
......@@ -86,13 +105,35 @@ wb_object wb_session::copyObject(wb_object o, wb_destination d, wb_name name)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
wb_object parent;
switch ( d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
m_sts = triggAnteCreate( parent, o.cid());
if ( evenSts()) return wb_object();
m_sts = triggAnteAdopt( parent, o.cid());
if ( evenSts()) return wb_object();
orep = m_vrep->copyObject(&m_sts, (wb_orep*)o, d, name);
ldh_sEvent *ep = m_srep->eventStart( orep->oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily( ep, o);
wb_object onew = wb_object(m_sts, orep);
ldh_sEvent *ep = m_srep->eventStart( onew.oid(), ldh_eEvent_ObjectCreated);
m_srep->eventNewFamily( ep, onew);
triggPostCreate( onew);
triggPostAdopt( parent, onew);
m_srep->eventSend( ep);
return wb_object(m_sts, orep);
return onew;
}
bool wb_session::moveObject(wb_object o, wb_destination d)
......@@ -100,15 +141,41 @@ bool wb_session::moveObject(wb_object o, wb_destination d)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
wb_object parent;
switch ( d.code()) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( d.oid());
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( d.oid()).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
wb_object old_parent = o.parent();
m_sts = triggAnteMove( o, parent);
if ( evenSts()) return false;
m_sts = triggAnteUnadopt( old_parent, o);
if ( evenSts()) return false;
m_sts = triggAnteAdopt( parent, o.cid());
if ( evenSts()) return false;
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectMoved);
m_srep->eventOldFamily( ep, o);
bool sts = m_vrep->moveObject(&m_sts, (wb_orep*)o, d);
bool rsts = m_vrep->moveObject(&m_sts, (wb_orep*)o, d);
triggPostMove( o);
triggPostUnadopt( old_parent, o);
triggPostAdopt( parent, o);
m_srep->eventNewFamily( ep, o);
m_srep->eventSend( ep);
return sts;
return rsts;
}
......@@ -129,19 +196,27 @@ bool wb_session::deleteObject(wb_object o)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
return m_vrep->deleteObject(&m_sts, (wb_orep*)o);
/*
if (!o.isLocal())
return LDH__OTHERVOLUME;
if (o.hasChild())
return LDH__HAS_CHILD;
if (!isLocal( o)) {
m_sts = LDH__OTHERVOLUME;
return false;
}
if ( o.first()) {
m_sts = LDH__HAS_CHILD;
return false;
}
o.triggAnteUnadopt();
o.unaAdopt();
o.triggPostUnadopt();
*/
pwr_tStatus sts;
wb_object parent = o.parent();
sts = triggAnteUnadopt( parent, o);
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectDeleted);
m_srep->eventOldFamily( ep, o);
sts = triggPostUnadopt( parent, o);
bool rsts = m_vrep->deleteObject(&m_sts, (wb_orep*)o);
m_srep->eventSend( ep);
return rsts;
}
bool wb_session::deleteFamily(wb_object o)
......@@ -149,7 +224,23 @@ bool wb_session::deleteFamily(wb_object o)
if (isReadonly())
throw wb_error_str("ReadOnlySession");
return m_vrep->deleteFamily(&m_sts, (wb_orep*)o);
if (!isLocal( o)) {
m_sts = LDH__OTHERVOLUME;
return false;
}
pwr_tStatus sts;
wb_object parent = o.parent();
sts = triggAnteUnadopt( parent, o);
ldh_sEvent *ep = m_srep->eventStart( o.oid(), ldh_eEvent_ObjectDeleted);
m_srep->eventOldFamily( ep, o);
sts = triggPostUnadopt( parent, o);
bool rsts = m_vrep->deleteFamily(&m_sts, (wb_orep*)o);
m_srep->eventSend( ep);
return rsts;
}
bool wb_session::writeAttribute(wb_attribute &a, void *p, size_t size)
......@@ -302,7 +393,44 @@ bool wb_session::pasteOset( pwr_tOid doid, ldh_eDest dest,
m_sts = LDH__PASTESELF;
return false;
}
mem->exportPaste( *m_vrep, doid, dest, keepoid);
// Trigg ante adopt
wb_object parent;
switch ( dest) {
case ldh_eDest_IntoFirst:
case ldh_eDest_IntoLast:
parent = object( doid);
break;
case ldh_eDest_After:
case ldh_eDest_Before:
parent = object( doid).parent();
break;
default:
throw wb_error(LDH__NODEST);
}
if ( parent) {
pwr_tStatus sts;
wb_orep *orep = mem->object( &sts);
while( ODD(sts)) {
orep->ref();
m_sts = triggAnteAdopt( parent, orep->cid());
if ( evenSts()) return false;
wb_orep *prev = orep;
orep = orep->after( &sts);
prev->unref();
}
}
pwr_tOid *olist;
mem->exportPaste( *m_vrep, doid, dest, keepoid, &olist);
if ( parent) {
for ( pwr_tOid *oidp = olist; cdh_ObjidIsNotNull(*oidp); oidp++) {
wb_object o = object(*oidp);
triggPostAdopt( parent, o);
}
}
free( olist);
if ( dest == ldh_eDest_After || dest == ldh_eDest_Before)
doid = pwr_cNOid;
......
......@@ -32,9 +32,10 @@ public:
size_t rbSize, size_t dbSize, void *rbody, void *dbody) = 0;
virtual bool importPaste() = 0;
virtual bool importPasteObject(pwr_tOid destination, ldh_eDest destcode, bool keepoid,
pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody) = 0;
pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid) = 0;
bool importTranslationTableInsert( pwr_tOix from, pwr_tOix to);
void importTranslationTableClear();
pwr_tOix importTranslate( pwr_tOix oix);
......
......@@ -44,7 +44,6 @@
#include "co_time.h"
#include "co_dcli.h"
#include "wb_ldh.h"
#include "wb_ldhdump.h"
#include "wb_ldh_msg.h"
#include "wb_foe_msg.h"
#include "wb_vldh_msg.h"
......@@ -3229,94 +3228,6 @@ pwr_tStatus utl_show_volumes(
return FOE__SUCCESS;
}
/*************************************************************************
*
* Name: utl_show_objects_hier_class_name()
*
* Type int
*
* Type Parameter IOGF Description
* ldh_tSesContext ldhses I ldh session.
* char * hiername I Name of a object in the hierarchy.
* char * class I Name of the class.
*
*
* Description: Prints all objects of a specified class that is found
* below a specific object in the hierarchy.
*
**************************************************************************/
int utl_wb_dump(
ldh_tSesContext ldhses,
int i_flag,
int n_flag,
int h_flag,
int r_flag,
int indchr_arg,
char *objname,
char *dumpfile,
char *volume
)
{
int sts, i;
char vol_str[UTL_INPUTLIST_MAX + 1][80];
pwr_tVolumeId volume_vect[UTL_INPUTLIST_MAX + 1];
pwr_tVolumeId *volume_p;
pwr_tClassId vol_class;
pwr_tVolumeId vol_id;
int nr;
if ( !h_flag && !r_flag)
{
if ( volume != NULL)
{
/* Parse the volumestr */
nr = utl_parse( volume, ", ", "", (char *)vol_str,
sizeof( vol_str) / sizeof( vol_str[0]), sizeof( vol_str[0]));
if ( (nr == 0) || ( nr > UTL_INPUTLIST_MAX))
return FOE__PARSYNT;
for ( i = 0; i < nr; i++)
{
sts = ldh_VolumeNameToId( ldh_SessionToWB( ldhses), vol_str[i],
&volume_vect[i]);
if ( EVEN(sts)) return sts;
}
volume_vect[nr] = 0;
volume_p = volume_vect;
}
else
{
/* Get all volumes that is not class and wb volumes */
i = 0;
sts = ldh_GetVolumeList( ldh_SessionToWB( ldhses), &vol_id);
while ( ODD(sts) )
{
sts = ldh_GetVolumeClass( ldh_SessionToWB( ldhses), vol_id,
&vol_class);
if (EVEN(sts)) return sts;
if ( vol_class != pwr_eClass_ClassVolume)
{
volume_vect[i] = vol_id;
i++;
if ( i > UTL_INPUTLIST_MAX)
return FOE__PARSYNT;
}
sts = ldh_GetNextVolume( ldh_SessionToWB( ldhses), vol_id, &vol_id);
}
volume_vect[i] = 0;
volume_p = volume_vect;
}
}
else
volume_p = NULL;
sts = ldh_ldhdump( ldhses, i_flag, n_flag, h_flag, r_flag, indchr_arg,
objname, dumpfile, volume_p);
return sts;
}
/*************************************************************************
*
......
......@@ -487,18 +487,6 @@ pwr_tStatus utl_show_volumes(
int allvolumes
);
int utl_wb_dump(
ldh_tSesContext ldhses,
int i_flag,
int n_flag,
int h_flag,
int r_flag,
int indchr_arg,
char *objname,
char *dumpfile,
char *volume
);
int utl_revert (
ldh_tSesContext ldhses,
int confirm
......
......@@ -306,53 +306,47 @@ pwr_tStatus wb_volume::syntaxCheck( int *errorcount, int *warningcount)
{
pwr_tStatus sts;
wb_orep *orep = m_vrep->object(&sts);
if ( ODD(sts)) {
orep->ref();
sts = syntaxCheckObject( orep, errorcount, warningcount);
orep->unref();
wb_object o = object();
if ( o) {
sts = syntaxCheckObject( o, errorcount, warningcount);
return sts;
}
return LDH__SUCCESS;
}
pwr_tStatus wb_volume::syntaxCheckObject( wb_orep *orep, int *errorcount, int *warningcount)
pwr_tStatus wb_volume::syntaxCheckObject( wb_object& o, int *errorcount, int *warningcount)
{
pwr_tStatus sts;
wb_orep *first, *after;
wb_object first, after;
sts = triggSyntaxCheck( orep, errorcount, warningcount);
sts = triggSyntaxCheck( o, errorcount, warningcount);
if ( EVEN(sts)) return sts;
switch ( orep->cid()) {
switch ( o.cid()) {
case pwr_eClass_LibHier:
break;
default:
first = orep->first( &sts);
if ( ODD(sts)) {
first->ref();
first = o.first();
if ( first) {
sts = syntaxCheckObject( first, errorcount, warningcount);
first->unref();
if ( EVEN(sts)) return sts;
}
after = orep->after( &sts);
if ( ODD(sts)) {
after->ref();
after = o.after();
if ( after) {
sts = syntaxCheckObject( after, errorcount, warningcount);
after->unref();
if ( EVEN(sts)) return sts;
}
}
return LDH__SUCCESS;
}
pwr_tStatus wb_volume::triggSyntaxCheck( wb_orep *orep, int *errorcount, int *warningcount)
pwr_tStatus wb_volume::triggSyntaxCheck( wb_object& o, int *errorcount, int *warningcount)
{
pwr_tStatus sts;
char methodName[] = "SyntaxCheck";
wb_tMethod method;
// wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, orep->cid());
// wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, o.cid());
// if ( EVEN(sts)) return sts;
// cdrep->dbCallBack( &sts, ldh_eDbCallBack_SyntaxCheck, &methodName, 0);
......@@ -362,17 +356,20 @@ pwr_tStatus wb_volume::triggSyntaxCheck( wb_orep *orep, int *errorcount, int *wa
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodSyntaxCheck) (method))( (ldh_tSesContext)this, orep->oid(), errorcount, warningcount);
sts = ((wb_tMethodSyntaxCheck) (method))( (ldh_tSesContext)this, o.oid(), errorcount, warningcount);
return sts;
}
pwr_tStatus wb_volume::triggAnteAdopt( wb_orep *father, pwr_tCid cid)
pwr_tStatus wb_volume::triggAnteAdopt( wb_object& father, pwr_tCid cid)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father->cid());
if ( !father)
return LDH__SUCCESS;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_AnteAdopt, &methodName, 0);
......@@ -382,11 +379,11 @@ pwr_tStatus wb_volume::triggAnteAdopt( wb_orep *father, pwr_tCid cid)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodAnteAdopt) (method))( (ldh_tSesContext)this, father->oid(), cid);
sts = ((wb_tMethodAnteAdopt) (method))( (ldh_tSesContext)this, father.oid(), cid);
return sts;
}
pwr_tStatus wb_volume::triggAnteCreate( wb_orep *father, pwr_tCid cid)
pwr_tStatus wb_volume::triggAnteCreate( wb_object& father, pwr_tCid cid)
{
pwr_tStatus sts;
char *methodName;
......@@ -405,17 +402,17 @@ pwr_tStatus wb_volume::triggAnteCreate( wb_orep *father, pwr_tCid cid)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodAnteCreate) (method))( (ldh_tSesContext)this, father->oid(), cid);
sts = ((wb_tMethodAnteCreate) (method))( (ldh_tSesContext)this, father.oid(), cid);
return sts;
}
pwr_tStatus wb_volume::triggAnteMove( wb_orep *orep, wb_orep *father)
pwr_tStatus wb_volume::triggAnteMove( wb_object& o, wb_object& father)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, orep->cid());
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, o.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_AnteCreate, &methodName, 0);
......@@ -426,21 +423,24 @@ pwr_tStatus wb_volume::triggAnteMove( wb_orep *orep, wb_orep *father)
if ( EVEN(sts)) return LDH__SUCCESS;
if ( father)
sts = ((wb_tMethodAnteMove) (method))( (ldh_tSesContext)this, orep->oid(), father->oid(),
father->cid());
sts = ((wb_tMethodAnteMove) (method))( (ldh_tSesContext)this, o.oid(), father.oid(),
father.cid());
else
sts = ((wb_tMethodAnteMove) (method))( (ldh_tSesContext)this, orep->oid(), pwr_cNObjid,
sts = ((wb_tMethodAnteMove) (method))( (ldh_tSesContext)this, o.oid(), pwr_cNObjid,
pwr_cNClassId);
return sts;
}
pwr_tStatus wb_volume::triggAnteUnadopt( wb_orep *father, wb_orep *orep)
pwr_tStatus wb_volume::triggAnteUnadopt( wb_object& father, wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father->cid());
if ( !father)
return LDH__SUCCESS;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_AnteCreate, &methodName, 0);
......@@ -450,18 +450,21 @@ pwr_tStatus wb_volume::triggAnteUnadopt( wb_orep *father, wb_orep *orep)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodAnteUnadopt) (method))( (ldh_tSesContext)this, father->oid(), orep->oid(),
orep->cid());
sts = ((wb_tMethodAnteUnadopt) (method))( (ldh_tSesContext)this, father.oid(), o.oid(),
o.cid());
return sts;
}
pwr_tStatus wb_volume::triggPostAdopt( wb_orep *father, wb_orep *orep)
pwr_tStatus wb_volume::triggPostAdopt( wb_object& father, wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father->cid());
if ( !father)
return LDH__SUCCESS;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_PostAdopt, &methodName, 0);
......@@ -471,18 +474,18 @@ pwr_tStatus wb_volume::triggPostAdopt( wb_orep *father, wb_orep *orep)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodPostAdopt) (method))( (ldh_tSesContext)this, father->oid(), orep->oid(),
orep->cid());
sts = ((wb_tMethodPostAdopt) (method))( (ldh_tSesContext)this, father.oid(), o.oid(),
o.cid());
return sts;
}
pwr_tStatus wb_volume::triggPostCreate( wb_orep *orep)
pwr_tStatus wb_volume::triggPostCreate( wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, orep->cid());
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, o.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_PostCreate, &methodName, 0);
......@@ -492,26 +495,24 @@ pwr_tStatus wb_volume::triggPostCreate( wb_orep *orep)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
wb_orep *father = orep->parent( &sts);
if ( ODD(sts)) {
father->ref();
sts = ((wb_tMethodPostCreate) (method))( (ldh_tSesContext)this, orep->oid(), father->oid(),
father->cid());
father->unref();
wb_object father = o.parent();
if ( father) {
sts = ((wb_tMethodPostCreate) (method))( (ldh_tSesContext)this, o.oid(), father.oid(),
father.cid());
}
else
sts = ((wb_tMethodPostCreate) (method))( (ldh_tSesContext)this, orep->oid(), pwr_cNObjid,
sts = ((wb_tMethodPostCreate) (method))( (ldh_tSesContext)this, o.oid(), pwr_cNObjid,
pwr_cNClassId);
return sts;
}
pwr_tStatus wb_volume::triggPostMove( wb_orep *orep)
pwr_tStatus wb_volume::triggPostMove( wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, orep->cid());
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, o.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_PostMove, &methodName, 0);
......@@ -521,26 +522,27 @@ pwr_tStatus wb_volume::triggPostMove( wb_orep *orep)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
wb_orep *father = orep->parent( &sts);
if ( ODD(sts)) {
father->ref();
sts = ((wb_tMethodPostMove) (method))( (ldh_tSesContext)this, orep->oid(), father->oid(),
father->cid());
father->unref();
wb_object father = o.parent();
if ( father) {
sts = ((wb_tMethodPostMove) (method))( (ldh_tSesContext)this, o.oid(), father.oid(),
father.cid());
}
else
sts = ((wb_tMethodPostMove) (method))( (ldh_tSesContext)this, orep->oid(), pwr_cNObjid,
sts = ((wb_tMethodPostMove) (method))( (ldh_tSesContext)this, o.oid(), pwr_cNObjid,
pwr_cNClassId);
return sts;
}
pwr_tStatus wb_volume::triggPostUnadopt( wb_orep *father, wb_orep *orep)
pwr_tStatus wb_volume::triggPostUnadopt( wb_object& father, wb_object& o)
{
pwr_tStatus sts;
char *methodName;
wb_tMethod method;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father->cid());
if ( !father)
return LDH__SUCCESS;
wb_cdrep *cdrep = m_vrep->merep()->cdrep( &sts, father.cid());
if ( EVEN(sts)) return sts;
cdrep->dbCallBack( &sts, ldh_eDbCallBack_PostUnadopt, &methodName, 0);
......@@ -550,8 +552,8 @@ pwr_tStatus wb_volume::triggPostUnadopt( wb_orep *father, wb_orep *orep)
m_vrep->erep()->method( &sts, methodName, &method);
if ( EVEN(sts)) return LDH__SUCCESS;
sts = ((wb_tMethodPostUnadopt) (method))( (ldh_tSesContext)this, father->oid(), orep->oid(),
orep->cid());
sts = ((wb_tMethodPostUnadopt) (method))( (ldh_tSesContext)this, father.oid(), o.oid(),
o.cid());
return sts;
}
......@@ -560,3 +562,7 @@ pwr_tStatus wb_volume::triggPostUnadopt( wb_orep *father, wb_orep *orep)
......@@ -81,16 +81,16 @@ public:
bool exportTree( wb_volume &import, pwr_tOid oid);
pwr_tStatus syntaxCheck( int *errorcount, int *warningcount);
pwr_tStatus syntaxCheckObject( wb_orep *orep, int *errorcount, int *warningcount);
pwr_tStatus triggSyntaxCheck( wb_orep *orep, int *errorcount, int *warningcount);
pwr_tStatus triggAnteAdopt( wb_orep *orep, pwr_tCid cid);
pwr_tStatus triggAnteCreate( wb_orep *father, pwr_tCid cid);
pwr_tStatus triggAnteMove( wb_orep *orep, wb_orep *father);
pwr_tStatus triggAnteUnadopt( wb_orep *father, wb_orep *orep);
pwr_tStatus triggPostAdopt( wb_orep *father, wb_orep *orep);
pwr_tStatus triggPostCreate( wb_orep *orep);
pwr_tStatus triggPostMove( wb_orep *orep);
pwr_tStatus triggPostUnadopt( wb_orep *father, wb_orep *orep);
pwr_tStatus syntaxCheckObject( wb_object& o, int *errorcount, int *warningcount);
pwr_tStatus triggSyntaxCheck( wb_object& o, int *errorcount, int *warningcount);
pwr_tStatus triggAnteAdopt( wb_object& o, pwr_tCid cid);
pwr_tStatus triggAnteCreate( wb_object& father, pwr_tCid cid);
pwr_tStatus triggAnteMove( wb_object& o, wb_object& father);
pwr_tStatus triggAnteUnadopt( wb_object& father, wb_object& o);
pwr_tStatus triggPostAdopt( wb_object& father, wb_object& o);
pwr_tStatus triggPostCreate( wb_object& o);
pwr_tStatus triggPostMove( wb_object& o);
pwr_tStatus triggPostUnadopt( wb_object& father, wb_object& o);
};
#endif
......
......@@ -131,7 +131,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{ return false;}
#if 0
......
......@@ -141,7 +141,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{ return false;}
virtual bool accessSupported( ldh_eAccess access) { return access == ldh_eAccess_ReadOnly; }
......
......@@ -581,6 +581,8 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
switch ( code) {
case ldh_eDest_IntoFirst:
memo->fws = dest->fch;
if ( dest->fch)
dest->fch->bws = memo;
dest->fch = memo;
memo->fth = dest;
break;
......@@ -598,6 +600,8 @@ wb_orep *wb_vrepmem::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
case ldh_eDest_After:
memo->fws = dest->fws;
memo->bws = dest;
if ( dest->fws)
dest->fws->bws = memo;
dest->fws = memo;
memo->fth = dest->fth;
break;
......@@ -682,6 +686,8 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
switch ( code) {
case ldh_eDest_IntoFirst:
memo->fws = dest->fch;
if ( dest->fch)
dest->fch->bws = memo;
dest->fch = memo;
memo->fth = dest;
break;
......@@ -699,6 +705,8 @@ wb_orep *wb_vrepmem::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
case ldh_eDest_After:
memo->fws = dest->fws;
memo->bws = dest;
if ( dest->fws)
dest->fws->bws = memo;
dest->fws = memo;
memo->fth = dest->fth;
break;
......@@ -766,6 +774,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
switch ( code) {
case ldh_eDest_IntoFirst:
memo->fws = dest->fch;
if ( dest->fch)
dest->fch->bws = memo;
dest->fch = memo;
memo->fth = dest;
break;
......@@ -783,6 +793,8 @@ bool wb_vrepmem::moveObject(pwr_tStatus *sts, wb_orep *orep, wb_destination &d)
case ldh_eDest_After:
memo->fws = dest->fws;
memo->bws = dest;
if ( dest->fws)
dest->fws->bws = memo;
dest->fws = memo;
memo->fth = dest->fth;
break;
......@@ -1143,7 +1155,8 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{
mem_object *memo = new mem_object();
strcpy( memo->m_name, name);
......@@ -1256,6 +1269,7 @@ bool wb_vrepmem::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
registerObject( memo->m_oid.oix, memo);
importTranslationTableInsert( oid.oix, memo->m_oid.oix);
*roid = memo->m_oid;
return true;
}
......@@ -1277,10 +1291,17 @@ bool wb_vrepmem::exportTree(wb_treeimport &i, pwr_tOid oid)
}
bool wb_vrepmem::exportPaste(wb_treeimport &i, pwr_tOid destination, ldh_eDest destcode,
bool keepoid)
bool keepoid, pwr_tOid **rootlist)
{
// Count number of topobjects
int top_cnt = 0;
for ( mem_object *top = root_object; top; top = top->fws)
top_cnt++;
*rootlist = (pwr_tOid *) calloc( top_cnt + 1, sizeof(pwr_tOid));
if ( root_object) {
root_object->exportPaste( i, destination, true, destcode, keepoid);
root_object->exportPaste( i, destination, true, destcode, keepoid, *rootlist);
i.importPaste();
}
return true;
......
......@@ -56,19 +56,22 @@ class mem_object
return true;
}
bool exportPaste( wb_treeimport &i, pwr_tOid destination, bool isRoot, ldh_eDest destcode,
bool keepoid) {
bool exportPaste( wb_treeimport &i, pwr_tOid destination, bool isRoot,
ldh_eDest destcode, bool keepoid, pwr_tOid *rootlist) {
pwr_tOid fthoid = (fth && !isRoot) ? fth->m_oid : pwr_cNOid;
pwr_tOid bwsoid = (bws && !isRoot) ? bws->m_oid : pwr_cNOid;
pwr_tOid oid;
i.importPasteObject( destination, destcode, keepoid, m_oid, m_cid, fthoid, bwsoid,
name(), rbody_size, dbody_size, rbody, dbody);
name(), rbody_size, dbody_size, rbody, dbody, &oid);
if ( rootlist)
*rootlist++ = oid;
if ( fch)
fch->exportPaste( i, destination, false, destcode, keepoid);
fch->exportPaste( i, destination, false, destcode, keepoid, 0);
if ( fws)
fws->exportPaste( i, destination, false, destcode, keepoid);
fws->exportPaste( i, destination, false, destcode, keepoid, rootlist);
return true;
}
......@@ -226,7 +229,8 @@ public:
virtual bool exportDbody(wb_import &i);
virtual bool exportMeta(wb_import &i);
virtual bool exportTree(wb_treeimport &i, pwr_tOid oid);
bool exportPaste(wb_treeimport &i, pwr_tOid destination, ldh_eDest destcode, bool keepoid);
bool exportPaste(wb_treeimport &i, pwr_tOid destination, ldh_eDest destcode, bool keepoid,
pwr_tOid **rootlist);
virtual bool importTreeObject(wb_merep *merep, pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody);
......@@ -235,7 +239,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody);
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid);
virtual bool importPaste();
bool updateObject( wb_orep *o, bool keepref);
bool updateSubClass( wb_adrep *subattr, char *body, bool keepref);
......
......@@ -194,7 +194,8 @@ public:
bool keepoid, pwr_tOid oid,
pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, const char *name,
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
pwr_tOid *roid)
{ return false;}
virtual bool accessSupported( ldh_eAccess access) { return access == ldh_eAccess_ReadOnly;}
};
......
......@@ -1760,6 +1760,8 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
&objid,
0, classid, ((WItemObject *)item)->objid,
destcode);
if (EVEN(sts))
wnav->message('E', wnav_get_message(sts));
break;
default:
;
......@@ -1769,6 +1771,8 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
// Create toplevel object
sts = ldh_CreateObject( wnav->ldhses, &objid,
0, classid, pwr_cNObjid, ldh_eDest_IntoLast);
if (EVEN(sts))
wnav->message('E', wnav_get_message(sts));
}
}
else
......@@ -1789,8 +1793,10 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
{
sts = ldh_MoveObject( wnav->ldhses, sel_list->Objid,
item->objid, destcode);
if ( EVEN(sts)) return sts;
if ( EVEN(sts)) {
wnav->message('E', wnav_get_message(sts));
return sts;
}
// Unselect moved object
if ( wnav->global_unselect_objid_cb)
(wnav->global_unselect_objid_cb)( wnav->parent_ctx, sel_list->Objid);
......
......@@ -273,20 +273,18 @@ dcli_tCmdTable wnav_command_table[] = {
{
"WB",
&wnav_wb_func,
{ "dcli_arg1", "/OUTPUT", "/HIERARCHY", "/INDENT",
"/HEADER", "/VOLUME", "/LOADFILE", "/IGNORE",
"/FULL", "/ANNOUNCE", "/NOINDEX", "/ROOT"
{ "dcli_arg1", "/OUTPUT", "/HIERARCHY",
""}
},
{
"EXIT",
&wnav_exit_func,
{ "",}
{ ""}
},
{
"QUIT",
&wnav_exit_func,
{ "",}
{ ""}
},
{
"DEFINE",
......@@ -2354,7 +2352,7 @@ static int wnav_list_func( void *client_data,
if ( !shortname)
{
// Search for local signal list descriptor
strcpy(descriptor_str, "wb:Local-Lists-SignalList");
strcpy(descriptor_str, "localWb:Lists-SignalList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2369,7 +2367,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-SignalList");
strcpy(descriptor_str, "wb:Lists-SignalList");
sts = utl_list( wnav->ldhses, descriptor_str, hierstr_p,
objectstr_p, file, print, allvolumes, volumestr_p, 0);
if ( EVEN(sts))
......@@ -2383,7 +2381,7 @@ static int wnav_list_func( void *client_data,
{
// Search for local signal list descriptor
strcpy( descriptor_str, "wb:Local-Lists-SignalListShort");
strcpy( descriptor_str, "localWb:Lists-SignalListShort");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2398,7 +2396,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy( descriptor_str, "wb:layout-Lists-SignalListShort");
strcpy( descriptor_str, "wb:Lists-SignalListShort");
sts = utl_list( wnav->ldhses, descriptor_str, hierstr_p, objectstr_p,
file, print, allvolumes, volumestr_p, 0);
if ( EVEN(sts))
......@@ -2442,7 +2440,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts)) return sts;
// Search for local signal list descriptor
strcpy(descriptor_str, "wb:Local-Lists-ChannelList");
strcpy(descriptor_str, "localWb:Lists-ChannelList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2457,7 +2455,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-ChannelList");
strcpy(descriptor_str, "wb:Lists-ChannelList");
sts = utl_list( wnav->ldhses, descriptor_str, hierstr_p,
objectstr_p, file, print, allvolumes, volumestr_p, 0);
if ( EVEN(sts))
......@@ -2497,7 +2495,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts)) return sts;
// Search for local signal list descriptor
strcpy(descriptor_str, "wb:Local-Lists-HierList");
strcpy(descriptor_str, "localWb:Lists-HierList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2512,7 +2510,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-HierList");
strcpy(descriptor_str, "wb:Lists-HierList");
sts = utl_list( wnav->ldhses, descriptor_str, hierstr_p,
objectstr_p, file, print, allvolumes, volumestr_p, 0);
if ( EVEN(sts))
......@@ -2523,7 +2521,7 @@ static int wnav_list_func( void *client_data,
}
// Write plcpgm list
strcpy(descriptor_str, "wb:Local-Lists-PlcPgmList");
strcpy(descriptor_str, "localWb:Lists-PlcPgmList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2538,7 +2536,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-PlcPgmList");
strcpy(descriptor_str, "wb:Lists-PlcPgmList");
sts = utl_list( wnav->ldhses, descriptor_str, hierstr_p,
objectstr_p, file, print, allvolumes, volumestr_p, 0);
if ( EVEN(sts))
......@@ -2581,7 +2579,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts)) return sts;
// Search for local signal list descriptor
strcpy(descriptor_str, "wb:Local-Lists-PlcModuleList");
strcpy(descriptor_str, "localWb:Lists-PlcModuleList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2596,7 +2594,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-PlcModuleList");
strcpy(descriptor_str, "wb:Lists-PlcModuleList");
sts = utl_list( wnav->ldhses, descriptor_str, hierstr_p,
objectstr_p, file, print, allvolumes, volumestr_p, 0);
if ( EVEN(sts))
......@@ -2621,7 +2619,7 @@ static int wnav_list_func( void *client_data,
sprintf( file, "pwrp_load:rtt_crr_%s.dat", wnav_VolumeIdToStr( info.Volume));
strcpy( descriptor_str, "wb:Local-Lists-RttSignalList");
strcpy( descriptor_str, "localWb:Lists-RttSignalList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2635,7 +2633,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-RttSignalList");
strcpy(descriptor_str, "wb:Lists-RttSignalList");
sts = utl_list( wnav->ldhses, descriptor_str, NULL, NULL, file, 0, 0, NULL, 1);
if ( EVEN(sts))
{
......@@ -2652,7 +2650,7 @@ static int wnav_list_func( void *client_data,
sprintf( file, "pwrp_load:rtt_crro_%s.dat", wnav_VolumeIdToStr( info.Volume));
strcpy(descriptor_str, "wb:Local-Lists-RttObjectList");
strcpy(descriptor_str, "localWb:Lists-RttObjectList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2666,7 +2664,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-RttObjectList");
strcpy(descriptor_str, "wb:Lists-RttObjectList");
sts = utl_list( wnav->ldhses, descriptor_str, NULL, NULL, file, 0, 0, NULL, 0);
if ( EVEN(sts))
{
......@@ -2683,7 +2681,7 @@ static int wnav_list_func( void *client_data,
sprintf( file, "pwrp_load:rtt_crrc_%s.dat", wnav_VolumeIdToStr( info.Volume));
strcpy(descriptor_str, "wb:Local-Lists-RttCodeList");
strcpy(descriptor_str, "localWb:Lists-RttCodeList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2697,7 +2695,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-RttCodeList");
strcpy(descriptor_str, "wb:Lists-RttCodeList");
sts = utl_list( wnav->ldhses, descriptor_str, NULL, NULL, file, 0, 0, NULL, 0);
if ( EVEN(sts))
{
......@@ -2710,7 +2708,7 @@ static int wnav_list_func( void *client_data,
sprintf( file, "pwrp_load:rtt_plc_%s.dat", wnav_VolumeIdToStr( info.Volume));
// Search for local descriptor
strcpy(descriptor_str, "wb:Local-Lists-RttPlcList");
strcpy(descriptor_str, "localWb:Lists-RttPlcList");
sts = ldh_NameToObjid( wnav->ldhses, &objid, descriptor_str);
if ( ODD(sts))
{
......@@ -2725,7 +2723,7 @@ static int wnav_list_func( void *client_data,
if ( EVEN(sts))
{
// No local found, take global
strcpy(descriptor_str, "wb:layout-Lists-RttPlcList");
strcpy(descriptor_str, "wb:Lists-RttPlcList");
sts = utl_list( wnav->ldhses, descriptor_str, NULL, NULL, file, 0, 0, NULL, 0);
if ( EVEN(sts))
{
......@@ -3894,16 +3892,9 @@ static int wnav_wb_func( void *client_data,
if ( strncmp( arg1_str, "DUMP", strlen( arg1_str)) == 0)
{
char hierarchystr[80];
char outputstr[80];
int hierarchy_flag;
int root_flag;
char indentstr[80];
int indent;
int indent_flag;
int header;
char outputstr[200];
char *hierarchystr_p;
pwr_tStatus sts;
char volumestr[160];
char *volumestr_p;
if ( EVEN( dcli_get_qualifier( "/OUTPUT" , outputstr)))
{
......@@ -3912,226 +3903,21 @@ static int wnav_wb_func( void *client_data,
}
if ( ODD( dcli_get_qualifier( "/HIERARCHY" , hierarchystr)))
hierarchy_flag = 1;
else
hierarchy_flag = 0;
root_flag = 0;
if ( ODD( dcli_get_qualifier( "/INDENT" , indentstr)))
{
indent_flag = 1;
sts = sscanf(indentstr, "%d", &indent);
if ( sts != 1)
{
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
}
else
indent_flag = 0;
header = ODD( dcli_get_qualifier( "/HEADER", NULL));
if ( ODD( dcli_get_qualifier( "/VOLUME" , volumestr)))
volumestr_p = volumestr;
hierarchystr_p = hierarchystr;
else
volumestr_p = NULL;
hierarchystr_p = 0;
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->wbctx);
sts = utl_wb_dump( wnav->ldhses, indent_flag, header, hierarchy_flag,
root_flag, indent, hierarchystr, outputstr, volumestr_p);
if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
return sts;
}
else if ( strncmp( arg1_str, "EXPORT", strlen( arg1_str)) == 0)
{
char outputstr[80];
int hierarchy_flag;
char hierarchystr[80];
int root_flag;
char indentstr[80];
int indent;
int indent_flag;
int header;
pwr_tStatus sts;
char *volumestr_p;
if ( EVEN( dcli_get_qualifier( "/OUTPUT" , outputstr)))
{
wnav->message('E', "Qualifer required");
return WNAV__QUAL;
}
hierarchy_flag = 0;
if ( ODD( dcli_get_qualifier( "/HIERARCHY" , hierarchystr)))
{
root_flag = 1;
hierarchy_flag = 1;
}
else
root_flag = 0;
if ( ODD( dcli_get_qualifier( "/INDENT" , indentstr)))
{
indent_flag = 1;
sts = sscanf(indentstr, "%d", &indent);
if ( sts != 1)
{
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
}
else
indent_flag = 0;
header = ODD( dcli_get_qualifier( "/HEADER", NULL));
volumestr_p = NULL;
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->wbctx);
sts = utl_wb_dump( wnav->ldhses, indent_flag, header, hierarchy_flag,
root_flag, indent, hierarchystr, outputstr, volumestr_p);
sts = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr);
if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
return sts;
}
else if ( strncmp( arg1_str, "LOAD", strlen( arg1_str)) == 0)
{
char loadfilestr[80];
char outputstr[80];
char *rootstr_ptr;
char *outputstr_ptr;
int ignore_flag;
int full_flag;
int index_flag;
int announce_flag;
pwr_tStatus sts, status;
ldh_sSessInfo info;
if ( !wnav->editmode)
{
wnav->message('E', "Not in edit mode");
return WNAV__NOEDIT;
}
if ( EVEN( dcli_get_qualifier( "/LOADFILE" , loadfilestr)))
{
wnav->message('E', "Qualifer required");
return WNAV__QUAL;
}
if ( ODD( dcli_get_qualifier( "/OUTPUT" , outputstr)))
outputstr_ptr = outputstr;
else
outputstr_ptr = NULL;
rootstr_ptr = NULL;
ignore_flag = ODD( dcli_get_qualifier( "/IGNORE" , NULL));
full_flag = ODD( dcli_get_qualifier( "/FULL" , NULL));
announce_flag = ODD( dcli_get_qualifier( "/ANNOUNCE" , NULL));
index_flag = EVEN( dcli_get_qualifier( "/NOINDEX" , NULL));
// The ldh session has to be saved
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->wbctx);
sts = ldh_GetSessionInfo( wnav->ldhses, &info);
if ( EVEN(sts)) return sts;
if ( !info.Empty )
{
wnav->message('E', "Session is not saved");
return WNAV__NOTSAVED;
}
sts = ldh_SetSession( wnav->ldhses, ldh_eAccess_ReadOnly);
if ( EVEN(sts)) return sts;
sts = ldh_wbload( ldh_SessionToWB( wnav->ldhses), wnav->ldhses,
ignore_flag, full_flag, rootstr_ptr, loadfilestr,
outputstr_ptr, announce_flag, !index_flag);
if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
status = ldh_SetSession( wnav->ldhses, ldh_eAccess_ReadWrite);
if ( EVEN(status)) return status;
if ( wnav->window_type != wnav_eWindowType_No)
wnav->ldh_refresh( pwr_cNObjid);
if ( EVEN(sts)) return sts;
}
else if ( strncmp( arg1_str, "IMPORT", strlen( arg1_str)) == 0)
{
char loadfilestr[80];
char outputstr[80];
char rootstr[80];
char *rootstr_ptr;
char *outputstr_ptr;
int ignore_flag;
int full_flag;
int announce_flag;
pwr_tStatus sts, status;
ldh_sSessInfo info;
int index_flag;
if ( !wnav->editmode)
{
wnav->message('E', "Not in edit mode");
return WNAV__NOEDIT;
}
if ( EVEN( dcli_get_qualifier( "/LOADFILE" , loadfilestr)))
{
wnav->message('E', "Qualifer required");
return WNAV__QUAL;
}
if ( ODD( dcli_get_qualifier( "/OUTPUT" , outputstr)))
outputstr_ptr = outputstr;
else
outputstr_ptr = NULL;
if ( ODD( dcli_get_qualifier( "/ROOT" , rootstr)))
rootstr_ptr = rootstr;
else
rootstr_ptr = NULL;
ignore_flag = ODD( dcli_get_qualifier( "/IGNORE" , NULL));
full_flag = ODD( dcli_get_qualifier( "/FULL" , NULL));
announce_flag = ODD( dcli_get_qualifier( "/ANNOUNCE" , NULL));
index_flag = 1;
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->wbctx);
// The ldh session has to be saved
sts = ldh_GetSessionInfo( wnav->ldhses, &info);
if ( EVEN(sts)) return sts;
if ( !info.Empty )
{
wnav->message('E', "Session is not saved");
return WNAV__NOTSAVED;
}
sts = ldh_SetSession( wnav->ldhses, ldh_eAccess_ReadOnly);
if ( EVEN(sts)) return sts;
sts = ldh_wbload( ldh_SessionToWB(wnav->ldhses), wnav->ldhses, ignore_flag,
full_flag, rootstr_ptr, loadfilestr, outputstr_ptr, announce_flag,
!index_flag);
if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
status = ldh_SetSession( wnav->ldhses, ldh_eAccess_ReadWrite);
if ( EVEN(status)) return status;
if ( wnav->window_type != wnav_eWindowType_No)
wnav->ldh_refresh( pwr_cNObjid);
if ( EVEN(sts)) return sts;
wnav->message('E', "Not yet implemented");
return LDH__NYI;
}
else
{
......
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