ReactOS  0.4.14-dev-114-gc8cbd56
debug.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <guiddef.h>
Include dependency graph for debug.h:

Go to the source code of this file.

Classes

struct  __wine_debug_channel
 
struct  __wine_debug_functions
 

Macros

#define __RELFILE__   __FILE__
 
#define UNIMPLEMENTED   WINE_FIXME("%s is UNIMPLEMENTED!\n", __FUNCTION__)
 
#define __WINE_GET_DEBUGGING_TRACE(dbch)   ((dbch)->flags & (1 << __WINE_DBCL_TRACE))
 
#define __WINE_GET_DEBUGGING_WARN(dbch)   ((dbch)->flags & (1 << __WINE_DBCL_WARN))
 
#define __WINE_GET_DEBUGGING_FIXME(dbch)   ((dbch)->flags & (1 << __WINE_DBCL_FIXME))
 
#define __WINE_GET_DEBUGGING_ERR(dbch)   ((dbch)->flags & (1 << __WINE_DBCL_ERR))
 
#define __WINE_GET_DEBUGGING(dbcl, dbch)   __WINE_GET_DEBUGGING##dbcl(dbch)
 
#define __WINE_IS_DEBUG_ON(dbcl, dbch)   (__WINE_GET_DEBUGGING##dbcl(dbch) && (__wine_dbg_get_channel_flags(dbch) & (1 << __WINE_DBCL##dbcl)))
 
#define __WINE_DPRINTF(dbcl, dbch)
 
#define __WINE_PRINTF_ATTR(fmt, args)
 
#define WINE_TRACE   __WINE_DPRINTF(_TRACE,__wine_dbch___default)
 
#define WINE_TRACE_(ch)   __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch)
 
#define WINE_TRACE_ON(ch)   __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch)
 
#define WINE_WARN   __WINE_DPRINTF(_WARN,__wine_dbch___default)
 
#define WINE_WARN_(ch)   __WINE_DPRINTF(_WARN,&__wine_dbch_##ch)
 
#define WINE_WARN_ON(ch)   __WINE_IS_DEBUG_ON(_WARN,&__wine_dbch_##ch)
 
#define WINE_FIXME   __WINE_DPRINTF(_FIXME,__wine_dbch___default)
 
#define WINE_FIXME_(ch)   __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch)
 
#define WINE_FIXME_ON(ch)   __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch)
 
#define WINE_ERR   __WINE_DPRINTF(_ERR,__wine_dbch___default)
 
#define WINE_ERR_(ch)   __WINE_DPRINTF(_ERR,&__wine_dbch_##ch)
 
#define WINE_ERR_ON(ch)   __WINE_IS_DEBUG_ON(_ERR,&__wine_dbch_##ch)
 
#define WINE_DECLARE_DEBUG_CHANNEL(ch)   static struct __wine_debug_channel __wine_dbch_##ch = { (unsigned char)~0, #ch }
 
#define WINE_DEFAULT_DEBUG_CHANNEL(ch)
 
#define WINE_DPRINTF   wine_dbg_printf
 
#define WINE_MESSAGE   wine_dbg_printf
 
#define TRACE   WINE_TRACE
 
#define TRACE_(ch)   WINE_TRACE_(ch)
 
#define TRACE_ON(ch)   WINE_TRACE_ON(ch)
 
#define WARN   WINE_WARN
 
#define WARN_(ch)   WINE_WARN_(ch)
 
#define WARN_ON(ch)   WINE_WARN_ON(ch)
 
#define FIXME   WINE_FIXME
 
#define FIXME_(ch)   WINE_FIXME_(ch)
 
#define FIXME_ON(ch)   WINE_FIXME_ON(ch)
 
#define ERR   WINE_ERR
 
#define ERR_(ch)   WINE_ERR_(ch)
 
#define ERR_ON(ch)   WINE_ERR_ON(ch)
 
#define DPRINTF   WINE_DPRINTF
 
