aboutsummaryrefslogtreecommitdiff
path: root/data_recorder.c
blob: 968ae17b9de53b2d60d9e87620d4645e78a9ea83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * Most of the data recorder functionality lives in the library now; this just enables
 * stdout by default if no record file is specified.
 */
#include <stdio.h>
#include <string.h>
#include <survive.h>

int main(int argc, char **argv) {
	SurviveContext *ctx = survive_init(argc, argv);
	if (ctx == 0) // implies -help or similiar
		return 0;

	const char *dataout_file = survive_configs(ctx, "record", SC_GET, "");
	if (strlen(dataout_file) == 0) {
		survive_configi(ctx, "record-stdout", SC_SET | SC_OVERRIDE, 1);
	}

	survive_startup(ctx);

	while (survive_poll(ctx) == 0) {
	}

	survive_close(ctx);
	return 0;
}