1explain_vsprintf_or_die(3) Library Functions Manual explain_vsprintf_or_die(3)
2
3
4
6 explain_vsprintf_or_die - formatted output conversion and report errors
7
9 #include <libexplain/vsprintf.h>
10 int explain_vsprintf_or_die(char *data, const char *format, va_list
11 ap);
12 int explain_vsprintf_on_error(char *data, const char *format, va_list
13 ap);
14
16 The explain_vsprintf_or_die function is used to call the vsprintf(3)
17 system call. On failure an explanation will be printed to stderr,
18 obtained from the explain_vsprintf(3) function, and then the process
19 terminates by calling exit(EXIT_FAILURE).
20
21 The explain_vsprintf_on_error function is used to call the vsprintf(3)
22 system call. On failure an explanation will be printed to stderr,
23 obtained from the explain_vsprintf(3) function, but still returns to
24 the caller.
25
26 data The data, exactly as to be passed to the vsprintf(3) system
27 call.
28
29 format The format, exactly as to be passed to the vsprintf(3) system
30 call.
31
32 ap The ap, exactly as to be passed to the vsprintf(3) system call.
33
35 The explain_vsprintf_or_die function only returns on success, see
36 vsprintf(3) for more information. On failure, prints an explanation and
37 exits, it does not return.
38
39 The explain_vsprintf_on_error function always returns the value return
40 by the wrapped vsprintf(3) system call.
41
43 The explain_vsprintf_or_die function is intended to be used in a fash‐
44 ion similar to the following example:
45 int result = explain_vsprintf_or_die(data, format, ap);
46
48 vsprintf(3)
49 formatted output conversion
50
51 explain_vsprintf(3)
52 explain vsprintf(3) errors
53
54 exit(2) terminate the calling process
55
57 libexplain version 1.4
58 Copyright (C) 2010 Peter Miller
59
60
61
62 explain_vsprintf_or_die(3)