Commit 2671b777cf146d93f8963dac79964d9167c6de66

Dan Nicholson 2009-03-28T14:06:26

Add more *Text functions from xkbfile This should cover all the usage in xkbcomp. The format arguments were dropped except for the special case of XkbModMaskText, which needs to write in XkbCFile format in HandleVModDef. This was just changed to a Bool to avoid the need for the macros in XKBfile.h. The function prefixes have been renamed to be unique from xkbfile.

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
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h
index 16e0a7b..7eafa77 100644
--- a/include/X11/extensions/XKBcommon.h
+++ b/include/X11/extensions/XKBcommon.h
@@ -159,10 +159,28 @@ extern Atom
 XkbcInternAtom(char *name, Bool onlyIfExists);
 
 extern char *
-XkbConfigText(unsigned config);
+XkbcAtomText(Atom atm);
 
 extern char *
-XkbActionTypeText(unsigned type);
+XkbcModMaskText(unsigned mask, Bool cFormat);
+
+extern char *
+XkbcConfigText(unsigned config);
+
+extern char *
+XkbcGeomFPText(int val);
+
+extern char *
+XkbcActionTypeText(unsigned type);
+
+extern char *
+XkbcKeysymText(KeySym sym);
+
+extern char *
+XkbcKeyNameText(char *name);
+
+extern char *
+XkbcSIMatchText(unsigned type);
 
 _XFUNCPROTOEND
 
diff --git a/src/text.c b/src/text.c
index 139bdc7..0180747 100644
--- a/src/text.c
+++ b/src/text.c
@@ -28,9 +28,177 @@
 #include <config.h>
 #endif
 #include "X11/extensions/XKBcommon.h"
+#include "XKBcommonint.h"
+#include <X11/extensions/XKM.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+#define BUFFER_SIZE 512
+static char textBuffer[BUFFER_SIZE];
+static int tbNext = 0;
+
+static char *
+tbGetBuffer(unsigned size)
+{
+    char *rtrn;
+
+    if (size >= BUFFER_SIZE)
+        return NULL;
+
+    if ((BUFFER_SIZE - tbNext) <= size)
+        tbNext = 0;
+
+    rtrn = &textBuffer[tbNext];
+    tbNext += size;
+
+    return rtrn;
+}
+
+static char *
+XkbStringText(char *str)
+{
+    char *buf, *in, *out;
+    int len;
+    Bool ok;
+
+    if (!str) {
+        buf = tbGetBuffer(2);
+        buf[0] = '\0';
+        return buf;
+    }
+
+    /* Find if there are any non-printable characters */
+    for (ok = True, len = 0, in = str; *in != '\0'; in++, len++) {
+        if (isprint(*in))
+            continue;
+
+        ok = False;
+        switch (*in) {
+        case '\n': case '\t': case '\v':
+        case '\b': case '\r': case '\f':
+            len++;
+            break;
+        default:
+            /* octal: \0ooo */
+            len += 4;
+            break;
+        }
+    }
+
+    if (ok)
+        return str;
+
+    /* Cleanup non-printable characters */
+    buf = tbGetBuffer(len + 1);
+    for (in = str, out = buf; *in != '\0'; in++) {
+        if (isprint(*in)) {
+            *out++ = *in;
+            continue;
+        }
+
+        *out++ = '\\';
+        switch (*in) {
+        case '\n':
+            *out++ = 'n';
+            break;
+        case '\t':
+            *out++ = 't';
+            break;
+        case '\v':
+            *out++ = 'v';
+            break;
+        case '\b':
+            *out++ = 'b';
+            break;
+        case '\r':
+            *out++ = 'r';
+            break;
+        case '\f':
+            *out++ = 'f';
+            break;
+        default:
+            *out++ = '0';
+            snprintf(out, 3, "%o", *in);
+            while (*out != '\0')
+                out++;
+        }
+    }
+
+    *out++ = '\0';
+    return buf;
+}
+
+char *
+XkbcAtomText(Atom atm)
+{
+    char *tmp, *rtrn;
+    int len;
+
+    tmp = XkbcAtomGetString(atm);
+
+    if (!tmp)
+        return "";
+
+    len = strlen(tmp) + 1;
+    if (len >= BUFFER_SIZE)
+        len = BUFFER_SIZE - 2;
+
+    rtrn = tbGetBuffer(len);
+    strncpy(rtrn, tmp, len);
+    rtrn[len] = '\0';
+
+    _XkbFree(tmp);
+
+    return XkbStringText(rtrn);
+}
+
+static char *modNames[XkbNumModifiers] = {
+    "Shift",
+    "Lock",
+    "Control",
+    "Mod1",
+    "Mod2",
+    "Mod3",
+    "Mod4",
+    "Mod5"
+};
 
 char *
-XkbConfigText(unsigned config)
+XkbcModMaskText(unsigned mask, Bool cFormat)
+{
+    int i, rem, bit;
+    char *str, *buf;
+
+    if ((mask & 0xff) == 0xff)
+        return (cFormat ? "0xff" : "all");
+
+    if ((mask & 0xff) == 0)
+        return (cFormat ? "0" : "none");
+
+    rem = 64;
+    buf = tbGetBuffer(rem);
+    str = buf;
+    buf[0] = '\0';
+    for (i = 0, bit = 1; i < XkbNumModifiers && rem > 1; i++, bit <<= 1) {
+        int len;
+
+        if (!(mask & bit))
+            continue;
+
+        len = snprintf(str, rem, "%s%s%s",
+                       (str != buf) ? (cFormat ? "|" : "+") : "",
+                       modNames[i],
+                       cFormat ? "Mask" : "");
+        rem -= len;
+        str += len;
+    }
+
+    return buf;
+}
+
+char *
+XkbcConfigText(unsigned config)
 {
     switch (config) {
     case XkmSemanticsFile:
@@ -59,6 +227,24 @@ XkbConfigText(unsigned config)
     }
 }
 
