nc/src/printevents.c
2023-04-01 23:13:39 -04:00

30 lines
526 B
C

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../include/libcolor.h"
#include "config.h"
char printevents() {
FILE *fp;
char filename[100], contents;
fp = fopen(NC_EVENTS_FILE, "r");
if (fp == NULL) {
printf(TXT_BOLD COL_RED "events file does not exist\n");
printf("ensure the events file defined in config.h exists\n" COL_RESET TXT_RESET);
exit(1);
}
contents = fgetc(fp);
while (contents != EOF) {
printf ("%c", contents);
contents = fgetc(fp);
}
fclose(fp);
exit(0);
}