DD2-monitor/fake-values.c

39 lines
682 B
C
Raw Normal View History

2018-12-05 15:40:31 +01:00
/*
2018-12-08 13:02:24 +01:00
* fake-values.c
2018-12-05 15:40:31 +01:00
*/
#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-06 21:06:34 +01:00
int opt;
int type = 0;
2018-12-05 18:14:52 +01:00
2018-12-06 21:06:34 +01:00
while ((opt = getopt(argc, argv, "vst:")) != -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;
2018-12-06 21:06:34 +01:00
case 't': type = atoi(optarg); break;
2018-12-05 19:15:01 +01:00
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-06 21:06:34 +01:00
printf("%f %d\n", dtime(), random1000(type));
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
/* --------------------------------------------------------------- */