1explain_vsnprintf_or_die(3)Library Functions Manualexplain_vsnprintf_or_die(3)
2
3
4

NAME

6       explain_vsnprintf_or_die  -  formatted  output  conversion  and  report
7       errors
8

SYNOPSIS

10       #include <libexplain/vsnprintf.h>
11       int explain_vsnprintf_or_die(char *data, size_t data_size,  const  char
12       *format, va_list ap);
13       int explain_vsnprintf_on_error(char *data, size_t data_size, const char
14       *format, va_list ap);
15

DESCRIPTION

17       The explain_vsnprintf_or_die function is used to call the  vsnprintf(3)
18       system  call.  On  failure  an  explanation  will be printed to stderr,
19       obtained from the explain_vsnprintf(3) function, and then  the  process
20       terminates by calling exit(EXIT_FAILURE).
21
22       The   explain_vsnprintf_on_error   function   is   used   to  call  the
23       vsnprintf(3) system call. On failure an explanation will be printed  to
24       stderr,  obtained  from  the  explain_vsnprintf(3)  function, but still
25       returns to the caller.
26
27       data    The data, exactly as to be passed to  the  vsnprintf(3)  system
28               call.
29
30       data_size
31               The data_size, exactly as to be passed to the vsnprintf(3) sys‐
32               tem call.
33
34       format  The format, exactly as to be passed to the vsnprintf(3)  system
35               call.
36
37       ap      The  ap,  exactly  as  to  be passed to the vsnprintf(3) system
38               call.
39

RETURN VALUE

41       The explain_vsnprintf_or_die function  only  returns  on  success,  see
42       vsnprintf(3)  for  more  information. On failure, prints an explanation
43       and exits, it does not return.
44
45       The explain_vsnprintf_on_error function always returns the value return
46       by the wrapped vsnprintf(3) system call.
47

EXAMPLE

49       The explain_vsnprintf_or_die function is intended to be used in a fash‐
50       ion similar to the following example:
51              int result = explain_vsnprintf_or_die(data, data_size, format, ap);
52

SEE ALSO

54       vsnprintf(3)
55               formatted output conversion
56
57       explain_vsnprintf(3)
58               explain vsnprintf(3) errors
59
60       exit(2) terminate the calling process
61
63       libexplain version 1.4
64       Copyright (C) 2010 Peter Miller
65
66
67
68                                                   explain_vsnprintf_or_die(3)
Impressum