Commit a0e756fd83e9e4910ed8981f2ed7b6b0b522a2dc

Daniel Stone 2012-03-09T19:09:25

Introduce xkb_atom_t type Signed-off-by: Daniel Stone <daniel@fooishbar.org>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
diff --git a/src/atom.c b/src/atom.c
index 43e8fad..40c2153 100644
--- a/src/atom.c
+++ b/src/atom.c
@@ -88,13 +88,13 @@ typedef struct _Node {
 
 #define BAD_RESOURCE 0xe0000000
 
-static uint32_t lastAtom = None;
+static xkb_atom_t lastAtom = None;
 static NodePtr atomRoot = NULL;
 static unsigned long tableLength;
 static NodePtr *nodeTable = NULL;
 
 const char *
-XkbcAtomText(uint32_t atom)
+XkbcAtomText(xkb_atom_t atom)
 {
     NodePtr node;
 
@@ -106,13 +106,13 @@ XkbcAtomText(uint32_t atom)
 }
 
 char *
-XkbcAtomGetString(uint32_t atom)
+XkbcAtomGetString(xkb_atom_t atom)
 {
     const char *ret = XkbcAtomText(atom);
     return ret ? strdup(ret) : NULL;
 }
 
-uint32_t
+xkb_atom_t
 xkb_intern_atom(const char *string)
 {
     NodePtr *np;
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index c2e9609..fa59897 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -52,7 +52,7 @@ typedef struct _GroupCompatInfo
     unsigned char fileID;
     unsigned char merge;
     unsigned char real_mods;
-    uint32_t vmods;
+    xkb_atom_t vmods;
 } GroupCompatInfo;
 
 typedef struct _CompatInfo
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index db45e9b..d912631 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -34,7 +34,7 @@
 /***====================================================================***/
 
 typedef Bool(*IdentLookupFunc) (const void * /* priv */ ,
-                                uint32_t /* field */ ,
+                                xkb_atom_t /* field */ ,
                                 unsigned /* type */ ,
                                 ExprResult *    /* val_rtrn */
     );
@@ -163,7 +163,7 @@ ExprResolveLhs(ExprDef * expr,
 }
 
 static Bool
-SimpleLookup(const void * priv, uint32_t field, unsigned type,
+SimpleLookup(const void * priv, xkb_atom_t field, unsigned type,
              ExprResult * val_rtrn)
 {
     const LookupEntry *entry;
@@ -189,7 +189,7 @@ SimpleLookup(const void * priv, uint32_t field, unsigned type,
 }
 
 static Bool
-RadioLookup(const void * priv, uint32_t field, unsigned type, ExprResult * val_rtrn)
+RadioLookup(const void * priv, xkb_atom_t field, unsigned type, ExprResult * val_rtrn)
 {
     const char *str;
     int rg;
@@ -229,14 +229,14 @@ static const LookupEntry modIndexNames[] = {
 };
 
 int
-LookupModIndex(const void * priv, uint32_t field, unsigned type,
+LookupModIndex(const void * priv, xkb_atom_t field, unsigned type,
                ExprResult * val_rtrn)
 {
     return SimpleLookup(modIndexNames, field, type, val_rtrn);
 }
 
 int
-LookupModMask(const void * priv, uint32_t field, unsigned type,
+LookupModMask(const void * priv, xkb_atom_t field, unsigned type,
               ExprResult * val_rtrn)
 {
     char *str;
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 921516b..c990351 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -52,19 +52,19 @@ extern const char *exprOpText(unsigned        /* type */
     );
 
 extern int LookupModMask(const void * /* priv */ ,
-                         uint32_t /* field */ ,
+                         xkb_atom_t /* field */ ,
                          unsigned /* type */ ,
                          ExprResult *  /* val_rtrn */
     );
 
 extern int LookupVModMask(const void * /* priv */ ,
-                          uint32_t /* field */ ,
+                          xkb_atom_t /* field */ ,
                           unsigned /* type */ ,
                           ExprResult *  /* val_rtrn */
     );
 
 extern int LookupModIndex(const void * /* priv */ ,
-                          uint32_t /* field */ ,
+                          xkb_atom_t /* field */ ,
                           unsigned /* type */ ,
                           ExprResult *  /* val_rtrn */
     );
diff --git a/src/xkbcomp/indicators.h b/src/xkbcomp/indicators.h
index f4b38f1..dd0e680 100644
--- a/src/xkbcomp/indicators.h
+++ b/src/xkbcomp/indicators.h
@@ -40,7 +40,7 @@
 typedef struct _LEDInfo
 {
     CommonInfo defs;
-    uint32_t name;
+    xkb_atom_t name;
     unsigned char indicator;
     unsigned char flags;
     unsigned char which_mods;
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index b207fdc..a65bb1a 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -59,7 +59,7 @@ typedef struct _IndicatorNameInfo
 {
     CommonInfo defs;
     int ndx;
-    uint32_t name;
+    xkb_atom_t name;
     Bool virtual;
 } IndicatorNameInfo;
 
@@ -185,7 +185,7 @@ FindIndicatorByIndex(KeyNamesInfo * info, int ndx)
 }
 
 static IndicatorNameInfo *
-FindIndicatorByName(KeyNamesInfo * info, uint32_t name)
+FindIndicatorByName(KeyNamesInfo * info, xkb_atom_t name)
 {
     IndicatorNameInfo *old;
 
@@ -270,7 +270,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
             else
             {
                 const char *oldType, *newType;
-                uint32_t using, ignoring;
+                xkb_atom_t using, ignoring;
                 if (old->virtual)
                     oldType = "virtual indicator";
                 else
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index 5b10818..5268d2d 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -52,7 +52,7 @@ typedef struct _PreserveInfo
 typedef struct _KeyTypeInfo
 {
     CommonInfo defs;
-    uint32_t name;
+    xkb_atom_t name;
     int fileID;
     unsigned mask;
     unsigned vmask;
@@ -63,7 +63,7 @@ typedef struct _KeyTypeInfo
     struct xkb_kt_map_entry * entries;
     PreserveInfo *preserve;
     int szNames;
-    uint32_t *lvlNames;
+    xkb_atom_t *lvlNames;
 } KeyTypeInfo;
 
 typedef struct _KeyTypesInfo
@@ -78,10 +78,10 @@ typedef struct _KeyTypesInfo
     VModInfo vmods;
 } KeyTypesInfo;
 
-static uint32_t tok_ONE_LEVEL;
-static uint32_t tok_TWO_LEVEL;
-static uint32_t tok_ALPHABETIC;
-static uint32_t tok_KEYPAD;
+static xkb_atom_t tok_ONE_LEVEL;
+static xkb_atom_t tok_TWO_LEVEL;
+static xkb_atom_t tok_ALPHABETIC;
+static xkb_atom_t tok_KEYPAD;
 
 /***====================================================================***/
 
@@ -147,10 +147,10 @@ InitKeyTypesInfo(KeyTypesInfo * info, struct xkb_desc * xkb, KeyTypesInfo * from
         }
         if (from->dflt.lvlNames)
         {
-            info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, uint32_t);
+            info->dflt.lvlNames = uTypedCalloc(from->dflt.szNames, xkb_atom_t);
             if (info->dflt.lvlNames)
             {
-                unsigned sz = from->dflt.szNames * sizeof(uint32_t);
+                unsigned sz = from->dflt.szNames * sizeof(xkb_atom_t);
                 memcpy(info->dflt.lvlNames, from->dflt.lvlNames, sz);
             }
         }
@@ -732,12 +732,12 @@ SetPreserve(KeyTypeInfo * type,
 
 static Bool
 AddLevelName(KeyTypeInfo * type,
-             unsigned level, uint32_t name, Bool clobber, Bool report)
+             unsigned level, xkb_atom_t name, Bool clobber, Bool report)
 {
     if ((type->lvlNames == NULL) || (type->szNames <= level))
     {
         type->lvlNames =
-            uTypedRecalloc(type->lvlNames, type->szNames, level + 1, uint32_t);
+            uTypedRecalloc(type->lvlNames, type->szNames, level + 1, xkb_atom_t);
         if (type->lvlNames == NULL)
         {
             ERROR("Couldn't allocate level names for type %s\n",
@@ -786,7 +786,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
 {
     ExprResult rtrn;
     unsigned level;
-    uint32_t level_name;
+    xkb_atom_t level_name;
 
     if (arrayNdx == NULL)
         return ReportTypeShouldBeArray(type, "level name");
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index 56c6d12..df1aa57 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -230,8 +230,8 @@ AddCommonInfo(CommonInfo * old, CommonInfo * new)
 
 typedef struct _KeyNameDesc
 {
-    uint32_t level1;
-    uint32_t level2;
+    xkb_atom_t level1;
+    xkb_atom_t level2;
     char name[5];
     Bool used;
 } KeyNameDesc;
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index 7148aad..88bfff8 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -166,7 +166,7 @@ KeyAliasCreate(char *alias, char *real)
 }
 
 VModDef *
-VModCreate(uint32_t name, ExprDef * value)
+VModCreate(xkb_atom_t name, ExprDef * value)
 {
     VModDef *def;
     def = uTypedAlloc(VModDef);
@@ -206,7 +206,7 @@ VarCreate(ExprDef * name, ExprDef * value)
 }
 
 VarDef *
-BoolVarCreate(uint32_t nameToken, unsigned set)
+BoolVarCreate(xkb_atom_t nameToken, unsigned set)
 {
     ExprDef *name, *value;
 
@@ -239,7 +239,7 @@ InterpCreate(char *sym, ExprDef * match)
 }
 
 KeyTypeDef *
-KeyTypeCreate(uint32_t name, VarDef * body)
+KeyTypeCreate(xkb_atom_t name, VarDef * body)
 {
     KeyTypeDef *def;
 
@@ -328,7 +328,7 @@ ModMapCreate(uint32_t modifier, ExprDef * keys)
 }
 
 IndicatorMapDef *
-IndicatorMapCreate(uint32_t name, VarDef * body)
+IndicatorMapCreate(xkb_atom_t name, VarDef * body)
 {
     IndicatorMapDef *def;
 
@@ -373,7 +373,7 @@ IndicatorNameCreate(int ndx, ExprDef * name, Bool virtual)
 }
 
 ExprDef *
-ActionCreate(uint32_t name, ExprDef * args)
+ActionCreate(xkb_atom_t name, ExprDef * args)
 {
     ExprDef *act;
 
@@ -413,7 +413,7 @@ CreateKeysymList(char *sym)
 }
 
 ShapeDef *
-ShapeDeclCreate(uint32_t name, OutlineDef * outlines)
+ShapeDeclCreate(xkb_atom_t name, OutlineDef * outlines)
 {
     ShapeDef *shape;
     OutlineDef *ol;
@@ -438,7 +438,7 @@ ShapeDeclCreate(uint32_t name, OutlineDef * outlines)
 }
 
 OutlineDef *
-OutlineCreate(uint32_t field, ExprDef * points)
+OutlineCreate(xkb_atom_t field, ExprDef * points)
 {
     OutlineDef *outline;
     ExprDef *pt;
@@ -506,7 +506,7 @@ RowDeclCreate(KeyDef * keys)
 }
 
 SectionDef *
-SectionDeclCreate(uint32_t name, RowDef * rows)
+SectionDeclCreate(xkb_atom_t name, RowDef * rows)
 {
     SectionDef *section;
     RowDef *row;
@@ -548,7 +548,7 @@ OverlayKeyCreate(char *under, char *over)
 }
 
 OverlayDef *
-OverlayDeclCreate(uint32_t name, OverlayKeyDef * keys)
+OverlayDeclCreate(xkb_atom_t name, OverlayKeyDef * keys)
 {
     OverlayDef *ol;
     OverlayKeyDef *key;
@@ -570,7 +570,7 @@ OverlayDeclCreate(uint32_t name, OverlayKeyDef * keys)
 }
 
 DoodadDef *
-DoodadCreate(unsigned type, uint32_t name, VarDef * body)
+DoodadCreate(unsigned type, xkb_atom_t name, VarDef * body)
 {
     DoodadDef *doodad;
 
diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h
index efb3317..2853e90 100644
--- a/src/xkbcomp/parseutils.h
+++ b/src/xkbcomp/parseutils.h
@@ -62,7 +62,7 @@ extern KeyAliasDef *KeyAliasCreate(char * /* alias */ ,
                                    char *       /* real */
     );
 
-extern VModDef *VModCreate(uint32_t /* name */ ,
+extern VModDef *VModCreate(xkb_atom_t /* name */ ,
                            ExprDef *    /* value */
     );
 
@@ -70,7 +70,7 @@ extern VarDef *VarCreate(ExprDef * /* name */ ,
                          ExprDef *      /* value */
     );
 
-extern VarDef *BoolVarCreate(uint32_t /* nameToken */ ,
+extern VarDef *BoolVarCreate(xkb_atom_t /* nameToken */ ,
                              unsigned   /* set */
     );
 
@@ -78,7 +78,7 @@ extern InterpDef *InterpCreate(char * /* sym */ ,
                                ExprDef *        /* match */
     );
 
-extern KeyTypeDef *KeyTypeCreate(uint32_t /* name */ ,
+extern KeyTypeDef *KeyTypeCreate(xkb_atom_t /* name */ ,
                                  VarDef *       /* body */
     );
 
@@ -94,7 +94,7 @@ extern ModMapDef *ModMapCreate(uint32_t /* modifier */ ,
                                ExprDef *        /* keys */
     );
 
-extern IndicatorMapDef *IndicatorMapCreate(uint32_t /* name */ ,
+extern IndicatorMapDef *IndicatorMapCreate(xkb_atom_t /* name */ ,
                                            VarDef *     /* body */
     );
 
@@ -103,18 +103,18 @@ extern IndicatorNameDef *IndicatorNameCreate(int /* ndx */ ,
                                              Bool       /* virtual */
     );
 
-extern ExprDef *ActionCreate(uint32_t /* name */ ,
+extern ExprDef *ActionCreate(xkb_atom_t /* name */ ,
                              ExprDef *  /* args */
     );
 
 extern ExprDef *CreateKeysymList(char * /* sym */
     );
 
-extern ShapeDef *ShapeDeclCreate(uint32_t /* name */ ,
+extern ShapeDef *ShapeDeclCreate(xkb_atom_t /* name */ ,
                                  OutlineDef *   /* outlines */
     );
 
-extern OutlineDef *OutlineCreate(uint32_t /* field */ ,
+extern OutlineDef *OutlineCreate(xkb_atom_t /* field */ ,
                                  ExprDef *      /* points */
     );
 
@@ -125,7 +125,7 @@ extern KeyDef *KeyDeclCreate(char * /* name */ ,
 extern RowDef *RowDeclCreate(KeyDef *   /* keys */
     );
 
-extern SectionDef *SectionDeclCreate(uint32_t /* name */ ,
+extern SectionDef *SectionDeclCreate(xkb_atom_t /* name */ ,
                                      RowDef *   /* rows */
     );
 
@@ -133,12 +133,12 @@ extern OverlayKeyDef *OverlayKeyCreate(char * /* under */ ,
                                        char *   /* over  */
     );
 
-extern OverlayDef *OverlayDeclCreate(uint32_t /* name */ ,
+extern OverlayDef *OverlayDeclCreate(xkb_atom_t /* name */ ,
                                      OverlayKeyDef *    /* rows */
     );
 
 extern DoodadDef *DoodadCreate(unsigned /* type */ ,
-                               uint32_t /* name */ ,
+                               xkb_atom_t /* name */ ,
                                VarDef * /* body */
     );
 
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 97ccae5..0d430c4 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -66,13 +66,13 @@ typedef struct _KeyInfo
     short numLevels[XkbNumKbdGroups];
     xkb_keysym_t *syms[XkbNumKbdGroups];
     union xkb_action *acts[XkbNumKbdGroups];
-    uint32_t types[XkbNumKbdGroups];
+    xkb_atom_t types[XkbNumKbdGroups];
     unsigned repeat;
     struct xkb_behavior behavior;
     unsigned short vmodmap;
     unsigned long nameForOverlayKey;
     unsigned long allowNone;
-    uint32_t dfltType;
+    xkb_atom_t dfltType;
 } KeyInfo;
 
 /**
@@ -223,7 +223,7 @@ typedef struct _SymbolsInfo
     KeyInfo dflt;
     VModInfo vmods;
     ActionInfo *action;
-    uint32_t groupNames[XkbNumKbdGroups];
+    xkb_atom_t groupNames[XkbNumKbdGroups];
 
     ModMapEntry *modMap;
     AliasInfo *aliases;
@@ -515,7 +515,7 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
             if ((into->types[i] != None) && (report) &&
                 (into->types[i] != from->types[i]))
             {
-                uint32_t use, ignore;
+                xkb_atom_t use, ignore;
                 collide |= _Key_Types;
                 if (from->defs.merge != MergeAugment)
                 {
@@ -1674,7 +1674,7 @@ FindKeyForSymbol(struct xkb_desc * xkb, xkb_keysym_t sym, xkb_keycode_t *kc_rtrn
  * @return True if found, False otherwise.
  */
 static Bool
-FindNamedType(struct xkb_desc * xkb, uint32_t atom, unsigned *type_rtrn)
+FindNamedType(struct xkb_desc * xkb, xkb_atom_t atom, unsigned *type_rtrn)
 {
     unsigned n;
     const char *name = XkbcAtomText(atom);
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 039da91..2fcf6a1 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -160,7 +160,7 @@ HandleVModDef(VModDef * stmt, struct xkb_desc *xkb, unsigned mergeMode,
  * undefined.
  */
 static int
-LookupVModIndex(const struct xkb_desc *xkb, uint32_t field, unsigned type,
+LookupVModIndex(const struct xkb_desc *xkb, xkb_atom_t field, unsigned type,
                 ExprResult * val_rtrn)
 {
     int i;
@@ -197,7 +197,7 @@ LookupVModIndex(const struct xkb_desc *xkb, uint32_t field, unsigned type,
  * undefined.
  */
 int
-LookupVModMask(const void * priv, uint32_t field, unsigned type,
+LookupVModMask(const void * priv, xkb_atom_t field, unsigned type,
                ExprResult * val_rtrn)
 {
     if (LookupModMask(NULL, field, type, val_rtrn))
@@ -216,7 +216,7 @@ LookupVModMask(const void * priv, uint32_t field, unsigned type,
 int
 FindKeypadVMod(struct xkb_desc * xkb)
 {
-    uint32_t name;
+    xkb_atom_t name;
     ExprResult rtrn;
 
     name = xkb_intern_atom("NumLock");
diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h
index b0026d0..baadaee 100644
--- a/src/xkbcomp/xkbcomp.h
+++ b/src/xkbcomp/xkbcomp.h
@@ -38,6 +38,7 @@
 
 #include "xkbcommon/xkbcommon.h"
 #include "XKBcommonint.h"
+#include "xkbmisc.h"
 
 extern char *scanFile;
 
@@ -137,18 +138,18 @@ typedef struct _Expr
         } binary;
         struct
         {
-            uint32_t element;
-            uint32_t field;
+            xkb_atom_t element;
+            xkb_atom_t field;
         } field;
         struct
         {
-            uint32_t element;
-            uint32_t field;
+            xkb_atom_t element;
+            xkb_atom_t field;
             struct _Expr *entry;
         } array;
         struct
         {
-            uint32_t name;
+            xkb_atom_t name;
             struct _Expr *args;
         } action;
         struct
@@ -163,7 +164,7 @@ typedef struct _Expr
             int y;
         } coord;
         struct _Expr *child;
-        uint32_t str;
+        xkb_atom_t str;
         unsigned uval;
         int ival;
         char keyName[5];
@@ -183,7 +184,7 @@ typedef struct _VModDef
 {
     ParseCommon common;
     unsigned merge;
-    uint32_t name;
+    xkb_atom_t name;
     ExprDef *value;
 } VModDef;
 
@@ -207,7 +208,7 @@ typedef struct _KeyTypeDef
 {
     ParseCommon common;
     unsigned merge;
-    uint32_t name;
+    xkb_atom_t name;
     VarDef *body;
 } KeyTypeDef;
 
@@ -223,7 +224,7 @@ typedef struct _ModMapDef
 {
     ParseCommon common;
     unsigned merge;
-    uint32_t modifier;
+    xkb_atom_t modifier;
     ExprDef *keys;
 } ModMapDef;
 
@@ -256,7 +257,7 @@ typedef struct _IndicatorNameDef
 typedef struct _OutlineDef
 {
     ParseCommon common;
-    uint32_t field;
+    xkb_atom_t field;
     int nPoints;
     ExprDef *points;
 } OutlineDef;
@@ -265,7 +266,7 @@ typedef struct _ShapeDef
 {
     ParseCommon common;
     unsigned merge;
-    uint32_t name;
+    xkb_atom_t name;
     int nOutlines;
     OutlineDef *outlines;
 } ShapeDef;
@@ -289,7 +290,7 @@ typedef struct _SectionDef
 {
     ParseCommon common;
     unsigned merge;
-    uint32_t name;
+    xkb_atom_t name;
     int nRows;
     RowDef *rows;
 } SectionDef;
@@ -305,7 +306,7 @@ typedef struct _OverlayDef
 {
     ParseCommon common;
     unsigned merge;
-    uint32_t name;
+    xkb_atom_t name;
     int nKeys;
     OverlayKeyDef *keys;
 } OverlayDef;
@@ -315,7 +316,7 @@ typedef struct _DoodadDef
     ParseCommon common;
     unsigned merge;
     unsigned type;
-    uint32_t name;
+    xkb_atom_t name;
     VarDef *body;
 } DoodadDef;
 
diff --git a/src/xkbmisc.h b/src/xkbmisc.h
index 198c9d1..a10e6ae 100644
--- a/src/xkbmisc.h
+++ b/src/xkbmisc.h
@@ -31,6 +31,8 @@ authorization from the authors.
 #include <X11/Xdefs.h>
 #include "xkbcommon/xkbcommon.h"
 
+typedef uint32_t xkb_atom_t;
+
 /***====================================================================***/
 
 extern Bool
@@ -67,11 +69,11 @@ XkbcNameMatchesPattern(char *name, char *ptrn);
 
 /***====================================================================***/
 
-extern uint32_t
+extern xkb_atom_t
 xkb_intern_atom(const char *string);
 
 extern char *
-XkbcAtomGetString(uint32_t atom);
+XkbcAtomGetString(xkb_atom_t atom);
 
 extern void
 XkbcFreeAllAtoms(void);
@@ -79,7 +81,7 @@ XkbcFreeAllAtoms(void);
 /***====================================================================***/
 
 extern const char *
-XkbcAtomText(uint32_t atm);
+XkbcAtomText(xkb_atom_t atm);
 
 extern const char *
 XkbcVModMaskText(struct xkb_desc * xkb, unsigned modMask, unsigned mask);