#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "dix.h"
#include "misc.h"
#include "dixstruct.h"
_X_EXPORT WindowPtr
SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode)
{
WindowPtr pWin;
int i = dixLookupWindow(&pWin, id, client, access_mode);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
"are deprecated. Please convert your driver/module "
"to use dixLookupWindow().\n");
return (i == Success) ? pWin : NULL;
}
_X_EXPORT WindowPtr
LookupWindow(XID id, ClientPtr client)
{
return SecurityLookupWindow(id, client, DixUnknownAccess);
}
_X_EXPORT pointer
SecurityLookupDrawable(XID id, ClientPtr client, Mask access_mode)
{
DrawablePtr pDraw;
int i = dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() "
"are deprecated. Please convert your driver/module "
"to use dixLookupDrawable().\n");
return (i == Success) ? pDraw : NULL;
}
_X_EXPORT pointer
LookupDrawable(XID id, ClientPtr client)
{
return SecurityLookupDrawable(id, client, DixUnknownAccess);
}
_X_EXPORT ClientPtr
LookupClient(XID id, ClientPtr client)
{
ClientPtr pClient;
int i = dixLookupClient(&pClient, id, client, DixUnknownAccess);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: LookupClient() is deprecated. Please convert your "
"driver/module to use dixLookupClient().\n");
return (i == Success) ? pClient : NULL;
}
_X_EXPORT pointer
SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype,
Mask access_mode)
{
pointer retval;
int i = dixLookupResourceByType(&retval, id, rtype, client, access_mode);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() "
"are deprecated. Please convert your driver/module "
"to use dixLookupResourceByType().\n");
return (i == Success) ? retval : NULL;
}
_X_EXPORT pointer
SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes,
Mask access_mode)
{
pointer retval;
int i = dixLookupResourceByClass(&retval, id, classes, client, access_mode);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() "
"are deprecated. Please convert your driver/module "
"to use dixLookupResourceByClass().\n");
return (i == Success) ? retval : NULL;
}
_X_EXPORT pointer
LookupIDByType(XID id, RESTYPE rtype)
{
return SecurityLookupIDByType(NullClient, id, rtype, DixUnknownAccess);
}
_X_EXPORT pointer
LookupIDByClass(XID id, RESTYPE classes)
{
return SecurityLookupIDByClass(NullClient, id, classes, DixUnknownAccess);
}
_X_EXPORT int
dixLookupResource (pointer *result, XID id, RESTYPE rtype,
ClientPtr client, Mask mode)
{
Bool istype = ((rtype & TypeMask) && (rtype != RC_ANY)) || (rtype == RT_NONE);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: dixLookupResource() "
"is deprecated. Please convert your driver/module "
"to use dixLookupResourceByType/dixLookupResourceByClass().\n");
if (istype)
return dixLookupResourceByType (result, id, rtype, client, mode);
else
return dixLookupResourceByClass (result, id, rtype, client, mode);
}