diff --git a/include/wine/debug.h b/include/wine/debug.h index aca055fec5b..41f2d3f3960 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -73,7 +73,7 @@ struct __wine_debug_channel #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_log(__WINE_DBCL##dbcl, (dbch), 0, 0) != -1) + (__WINE_GET_DEBUGGING##dbcl(dbch) && (__wine_dbg_get_channel_flags(dbch) & (1 << __WINE_DBCL##dbcl))) #ifdef __GNUC__ @@ -148,6 +148,7 @@ struct __wine_debug_functions const char *function, const char *format, va_list args ); }; +extern unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ); extern void __wine_dbg_set_functions( const struct __wine_debug_functions *new_funcs, struct __wine_debug_functions *old_funcs, size_t size ); @@ -166,12 +167,12 @@ extern int wine_dbg_printf( const char *format, ... ) __WINE_PRINTF_ATTR(1,2); extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func, const char *format, ... ) __WINE_PRINTF_ATTR(4,5); -extern inline const char *wine_dbgstr_a( const char *s ) +static inline const char *wine_dbgstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); } -extern inline const char *wine_dbgstr_w( const WCHAR *s ) +static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } diff --git a/libs/wine/debug.c b/libs/wine/debug.c index 95c911045ad..6a4cf3ed30f 100644 --- a/libs/wine/debug.c +++ b/libs/wine/debug.c @@ -49,7 +49,7 @@ static int cmp_name( const void *p1, const void *p2 ) } /* get the flags to use for a given channel, possibly setting them too in case of lazy init */ -static inline unsigned char get_channel_flags( struct __wine_debug_channel *channel ) +unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ) { if (nb_debug_options) { @@ -62,26 +62,6 @@ static inline unsigned char get_channel_flags( struct __wine_debug_channel *chan return default_flags; } -/* register a new set of channels for a dll */ -void *__wine_dbg_register( struct __wine_debug_channel * const *channels, int nb ) -{ - int i; - - for (i = 0; i < nb; i++) - { - channels[i]->flags = ~0; - get_channel_flags( channels[i] ); - } - return NULL; -} - - -/* unregister a set of channels; must pass the pointer obtained from wine_dbg_register */ -void __wine_dbg_unregister( void *channel ) -{ -} - - /* add a new debug option at the end of the option list */ static void add_option( const char *name, unsigned char set, unsigned char clear ) { @@ -229,8 +209,7 @@ int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *chan int ret; va_list valist; - if (!(get_channel_flags( channel ) & (1 << cls))) return -1; - if (!format) return 0; + if (!(__wine_dbg_get_channel_flags( channel ) & (1 << cls))) return -1; va_start(valist, format); ret = funcs.dbg_vlog( cls, channel, func, format, valist ); @@ -400,16 +379,6 @@ const char *wine_dbgstr_wn( const WCHAR *s, int n ) return funcs.dbgstr_wn(s, n); } -const char *wine_dbgstr_a( const char *s ) -{ - return funcs.dbgstr_an( s, -1 ); -} - -const char *wine_dbgstr_w( const WCHAR *s ) -{ - return funcs.dbgstr_wn( s, -1 ); -} - void __wine_dbg_set_functions( const struct __wine_debug_functions *new_funcs, struct __wine_debug_functions *old_funcs, size_t size ) { diff --git a/libs/wine/wine.def b/libs/wine/wine.def index aecd1a2211a..de6dd3b488d 100644 --- a/libs/wine/wine.def +++ b/libs/wine/wine.def @@ -1,9 +1,8 @@ LIBRARY libwine.dll EXPORTS - __wine_dbg_register + __wine_dbg_get_channel_flags __wine_dbg_set_functions - __wine_dbg_unregister __wine_dll_register __wine_main_argc __wine_main_argv @@ -13,9 +12,7 @@ EXPORTS wine_dbg_log wine_dbg_printf wine_dbg_sprintf - wine_dbgstr_a wine_dbgstr_an - wine_dbgstr_w wine_dbgstr_wn wine_dlclose wine_dll_get_owner diff --git a/libs/wine/wine.map b/libs/wine/wine.map index c6205cf1659..5ab7258edb8 100644 --- a/libs/wine/wine.map +++ b/libs/wine/wine.map @@ -1,9 +1,8 @@ WINE_1.0 { global: - __wine_dbg_register; + __wine_dbg_get_channel_flags; __wine_dbg_set_functions; - __wine_dbg_unregister; __wine_dll_register; __wine_main_argc; __wine_main_argv; @@ -13,9 +12,7 @@ WINE_1.0 wine_dbg_log; wine_dbg_printf; wine_dbg_sprintf; - wine_dbgstr_a; wine_dbgstr_an; - wine_dbgstr_w; wine_dbgstr_wn; wine_dlclose; wine_dll_get_owner;