1 /* very simple error handling functions */
10 /* print "ERROR: " followed by error msg "fmt", a printf style format string */
16 (void) fflush(stdout
);
17 fprintf(stderr
, "ERROR: ");
20 (void) vfprintf(stderr
, fmt
, ap
);
23 (void) putc('\n', stderr
);
26 /* call error and die */
32 (void) fflush(stdout
);
33 fprintf(stderr
, "ERROR: ");
36 (void) vfprintf(stderr
, fmt
, ap
);
39 (void) putc('\n', stderr
);
46 register void *p
= malloc(size
);
49 fatal("out of memory");
54 erealloc(void *ptr
, size_t size
)
62 ptr
= realloc(ptr
, size
);
64 fatal("out of memory");
70 efopen(const char *path
, const char *mode
)
72 FILE *p
= fopen(path
, mode
);
75 error("unable to open file: %s", path
);