+char *
+XkbcGeomFPText(int val)
+{
+    char *buf;
+    int whole, frac;
+
+    buf = tbGetBuffer(12);
+    whole = val / XkbGeomPtsPerMM;
+    frac = val % XkbGeomPtsPerMM;
+
+    if (frac != 0)
+        snprintf(buf, 12, "%d.%d", whole, frac);
+    else
+        snprintf(buf, 12, "%d", whole);
+
+    return buf;
+}
+
 static char *actionTypeNames[XkbSA_NumActions]= {
     "NoAction",         /* XkbSA_NoAction */
     "SetMods",          /* XkbSA_SetMods */
@@ -84,9 +270,73 @@ static char *actionTypeNames[XkbSA_NumActions]= {
 };
 
 char *
-XkbActionTypeText(unsigned type)
+XkbcActionTypeText(unsigned type)
 {
     if (type <= XkbSA_LastAction)
         return actionTypeNames[type];
     return "Private";
 }
+
+char *
+XkbcKeysymText(KeySym sym)
+{
+    char *buf;
+
+    if (sym == NoSymbol)
+        return "NoSymbol";
+
+    if ((buf = XkbcKeysymToString(sym)))
+        return buf;
+
+    buf = tbGetBuffer(32);
+    snprintf(buf, 32, "0x%lx", (long)sym);
+    return buf;
+}
+
+char *
+XkbcKeyNameText(char *name)
+{
+    char *buf;
+    int len;
+
+    buf = tbGetBuffer(7);
+    buf[0] = '<';
+    strncpy(&buf[1], name, 4);
+    buf[5] = '\0';
+    len = strlen(buf);
+    buf[len++] = '>';
+    buf[len] = '\0';
+
+    return buf;
+}
+
+static char *siMatchText[5] = {
+    "NoneOf",       /* XkbSI_NoneOf */
+    "AnyOfOrNone",  /* XkbSI_AnyOfOrNone */
+    "AnyOf",        /* XkbSI_AnyOf */
+    "AllOf",        /* XkbSI_AllOf */
+    "Exactly"       /* XkbSI_Exactly */
+};
+
+char *
+XkbcSIMatchText(unsigned type)
+{
+    char *buf;
+
+    switch (type & XkbSI_OpMask) {
+    case XkbSI_NoneOf:
+        return siMatchText[0];
+    case XkbSI_AnyOfOrNone:
+        return siMatchText[1];
+    case XkbSI_AnyOf:
+        return siMatchText[2];
+    case XkbSI_AllOf:
+        return siMatchText[3];
+    case XkbSI_Exactly:
+        return siMatchText[4];
+    default:
+        buf = tbGetBuffer(40);
+        snprintf(buf, 40, "0x%x", type & XkbSI_OpMask);
+        return buf;
+    }
+}
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 0f70fce..b18b08c 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -300,7 +300,7 @@ static Bool
 ReportMismatch(unsigned action, unsigned field, const char *type)
 {
     ERROR2("Value of %s field must be of type %s\n", fieldText(field), type);
-    ACTION1("Action %s definition ignored\n", XkbActionTypeText(action));
+    ACTION1("Action %s definition ignored\n", XkbcActionTypeText(action));
     return False;
 }
 
@@ -308,7 +308,7 @@ static Bool
 ReportIllegal(unsigned action, unsigned field)
 {
     ERROR2("Field %s is not defined for an action of type %s\n",
-           fieldText(field), XkbActionTypeText(action));
+           fieldText(field), XkbcActionTypeText(action));
     ACTION("Action definition ignored\n");
     return False;
 }
@@ -317,7 +317,7 @@ static Bool
 ReportActionNotArray(unsigned action, unsigned field)
 {
     ERROR2("The %s field in the %s action is not an array\n",
-           fieldText(field), XkbActionTypeText(action));
+           fieldText(field), XkbcActionTypeText(action));
     ACTION("Action definition ignored\n");
     return False;
 }
@@ -327,7 +327,7 @@ ReportNotFound(unsigned action, unsigned field, const char *what, char *bad)
 {
     ERROR2("%s named %s not found\n", what, bad);
     ACTION2("Ignoring the %s field of an %s action\n", fieldText(field),
-            XkbActionTypeText(action));
+            XkbcActionTypeText(action));
     return False;
 }
 
@@ -499,7 +499,7 @@ CheckGroupField(unsigned action,
     {
         ERROR2("Illegal group %d (must be in the range 1..%d)\n", rtrn.ival,
                XkbNumKbdGroups);
-        ACTION1("Action %s definition ignored\n", XkbActionTypeText(action));
+        ACTION1("Action %s definition ignored\n", XkbcActionTypeText(action));
         return False;
     }
     if (value->op == OpNegate)
@@ -1055,8 +1055,7 @@ HandleRedirectKey(XkbcDescPtr xkb,
         if (!FindNamedKey(xkb, tmp, &t1, True, CreateKeyNames(xkb), 0))
         {
             return ReportNotFound(action->type, field, "Key",
-                                  XkbKeyNameText(rtrn.keyName.name,
-                                                 XkbMessage));
+                                  XkbcKeyNameText(rtrn.keyName.name));
         }
         act->new_key = t1;
         return True;
diff --git a/src/xkbcomp/alias.c b/src/xkbcomp/alias.c
index 2635c68..9fba41f 100644
--- a/src/xkbcomp/alias.c
+++ b/src/xkbcomp/alias.c
@@ -40,8 +40,7 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
             (warningLevel > 9))
         {
             WARN2("Alias of %s for %s declared more than once\n",
-                  XkbKeyNameText(new->alias, XkbMessage),
-                  XkbKeyNameText(new->real, XkbMessage));
+                  XkbcKeyNameText(new->alias), XkbcKeyNameText(new->real));
             ACTION("First definition ignored\n");
         }
     }
@@ -62,10 +61,9 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
             (warningLevel > 9))
         {
             WARN1("Multiple definitions for alias %s\n",
-                  XkbKeyNameText(old->alias, XkbMessage));
+                  XkbcKeyNameText(old->alias));
             ACTION2("Using %s, ignoring %s\n",
-                    XkbKeyNameText(use, XkbMessage),
-                    XkbKeyNameText(ignore, XkbMessage));
+                    XkbcKeyNameText(use), XkbcKeyNameText(ignore));
         }
         if (use != old->real)
             memcpy(old->real, use, XkbKeyNameLength);
