ReactOS 0.4.16-dev-199-g898cc56
err.c File Reference
#include "precomp.h"
Include dependency graph for err.c:

Go to the source code of this file.

Functions

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

Variables

char__progname
 

Function Documentation

◆ err()

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

Definition at line 43 of file err.c.

44{
45 va_list ap;
46 va_start(ap, fmt);
47 verr(eval, fmt, ap);
48 va_end(ap);
49}
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,
  ... 
)

Definition at line 67 of file err.c.

68{
69 va_list ap;
70 va_start(ap, fmt);
71 verrx(eval, fmt, ap);
72 va_end(ap);
73}
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 52 of file err.c.

53{
54 int sverrno;
55
56 sverrno = errno;
57 (void)fprintf(stderr, "%s: ", __progname);
58 if (fmt != NULL) {
60 (void)fprintf(stderr, ": ");
61 }
62 (void)fprintf(stderr, "%s\n", strerror(sverrno));
63 exit(eval);
64}
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

Referenced by err().

◆ verrx()

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

Definition at line 76 of file err.c.

77{
78 (void)fprintf(stderr, "%s: ", __progname);
79 if (fmt != NULL)
81 (void)fprintf(stderr, "\n");
82 exit(eval);
83}

Referenced by errx().

◆ vwarn()

void vwarn ( char fmt,
va_list  ap 
) const

Definition at line 95 of file err.c.

98{
99 int sverrno;
100
101 sverrno = errno;
102 (void)fprintf(stderr, "%s: ", __progname);
103 if (fmt != NULL) {
105 (void)fprintf(stderr, ": ");
106 }
107 (void)fprintf(stderr, "%s\n", strerror(sverrno));
108}

Referenced by warn().

◆ vwarnx()

void vwarnx ( char fmt,
va_list  ap 
) const

Definition at line 120 of file err.c.

123{
124 (void)fprintf(stderr, "%s: ", __progname);
125 if (fmt != NULL)
127 (void)fprintf(stderr, "\n");
128}

Referenced by warnx().

◆ warn()

void warn ( const char fmt,
  ... 
)

Definition at line 86 of file err.c.

87{
88 va_list ap;
89 va_start(ap, fmt);
90 vwarn(fmt, ap);
91 va_end(ap);
92}
void vwarn(char *fmt, va_list ap) const
Definition: err.c:95

◆ warnx()

void warnx ( const char fmt,
  ... 
)

Definition at line 111 of file err.c.

112{
113 va_list ap;
114 va_start(ap, fmt);
115 vwarnx(fmt, ap);
116 va_end(ap);
117}
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 verr(), verrx(), vwarn(), and vwarnx().