From 2058f543001eb1090b67d33f9c6c3f56bb717e4d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 18 Oct 2005 10:49:20 +0000 Subject: [PATCH] Added a __wine_dbg_set_channel_flags function to allow changing flags from inside the code. --- include/wine/debug.h | 2 ++ libs/wine/debug.c | 17 +++++++++++++++++ libs/wine/wine.def | 1 + libs/wine/wine.map | 1 + 4 files changed, 21 insertions(+) diff --git a/include/wine/debug.h b/include/wine/debug.h index 41f2d3f3960..05c41841f6b 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -149,6 +149,8 @@ struct __wine_debug_functions }; extern unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ); +extern int __wine_dbg_set_channel_flags( struct __wine_debug_channel *channel, + unsigned char set, unsigned char clear ); extern 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/debug.c b/libs/wine/debug.c index 6a4cf3ed30f..f6ee71b6722 100644 --- a/libs/wine/debug.c +++ b/libs/wine/debug.c @@ -62,6 +62,23 @@ unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel return default_flags; } +/* set the flags to use for a given channel; return 0 if the channel is not available to set */ +int __wine_dbg_set_channel_flags( struct __wine_debug_channel *channel, + unsigned char set, unsigned char clear ) +{ + if (nb_debug_options) + { + struct __wine_debug_channel *opt = bsearch( channel->name, debug_options, nb_debug_options, + sizeof(debug_options[0]), cmp_name ); + if (opt) + { + opt->flags = (opt->flags & ~clear) | set; + return 1; + } + } + return 0; +} + /* 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 ) { diff --git a/libs/wine/wine.def b/libs/wine/wine.def index de6dd3b488d..bea6f8a17de 100644 --- a/libs/wine/wine.def +++ b/libs/wine/wine.def @@ -2,6 +2,7 @@ LIBRARY libwine.dll EXPORTS __wine_dbg_get_channel_flags + __wine_dbg_set_channel_flags __wine_dbg_set_functions __wine_dll_register __wine_main_argc diff --git a/libs/wine/wine.map b/libs/wine/wine.map index 5ab7258edb8..fabd57b320c 100644 --- a/libs/wine/wine.map +++ b/libs/wine/wine.map @@ -2,6 +2,7 @@ WINE_1.0 { global: __wine_dbg_get_channel_flags; + __wine_dbg_set_channel_flags; __wine_dbg_set_functions; __wine_dll_register; __wine_main_argc;