@@ -188,8 +186,7 @@ ApplyAliases(XkbcDescPtr xkb, Bool toGeom, AliasInfo ** info_in)
             if (warningLevel > 4)
             {
                 WARN2("Attempt to alias %s to non-existent key %s\n",
-                      XkbKeyNameText(info->alias, XkbMessage),
-                      XkbKeyNameText(info->real, XkbMessage));
+                      XkbcKeyNameText(info->alias), XkbcKeyNameText(info->real));
                 ACTION("Ignored\n");
             }
             info->alias[0] = '\0';
@@ -202,8 +199,8 @@ ApplyAliases(XkbcDescPtr xkb, Bool toGeom, AliasInfo ** info_in)
             {
                 WARN("Attempt to create alias with the name of a real key\n");
                 ACTION2("Alias \"%s = %s\" ignored\n",
-                        XkbKeyNameText(info->alias, XkbMessage),
-                        XkbKeyNameText(info->real, XkbMessage));
+                        XkbcKeyNameText(info->alias),
+                        XkbcKeyNameText(info->real));
             }
             info->alias[0] = '\0';
             continue;
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index de6a1f2..1e9f249 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -90,10 +90,10 @@ siText(SymInterpInfo * si, CompatInfo * info)
     }
     else
     {
-        snprintf(buf, sizeof(buf), "%s+%s(%s)", 
-		XkbKeysymText(si->interp.sym, XkbMessage),
-                XkbSIMatchText(si->interp.match, XkbMessage),
-                XkbModMaskText(si->interp.mods, XkbMessage));
+        snprintf(buf, sizeof(buf), "%s+%s(%s)",
+                XkbcKeysymText(si->interp.sym),
+                XkbcSIMatchText(si->interp.match),
+                XkbcModMaskText(si->interp.mods, False));
     }
     return buf;
 }
@@ -304,8 +304,7 @@ ResolveStateAndPredicate(ExprDef * expr,
     *pred_rtrn = XkbSI_Exactly;
     if (expr->op == ExprActionDecl)
     {
-        char *pred_txt =
-            XkbAtomText(NULL, expr->value.action.name, XkbMessage);
+        char *pred_txt = XkbcAtomText(expr->value.action.name);
         if (uStrCaseCmp(pred_txt, "noneof") == 0)
             *pred_rtrn = XkbSI_NoneOf;
         else if (uStrCaseCmp(pred_txt, "anyofornone") == 0)
@@ -326,7 +325,7 @@ ResolveStateAndPredicate(ExprDef * expr,
     }
     else if (expr->op == ExprIdent)
     {
-        char *pred_txt = XkbAtomText(NULL, expr->value.str, XkbMessage);
+        char *pred_txt = XkbcAtomText(expr->value.str);
         if ((pred_txt) && (uStrCaseCmp(pred_txt, "any") == 0))
         {
             *pred_rtrn = XkbSI_AnyOf;
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 5631cfe..c71399a 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -326,7 +326,7 @@ ExprResolveModIndex(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Cannot determine modifier index for \"%s\"\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         break;
     case ExprFieldRef:
         bogus = "field reference";
@@ -422,7 +422,7 @@ ExprResolveBoolean(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Identifier \"%s\" of type int is unknown\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
         if (lookup)
@@ -433,8 +433,8 @@ ExprResolveBoolean(ExprDef * expr,
         }
         if (!ok)
             ERROR2("Default \"%s.%s\" of type boolean is unknown\n",
-                   XkbAtomText(NULL, expr->value.field.element, XkbMessage),
-                   XkbAtomText(NULL, expr->value.field.field, XkbMessage));
+                   XkbcAtomText(expr->value.field.element),
+                   XkbcAtomText(expr->value.field.field));
         return ok;
     case OpInvert:
     case OpNot:
@@ -512,7 +512,7 @@ ExprResolveFloat(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Numeric identifier \"%s\" unknown\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
         if (lookup)
@@ -523,8 +523,8 @@ ExprResolveFloat(ExprDef * expr,
         }
         if (!ok)
             ERROR2("Numeric default \"%s.%s\" unknown\n",
-                   XkbAtomText(NULL, expr->value.field.element, XkbMessage),
-                   XkbAtomText(NULL, expr->value.field.field, XkbMessage));
+                   XkbcAtomText(expr->value.field.element),
+                   XkbcAtomText(expr->value.field.field));
         return ok;
     case OpAdd:
     case OpSubtract:
@@ -633,7 +633,7 @@ ExprResolveInteger(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Identifier \"%s\" of type int is unknown\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
         if (lookup)
@@ -644,8 +644,8 @@ ExprResolveInteger(ExprDef * expr,
         }
         if (!ok)
             ERROR2("Default \"%s.%s\" of type int is unknown\n",
-                   XkbAtomText(NULL, expr->value.field.element, XkbMessage),
-                   XkbAtomText(NULL, expr->value.field.field, XkbMessage));
+                   XkbcAtomText(expr->value.field.element),
+                   XkbcAtomText(expr->value.field.field));
         return ok;
     case OpAdd:
     case OpSubtract:
@@ -741,7 +741,7 @@ ExprResolveString(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Identifier \"%s\" of type string not found\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
         if (lookup)
@@ -752,8 +752,8 @@ ExprResolveString(ExprDef * expr,
         }
         if (!ok)
             ERROR2("Default \"%s.%s\" of type string not found\n",
-                   XkbAtomText(NULL, expr->value.field.element, XkbMessage),
-                   XkbAtomText(NULL, expr->value.field.field, XkbMessage));
+                   XkbcAtomText(expr->value.field.element),
+                   XkbcAtomText(expr->value.field.field));
         return ok;
     case OpAdd:
         left = expr->value.binary.left;
@@ -843,7 +843,7 @@ ExprResolveKeyName(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Identifier \"%s\" of type string not found\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
         if (lookup)
@@ -854,8 +854,8 @@ ExprResolveKeyName(ExprDef * expr,
         }
         if (!ok)
             ERROR2("Default \"%s.%s\" of type key name not found\n",
-                   XkbAtomText(NULL, expr->value.field.element, XkbMessage),
-                   XkbAtomText(NULL, expr->value.field.field, XkbMessage));
+                   XkbcAtomText(expr->value.field.element),
+                   XkbcAtomText(expr->value.field.field));
         return ok;
     case OpAdd:
         if (bogus == NULL)
@@ -917,7 +917,7 @@ ExprResolveEnum(ExprDef * expr, ExprResult * val_rtrn, LookupEntry * values)
     {
         int nOut = 0;
         ERROR1("Illegal identifier %s (expected one of: ",
-               XkbAtomText(NULL, expr->value.str, XkbMessage));
+               XkbcAtomText(expr->value.str));
         while (values && values->name)
         {
             if (nOut != 0)
@@ -963,7 +963,7 @@ ExprResolveMask(ExprDef * expr,
         }
         if (!ok)
             ERROR1("Identifier \"%s\" of type int is unknown\n",
-                   XkbAtomText(NULL, expr->value.str, XkbMessage));
+                   XkbcAtomText(expr->value.str));
         return ok;
     case ExprFieldRef:
         if (lookup)
@@ -974,8 +974,8 @@ ExprResolveMask(ExprDef * expr,
         }
         if (!ok)
             ERROR2("Default \"%s.%s\" of type int is unknown\n",
-                   XkbAtomText(NULL, expr->value.field.element, XkbMessage),
-                   XkbAtomText(NULL, expr->value.field.field, XkbMessage));
+                   XkbcAtomText(expr->value.field.element),
+                   XkbcAtomText(expr->value.field.field));
         return ok;
     case ExprArrayRef:
         bogus = "array reference";
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index e7eac3b..3baafe6 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -67,8 +67,8 @@ typedef struct _ShapeInfo
     int dfltCornerRadius;
 } ShapeInfo;
 
-#define	shText(d,s)	\
-		((s)?XkbAtomText((d),(s)->name,XkbMessage):"default shape")
+#define	shText(d, s) \
+    ((s) ? XkbcAtomText((s)->name) : "default shape")
 
 #define	_GD_Priority	(1<<0)
 #define	_GD_Top		(1<<1)
@@ -158,8 +158,8 @@ typedef struct _RowInfo
     KeyInfo dfltKey;
     struct _SectionInfo *section;
 } RowInfo;
-#define	rowText(d,r)	\
-	((r)?XkbAtomText((d),(r)->section->name,XkbMessage):"default")
+#define	rowText(d, r) \
+    ((r) ? XkbcAtomText((r)->section->name) : "default")
 
 #define	_GOK_UnknownRow	-1
 typedef struct _OverlayKeyInfo
@@ -179,7 +179,8 @@ typedef struct _OverlayInfo
     unsigned short nKeys;
     OverlayKeyInfo *keys;
 } OverlayInfo;
-#define	oiText(d,o)	((o)?XkbAtomText((d),(o)->name,XkbMessage):"default")
+#define	oiText(d, o) \
+    ((o) ? XkbcAtomText((o)->name) : "default")
 
 
 #define	_GS_Default	(1<<0)
@@ -211,7 +212,8 @@ typedef struct _SectionInfo
     OverlayInfo *overlays;
     struct _GeometryInfo *geometry;
 } SectionInfo;
