diff options
author | EuAndreh <eu@euandre.org> | 2021-09-01 11:03:49 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-09-01 11:07:11 -0300 |
commit | 7eef4f04d9fd1fc8ecc38392ce1adb1c44899adc (patch) | |
tree | 7366fac128a49fb2b128090ca6b69f147ebfe583 /src/logerr.c | |
parent | tests/lib.sh: Update (diff) | |
download | remembering-7eef4f04d9fd1fc8ecc38392ce1adb1c44899adc.tar.gz remembering-7eef4f04d9fd1fc8ecc38392ce1adb1c44899adc.tar.xz |
Refactor C files, split logerr and tests-lib
Diffstat (limited to 'src/logerr.c')
-rw-r--r-- | src/logerr.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/logerr.c b/src/logerr.c new file mode 100644 index 0000000..029ed7f --- /dev/null +++ b/src/logerr.c @@ -0,0 +1,67 @@ +#include "config.h" +#include "logerr.h" + +#include <stdio.h> + + +void +logerr_file( + const char *const s, + const char *const msg, + const char *const file, + const int lineno +) { + fprintf( + stderr, + "%s:%s:%d: %s: %s\n", + PROGNAME, + file, + lineno, + s, + msg + ); +} + +void +logerrs_file( + const char *const pre, + const char *const mid, + const char *const post, + const char *const msg, + const char *const file, + const int lineno +) { + fprintf( + stderr, + "%s:%s:%d: %s%s%s: %s\n", + PROGNAME, + file, + lineno, + pre, + mid, + post, + msg + ); +} + +void +logerrl_file( + const char *const pre, + const size_t mid, + const char *const post, + const char *const msg, + const char *const file, + int lineno +) { + fprintf( + stderr, + "%s:%s:%d: %s%ld%s: %s\n", + PROGNAME, + file, + lineno, + pre, + mid, + post, + msg + ); +} |