diff options
| author | Jan Sucan <jan@jansucan.com> | 2021-05-02 10:19:23 +0200 |
|---|---|---|
| committer | Jan Sucan <jan@jansucan.com> | 2021-05-02 10:20:29 +0200 |
| commit | 02ffe0ed4113e7b479197d0ba1b160e6280b4099 (patch) | |
| tree | c7a3573039ba02983eec38267d61d86e1965bbab /src/print.c | |
| parent | 36a92af6ee3c20c93835a34ddeb148c34ccf023c (diff) | |
Move the source files to a src directory
Diffstat (limited to 'src/print.c')
| -rw-r--r-- | src/print.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c new file mode 100644 index 0000000..824f818 --- /dev/null +++ b/src/print.c @@ -0,0 +1,21 @@ +#include <stdarg.h> +#include <stdio.h> + +#include "print.h" + +#define PRINT_ERROR_PREFIX "ERROR: " +#define PRINT_ERROR_SUFFIX "\n" + +void +print_error(const char *const format, ...) +{ + fprintf(stderr, PRINT_ERROR_PREFIX); + + va_list args; + + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + + fprintf(stderr, PRINT_ERROR_SUFFIX); +} |