-#define	scText(d,s)	((s)?XkbAtomText((d),(s)->name,XkbMessage):"default")
+#define	scText(d, s) \
+    ((s) ? XkbcAtomText((s)->name) : "default")
 
 typedef struct _GeometryInfo
 {
@@ -260,11 +262,10 @@ ddText(Display * dpy, DoodadInfo * di)
     if (di->section)
     {
         sprintf(buf, "%s in section %s",
-                XkbAtomText(dpy, di->name, XkbMessage), scText(dpy,
-                                                               di->section));
+                XkbcAtomText(di->name), scText(dpy, di->section));
         return buf;
     }
-    return XkbAtomText(dpy, di->name, XkbMessage);
+    return XkbcAtomText(di->name);
 }
 
 /***====================================================================***/
@@ -806,7 +807,7 @@ FindShape(GeometryInfo * info, Atom name, const char *type, const char *which)
     {
         old = info->shapes;
         WARN3("Unknown shape \"%s\" for %s %s\n",
-              XkbAtomText(info->dpy, name, XkbMessage), type, which);
+              XkbcAtomText(name), type, which);
         if (old)
         {
             ACTION1("Using default shape %s instead\n",
@@ -942,7 +943,7 @@ AddDoodad(SectionInfo * si, GeometryInfo * info, DoodadInfo * new)
                  && (warningLevel > 0)) || (warningLevel > 9))
             {
                 WARN1("Multiple doodads named \"%s\"\n",
-                      XkbAtomText(info->dpy, old->name, XkbMessage));
+                      XkbcAtomText(old->name));
                 ACTION("Using last definition\n");
             }
             ReplaceDoodad(old, new);
@@ -953,7 +954,7 @@ AddDoodad(SectionInfo * si, GeometryInfo * info, DoodadInfo * new)
             || (warningLevel > 9))
         {
             WARN1("Multiple doodads named \"%s\"\n",
-                  XkbAtomText(info->dpy, old->name, XkbMessage));
+                  XkbcAtomText(old->name));
             ACTION("Using first definition\n");
         }
         return True;
@@ -1026,8 +1027,7 @@ AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
             {
                 WARN2
                     ("Multiple overlays named \"%s\" for section \"%s\"\n",
-                     XkbAtomText(info->dpy, old->name, XkbMessage),
-                     XkbAtomText(info->dpy, si->name, XkbMessage));
+                     XkbcAtomText(old->name), XkbcAtomText(si->name));
                 ACTION("Using last definition\n");
             }
             ClearOverlayInfo(old);
@@ -1041,8 +1041,7 @@ AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
             || (warningLevel > 9))
         {
             WARN2("Multiple doodads named \"%s\" in section \"%s\"\n",
-                  XkbAtomText(info->dpy, old->name, XkbMessage),
-                  XkbAtomText(info->dpy, si->name, XkbMessage));
+                  XkbcAtomText(old->name), XkbcAtomText(si->name));
             ACTION("Using first definition\n");
         }
         return True;
