/* dump.c dumps a file to stdout By Bill Kendrick kendrick@zippy.sonoma.edu http://zippy.sonoma.edu/~kendrick/ New Breed Software April 6, 1996 / Sept. 20, 1996 */ #include #include "dump.h" int dump_no_abort(char * filename) { FILE * fi; int c; fi = fopen(filename, "r"); if (fi == NULL) return(-1); else { do { c = fgetc(fi); if (c != EOF) fputc(c, stdout); } while (c != EOF); fclose(fi); return(0); } } void dump(char * filename) { if (dump_no_abort(filename) == -1) { printf("Can't open %s\n", filename); exit(0); } }