xace: Add XaceHookIsSet helper function
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
fa12f2c150
commit
5dc2a9aae4
15
Xext/xace.c
15
Xext/xace.c
|
@ -213,6 +213,21 @@ XaceHook(int hook, ...)
|
||||||
return prv ? *prv : Success;
|
return prv ? *prv : Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XaceHookIsSet
|
||||||
|
*
|
||||||
|
* Utility function to determine whether there are any callbacks listening on a
|
||||||
|
* particular XACE hook.
|
||||||
|
*
|
||||||
|
* Returns non-zero if there is a callback, zero otherwise.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
XaceHookIsSet(int hook)
|
||||||
|
{
|
||||||
|
if (hook < 0 || hook >= XACE_NUM_HOOKS)
|
||||||
|
return 0;
|
||||||
|
return XaceHooks[hook] != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* XaceCensorImage
|
/* XaceCensorImage
|
||||||
*
|
*
|
||||||
* Called after pScreen->GetImage to prevent pieces or trusted windows from
|
* Called after pScreen->GetImage to prevent pieces or trusted windows from
|
||||||
|
|
|
@ -65,6 +65,9 @@ extern _X_EXPORT int XaceHook(int /*hook */ ,
|
||||||
... /*appropriate args for hook */
|
... /*appropriate args for hook */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* determine whether any callbacks are present for the XACE hook */
|
||||||
|
extern _X_EXPORT int XaceHookIsSet(int hook);
|
||||||
|
|
||||||
/* Special-cased hook functions
|
/* Special-cased hook functions
|
||||||
*/
|
*/
|
||||||
extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major);
|
extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major);
|
||||||
|
|
Loading…
Reference in New Issue