@@ -1056,8 +1055,7 @@ AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
             WSGO("Couldn't allocate a new OverlayInfo\n");
             ACTION2
                 ("Overlay \"%s\" in section \"%s\" will be incomplete\n",
-                 XkbAtomText(info->dpy, old->name, XkbMessage),
-                 XkbAtomText(info->dpy, si->name, XkbMessage));
+                 XkbcAtomText(old->name), XkbcAtomText(si->name));
         }
         return False;
     }
@@ -2242,16 +2240,14 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info)
         {
             WARN("Keyboard width must be positive\n");
             ACTION1("Ignoring illegal keyboard width %s\n",
-                    XkbGeomFPText(tmp.ival, XkbMessage));
+                    XkbcGeomFPText(tmp.ival));
             return True;
         }
         if (info->widthMM != 0)
         {
             WARN("Keyboard width multiply defined\n");
-            ACTION1("Using last definition (%s),",
-                    XkbGeomFPText(tmp.ival, XkbMessage));
-            INFO1(" ignoring first (%s)\n",
-                  XkbGeomFPText(info->widthMM, XkbMessage));
+            ACTION1("Using last definition (%s),", XkbcGeomFPText(tmp.ival));
+            INFO1(" ignoring first (%s)\n", XkbcGeomFPText(info->widthMM));
         }
         info->widthMM = tmp.ival;
         return True;
@@ -2273,16 +2269,14 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info)
         {
             WARN("Keyboard height must be positive\n");
             ACTION1("Ignoring illegal keyboard height %s\n",
-                    XkbGeomFPText(tmp.ival, XkbMessage));
+                    XkbcGeomFPText(tmp.ival));
             return True;
         }
         if (info->heightMM != 0)
         {
             WARN("Keyboard height multiply defined\n");
-            ACTION1("Using last definition (%s),",
-                    XkbGeomFPText(tmp.ival, XkbMessage));
-            INFO1(" ignoring first (%s)\n",
-                  XkbGeomFPText(info->heightMM, XkbMessage));
+            ACTION1("Using last definition (%s),", XkbcGeomFPText(tmp.ival));
+            INFO1(" ignoring first (%s)\n", XkbcGeomFPText(info->heightMM));
         }
         info->heightMM = tmp.ival;
         return True;
@@ -2446,7 +2440,7 @@ HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge,
         }
         if (ol->field != None)
         {
-            char *str = XkbAtomText(NULL, ol->field, XkbMessage);
+            char *str = XkbcAtomText(ol->field);
             if ((uStrCaseCmp(str, "approximation") == 0) ||
                 (uStrCaseCmp(str, "approx") == 0))
             {
@@ -2559,8 +2553,7 @@ HandleOverlayDef(OverlayDef * def,
     if ((def->nKeys < 1) && (warningLevel > 3))
     {
         WARN2("Overlay \"%s\" in section \"%s\" has no keys\n",
-              XkbAtomText(NULL, def->name, XkbMessage), scText(info->dpy,
-                                                               si));
+              XkbcAtomText(def->name), scText(info->dpy, si));
         ACTION("Overlay ignored\n");
         return True;
     }
@@ -3118,8 +3111,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
             {
                 WARN1("No font size for text doodad %s\n",
                       ddText(info->dpy, di));
-                ACTION1("Using %s point text\n",
-                        XkbGeomFPText(DFLT_SIZE, XkbMessage));
+                ACTION1("Using %s point text\n", XkbcGeomFPText(DFLT_SIZE));
             }
             di->fontSize = DFLT_SIZE;
         }
@@ -3141,7 +3133,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
                 WARN1("No height for text doodad %s\n",
                       ddText(info->dpy, di));
                 ACTION1("Using calculated height %s millimeters\n",
-                        XkbGeomFPText(size, XkbMessage));
+                        XkbcGeomFPText(size));
             }
             di->height = size;
         }
@@ -3168,7 +3160,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
             {
                 WARN1("No width for text doodad %s\n", ddText(info->dpy, di));
                 ACTION1("Using calculated width %s millimeters\n",
-                        XkbGeomFPText(width, XkbMessage));
+                        XkbcGeomFPText(width));
             }
             di->width = width;
         }
@@ -3426,11 +3418,9 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
                     {
                         WARN3
                             ("Key %s in section \"%s\" and overlay \"%s\"\n",
-                             XkbKeyNameText(key->name.name,
-                                            XkbMessage),
-                             XkbAtomText(info->dpy, section->name,
-                                         XkbMessage),
-                             XkbAtomText(info->dpy, oi->name, XkbMessage));
+                             XkbcKeyNameText(key->name.name),
+                             XkbcAtomText(section->name),
+                             XkbcAtomText(oi->name));
                         ACTION("Overlay definition ignored\n");
                     }
                     oKey = 0;
@@ -3446,9 +3436,9 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
         {
             WARN3
                 ("Key %s not in \"%s\", but has an overlay key in \"%s\"\n",
-                 XkbKeyNameText(ki->under, XkbMessage),
-                 XkbAtomText(info->dpy, section->name, XkbMessage),
-                 XkbAtomText(info->dpy, oi->name, XkbMessage));
+                 XkbcKeyNameText(ki->under),
+                 XkbcAtomText(section->name),
+                 XkbcAtomText(oi->name));
             ACTION("Definition ignored\n");
         }
     }
@@ -3474,8 +3464,7 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
     if (oi->nKeys < 1)
     {
         ERROR2("Overlay \"%s\" for section \"%s\" has no legal keys\n",
-               XkbAtomText(info->dpy, oi->name, XkbMessage),
-               XkbAtomText(info->dpy, section->name, XkbMessage));
+               XkbcAtomText(oi->name), XkbcAtomText(section->name));
         ACTION("Overlay definition ignored\n");
         return False;
     }
