ReactOS  0.4.14-dev-52-g6116262
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 }
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
void verr(int eval, const char *fmt, va_list ap)
Definition: err.c:52
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
Definition: dsound.c:943

◆ 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 }
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
void verrx(int eval, const char *fmt, va_list ap)
Definition: err.c:76
Definition: dsound.c:943

◆ 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 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
int errno
const char * strerror(int err)
Definition: compat_str.c:23
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
void exit(int exitcode)
Definition: _exit.c:33
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
Definition: dsound.c:943
char * __progname
Definition: finger.c:63

◆ 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)
112  (void)vfprintf(stderr, fmt, ap);
113  (void)fprintf(stderr, "\n");
114  exit(eval);
115 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
void exit(int exitcode)
Definition: _exit.c:33
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
Definition: dsound.c:943
char * __progname
Definition: finger.c:63

◆ 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) {
146  (void)vfprintf(stderr, fmt, ap);
147  (void)fprintf(stderr, ": ");
148  }
149  (void)fprintf(stderr, "%s\n", strerror(sverrno));
150 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
int errno
const char * strerror(int err)
Definition: compat_str.c:23
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
Definition: dsound.c:943
char * __progname
Definition: finger.c:63

◆ 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)
178  (void)vfprintf(stderr, fmt, ap);
179  (void)fprintf(stderr, "\n");
180 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
FILE * stderr
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
Definition: dsound.c:943
char * __progname
Definition: finger.c:63

◆ 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
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
Definition: dsound.c:943

◆ 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
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
Definition: dsound.c:943

Variable Documentation

◆ __progname

char* __progname

Definition at line 63 of file finger.c.

Referenced by main().