libutil

C Utility Library
git clone http://git.omkov.net/libutil
Log | Tree | Refs | README | LICENCE | Download

AuthorJamozed <[email protected]>
Date2020-10-29 10:12:14
Commit07c88d8b06038d087007f2a2788a5a767c02db08
Parent5eb6683ac22a6bc9baf1a3b4416105d01db40718

error: Add manpage

Diffstat

M README.md | 4 ++--
A man/error.3 | 27 +++++++++++++++++++++++++++

2 files changed, 29 insertions, 2 deletions

diff --git a/README.md b/README.md
index 27932d8..ed382de 100644
--- a/README.md
+++ b/README.md
@@ -8,14 +8,14 @@ OMKOV lib is a lightweight generic library to be included locally in projects.
 
 | Component        | Description                                         |
 | ---------------- | --------------------------------------------------- |
-| error            | Print formatted error messages                      |
+| error            | Error reporting functions                           |
 | mode             | Parse numeric or symbolic POSIX modes               |
 | optget           | Parse arguments                                     |
 
 ## Build Instructions
 
 OMKOV lib uses CMake to build.
-Binaries will be located in the `bin` directory.
+Binaries will be located in the `bin` directory.  
 Libraries will be located in the `lib` directory.
 
 ### UNIX Build
diff --git a/man/error.3 b/man/error.3
new file mode 100644
index 0000000..7ca7f76
--- /dev/null
+++ b/man/error.3
@@ -0,0 +1,27 @@
+.TH ERROR 3 2020-10-29 "OMKOV lib" "OMKOV lib Programmer's Manual"
+.SH NAME
+error, warn, serr \(em error reporting functions
+.SH SYNOPSYS
+\fB#include <error.h>
+.PP
+\fBvoid error(int \fIstatus\fB, const char *\fIformat\fR, ...);
+.PP
+\fBvoid warn(const char *\fIformat\fR, ...);
+.PP
+\fBchar *serr(void);
+.SH DESCRIPTION
+The \fBerror()\fR and \fBwarn()\fR functions print a formatted error message to
+standard error. If the global variable \fIA0\fR is set, it is output, followed
+by a colon character and a space, in front of the formatted error message.
+.PP
+The \fBerror()\fR function will call the \fBexit()\fR function specified
+declared in \fB<stdlib.h>\fR with \fIstatus\fR as its argument after the error
+message has been printed.
+.PP
+The \fBserr()\fR function is shorthand for \fBstrerror(\fIerrno\fB)\fR.
+.SH COPYRIGHT
+.nf
+Copyright (C) 2020, Jakob Wakeling
+All rights reserved.
+OMKOV Permissive Licence (https://www.omkov.net/OLPE)
+.fi