@@ -3515,8 +3504,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
     if (!ol)
     {
         WSGO2("Couldn't add overlay \"%s\" to section \"%s\"\n",
-              XkbAtomText(info->dpy, name, XkbMessage),
-              XkbAtomText(info->dpy, section->name, XkbMessage));
+              XkbcAtomText(name), XkbcAtomText(section->name));
         return False;
     }
     for (i = 0; i < oi->nRows; i++)
@@ -3532,8 +3520,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
         {
             WSGO3
                 ("Can't add row %d to overlay \"%s\" of section \"%s\"\n",
-                 i, XkbAtomText(info->dpy, name, XkbMessage),
-                 XkbAtomText(info->dpy, section->name, XkbMessage));
+                 i, XkbcAtomText(name), XkbcAtomText(section->name));
             return False;
         }
     }
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 6841894..b2ad92a 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -35,12 +35,10 @@
 
 /***====================================================================***/
 
-#define	ReportIndicatorBadType(d,l,f,w)	\
-		ReportBadType("indicator map",(f),\
-		      	XkbAtomText((d),(l)->name,XkbMessage),(w))
-#define	ReportIndicatorNotArray(d,l,f)	\
-		ReportNotArray("indicator map",(f),\
-			XkbAtomText((d),(l)->name,XkbMessage))
+#define ReportIndicatorBadType(d,l,f,w) \
+    ReportBadType("indicator map", (f), XkbcAtomText((l)->name), (w))
+#define ReportIndicatorNotArray(d,l,f) \
+    ReportNotArray("indicator map", (f), XkbcAtomText((l)->name))
 
 /***====================================================================***/
 
@@ -84,7 +82,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new)
                      && (warningLevel > 0)) || (warningLevel > 9))
                 {
                     WARN1("Map for indicator %s redefined\n",
-                          XkbAtomText(NULL, old->name, XkbMessage));
+                          XkbcAtomText(old->name));
                     ACTION("Earlier definition ignored\n");
                 }
                 *old = *new;
@@ -136,7 +134,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new)
             if (collide)
             {
                 WARN1("Map for indicator %s redefined\n",
-                      XkbAtomText(NULL, old->name, XkbMessage));
+                      XkbcAtomText(old->name));
                 ACTION1("Using %s definition for duplicate fields\n",
                         (new->defs.merge == MergeAugment ? "first" : "last"));
             }
@@ -151,7 +149,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new)
     {
         WSGO("Couldn't allocate indicator map\n");
         ACTION1("Map for indicator %s not compiled\n",
-                XkbAtomText(NULL, new->name, XkbMessage));
+                XkbcAtomText(new->name));
         return NULL;
     }
     *old = *new;
@@ -306,7 +304,7 @@ SetIndicatorMapField(LEDInfo * led,
             ERROR2("Illegal indicator index %d (range 1..%d)\n",
                    rtrn.uval, XkbNumIndicators);
             ACTION1("Index definition for %s indicator ignored\n",
-                    XkbAtomText(NULL, led->name, XkbMessage));
+                    XkbcAtomText(led->name));
             return False;
         }
         led->indicator = rtrn.uval;
@@ -315,7 +313,7 @@ SetIndicatorMapField(LEDInfo * led,
     else
     {
         ERROR2("Unknown field %s in map for %s indicator\n", field,
-               XkbAtomText(NULL, led->name, XkbMessage));
+               XkbcAtomText(led->name));
         ACTION("Definition ignored\n");
         ok = False;
     }
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index 2c9eb58..5b92447 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -37,7 +37,7 @@ longText(unsigned long val, unsigned format)
     char buf[4];
 
     LongToKeyName(val, buf);
-    return XkbKeyNameText(buf, format);
+    return XkbcKeyNameText(buf);
 }
 
 /***====================================================================***/
@@ -168,8 +168,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
         if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
             || (warningLevel > 9))
         {
-            WARN1("Multiple indicators named %s\n",
-                  XkbAtomText(NULL, new->name, XkbMessage));
+            WARN1("Multiple indicators named %s\n", XkbcAtomText(new->name));
             if (old->ndx == new->ndx)
             {
                 if (old->virtual != new->virtual)
@@ -248,8 +247,8 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
                     ignoring = new->name;
                 }
                 ACTION4("Using %s %s, ignoring %s %s\n",
-                        oldType, XkbAtomText(NULL, using, XkbMessage),
-                        newType, XkbAtomText(NULL, ignoring, XkbMessage));
+                        oldType, XkbcAtomText(using),
+                        newType, XkbcAtomText(ignoring));
             }
         }
         if (replace)
@@ -852,7 +851,7 @@ CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
             {
                 LongToKeyName(info.names[i], xkb->names->keys[i].name);
                 uDEBUG2(2, "key %d = %s\n", i,
-                        XkbKeyNameText(xkb->names->keys[i].name, XkbMessage));
+                        XkbcKeyNameText(xkb->names->keys[i].name));
             }
         }
         else
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 7253d4e..927dd95 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -75,7 +75,7 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
         break;
     default:
         ERROR1("Cannot compile %s alone into an XKM file\n",
-               XkbConfigText(mainType));
+               XkbcConfigText(mainType));
         return False;
     }
     have = 0;
@@ -88,14 +88,14 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
         if ((have & (1 << file->type)) != 0)
         {
             ERROR2("More than one %s section in a %s file\n",
-                   XkbConfigText(file->type), XkbConfigText(mainType));
+                   XkbcConfigText(file->type), XkbcConfigText(mainType));
             ACTION("All sections after the first ignored\n");
             ok = False;
         }
         else if ((1 << file->type) & (~legal))
         {
             ERROR2("Cannot define %s in a %s file\n",
-                   XkbConfigText(file->type), XkbConfigText(mainType));
+                   XkbcConfigText(file->type), XkbcConfigText(mainType));
             ok = False;
         }
         else
@@ -105,7 +105,7 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
             case XkmLayoutFile:
             case XkmKeymapFile:
                 WSGO2("Illegal %s configuration in a %s file\n",
-                      XkbConfigText(file->type), XkbConfigText(mainType));
+                      XkbcConfigText(file->type), XkbcConfigText(mainType));
                 ACTION("Ignored\n");
                 ok = False;
                 break;
