File: err.3

package info (click to toggle)
clippoly 0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,124 kB
  • sloc: cpp: 2,207; ansic: 1,504; makefile: 48; sh: 9
file content (70 lines) | stat: -rw-r--r-- 1,632 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.TH ERR 3 "25 July 1990" local "Utility routines"
.SH NAME 
warning, error, fatal \- consistent error handling
.SH SYNOPSIS
#include <setjmp.h>
.br
#include <err.h>
.LP
warning( fmt, ... )
.br
char *fmt;
.LP
error( fmt, ... )
.br
char *fmt;
.LP
fatal( fmt, ... )
.br
char *fmt;
.LP
fatal_nr( nr, fmt, ... )
.br
int	nr;
.br
char *fmt;
.LP
extern int err_nr_errors, err_nr_warnings;
.br
extern int *err_warning_jmpbuf, *err_error_jmpbuf, *err_fatal_jmpbuf;
.SH DESCRIPTION
These routines provide a way to handle all kind of errors in a consistent way.
The differences between the routines are:
.I warning()
is intended to be used when the error encountered is to be reported, but
will probably not harm the result.
.I error()
should be called when the error will harm the result (it will probably not be 
valid), but execution can continue;
.I fatal()
should be called when the error means that the program can not continue.
.I fatal()
will exit with a return value of 1;
.I fatal_nr()
will exit with the return value
.I nr.
.br
The integers
.I err_nr_warnings
and 
.I err_nr_errors
hold the number of time these routines are called.
.br
The
.I err_*_jmpbuf
variables are pointers to a 
.I jmp_buf.
When these are not NULL they should point to a valid
.I jmp_buf
for use by
.I longjmp(3).
In this way the program can catch errors as generated by these routines.
.SH ARGUMENTS
The string
.I fmt
and trailing arguments are handled in the way of
.I printf(3).
.SH SEE ALSO
setjmp(3), printf(3), fprintf(3), exit(3).
.SH AUTHOR
Klamer Schutte, klamer@mi.el.utwente.nl