aboutsummaryrefslogtreecommitdiff
path: root/src/logerr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logerr.c')
-rw-r--r--src/logerr.c67
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
+ );
+}