Newer
Older
emul / emul_io_file.c
@TakayunDev TakayunDev on 6 May 2016 340 bytes initial commit
#include "emul_io_file.h"

FILE *fp;

void emul_out_file(char c) {
    fputc(c, fp);
}

char emul_cin_file() {
    return fgetc(fp);
}

void emul_open_file(char *filename, char *mode) {
    if ((fp = fopen(filename, mode)) == NULL) {
	fprintf(stderr, "File open failed: %s\n", filename);
    }
}

void emul_close_file() {
    fclose(fp);
}