libxkbcommon 1.13.2 Library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state

Loading...
Searching...
No Matches
Functions
Include Paths

## Functions
XKB_EXPORT int | xkb_context::xkb_context_include_path_append (struct xkb_context *context, const char *path)
XKB_EXPORT int | xkb_context::xkb_context_include_path_append_default (struct xkb_context *context)
XKB_EXPORT int | xkb_context::xkb_context_include_path_reset_defaults (struct xkb_context *context)
XKB_EXPORT void | xkb_context::xkb_context_include_path_clear (struct xkb_context *context)
XKB_EXPORT unsigned int | xkb_context::xkb_context_num_include_paths (struct xkb_context *context)
XKB_EXPORT const char * | xkb_context::xkb_context_include_path_get (struct xkb_context *context, unsigned int index)

## Detailed Description

Manipulating the include paths in a context.

The include paths are the file-system paths that are searched when an include statement is encountered during keymap compilation.

The default include paths are, in that lookup order:

User

  - The path $XDG_CONFIG_HOME/xkb, where $XDG_CONFIG_HOME is the value of the environment variable XDG_CONFIG_HOME, with the usual fallback to $HOME/.config/ if unset.

    See Custom configuration for further information.

  - Deprecated
      The legacy path $HOME/.xkb, where $HOME is the value of the environment variable HOME.

System

  - The XKB_CONFIG_EXTRA_PATH environment variable, if defined, otherwise the system configuration directory, defined at library configuration time (usually /etc/xkb).

    One can adapt the Custom configuration instructions by replacing $XDG_CONFIG_HOME with the system configuration directory in the file locations.

  - Each subdirectory of each XKB extensions directory (versioned, then unversioned if no corresponding versioned subdirectory), listed in lexicographic order. The extensions directories are defined by the environment variables XKB_CONFIG_VERSIONED_EXTENSIONS_PATH and XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH and default to the system XKB root extensions directories, defined at library configuration time (usually /usr/share/xkeyboard-config-<VERSION>.d and /usr/share/xkeyboard-config.d).

    See Packaging keyboard layouts for further information.

  - The XKB_CONFIG_ROOT environment variable, if defined, otherwise the system XKB root, defined at library configuration time (usually /usr/share/xkeyboard-config-<VERSION> or /usr/share/X11/xkb).

    Warning
      Do not modify the system XKB root files, because they will be overwritten by any update of the xkeyboard-config/xkb-data package.
  - Since 1.12.2: if the previous path failed, it fallbacks to the legacy X11 path defined at compilation time (usually /usr/share/X11/xkb). This fallback is skipped is XKB_CONFIG_ROOT is explicitly set to an empty string.

## Function Documentation

## ◆ xkb_context_include_path_append()

XKB_EXPORT int xkb_context_include_path_append | ( | struct xkb_context * | context,
|  | const char * | path )

Append a new entry to the context’s include path.

Returns
  1 on success, or 0 if the include path could not be added or is inaccessible.

## ◆ xkb_context_include_path_append_default()

XKB_EXPORT int xkb_context_include_path_append_default | ( | struct xkb_context * | context | ) |

Append the default include paths to the context’s include path.

Returns
  1 on success, or 0 if no default include path could be added.

## ◆ xkb_context_include_path_reset_defaults()

XKB_EXPORT int xkb_context_include_path_reset_defaults | ( | struct xkb_context * | context | ) |

Reset the context’s include path to the default.

Removes all entries from the context’s include path, and inserts the default paths.

Returns
  1 on success, or 0 if the primary include path could not be added.

## ◆ xkb_context_include_path_get()

XKB_EXPORT const char * xkb_context_include_path_get | ( | struct xkb_context * | context,
|  | unsigned int | index )

Get a specific include path from the context’s include path.

Returns
  The include path at the specified index. If the index is invalid, returns NULL.