libweston/weston-debug: Add a easy way to determine if the debug protocol has been enabled

This allows additional debug features to depend on the debug protocol being enabled

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
dev
Marius Vlad 6 years ago
parent f7843a50ab
commit d9bcc0b171
  1. 10
      libweston/weston-debug.c
  2. 3
      libweston/weston-debug.h

@ -350,6 +350,16 @@ weston_compositor_enable_debug_protocol(struct weston_compositor *compositor)
"information leak.\n");
}
/** Determine if the debug protocol has been enabled
*
* \param wc The libweston compositor to verify if debug protocol has been enabled
*/
WL_EXPORT bool
weston_compositor_is_debug_protocol_enabled(struct weston_compositor *wc)
{
return wc->weston_debug->global != NULL;
}
/** Register a new debug stream name, creating a debug scope
*
* \param compositor The libweston compositor where to add.

@ -39,6 +39,9 @@ struct weston_compositor;
void
weston_compositor_enable_debug_protocol(struct weston_compositor *);
bool
weston_compositor_is_debug_protocol_enabled(struct weston_compositor *);
struct weston_debug_scope;
struct weston_debug_stream;

Loading…
Cancel
Save