src/test/sysdep/linux/input.c
static int check_xinput2(void)
{
    int xinput2_opcode;
    if (!XQueryExtension(linux_x11_display(), "XInputExtension",
                         &xinput2_opcode, (int[1]){0}, (int[1]){0})) {
        return 0;
    }
    __typeof__(XIQueryVersion) *p_XIQueryVersion =
        dlsym(RTLD_NEXT, "XIQueryVersion");
    if (!p_XIQueryVersion) {
        return 0;
    }
    int major = 2;
    int minor = 2;
    if ((*p_XIQueryVersion)(linux_x11_display(), &major, &minor) != Success) {
        return 0;
    }
    if (!(major > 2 || (major == 2 && minor >= 2))) {
        return 0;
    }
    return xinput2_opcode;
}
/**
 * check_xinput2:  Check whether XInput 2.2+ is available.  If so, return
 * the X11 opcode for the extension; otherwise, return zero.
 */
Check whether XInput 2.2+ is available.  If so, return
the X11 opcode for the extension; otherwise, return zero.
Check whether XInput 2 . 2 + is available . If so return the X11 opcode for the extension ; otherwise return zero .
static int check_xinput2(void)
{
    int xinput2_opcode;
    if (!XQueryExtension(linux_x11_display(), "XInputExtension",
                         &xinput2_opcode, (int[1]){0}, (int[1]){0})) {
        return 0;
    }
    __typeof__(XIQueryVersion) *p_XIQueryVersion =
        dlsym(RTLD_NEXT, "XIQueryVersion");
    if (!p_XIQueryVersion) {
        return 0;
    }
    int major = 2;
    int minor = 2;
    if ((*p_XIQueryVersion)(linux_x11_display(), &major, &minor) != Success) {
        return 0;
    }
    if (!(major > 2 || (major == 2 && minor >= 2))) {
        return 0;
    }
    return xinput2_opcode;
}
static int check_xinput2 ( void ) { int xinput2_opcode ; if ( ! XQueryExtension ( linux_x11_display ( ) , " " , & xinput2_opcode , ( int [ 1 ] ) { 0 } , ( int [ 1 ] ) { 0 } ) ) { return 0 ; } __typeof__ ( XIQueryVersion ) * p_XIQueryVersion = dlsym ( RTLD_NEXT , " " ) ; if ( ! p_XIQueryVersion ) { return 0 ; } int major = 2 ; int minor = 2 ; if ( ( * p_XIQueryVersion ) ( linux_x11_display ( ) , & major , & minor ) != Success ) { return 0 ; } if ( ! ( major > 2 || ( major == 2 && minor >= 2 ) ) ) { return 0 ; } return xinput2_opcode ; }
check_xinput2:  Check whether XInput 2.2+ is available.
check_xinput2 : Check whether XInput 2 . 2 + is available .