From 76d0af5599554d11f104d582cdac8fbaa8569fcc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 4 Mar 2016 23:50:00 +0100 Subject: Clean up, add zerror and zperror, fix bugs and add more tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- man/zerror.3 | 41 +++++++++++++++++++++++++++++++++++++++++ man/zperror.3 | 21 +++++++++++++++++++++ man/zsetup.3 | 4 +++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 man/zerror.3 create mode 100644 man/zperror.3 (limited to 'man') diff --git a/man/zerror.3 b/man/zerror.3 new file mode 100644 index 0000000..837b3df --- /dev/null +++ b/man/zerror.3 @@ -0,0 +1,41 @@ +.TH ZERROR 3 libzahl +.SH NAME +zerror - Get the error that caused a jump to the jmp_buf passed to zsetup +.SH SYNOPSIS +.nf +#include + +enum zerror zerror(const char **\fIdesc\fP); +.fi +.SH DESCRIPTION +.B zerror +shall return the error that caused a libzahl +function to perform a long jump to the point +specified to +.BR zsetup (3). +If +.I desc +is not +.BR 0 , +a textual description is set stored in +.IR *desc . +This string may be changed by a subsequent +call to +.BR strerror (3), +.BR perror (3), +.BR zperror (3), +and similar functions. +.P +Currently available +.B "enum zerror" +values are: +.P +.TP +.B ZERROR_ERRNO_SET +The error is stored in +.IR errno . +(The error may not be stored in +.I errno +until this function is called.) +.SH SEE ALSO +.BR zperror (3) diff --git a/man/zperror.3 b/man/zperror.3 new file mode 100644 index 0000000..fa01d90 --- /dev/null +++ b/man/zperror.3 @@ -0,0 +1,21 @@ +.TH ZPERROR 3 libzahl +.SH NAME +zperror - Print a libzahl error message +.SH SYNOPSIS +.nf +#include + +void zperror(const char *\fIprefix\fP); +.fi +.SH DESCRIPTION +.B zperror +prints a libzahl error message to standard error. +Unless +.I prefix +is +.B 0 +or an empty string, the message is prefixed by +.IR prefix , +a colon and a blank space. +.SH SEE ALSO +.BR zerror (3) diff --git a/man/zsetup.3 b/man/zsetup.3 index df81556..14c04c5 100644 --- a/man/zsetup.3 +++ b/man/zsetup.3 @@ -56,4 +56,6 @@ code. Instead libzahl goes directly to the part of the program that handles the error. .SH SEE ALSO .BR zunsetup (3), -.BR zinit (3) +.BR zinit (3), +.BR zerror (3), +.BR zperror (3) -- cgit v1.2.3-70-g09d2