XkbAllocClientMap(3)
π NAME π
okay bestie, welcome to XkbAllocClientMap(3) from the XKB FUNCTIONS manual β yes, that manual name is folded right in here so youβre never lost. This page is literally: XkbAllocClientMap β Allocate and initialize an empty client map description record. Thatβs the whole vibe: empty client map description record, allocated and initialized. π
β¨ SYNOPSIS β¨
Status XkbAllocClientMap (XkbDescPtr xkb, unsigned int which, unsigned
int type_count);
π«Ά ARGUMENTS π«Ά
xkbβ keyboard description in which to allocate client mapwhichβ mask selecting map components to allocatetype_countβ value ofnum_typesfield in map to be allocated
π₯ DESCRIPTION π₯
ngl, calling XkbGetMap should be sufficient for most applications to get client and server maps. As a result, most applications do not need to directly allocate client and server maps. π¦
If you change the number of key types or construct map components without loading the necessary components from the X server, do not allocate any map components directly using malloc or Xmalloc. Instead, use the Xkb allocators, XkbAllocClientMap, and XkbAllocServerMap.
Similarly, use the Xkb destructors, XkbFreeClientMap, and XkbFreeServerMap instead of free or Xfree. no cap, thatβs the whole point of the Xkb allocator/destructor squad. π
XkbAllocClientMap allocates and initializes an empty client map in the map field of the keyboard description specified by xkb. The which parameter specifies the particular components of the client map structure to allocate and is a mask composed by a bitwise inclusive OR of one or more of the masks shown in Table 1 XkbAllocClientMap Masks:
XkbKeyTypesMaskβ Thetype_countfield specifies the number of entries to preallocate for thetypesfield of the client map. If thetype_countfield is less thanXkbNumRequiredTypes, it returnsBadValue.XkbKeySymsMaskβ Themin_key_codeandmax_key_codefields of thexkbparameter are used to allocate thesymsandkey_sym_mapfields of the client map. The fields are allocated to contain the maximum number of entries necessary formax_key_code - min_key_code + 1keys.XkbModifierMapMaskβ Themin_key_codeandmax_key_codefields of thexkbparameter are used to allocate themodmapfield of the client map. The field is allocated to contain the maximum number of entries necessary formax_key_code - min_key_code + 1keys.
NOTE: Themin_key_codeandmax_key_codefields of thexkbparameter must be legal values if theXkbKeySymsMaskorXkbModifierMapMaskmasks are set in thewhichparameter. If they are not valid,XkbAllocClientMapreturnsBadValue. π¨
If the client map of the keyboard description is not NULL, and any fields are already allocated in the client map, XkbAllocClientMap does not overwrite the existing values; it simply ignores that part of the request. The only exception is the types array. If type_count is greater than the current num_types field of the client map, XkbAllocClientMap resizes the types array and resets the num_types field accordingly. π
If XkbAllocClientMap is successful, it returns Success. Otherwise, it can return either BadMatch, BadAlloc, or BadValue errors.
π DIAGNOSTICS π
BadAllocβ Unable to allocate storageBadMatchβ A compatible version of Xkb was not available in the server or an argument has correct type and range, but is otherwise invalidBadValueβ An argument is out of range
π SEE ALSO π
go give these icon references a little look too, bestie:
XkbAllocClientMap(3)XkbAllocServerMap(3)XkbFreeClientMap,(3)XkbFreeServerMap(3)XkbGetMap(3)
mwah π cute little sign-off: this page comes from X Version 11, libX11 1.8.14, and the page name is XkbAllocClientMap(3) β thatβs the footer source/version situation, periodt. β¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms