chiark / gitweb /
4c5db7d6d879744b28f662d75e369db25033ebbd
[mLib] / man / report.3
1 .\" -*-nroff-*-
2 .TH report 3 "20 June 1999" mLib
3 .SH NAME
4 report \- report errors
5 .\" @moan
6 .\" @die
7 .SH SYNOPSIS
8 .nf
9 .B "#include <mLib/report.h>"
10
11 .BI "void moan(const char *" f ", ...);"
12 .BI "void die(int " status ", const char *" f ", ...);"
13 .fi
14 .SH DESCRIPTION
15 The
16 .B moan
17 function emits a message to the standard error stream consisting of the
18 program's name (as read by the
19 .B quis
20 function; see
21 .BR quis (3) for details),
22 a colon, a space, and the
23 .BR printf -style
24 formatted string
25 .I f
26 followed by a newline.  This is a handy way to report nonfatal errors in
27 a program.
28 .PP
29 The
30 .B die
31 function emits a message to the standard error stream, just as for
32 .B moan
33 above, and then calls the
34 .B exit
35 function with argument
36 .I status
37 to halt the program.  This is a handy way to report fatal errors in a
38 program.
39 .SH SEE ALSO
40 .BR exit (3),
41 .BR quis (3),
42 .BR mLib (3).
43 .SH AUTHOR
44 Mark Wooding, <mdw@nsict.org>