ncurses-gameoflife/log.c
Sheldon Lee fada7a7af3 Tweaks.
2020-07-01 02:01:04 +01:00

24 lines
309 B
C

#include <stdio.h>
#include "log.h"
static FILE* file = 0;
static char* name;
void startLog(char* filename)
{
name = filename;
file = fopen(filename, "w");
}
void logLine(char* string)
{
if (!file) return;
fputs(string, file);
fputs("\n", file);
}
void endLog()
{
if (!file) return;
fclose(file);
}