Compare commits

...

2 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult bd8b6980ca dix: unexport InitAtoms() and FreeAllAtoms()
Not used by any drivers, very DIX-internal, so should not be part
of public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-22 18:37:11 +02:00
Enrico Weigelt, metux IT consult 08dfb34d62 dix: replace AtomError() by better messages
Not used by any exteral drivers (and really should not be used by them),
so can be replaced by more fitting error messages.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-05-22 17:31:24 +02:00
8 changed files with 26 additions and 19 deletions

View File

@ -51,6 +51,7 @@ SOFTWARE.
#include <X11/X.h>
#include <X11/Xatom.h>
#include "dix/atom_priv.h"
#include "dix/dix_priv.h"
#include "misc.h"
@ -159,12 +160,6 @@ NameForAtom(Atom atom)
return node->string;
}
void
AtomError(void)
{
FatalError("initializing atoms");
}
static void
FreeAtom(NodePtr patom)
{
@ -201,9 +196,9 @@ InitAtoms(void)
tableLength = InitialTableSize;
nodeTable = xallocarray(InitialTableSize, sizeof(NodePtr));
if (!nodeTable)
AtomError();
FatalError("creating atom table");
nodeTable[None] = NULL;
MakePredeclaredAtoms();
if (lastAtom != XA_LAST_PREDEFINED)
AtomError();
FatalError("builtin atom number mismatch");
}

18
dix/atom_priv.h Normal file
View File

@ -0,0 +1,18 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DIX_ATOM_PRIV_H
#define _XSERVER_DIX_ATOM_PRIV_H
/*
* @brief initialize atom table
*/
void InitAtoms(void);
/*
* @brief free all atoms and atom table
*/
void FreeAllAtoms(void);
#endif /* _XSERVER_DIX_ATOM_PRIV_H */

View File

@ -10,7 +10,7 @@ do_line() {
local name="$1"
[ "$2" != "@" ] && return 0
echo " if (MakeAtom(\"$name\", ${#name}, 1) != XA_$name)"
echo " AtomError();"
echo " FatalError(\"adding builtin atom\");"
}
cat > "$OUTPUT" << __END__

View File

@ -85,6 +85,7 @@ Equipment Corporation.
#include <X11/fonts/libxfont2.h>
#include "config/hotplug_priv.h"
#include "dix/atom_priv.h"
#include "dix/callback_priv.h"
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"

View File

@ -257,16 +257,6 @@ extern _X_EXPORT Bool ValidAtom(Atom /*atom */ );
extern _X_EXPORT const char *NameForAtom(Atom /*atom */ );
extern _X_EXPORT void
AtomError(void)
_X_NORETURN;
extern _X_EXPORT void
FreeAllAtoms(void);
extern _X_EXPORT void
InitAtoms(void);
/* main.c */
extern _X_EXPORT void

View File

@ -28,6 +28,7 @@
#include <stdint.h>
#include "dix/atom_priv.h"
#include "dix/input_priv.h"
#include "inputstr.h"

View File

@ -30,6 +30,7 @@
#include <stdint.h>
#include <X11/extensions/XI2.h>
#include "dix/atom_priv.h"
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"

View File

@ -29,6 +29,7 @@
#include <stdint.h>
#include <X11/Xatom.h>
#include "dix/atom_priv.h"
#include "dix/dix_priv.h"
#include "dix/input_priv.h"