From: Eric Bollengier Date: Fri, 25 Feb 2022 15:02:07 +0000 (+0100) Subject: metaplugin: Add function to determine if the plugin is ready to be used X-Git-Tag: Release-11.3.2~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c9441d26f4285ee35a9d59fcde57e6acfc5f274;p=thirdparty%2Fbacula.git metaplugin: Add function to determine if the plugin is ready to be used --- diff --git a/bacula/src/plugins/fd/pluginlib/commctx.h b/bacula/src/plugins/fd/pluginlib/commctx.h index fecef7d57..f7fdc5642 100644 --- a/bacula/src/plugins/fd/pluginlib/commctx.h +++ b/bacula/src/plugins/fd/pluginlib/commctx.h @@ -69,7 +69,12 @@ public: bool check_command(const char *command); void foreach_command(void (*func)(T *, void *), void *param); bRC foreach_command_status(bRC (*func)(T *, void *), void *param); + bool is_ctx_null() { return ctx == NULL ; } + /* Shortcut that will blow up if ctx is not yet defined, use carefully + * The gdb backtrace is misleading, we see pluginctx->xxx while we + * do pluginctx.ctx->xxx + */ T * operator->() { return ctx; } };