diff --git a/log.c b/log.c new file mode 100644 index 0000000..38e9ec3 --- /dev/null +++ b/log.c @@ -0,0 +1,22 @@ +#include +#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() +{ + fclose(file); +} diff --git a/log.h b/log.h new file mode 100644 index 0000000..1ad1339 --- /dev/null +++ b/log.h @@ -0,0 +1,10 @@ +#ifndef LOG_H +#define LOG_H + +void startLog(char* filename); + +void logLine(char* string); + +void endLog(); + +#endif