ReactOS  0.4.14-dev-599-g2d4d3f5
err.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
Include dependency graph for err.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define chmcerr_printf(fmt, ...)   fprintf (stderr, fmt , ## __VA_ARGS__)
 
#define BUG_ON(fmt, ...)
 
#define CHMC_ERRMAXLEN   (1023)
 
#define CHMC_NOERR   (0)
 
#define CHMC_ENOMEM   (ENOMEM)
 
#define CHMC_EINVAL   (EINVAL)
 
#define chmc_error(fmt, ...)   fprintf (stdout, fmt , ## __VA_ARGS__)
 
#define chmcerr_return_msg(fmt, ...)
 
#define chmcerr_msg(fmt, ...)
 
#define chmcerr_set_return(code, fmt, ...)
 

Functions

void chmcerr_set (int code, const char *fmt,...)
 
void chmcerr_clean (void)
 
int chmcerr_code (void)
 
const charchmcerr_message (void)
 

Macro Definition Documentation

◆ BUG_ON

#define BUG_ON (   fmt,
  ... 
)
Value:
do { \
fprintf (stderr, "%s:%d: ", __FILE__, __LINE__); \
fprintf (stderr, fmt , ## __VA_ARGS__); \
abort (); \
} while (0)
FILE * stderr
Definition: dsound.c:943

Definition at line 28 of file err.h.

◆ CHMC_EINVAL

#define CHMC_EINVAL   (EINVAL)

Definition at line 41 of file err.h.

◆ CHMC_ENOMEM

#define CHMC_ENOMEM   (ENOMEM)

Definition at line 40 of file err.h.

◆ CHMC_ERRMAXLEN

#define CHMC_ERRMAXLEN   (1023)

Definition at line 35 of file err.h.

◆ chmc_error

#define chmc_error (   fmt,
  ... 
)    fprintf (stdout, fmt , ## __VA_ARGS__)

Definition at line 48 of file err.h.

◆ CHMC_NOERR

#define CHMC_NOERR   (0)

Definition at line 39 of file err.h.

◆ chmcerr_msg

#define chmcerr_msg (   fmt,
  ... 
)
Value:
do { \
chmcerr_printf ("%s: %d: ", __FILE__, __LINE__); \
chmcerr_printf ("error %d: ", chmcerr_code ()); \
chmcerr_printf (fmt , ## __VA_ARGS__ ); \
chmcerr_printf (": %s\n", chmcerr_message ()); \
} while (0)
const char * chmcerr_message(void)
Definition: err.c:46
int chmcerr_code(void)
Definition: err.c:42
Definition: dsound.c:943

Definition at line 59 of file err.h.

◆ chmcerr_printf

#define chmcerr_printf (   fmt,
  ... 
)    fprintf (stderr, fmt , ## __VA_ARGS__)

Definition at line 25 of file err.h.

◆ chmcerr_return_msg

#define chmcerr_return_msg (   fmt,
  ... 
)
Value:
do { \
chmcerr_printf ( "%s: %d: ", __FILE__, __LINE__ ); \
chmcerr_printf ( "error %d: ", chmcerr_code () ); \
chmcerr_printf ( fmt , ## __VA_ARGS__ ); \
chmcerr_printf ( ": %s\n", chmcerr_message () ); \
return chmcerr_code (); \
} while (0)
const char * chmcerr_message(void)
Definition: err.c:46
int chmcerr_code(void)
Definition: err.c:42
Definition: dsound.c:943

Definition at line 50 of file err.h.

◆ chmcerr_set_return

#define chmcerr_set_return (   code,
  fmt,
  ... 
)
Value:
do { \
chmcerr_set ( (code), (fmt), ## __VA_ARGS__ ); \
return (code); \
} while (0)
Definition: dsound.c:943

Definition at line 67 of file err.h.

Function Documentation

◆ chmcerr_clean()

void chmcerr_clean ( void  )

Definition at line 37 of file err.c.

37  {
38  chmc_err.code = CHMC_NOERR;
39  chmc_err.msg[0] = '\0';
40 }
#define CHMC_NOERR
Definition: err.h:39
static struct chmcErr chmc_err
Definition: err.c:32

Referenced by chmc_init().

◆ chmcerr_code()

int chmcerr_code ( void  )

Definition at line 42 of file err.c.

42  {
43  return chmc_err.code;
44 }
static struct chmcErr chmc_err
Definition: err.c:32

Referenced by chmc_section_add(), and main().

◆ chmcerr_message()

const char* chmcerr_message ( void  )

Definition at line 46 of file err.c.

46  {
47  return chmc_err.msg;
48 }
static struct chmcErr chmc_err
Definition: err.c:32

◆ chmcerr_set()

void chmcerr_set ( int  code,
const char fmt,
  ... 
)

Definition at line 50 of file err.c.

51 {
52  int len;
53  va_list ap;
54 
55  chmc_err.code = code;
56 
57  va_start(ap, fmt);
58 
60  if (len == CHMC_ERRMAXLEN)
61  chmc_err.msg[CHMC_ERRMAXLEN] = '\0';
62 
64 
65  va_end(ap);
66 }
#define vsnprintf
Definition: tif_win32.c:406
#define assert(x)
Definition: debug.h:53
#define CHMC_ERRMAXLEN
Definition: err.h:35
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
GLenum GLsizei len
Definition: glext.h:6722
int code
Definition: i386-dis.c:3591
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
static struct chmcErr chmc_err
Definition: err.c:32
Definition: dsound.c:943

Referenced by chmc_init(), chmc_section_create(), and chmc_system_done().