aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--liberror.780
2 files changed, 86 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4d9f242..091428c 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,9 @@ MAN3 =\
liberror_set_error.3\
liberror_set_error_errno.3
+MAN7 =\
+ liberror.7
+
LOBJ = $(OBJ:.o=.lo)
@@ -66,6 +69,7 @@ install: liberror.a liberror.$(LIBEXT)
mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/liberror"
mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man3"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man7"
cp -- liberror.a "$(DESTDIR)$(PREFIX)/lib"
cp -- liberror.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/liberror.$(LIBMINOREXT)"
ln -sf -- liberror.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/liberror.$(LIBMAJOREXT)"
@@ -73,12 +77,14 @@ install: liberror.a liberror.$(LIBEXT)
cp -- liberror.h "$(DESTDIR)$(PREFIX)/include"
cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/liberror"
cp -- $(MAN3) "$(DESTDIR)$(MANPREFIX)/man3"
+ cp -- $(MAN7) "$(DESTDIR)$(MANPREFIX)/man7"
uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/liberror."*
-rm -f -- "$(DESTDIR)$(PREFIX)/include/liberror.h"
-rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/liberror"
-cd -- "$(DESTDIR)$(MANPREFIX)/man3" && rm -f -- $(MAN3)
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man7" && rm -f -- $(MAN7)
clean:
-rm -f -- *.o *.lo *.a *.so *.so.* *.su *.test
diff --git a/liberror.7 b/liberror.7
new file mode 100644
index 0000000..cfa4cc3
--- /dev/null
+++ b/liberror.7
@@ -0,0 +1,80 @@
+.TH LIBERROR 7 2019-04-13 liberror
+.SH NAME
+liberror \- single interface for custom and standard errors
+.SH SYNOPSIS
+.nf
+#include <liberror.h>
+.fi
+.PP
+Link with
+.IR \-lerror .
+.SH DESCRIPTION
+The
+.B liberror
+library provides a single interface for error handling.
+Specifically this is intended for cases where some
+errors are
+.I errno
+errors or other
+.B libc
+errors and there are library-specific, maybe for
+multiple libraries, errors.
+.PP
+The errors are thread-local, support error description,
+error source string (which function failed), and error
+code with error code group (e.g. \(dqerrno\(dq,
+\(dqaddrinfo\(dq or a library name), as well as cause
+chains, extended details, and if linked together with
+.BR liberror-backtrace ,
+backtraces.
+.PP
+The important functions are:
+.TP
+.BR liberror_get_error (3)
+Get error for the calling thread.
+.TP
+.BR liberror_set_error (3)
+Set error for the calling thread.
+.TP
+.BR liberror_set_error_errno (3)
+Wrapper for the
+.BR liberror_set_error (3)
+function for
+.I errno
+errors.
+.TP
+.BR liberror_reset_error (3)
+Remove error for the calling thread, needed because the
+.BR liberror_set_error (3)
+function otherwise stores the error as the cause of the
+new error.
+.TP
+.BR liberror_print_error (3)
+Print the error for the calling thread, include its
+backtrace if the
+.B liberror-backtrace
+library is also linked, the errors cause, and optionally
+remove the error for the calling thread.
+.SH ERRORS
+None.
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH SEE ALSO
+.BR liberror.h (0),
+.BR liberror_copy_error (3),
+.BR liberror_free_error (3),
+.BR liberror_get_error (3),
+.BR liberror_print_bactrace (3),
+.BR liberror_print_error (3),
+.BR liberror_reset_error (3),
+.BR liberror_save_backtrace (3),
+.BR liberror_set_error (3),
+.BR liberror_set_error_errno (3)