npv:_reasonable_ "pedanticage" of the code
[nyanmp.git] / npv / public / code.frag.c
blob7fded40fc2e35b06ad57c74e625764b7284047cf
1 STATIC void pout(u8 *fmt, ...)
3 va_list ap;
5 va_start(ap, fmt);
6 flockfile(stdout);
7 vfprintf(stdout, fmt, ap);
8 funlockfile(stdout);
9 va_end(ap);
11 STATIC void vpout(u8 *fmt, va_list ap)
13 va_list aq;
15 va_copy(aq, ap);
16 flockfile(stdout);
17 vfprintf(stdout, fmt, aq);
18 funlockfile(stdout);
19 va_end(aq);
21 STATIC void perr(u8 *fmt, ...)
23 va_list ap;
25 va_start(ap, fmt);
26 flockfile(stderr);
27 vfprintf(stderr, fmt, ap);
28 funlockfile(stderr);
29 va_end(ap);
31 STATIC void vperr(u8 *fmt, va_list ap)
33 va_list aq;
35 va_copy(aq, ap);
36 flockfile(stderr);
37 vfprintf(stderr, fmt, aq);
38 funlockfile(stderr);
39 va_end(aq);
41 STATIC void warning(u8 *fmt, ...)
43 va_list ap;
45 perr("WARNING:");
46 va_start(ap, fmt);
47 vperr(fmt, ap);
48 va_end(ap);
50 STATIC void vwarning(u8 *fmt, va_list ap)
52 va_list aq;
54 perr("WARNING:");
55 va_copy(aq, ap);
56 vperr(fmt, aq);
57 va_end(aq);
59 STATIC void fatal(u8 *fmt, ...)
61 va_list ap;
63 perr("FATAL:");
64 va_start(ap, fmt);
65 vperr(fmt, ap);
66 va_end(ap);
67 exit(EXIT_FAILURE);
69 STATIC void vfatal(u8 *fmt, va_list ap)
71 va_list aq;
73 perr("FATAL:");
74 va_copy(aq, ap);
75 vperr(fmt, aq);
76 va_end(aq);
77 exit(EXIT_FAILURE);
79 STATIC void exit_ok(u8 *fmt, ...)
81 va_list ap;
83 pout("EXIT:");
84 va_start(ap, fmt);
85 vpout(fmt, ap);
86 va_end(ap);
87 exit(EXIT_SUCCESS);