From 9a605799941ee1211f165b66617e38ec361ad7e7 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 22 Jul 2025 14:44:40 +0200 Subject: [PATCH] dix: add dixGetAtomID() Helper function for retrieving _existing_ atom ID for given name. If atom doesn't exist yet, it won't be created, but returning None instead. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/dix_priv.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dix/dix_priv.h b/dix/dix_priv.h index fc22d02fa5..30c10ce2cf 100644 --- a/dix/dix_priv.h +++ b/dix/dix_priv.h @@ -704,4 +704,16 @@ static inline int WriteRpcbufToClient(ClientPtr pClient, return ret; } +/* + * @brief retrieve atom ID by name + * + * if the atom doesn't exist yet, 0 / NONE is returned + * + * @param name the atom name + * @return atom ID + */ +static inline Atom dixGetAtomID(const char *name) { + return MakeAtom(name, strlen(name), FALSE); +} + #endif /* _XSERVER_DIX_PRIV_H */