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
Show 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 @@
...
@@ -10,9 +10,9 @@
#include "pwr.h"
#include "pwr.h"
#include "co_dbs.h"
#include "co_dbs.h"
#include "co_dbs_msg.h"
#include "co_errno.h"
#include "co_errno.h"
#include "co_platform.h"
#include "co_platform.h"
#include "rt_errh.h"
...
@@ -267,7 +267,7 @@ dbs_Reference(pwr_tStatus sts*, dbs_sEnv *ep, void *adrs)
...
@@ -267,7 +267,7 @@ dbs_Reference(pwr_tStatus sts*, dbs_sEnv *ep, void *adrs)
pwr_tBoolean
pwr_tBoolean
dbs_Close
(
pwr_tStatus
*
sts
,
dbs_sEnv
*
ep
)
dbs_Close
(
pwr_tStatus
*
sts
,
dbs_sEnv
*
ep
)
{
{
*
sts
=
1
;
/** @todo msg code */
*
sts
=
DBS__SUCCESS
;
fclose
(
ep
->
f
);
fclose
(
ep
->
f
);
ep
->
f
=
NULL
;
ep
->
f
=
NULL
;
...
@@ -281,19 +281,17 @@ dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
...
@@ -281,19 +281,17 @@ dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
co_mFormat
srcFormat
,
ownFormat
;
co_mFormat
srcFormat
,
ownFormat
;
PDR
pdrs
;
PDR
pdrs
;
*
sts
=
1
;
/** @todo msg code */
*
sts
=
DBS__SUCCESS
;
memset
(
ep
,
0
,
sizeof
(
*
ep
));
memset
(
ep
,
0
,
sizeof
(
*
ep
));
f
=
fopen
(
filename
,
"r"
);
f
=
fopen
(
filename
,
"r"
);
if
(
f
==
NULL
)
{
if
(
f
==
NULL
)
{
*
sts
=
errno_GetStatus
();
*
sts
=
errno_GetStatus
();
errh_Error
(
"Failed to open: %s, %m"
,
filename
,
*
sts
);
return
NULL
;
return
NULL
;
}
}
if
(
fread
(
&
ep
->
file
,
sizeof
(
ep
->
file
),
1
,
f
)
==
0
)
{
if
(
fread
(
&
ep
->
file
,
sizeof
(
ep
->
file
),
1
,
f
)
==
0
)
{
*
sts
=
errno_GetStatus
();
*
sts
=
errno_GetStatus
();
errh_Error
(
"Failed to read dbs_sFile from: %s, %m"
,
filename
,
*
sts
);
fclose
(
f
);
fclose
(
f
);
return
NULL
;
return
NULL
;
}
}
...
@@ -308,9 +306,7 @@ dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
...
@@ -308,9 +306,7 @@ dbs_Open(pwr_tStatus *sts, dbs_sEnv *ep, const char *filename)
if
(
srcFormat
.
m
!=
ownFormat
.
m
)
{
if
(
srcFormat
.
m
!=
ownFormat
.
m
)
{
pdrmem_create
(
&
pdrs
,
&
ep
->
file
,
sizeof
(
ep
->
file
),
PDR_DECODE
,
srcFormat
,
ownFormat
);
pdrmem_create
(
&
pdrs
,
&
ep
->
file
,
sizeof
(
ep
->
file
),
PDR_DECODE
,
srcFormat
,
ownFormat
);
if
(
!
pdr_dbs_sFile
(
&
pdrs
,
&
ep
->
file
))
{
if
(
!
pdr_dbs_sFile
(
&
pdrs
,
&
ep
->
file
))
{
/** @todo Define error messages for co_dbs */
*
sts
=
DBS__PDRFILE
;
*
sts
=
2
;
errh_Error
(
"pdr_dbs_sFile failed for: %s"
,
filename
);
fclose
(
f
);
fclose
(
f
);
return
NULL
;
return
NULL
;
}
}
...
@@ -326,7 +322,7 @@ pwr_tBoolean
...
@@ -326,7 +322,7 @@ pwr_tBoolean
dbs_AlignedRead
(
pwr_tStatus
*
sts
,
void
*
buf
,
pwr_tUInt32
size
,
dbs_sEnv
*
ep
)
dbs_AlignedRead
(
pwr_tStatus
*
sts
,
void
*
buf
,
pwr_tUInt32
size
,
dbs_sEnv
*
ep
)
{
{
int
offset
;
int
offset
;
*
sts
=
1
;
/**@todo dbs errorcode */
*
sts
=
DBS__SUCCESS
;
if
(
fread
(
buf
,
size
,
1
,
ep
->
f
)
==
0
)
if
(
fread
(
buf
,
size
,
1
,
ep
->
f
)
==
0
)
...
...
src/lib/co/src/co_dbs.pdr
View file @
f3182024
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
%extern "C" {
%extern "C" {
%#endif
%#endif
%
%
%/* co_dbs.h -- database snapsho
p
files
%/* co_dbs.h -- database snapsho
t
files
%
%
% PROVIEW/R
% PROVIEW/R
% Copyright (C) 2002 by Cell Network AB.
% Copyright (C) 2002 by Cell Network AB.
...
...
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