@@ -128,7 +128,7 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
             case XkmVirtualModsIndex:
             case XkmIndicatorsIndex:
                 WSGO1("Found an isolated %s section\n",
-                      XkbConfigText(file->type));
+                      XkbcConfigText(file->type));
                 break;
             default:
                 WSGO1("Unknown file type %d\n", file->type);
@@ -166,12 +166,12 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
             if (missing & bit)
             {
                 ERROR2("Missing %s section in a %s file\n",
-                       XkbConfigText(i), XkbConfigText(mainType));
+                       XkbcConfigText(i), XkbcConfigText(mainType));
                 missing &= ~bit;
             }
         }
         ACTION1("Description of %s not compiled\n",
-                XkbConfigText(mainType));
+                XkbcConfigText(mainType));
         ok = False;
     }
     ok = BindIndicators(xkb, True, unbound, NULL);
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index fc8ffa1..eb5aa9d 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -119,7 +119,7 @@ extern Bool AddLevelName(KeyTypeInfo * /* type */ ,
 	XkbVModMaskText((t)->dpy,(x),(p)->indexMods,(p)->indexVMods,XkbMessage)
 #define	PreserveTxt(t,x,p)	\
 	XkbVModMaskText((t)->dpy,(x),(p)->preMods,(p)->preVMods,XkbMessage)
-#define	TypeTxt(t)	XkbAtomText((t)->dpy,(t)->name,XkbMessage)
+#define	TypeTxt(t)	XkbcAtomText((t)->name)
 #define	TypeMaskTxt(t,x)	\
 	XkbVModMaskText((t)->dpy,(x),(t)->mask,(t)->vmask,XkbMessage)
 
@@ -819,8 +819,8 @@ AddLevelName(KeyTypeInfo * type,
         if (warningLevel > 0)
         {
             char *old, *new;
-            old = XkbAtomText(type->dpy, type->lvlNames[level], XkbMessage);
-            new = XkbAtomText(type->dpy, name, XkbMessage);
+            old = XkbcAtomText(type->lvlNames[level]);
+            new = XkbcAtomText(name);
             WARN2("Multiple names for level %d of key type %s\n",
                   level + 1, TypeTxt(type));
             if (clobber)
@@ -852,7 +852,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
         ERROR3("Level name %d out of range (1..%d) in key type %s\n",
                rtrn.ival,
                XkbMaxShiftLevel + 1,
-               XkbAtomText(type->dpy, type->name, XkbMessage));
+               XkbcAtomText(type->name));
         ACTION("Ignoring illegal level name definition\n");
         return False;
     }
@@ -860,7 +860,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
     if (!ExprResolveString(value, &rtrn, NULL, NULL))
     {
         ERROR2("Non-string name for level %d in key type %s\n", level + 1,
-               XkbAtomText(type->dpy, type->name, XkbMessage));
+               XkbcAtomText(type->name));
         ACTION("Ignoring illegal level name definition\n");
         return False;
     }
@@ -904,7 +904,7 @@ SetKeyTypeField(KeyTypeInfo * type,
         if (type->defs.defined & _KT_Mask)
         {
             WARN1("Multiple modifier mask definitions for key type %s\n",
-                  XkbAtomText(type->dpy, type->name, XkbMessage));
+                  XkbcAtomText(type->name));
             ACTION1("Using %s, ", TypeMaskTxt(type, xkb));
             INFO1("ignoring %s\n", XkbVModMaskText(type->dpy, xkb, mods,
                                                    vmods, XkbMessage));
@@ -1167,7 +1167,7 @@ CopyDefToKeyType(XkbcDescPtr xkb, XkbKeyTypePtr type, KeyTypeInfo * def)
         {
             WARN("Couldn't allocate preserve array in CopyDefToKeyType\n");
             ACTION1("Preserve setting for type %s lost\n",
-                    XkbAtomText(def->dpy, def->name, XkbMessage));
+                    XkbcAtomText(def->name));
         }
         else
         {
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index de0f667..800d3ce 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -99,7 +99,7 @@ ProcessIncludeFile(IncludeStmt * stmt,
         if (!mapToUse)
         {
             ERROR3("No %s named \"%s\" in the include file \"%s\"\n",
-                   XkbConfigText(file_type), stmt->map, stmt->file);
+                   XkbcConfigText(file_type), stmt->map, stmt->file);
             ACTION("Exiting\n");
             return False;
         }
@@ -114,7 +114,7 @@ ProcessIncludeFile(IncludeStmt * stmt,
     if (mapToUse->type != file_type)
     {
         ERROR2("Include file wrong type (expected %s, got %s)\n",
-               XkbConfigText(file_type), XkbConfigText(mapToUse->type));
+               XkbcConfigText(file_type), XkbcConfigText(mapToUse->type));
         ACTION1("Include file \"%s\" ignored\n", stmt->file);
         return False;
     }
@@ -424,7 +424,7 @@ ComputeKbdDefaults(XkbcDescPtr xkb)
                         {
                             WARN1
                                 ("Several keys match pattern for %s\n",
-                                 XkbKeyNameText(name->name, XkbMessage));
+                                 XkbcKeyNameText(name->name));
                             ACTION2("Using <U%03d> for key %d\n",
                                     nUnknown, i);
                         }
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 912abb9..236d451 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -410,8 +410,7 @@ MergeKeyGroups(SymbolsInfo * info,
                     ("Multiple symbols for level %d/group %d on key %s\n",
                      i + 1, group + 1, longText(into->name, XkbMessage));
                 ACTION2("Using %s, ignoring %s\n",
-                        XkbKeysymText(use, XkbMessage),
-                        XkbKeysymText(ignore, XkbMessage));
+                        XkbcKeysymText(use), XkbcKeysymText(ignore));
             }
             resultSyms[i] = use;
         }
