aboutsummaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-04-12 21:37:25 +0200
committerMattias Andrée <maandree@kth.se>2019-04-12 21:37:25 +0200
commit505526b00aefe81765441c22b589b1e2bad92f5a (patch)
tree64d7c4442127530da23066ff6b9dc603c7ec0a80 /README
parentFix memory leak in set_error (diff)
downloadliberror-505526b00aefe81765441c22b589b1e2bad92f5a.tar.gz
liberror-505526b00aefe81765441c22b589b1e2bad92f5a.tar.bz2
liberror-505526b00aefe81765441c22b589b1e2bad92f5a.tar.xz
Add readme
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--README33
1 files changed, 33 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..4d24223
--- /dev/null
+++ b/README
@@ -0,0 +1,33 @@
+A library that provides a single interface for error handling.
+Specifically this is intended for cases where some errors are
+errno errors or other libc errors and there are library
+specific, maybe multiple library, errors.
+
+The errors are thread-local, support error description, error
+source string (which function failed), and error code with
+error code group (e.g. "errno", "addrinfo" or a library name),
+as well as cause chains, and if linked together with
+liberror-backtrace, backtraces.
+
+
+The important functions are:
+
+ liberror_get_error
+ Get error for the calling thread
+
+ liberror_set_error
+ Set error for the calling thread
+
+ liberror_set_error_errno
+ Wrapper for liberror_set_error for errno errors
+
+ liberror_reset_error
+ Remove error for the calling thread, needed
+ because `liberror_set_error` otherwise stores
+ the error as the cause of the new error
+
+ liberror_print_error
+ Print the error for the calling thread, include
+ its backtrace if liberror-backtrace is also
+ linked, the errors cause, and optionally remove
+ the error for the calling thread.