DD2-monitor/fake-values.c

41 lines
730 B
C
Raw Normal View History

2018-12-06 01:40:31 +11:00
/*
2018-12-08 23:02:24 +11:00
* fake-values.c
2019-01-27 23:03:59 +11:00
* -------------
* useless software
2018-12-06 01:40:31 +11:00
*/
#include <stdio.h>
2018-12-06 04:14:52 +11:00
#include <unistd.h>
2018-12-06 05:15:01 +11:00
#include <stdlib.h>
2018-12-06 04:14:52 +11:00
2019-01-18 04:37:30 +11:00
#include "core/utils.h"
2018-12-06 01:40:31 +11:00
2018-12-06 02:04:09 +11:00
int verbosity;
2018-12-06 04:14:52 +11:00
/* --------------------------------------------------------------- */
2018-12-06 01:44:04 +11:00
int main(int argc, char *argv[])
2018-12-06 01:40:31 +11:00
{
2018-12-07 07:06:34 +11:00
int opt;
int type = 0;
2018-12-06 04:14:52 +11:00
2018-12-07 07:06:34 +11:00
while ((opt = getopt(argc, argv, "vst:")) != -1) {
2018-12-06 04:14:52 +11:00
switch (opt) {
2018-12-06 05:15:01 +11:00
case 'v': verbosity++; break;
case 's': srand(getpid()); break;
2018-12-07 07:06:34 +11:00
case 't': type = atoi(optarg); break;
2018-12-06 05:15:01 +11:00
default: break;
2018-12-06 04:14:52 +11:00
}
}
2018-12-06 05:15:01 +11:00
if (verbosity > 1) {
2018-12-06 04:14:52 +11:00
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
2018-12-06 05:15:01 +11:00
}
2018-12-06 04:14:52 +11:00
2019-01-27 23:15:33 +11:00
printf("%.3f %4d\n", dtime(), random1000(type));
2018-12-06 02:00:11 +11:00
2018-12-06 01:40:31 +11:00
return 0;
}
2018-12-06 04:14:52 +11:00
/* --------------------------------------------------------------- */