Commit 2171c166 authored by lw's avatar lw

Added update of classes in a volume database

parent f661868f
/*
* Proview $Id: wb_c_pb_dp_slave.cpp,v 1.4 2006-04-12 12:17:45 claes Exp $
* Proview $Id: wb_c_pb_dp_slave.cpp,v 1.5 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -39,14 +39,12 @@
#include "flow_browctx.h"
#include "flow_browapi.h"
extern "C" {
#include "pwr.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "co_wow.h"
#include "wb_nav_macros.h"
}
#include "rt_pb_gsd.h"
#include "rt_pb_gsd_attr.h"
......@@ -62,8 +60,6 @@ extern "C" {
using namespace std;
// #include "wb_api.h"
/*----------------------------------------------------------------------------*\
Configure the slave from gsd file.
......
/*
* Proview $Id: pwr.h,v 1.23 2006-04-28 04:59:58 claes Exp $
* Proview $Id: pwr.h,v 1.24 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -46,6 +46,10 @@
/*! \addtogroup Pwr */
/*@{*/
#if defined __cplusplus
extern "C" {
#endif
#ifdef VAXC
# define pwr_dExport globaldef
# define pwr_dImport globalref
......@@ -679,6 +683,9 @@ static const pwr_tDeltaTime pwr_cNDeltaTime = {0, 0}; //!< Zero deltatime consta
/*@}*/
#if defined __cplusplus
}
#endif
#endif
/*
* Proview $Id: pwr_class.h,v 1.21 2006-04-05 08:41:34 claes Exp $
* Proview $Id: pwr_class.h,v 1.22 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -23,14 +23,14 @@
/* pwr_class.h -- system classes
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef pwr_h
#include "pwr.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define PWR_BREAKPOINTS_MAX 10
#define PWR_OBJTYPES_MAX 300
......
/**
* Proview $Id: co_dbs.c,v 1.25 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Proview $Id: co_dbs.c,v 1.26 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -34,6 +34,7 @@
#include "pwr.h"
#include "co_dbs.h"
#include "co_time.h"
#include "co_dbs_msg.h"
#include "co_errno.h"
#include "co_platform.h"
......@@ -402,7 +403,6 @@ dbs_Reference(pwr_tStatus *sts, const dbs_sVenv *vep, void *adrs)
{
long iadrs = (long)adrs;
long ofs;
//long base = ep->sect[]
if (iadrs < (long)vep->base)
return dbs_cNref;
......@@ -423,7 +423,6 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
int tfd;
int i;
dbs_sSect *sect;
//dbs_sFile file;
void *base = 0;
int nVolRef;
dbs_sVolRef *vrp;
......@@ -436,13 +435,11 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
if ((ret = stat(filename, &sb)) != 0) {
*sts = errno_GetStatus();
// perror("stat");
return NULL;
}
fd = open(filename, O_RDWR);
tfd = mkstemp(tfname);
//printf("dbs_Map:: %s -> %s\n", filename, tfname);
while (1) {
int count;
......@@ -456,10 +453,6 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
ret = close(fd);
errno = 0;
//ret = read(fd, &file, sizeof(file));
// printf("st_size...: %ld\n", sb.st_size);
// printf("size......: %d\n", file.size);
base = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, tfd, 0);
if (base == NULL) {
......@@ -492,7 +485,7 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
vep->name_bt = &vep->vp->name_bt;
vep->oid_bt = &vep->vp->oid_bt;
vep->class_bt = &vep->vp->class_bt;
for (i = 0; i < nVolRef; i++) {
vep = &mep->venv[i + 1];
......@@ -584,8 +577,6 @@ dbs_Split(pwr_tStatus *sts, dbs_sMenv *mep, char *dirName)
fclose(fp);
for (j = 0; j < n; j++, vrp++) {
//vrp->offset = offset;
printf(" %s, size %d, offset %d\n", vrp->name, vrp->size, offset);
offset += vrp->size;
}
}
......
/**
* Proview $Id: co_regex.h,v 1.2 2005-09-01 14:57:52 claes Exp $
* Proview $Id: co_regex.h,v 1.3 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -22,6 +22,10 @@
#include <stddef.h>
#if defined __cplusplus
extern "C" {
#endif
typedef struct regex {
char *buffer;
long allocated;
......@@ -98,4 +102,8 @@ void regfree(regex_t *preg);
char *regerror(int errcode);
#if defined __cplusplus
}
#endif
# endif
This diff is collapsed.
/**
* Proview $Id: co_time.h,v 1.6 2006-01-13 06:41:20 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Proview $Id: co_time.h,v 1.7 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -21,7 +21,7 @@
#define co_time_h
#ifndef pwr_h
# include "pwr.h"
# include "pwr.h"
#endif
#ifdef __cplusplus
......@@ -61,9 +61,10 @@ typedef unsigned int time_tClock;
//! Time string format
typedef enum {
time_eFormat_DateAndTime = 0, //!< Display date and time, 01-JAN-1970 01:00:00.00
time_eFormat_Time = 1, //!< Display time only 01:00:00.00
time_eFormat_ComprDateAndTime = 2 //!< Date and time compressed format, 70-01-01 00:00:00
time_eFormat_DateAndTime = 0, //!< Display date and time, 01-JAN-1970 01:00:00.00
time_eFormat_Time = 1, //!< Display time only 01:00:00.00
time_eFormat_ComprDateAndTime = 2, //!< Date and time compressed format, 70-01-01 00:00:00
time_eFormat_NumDateAndTime = 3 //!< Date and time format, 2005-01-01 00:00:00
} time_eFormat;
#define SWE 0
......@@ -80,68 +81,68 @@ typedef enum {
int
clock_gettime (
clockid_t clockid,
struct timespec *ts
clockid_t clockid,
struct timespec *ts
);
int
clock_getres (
clockid_t clockid,
struct timespec *tp
clockid_t clockid,
struct timespec *tp
);
#endif
pwr_tTime * time_Aabs (pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Aadd (pwr_tTime*, pwr_tTime*, pwr_tDeltaTime*);
int time_Acomp (pwr_tTime*, pwr_tTime*);
pwr_tDeltaTime * time_Adiff (pwr_tDeltaTime*, pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Aneg (pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Asub (pwr_tTime*, pwr_tTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dabs (pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dadd (pwr_tDeltaTime*, pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dneg (pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dsub (pwr_tDeltaTime*, pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tTime * time_Aabs (pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Aadd (pwr_tTime*, pwr_tTime*, pwr_tDeltaTime*);
int time_Acomp (pwr_tTime*, pwr_tTime*);
pwr_tDeltaTime * time_Adiff (pwr_tDeltaTime*, pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Aneg (pwr_tTime*, pwr_tTime*);
pwr_tTime * time_Asub (pwr_tTime*, pwr_tTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dabs (pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dadd (pwr_tDeltaTime*, pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dneg (pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Dsub (pwr_tDeltaTime*, pwr_tDeltaTime*, pwr_tDeltaTime*);
#if defined (OS_VMS) || defined(OS_ELN)
pwr_tStatus time_Dmul (pwr_tDeltaTime*, pwr_tDeltaTime*, pwr_tInt32);
pwr_tStatus time_Dmul (pwr_tDeltaTime*, pwr_tDeltaTime*, pwr_tInt32);
#endif
int time_Dcomp (pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tStatus time_DtoAscii (pwr_tDeltaTime*, int, char*, int);
pwr_tStatus time_AtoAscii (pwr_tTime*, time_eFormat, char*, int);
pwr_tStatus time_AsciiToD (char*, pwr_tDeltaTime*);
pwr_tStatus time_AsciiToA (char*, pwr_tTime*);
pwr_tStatus time_TmToAscii (struct tm*, time_eFormat, char*, int);
pwr_tStatus time_AsciiToTm (char*, struct tm*);
pwr_tStatus time_FormAsciiToA(char*, short, short, pwr_tTime*);
void time_AtoFormAscii(pwr_tTime*, short, short, char[], int);
pwr_tDeltaTime * time_MsToD (pwr_tDeltaTime*, pwr_tInt32);
int time_Dcomp (pwr_tDeltaTime*, pwr_tDeltaTime*);
pwr_tStatus time_DtoAscii (pwr_tDeltaTime*, int, char*, int);
pwr_tStatus time_AtoAscii (pwr_tTime*, time_eFormat, char*, int);
pwr_tStatus time_AsciiToD (char*, pwr_tDeltaTime*);
pwr_tStatus time_AsciiToA (char*, pwr_tTime*);
pwr_tStatus time_TmToAscii (struct tm*, time_eFormat, char*, int);
pwr_tStatus time_AsciiToTm (char*, struct tm*);
pwr_tStatus time_FormAsciiToA(char*, short, short, pwr_tTime*);
void time_AtoFormAscii(pwr_tTime*, short, short, char[], int);
pwr_tDeltaTime * time_MsToD (pwr_tDeltaTime*, pwr_tInt32);
#if defined(OS_VMS) || defined(OS_ELN)
pwr_tStatus time_PwrDeltaToVms (pwr_tDeltaTime*, pwr_tVaxTime*);
pwr_tStatus time_PwrToVms (pwr_tTime*, pwr_tVaxTime*);
pwr_tStatus time_VmsToPwr (pwr_tVaxTime*, pwr_tTime*);
pwr_tStatus time_SetTime (pwr_tTime*);
pwr_tStatus time_PwrDeltaToVms (pwr_tDeltaTime*, pwr_tVaxTime*);
pwr_tStatus time_PwrToVms (pwr_tTime*, pwr_tVaxTime*);
pwr_tStatus time_VmsToPwr (pwr_tVaxTime*, pwr_tTime*);
pwr_tStatus time_SetTime (pwr_tTime*);
#endif
pwr_tDeltaTime * time_FloatToD (pwr_tDeltaTime*, pwr_tFloat32);
pwr_tFloat32 time_DToFloat (pwr_tFloat32*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Uptime (pwr_tStatus*, pwr_tDeltaTime*, pwr_tDeltaTime*);
time_tClock time_Clock (pwr_tStatus*, pwr_tDeltaTime*);
time_tOs * time_Os (pwr_tStatus*, time_tOs*);
time_tClock time_DtoClock (pwr_tStatus*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_ClockToD (pwr_tStatus*, pwr_tDeltaTime*, time_tClock);
time_tOs * time_AtoOs (pwr_tStatus*, time_tOs*, pwr_tTime*);
time_tOs * time_DtoOs (pwr_tStatus*, time_tOs*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_ZeroD (pwr_tDeltaTime*);
pwr_tDeltaTime * time_FloatToD (pwr_tDeltaTime*, pwr_tFloat32);
pwr_tFloat32 time_DToFloat (pwr_tFloat32*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Uptime (pwr_tStatus*, pwr_tDeltaTime*, pwr_tDeltaTime*);
time_tClock time_Clock (pwr_tStatus*, pwr_tDeltaTime*);
time_tOs * time_Os (pwr_tStatus*, time_tOs*);
time_tClock time_DtoClock (pwr_tStatus*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_ClockToD (pwr_tStatus*, pwr_tDeltaTime*, time_tClock);
time_tOs * time_AtoOs (pwr_tStatus*, time_tOs*, pwr_tTime*);
time_tOs * time_DtoOs (pwr_tStatus*, time_tOs*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_ZeroD (pwr_tDeltaTime*);
void time_Sleep (float time);
#if defined(OS_ELN)
int eln_clock_gettime (clockid_t, struct timespec*);
struct tm *eln_localtime (const time_t*);
time_t eln_mktime (tm_t*);
int eln_clock_getres (clockid_t, struct timespec*);
int eln_clock_gettime (clockid_t, struct timespec*);
struct tm *eln_localtime (const time_t*);
time_t eln_mktime (tm_t*);
int eln_clock_getres (clockid_t, struct timespec*);
#define clock_gettime eln_clock_gettime
#define localtime eln_localtime
......
/**
* Proview $Id: co_wow.h,v 1.9 2006-02-15 14:19:18 claes Exp $
* Proview $Id: co_wow.h,v 1.10 2006-05-21 22:30:49 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -104,10 +104,3 @@ void wow_DisplayLicense( Widget father);
#endif
#endif
......@@ -215,15 +215,15 @@ sub build_all_modules ()
merge();
_module("tlog");
build_all();
merge();
_module("remote");
build_all();
# merge();
# _module("remote");
# build_all();
merge();
_module("bcomp");
build_all();
merge();
_module("java");
build_all();
# merge();
# _module("java");
# build_all();
merge();
_module("profibus");
build_all();
......
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_objs) $(rt_msg_objs) \
$(pwr_obj)/rt_io_user.o $(pwr_obj)/wb_provider.o \
-L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib\
ifeq ($(export_type),exp)
link = $(ldxx) $(explinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_provider.o \
-L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \
-L/opt/gnome/lib \
-lpwr_wb -lpwr_ge -lpwr_rt -lpwr_co -lpwr_flow -lpwr_glow\
-lpwr_msg_dummy -lantlr -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp -ldb_cxx\
-lpwr_wb -lpwr_rt -lpwr_ge -lpwr_flow -lpwr_glow -lpwr_co \
-lpwr_msg_dummy -lantlr -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp\
-lXmu -lSM -lICE\
-lrpcsvc -lpthread -lm -lrt
-lrpcsvc -lpthread -lm -ldb_cxx -lz
else
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_provider.o \
-L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \
-L/opt/gnome/lib \
-lpwr_wb -lpwr_rt -lpwr_ge -lpwr_flow -lpwr_glow -lpwr_co \
-lpwr_msg_dummy -lantlr -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp\
-lXmu -lSM -lICE\
-lrpcsvc -lpthread -lm -ldb_cxx -lz
endif
endif
/*
* Proview $Id: wb_wbltest.cpp,v 1.10 2005-09-01 14:57:49 claes Exp $
* Proview $Id: wb_wbltest.cpp,v 1.11 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -37,12 +37,18 @@
#include "co_dbs.h"
#include "co_time.h"
#if 0
#if 1
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello world\n");
}
#elif 0
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main( int argc, char *argv[])
int main(int argc, char *argv[])
{
struct stat sb;
int ret;
......@@ -71,82 +77,21 @@ int main( int argc, char *argv[])
#elif 0
int main( int argc, char *argv[])
{
int a;
int b;
int i;
int c;
for (i = 0; i < 100; i++) {
if (i % 3 == 0) {
a = rand() % 101;
b = rand() % 101;
printf("[%d] vad blir %d + %d = ", i + 1, a, b);
scanf("%d", &c);
if (c == a + b) {
printf("\nKorrekt!\n");
} else {
printf("Fel\007! Det blir: %d\n", a + b);
}
}
else if (i % 3 == 1) {
int tmp;
a = rand() % 101;
b = rand() % 101;
if (a < b) {
tmp = b;
b = a;
a = tmp;
}
printf("[%d] vad blir %d - %d = ", i + 1, a, b);
scanf("%d", &c);
if (c == a - b) {
printf("\nKorrekt!\n");
} else {
printf("Fel\007! Det blir %d\n", a - b);
}
}
else if (i % 3 == 2) {
a = rand() % 11;
b = rand() % 11;
printf("[%d] vad blir %d * %d = ", i + 1, a, b);
scanf("%d", &c);
//pwr_tStatus sts;
//dbs_sEnv env;
//dbs_sEnv *ep;
wb_erep *erep = new wb_erep();
//if (argc <= 2) exit(0);
wb_vrepwbl *vwbl = new wb_vrepwbl(erep);
vwbl->info();
vwbl->load("cvolvhxnu4.wb_load");
vwbl->createSnapshot("cvolvhxnu4.dbs");
if (c == a * b) {
printf("\nKorrekt!\n");
} else {
printf("Fel\007! Det blir %d\n", a * b);
}
}
}
}
#elif 0
int main( int argc, char *argv[])
{
char namn[50];
char bnamn[50];
int len;
printf("Vad heter du? ");
scanf("%s", namn);
len = strlen(namn);
for (int i = 0; i < len; i++) {
bnamn[len - i -1] = namn[i];
}
bnamn[len+1] = '\0';
printf("\nDitt namn baklnges r: %s\n", bnamn);
}
#elif 1
int main( int argc, char *argv[])
{
//pwr_tStatus sts;
//dbs_sEnv env;
......
/*
* Proview $Id: wb.h,v 1.10 2006-03-31 14:24:34 claes Exp $
* Proview $Id: wb.h,v 1.11 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -22,8 +22,8 @@
/* wb.h -- work bench */
#ifndef pwr_h
#include "pwr.h"
#if defined __cplusplus
extern "C" {
#endif
#define WB_CLASS_NAME "PWR_DEV"
......@@ -47,6 +47,9 @@ typedef enum {
wb_eUtility_WNav = 1005
} wb_eUtility;
#if defined __cplusplus
}
#endif
#endif
......
/*
* Proview $Id: wb_api.h,v 1.7 2006-03-31 14:24:34 claes Exp $
* Proview $Id: wb_api.h,v 1.8 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -26,20 +26,6 @@
extern "C" {
#endif
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef wb_ldh_h
# include "wb_ldh.h"
#endif
#ifndef flow_h
#include "flow.h"
#endif
#ifndef flow_browctx_h
#include "flow_browapi.h"
#endif
#ifndef co_wow_h
#include "co_wow.h"
#endif
......
/*
* Proview $Id: wb_c_xttgraph.cpp,v 1.2 2006-04-24 13:22:24 claes Exp $
* Proview $Id: wb_c_xttgraph.cpp,v 1.3 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -22,17 +22,7 @@
using namespace std;
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "ge.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
//#undef Status
#include <Xm/Xm.h>
#include <Xm/XmP.h>
......@@ -41,13 +31,10 @@ using namespace std;
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget.h"
#include "wb_wtt.h"
#include "ge.h"
#include "wb_wnav.h"
#include "wb_pwrb_msg.h"
#include "wb_build.h"
#include "co_msgwindow.h"
/*----------------------------------------------------------------------------*\
......
/*
* Proview $Id: wb_cdrep.cpp,v 1.30 2006-02-01 07:36:23 claes Exp $
* Proview $Id: wb_cdrep.cpp,v 1.31 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -581,7 +581,8 @@ void wb_cdrep::convertObject( wb_merep *merep, void *rbody, void *dbody,
{
pwr_tStatus sts;
wb_cdrep *cdrep_source = merep->cdrep( &sts, cid());
if ( EVEN(sts)) throw wb_error(sts);
if ( EVEN(sts))
throw wb_error(sts);
for ( int i = 0; i < 2; i++) {
int size_target, size_source;
......
This diff is collapsed.
/*
* Proview $Id: wb_db.h,v 1.19 2005-09-06 10:43:31 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Proview $Id: wb_db.h,v 1.20 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -23,8 +23,11 @@
#include "pwr.h"
#include "db_cxx.h"
#include "wb_import.h"
#include "wb_convert_volume.h"
class wb_name;
class wb_convert_volume;
typedef struct {
pwr_tOid oid; /**< object identifier */
......@@ -37,7 +40,7 @@ typedef struct {
pwr_tOid aoid; /**< object after this object. */
pwr_tOid foid; /**< first child object. */
pwr_tOid loid; /**< last child object. */
pwr_mClassDef flags;
struct {
pwr_tTime time;
......@@ -65,10 +68,10 @@ public:
Db *m_t_name;
Db *m_t_info;
wb_db_txn *m_txn;
wb_db_txn *m_txn;
public:
wb_db();
wb_db(pwr_tVid vid);
//~wb_db();
......@@ -84,28 +87,28 @@ public:
void close();
void open(const char *fileName);
void openDb(bool useTxn);
void copy(wb_export &e, const char *fileName);
void create(pwr_tVid vid, pwr_tCid cid, const char *volumeName, const char *fileName);
int del_family(wb_db_txn *txn, Dbc *cp, pwr_tOid poid);
wb_db_txn *begin(wb_db_txn *txn);
bool commit(pwr_tStatus *sts);
bool abort(pwr_tStatus *sts);
//void adopt(wb_db_txn *txn, wb_db_ohead &o, wb_destination &dest);
//void unadopt(wb_db_txn *txn, wb_db_ohead &o);
bool deleteFamily(pwr_tStatus *sts, wb_db_ohead *o);
//bool deleteOset(pwr_tStatus *sts, wb_oset *o);
bool importVolume(wb_export &e);
bool importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
pwr_tOid boid, pwr_tOid aoid, pwr_tOid foid, pwr_tOid loid,
const char *name, const char *normname, pwr_mClassDef flags,
......@@ -113,20 +116,21 @@ public:
size_t rbSize, size_t dbSize);
bool importRbody(pwr_tOid oid, size_t size, void *body);
bool importDbody(pwr_tOid oid, size_t size, void *body);
bool importDocBlock(pwr_tOid oid, size_t size, char *block) { return true;}
bool importMeta(dbs_sMenv *mep);
void checkClassList(pwr_tOid oid, pwr_tCid cid, bool update);
};
class wb_db_info
{
public:
struct
struct
{
pwr_tVid vid;
pwr_tCid cid;
......@@ -135,26 +139,26 @@ public:
} m_volume;
wb_db *m_db;
Dbt m_key;
Dbt m_data;
wb_db_info(wb_db *db);
//~wb_db_info();
void put(wb_db_txn *txn);
void get(wb_db_txn *txn);
pwr_tCid cid() { return m_volume.cid;}
pwr_tVid vid() { return m_volume.vid;}
pwr_tTime time() { return m_volume.time;}
char *name() { return m_volume.name;}
void cid(pwr_tCid cid) { m_volume.cid = cid;}
void vid(pwr_tVid vid) { m_volume.vid = vid;}
void time(pwr_tTime time) { m_volume.time = time;}
void name(char const *name) { strcpy(m_volume.name, name);}
};
class wb_db_ohead
......@@ -162,7 +166,7 @@ class wb_db_ohead
public:
db_sObject m_o;
pwr_tOid m_oid;
wb_db *m_db;
Dbt m_key;
Dbt m_data;
......@@ -183,10 +187,10 @@ public:
wb_db_ohead &get(wb_db_txn *txn, pwr_tOid oid);
void setDb(wb_db *db) { m_db = db;}
int put(wb_db_txn *txn);
int del(wb_db_txn *txn);
pwr_tOid oid() { return m_o.oid;}
pwr_tVid vid() { return m_o.oid.vid;}
pwr_tOix oix() { return m_o.oid.oix;}
......@@ -199,7 +203,7 @@ public:
pwr_tTime ohTime() { return m_o.time;}
const char *name() { return m_o.name;}
const char *normname() {return m_o.normname;}
pwr_mClassDef flags() { return m_o.flags;}
......@@ -208,7 +212,7 @@ public:
size_t dbSize() { return m_o.body[1].size;}
pwr_tTime rbTime() { return m_o.body[0].time;}
pwr_tTime dbTime() { return m_o.body[1].time;}
void name(wb_name &name);
void name(pwr_tOid &oid);
......@@ -233,7 +237,7 @@ public:
void iter(void (*print)(pwr_tOid oid, db_sObject *op));
void iter(wb_import &i);
};
class wb_db_name
{
public:
......@@ -249,44 +253,44 @@ public:
//pwr_tCid cid; // saved here to optimize tree traversal
//pwr_mClassDef flags; // saved here to optimize tree traversal
} m_d;
wb_db *m_db;
Dbt m_key;
Dbt m_data;
Dbc *m_dbc;
wb_db_name(wb_db *db, wb_db_txn *txn);
wb_db_name(wb_db *db, wb_db_ohead &o);
//wb_db_name(wb_db *db, pwr_tOid, char *name);
wb_db_name(wb_db *db, pwr_tOid poid, const char *name);
wb_db_name(wb_db *db, pwr_tOid oid, pwr_tOid poid, const char *name);
wb_db_name(wb_db *db, wb_db_txn *txn, pwr_tOid poid, wb_name &name);
int get(wb_db_txn *txn);
int put(wb_db_txn *txn);
int del(wb_db_txn *txn);
void name(wb_name &name);
void iter(void (*print)(pwr_tOid poid, pwr_tObjName name, pwr_tOid oid));
pwr_tOid oid() { return m_d.oid;}
};
class wb_db_class
{
public:
struct
struct
{
pwr_tCid cid;
pwr_tOid oid;
} m_k;
wb_db *m_db;
Dbt m_key;
Dbt m_data;
Dbc *m_dbc;
wb_db_class(wb_db *db);
wb_db_class(wb_db *db, pwr_tCid cid);
wb_db_class(wb_db *db, pwr_tCid cid, pwr_tOid oid);
......@@ -295,15 +299,16 @@ public:
~wb_db_class();
bool succ(pwr_tOid oid);
bool succClass(pwr_tCid cid);
bool pred(pwr_tOid oid);
int put(wb_db_txn *txn);
int del(wb_db_txn *txn);
pwr_tCid cid() { return m_k.cid;}
pwr_tOid oid() { return m_k.oid;}
void iter(void (*print)(pwr_tOid oid, pwr_tCid cid));
void iter(wb_convert_volume *cp);
};
class wb_db_dbody
......@@ -314,7 +319,7 @@ public:
pwr_tOid m_oid;
size_t m_size;
void *m_p;
Dbt m_key;
Dbt m_data;
Dbc *m_dbc;
......@@ -322,9 +327,9 @@ public:
wb_db_dbody(wb_db *db);
wb_db_dbody(wb_db *db, pwr_tOid oid);
wb_db_dbody(wb_db *db, pwr_tOid oid, size_t size, void *p);
void oid(pwr_tOid oid) {m_oid = oid;}
int get(wb_db_txn *txn, size_t offset, size_t size, void *p);
int put(wb_db_txn *txn);
int put(wb_db_txn *txn, size_t offset, size_t size, void *p);
......@@ -343,7 +348,7 @@ public:
pwr_tOid m_oid;
size_t m_size;
void *m_p;
Dbt m_key;
Dbt m_data;
Dbc *m_dbc;
......@@ -351,7 +356,7 @@ public:
wb_db_rbody(wb_db *db);
wb_db_rbody(wb_db *db, pwr_tOid oid);
wb_db_rbody(wb_db *db, pwr_tOid oid, size_t size, void *p);
void oid(pwr_tOid oid) {m_oid = oid;}
int get(wb_db_txn *txn, size_t offset, size_t size, void *p);
......
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id: wb_ldh.cpp,v 1.54 2006-05-11 07:12:19 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.55 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -259,7 +259,7 @@ ldh_CallMenuMethod(ldh_sMenuCall *mcp, int index)
return sp->callMenuMethod( mcp, index);
}
pwr_tStatus
pwr_tStatus
ldh_GetMethod( ldh_tSession Session, char *Name, wb_tMethod *method)
{
pwr_tStatus sts;
......@@ -378,17 +378,17 @@ ldh_CopyObject(ldh_tSession session, pwr_tObjid *oid, char *name, pwr_tObjid src
wb_session *sp = (wb_session *)session;
try {
wb_object s_o = sp->object(srcoid);
if ( !s_o) return s_o.sts();
wb_object d_o = sp->object(dstoid);
if ( !d_o) return d_o.sts();
wb_destination d = d_o.destination(dest);
wb_object o = sp->copyObject(s_o, d, name);
wb_object s_o = sp->object(srcoid);
if ( !s_o) return s_o.sts();
wb_object d_o = sp->object(dstoid);
if ( !d_o) return d_o.sts();
wb_destination d = d_o.destination(dest);
wb_object o = sp->copyObject(s_o, d, name);
if (!o) return o.sts();
if (!o) return o.sts();
*oid = o.oid();
return o.sts();
*oid = o.oid();
return o.sts();
}
catch (wb_error& e) {
return e.sts();
......@@ -449,8 +449,8 @@ ldh_DeleteObject(ldh_tSession session, pwr_tOid oid)
if (!o) return o.sts();
try {
sp->deleteObject(o);
return sp->sts();
sp->deleteObject(o);
return sp->sts();
}
catch ( wb_error& e) {
return e.sts();
......@@ -466,7 +466,7 @@ ldh_DeleteObjectTree(ldh_tSession session, pwr_tOid oid)
if (!o) return o.sts();
try {
return sp->deleteFamily(o);
return sp->deleteFamily(o);
}
catch ( wb_error& e) {
return e.sts();
......@@ -873,11 +873,11 @@ ldh_GetAttrRefOrigTid(ldh_tSession session, pwr_sAttrRef *arp, pwr_tTid *tid)
}
try {
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
*tid = a.originalTid();
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
*tid = a.originalTid();
return a.sts();
return a.sts();
}
catch ( wb_error& e) {
return e.sts();
......@@ -1307,6 +1307,12 @@ ldh_ObjidToName(ldh_tSession session, pwr_tOid oid, int type, char *buf, int max
{
wb_session *sp = (wb_session *)session;
if (cdh_ObjidIsNull(oid)) {
strncpy( buf, cdh_ObjidToString( NULL, oid, 1), maxsize);
*size = strlen( buf);
return LDH__SUCCESS;
}
switch ( type) {
case ldh_eName_Object:
{
......@@ -1417,60 +1423,60 @@ ldh_AttrRefToName(ldh_tSession session, pwr_sAttrRef *arp, int nametype, char **
{
static char str[512];
wb_session *sp = (wb_session *)session;
try {
switch ( nametype) {
case ldh_eName_ArefExport:
case ldh_eName_Objid:
case ldh_eName_ObjectIx:
case ldh_eName_OixString:
case ldh_eName_VolumeId:
case ldh_eName_VidString: {
wb_name n = wb_name( cdh_ArefToString( NULL, arp, 1));
strcpy( str, n.name( nametype));
*aname = str;
*size = strlen(str);
break;
}
case ldh_eName_Ref: {
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
wb_name n = a.longName();
strcpy( str, a.name());
strcat( str, ".");
strcat( str, n.attributesAll());
*aname = str;
*size = strlen(str);
break;
}
case 0: { // cdh_mNName
if ( arp->Objid.vid == sp->vid())
nametype = cdh_mName_path | cdh_mName_attribute;
else
nametype = cdh_mName_volume | cdh_mName_attribute;
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
wb_name n = a.longName();
strcpy( str, n.name( nametype));
*aname = str;
*size = strlen(str);
break;
}
default: {
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
wb_name n = a.longName();
strcpy( str, n.name( nametype));
*aname = str;
*size = strlen(str);
break;
}
}
switch ( nametype) {
case ldh_eName_ArefExport:
case ldh_eName_Objid:
case ldh_eName_ObjectIx:
case ldh_eName_OixString:
case ldh_eName_VolumeId:
case ldh_eName_VidString: {
wb_name n = wb_name( cdh_ArefToString( NULL, arp, 1));
strcpy( str, n.name( nametype));
*aname = str;
*size = strlen(str);
break;
}
case ldh_eName_Ref: {
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
wb_name n = a.longName();
strcpy( str, a.name());
strcat( str, ".");
strcat( str, n.attributesAll());
*aname = str;
*size = strlen(str);
break;
}
case 0: { // cdh_mNName
if ( arp->Objid.vid == sp->vid())
nametype = cdh_mName_path | cdh_mName_attribute;
else
nametype = cdh_mName_volume | cdh_mName_attribute;
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
wb_name n = a.longName();
strcpy( str, n.name( nametype));
*aname = str;
*size = strlen(str);
break;
}
default: {
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
wb_name n = a.longName();
strcpy( str, n.name( nametype));
*aname = str;
*size = strlen(str);
break;
}
}
}
catch (wb_error& e) {
return e.sts();
......@@ -2004,22 +2010,22 @@ pwr_tStatus
ldh_GetAttrRefInfo(ldh_tSession session, pwr_sAttrRef *arp, ldh_sAttrRefInfo *info)
{
wb_session *sp = (wb_session *)session;
try {
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
info->size = a.size();
info->nElement = a.nElement();
info->index = a.index();
info->flags = a.flags();
info->type = a.type();
info->tid = a.tid();
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
info->size = a.size();
info->nElement = a.nElement();
info->index = a.index();
info->flags = a.flags();
info->type = a.type();
info->tid = a.tid();
}
catch ( wb_error& e) {
return e.sts();
}
return LDH__SUCCESS;
}
......
/*
* Proview $Id: wb_ldh.h,v 1.35 2006-04-26 04:46:10 claes Exp $
* Proview $Id: wb_ldh.h,v 1.36 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -96,7 +96,8 @@ typedef enum {
ldh_eVolRep_Wbl,
ldh_eVolRep_Mem,
ldh_eVolRep_Ref,
ldh_eVolRep_Ext
ldh_eVolRep_Ext,
ldh_eVolRep_Dbms
} ldh_eVolRep;
typedef enum {
......
This diff is collapsed.
/*
* Proview $Id: wb_merep.h,v 1.21 2005-10-07 05:57:29 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Proview $Id: wb_merep.h,v 1.22 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -31,22 +31,23 @@ using namespace std;
class wb_vrep;
class wb_tdrep;
class wb_adrep;
class wb_vrepdb;
typedef struct {
pwr_tCid subCid; /**< Class Id for class attribute */
pwr_tCid hostCid; /**< Class Id for owner class */
pwr_tUInt32 idx; /**< Index of offset data */
pwr_tCid subCid; /**< Class Id for class attribute */
pwr_tCid hostCid; /**< Class Id for owner class */
pwr_tUInt32 idx; /**< Index of offset data */
} merep_sClassAttrKey;
#define merep_cCattOffsetSize 20
typedef struct {
tree_sNode n;
merep_sClassAttrKey key;
int numOffset;
pwr_tUInt32 offset[merep_cCattOffsetSize];
tree_sNode n;
merep_sClassAttrKey key;
int numOffset;
pwr_tUInt32 offset[merep_cCattOffsetSize];
pwr_tUInt32 flags[merep_cCattOffsetSize];
} merep_sClassAttr;
} merep_sClassAttr;
class wb_merep {
......@@ -62,13 +63,17 @@ public:
wb_merep( wb_erep *erep, wb_vrep *vrep = 0) :
m_erep(erep), m_vrep(vrep), m_catt_tt(0) {}
~wb_merep();
wb_merep(const char *dirname, wb_erep *erep, wb_vrep *vrep = 0);
wb_merep( const wb_merep& x, wb_vrep *vrep);
wb_mvrep *volume(pwr_tStatus *sts);
wb_mvrep *volume(pwr_tStatus *sts, pwr_tVid vid);
wb_mvrep *volume(pwr_tStatus *sts, const char *name);
bool compareMeta(const char *dirname, wb_merep *merep);
void copyFiles(const char *dirname);
void copyFiles(const char *dirname, wb_merep *merep);
void checkFiles(wb_vrepdb *db, const char *dirname);
wb_orep *object(pwr_tStatus *sts, pwr_tOid oid);
void addDbs( pwr_tStatus *sts, wb_mvrep *mvrep);
void removeDbs( pwr_tStatus *sts, wb_mvrep *mvrep);
......@@ -81,15 +86,15 @@ public:
wb_tdrep *tdrep( pwr_tStatus *sts, wb_name name);
int getAttrInfoRec( wb_attrname *attr, pwr_eBix bix, pwr_tCid cid, size_t *size,
size_t *offset, pwr_tTid *tid, int *elements,
size_t *offset, pwr_tTid *tid, int *elements,
pwr_eType *type, int *flags, int level);
void classDependency( pwr_tStatus *sts, pwr_tCid cid,
pwr_tCid **lst, pwr_sAttrRef **arlst, int *cnt);
void classDependency( pwr_tStatus *sts, pwr_tCid cid,
pwr_tCid **lst, pwr_sAttrRef **arlst, int *cnt);
void classVersion( pwr_tStatus *sts, pwr_tCid cid, pwr_tTime *time);
tree_sTable *buildCatt( pwr_tStatus *sts);
void insertCattObject( pwr_tStatus *sts, pwr_tCid cid,
wb_adrep *adp, int offset);
void insertCattObject( pwr_tStatus *sts, pwr_tCid cid,
wb_adrep *adp, int offset);
tree_sTable *catt_tt() { return m_catt_tt;}
void subClass( pwr_tCid supercid, pwr_tCid subcid, pwr_tCid *nextsubcid, pwr_tStatus *sts);
};
......
/*
* Proview $Id: wb_object.h,v 1.14 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_object.h,v 1.15 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -25,7 +25,6 @@
#include "wb_orep.h"
#include "wb_ldh.h"
#include "wb_destination.h"
//#include "wb_location.h"
#include "wb_attribute.h"
class wb_bdef;
......
/*
* Proview $Id: wb_pwrs.h,v 1.6 2006-03-31 14:29:39 claes Exp $
* Proview $Id: wb_pwrs.h,v 1.7 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -50,12 +50,13 @@ typedef struct {
pwr_sMethodBinding (*Methods)[];
} pwr_sClassBinding;
#if defined __DECC || OS_LINUX
#if 1 //defined OS_LINUX
#define pwr_BindMethods(Class) pwr_sMethodBinding pwr_g ## Class ## _Methods[]
#define pwr_BindClasses(Type) pwr_sClassBinding pwr_g ## Type ## _ClassMethods[]
#define pwr_BindClass(Class) {#Class, (void *)pwr_g ## Class ## _Methods}
#define pwr_BindMethod(Method) {#Method, (pwr_tStatus (*)())Method}
#else
#error "Wrong OS"
#define pwr_BindMethods(Class) pwr_sMethodBinding pwr_g/**/Class/**/_Methods[]
#define pwr_BindClasses(Type) pwr_sClassBinding pwr_g/**/Type/**/_ClassMethods[]
#define pwr_BindClass(Class) {"Class", pwr_g/**/Class/**/_Methods}
......
/*
* Proview $Id: wb_session.cpp,v 1.20 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Proview $Id: wb_session.cpp,v 1.21 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -864,12 +864,13 @@ pwr_tStatus wb_session::callMenuMethod( ldh_sMenuCall *mcp, int Index)
bool wb_session::validateDestination( wb_destination d, pwr_tCid cid)
{
wb_object o = object( d.oid());
wb_object parent;
wb_object o = object(d.oid());
// Get parent
wb_object parent = wb_object();
if ( o) {
switch( d.code()) {
if (o) {
switch(d.code()) {
case ldh_eDest_After:
case ldh_eDest_Before:
parent = o.parent();
......@@ -878,17 +879,17 @@ bool wb_session::validateDestination( wb_destination d, pwr_tCid cid)
parent = o;
}
}
if ( !parent) {
if (!parent) {
// No parent, check if valid top object (for vrepmem all objects are valid topobjects)
wb_cdef c = cdef( cid);
if ( !c.flags().b.TopObject && type() != ldh_eVolRep_Mem) {
wb_cdef c = cdef(cid);
if (!c.flags().b.TopObject && type() != ldh_eVolRep_Mem) {
m_sts = LDH__NOTOP;
return false;
}
}
else {
// Check if adoption is legal
if ( parent.flags().b.NoAdopt) {
if (parent.flags().b.NoAdopt) {
m_sts = LDH__NOADOPT;
return false;
}
......
/*
* Proview $Id: wb_session.h,v 1.11 2006-03-31 14:29:39 claes Exp $
* Proview $Id: wb_session.h,v 1.12 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -23,19 +23,15 @@
#define wb_session_h
#ifndef pwr_h
#include "pwr.h"
//#include "wb_vrep.h"
#include "wb_object.h"
#include "wb_attribute.h"
#endif
#include "wb_ldh.h"
//#include "wb_ldhi.h"
//#include "wb_adef.h"
//#include "wb_bdef.h"
#include "wb_object.h"
#include "wb_bdef.h"
#include "wb_cdef.h"
#include "wb_name.h"
#include "wb_destination.h"
#include "wb_oset.h"
#include "wb_srep.h"
#include "wb_volume.h"
class wb_object;
......
/*
* Proview $Id: wb_treeimport.cpp,v 1.5 2005-10-18 05:12:47 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Proview $Id: wb_treeimport.cpp,v 1.6 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -162,6 +162,7 @@ bool wb_treeimport::importUpdateObject( wb_orep *o, wb_vrep *vrep)
wb_bdrep *bdrep = cdrep->bdrep( &sts, bix);
if ( EVEN(sts)) continue;
int size = bdrep->size();
char *body = (char *)malloc( bdrep->size());
vrep->readBody( &sts, o, bix, body);
......@@ -172,6 +173,9 @@ bool wb_treeimport::importUpdateObject( wb_orep *o, wb_vrep *vrep)
wb_adrep *adrep = bdrep->adrep( &sts);
while ( ODD(sts)) {
int elements = adrep->isArray() ? adrep->nElement() : 1;
if (adrep->offset() < 0 || (adrep->offset() + adrep->size() > size))
printf("(adrep->offset() < 0 || (adrep->offset() + adrep->size() > size))\n");
if ( adrep->isClass()) {
importUpdateSubClass( adrep, body + adrep->offset(), vrep, &modified);
}
......
/*
* Proview $Id: wb_utl.c,v 1.24 2006-05-18 10:26:10 claes Exp $
* Proview $Id: wb_utl.c,v 1.25 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -3170,6 +3170,9 @@ pwr_tStatus utl_show_volumes(
case ldh_eVolRep_Dbs:
u_print( utlctx, " Dbs");
break;
case ldh_eVolRep_Dbms:
u_print( utlctx, " Dbms");
break;
case ldh_eVolRep_Wbl:
u_print( utlctx, " Wbl");
break;
......@@ -5486,7 +5489,7 @@ int utl_compile (
sts = ldh_GetVidInfo( ldh_SessionToWB( ldhses), vol_id, &volinfo);
if (EVEN(sts)) return sts;
if ( volinfo.VolRep == ldh_eVolRep_Db) {
if ( volinfo.VolRep == ldh_eVolRep_Db) { // Todo!!!! Handle dbms
volume_vect[i] = vol_id;
i++;
if ( i > UTL_INPUTLIST_MAX)
......
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id: wb_vrepdb.h,v 1.29 2006-05-11 07:12:19 claes Exp $
* Proview $Id: wb_vrepdb.h,v 1.30 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@
#include "db_cxx.h"
#include "co_tree.h"
class wb_vrepdb : public wb_vrep
class wb_vrepdb : public wb_vrep, public wb_convert_volume
{
private:
bool deleteFamilyMember(pwr_tOid oid, wb_db_txn *txn);
......@@ -41,7 +41,7 @@ private:
pwr_tBitMask m;
#define mOentry_temporary 1
#define mOentry_exist 2
#define mOentry_exist 2
} mOentry;
typedef struct sOentry
......@@ -54,11 +54,11 @@ private:
struct sOentry *after;
struct sOentry *first;
struct sOentry *last;
} sOentry;
sOentry *m_poep;
typedef struct sDestination
{
pwr_tOid oid;
......@@ -66,12 +66,13 @@ private:
pwr_tOid foid;
pwr_tOid loid;
} sDestination;
sDestination m_destination;
protected:
wb_erep *m_erep;
wb_merep *m_merep;
wb_merep *m_merepCheck;
unsigned int m_nRef;
......@@ -81,7 +82,7 @@ public:
wb_db *m_db;
wb_db_ohead m_ohead;
wb_vrepdb(wb_erep *erep, const char *fileName);
wb_vrepdb(wb_erep *erep, pwr_tVid, pwr_tCid, const char *volumeName, const char *fileName);
......@@ -94,7 +95,7 @@ public:
virtual wb_erep *erep();
virtual wb_merep *merep() const;
virtual wb_vrep *next();
virtual pwr_tTime ohTime(pwr_tStatus *sts, const wb_orep *o);
......@@ -104,17 +105,17 @@ public:
virtual pwr_tOid oid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tVid vid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOix oix(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tCid cid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid poid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid foid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid loid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid boid(pwr_tStatus *sts, const wb_orep *o);
virtual pwr_tOid aoid(pwr_tStatus *sts, const wb_orep *o);
virtual const char * objectName(pwr_tStatus *sts, const wb_orep *o);
virtual wb_name longName(pwr_tStatus *sts, const wb_orep *o);
virtual bool isOffspringOf(pwr_tStatus *sts, const wb_orep *child, const wb_orep *parent);
virtual wb_orep *object(pwr_tStatus *sts);
......@@ -138,7 +139,7 @@ public:
virtual bool commit(pwr_tStatus *sts) {return m_db->commit(sts);}
virtual bool abort(pwr_tStatus *sts) {return m_db->abort(sts);}
virtual bool writeAttribute(pwr_tStatus *sts, wb_orep *o, pwr_eBix bix, size_t offset, size_t size, void *p);
......@@ -165,6 +166,8 @@ public:
virtual wb_orep *next(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *nextClass(pwr_tStatus *sts, const wb_orep *o);
virtual wb_orep *previous(pwr_tStatus *sts, const wb_orep *o);
virtual wb_srep *newSession();
......@@ -179,16 +182,19 @@ public:
void load();
void checkMeta();
void updateMeta();
virtual bool exportVolume(wb_import &e);
virtual bool exportHead(wb_import &e);
virtual bool exportRbody(wb_import &e);
virtual bool exportDbody(wb_import &e);
virtual bool exportDocBlock(wb_import &e);
virtual bool exportMeta(wb_import &e);
virtual bool exportTree(wb_treeimport &i, pwr_tOid oid);
......@@ -199,8 +205,8 @@ public:
size_t rbSize, size_t dbSize, void *rbody, void *dbody)
{ return false;}
virtual bool importPaste();
virtual bool importPasteObject(pwr_tOid destination, ldh_eDest destcode,
bool keepoid, pwr_tOid oid,
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, pwr_mClassDef flags,
size_t rbSize, size_t dbSize, void *rbody, void *dbody,
......@@ -217,6 +223,12 @@ public:
void delete_wb_orepdb(void *p);
virtual bool accessSupported( ldh_eAccess access) { return true;}
virtual const char *fileName() { return m_fileName;}
// virtual void checkClassList(pwr_tOid oid, pwr_tCid cid, bool update);
virtual void updateObject(pwr_tOid oid, pwr_tCid cid);
virtual void checkObject(pwr_tOid oid, pwr_tCid cid);
};
#endif
This diff is collapsed.
/*
* Proview $Id: wb_vrepwbl.cpp,v 1.50 2006-05-11 07:12:20 claes Exp $
* Proview $Id: wb_vrepwbl.cpp,v 1.51 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -297,7 +297,9 @@ int wb_vrepwbl::load( const char *fname)
cout << "\n-- Building volume " << volume_name << endl;
if ( root_object) {
cout << "\n-- Root object " << volume_name << endl;
root_object->build( 1);
cout << "\n-- post build volume " << volume_name << endl;
root_object->postBuild();
}
// info();
......@@ -1414,7 +1416,7 @@ bool wb_vrepwbl::registerObject( pwr_tOix oix, ref_wblnode node)
void wb_vrepwbl::registerClass( const char *name, pwr_tCid cid, ref_wblnode node)
{
string sname(name);
printf("register class: %s, %d\n", name, cid);
m_cid_list[cid] = node;
m_class_list[sname] = node;
}
......@@ -1422,6 +1424,7 @@ void wb_vrepwbl::registerClass( const char *name, pwr_tCid cid, ref_wblnode node
void wb_vrepwbl::registerType( const char *name, pwr_tTid tid, ref_wblnode node)
{
string sname(name);
printf("register type: %s, %d\n", name, tid);
m_tid_list[tid] = node;
m_type_list[sname] = node;
......@@ -1430,6 +1433,8 @@ void wb_vrepwbl::registerType( const char *name, pwr_tTid tid, ref_wblnode node)
void wb_vrepwbl::registerVolume( const char *name, pwr_tCid cid, pwr_tVid vid, ref_wblnode node)
{
m_vid = vid;
printf("register volume: %s, %d\n", name, vid);
strcpy( volume_name, name);
strcpy( m_name, name);
m_cid = cid;
......
/*
* Proview $Id: wb_vsel.cpp,v 1.13 2005-11-14 16:30:36 claes Exp $
* Proview $Id: wb_vsel.cpp,v 1.14 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -582,6 +582,9 @@ pwr_tStatus WVsel::load_volumelist()
case ldh_eVolRep_Dbs:
strcat( str, "Dbs ");
break;
case ldh_eVolRep_Dbms:
strcat( str, "Dbms ");
break;
case ldh_eVolRep_Wbl:
strcat( str, "Wbl ");
break;
......
/*
* Proview $Id: wb_wblnode.cpp,v 1.55 2006-02-16 13:04:40 claes Exp $
* Proview $Id: wb_wblnode.cpp,v 1.56 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -328,7 +328,7 @@ void wb_wblnode::initialize( antlr::RefToken t )
// Test
static int last = 0;
if ( (line_number % 1000) == 0 && line_number != last) {
if ( /*(line_number % 1000) == 0 &&*/ line_number != last) {
printf( "-- Processing line: %d\r", line_number);
fflush(stdout);
last = line_number;
......
/*
* Proview $Id: wb_wblnode.h,v 1.19 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wblnode.h,v 1.20 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -213,12 +213,12 @@ public:
return ret;
}
ref_wblnode wb_wblnode::getFirstChild()
ref_wblnode getFirstChild()
{
return ref_wblnode(BaseAST::getFirstChild());
}
ref_wblnode wb_wblnode::getNextSibling()
ref_wblnode getNextSibling()
{
return ref_wblnode(BaseAST::getNextSibling());
}
......
/*
* Proview $Id: wb_wnav.h,v 1.13 2006-03-31 14:29:39 claes Exp $
* Proview $Id: wb_wnav.h,v 1.14 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -27,7 +27,7 @@
//#endif
#ifndef pwr_h
# include "pwr.h"
//# include "pwr.h"
#endif
#ifndef co_regex_h
......@@ -35,23 +35,19 @@
#endif
#ifndef co_nav_help_h
# include "co_nav_help.h"
//# include "co_nav_help.h"
#endif
#ifndef flow_h
#include "flow.h"
#endif
#ifndef flow_browctx_h
#include "flow_browapi.h"
//#include "flow.h"
#endif
#ifndef wb_wnav_brow_h
#include "wb_wnav_brow.h"
#endif
#ifndef wb_pal_h
#include "wb_pal.h"
#ifndef wb_palfile_h
# include "wb_palfile.h"
#endif
#ifndef wb_build_opt_h
......@@ -59,12 +55,12 @@
#endif
#ifndef co_wow_h
#include "co_wow.h"
# include "co_wow.h"
#endif
#ifndef co_xhelp_h
#include "co_xhelp.h"
#endif
//#ifndef co_xhelp_h
//#include "co_xhelp.h"
//#endif
#ifndef wb_h
#include "wb.h"
......
/*
* Proview $Id: wb_wnav_brow.h,v 1.6 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wnav_brow.h,v 1.7 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -20,12 +20,8 @@
#ifndef wb_wnav_brow_h
#define wb_wnav_brow_h
#if defined __cplusplus
extern "C" {
#endif
#ifndef pwr_h
# include "pwr.h"
//# include "pwr.h"
#endif
#ifndef flow_h
......@@ -33,6 +29,10 @@ extern "C" {
#endif
#ifndef flow_browctx_h
#include "flow_browctx.h"
#endif
#ifndef flow_browapi_h
#include "flow_browapi.h"
#endif
......@@ -110,7 +110,4 @@ class WNavBrow {
void brow_setup();
};
#if defined __cplusplus
}
#endif
#endif
/*
* Proview $Id: flow.h,v 1.9 2005-10-21 16:11:22 claes Exp $
* Proview $Id: flow.h,v 1.10 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -535,15 +535,15 @@ typedef enum {
} flow_mDisplayLevel;
typedef enum {
flow_mSensitivity_MB1Click = 1 << 0,
flow_mSensitivity_MB1Click = 1 << 0,
flow_mSensitivity_MB1DoubleClick = 1 << 1,
flow_mSensitivity_MB1Press = 1 << 2,
flow_mSensitivity_MB2Click = 1 << 3,
flow_mSensitivity_MB1Press = 1 << 2,
flow_mSensitivity_MB2Click = 1 << 3,
flow_mSensitivity_MB2DoubleClick = 1 << 4,
flow_mSensitivity_MB2Press = 1 << 5,
flow_mSensitivity_MB3Click = 1 << 6,
flow_mSensitivity_MB2Press = 1 << 5,
flow_mSensitivity_MB3Click = 1 << 6,
flow_mSensitivity_MB3DoubleClick = 1 << 7,
flow_mSensitivity_MB3Press = 1 << 8
flow_mSensitivity_MB3Press = 1 << 8
} flow_mSensitivity;
......
/*
* Proview $Id: flow_browapi.h,v 1.7 2005-09-01 14:56:12 claes Exp $
* Proview $Id: flow_browapi.h,v 1.8 2006-05-21 22:30:50 lw Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -20,6 +20,14 @@
#ifndef flow_browapi_h
#define flow_browapi_h
#ifndef flow_h
#include "flow.h"
#endif
#ifndef flow_browctx_h
#include "flow_browctx.h"
#endif
#if defined __cplusplus
extern "C" {
#endif
......@@ -31,8 +39,6 @@ typedef void *FlowCtx;
#endif
#endif
#include "flow.h"
typedef struct {
double base_zoom_factor;
double indentation;
......@@ -43,7 +49,7 @@ typedef enum {
brow_eAttr_base_zoom_factor = 1 << 0,
brow_eAttr_indentation = 1 << 1,
brow_eAttr_annotation_space = 1 << 2
} brow_eAttribute;
} brow_eAttribute;
typedef BrowCtx *brow_tCtx;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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