XkbLibraryVersion(3)
β¨ XkbLibraryVersion(3) β¨
okay so this is a page from the XKB FUNCTIONS section of the manual (yes, the X11 one, we love a legacy icon π
), and it's literally all about XkbLibraryVersion β the little function that tells you whether the Xkb library you're actually running against is compatible with the one you built against. vibe check for your libraries, basically π«Ά
π NAME π
XkbLibraryVersion β determines the compatibility of a library at runtime. yes bestie, at runtime, that's the whole point π₯
πΈ SYNOPSIS πΈ
Bool XkbLibraryVersion (int *lib_major_in_out, int *lib_minor_in_out);
π ARGUMENTS π
lib_major_in_outβ specifies and returns the major Xkb library version. it goes in, it comes back out β it's giving double duty, honestly iconic β¨lib_minor_in_outβ specifies and returns the minor Xkb library version. same deal, in-and-out energy π«
π¦ DESCRIPTION π¦
okay so here's the situation. if your application is dynamically linked, then both the X server and the client-side X library have to contain the Xkb extension for the client to be able to use the Xkb extension capabilities. both. no exceptions. so a dynamically linked application has to check both the library and the server for compatibility before it goes around calling any Xkb functions. a properly written program must check for compatibility between the version of the Xkb library that's dynamically loaded and the one that was used when the application was built. and then β after that β it must check the server version for compatibility with the version of Xkb in the library. two checks, in that order, that's the assignment π―
if your application is statically linked, you still have to check for server compatibility, and you may check library compatibility too. (it's actually possible to compile against one set of header files and link against a different, incompatible, version of the library β although this should not normally occur. like, it shouldn't happen, but the universe is chaotic π)
β οΈ so anyway β pass the symbolic valueXkbMajorVersioninlib_major_in_outandXkbMinorVersioninlib_minor_in_out. these arguments represent the version of the library used at compile time. thenXkbLibraryVersionbackfills the major and minor version numbers of the library used at run time intolib_major_in_outandlib_minor_in_out. cute, right? π
if the versions of the compile time and run time libraries are compatible, XkbLibraryVersion returns True. otherwise, it returns False. simple as that, no cap π
and ALSO, bestie, listen β in order to use the Xkb extension, you have to make sure the extension is present in the server and that the server supports the version of the extension expected by the client. use XkbQueryExtension to do that, as described in the next section. don't skip this step, it's literally the main character of the next page π
β RETURN VALUES β
TrueβXkbLibraryVersionreturnsTrueif the versions of the compile time and run time libraries are compatible. slay βFalseβXkbLibraryVersionreturnsFalseif the versions of the compile time and run time libraries are not compatible. not slay π
π SEE ALSO π
XkbMajorVersion(3)XkbMinorVersion(3)XkbQueryExtension(3)
go read those next, i'm obsessed with the whole set honestly π§
mwah π that's the whole page! this little legend came from X Version 11, shipping with libX11 1.8.14 β go check compatibility at runtime and stay hydrated, bestie ππ¦
π¦ 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