XkbAllocNames(3) XKB FUNCTIONS XkbAllocNames(3)

# [NAME](#NAME)

XkbAllocNames - Allocate symbolic names structures

# [SYNOPSIS](#SYNOPSIS)

**Status XkbAllocNames** **(XkbDescPtr xkb,** **unsigned int which,** **int num\_rg,** **int num\_key\_aliases);**

# [ARGUMENTS](#ARGUMENTS)

[*xkb*](#xkb)

keyboard description for which names are to be allocated

[*which*](#which)

mask of names to be allocated

[*num\_rg*](#num_rg)

total number of radio group names needed

[*num\_key\_aliases*](#num_key_aliases)

total number of key aliases needed

# [DESCRIPTION](#DESCRIPTION)

Most applications do not need to directly allocate symbolic names structures. Do not allocate a names structure directly using *malloc* or *Xmalloc* if your application changes the number of key aliases or radio groups or constructs a symbolic names structure without loading the necessary components from the X server. Instead use *XkbAllocNames.*

*XkbAllocNames* can return BadAlloc, BadMatch, and BadValue errors. The *which* parameter is the bitwise inclusive OR of the valid names mask bits defined in Table 1.

Table 1 Symbolic Names Masks Mask Bit Value Keyboard Field Component XkbKeycodesNameMask (1&lt;&lt;0) Xkb-&gt;names keycodes XkbGeometryNameMask (1&lt;&lt;1) Xkb-&gt;names geometry XkbSymbolsNameMask (1&lt;&lt;2) Xkb-&gt;names symbols XkbPhysSymbolsNameMask (1&lt;&lt;3) Xkb-&gt;names phys\_symbols XkbTypesNameMask (1&lt;&lt;4) Xkb-&gt;names type XkbCompatNameMask (1&lt;&lt;5) Xkb-&gt;names compat XkbKeyTypeNamesMask (1&lt;&lt;6) Xkb-&gt;map type\[\*].name XkbKTLevelNamesMask (1&lt;&lt;7) Xkb-&gt;map type\[\*].lvl\_names\[\*] XkbIndicatorNamesMask (1&lt;&lt;8) Xkb-&gt;names indicators\[\*] XkbKeyNamesMask (1&lt;&lt;9) Xkb-&gt;names keys\[\*], num\_keys XkbKeyAliasesMask (1&lt;&lt;10) Xkb-&gt;names key\_aliases\[\*], num\_key\_aliases XkbVirtualModNamesMask (1&lt;&lt;11) Xkb-&gt;names vmods\[\*] XkbGroupNamesMask (1&lt;&lt;12) Xkb-&gt;names groups\[\*] XkbRGNamesMask (1&lt;&lt;13) Xkb-&gt;names radio\_groups\[\*], num\_rg XkbComponentNamesMask (0x3f) Xkb-&gt;names keycodes, geometry, symbols, physical symbols, types, and compatibility map XkbAllNamesMask (0x3fff) Xkb-&gt;names all name components

Do not free symbolic names structures directly using *free* or *XFree.* Use *XkbFreeNames* instead.

# [DIAGNOSTICS](#DIAGNOSTICS)

[**BadAlloc**](#BadAlloc)

Unable to allocate storage

[**BadMatch**](#BadMatch)

A compatible version of Xkb was not available in the server or an argument has correct type and range, but is otherwise invalid

[**BadValue**](#BadValue)

An argument is out of range

# [SEE ALSO](#SEE_ALSO)

[**XkbFreeNames**(3)](/man/os/libx11/XkbFreeNames.3)

libX11 1.8.14 X Version 11

---

Document: XkbAllocNames(3) from libx11 1.8.14-r3 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libx11.git