@@ -449,8 +448,8 @@ MergeKeyGroups(SymbolsInfo * info,
                         ("Multiple actions for level %d/group %d on key %s\n",
                          i + 1, group + 1, longText(into->name, XkbMessage));
                     ACTION2("Using %s, ignoring %s\n",
-                            XkbActionTypeText(use->type),
-                            XkbActionTypeText(ignore->type));
+                            XkbcActionTypeText(use->type),
+                            XkbcActionTypeText(ignore->type));
                 }
                 resultActs[i] = *use;
             }
@@ -554,8 +553,8 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
                     ("Multiple definitions for group %d type of key %s\n",
                      i, longText(into->name, XkbMessage));
                 ACTION2("Using %s, ignoring %s\n",
-                        XkbAtomText(NULL, use, XkbMessage),
-                        XkbAtomText(NULL, ignore, XkbMessage));
+                        XkbcAtomText(use),
+                        XkbcAtomText(ignore));
             }
             if ((from->defs.merge != MergeAugment)
                 || (into->types[i] == None))
@@ -661,7 +660,7 @@ AddModMapEntry(SymbolsInfo * info, ModMapEntry * new)
                 }
                 ERROR1
                     ("%s added to symbol map for multiple modifiers\n",
-                     XkbKeysymText(new->u.keySym, XkbMessage));
+                     XkbcKeysymText(new->u.keySym));
                 ACTION2("Using %s, ignoring %s.\n",
                         XkbModIndexText(use, XkbMessage),
                         XkbModIndexText(ignore, XkbMessage));
@@ -1603,7 +1602,7 @@ HandleModMapDef(ModMapDef * def,
     {
         ERROR("Illegal modifier map definition\n");
         ACTION1("Ignoring map for non-modifier \"%s\"\n",
-                XkbAtomText(NULL, def->modifier, XkbMessage));
+                XkbcAtomText(def->modifier));
         return False;
     }
     ok = True;
@@ -1968,7 +1967,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
         {
             WARN2("Key %s not found in %s keycodes\n",
                   longText(key->name, XkbMessage),
-                  XkbAtomText(NULL, xkb->names->keycodes, XkbMessage));
+                  XkbcAtomText(xkb->names->keycodes));
             ACTION("Symbols ignored\n");
         }
         return False;
@@ -2000,8 +1999,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
                     WARN1("No automatic type for %d symbols\n",
                           (unsigned int) key->numLevels[i]);
                     ACTION3("Using %s for the %s key (keycode %d)\n",
-                            XkbAtomText(NULL, key->types[i],
-                                        XkbMessage),
+                            XkbcAtomText(key->types[i]),
                             longText(key->name, XkbMessage), kc);
                 }
             }
@@ -2016,7 +2014,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
             if (warningLevel >= 3)
             {
                 WARN1("Type \"%s\" is not defined\n",
-                      XkbAtomText(NULL, key->types[i], XkbMessage));
+                      XkbcAtomText(key->types[i]));
                 ACTION2("Using TWO_LEVEL for the %s key (keycode %d)\n",
                         longText(key->name, XkbMessage), kc);
             }
@@ -2030,7 +2028,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
             {
                 WARN4
                     ("Type \"%s\" has %d levels, but %s has %d symbols\n",
-                     XkbAtomText(NULL, type->name, XkbMessage),
+                     XkbcAtomText(type->name),
                      (unsigned int) type->num_levels,
                      longText(key->name, XkbMessage),
                      (unsigned int) key->numLevels[i]);
@@ -2121,7 +2119,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
             {
                 WARN2("Key %s not found in %s keycodes\n",
                       longText(key->nameForOverlayKey, XkbMessage),
-                      XkbAtomText(NULL, xkb->names->keycodes, XkbMessage));
+                      XkbcAtomText(xkb->names->keycodes));
                 ACTION1("Not treating %s as an overlay key \n",
                         longText(key->name, XkbMessage));
             }
@@ -2166,7 +2164,7 @@ CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
         {
             WARN2("Key %s not found in %s keycodes\n",
                   longText(entry->u.keyName, XkbMessage),
-                  XkbAtomText(NULL, xkb->names->keycodes, XkbMessage));
+                  XkbcAtomText(xkb->names->keycodes));
             ACTION1("Modifier map entry for %s not updated\n",
                     XkbModIndexText(entry->modifier, XkbMessage));
         }
@@ -2178,8 +2176,8 @@ CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
         if (warningLevel > 5)
         {
             WARN2("Key \"%s\" not found in %s symbol map\n",
-                  XkbKeysymText(entry->u.keySym, XkbMessage),
-                  XkbAtomText(NULL, xkb->names->symbols, XkbMessage));
+                  XkbcKeysymText(entry->u.keySym),
+                  XkbcAtomText(xkb->names->symbols));
             ACTION1("Modifier map entry for %s not updated\n",
                     XkbModIndexText(entry->modifier, XkbMessage));
         }
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 8b9d378..d7e586e 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -104,20 +104,20 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
                     const char *str2 = "";
                     if (!ExprResolveModMask(stmt->value, &mod, NULL, NULL))
                     {
-                        str1 = XkbAtomText(NULL, stmt->name, XkbMessage);
+                        str1 = XkbcAtomText(stmt->name);
                         ACTION1("Declaration of %s ignored\n", str1);
                         return False;
                     }
                     if (mod.uval == srv->vmods[i])
                         return True;
 
-                    str1 = XkbAtomText(NULL, stmt->name, XkbMessage);
+                    str1 = XkbcAtomText(stmt->name);
                     WARN1("Virtual modifier %s multiply defined\n", str1);
-                    str1 = XkbModMaskText(srv->vmods[i], XkbCFile);
+                    str1 = XkbcModMaskText(srv->vmods[i], True);
                     if (mergeMode == MergeOverride)
                     {
                         str2 = str1;
-                        str1 = XkbModMaskText(mod.uval, XkbCFile);
+                        str1 = XkbcModMaskText(mod.uval, True);
                     }
                     ACTION2("Using %s, ignoring %s\n", str1, str2);
                     if (mergeMode == MergeOverride)
@@ -148,7 +148,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
         return True;
     }
     ACTION1("Declaration of %s ignored\n",
-            XkbAtomText(NULL, stmt->name, XkbMessage));
+            XkbcAtomText(stmt->name));
     return False;
 }