DD2-monitor/fake-values.c

38 lines
620 B
C
Raw Normal View History

2018-12-05 15:40:31 +01:00
/*
* fake-values.c
*/
#include <stdio.h>
2018-12-05 18:14:52 +01:00
#include <unistd.h>
2018-12-05 19:15:01 +01:00
#include <stdlib.h>
2018-12-05 18:14:52 +01:00
2018-12-05 16:00:11 +01:00
#include "funcs.h"
2018-12-05 15:40:31 +01:00
2018-12-05 16:04:09 +01:00
int verbosity;
2018-12-05 18:14:52 +01:00
/* --------------------------------------------------------------- */
2018-12-05 15:44:04 +01:00
int main(int argc, char *argv[])
2018-12-05 15:40:31 +01:00
{
2018-12-05 18:14:52 +01:00
int opt;
2018-12-05 19:15:01 +01:00
while ((opt = getopt(argc, argv, "vs")) != -1) {
2018-12-05 18:14:52 +01:00
switch (opt) {
2018-12-05 19:15:01 +01:00
case 'v': verbosity++; break;
case 's': srand(getpid()); break;
default: break;
2018-12-05 18:14:52 +01:00
}
}
2018-12-05 19:15:01 +01:00
if (verbosity > 1) {
2018-12-05 18:14:52 +01:00
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
2018-12-05 19:15:01 +01:00
}
2018-12-05 18:14:52 +01:00
2018-12-05 15:40:31 +01:00
2018-12-05 17:58:55 +01:00
printf("%f %d\n", dtime(), random1000(0));
2018-12-05 16:00:11 +01:00
2018-12-05 15:40:31 +01:00
return 0;
}
2018-12-05 18:14:52 +01:00
/* --------------------------------------------------------------- */