Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
boids
boids4
Commits
d6d9d306
Commit
d6d9d306
authored
Oct 24, 2015
by
Cassio Kirch
Browse files
Print help or parameters
parent
84cafcbb
Changes
3
Hide whitespace changes
Inline
Side-by-side
files.c
View file @
d6d9d306
...
...
@@ -102,3 +102,8 @@ FILE* initializeFinalConfigurationFile()
return
finalConfigurationFile
;
}
void
printParameters
()
{
putParametersToFile
(
stdout
);
}
files.h
View file @
d6d9d306
#include "boid.h"
FILE
*
initializeSingleFile
();
FILE
*
initializeStepAndTypeFile
(
const
unsigned
long
long
int
step
,
\
...
...
@@ -11,3 +12,5 @@ FILE* initializeFinalConfigurationFile();
void
setDate
();
char
*
getDate
();
void
printParameters
();
main.c
View file @
d6d9d306
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "define.h"
#include "comp_errors.h"
...
...
@@ -28,6 +29,7 @@ getGamma (const struct Boid* const boids)
}
while
(
boidCount
!=
0
);
#ifdef DEBUG
for
(
boidCount
=
endoBoids
;
boidCount
<
N
;
++
boidCount
)
if
(
boids
[
boidCount
].
type
==
ENDODERM
)
...
...
@@ -44,12 +46,15 @@ one_system ()
struct
Box
box
[
BOXES
];
unsigned
int
boidCount
,
boxID
,
threadCount
;
unsigned
long
long
int
step
,
continuousStep
=
0
;
//FILE* dat = initializeSingleFile();
FILE
*
finalConfigurationFile
;
#ifdef PLOT_EXIT_FILES
FILE
*
endoFile
;
FILE
*
ectoFile
;
#endif
#ifdef GAMMA_FILE
FILE
*
gammaFile
=
initializeGammaFile
();
#endif
...
...
@@ -148,14 +153,32 @@ one_system ()
fclose
(
finalConfigurationFile
);
}
void
printHelp
()
{
printf
(
"-h
\t
"
"Show this help menu.
\n
"
);
printf
(
"-p
\t
"
"Show the parameters compiled.
\n
"
);
}
int
main
()
main
(
int
argc
,
char
**
argv
)
{
int
returned
=
checkParameters
();
if
(
returned
!=
0
)
return
returned
;
setDate
();
srand
(
time
(
NULL
));
one_system
();
if
(
argc
>
1u
)
{
if
(
strcmp
(
argv
[
1
],
"-p"
)
==
0
)
printParameters
();
else
printHelp
();
}
else
{
int
returned
=
checkParameters
();
if
(
returned
!=
0
)
return
returned
;
setDate
();
srand
(
time
(
NULL
));
one_system
();
}
return
0
;
}
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