#define MESSAGE   WINE_MESSAGE
 

Enumerations

enum  __wine_debug_class {
  __WINE_DBCL_FIXME = 0, __WINE_DBCL_ERR = 1, __WINE_DBCL_WARN = 2, __WINE_DBCL_TRACE = 3,
  __WINE_DBCL_INIT = 0x7
}
 

Functions

unsigned char __wine_dbg_get_channel_flags (struct __wine_debug_channel *channel)
 
int __wine_dbg_set_channel_flags (struct __wine_debug_channel *channel, unsigned char set, unsigned char clear)
 
void __wine_dbg_set_functions (const struct __wine_debug_functions *new_funcs, struct __wine_debug_functions *old_funcs, size_t size)
 
const charwine_dbgstr_an (const char *s, int n)
 
const charwine_dbgstr_wn (const WCHAR *s, int n)
 
const charwine_dbg_sprintf (const char *format,...) __WINE_PRINTF_ATTR(1
 
const char int wine_dbg_printf (const char *format,...) __WINE_PRINTF_ATTR(1
 
const char int int wine_dbg_log (enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func, const char *format,...) __WINE_PRINTF_ATTR(4
 
const char int int int ros_dbg_log (enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *file, const char *func, const int line, const char *format,...) __WINE_PRINTF_ATTR(6
 
const char int int int static __inline const charwine_dbgstr_a (const char *s)
 
static __inline const charwine_dbgstr_w (const WCHAR *s)
 
static __inline const charwine_dbgstr_guid (const GUID *id)
 
static __inline const charwine_dbgstr_point (const POINT *pt)
 
static __inline const charwine_dbgstr_size (const SIZE *size)
 
static __inline const charwine_dbgstr_rect (const RECT *rect)
 
static __inline const charwine_dbgstr_longlong (ULONGLONG ll)
 
static __inline const chardebugstr_an (const char *s, int n)
 
static __inline const chardebugstr_wn (const WCHAR *s, int n)
 
static __inline const chardebugstr_guid (const struct _GUID *id)
 
static __inline const chardebugstr_a (const char *s)
 
static __inline const chardebugstr_w (const WCHAR *s)
 

Macro Definition Documentation

◆ __RELFILE__

#define __RELFILE__   __FILE__

Definition at line 31 of file debug.h.

◆ __WINE_DPRINTF

#define __WINE_DPRINTF (   dbcl,
  dbch 
)
Value:
(!__WINE_GET_DEBUGGING(dbcl,(dbch)) || \
(ros_dbg_log(__WINE_DBCL##dbcl,(dbch),__RELFILE__,__FUNCTION__,__LINE__,"") == -1)) ? \
(void)0 : (void)wine_dbg_printf
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define __WINE_GET_DEBUGGING(dbcl, dbch)
Definition: debug.h:84
const char int int int ros_dbg_log(enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *file, const char *func, const int line, const char *format,...) __WINE_PRINTF_ATTR(6
#define __RELFILE__
Definition: debug.h:31
const char int wine_dbg_printf(const char *format,...) __WINE_PRINTF_ATTR(1
#define __FUNCTION__
Definition: types.h:112

Definition at line 142 of file debug.h.

◆ __WINE_GET_DEBUGGING

#define __WINE_GET_DEBUGGING (   dbcl,
  dbch 
)    __WINE_GET_DEBUGGING##dbcl(dbch)

Definition at line 84 of file debug.h.

◆ __WINE_GET_DEBUGGING_ERR

#define __WINE_GET_DEBUGGING_ERR (   dbch)    ((dbch)->flags & (1 << __WINE_DBCL_ERR))

Definition at line 82 of file debug.h.

◆ __WINE_GET_DEBUGGING_FIXME

#define __WINE_GET_DEBUGGING_FIXME (   dbch)    ((dbch)->flags & (1 << __WINE_DBCL_FIXME))

Definition at line 75 of file debug.h.

◆ __WINE_GET_DEBUGGING_TRACE

#define __WINE_GET_DEBUGGING_TRACE (   dbch)    ((dbch)->flags & (1 << __WINE_DBCL_TRACE))

Definition at line 68 of file debug.h.

◆ __WINE_GET_DEBUGGING_WARN

#define __WINE_GET_DEBUGGING_WARN (   dbch)    ((dbch)->flags & (1 << __WINE_DBCL_WARN))

Definition at line 74 of file debug.h.

◆ __WINE_IS_DEBUG_ON

#define __WINE_IS_DEBUG_ON (   dbcl,
  dbch 
)    (__WINE_GET_DEBUGGING##dbcl(dbch) && (__wine_dbg_get_channel_flags(dbch) & (1 << __WINE_DBCL##dbcl)))

Definition at line 86 of file debug.h.

◆ __WINE_PRINTF_ATTR

#define __WINE_PRINTF_ATTR (   fmt,
  args 
)

Definition at line 147 of file debug.h.

◆ DPRINTF

#define DPRINTF   WINE_DPRINTF

Definition at line 413 of file debug.h.

◆ ERR

#define ERR   WINE_ERR

Definition at line 409 of file debug.h.

◆ ERR_

#define ERR_ (   ch)    WINE_ERR_(ch)

Definition at line 410 of file debug.h.

◆ ERR_ON

#define ERR_ON (   ch)    WINE_ERR_ON(ch)

Definition at line 411 of file debug.h.

◆ FIXME

#define FIXME   WINE_FIXME

Definition at line 404 of file debug.h.

◆ FIXME_

#define FIXME_ (   ch)    WINE_FIXME_(ch)

Definition at line 405 of file debug.h.

◆ FIXME_ON

#define FIXME_ON (   ch)    WINE_FIXME_ON(ch)

Definition at line 406 of file debug.h.

◆ MESSAGE

#define MESSAGE   WINE_MESSAGE

Definition at line 414 of file debug.h.

◆ TRACE

#define TRACE   WINE_TRACE

Definition at line 396 of file debug.h.

◆ TRACE_

#define TRACE_ (   ch)    WINE_TRACE_(ch)

Definition at line 397 of file debug.h.

◆ TRACE_ON

#define TRACE_ON (   ch)    WINE_TRACE_ON(ch)

Definition at line 398 of file debug.h.

◆ UNIMPLEMENTED

#define UNIMPLEMENTED   WINE_FIXME("%s is UNIMPLEMENTED!\n", __FUNCTION__)

Definition at line 65 of file debug.h.

◆ WARN

#define WARN   WINE_WARN

Definition at line 400 of file debug.h.

◆ WARN_

#define WARN_ (   ch)    WINE_WARN_(ch)

Definition at line 401 of file debug.h.

◆ WARN_ON

#define WARN_ON (   ch)    WINE_WARN_ON(ch)

Definition at line 402 of file debug.h.

◆ WINE_DECLARE_DEBUG_CHANNEL

#define WINE_DECLARE_DEBUG_CHANNEL (   ch)    static struct __wine_debug_channel __wine_dbch_##ch = { (unsigned char)~0, #ch }

Definition at line 374 of file debug.h.

◆ WINE_DEFAULT_DEBUG_CHANNEL

#define WINE_DEFAULT_DEBUG_CHANNEL (   ch)
Value:
static struct __wine_debug_channel __wine_dbch_##ch = { (unsigned char)~0, #ch }; \
static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch
unsigned char
Definition: typeof.h:29

Definition at line 376 of file debug.h.

◆ WINE_DPRINTF

#define WINE_DPRINTF   wine_dbg_printf

Definition at line 380 of file debug.h.

◆ WINE_ERR

#define WINE_ERR   __WINE_DPRINTF(_ERR,__wine_dbch___default)

Definition at line 370 of file debug.h.

◆ WINE_ERR_

#define WINE_ERR_ (   ch)    __WINE_DPRINTF(_ERR,&__wine_dbch_##ch)

Definition at line 371 of file debug.h.

◆ WINE_ERR_ON

#define WINE_ERR_ON (   ch)    __WINE_IS_DEBUG_ON(_ERR,&__wine_dbch_##ch)

Definition at line 372 of file debug.h.

◆ WINE_FIXME

#define WINE_FIXME   __WINE_DPRINTF(_FIXME,__wine_dbch___default)

Definition at line 365 of file debug.h.

◆ WINE_FIXME_

#define WINE_FIXME_ (   ch)    __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch)

Definition at line 366 of file debug.h.

◆ WINE_FIXME_ON

#define WINE_FIXME_ON (   ch)    __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch)

Definition at line 368 of file debug.h.

◆ WINE_MESSAGE

#define WINE_MESSAGE   wine_dbg_printf

Definition at line 381 of file debug.h.

◆ WINE_TRACE

#define WINE_TRACE   __WINE_DPRINTF(_TRACE,__wine_dbch___default)

Definition at line 353 of file debug.h.

◆ WINE_TRACE_

#define WINE_TRACE_ (   ch)    __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch)

Definition at line 354 of file debug.h.

◆ WINE_TRACE_ON

#define WINE_TRACE_ON (   ch)    __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch)

Definition at line 356 of file debug.h.

◆ WINE_WARN

#define WINE_WARN   __WINE_DPRINTF(_WARN,__wine_dbch___default)

Definition at line 359 of file debug.h.

◆ WINE_WARN_

#define WINE_WARN_ (   ch)    __WINE_DPRINTF(_WARN,&__wine_dbch_##ch)

Definition at line 360 of file debug.h.

◆ WINE_WARN_ON

#define WINE_WARN_ON (   ch)    __WINE_IS_DEBUG_ON(_WARN,&__wine_dbch_##ch)

Definition at line 362 of file debug.h.

Enumeration Type Documentation

◆ __wine_debug_class

Enumerator
__WINE_DBCL_FIXME 
__WINE_DBCL_ERR 
__WINE_DBCL_WARN 
__WINE_DBCL_TRACE 
__WINE_DBCL_INIT 

Definition at line 48 of file debug.h.

49 {
50  __WINE_DBCL_FIXME = 0, /* 0x1 */
51  __WINE_DBCL_ERR = 1, /* 0x2 */
52  __WINE_DBCL_WARN = 2, /* 0x4 */
53  __WINE_DBCL_TRACE = 3, /* 0x8 */
54 
55  /* lazy init flag */
56  __WINE_DBCL_INIT = 0x7
57 };

Function Documentation

◆ __wine_dbg_get_channel_flags()

unsigned char __wine_dbg_get_channel_flags ( struct __wine_debug_channel channel)

Definition at line 83 of file debug.c.

84 {
85  if (nb_debug_options == -1) debug_init();
86 
87  if (nb_debug_options)
88  {
90  sizeof(debug_options[0]), cmp_name );
91  if (opt) return opt->flags;
92  }
93  /* no option for this channel */
94  if (channel->flags & (1 << __WINE_DBCL_INIT)) channel->flags = default_flags;
95  return default_flags;
96 }
static void debug_init(void)
Definition: debug.c:220
static struct __wine_debug_channel debug_options[MAX_DEBUG_OPTIONS]
Definition: debug.c:57
static unsigned char default_flags
Definition: debug.c:55
static int __cdecl cmp_name(const void *p1, const void *p2)
Definition: debug.c:75
static int nb_debug_options
Definition: debug.c:56
unsigned char flags
Definition: debug.h:61
char name[15]
Definition: debug.h:62
#define bsearch

Referenced by ros_dbg_log(), and wine_dbg_log().

◆ __wine_dbg_set_channel_flags()

int __wine_dbg_set_channel_flags ( struct __wine_debug_channel channel,
unsigned char  set,
unsigned char  clear 
)

Definition at line 99 of file debug.c.

101 {
102  if (nb_debug_options == -1) debug_init();
103 
104  if (nb_debug_options)
105  {
107  sizeof(debug_options[0]), cmp_name );
108  if (opt)
109  {
110  opt->flags = (opt->flags & ~clear) | set;
111  return 1;
112  }
113  }
114  return 0;
115 }
static void debug_init(void)
Definition: debug.c:220
static struct __wine_debug_channel debug_options[MAX_DEBUG_OPTIONS]
Definition: debug.c:57
static int __cdecl cmp_name(const void *p1, const void *p2)
Definition: debug.c:75
static int nb_debug_options
Definition: debug.c:56
unsigned char flags
Definition: debug.h:61
char name[15]
Definition: debug.h:62
Definition: _set.h:46
#define bsearch

◆ __wine_dbg_set_functions()

void __wine_dbg_set_functions ( const struct __wine_debug_functions new_funcs,
struct __wine_debug_functions old_funcs,
size_t  size 
)

Definition at line 551 of file debug.c.

553 {
554  if (old_funcs) memcpy( old_funcs, &funcs, min(sizeof(funcs),size) );
555  if (new_funcs) memcpy( &funcs, new_funcs, min(sizeof(funcs),size) );
556 }
GLsizeiptr size
Definition: glext.h:5919
static struct __wine_debug_functions funcs
Definition: debug.c:59
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55

◆ debugstr_a()

static __inline const char* debugstr_a ( const char s)
static

Definition at line 388 of file debug.h.

388 { return wine_dbgstr_an( s, -1 ); }
GLdouble s
Definition: gl.h:2039
const char * wine_dbgstr_an(const char *s, int n)
Definition: compat.c:288

◆ debugstr_an()

static __inline const char* debugstr_an ( const char s,
int  n 
)
static

Definition at line 385 of file debug.h.

385 { return wine_dbgstr_an( s, n ); }
GLdouble n
Definition: glext.h:7729
GLdouble s
Definition: gl.h:2039
const char * wine_dbgstr_an(const char *s, int n)
Definition: compat.c:288

◆ debugstr_guid()

static __inline const char* debugstr_guid ( const struct _GUID id)
static

Definition at line 387 of file debug.h.

387 { return wine_dbgstr_guid(id); }
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:196

◆ debugstr_w()

static __inline const char* debugstr_w ( const WCHAR s)
static

Definition at line 389 of file debug.h.

389 { return wine_dbgstr_wn( s, -1 ); }
const char * wine_dbgstr_wn(const WCHAR *s, int n)
Definition: compat.c:342
GLdouble s
Definition: gl.h:2039

◆ debugstr_wn()

static __inline const char* debugstr_wn ( const WCHAR s,
int  n 
)
static

Definition at line 386 of file debug.h.

386 { return wine_dbgstr_wn( s, n ); }
const char * wine_dbgstr_wn(const WCHAR *s, int n)
Definition: compat.c:342
GLdouble n
Definition: glext.h:7729
GLdouble s
Definition: gl.h:2039

◆ ros_dbg_log()

const char int int int ros_dbg_log ( enum __wine_debug_class  cls,
struct __wine_debug_channel ch,
const char file,
const char func,
const int  line,
const char format,
  ... 
)

◆ wine_dbg_log()

const char int int wine_dbg_log ( enum __wine_debug_class  cls,
struct __wine_debug_channel ch,
const char func,
const char format,
  ... 
)

◆ wine_dbg_printf()

const char int wine_dbg_printf ( const char format,
  ... 
)

◆ wine_dbg_sprintf()

const char* wine_dbg_sprintf ( const char format,
  ... 
)

Definition at line 271 of file compat.c.

272 {
273  static const int max_size = 200;
274  static char buffer[256];
275  char *ret;
276  int len;
277  va_list valist;
278 
280  ret = buffer;
282  if (len == -1 || len >= max_size) ret[max_size-1] = 0;
283  va_end(valist);
284  return ret;
285 }
#define vsnprintf
Definition: tif_win32.c:406
GLuint buffer
Definition: glext.h:5915
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define va_end(ap)
Definition: acmsvcex.h:90
static INT max_size
Definition: history.c:51
char * va_list
Definition: acmsvcex.h:78
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define va_start(ap, A)
Definition: acmsvcex.h:91
static __ms_va_list valist
Definition: printf.c:59

Referenced by wine_dbgstr_guid(), wine_dbgstr_longlong(), wine_dbgstr_point(), wine_dbgstr_rect(), and wine_dbgstr_size().

◆ wine_dbgstr_a()

const char int int int static __inline const char* wine_dbgstr_a ( const char s)
static

◆ wine_dbgstr_an()

const char* wine_dbgstr_an ( const char s,
int  n 
)

Definition at line 288 of file compat.c.

289 {
290  static const char hex[16] = "0123456789abcdef";
291  char *dst, *res;
292  size_t size;
293  static char buffer[256];
294 
295  if (!((ULONG_PTR)str >> 16))
296  {
297  if (!str) return "(null)";
298  res = buffer;
299  sprintf( res, "#%04x", LOWORD(str) );
300  return res;
301  }
302  if (n == -1) n = strlen(str);
303  if (n < 0) n = 0;
304  size = 10 + min( 300, n * 4 );
305  dst = res = buffer;
306  *dst++ = '"';
307  while (n-- > 0 && dst <= res + size - 9)
308  {
309  unsigned char c = *str++;
310  switch (c)
311  {
312  case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
313  case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
314  case '\t': *dst++ = '\\'; *dst++ = 't'; break;
315  case '"': *dst++ = '\\'; *dst++ = '"'; break;
316  case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
317  default:
318  if (c >= ' ' && c <= 126)
319  *dst++ = c;
320  else
321  {
322  *dst++ = '\\';
323  *dst++ = 'x';
324  *dst++ = hex[(c >> 4) & 0x0f];
325  *dst++ = hex[c & 0x0f];
326  }
327  }
328  }
329  *dst++ = '"';
330  if (n > 0)
331  {
332  *dst++ = '.';
333  *dst++ = '.';
334  *dst++ = '.';
335  }
336  *dst++ = 0;
337  return res;
338 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLdouble n
Definition: glext.h:7729
GLuint buffer
Definition: glext.h:5915
static const char hex[16]
Definition: profile.c:123
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define sprintf(buf, format,...)
Definition: sprintf.c:55
const WCHAR * str
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
GLuint res
Definition: glext.h:9613
#define c
Definition: ke_i.h:80
#define LOWORD(l)
Definition: pedump.c:82

Referenced by debugstr_a(), debugstr_an(), and wine_dbgstr_a().

◆ wine_dbgstr_guid()

static __inline const char* wine_dbgstr_guid ( const GUID id)
static

Definition at line 196 of file debug.h.

197 {
198  if (!id) return "(null)";
199  if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04lx>", (ULONG_PTR)id & 0xffff );
200  return wine_dbg_sprintf( "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
201  id->Data1, id->Data2, id->Data3,
202  id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
203  id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
204 }
const char * wine_dbg_sprintf(const char *format,...) __WINE_PRINTF_ATTR(1
Definition: compat.c:271
uint32_t ULONG_PTR
Definition: typedefs.h:63
GLenum GLuint id
Definition: glext.h:5579

Referenced by debugstr_guid().

◆ wine_dbgstr_longlong()

static __inline const char* wine_dbgstr_longlong ( ULONGLONG  ll)
static

Definition at line 225 of file debug.h.

226 {
227  if (/*sizeof(ll) > sizeof(unsigned long) &&*/ ll >> 32) /* ULONGLONG is always > long in ReactOS */
228  return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll );
229  else return wine_dbg_sprintf( "%lx", (unsigned long)ll );
230 }
const char * wine_dbg_sprintf(const char *format,...) __WINE_PRINTF_ATTR(1
Definition: compat.c:271
w ll
Definition: byte_order.h:166

◆ wine_dbgstr_point()

static __inline const char* wine_dbgstr_point ( const POINT pt)
static

Definition at line 206 of file debug.h.

207 {
208  if (!pt) return "(null)";
209  return wine_dbg_sprintf( "(%ld,%ld)", pt->x, pt->y );
210 }
#define pt(x, y)
Definition: drawing.c:79
const char * wine_dbg_sprintf(const char *format,...) __WINE_PRINTF_ATTR(1
Definition: compat.c:271

◆ wine_dbgstr_rect()

static __inline const char* wine_dbgstr_rect ( const RECT rect)
static

Definition at line 218 of file debug.h.

219 {
220  if (!rect) return "(null)";
221  return wine_dbg_sprintf( "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top,
222  rect->right, rect->bottom );
223 }
const char * wine_dbg_sprintf(const char *format,...) __WINE_PRINTF_ATTR(1
Definition: compat.c:271
& rect
Definition: startmenu.cpp:1413

◆ wine_dbgstr_size()

static __inline const char* wine_dbgstr_size ( const SIZE size)
static

Definition at line 212 of file debug.h.

213 {
214  if (!size) return "(null)";
215  return wine_dbg_sprintf( "(%ld,%ld)", size->cx, size->cy );
216 }
const char * wine_dbg_sprintf(const char *format,...) __WINE_PRINTF_ATTR(1
Definition: compat.c:271
GLsizeiptr size
Definition: glext.h:5919

◆ wine_dbgstr_w()

static __inline const char* wine_dbgstr_w ( const WCHAR s)
static

Definition at line 191 of file debug.h.

192 {
193  return wine_dbgstr_wn( s, -1 );
194 }
const char * wine_dbgstr_wn(const WCHAR *s, int n)
Definition: compat.c:342
GLdouble s
Definition: gl.h:2039

◆ wine_dbgstr_wn()

const char* wine_dbgstr_wn ( const WCHAR s,
int  n 
)

Definition at line 342 of file compat.c.

343 {
344  char *dst, *res;
345  size_t size;
346  static char buffer[256];
347 
348  if (!((ULONG_PTR)str >> 16))
349  {
350  if (!str) return "(null)";
351  res = buffer;
352  sprintf( res, "#%04x", LOWORD(str) );
353  return res;
354  }
355  if (n == -1)
356  {
357  const WCHAR *end = str;
358  while (*end) end++;
359  n = end - str;
360  }
361  if (n < 0) n = 0;
362  size = 12 + min( 300, n * 5 );
363  dst = res = buffer;
364  *dst++ = 'L';
365  *dst++ = '"';
366  while (n-- > 0 && dst <= res + size - 10)
367  {
368  WCHAR c = *str++;
369  switch (c)
370  {
371  case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
372  case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
373  case '\t': *dst++ = '\\'; *dst++ = 't'; break;
374  case '"': *dst++ = '\\'; *dst++ = '"'; break;
375  case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
376  default:
377  if (c >= ' ' && c <= 126)
378  *dst++ = c;
379  else
380  {
381  *dst++ = '\\';
382  sprintf(dst,"%04x",c);
383  dst+=4;
384  }
385  }
386  }
387  *dst++ = '"';
388  if (n > 0)
389  {
390  *dst++ = '.';
391  *dst++ = '.';
392  *dst++ = '.';
393  }
394  *dst++ = 0;
395  return res;
396 }
GLdouble n
Definition: glext.h:7729
GLuint buffer
Definition: glext.h:5915
GLuint GLuint end
Definition: gl.h:1545
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define sprintf(buf, format,...)
Definition: sprintf.c:55
const WCHAR * str
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
const GLubyte * c
Definition: glext.h:8905
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
GLuint res
Definition: glext.h:9613
#define c
Definition: ke_i.h:80
#define LOWORD(l)
Definition: pedump.c:82

Referenced by debugstr_w(), debugstr_wn(), and wine_dbgstr_w().