add verbosity control, first part
This commit is contained in:
parent
b022744a46
commit
50efd881f6
@ -5,10 +5,13 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
|
|
||||||
|
int verbosity;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
|
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
|
||||||
|
|
||||||
|
verbosity = 1;
|
||||||
printf("%d\n", random1000(0));
|
printf("%d\n", random1000(0));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
4
funcs.c
4
funcs.c
@ -7,9 +7,13 @@
|
|||||||
|
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
|
|
||||||
|
extern int verbosity;
|
||||||
|
|
||||||
int random1000(int foo)
|
int random1000(int foo)
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
|
if (verbosity)
|
||||||
|
fprintf(stderr, "%s(%d)\n", __func__, foo);
|
||||||
value = rand() % 1000;
|
value = rand() % 1000;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user