ReactOS 0.4.16-dev-197-g92996da
err.c File Reference
#include "err.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <varargs.h>
Include dependency graph for err.c:

Go to the source code of this file.

Functions

void err (int eval, const char *fmt, va_alist)
 
void verr (int eval, const char *fmt, va_list ap)
 
void errx (int eval, const char *fmt, va_alist)
 
void verrx (int eval, const char *fmt, va_list ap)
 
void warn (char *fmt, va_alist) const
 
void vwarn (char *fmt, va_list ap) const
 
void warnx (char *fmt, va_alist) const
 
void vwarnx (char *fmt, va_list ap) const
 

Variables

char__progname
 

Function Documentation

◆ err()

void err ( int  eval,
const char fmt,
va_alist   
)

Definition at line 56 of file err.c.

61{
62 va_list ap;
63#if __STDC__
64 va_start(ap, fmt);
65#else
66 va_start(ap);
67#endif
68 verr(eval, fmt, ap);
69 va_end(ap);
70}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
void verr(int eval, const char *fmt, va_list ap)
Definition: err.c:52
Definition: dsound.c:943
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

◆ errx()

void errx ( int  eval,
const char fmt,
va_alist   
)

Definition at line 91 of file err.c.

96{
97 va_list ap;
98#if __STDC__
99 va_start(ap, fmt);
100#else
101 va_start(ap);
102#endif
103 verrx(eval, fmt, ap);
104 va_end(ap);
105}
void verrx(int eval, const char *fmt, va_list ap)
Definition: err.c:76

◆ verr()

void verr ( int  eval,
const char fmt,
va_list  ap 
)

Definition at line 73 of file err.c.

74{
75 int sverrno;
76
77 sverrno = errno;
78 (void)fprintf(stderr, "%s: ", __progname);
79 if (fmt != NULL) {
81 (void)fprintf(stderr, ": ");
82 }
83 (void)fprintf(stderr, "%s\n", strerror(sverrno));
84 exit(eval);
85}
char * __progname
Definition: finger.c:63
#define NULL
Definition: types.h:112
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
const char * strerror(int err)
Definition: compat_str.c:23
#define errno
Definition: errno.h:18
#define exit(n)
Definition: config.h:202

◆ verrx()

void verrx ( int  eval,
const char fmt,
va_list  ap 
)

Definition at line 108 of file err.c.

109{
110 (void)fprintf(stderr, "%s: ", __progname);
111 if (fmt != NULL)
113 (void)fprintf(stderr, "\n");
114 exit(eval);
115}

◆ vwarn()

void vwarn ( char fmt,
va_list  ap 
) const

Definition at line 137 of file err.c.

140{
141 int sverrno;
142
143 sverrno = errno;
144 (void)fprintf(stderr, "%s: ", __progname);
145 if (fmt != NULL) {
147 (void)fprintf(stderr, ": ");
148 }
149 (void)fprintf(stderr, "%s\n", strerror(sverrno));
150}

◆ vwarnx()

void vwarnx ( char fmt,
va_list  ap 
) const

Definition at line 172 of file err.c.

175{
176 (void)fprintf(stderr, "%s: ", __progname);
177 if (fmt != NULL)
179 (void)fprintf(stderr, "\n");
180}

◆ warn()

void warn ( char fmt,
va_alist   
) const

Definition at line 121 of file err.c.

125{
126 va_list ap;
127#if __STDC__
128 va_start(ap, fmt);
129#else
130 va_start(ap);
131#endif
132 vwarn(fmt, ap);
133 va_end(ap);
134}
void vwarn(char *fmt, va_list ap) const
Definition: err.c:95

◆ warnx()

void warnx ( char fmt,
va_alist   
) const

Definition at line 156 of file err.c.

160{
161 va_list ap;
162#ifdef __STDC__
163 va_start(ap, fmt);
164#else
165 va_start(ap);
166#endif
167 vwarnx(fmt, ap);
168 va_end(ap);
169}
void vwarnx(char *fmt, va_list ap) const
Definition: err.c:120

Variable Documentation

◆ __progname

char* __progname
extern

Definition at line 63 of file finger.c.

Referenced by main().