Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
saeed
odb_view
Commits
eeb23774
Commit
eeb23774
authored
Nov 24, 2019
by
saeed
Browse files
file exist is added
parent
e9a53fb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
compile.sh
View file @
eeb23774
time
gcc
-std
=
c99
-O2
rita.c
-o
odbview
-lX11
-lm
-lpthread
time
gcc
-Wall
-std
=
c99
-O2
rita.c
-o
odbview
-lX11
-lm
-lpthread
config.h
View file @
eeb23774
...
...
@@ -11,4 +11,4 @@
#define oceancolor 0xffffffff
#define landcolor 0x91919191
#define stncolor 0x00bf0000
#define landseamask_file "
/home/a002066/odbview/
landseamask.bin"
#define landseamask_file "landseamask.bin"
run_main.c
View file @
eeb23774
...
...
@@ -8,7 +8,14 @@ static int run_view(int argc,char *argv[]){
}
if
(
argc
>=
2
){
if
(
!
file_exist
(
landseamask_file
)){
printf
(
"file %s does not exist so we quit
\n
"
,
landseamask_file
);
result
=
1
;
return
result
;
}
int
width
=
WIDTH_INIT
;
int
height
=
HEIGHT_INIT
;
int
ncolor
=
0
;
...
...
util.c
View file @
eeb23774
static
int
file_exist
(
char
*
filename
){
int
result
=
0
;
if
(
filename
){
FILE
*
file
=
fopen
(
filename
,
"r"
);
if
(
file
){
result
=
1
;
fclose
(
file
);
}
}
return
result
;
}
static
float
getradius
(
int
w
,
int
h
,
struct
screen_dim
*
scdim
){
float
result
=
(
float
)(((
float
)(
w
*
h
)
/
(
float
)(
scdim
->
width
*
scdim
->
height
))
*
scdim
->
symbol_radius
);
...
...
Write
Preview
Supports
Markdown
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