libutil

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

libutil/man/error.3 (32 lines, 997 B) -rw-r--r-- file download

7f427d9 Jamozed 2022-03-06 12:55:13
0
.TH ERROR 3 2022-03-06 "libutil" "libutil Programmer's Manual"
07c88d8 Jamozed 2020-10-29 23:12:14
1
.SH NAME
98e5939 Jamozed 2021-11-27 17:53:46
2
error, warn, alert \(em error reporting functions
07c88d8 Jamozed 2020-10-29 23:12:14
3
.SH SYNOPSYS
98e5939 Jamozed 2021-11-27 17:53:46
4
#include "error.h"
07c88d8 Jamozed 2020-10-29 23:12:14
5
.PP
bc682d2 Jamozed 2020-11-01 13:44:07
6
extern char *\fIA0\fR;
98e5939 Jamozed 2021-11-27 17:53:46
7
.br
98e5939 Jamozed 2021-11-27 17:53:46
8
extern bool \fIwarned\fR;
07c88d8 Jamozed 2020-10-29 23:12:14
9
.PP
bc682d2 Jamozed 2020-11-01 13:44:07
10
void \fBerror\fR(int \fIstatus\fR, const char *\fIformat\fR, ...);
bc682d2 Jamozed 2020-11-01 13:44:07
11
.br
bc682d2 Jamozed 2020-11-01 13:44:07
12
void \fBwarn\fR(const char *\fIformat\fR, ...);
bc682d2 Jamozed 2020-11-01 13:44:07
13
.br
98e5939 Jamozed 2021-11-27 17:53:46
14
void \fBalert\fR(const char *\fIformat\fR, ...);
07c88d8 Jamozed 2020-10-29 23:12:14
15
.SH DESCRIPTION
98e5939 Jamozed 2021-11-27 17:53:46
16
The \fBerror\fR(), \fBwarn\fR(), and \fBalert\fR functions print a formatted
98e5939 Jamozed 2021-11-27 17:53:46
17
error message to stderr. If the global variable \fIA0\fR is set, it is output,
98e5939 Jamozed 2021-11-27 17:53:46
18
followed by a colon character and a space, in front of the formatted error
98e5939 Jamozed 2021-11-27 17:53:46
19
message.
07c88d8 Jamozed 2020-10-29 23:12:14
20
.PP
98e5939 Jamozed 2021-11-27 17:53:46
21
The \fBerror\fR() function will call the \fBexit\fR() function declared in
98e5939 Jamozed 2021-11-27 17:53:46
22
<stdlib.h> with \fIstatus\fR as its argument after the error message has been
98e5939 Jamozed 2021-11-27 17:53:46
23
printed.
07c88d8 Jamozed 2020-10-29 23:12:14
24
.PP
98e5939 Jamozed 2021-11-27 17:53:46
25
The \fBwarn\fR() function will set the global variable \fIwarned\fR to true.
07c88d8 Jamozed 2020-10-29 23:12:14
26
.SH COPYRIGHT
07c88d8 Jamozed 2020-10-29 23:12:14
27
.nf
07c88d8 Jamozed 2020-10-29 23:12:14
28
Copyright (C) 2020, Jakob Wakeling
7f427d9 Jamozed 2022-03-06 12:55:13
29
MIT Licence (https://opensource.org/licenses/MIT)
07c88d8 Jamozed 2020-10-29 23:12:14
30
.fi
31