Rename 'ctx' back to 'context' in external API Still keep things as 'ctx' internally so we don't have to worry about typing it too often, but rename the user-visible API back as it was kinda ugly. This partially reverts e7bb1e5f. 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 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
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index ce226f7..2b1eb96 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -118,9 +118,9 @@ struct xkb_rule_names {
/**
* Opaque context object; may only be created, accessed, manipulated and
- * destroyed through the xkb_ctx_*() API.
+ * destroyed through the xkb_context_*() API.
*/
-struct xkb_ctx;
+struct xkb_context;
/**
* Opaque keymap object; may only be created, accessed, manipulated and
@@ -153,14 +153,14 @@ xkb_keysym_t
xkb_keysym_from_name(const char *s);
/**
- * @defgroup ctx XKB contexts
+ * @defgroup context XKB contexts
* Every keymap compilation request must have an XKB context associated with
* it. The context keeps around state such as the include path.
*
* @{
*/
-enum xkb_ctx_flags {
+enum xkb_context_flags {
/** Create this context with an empty include path. */
XKB_CONTEXT_NO_DEFAULT_INCLUDES = 1,
};
@@ -168,10 +168,10 @@ enum xkb_ctx_flags {
/**
* Returns a new XKB context, or NULL on failure. If successful, the caller
* holds a reference on the context, and must free it when finished with
- * xkb_ctx_unref().
+ * xkb_context_unref().
*/
-struct xkb_ctx *
-xkb_ctx_new(enum xkb_ctx_flags flags);
+struct xkb_context *
+xkb_context_new(enum xkb_context_flags flags);
/**
* Appends a new entry to the include path used for keymap compilation.
@@ -179,7 +179,7 @@ xkb_ctx_new(enum xkb_ctx_flags flags);
* inaccessible.
*/
int
-xkb_ctx_include_path_append(struct xkb_ctx *ctx, const char *path);
+xkb_context_include_path_append(struct xkb_context *context, const char *path);
/**
* Appends the default include paths to the context's current include path.
@@ -187,7 +187,7 @@ xkb_ctx_include_path_append(struct xkb_ctx *ctx, const char *path);
* added.
*/
int
-xkb_ctx_include_path_append_default(struct xkb_ctx *ctx);
+xkb_context_include_path_append_default(struct xkb_context *context);
/**
* Removes all entries from the context's include path, and inserts the
@@ -195,37 +195,37 @@ xkb_ctx_include_path_append_default(struct xkb_ctx *ctx);
* could not be added.
*/
int
-xkb_ctx_include_path_reset_defaults(struct xkb_ctx *ctx);
+xkb_context_include_path_reset_defaults(struct xkb_context *context);
/**
* Removes all entries from the context's include path.
*/
void
-xkb_ctx_include_path_clear(struct xkb_ctx *ctx);
+xkb_context_include_path_clear(struct xkb_context *context);
/**
* Returns the number of include paths currently active in the context.
*/
unsigned int
-xkb_ctx_num_include_paths(struct xkb_ctx *ctx);
+xkb_context_num_include_paths(struct xkb_context *context);
/**
* Returns the include path at the specified index within the context.
*/
const char *
-xkb_ctx_include_path_get(struct xkb_ctx *ctx, unsigned int index);
+xkb_context_include_path_get(struct xkb_context *context, unsigned int index);
/**
* Takes a new reference on an XKB context.
*/
-struct xkb_ctx *
-xkb_ctx_ref(struct xkb_ctx *ctx);
+struct xkb_context *
+xkb_context_ref(struct xkb_context *context);
/**
* Releases a reference on an XKB context, and possibly frees it.
*/
void
-xkb_ctx_unref(struct xkb_ctx *ctx);
+xkb_context_unref(struct xkb_context *context);
/** @} */
@@ -249,7 +249,7 @@ enum xkb_map_compile_flags {
* keymaps.
*/
struct xkb_keymap *
-xkb_map_new_from_names(struct xkb_ctx *ctx,
+xkb_map_new_from_names(struct xkb_context *context,
const struct xkb_rule_names *names,
enum xkb_map_compile_flags flags);
@@ -263,7 +263,7 @@ enum xkb_keymap_format {
* file descriptor.
*/
struct xkb_keymap *
-xkb_map_new_from_fd(struct xkb_ctx *ctx,
+xkb_map_new_from_fd(struct xkb_context *context,
int fd, enum xkb_keymap_format format,
enum xkb_map_compile_flags flags);
@@ -272,7 +272,7 @@ xkb_map_new_from_fd(struct xkb_ctx *ctx,
* enormous string.
*/
struct xkb_keymap *
-xkb_map_new_from_string(struct xkb_ctx *ctx,
+xkb_map_new_from_string(struct xkb_context *context,
const char *string,
enum xkb_keymap_format format,
enum xkb_map_compile_flags flags);
diff --git a/src/alloc.c b/src/alloc.c
index b4668ff..2d7025c 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -582,7 +582,7 @@ XkbcFreeIndicatorMaps(struct xkb_keymap *keymap)
}
struct xkb_keymap *
-XkbcAllocKeyboard(struct xkb_ctx *ctx)
+XkbcAllocKeyboard(struct xkb_context *ctx)
{
struct xkb_keymap *keymap;
@@ -591,7 +591,7 @@ XkbcAllocKeyboard(struct xkb_ctx *ctx)
return NULL;
keymap->refcnt = 1;
- keymap->ctx = xkb_ctx_ref(ctx);
+ keymap->ctx = xkb_context_ref(ctx);
return keymap;
}
@@ -608,6 +608,6 @@ XkbcFreeKeyboard(struct xkb_keymap *keymap)
XkbcFreeIndicatorMaps(keymap);
XkbcFreeNames(keymap);
XkbcFreeControls(keymap);
- xkb_ctx_unref(keymap->ctx);
+ xkb_context_unref(keymap->ctx);
free(keymap);
}
diff --git a/src/alloc.h b/src/alloc.h
index 4a0bcca..aec0249 100644
--- a/src/alloc.h
+++ b/src/alloc.h
@@ -43,7 +43,7 @@ extern int
XkbcAllocIndicatorMaps(struct xkb_keymap *keymap);
extern struct xkb_keymap *
-XkbcAllocKeyboard(struct xkb_ctx *ctx);
+XkbcAllocKeyboard(struct xkb_context *ctx);
extern void
XkbcFreeKeyboard(struct xkb_keymap *keymap);
diff --git a/src/context.c b/src/context.c
index 0d0e900..2472d36 100644
--- a/src/context.c
+++ b/src/context.c
@@ -31,7 +31,7 @@
#include "xkb-priv.h"
#include "atom.h"
-struct xkb_ctx {
+struct xkb_context {
int refcnt;
char **include_paths;
@@ -48,7 +48,7 @@ struct xkb_ctx {
* Append one directory to the context's include path.
*/
_X_EXPORT int
-xkb_ctx_include_path_append(struct xkb_ctx *ctx, const char *path)
+xkb_context_include_path_append(struct xkb_context *ctx, const char *path)
{
struct stat stat_buf;
int err;
@@ -87,13 +87,13 @@ xkb_ctx_include_path_append(struct xkb_ctx *ctx, const char *path)
* Append the default include directories to the context.
*/
_X_EXPORT int
-xkb_ctx_include_path_append_default(struct xkb_ctx *ctx)
+xkb_context_include_path_append_default(struct xkb_context *ctx)
{
const char *home = getenv("HOME");
char *user_path;
int err;
- (void) xkb_ctx_include_path_append(ctx, DFLT_XKB_CONFIG_ROOT);
+ (void) xkb_context_include_path_append(ctx, DFLT_XKB_CONFIG_ROOT);
home = getenv("HOME");
if (!home)
@@ -101,7 +101,7 @@ xkb_ctx_include_path_append_default(struct xkb_ctx *ctx)
err = asprintf(&user_path, "%s/.xkb", home);
if (err <= 0)
return 1;
- (void) xkb_ctx_include_path_append(ctx, user_path);
+ (void) xkb_context_include_path_append(ctx, user_path);
free(user_path);
return 1;
@@ -111,7 +111,7 @@ xkb_ctx_include_path_append_default(struct xkb_ctx *ctx)
* Remove all entries in the context's include path.
*/
_X_EXPORT void
-xkb_ctx_include_path_clear(struct xkb_ctx *ctx)
+xkb_context_include_path_clear(struct xkb_context *ctx)
{
int i;
@@ -125,20 +125,20 @@ xkb_ctx_include_path_clear(struct xkb_ctx *ctx)
}
/**
- * xkb_ctx_include_path_clear() + xkb_ctx_include_path_append_default()
+ * xkb_context_include_path_clear() + xkb_context_include_path_append_default()
*/
_X_EXPORT int
-xkb_ctx_include_path_reset_defaults(struct xkb_ctx *ctx)
+xkb_context_include_path_reset_defaults(struct xkb_context *ctx)
{
- xkb_ctx_include_path_clear(ctx);
- return xkb_ctx_include_path_append_default(ctx);
+ xkb_context_include_path_clear(ctx);
+ return xkb_context_include_path_append_default(ctx);
}
/**
* Returns the number of entries in the context's include path.
*/
_X_EXPORT unsigned int
-xkb_ctx_num_include_paths(struct xkb_ctx *ctx)
+xkb_context_num_include_paths(struct xkb_context *ctx)
{
return ctx->num_include_paths;
}
@@ -148,16 +148,16 @@ xkb_ctx_num_include_paths(struct xkb_ctx *ctx)
* invalid index is passed.
*/
_X_EXPORT const char *
-xkb_ctx_include_path_get(struct xkb_ctx *ctx, unsigned int idx)
+xkb_context_include_path_get(struct xkb_context *ctx, unsigned int idx)
{
- if (idx >= xkb_ctx_num_include_paths(ctx))
+ if (idx >= xkb_context_num_include_paths(ctx))
return NULL;
return ctx->include_paths[idx];
}
int
-xkb_ctx_take_file_id(struct xkb_ctx *ctx)
+xkb_context_take_file_id(struct xkb_context *ctx)
{
return ctx->file_id++;
}
@@ -165,8 +165,8 @@ xkb_ctx_take_file_id(struct xkb_ctx *ctx)
/**
* Take a new reference on the context.
*/
-_X_EXPORT struct xkb_ctx *
-xkb_ctx_ref(struct xkb_ctx *ctx)
+_X_EXPORT struct xkb_context *
+xkb_context_ref(struct xkb_context *ctx)
{
ctx->refcnt++;
return ctx;
@@ -177,12 +177,12 @@ xkb_ctx_ref(struct xkb_ctx *ctx)
* now 0.
*/
_X_EXPORT void
-xkb_ctx_unref(struct xkb_ctx *ctx)
+xkb_context_unref(struct xkb_context *ctx)
{
if (--ctx->refcnt > 0)
return;
- xkb_ctx_include_path_clear(ctx);
+ xkb_context_include_path_clear(ctx);
atom_table_free(ctx->atom_table);
free(ctx);
}
@@ -190,10 +190,10 @@ xkb_ctx_unref(struct xkb_ctx *ctx)
/**
* Create a new context.
*/
-_X_EXPORT struct xkb_ctx *
-xkb_ctx_new(enum xkb_ctx_flags flags)
+_X_EXPORT struct xkb_context *
+xkb_context_new(enum xkb_context_flags flags)
{
- struct xkb_ctx *ctx = calloc(1, sizeof(*ctx));
+ struct xkb_context *ctx = calloc(1, sizeof(*ctx));
if (!ctx)
return NULL;
@@ -201,14 +201,14 @@ xkb_ctx_new(enum xkb_ctx_flags flags)
ctx->refcnt = 1;
if (!(flags & XKB_CONTEXT_NO_DEFAULT_INCLUDES) &&
- !xkb_ctx_include_path_append_default(ctx)) {
- xkb_ctx_unref(ctx);
+ !xkb_context_include_path_append_default(ctx)) {
+ xkb_context_unref(ctx);
return NULL;
}
ctx->atom_table = atom_table_new();
if (!ctx->atom_table) {
- xkb_ctx_unref(ctx);
+ xkb_context_unref(ctx);
return NULL;
}
@@ -216,19 +216,19 @@ xkb_ctx_new(enum xkb_ctx_flags flags)
}
xkb_atom_t
-xkb_atom_intern(struct xkb_ctx *ctx, const char *string)
+xkb_atom_intern(struct xkb_context *ctx, const char *string)
{
return atom_intern(ctx->atom_table, string);
}
char *
-xkb_atom_strdup(struct xkb_ctx *ctx, xkb_atom_t atom)
+xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom)
{
return atom_strdup(ctx->atom_table, atom);
}
const char *
-xkb_atom_text(struct xkb_ctx *ctx, xkb_atom_t atom)
+xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom)
{
return atom_text(ctx->atom_table, atom);
}
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index a7f5a70..bbd20ee 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -361,7 +361,7 @@ struct xkb_controls {
/* Common keyboard description structure */
struct xkb_keymap {
- struct xkb_ctx *ctx;
+ struct xkb_context *ctx;
unsigned int refcnt;
unsigned short flags;
@@ -434,13 +434,13 @@ typedef uint32_t xkb_atom_t;
#define XKB_ATOM_NONE 0
xkb_atom_t
-xkb_atom_intern(struct xkb_ctx *ctx, const char *string);
+xkb_atom_intern(struct xkb_context *ctx, const char *string);
char *
-xkb_atom_strdup(struct xkb_ctx *ctx, xkb_atom_t atom);
+xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom);
const char *
-xkb_atom_text(struct xkb_ctx *ctx, xkb_atom_t atom);
+xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom);
extern unsigned int
xkb_key_get_group(struct xkb_state *state, xkb_keycode_t key);
@@ -483,12 +483,12 @@ xkb_canonicalise_components(struct xkb_component_names *names,
* Geometry will be ignored since xkbcommon does not support it in any way.
*/
struct xkb_keymap *
-xkb_map_new_from_kccgst(struct xkb_ctx *ctx,
+xkb_map_new_from_kccgst(struct xkb_context *ctx,
const struct xkb_component_names *kccgst,
enum xkb_map_compile_flags flags);
extern int
-xkb_ctx_take_file_id(struct xkb_ctx *ctx);
+xkb_context_take_file_id(struct xkb_context *ctx);
extern bool
XkbcComputeEffectiveMap(struct xkb_keymap *keymap, struct xkb_key_type *type,
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 1cd1815..a412d54 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -1085,7 +1085,7 @@ ApplyActionFactoryDefaults(union xkb_action * action)
}
static void
-ActionsInit(struct xkb_ctx *ctx);
+ActionsInit(struct xkb_context *ctx);
int
HandleActionDef(ExprDef * def,
@@ -1249,7 +1249,7 @@ SetActionField(struct xkb_keymap *keymap,
/***====================================================================***/
static void
-ActionsInit(struct xkb_ctx *ctx)
+ActionsInit(struct xkb_context *ctx)
{
if (!actionsInitialized)
{
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 57b8be8..3639017 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -28,7 +28,7 @@
/***====================================================================***/
-typedef bool (*IdentLookupFunc) (struct xkb_ctx *ctx, const void *priv,
+typedef bool (*IdentLookupFunc) (struct xkb_context *ctx, const void *priv,
xkb_atom_t field, unsigned type,
ExprResult *val_rtrn);
@@ -161,7 +161,7 @@ ExprResolveLhs(struct xkb_keymap *keymap, ExprDef *expr,
}
static bool
-SimpleLookup(struct xkb_ctx *ctx, const void *priv,
+SimpleLookup(struct xkb_context *ctx, const void *priv,
xkb_atom_t field, unsigned type, ExprResult *val_rtrn)
{
const LookupEntry *entry;
@@ -197,14 +197,14 @@ static const LookupEntry modIndexNames[] = {
};
bool
-LookupModIndex(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
+LookupModIndex(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
unsigned type, ExprResult *val_rtrn)
{
return SimpleLookup(ctx, modIndexNames, field, type, val_rtrn);
}
bool
-LookupModMask(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
+LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
unsigned type, ExprResult *val_rtrn)
{
const char *str;
@@ -227,7 +227,7 @@ LookupModMask(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
}
int
-ExprResolveBoolean(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveBoolean(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
int ok = 0;
@@ -309,7 +309,7 @@ ExprResolveBoolean(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveFloat(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveFloat(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
int ok = 0;
@@ -404,7 +404,7 @@ ExprResolveFloat(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveKeyCode(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveKeyCode(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
ExprResult leftRtrn, rightRtrn;
@@ -482,7 +482,7 @@ ExprResolveKeyCode(struct xkb_ctx *ctx, ExprDef *expr,
* Cool.
*/
static int
-ExprResolveIntegerLookup(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveIntegerLookup(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn, IdentLookupFunc lookup,
const void *lookupPriv)
{
@@ -590,14 +590,14 @@ ExprResolveIntegerLookup(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveInteger(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveInteger(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
return ExprResolveIntegerLookup(ctx, expr, val_rtrn, NULL, NULL);
}
int
-ExprResolveGroup(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveGroup(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
int ret;
@@ -628,7 +628,7 @@ ExprResolveGroup(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveLevel(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveLevel(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
int ret;
@@ -659,7 +659,7 @@ ExprResolveLevel(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveButton(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveButton(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
static const LookupEntry button_names[] = {
@@ -677,7 +677,7 @@ ExprResolveButton(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveString(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveString(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
ExprResult leftRtrn, rightRtrn;
@@ -762,7 +762,7 @@ ExprResolveString(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveKeyName(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveKeyName(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
const char *bogus = NULL;
@@ -826,7 +826,7 @@ ExprResolveKeyName(struct xkb_ctx *ctx, ExprDef *expr,
/***====================================================================***/
int
-ExprResolveEnum(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveEnum(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn, const LookupEntry *values)
{
if (expr->op != ExprIdent)
@@ -856,7 +856,7 @@ ExprResolveEnum(struct xkb_ctx *ctx, ExprDef *expr,
}
static int
-ExprResolveMaskLookup(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveMaskLookup(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn, IdentLookupFunc lookup,
const void *lookupPriv)
{
@@ -954,14 +954,14 @@ ExprResolveMaskLookup(struct xkb_ctx *ctx, ExprDef *expr,
}
int
-ExprResolveMask(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveMask(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn, const LookupEntry *values)
{
return ExprResolveMaskLookup(ctx, expr, val_rtrn, SimpleLookup, values);
}
int
-ExprResolveModMask(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveModMask(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
return ExprResolveMaskLookup(ctx, expr, val_rtrn, LookupModMask, NULL);
@@ -976,7 +976,7 @@ ExprResolveVModMask(ExprDef *expr, ExprResult *val_rtrn,
}
int
-ExprResolveKeySym(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveKeySym(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn)
{
int ok = 0;
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 29b46e5..e9abf59 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -53,19 +53,19 @@ extern const char *
exprOpText(unsigned type);
extern bool
-LookupModMask(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
+LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
unsigned type, ExprResult *val_rtrn);
extern bool
-LookupVModMask(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
+LookupVModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
unsigned type, ExprResult *val_rtrn);
extern bool
-LookupModIndex(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
+LookupModIndex(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
unsigned type, ExprResult *val_rtrn);
extern int
-ExprResolveModMask(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveModMask(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
@@ -73,51 +73,51 @@ ExprResolveVModMask(ExprDef *expr, ExprResult *val_rtrn,
struct xkb_keymap *keymap);
extern int
-ExprResolveBoolean(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveBoolean(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveKeyCode(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveKeyCode(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveInteger(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveInteger(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveLevel(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveLevel(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveGroup(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveGroup(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveButton(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveButton(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveFloat(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveFloat(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveString(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveString(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveKeyName(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveKeyName(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
extern int
-ExprResolveEnum(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveEnum(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn, const LookupEntry *values);
extern int
-ExprResolveMask(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveMask(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn, const LookupEntry *values);
extern int
-ExprResolveKeySym(struct xkb_ctx *ctx, ExprDef *expr,
+ExprResolveKeySym(struct xkb_context *ctx, ExprDef *expr,
ExprResult *val_rtrn);
#endif /* EXPR_H */
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 4d76a2b..2e9f43b 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -40,7 +40,7 @@
/***====================================================================***/
void
-ClearIndicatorMapInfo(struct xkb_ctx *ctx, LEDInfo * info)
+ClearIndicatorMapInfo(struct xkb_context *ctx, LEDInfo * info)
{
info->name = xkb_atom_intern(ctx, "default");
info->indicator = _LED_NotBound;
diff --git a/src/xkbcomp/indicators.h b/src/xkbcomp/indicators.h
index b0ed415..6f09a0d 100644
--- a/src/xkbcomp/indicators.h
+++ b/src/xkbcomp/indicators.h
@@ -54,7 +54,7 @@ typedef struct _LEDInfo
} LEDInfo;
extern void
-ClearIndicatorMapInfo(struct xkb_ctx *ctx, LEDInfo *info);
+ClearIndicatorMapInfo(struct xkb_context *ctx, LEDInfo *info);
extern LEDInfo *
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 9967f0e..a1f4c60 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -33,7 +33,7 @@
* XkmKeyNamesIdx, etc.)
*/
struct xkb_keymap *
-CompileKeymap(struct xkb_ctx *ctx, XkbFile *file)
+CompileKeymap(struct xkb_context *ctx, XkbFile *file)
{
unsigned have;
bool ok;
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index 8802283..d386d3d 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -44,7 +44,7 @@
* @return true on success or false otherwise.
*/
bool
-ProcessIncludeFile(struct xkb_ctx *ctx,
+ProcessIncludeFile(struct xkb_context *ctx,
IncludeStmt * stmt,
unsigned file_type,
XkbFile ** file_rtrn, unsigned *merge_rtrn)
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index 1065e1c..a80315d 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -682,7 +682,7 @@ EnsureSafeMapName(char *name)
}
XkbFile *
-CreateXKBFile(struct xkb_ctx *ctx, int type, char *name,
+CreateXKBFile(struct xkb_context *ctx, int type, char *name,
ParseCommon *defs, unsigned flags)
{
XkbFile *file;
@@ -696,7 +696,7 @@ CreateXKBFile(struct xkb_ctx *ctx, int type, char *name,
file->topName = uDupString(name);
file->name = name;
file->defs = defs;
- file->id = xkb_ctx_take_file_id(ctx);
+ file->id = xkb_context_take_file_id(ctx);
file->flags = flags;
}
return file;
diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h
index eed6da4..53f24d2 100644
--- a/src/xkbcomp/parseutils.h
+++ b/src/xkbcomp/parseutils.h
@@ -33,7 +33,7 @@
#include "parser.h"
struct parser_param {
- struct xkb_ctx *ctx;
+ struct xkb_context *ctx;
void *scanner;
XkbFile *rtrn;
};
@@ -120,15 +120,15 @@ extern void
CheckDefaultMap(XkbFile *maps, const char *fileName);
extern XkbFile *
-CreateXKBFile(struct xkb_ctx *ctx, int type, char *name,
+CreateXKBFile(struct xkb_context *ctx, int type, char *name,
ParseCommon *defs, unsigned flags);
extern bool
-XKBParseFile(struct xkb_ctx *ctx, FILE *file,
+XKBParseFile(struct xkb_context *ctx, FILE *file,
const char *file_name, XkbFile **out);
extern bool
-XKBParseString(struct xkb_ctx *context, const char *string,
+XKBParseString(struct xkb_context *context, const char *string,
const char *file_name, XkbFile **out);
extern void
diff --git a/src/xkbcomp/path.c b/src/xkbcomp/path.c
index f45ab6b..c213739 100644
--- a/src/xkbcomp/path.c
+++ b/src/xkbcomp/path.c
@@ -179,7 +179,7 @@ XkbDirectoryForInclude(unsigned type)
* pathRtrn is undefined.
*/
FILE *
-XkbFindFileInPath(struct xkb_ctx *ctx,
+XkbFindFileInPath(struct xkb_context *ctx,
const char *name, unsigned type, char **pathRtrn)
{
size_t i;
@@ -189,21 +189,21 @@ XkbFindFileInPath(struct xkb_ctx *ctx,
const char *typeDir;
typeDir = XkbDirectoryForInclude(type);
- for (i = 0; i < xkb_ctx_num_include_paths(ctx); i++)
+ for (i = 0; i < xkb_context_num_include_paths(ctx); i++)
{
ret = snprintf(buf, sizeof(buf), "%s/%s/%s",
- xkb_ctx_include_path_get(ctx, i), typeDir, name);
+ xkb_context_include_path_get(ctx, i), typeDir, name);
if (ret >= (ssize_t)sizeof(buf))
{
ERROR("File name (%s/%s/%s) too long\n",
- xkb_ctx_include_path_get(ctx, i), typeDir, name);
+ xkb_context_include_path_get(ctx, i), typeDir, name);
ACTION("Ignored\n");
continue;
}
file = fopen(buf, "r");
if (file == NULL) {
ERROR("Couldn't open file (%s/%s/%s): %s\n",
- xkb_ctx_include_path_get(ctx, i), typeDir, name,
+ xkb_context_include_path_get(ctx, i), typeDir, name,
strerror(-errno));
ACTION("Ignored\n");
continue;
diff --git a/src/xkbcomp/scanner.l b/src/xkbcomp/scanner.l
index f105c0e..daf233a 100644
--- a/src/xkbcomp/scanner.l
+++ b/src/xkbcomp/scanner.l
@@ -205,7 +205,7 @@ yyerror(struct YYLTYPE *loc, void *scanner, const char *msg)
}
bool
-XKBParseString(struct xkb_ctx *ctx, const char *string,
+XKBParseString(struct xkb_context *ctx, const char *string,
const char *file_name, XkbFile **out)
{
int ret;
@@ -241,7 +241,7 @@ XKBParseString(struct xkb_ctx *ctx, const char *string,
}
bool
-XKBParseFile(struct xkb_ctx *ctx, FILE *file,
+XKBParseFile(struct xkb_context *ctx, FILE *file,
const char *file_name, XkbFile **out)
{
int ret;
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 39ba5f9..c188c2b 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -190,7 +190,7 @@ LookupVModIndex(const struct xkb_keymap *keymap, xkb_atom_t field,
* undefined.
*/
bool
-LookupVModMask(struct xkb_ctx *ctx, const void *priv, xkb_atom_t field,
+LookupVModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
unsigned type, ExprResult *val_rtrn)
{
if (LookupModMask(ctx, NULL, field, type, val_rtrn))
diff --git a/src/xkbcomp/xkbcomp-priv.h b/src/xkbcomp/xkbcomp-priv.h
index bffab47..81fd01e 100644
--- a/src/xkbcomp/xkbcomp-priv.h
+++ b/src/xkbcomp/xkbcomp-priv.h
@@ -64,7 +64,7 @@ extern int
ReportBadField(const char *type, const char *field, const char *name);
extern bool
-ProcessIncludeFile(struct xkb_ctx *ctx,
+ProcessIncludeFile(struct xkb_context *ctx,
IncludeStmt *stmt, unsigned file_type, XkbFile **file_rtrn,
unsigned *merge_rtrn);
@@ -84,7 +84,7 @@ extern const char *
XkbDirectoryForInclude(unsigned type);
extern FILE *
-XkbFindFileInPath(struct xkb_ctx *ctx, const char *name,
+XkbFindFileInPath(struct xkb_context *ctx, const char *name,
unsigned type, char **pathRtrn);
extern bool
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index a18451f..7e8763c 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -34,7 +34,7 @@ unsigned int warningLevel = 0;
#define ISEMPTY(str) (!(str) || (strlen(str) == 0))
static XkbFile *
-XkbKeymapFileFromComponents(struct xkb_ctx *ctx,
+XkbKeymapFileFromComponents(struct xkb_context *ctx,
const struct xkb_component_names *ktcsg)
{
XkbFile *keycodes, *types, *compat, *symbols;
@@ -65,7 +65,7 @@ XkbKeymapFileFromComponents(struct xkb_ctx *ctx,
}
static struct xkb_component_names *
-XkbComponentsFromRules(struct xkb_ctx *ctx,
+XkbComponentsFromRules(struct xkb_context *ctx,
const char *rules,
const XkbRF_VarDefsPtr defs)
{
@@ -79,9 +79,9 @@ XkbComponentsFromRules(struct xkb_ctx *ctx,
if (!rulesFile) {
ERROR("could not find \"%s\" rules in XKB path\n", rules);
ERROR("%d include paths searched:\n",
- xkb_ctx_num_include_paths(ctx));
- for (i = 0; i < xkb_ctx_num_include_paths(ctx); i++)
- ERROR("\t%s\n", xkb_ctx_include_path_get(ctx, i));
+ xkb_context_num_include_paths(ctx));
+ for (i = 0; i < xkb_context_num_include_paths(ctx); i++)
+ ERROR("\t%s\n", xkb_context_include_path_get(ctx, i));
return NULL;
}
@@ -120,7 +120,7 @@ unwind_file:
}
_X_EXPORT struct xkb_keymap *
-xkb_map_new_from_names(struct xkb_ctx *ctx,
+xkb_map_new_from_names(struct xkb_context *ctx,
const struct xkb_rule_names *rmlvo,
enum xkb_map_compile_flags flags)
{
@@ -192,7 +192,7 @@ XkbChooseMap(XkbFile *file, const char *name)
}
static struct xkb_keymap *
-compile_keymap(struct xkb_ctx *ctx, XkbFile *file)
+compile_keymap(struct xkb_context *ctx, XkbFile *file)
{
XkbFile *mapToUse;
struct xkb_keymap *keymap = NULL;
@@ -214,7 +214,7 @@ err:
}
_X_EXPORT struct xkb_keymap *
-xkb_map_new_from_kccgst(struct xkb_ctx *ctx,
+xkb_map_new_from_kccgst(struct xkb_context *ctx,
const struct xkb_component_names *kccgst,
enum xkb_map_compile_flags flags)
{
@@ -254,7 +254,7 @@ xkb_map_new_from_kccgst(struct xkb_ctx *ctx,
}
_X_EXPORT struct xkb_keymap *
-xkb_map_new_from_string(struct xkb_ctx *ctx,
+xkb_map_new_from_string(struct xkb_context *ctx,
const char *string,
enum xkb_keymap_format format,
enum xkb_map_compile_flags flags)
@@ -280,7 +280,7 @@ xkb_map_new_from_string(struct xkb_ctx *ctx,
}
_X_EXPORT struct xkb_keymap *
-xkb_map_new_from_fd(struct xkb_ctx *ctx,
+xkb_map_new_from_fd(struct xkb_context *ctx,
int fd,
enum xkb_keymap_format format,
enum xkb_map_compile_flags flags)
diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h
index a4078a3..e16d96b 100644
--- a/src/xkbcomp/xkbcomp.h
+++ b/src/xkbcomp/xkbcomp.h
@@ -250,7 +250,7 @@ typedef struct _XkbFile
} XkbFile;
extern struct xkb_keymap *
-CompileKeymap(struct xkb_ctx *ctx, XkbFile *file);
+CompileKeymap(struct xkb_context *ctx, XkbFile *file);
extern bool
CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap, unsigned merge);
diff --git a/test/context.c b/test/context.c
index 77060ad..016c5ea 100644
--- a/test/context.c
+++ b/test/context.c
@@ -30,13 +30,13 @@
int
main(void)
{
- struct xkb_ctx *ctx = xkb_ctx_new(0);
+ struct xkb_context *context = xkb_context_new(0);
- assert(ctx);
+ assert(context);
/* FIXME: Test include path stuff. */
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
diff --git a/test/filecomp.c b/test/filecomp.c
index e595ed5..5465b2c 100644
--- a/test/filecomp.c
+++ b/test/filecomp.c
@@ -40,28 +40,28 @@ static int
test_file(const char *path)
{
int fd;
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
fd = open(path, O_RDONLY);
assert(fd >= 0);
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling path: %s\n", path);
- keymap = xkb_map_new_from_fd(ctx, fd, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
+ keymap = xkb_map_new_from_fd(context, fd, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
close(fd);
if (!keymap) {
fprintf(stderr, "Failed to compile keymap\n");
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 1;
}
@@ -78,22 +78,22 @@ test_file_name(const char *file_name)
static int
test_string(const char *string)
{
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling string\n");
- keymap = xkb_map_new_from_string(ctx, string, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
+ keymap = xkb_map_new_from_string(context, string, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
if (!keymap) {
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 1;
}
diff --git a/test/namescomp.c b/test/namescomp.c
index 58a17fc..81ef369 100644
--- a/test/namescomp.c
+++ b/test/namescomp.c
@@ -37,7 +37,7 @@ test_names(const char *keycodes, const char *types,
const char *compat, const char *symbols)
{
int ret = 1;
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
struct xkb_component_names kccgst = {
.keymap = NULL,
@@ -47,21 +47,21 @@ test_names(const char *keycodes, const char *types,
.symbols = strdup(symbols),
};
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s\n", kccgst.keycodes, kccgst.types,
kccgst.compat, kccgst.symbols);
- keymap = xkb_map_new_from_kccgst(ctx, &kccgst, 0);
+ keymap = xkb_map_new_from_kccgst(context, &kccgst, 0);
if (!keymap) {
ret = 0;
- goto err_ctx;
+ goto err_context;
}
xkb_map_unref(keymap);
-err_ctx:
- xkb_ctx_unref(ctx);
+err_context:
+ xkb_context_unref(context);
free(kccgst.keycodes);
free(kccgst.types);
free(kccgst.compat);
diff --git a/test/rulescomp.c b/test/rulescomp.c
index 403ff65..fbf335d 100644
--- a/test/rulescomp.c
+++ b/test/rulescomp.c
@@ -33,7 +33,7 @@ static int
test_rmlvo(const char *rules, const char *model, const char *layout,
const char *variant, const char *options)
{
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
struct xkb_rule_names rmlvo = {
.rules = rules,
@@ -43,20 +43,20 @@ test_rmlvo(const char *rules, const char *model, const char *layout,
.options = options
};
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s %s\n", rmlvo.rules, rmlvo.model,
rmlvo.layout, rmlvo.variant, rmlvo.options);
- keymap = xkb_map_new_from_names(ctx, &rmlvo, 0);
+ keymap = xkb_map_new_from_names(context, &rmlvo, 0);
if (!keymap) {
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 0;
}
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
return 1;
}
diff --git a/test/state.c b/test/state.c
index c16518c..ab1524b 100644
--- a/test/state.c
+++ b/test/state.c
@@ -224,7 +224,7 @@ test_serialisation(struct xkb_keymap *keymap)
int
main(void)
{
- struct xkb_ctx *ctx;
+ struct xkb_context *context;
struct xkb_keymap *keymap;
struct xkb_rule_names rmlvo = {
.rules = "evdev",
@@ -234,15 +234,15 @@ main(void)
.options = NULL,
};
- ctx = xkb_ctx_new(0);
- assert(ctx);
+ context = xkb_context_new(0);
+ assert(context);
- keymap = xkb_map_new_from_names(ctx, &rmlvo, 0);
+ keymap = xkb_map_new_from_names(context, &rmlvo, 0);
assert(keymap);
test_update_key(keymap);
test_serialisation(keymap);
xkb_map_unref(keymap);
- xkb_ctx_unref(ctx);
+ xkb_context_unref(context);
}