1explain_getc_or_die(3) Library Functions Manual explain_getc_or_die(3)
2
3
4
6 explain_getc_or_die - input of characters and report errors
7
9 #include <libexplain/getc.h>
10 int explain_getc_or_die(FILE *fp);
11
13 The explain_getc_or_die function is used to call the getc(3) system
14 call. On failure an explanation will be printed to stderr, obtained
15 from explain_getc(3), and then the process terminates by calling
16 exit(EXIT_FAILURE).
17
18 This function is intended to be used in a fashion similar to the fol‐
19 lowing example:
20 int c = explain_getc_or_die(fp);
21
22 fp The fp, exactly as to be passed to the getc(3) system call.
23
24 Returns:
25 This function only returns on success, and returns the next
26 character or EOF at end of input. On failure, prints an expla‐
27 nation and exits.
28
30 getc(3) input of characters
31
32 explain_getc(3)
33 explain getc(3) errors
34
35 exit(2) terminate the calling process
36
38 libexplain version 1.4
39 Copyright (C) 2008 Peter Miller
40
41
42
43 explain_getc_or_die(3)