Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
f3182024
Commit
f3182024
authored
Feb 06, 2003
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed dependency to errh
parent
7ef66acd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
44 deletions
+40
-44
src/lib/co/src/co_dbs.c
src/lib/co/src/co_dbs.c
+5
-9
src/lib/co/src/co_dbs.pdr
src/lib/co/src/co_dbs.pdr
+35
-35
No files found.
src/lib/co/src/co_dbs.c
View file @
f3182024
...
...
@@ -10,9 +10,9 @@
#include "pwr.h"
#include "co_dbs.h"
#include "co_dbs_msg.h"
#include "co_errno.h"
#include "co_platform.h"
#include "rt_errh.h"
...
...
@@ -267,7 +267,7 @@ dbs_Reference(pwr_tStatus sts*, dbs_sEnv *ep, void *adrs)
pwr_tBoolean
dbs_Close
(
pwr_tStatus
*
sts
,
dbs_sEnv
*
ep
)
{
*
sts
=
1
;
/** @todo msg code */
*
sts
=
DBS__SUCCESS
;
fclose
(
ep
->
f
);
ep
->
f
=
NULL
;
...
...
@@ -281,19 +281,17 @@ dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
co_mFormat
srcFormat
,
ownFormat
;
PDR
pdrs
;
*
sts
=
1
;
/** @todo msg code */
*
sts
=
DBS__SUCCESS
;
memset
(
ep
,
0
,
sizeof
(
*
ep
));
f
=
fopen
(
filename
,
"r"
);
if
(
f
==
NULL
)
{
*
sts
=
errno_GetStatus
();
errh_Error
(
"Failed to open: %s, %m"
,
filename
,
*
sts
);
return
NULL
;
}
if
(
fread
(
&
ep
->
file
,
sizeof
(
ep
->
file
),
1
,
f
)
==
0
)
{
*
sts
=
errno_GetStatus
();
errh_Error
(
"Failed to read dbs_sFile from: %s, %m"
,
filename
,
*
sts
);
fclose
(
f
);
return
NULL
;
}
...
...
@@ -308,9 +306,7 @@ dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
if
(
srcFormat
.
m
!=
ownFormat
.
m
)
{
pdrmem_create
(
&
pdrs
,
&
ep
->
file
,
sizeof
(
ep
->
file
),
PDR_DECODE
,
srcFormat
,
ownFormat
);
if
(
!
pdr_dbs_sFile
(
&
pdrs
,
&
ep
->
file
))
{
/** @todo Define error messages for co_dbs */
*
sts
=
2
;
errh_Error
(
"pdr_dbs_sFile failed for: %s"
,
filename
);
*
sts
=
DBS__PDRFILE
;
fclose
(
f
);
return
NULL
;
}
...
...
@@ -326,7 +322,7 @@ pwr_tBoolean
dbs_AlignedRead
(
pwr_tStatus
*
sts
,
void
*
buf
,
pwr_tUInt32
size
,
dbs_sEnv
*
ep
)
{
int
offset
;
*
sts
=
1
;
/**@todo dbs errorcode */
*
sts
=
DBS__SUCCESS
;
if
(
fread
(
buf
,
size
,
1
,
ep
->
f
)
==
0
)
...
...
src/lib/co/src/co_dbs.pdr
View file @
f3182024
...
...
@@ -6,7 +6,7 @@
%extern "C" {
%#endif
%
%/* co_dbs.h -- database snapsho
p
files
%/* co_dbs.h -- database snapsho
t
files
%
% PROVIEW/R
% Copyright (C) 2002 by Cell Network AB.
...
...
@@ -104,46 +104,46 @@
%
%#if defined OS_VMS || defined OS_ELN
%
%# define dbs_cNameDirectory
"pwrp_load:"
%# define dbs_cDirectory
"pwrp_load:"
%# define dbs_cNamePlc
"%splc_%s_%04d_%05d.exe"
%
%# define dbs_cNameBootList
"pwrp_root:[common.db]pwrp_cnf_bootlist.dat"
%# define dbs_cNameVolumeList
"pwrp_root:[common.db]pwrp_cnf_volumelist.dat"
%# define dbs_cNamePlcVersion
"pwrp_root:[common.db]pwrp_cnf_plcvers_%s.dat"
%# define dbs_cNameDistribute
"pwrp_root:[common.db]pwrp_cnf_distribute.dat"
%# define dbs_cNameSysObject
"pwrp_root:[common.db]pwrp_cnf_sysobject.dat"
%# define dbs_cNameGblVolumeList
"pwra_db:pwr_volumelist.dat"
%# define dbs_cNameRttCrr
"rtt_crr_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrObj
"rtt_crro_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrCode
"rtt_crrc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttPlc
"rtt_plc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameDirectory "pwrp_load:"
%# define dbs_cDirectory
"pwrp_load:"
%# define dbs_cNamePlc
"%splc_%s_%04d_%05d.exe"
%
%# define dbs_cNameBootList
"pwrp_root:[common.db]pwrp_cnf_bootlist.dat"
%# define dbs_cNameVolumeList
"pwrp_root:[common.db]pwrp_cnf_volumelist.dat"
%# define dbs_cNamePlcVersion
"pwrp_root:[common.db]pwrp_cnf_plcvers_%s.dat"
%# define dbs_cNameDistribute
"pwrp_root:[common.db]pwrp_cnf_distribute.dat"
%# define dbs_cNameSysObject "pwrp_root:[common.db]pwrp_cnf_sysobject.dat"
%# define dbs_cNameGblVolumeList "pwra_db:pwr_volumelist.dat"
%# define dbs_cNameRttCrr "rtt_crr_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrObj "rtt_crro_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrCode "rtt_crrc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttPlc "rtt_plc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%
%#elif defined OS_LYNX || defined OS_LINUX
%
%# define dbs_cNameDirectory
"pwrp_load"
%# define dbs_cDirectory
"$pwrp_load/"
%# define dbs_cNamePlc
"%splc_%s_%04d_%05d"
%
%# define dbs_cNameBootList
"$pwrp_root/common/db/pwrp_cnf_bootlist.dat"
%# define dbs_cNameVolumeList
"$pwrp_root/common/db/pwrp_cnf_volumelist.dat"
%# define dbs_cNamePlcVersion
"$pwrp_root/common/db/pwrp_cnf_plcvers_%s.dat"
%# define dbs_cNameDistribute
"$pwrp_root/common/db/pwrp_cnf_distribute.dat"
%# define dbs_cNameSysObject
"$pwrp_root/common/db/pwrp_cnf_sysobject.dat"
%# define dbs_cNameGblVolumeList
"$pwra_db/pwr_volumelist.dat"
%# define dbs_cNameRttCrr
"rtt_crr_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrObj
"rtt_crro_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrCode
"rtt_crrc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttPlc
"rtt_plc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameDirectory "pwrp_load"
%# define dbs_cDirectory
"$pwrp_load/"
%# define dbs_cNamePlc
"%splc_%s_%04d_%05d"
%
%# define dbs_cNameBootList
"$pwrp_root/common/db/pwrp_cnf_bootlist.dat"
%# define dbs_cNameVolumeList
"$pwrp_root/common/db/pwrp_cnf_volumelist.dat"
%# define dbs_cNamePlcVersion
"$pwrp_root/common/db/pwrp_cnf_plcvers_%s.dat"
%# define dbs_cNameDistribute
"$pwrp_root/common/db/pwrp_cnf_distribute.dat"
%# define dbs_cNameSysObject "$pwrp_root/common/db/pwrp_cnf_sysobject.dat"
%# define dbs_cNameGblVolumeList "$pwra_db/pwr_volumelist.dat"
%# define dbs_cNameRttCrr "rtt_crr_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrObj "rtt_crro_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttCrrCode "rtt_crrc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%# define dbs_cNameRttPlc "rtt_plc_%03.3d_%03.3d_%03.3d_%03.3d.dat"
%
%#endif
%
%#define dbs_cNameVolume
"%s%s.dbs" /* <volume name>.dbs */
%#define
dbs_cNameAlias
"%spwrp_alias.dat"
%#define
dbs_cNameAppl
"%sld_appl_%s_%d.txt"
%#define
dbs_cNameBoot
"%sld_boot_%s_%04d.dat"
%#define
dbs_cNameNode
"%sld_node_%04d.dat"
%#define
dbs_cNameRc
"%sld_rc_%s_%04d.dat"
%#define dbs_cNameVolume
"%s%s.dbs" /* <volume name>.dbs */
%#define
dbs_cNameAlias
"%spwrp_alias.dat"
%#define
dbs_cNameAppl
"%sld_appl_%s_%d.txt"
%#define
dbs_cNameBoot
"%sld_boot_%s_%04d.dat"
%#define
dbs_cNameNode
"%sld_node_%04d.dat"
%#define
dbs_cNameRc
"%sld_rc_%s_%04d.dat"
%
%/**
% * A database load file is organised in sections.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment