#include <stdio.h>
#include "covman.h"

static FILE *outfp;

static void write(char *key, char *value) {
	if (outfp == NULL) {
		outfp = fopen("coverage_result.txt", "w");
	}
	if (outfp != NULL) {
		fprintf(outfp, "%s,%s\n", value, key);
		fflush(outfp);
	}
}

int branch(char *key, int value) {
	write(key, value ? "1" : "2");
	return value;
}

void statement(char *key) {
	write(key, "3");
}
