diff options
Diffstat (limited to 'src/xkbcomp/ast-build.c')
-rw-r--r-- | src/xkbcomp/ast-build.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/xkbcomp/ast-build.c b/src/xkbcomp/ast-build.c index bbafaf4..a16c771 100644 --- a/src/xkbcomp/ast-build.c +++ b/src/xkbcomp/ast-build.c @@ -651,6 +651,23 @@ FreeXkbFile(XkbFile *file) } } +static const char *xkb_file_type_strings[_FILE_TYPE_NUM_ENTRIES] = { + [FILE_TYPE_KEYCODES] = "xkb_keycodes", + [FILE_TYPE_TYPES] = "xkb_types", + [FILE_TYPE_COMPAT] = "xkb_compatibility", + [FILE_TYPE_SYMBOLS] = "xkb_symbols", + [FILE_TYPE_KEYMAP] = "xkb_keymap", + [FILE_TYPE_RULES] = "rules", +}; + +const char * +xkb_file_type_to_string(enum xkb_file_type type) +{ + if (type > _FILE_TYPE_NUM_ENTRIES) + return "unknown"; + return xkb_file_type_strings[type]; +} + static const char *stmt_type_strings[_STMT_NUM_VALUES] = { [STMT_UNKNOWN] = "unknown statement", [STMT_INCLUDE] = "include statement", |