TS_LIBVERSION(3)

πŸ’– TS_LIBVERSION(3) β€” the tslib girlies' guide to peeping your version πŸ’–

okay bestie, so this is a page from the tslib manual, section 3 (that's the library-functions section, iykyk). it's short, it's sweet, it's literally just "how do i find out what version of tslib i'm running" and honestly? iconic behaviour.


✨ NAME ✨

ts_libversion β€” get version information on the currently running tslib 🫢


🌸 SYNOPSIS 🌸

#include <tslib.h>

struct ts_lib_version_data *ts_libversion();

like, that's it. no arguments. she takes nothing and gives you everything πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

ts_libversion() β€” okay so what this does is it returns a pointer to a static copy of the version info struct. static. as in, don't you dare try to free it, she lives there rent-free forever.

and the struct? the struct is giving:

struct ts_lib_version_data {
        const char      *package_version;
        int             version_num;
        unsigned int    features;
};

let's break her down, one field at a time, no cap:

  • package_version β€” just a string with the tarball release number in it. like, for example "1.10". that's the whole vibe. a string. a little release-number string. πŸŽ€
  • version_num β€” this one's the math girlie. it's a 24 bit number built like this: <8 bits major number> | <8 bits minor number> | <8 bits patch number> β€” and all of that is of the library libts. so version 0.7.1? that gets returned as 0x000701. cute right? bit-shifted into one single int. she's efficient. she's compact. she's slaying. ⭐
  • features β€” this is the bitmask, bestie, and it can have one or more bits set. the bits that are currently defined are:
    • TSLIB_VERSION_MT β€” tslib filters support multitouch ts_read_mt() and there is at least one raw access module supporting it (currently evdev input). multitouch era fr fr πŸ”₯
    • TSLIB_VERSION_OPEN_RESTRICTED β€” ts_open_restricted and ts_close_restricted function pointers are available to implement
    • TSLIB_VERSION_EVENTPATH β€” ts_get_eventpath() is available since tslib can auto-detect a device πŸ‘‘
    • TSLIB_VERSION_VERSION β€” simple tslib_version() and ts_print_ascii_logo() are available 🌈
not me noticing the descriptions in the original just kind of... run into each other 😭 that's the source material though, so we're keeping every word of it, exactly as it is. no editing, no guessing, no adding.

πŸ’œ RETURN VALUE πŸ’œ

she returns a pointer to a static copy of the version info struct. that's the answer. that's the whole answer. pointer. static. version info struct. periodt. πŸ’…


πŸŽ€ SEE ALSO πŸŽ€

go read those next, bestie, they're part of the same little family 🫢


and that's the page!! brought to you by the tslib manual, section 3, TS_LIBVERSION(3) β€” mwah, go check your version numbers, you're doing amazing, ily, bye πŸ’–βœ¨