Browse Source

add verbosity control, first part

master
tth 2 years ago
parent
commit
50efd881f6
2 changed files with 7 additions and 0 deletions
  1. +3
    -0
      fake-values.c
  2. +4
    -0
      funcs.c

+ 3
- 0
fake-values.c View File

@ -5,10 +5,13 @@
#include <stdio.h>
#include "funcs.h"
int verbosity;
int main(int argc, char *argv[])
{
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
verbosity = 1;
printf("%d\n", random1000(0));
return 0;


+ 4
- 0
funcs.c View File

@ -7,9 +7,13 @@
#include "funcs.h"
extern int verbosity;
int random1000(int foo)
{
int value;
if (verbosity)
fprintf(stderr, "%s(%d)\n", __func__, foo);
value = rand() % 1000;
return value;
}

Loading…
Cancel
Save