summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-23 21:27:07 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-23 21:27:07 +0200
commitd3a8bc803cd7c4ce106038bfc4b37cdd6bb8e177 (patch)
tree3b6db0d4869f334d0eb4559c5ae457995cbe913e
parentd934ddc297f6db94dbc548fe01da64350f13577d (diff)
parent47a7628023610904c6ac52e23fa289f75f349b4e (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/corelib/json/qjsonwriter.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbkeyboard.cpp Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
-rwxr-xr-xbin/syncqt.bat44
-rwxr-xr-xbin/syncqt.pl (renamed from bin/syncqt)0
-rw-r--r--config.tests/qpa/xcb-xkb/xcb-xkb.cpp60
-rw-r--r--config.tests/qpa/xcb-xkb/xcb-xkb.pro5
-rwxr-xr-xconfigure359
-rw-r--r--configure.bat2
-rw-r--r--dist/changes-5.0.02
-rw-r--r--dist/changes-5.1.08
-rw-r--r--doc/global/externalsites/external-resources.qdoc18
-rw-r--r--doc/global/externalsites/qch-urls.qdoc4
-rw-r--r--doc/global/externalsites/qt-webpages.qdoc15
-rw-r--r--doc/global/manifest-meta.qdocconf39
-rw-r--r--doc/src/images/appicon_packagecontents.pngbin21266 -> 0 bytes
-rw-r--r--doc/src/images/appicon_screenshot.pngbin150183 -> 0 bytes
-rw-r--r--examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc2
-rw-r--r--examples/network/doc/src/network-download.qdoc2
-rw-r--r--examples/network/doc/src/network-downloadmanager.qdoc2
-rw-r--r--examples/opengl/grabber/mainwindow.cpp2
-rw-r--r--examples/opengl/overpainting/glwidget.cpp6
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.cpp8
-rw-r--r--examples/opengl/paintedwindow/paintedwindow.h1
-rw-r--r--examples/sql/connection.h75
-rw-r--r--examples/sql/doc/images/drilldown-example.pngbin128081 -> 52950 bytes
-rw-r--r--examples/sql/doc/src/drilldown.qdoc117
-rw-r--r--examples/sql/drilldown/drilldown.qrc17
-rw-r--r--examples/sql/drilldown/imageitem.cpp2
-rw-r--r--examples/sql/drilldown/images/beijing.pngbin99093 -> 0 bytes
-rw-r--r--examples/sql/drilldown/images/berlin.pngbin81944 -> 0 bytes
-rw-r--r--examples/sql/drilldown/images/brisbane.pngbin57785 -> 0 bytes
-rw-r--r--examples/sql/drilldown/images/munich.pngbin59769 -> 0 bytes
-rw-r--r--examples/sql/drilldown/images/oslo.pngbin41781 -> 0 bytes
-rw-r--r--examples/sql/drilldown/images/qt-creator.pngbin0 -> 46906 bytes
-rw-r--r--examples/sql/drilldown/images/qt-logo.pngbin0 -> 45652 bytes
-rw-r--r--examples/sql/drilldown/images/qt-project.pngbin0 -> 37795 bytes
-rw-r--r--examples/sql/drilldown/images/qt-quick.pngbin0 -> 43238 bytes
-rw-r--r--examples/sql/drilldown/images/redwood.pngbin39050 -> 0 bytes
-rw-r--r--examples/sql/drilldown/informationwindow.cpp38
-rw-r--r--examples/sql/drilldown/informationwindow.h7
-rw-r--r--examples/sql/drilldown/logo.pngbin13378 -> 0 bytes
-rw-r--r--examples/sql/drilldown/main.cpp2
-rw-r--r--examples/sql/drilldown/view.cpp47
-rw-r--r--examples/sql/drilldown/view.h4
-rw-r--r--examples/tools/doc/src/customtype.qdoc2
-rw-r--r--examples/widgets/doc/images/orientation-landscape-ui.pngbin18077 -> 0 bytes
-rw-r--r--examples/widgets/doc/images/orientation-landscape.pngbin46496 -> 0 bytes
-rw-r--r--examples/widgets/doc/images/orientation-portrait-ui.pngbin9785 -> 0 bytes
-rw-r--r--examples/widgets/doc/images/orientation-portrait.pngbin17377 -> 0 bytes
-rw-r--r--examples/widgets/doc/orientation.qdoc142
-rw-r--r--examples/widgets/doc/src/applicationicon.qdoc52
-rw-r--r--examples/widgets/widgets/applicationicon/applicationicon.pngbin4023 -> 0 bytes
-rw-r--r--examples/widgets/widgets/applicationicon/applicationicon.pro15
-rw-r--r--examples/widgets/widgets/applicationicon/applicationicon.svg22
-rw-r--r--examples/widgets/widgets/applicationicon/main.cpp50
-rw-r--r--examples/widgets/widgets/orientation/image_a.pngbin1075 -> 0 bytes
-rw-r--r--examples/widgets/widgets/orientation/image_b.pngbin1020 -> 0 bytes
-rw-r--r--examples/widgets/widgets/orientation/image_c.pngbin1163 -> 0 bytes
-rw-r--r--examples/widgets/widgets/orientation/images.qrc7
-rw-r--r--examples/widgets/widgets/orientation/landscape.ui114
-rw-r--r--examples/widgets/widgets/orientation/main.cpp55
-rw-r--r--examples/widgets/widgets/orientation/mainwindow.cpp112
-rw-r--r--examples/widgets/widgets/orientation/mainwindow.h75
-rw-r--r--examples/widgets/widgets/orientation/orientation.pro29
-rw-r--r--examples/widgets/widgets/orientation/portrait.ui61
-rw-r--r--examples/widgets/widgets/widgets.pro2
-rw-r--r--examples/xml/doc/src/qxmlstreambookmarks.qdoc2
-rw-r--r--mkspecs/android-g++/qmake.conf4
-rw-r--r--mkspecs/common/ios/clang.conf7
-rw-r--r--mkspecs/common/mac.conf3
-rw-r--r--mkspecs/common/xcode.conf21
-rw-r--r--mkspecs/features/create_cmake.prf2
-rw-r--r--mkspecs/features/ctest_testcase.prf5
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in51
-rw-r--r--mkspecs/features/ios/default_pre.prf6
-rw-r--r--mkspecs/features/java.prf7
-rw-r--r--mkspecs/features/mac/default_post.prf8
-rw-r--r--mkspecs/features/mac/default_pre.prf22
-rw-r--r--mkspecs/features/mac/sdk.prf32
-rw-r--r--mkspecs/features/qt_android_deps.prf5
-rw-r--r--mkspecs/features/qt_config.prf2
-rw-r--r--mkspecs/features/qt_functions.prf10
-rw-r--r--mkspecs/features/qt_installs.prf10
-rw-r--r--mkspecs/features/qt_module.prf9
-rw-r--r--mkspecs/features/qt_module_pris.prf26
-rw-r--r--mkspecs/unsupported/macx-ios-clang/qmake.conf2
-rw-r--r--mkspecs/win32-g++/qmake.conf4
-rw-r--r--mkspecs/win32-msvc2005/qmake.conf6
-rw-r--r--mkspecs/win32-msvc2008/qmake.conf6
-rw-r--r--mkspecs/win32-msvc2010/qmake.conf6
-rw-r--r--mkspecs/win32-msvc2012/qmake.conf7
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp2
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp39
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h12
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp3
-rw-r--r--qmake/library/proitems.cpp2
-rw-r--r--qmake/library/proitems.h1
-rw-r--r--qmake/library/qmakebuiltins.cpp2
-rw-r--r--qmake/library/qmakeevaluator.cpp19
-rw-r--r--qmake/library/qmakeevaluator.h4
-rw-r--r--qmake/library/qmakeparser.cpp8
-rw-r--r--qmake/property.cpp1
-rw-r--r--qtbase.pro9
-rw-r--r--src/3rdparty/sqlite/shell.c97
-rw-r--r--src/3rdparty/sqlite/sqlite3.c3154
-rw-r--r--src/3rdparty/sqlite/sqlite3.h109
-rw-r--r--src/3rdparty/xcb/README1
-rw-r--r--src/3rdparty/xcb/include/xcb/xkb.h14871
-rw-r--r--src/3rdparty/xcb/libxcb/xkb.c22021
-rw-r--r--src/3rdparty/xcb/libxcb/xkb.patch172
-rw-r--r--src/3rdparty/xkbcommon.pri40
-rw-r--r--src/3rdparty/xkbcommon/COPYING188
-rw-r--r--src/3rdparty/xkbcommon/README119
-rw-r--r--src/3rdparty/xkbcommon/src/atom.c248
-rw-r--r--src/3rdparty/xkbcommon/src/atom.h52
-rw-r--r--src/3rdparty/xkbcommon/src/context.c492
-rw-r--r--src/3rdparty/xkbcommon/src/context.h124
-rw-r--r--src/3rdparty/xkbcommon/src/darray.h388
-rw-r--r--src/3rdparty/xkbcommon/src/keymap.h451
-rw-r--r--src/3rdparty/xkbcommon/src/keysym-utf.c971
-rw-r--r--src/3rdparty/xkbcommon/src/keysym.c720
-rw-r--r--src/3rdparty/xkbcommon/src/keysym.h62
-rw-r--r--src/3rdparty/xkbcommon/src/ks_tables.h4681
-rw-r--r--src/3rdparty/xkbcommon/src/state.c1144
-rw-r--r--src/3rdparty/xkbcommon/src/text.c357
-rw-r--r--src/3rdparty/xkbcommon/src/text.h78
-rw-r--r--src/3rdparty/xkbcommon/src/utils.h136
-rw-r--r--src/3rdparty/xkbcommon/src/xkb-compat.c189
-rw-r--r--src/3rdparty/xkbcommon/src/xkb-keymap.c555
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/action.c951
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/action.h53
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/ast-build.c793
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/ast-build.h104
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/ast.h295
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/compat.c1078
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/expr.c685
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/expr.h83
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/include.c289
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/include.h42
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/keycodes.c692
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/keymap-dump.c662
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/keymap.c333
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/parser-priv.h47
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/parser.c3674
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/parser.h230
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/rules.c1231
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/rules.h32
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/scanner.c2861
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/symbols.c1638
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/types.c842
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/vmod.c69
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/vmod.h33
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp-priv.h130
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c171
-rw-r--r--src/3rdparty/xkbcommon/xkbcommon/xkbcommon-compat.h94
-rw-r--r--src/3rdparty/xkbcommon/xkbcommon/xkbcommon-keysyms.h3004
-rw-r--r--src/3rdparty/xkbcommon/xkbcommon/xkbcommon-names.h44
-rw-r--r--src/3rdparty/xkbcommon/xkbcommon/xkbcommon.h1495
-rw-r--r--src/3rdparty/xkbcommon/xkbcommon/xkbcommon_workaround.h (renamed from src/plugins/platforminputcontexts/compose/xkbcommon_workaround.h)0
-rw-r--r--src/android/java/res/values/libs.xml2
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java3
-rw-r--r--src/corelib/Qt5Config.cmake.in2
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in49
-rw-r--r--src/corelib/codecs/qtextcodec.cpp4
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qflags.h15
-rw-r--r--src/corelib/global/qglobal.cpp44
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp1
-rw-r--r--src/corelib/global/qlibraryinfo.h1
-rw-r--r--src/corelib/global/qlogging.h20
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qsysinfo.h2
-rw-r--r--src/corelib/global/qsystemdetection.h8
-rw-r--r--src/corelib/io/qdatastream.cpp7
-rw-r--r--src/corelib/io/qdatastream.h2
-rw-r--r--src/corelib/io/qdebug.h2
-rw-r--r--src/corelib/io/qfile.cpp43
-rw-r--r--src/corelib/io/qfilesystemengine.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_p.h2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp16
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h4
-rw-r--r--src/corelib/io/qprocess.cpp38
-rw-r--r--src/corelib/io/qprocess.h2
-rw-r--r--src/corelib/io/qprocess_p.h44
-rw-r--r--src/corelib/io/qprocess_unix.cpp6
-rw-r--r--src/corelib/io/qprocess_win.cpp22
-rw-r--r--src/corelib/io/qprocess_wince.cpp5
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h2
-rw-r--r--src/corelib/json/qjson.cpp11
-rw-r--r--src/corelib/json/qjson_p.h5
-rw-r--r--src/corelib/json/qjsonarray.cpp24
-rw-r--r--src/corelib/json/qjsondocument.h3
-rw-r--r--src/corelib/json/qjsonobject.cpp16
-rw-r--r--src/corelib/json/qjsonparser.cpp21
-rw-r--r--src/corelib/kernel/qcorecmdlineargs_p.h7
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp1
-rw-r--r--src/corelib/kernel/qobject.cpp10
-rw-r--r--src/corelib/thread/qthreadpool.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp7
-rw-r--r--src/corelib/tools/qhash.cpp25
-rw-r--r--src/corelib/tools/qhash.h1
-rw-r--r--src/corelib/tools/qlocale.cpp13
-rw-r--r--src/corelib/tools/qlocale_p.h3
-rw-r--r--src/corelib/tools/qsharedpointer.cpp2
-rw-r--r--src/corelib/tools/qstring.h8
-rw-r--r--src/dbus/Qt5DBusConfigExtras.cmake.in18
-rw-r--r--src/dbus/dbus.pro4
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp2
-rw-r--r--src/dbus/qdbusunixfiledescriptor.h2
-rw-r--r--src/gui/Qt5GuiConfigExtras.cmake.in33
-rw-r--r--src/gui/doc/qtgui.qdocconf3
-rw-r--r--src/gui/gui.pro8
-rw-r--r--src/gui/image/qpixmap.cpp15
-rw-r--r--src/gui/kernel/qguiapplication.cpp13
-rw-r--r--src/gui/kernel/qguiapplication_p.h1
-rw-r--r--src/gui/kernel/qkeysequence.cpp32
-rw-r--r--src/gui/kernel/qpalette.cpp4
-rw-r--r--src/gui/kernel/qplatformwindow.cpp3
-rw-r--r--src/gui/kernel/qwindow.cpp43
-rw-r--r--src/gui/kernel/qwindow.h1
-rw-r--r--src/gui/kernel/qwindow_p.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp7
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h1
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h13
-rw-r--r--src/gui/opengl/qopenglfunctions_1_0.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_1_1.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_1_2.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_1_3.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_1_4.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_1_5.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_2_0.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_2_1.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_3_0.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_3_1.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_core.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_core.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_core.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_core.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_core.cpp1
-rw-r--r--src/gui/opengl/qopenglfunctions_es2.cpp1
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp10
-rw-r--r--src/gui/painting/qdrawhelper.cpp1
-rw-r--r--src/gui/painting/qpaintengine.cpp2
-rw-r--r--src/gui/painting/qpaintengine.h3
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp3
-rw-r--r--src/gui/painting/qpainter.cpp17
-rw-r--r--src/gui/painting/qrgb.h18
-rw-r--r--src/gui/text/qfont.h1
-rw-r--r--src/gui/text/qfontengine_p.h2
-rw-r--r--src/gui/text/qfontmetrics.cpp19
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp15
-rw-r--r--src/gui/text/qtextlayout.h1
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp4
-rw-r--r--src/network/kernel/qnetworkinterface.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp6
-rw-r--r--src/network/ssl/qsslsocket_p.h4
-rw-r--r--src/network/ssl/ssl.pri6
-rw-r--r--src/opengl/doc/qtopengl.qdocconf2
-rw-r--r--src/opengl/qgl.cpp7
-rw-r--r--src/opengl/qgl_p.h4
-rw-r--r--src/opengl/qgl_qpa.cpp9
-rw-r--r--src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp1
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.pri2
-rw-r--r--src/platformsupport/devicediscovery/devicediscovery.pri2
-rw-r--r--src/platformsupport/dnd/qsimpledrag.cpp8
-rw-r--r--src/platformsupport/dnd/qsimpledrag_p.h2
-rw-r--r--src/platformsupport/fbconvenience/qfbbackingstore.cpp5
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen.cpp13
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen_p.h4
-rw-r--r--src/platformsupport/fontdatabases/basic/basic.pri1
-rw-r--r--src/platformsupport/fontdatabases/mac/coretext.pri4
-rw-r--r--src/platformsupport/glxconvenience/glxconvenience.pri2
-rw-r--r--src/platformsupport/input/evdevkeyboard/evdevkeyboard.pri2
-rw-r--r--src/platformsupport/input/evdevmouse/evdevmouse.pri2
-rw-r--r--src/platformsupport/input/evdevtablet/evdevtablet.pri2
-rw-r--r--src/platformsupport/input/evdevtouch/evdevtouch.pri2
-rw-r--r--src/platformsupport/jniconvenience/jniconvenience.pri2
-rw-r--r--src/platformsupport/linuxaccessibility/linuxaccessibility.pri2
-rw-r--r--src/platformsupport/platformsupport.pro6
-rw-r--r--src/plugins/platforminputcontexts/compose/compose.pro13
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp7
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro2
-rw-r--r--src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp7
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm16
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm12
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm10
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm53
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h2
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm32
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.h2
-rw-r--r--src/plugins/platforms/eglfs/eglfs.pri2
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp4
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_x11.cpp160
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp4
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.cpp8
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm3
-rw-r--r--src/plugins/platforms/ios/qioswindow.h7
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm103
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp9
-rw-r--r--src/plugins/platforms/qnx/qnx.pro2
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.cpp21
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.cpp30
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp19
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp12
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorpps.cpp3
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.cpp60
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp10
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp53
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp15
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp81
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp24
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp41
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp164
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h26
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp115
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h7
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp24
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp32
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp909
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h89
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h5
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.cpp280
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.h71
-rw-r--r--src/plugins/platforms/xcb/xcb-plugin.pro25
-rw-r--r--src/plugins/platforms/xcb/xcb-static/xcb-static.pro3
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.cpp3
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp11
-rw-r--r--src/printsupport/doc/qtprintsupport.qdocconf6
-rw-r--r--src/printsupport/doc/snippets/widgetprinting.cpp36
-rw-r--r--src/printsupport/doc/src/qtprintsupport-index.qdoc6
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.cpp2
-rw-r--r--src/sql/doc/src/qsqldatatype-table.qdoc2
-rw-r--r--src/sql/doc/src/sql-driver.qdoc2
-rw-r--r--src/sql/doc/src/sql-programming.qdoc6
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.pri9
-rw-r--r--src/testlib/qtestcase.cpp10
-rw-r--r--src/testlib/qtestlog.cpp10
-rw-r--r--src/tools/moc/generator.cpp4
-rw-r--r--src/tools/moc/moc.cpp5
-rw-r--r--src/tools/moc/parser.cpp4
-rw-r--r--src/tools/qdoc/codeparser.cpp7
-rw-r--r--src/tools/qdoc/config.cpp2
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp18
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp13
-rw-r--r--src/tools/qdoc/doc/config/qdoc.qdocconf3
-rw-r--r--src/tools/qdoc/generator.cpp2
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp1
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp17
-rw-r--r--src/tools/qdoc/node.cpp12
-rw-r--r--src/tools/qdoc/node.h11
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp19
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp5
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp4
-rw-r--r--src/tools/qdoc/text.cpp5
-rw-r--r--src/widgets/Qt5WidgetsConfigExtras.cmake.in9
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp22
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp1
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp9
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp2
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp44
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp44
-rw-r--r--src/widgets/kernel/qapplication.cpp3
-rw-r--r--src/widgets/kernel/qformlayout.cpp4
-rw-r--r--src/widgets/kernel/qformlayout.h2
-rw-r--r--src/widgets/kernel/qlayout.cpp10
-rw-r--r--src/widgets/kernel/qshortcut.cpp10
-rw-r--r--src/widgets/kernel/qstandardgestures.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp16
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp14
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp10
-rw-r--r--src/widgets/styles/qfusionstyle_p_p.h6
-rw-r--r--src/widgets/styles/qgtkstyle_p.cpp4
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm28
-rw-r--r--src/widgets/styles/qstyleoption.cpp2
-rw-r--r--src/widgets/util/qcolormap.h4
-rw-r--r--src/widgets/widgets/qdockwidget.cpp14
-rw-r--r--src/widgets/widgets/qfontcombobox.h1
-rw-r--r--src/widgets/widgets/qmenu.cpp1
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp4
-rw-r--r--tests/auto/cmake/CMakeLists.txt2
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp11
-rw-r--r--tests/auto/corelib/global/qflags/tst_qflags.cpp116
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp3
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp34
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp77
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp25
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp53
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp20
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp22
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp1
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp8
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp4
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp46
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp10
-rw-r--r--tests/auto/widgets/dialogs/dialogs.pro2
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp28
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp47
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp131
-rw-r--r--tests/auto/widgets/itemviews/qtableview/qtableview.pro1
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp12
-rw-r--r--tests/auto/widgets/widgets/qstackedwidget/qstackedwidget.pro1
-rw-r--r--tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp3
-rw-r--r--tests/manual/manual.pro3
-rw-r--r--tests/manual/qtexteditlist/main.cpp52
-rw-r--r--tests/manual/qtexteditlist/qtexteditlist.pro8
-rw-r--r--tests/manual/qtexteditlist/widget.cpp129
-rw-r--r--tests/manual/qtexteditlist/widget.h67
-rw-r--r--tests/manual/qtexteditlist/widget.ui61
-rw-r--r--tests/manual/widgets/itemviews/itemviews.pro2
-rw-r--r--tests/manual/widgets/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/manual/widgets/widgets.pro2
-rw-r--r--tools/configure/configureapp.cpp178
-rw-r--r--tools/configure/configureapp.h13
-rw-r--r--tools/configure/main.cpp19
440 files changed, 77219 insertions, 3153 deletions
diff --git a/bin/syncqt.bat b/bin/syncqt.bat
deleted file mode 100755
index 99ada5baa7..0000000000
--- a/bin/syncqt.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::
-:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-:: Contact: http://www.qt-project.org/legal
-::
-:: This file is part of the tools applications of the Qt Toolkit.
-::
-:: $QT_BEGIN_LICENSE:LGPL$
-:: Commercial License Usage
-:: Licensees holding valid commercial Qt licenses may use this file in
-:: accordance with the commercial license agreement provided with the
-:: Software or, alternatively, in accordance with the terms contained in
-:: a written agreement between you and Digia. For licensing terms and
-:: conditions see http://qt.digia.com/licensing. For further information
-:: use the contact form at http://qt.digia.com/contact-us.
-::
-:: GNU Lesser General Public License Usage
-:: Alternatively, this file may be used under the terms of the GNU Lesser
-:: General Public License version 2.1 as published by the Free Software
-:: Foundation and appearing in the file LICENSE.LGPL included in the
-:: packaging of this file. Please review the following information to
-:: ensure the GNU Lesser General Public License version 2.1 requirements
-:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-::
-:: In addition, as a special exception, Digia gives you certain additional
-:: rights. These rights are described in the Digia Qt LGPL Exception
-:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-::
-:: GNU General Public License Usage
-:: Alternatively, this file may be used under the terms of the GNU
-:: General Public License version 3.0 as published by the Free Software
-:: Foundation and appearing in the file LICENSE.GPL included in the
-:: packaging of this file. Please review the following information to
-:: ensure the GNU General Public License version 3.0 requirements will be
-:: met: http://www.gnu.org/copyleft/gpl.html.
-::
-::
-:: $QT_END_LICENSE$
-::
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-@echo off
-rem ***** This assumes PERL is in the PATH *****
-set scriptpath=%~dp0
-perl.exe %scriptpath%syncqt %*
diff --git a/bin/syncqt b/bin/syncqt.pl
index ce07af4895..ce07af4895 100755
--- a/bin/syncqt
+++ b/bin/syncqt.pl
diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp b/config.tests/qpa/xcb-xkb/xcb-xkb.cpp
new file mode 100644
index 0000000000..524cfde71f
--- /dev/null
+++ b/config.tests/qpa/xcb-xkb/xcb-xkb.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <xcb/xcb.h>
+
+// This is needed to make Qt compile together with XKB. xkb.h is using a variable
+// which is called 'explicit', this is a reserved keyword in c++ */
+#define explicit dont_use_cxx_explicit
+#include <xcb/xkb.h>
+#undef explicit
+
+int main(int, char **)
+{
+ int primaryScreen = 0;
+
+ xcb_connection_t *connection = xcb_connect("", &primaryScreen);
+
+ // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY.
+ int xcbAtomPrimary = XCB_ATOM_PRIMARY;
+
+ return 0;
+}
diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.pro b/config.tests/qpa/xcb-xkb/xcb-xkb.pro
new file mode 100644
index 0000000000..a684a869d3
--- /dev/null
+++ b/config.tests/qpa/xcb-xkb/xcb-xkb.pro
@@ -0,0 +1,5 @@
+SOURCES = xcb-xkb.cpp
+CONFIG -= qt
+
+LIBS += -lxcb -lxcb-xkb
+
diff --git a/configure b/configure
index e6b92f1610..ba5567575d 100755
--- a/configure
+++ b/configure
@@ -446,6 +446,8 @@ if [ "$OSTYPE" = "msys" ]; then
BUILD_ON_MSYS=yes
DEV_NULL=/tmp/empty-file
echo "" > $DEV_NULL
+ relpath=`(cd "$relpath"; pwd -W)`
+ outpath=`pwd -W`
fi
#-------------------------------------------------------------------------------
@@ -901,7 +903,7 @@ CFG_USE_GNUMAKE=no
CFG_XINPUT2=auto
CFG_XINPUT=runtime
CFG_XKB=auto
-CFG_XKBCOMMON=no
+CFG_XKBCOMMON=auto
CFG_XCB=auto
CFG_XCB_GLX=no
CFG_EGLFS=auto
@@ -1001,6 +1003,7 @@ CFG_SYSROOT=
CFG_GCC_SYSROOT="yes"
QT_HOST_PREFIX=
QT_HOST_BINS=
+QT_HOST_LIBS=
QT_HOST_DATA=
#flags for SQL drivers
@@ -1109,7 +1112,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#Qt style options that pass an argument
- -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version)
+ -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-hostlibdir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
@@ -1294,6 +1297,9 @@ while [ "$#" -gt 0 ]; do
hostbindir)
QT_HOST_BINS="$VAL"
;;
+ hostlibdir)
+ QT_HOST_LIBS="$VAL"
+ ;;
pkg-config)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PKGCONFIG="$VAL"
@@ -1409,7 +1415,7 @@ while [ "$#" -gt 0 ]; do
OPT_OBSOLETE_HOST_ARG=yes
;;
harfbuzz)
- if [ "$BUILD_ON_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
+ if ([ "$BUILD_ON_MAC" = "yes" ] && [ "$VAL" = "yes" ]) || [ "$VAL" = "no" ]; then
CFG_MAC_HARFBUZZ="$VAL"
else
UNKNOWN_OPT=yes
@@ -1839,6 +1845,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ xkbcommon)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "qt" ] || [ "$VAL" = "system" ]; then
+ CFG_XKBCOMMON="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
xcb)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ] || [ "$VAL" = "qt" ]; then
CFG_XCB="$VAL"
@@ -2360,6 +2373,11 @@ if [ "$PLATFORM_MAC" = "no" -a "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo
fi
+if [ "$CFG_XCB" != "no" ] && [ "$CFG_XKBCOMMON" = "no" ]; then
+ echo "Error: -no-xkbcommon is not supported on XCB platform plugin."
+ exit 101
+fi
+
if [ "$CFG_SILENT" = "yes" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG silent"
fi
@@ -2378,26 +2396,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
- # make a syncqt script that can be used in the shadow
- rm -f "$outpath/bin/syncqt"
- if [ -x "$relpath/bin/syncqt" ]; then
- mkdir -p "$outpath/bin"
- echo "#!/bin/sh" >"$outpath/bin/syncqt"
- echo "perl \"$relpath/bin/syncqt\" \"\$@\"" >>"$outpath/bin/syncqt"
- chmod 755 "$outpath/bin/syncqt"
- fi
-
- for i in elf2e32_qtwrapper createpackage patch_capabilities qtmodule-configtests; do
- rm -f "$outpath/bin/$i"
- if [ -x "$relpath/bin/$i" ]; then
- mkdir -p "$outpath/bin"
- echo "#!/bin/sh" >"$outpath/bin/$i"
- echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/$i"
- echo "\"$relpath/bin/$i\" \"\$@\"" >>"$outpath/bin/$i"
- chmod 755 "$outpath/bin/$i"
- fi
- done
-
# save a pre-existing mkspecs/modules dir
test -d "$outpath/mkspecs/modules" && \
mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules"
@@ -2485,7 +2483,10 @@ if [ -z "$PLATFORM" ]; then
# about the OS version, since we're not using the clang version that comes
# with the system. We use 'xcrun' to check the clang version that's part of
# the Xcode installation.
- if [ "$(/usr/bin/xcrun -sdk macosx clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p')" -ge 3 ]; then
+ XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`
+ CLANGVERSION=`echo "$XCRUN" | sed -n 's/.*version \([0-9]\).*/\1/p'`
+ expr "$CLANGVERSION" : '[0-9]' > /dev/null || { echo "Unable to determine CLANG version from output of xcrun: $XCRUN" ; exit 2 ; }
+ if [ "$CLANGVERSION" -ge 3 ]; then
PLATFORM=macx-clang
# Advertise g++ as an alternative on Lion and below
@@ -2713,10 +2714,6 @@ if [ "$XPLATFORM_ANDROID" = "yes" ]; then
QT_QPA_DEFAULT_PLATFORM="android"
CFG_LARGEFILE="no"
- # FIXME: Qt Creator requires this to be in the lib/ directory of Qt. This line can be removed
- # once it's fixed to get the file directly from the NDK.
- cp -f $CFG_DEFAULT_ANDROID_NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION/libs/$CFG_DEFAULT_ANDROID_TARGET_ARCH/libgnustl_shared.so $outpath/lib
-
DeviceVar set DEFAULT_ANDROID_SDK_ROOT "$CFG_DEFAULT_ANDROID_SDK_ROOT"
DeviceVar set DEFAULT_ANDROID_NDK_ROOT "$CFG_DEFAULT_ANDROID_NDK_ROOT"
DeviceVar set DEFAULT_ANDROID_PLATFORM "$CFG_DEFAULT_ANDROID_PLATFORM"
@@ -3138,6 +3135,15 @@ if [ -z "$QT_HOST_BINS" ]; then #default
fi
QT_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_BINS"`
+if [ -z "$QT_HOST_LIBS" ]; then #default
+ if $haveHpx; then
+ QT_HOST_LIBS="$QT_HOST_PREFIX/lib" #fallback
+ else
+ QT_HOST_LIBS="$QT_INSTALL_LIBS"
+ fi
+fi
+QT_HOST_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_LIBS"`
+
if [ -z "$QT_HOST_DATA" ]; then #default
if $haveHpx; then
QT_HOST_DATA="$QT_HOST_PREFIX"
@@ -3311,6 +3317,8 @@ Installation options:
-hostbindir <dir> .. Host executables will be installed to <dir>
(default HOSTPREFIX/bin)
+ -hostlibdir <dir> .. Host libraries will be installed to <dir>
+ (default HOSTPREFIX/lib)
-hostdatadir <dir> . Data used by qmake will be installed to <dir>
(default HOSTPREFIX)
@@ -3436,6 +3444,9 @@ Third Party Libraries:
(libxcb.so will still be used from operating system).
+ -system-xcb ........ Use xcb- libraries from the operating system.
+ -qt-xkbcommon ...... Use the xkbcommon library bundled with Qt.
+ + -system-xkbcommon .. Use the xkbcommon library from the operating system.
+
Additional options:
-make <part> ....... Add part to the list of parts to be built at make time.
@@ -3822,6 +3833,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
"qt_ssrtpath=$CFG_SYSROOT",
"qt_hpfxpath=$QT_HOST_PREFIX",
"qt_hbinpath=$QT_HOST_BINS",
+ "qt_hlibpath=$QT_HOST_LIBS",
"qt_hdatpath=$QT_HOST_DATA",
"qt_targspec=$shortxspec",
"qt_hostspec=$shortspec",
@@ -3870,8 +3882,8 @@ fi
# -----------------------------------------------------------------------------
# symlink includes
-if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
- "$outpath/bin/syncqt" -minimal -module QtCore "$relpath" || exit 1
+if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt.pl" ]; then
+ "$relpath/bin/syncqt.pl" -minimal -module QtCore "$relpath" || exit 1
fi
# $1: input variable name (awk regexp)
@@ -5154,6 +5166,16 @@ if [ "$CFG_XCB" != "no" ]; then
XCB_PACKAGES="xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm"
QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags $XCB_PACKAGES 2>/dev/null`"
QMAKE_LIBS_XCB="`$PKG_CONFIG --libs $XCB_PACKAGES 2>/dev/null`"
+ # for xcb-xkb tests
+ QMAKE_CFLAGS_XKB="`$PKG_CONFIG --cflags xcb xcb-xkb 2>/dev/null`"
+ QMAKE_LIBS_XKB="`$PKG_CONFIG --libs xcb xcb-xkb 2>/dev/null`"
+ fi
+
+ if compileTest qpa/xcb-xkb "xcb-xkb" $QMAKE_CFLAGS_XKB $QMAKE_LIBS_XKB; then
+ CFG_XKB=yes
+ else
+ CFG_XKB=no
+ QMakeVar add DEFINES QT_NO_XKB
fi
if compileTest qpa/xcb-syslibs "xcb-syslibs" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
@@ -5167,7 +5189,7 @@ if [ "$CFG_XCB" != "no" ]; then
fi
else
echo "The test for linking against libxcb and support libraries failed!"
- echo " You might need install dependency packages, or pass -qt-xcb."
+ echo " You might need to install dependency packages, or pass -qt-xcb."
echo " See src/plugins/platforms/xcb/README."
exit 1
fi
@@ -5257,18 +5279,34 @@ if [ "$CFG_KMS" != "no" ]; then
fi
# Detect libxkbcommon
-if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= 0.2.0" 2>/dev/null; then
- QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
- QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
- QT_CONFIG="$QT_CONFIG xkbcommon"
- CFG_XKBCOMMON=yes
-elif [ "$CFG_XCB" != "no" ]; then
- QMakeVar add DEFINES QT_NO_XKBCOMMON
+ORIG_CFG_XKBCOMMON="$CFG_XKBCOMMON"
+if [ "$CFG_XKBCOMMON" != "qt" ]; then
+ # currently only xcb platform plugin requires xkbcommon, for other platforms it can be set to 'no'
+ if [ "$CFG_XKBCOMMON" != "no" ]; then
+ if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= 0.2.0" 2>/dev/null; then
+ QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
+ QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
+ QMAKE_VERSION_XKBCOMMON="`$PKG_CONFIG --modversion xkbcommon 2>/dev/null`"
+
+ QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON"
+ QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON"
+ QMakeVar set QMAKE_VERSION_XKBCOMMON "$QMAKE_VERSION_XKBCOMMON"
+ CFG_XKBCOMMON=yes
+ else
+ CFG_XKBCOMMON=no
+ fi
+
+ if [ "$CFG_XCB" != "no" ] && [ "$CFG_XKBCOMMON" = "no" ]; then
+ # use the bundled version instead
+ CFG_XKBCOMMON=qt
+ fi
+ fi
fi
-if [ "$CFG_XKBCOMMON" != "no" ]; then
- QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON"
- QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON"
+if [ "$CFG_XKBCOMMON" = "qt" ]; then
+ QT_CONFIG="$QT_CONFIG xkbcommon-qt"
+elif [ "$CFG_XKBCOMMON" = "no" ]; then
+ QMakeVar add DEFINES QT_NO_XKBCOMMON
fi
# EGL Support
@@ -6575,6 +6613,50 @@ fi
#-------------------------------------------------------------------------------
exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
+report_support()
+{
+ case "$#,$2" in
+ 2,auto)
+ # 2 arguments and the result is "auto", so just say "yes"
+ # this is usually an error in the configure script, but oh well..
+ echo "$1 yes"
+ return
+ ;;
+ [012],* | *,no*)
+ # 0, 1 or 2 arguments, or anything starting with "no"
+ # print just the first part of the argument (before the dash)
+ echo "$1 ${2%%-*}"
+ return
+ :;
+ esac
+ local heading
+ heading=$1
+ shift
+
+ local value
+ value=$1
+ shift
+
+ while [ $# -gt 0 ]; do
+ if [ "$value" = "$1" ]; then
+ echo "$heading yes ($2)"
+ return
+ fi
+ shift
+ shift
+ done
+ echo "$heading $value"
+}
+
+report_support_plugin()
+{
+ report_support "$1" "$2-$3" \
+ yes-qt "in $4, using bundled copy" \
+ yes-system "in $4, using system library" \
+ plugin-qt "plugin, using bundled copy" \
+ plugin-system "plugin, using system library"
+}
+
echo
echo " Configure summary"
echo
@@ -6632,135 +6714,89 @@ fi
# Qt modules
echo
echo "Qt modules and options:"
-[ "$CFG_DBUS" = "no" ] && echo " Qt D-Bus ............... no"
-[ "$CFG_DBUS" = "yes" ] && echo " Qt D-Bus ............... yes (loading dbus-1 at runtime)"
-[ "$CFG_DBUS" = "linked" ] && echo " Qt D-Bus ............... yes (linked to dbus-1)"
-echo " Qt Concurrent .......... $CFG_CONCURRENT"
-echo " Qt GUI ................. $CFG_GUI"
-echo " Qt Widgets ............. $CFG_WIDGETS"
-if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
- echo " JavaScriptCore JIT ..... To be decided by JavaScriptCore"
-else
- echo " JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
-fi
-echo " QML debugging .......... $CFG_QML_DEBUG"
-echo " Use system proxies ..... $CFG_SYSTEM_PROXIES"
+report_support " Qt D-Bus ..............." "$CFG_DBUS" yes "loading dbus-1 at runtime" linked "linked to dbus-1"
+report_support " Qt Concurrent .........." "$CFG_CONCURRENT"
+report_support " Qt GUI ................." "$CFG_GUI"
+report_support " Qt Widgets ............." "$CFG_WIDGETS"
+report_support " JavaScriptCore JIT ....." "$CFG_JAVASCRIPTCORE_JIT" auto "To be decided by JavaScriptCore"
+report_support " QML debugging .........." "$CFG_QML_DEBUG"
+report_support " Use system proxies ....." "$CFG_SYSTEM_PROXIES"
# Other things
# Please keep sorted and properly grouped! The output is quite long, so it's
# hard to find something you're searching for if it's not sorted.
echo
echo "Support enabled for:"
-echo " Accessibility .......... $CFG_ACCESSIBILITY"
-echo " ALSA ................... $CFG_ALSA"
-echo " CUPS ................... $CFG_CUPS"
+report_support " Accessibility .........." "$CFG_ACCESSIBILITY"
+report_support " ALSA ..................." "$CFG_ALSA"
+report_support " CUPS ..................." "$CFG_CUPS"
[ "$XPLATFORM_MINGW" = "yes" ] && \
- echo " DirectWrite ............ $CFG_DIRECTWRITE"
-echo " FontConfig ............. $CFG_FONTCONFIG"
-echo " Iconv .................. $CFG_ICONV"
-echo " ICU .................... $CFG_ICU"
-echo " Image formats:"
-echo " GIF .................. $CFG_GIF"
-if [ "$CFG_JPEG" = "no" ]; then
- echo " JPEG ................. $CFG_JPEG"
-else
- echo " JPEG ................. $CFG_JPEG ($CFG_LIBJPEG)"
-fi
-if [ "$CFG_PNG" = "no" ]; then
- echo " PNG .................. $CFG_PNG"
-else
- echo " PNG .................. $CFG_PNG ($CFG_LIBPNG)"
-fi
-echo " Glib ................... $CFG_GLIB"
-echo " GStreamer .............. $CFG_GSTREAMER"
-echo " GTK theme .............. $CFG_QGTKSTYLE"
-echo " Large Files ............ $CFG_LARGEFILE"
-echo " Networking:"
+ report_support " DirectWrite ............" "$CFG_DIRECTWRITE"
+report_support " FontConfig ............." "$CFG_FONTCONFIG"
+report_support " Iconv .................." "$CFG_ICONV"
+report_support " ICU ...................." "$CFG_ICU"
+report_support " Image formats:"
+report_support_plugin " GIF .................." "$CFG_GIF" system QtGui
+report_support_plugin " JPEG ................." "$CFG_JPEG" "$CFG_LIBJPEG" QtGui
+report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGui
+report_support " Glib ..................." "$CFG_GLIB"
+report_support " GStreamer .............." "$CFG_GSTREAMER"
+report_support " GTK theme .............." "$CFG_QGTKSTYLE"
+report_support " Large File ............." "$CFG_LARGEFILE"
+report_support " libudev ................" "$CFG_LIBUDEV"
+report_support " Networking:"
[ "$BUILD_ON_MAC" = "yes" ] && \
- echo " CoreWlan ............. $CFG_COREWLAN"
-echo " getaddrinfo .......... $CFG_GETADDRINFO"
-echo " getifaddrs ........... $CFG_GETIFADDRS"
-echo " IPv6 ifname .......... $CFG_IPV6IFNAME"
-OPENSSL_LINKAGE=""
-if [ "$CFG_OPENSSL" = "yes" ]; then
- OPENSSL_LINKAGE="(loading libraries at run-time)"
-elif [ "$CFG_OPENSSL" = "linked" ]; then
- OPENSSL_LINKAGE="(linked to the libraries)"
-fi
-echo " OpenSSL .............. $CFG_OPENSSL $OPENSSL_LINKAGE"
-unset OPENSSL_LINKAGE
-echo " NIS .................... $CFG_NIS"
-if [ "$CFG_OPENGL" = "desktop" ]; then
- echo " OpenGL ................. yes (Desktop OpenGL)"
-elif [ "$CFG_OPENGL" = "es2" ]; then
- echo " OpenGL ................. yes (OpenGL ES 2.x)"
-else
- echo " OpenGL ................. no"
-fi
-if [ "$CFG_OPENVG" ]; then
- if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
- echo " OpenVG ................. ShivaVG"
- else
- echo " OpenVG ................. $CFG_OPENVG"
- fi
-fi
-if [ "$CFG_PCRE" = "no" ]; then
- echo " PCRE ................... no"
-else
- pcre_sys=system
- [ "$CFG_PCRE" = "qt" ] && pcre_sys=qt
- echo " PCRE ................... yes ($pcre_sys)"
- unset pcre_sys
-fi
+ report_support " CoreWlan ............." "$CFG_COREWLAN"
+report_support " getaddrinfo .........." "$CFG_GETADDRINFO"
+report_support " getifaddrs ..........." "$CFG_GETIFADDRS"
+report_support " IPv6 ifname .........." "$CFG_IPV6IFNAME"
+report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading libraries at run-time" linked "linked to the libraries"
+report_support " NIS ...................." "$CFG_NIS"
+report_support " OpenGL ................." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.x"
+report_support " OpenVG ................." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
+report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
if [ -n "$PKG_CONFIG" ]; then
- echo " pkg-config ............. yes"
+ report_support " pkg-config ............. yes"
else
- echo " pkg-config ............. no"
-fi
-echo " PulseAudio ............. $CFG_PULSEAUDIO"
-echo " QPA backends:"
-echo " DirectFB ............. $CFG_DIRECTFB"
-echo " EGLFS ................ $CFG_EGLFS"
-echo " KMS .................. $CFG_KMS"
-echo " LinuxFB .............. $CFG_LINUXFB"
-echo " XCB .................. $CFG_XCB"
+ report_support " pkg-config ............. no"
+fi
+report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
+report_support " QPA backends:"
+report_support " DirectFB ............." "$CFG_DIRECTFB"
+report_support " EGLFS ................" "$CFG_EGLFS"
+report_support " KMS .................." "$CFG_KMS"
+report_support " LinuxFB .............." "$CFG_LINUXFB"
+report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy"
if [ "$CFG_XCB" != "no" ]; then
- echo " MIT-SHM ............ $CFG_MITSHM"
- echo " Xcursor ............ $CFG_XCURSOR"
- echo " Xfixes ............. $CFG_XFIXES"
- echo " Xi ................. $CFG_XINPUT"
- echo " Xi2 ................ $CFG_XINPUT2"
- echo " Xinerama ........... $CFG_XINERAMA"
- echo " Xrandr ............. $CFG_XRANDR"
- echo " Xrender ............ $CFG_XRENDER"
- echo " XKB ................ $CFG_XKB"
- echo " XShape ............. $CFG_XSHAPE"
- echo " XSync .............. $CFG_XSYNC"
- echo " XVideo ............. $CFG_XVIDEO"
-fi
-echo " Session management ..... $CFG_SM"
+ report_support " MIT-SHM ............" "$CFG_MITSHM"
+ report_support " Xcursor ............" "$CFG_XCURSOR" runtime "loaded at runtime"
+ report_support " Xfixes ............." "$CFG_XFIXES" runtime "loaded at runtime"
+ report_support " Xi ................." "$CFG_XINPUT" runtime "loaded at runtime"
+ report_support " Xi2 ................" "$CFG_XINPUT2" runtime "loaded at runtime"
+ report_support " Xinerama ..........." "$CFG_XINERAMA" runtime "loaded at runtime"
+ report_support " Xrandr ............." "$CFG_XRANDR" runtime "loaded at runtime"
+ report_support " Xrender ............" "$CFG_XRENDER"
+ report_support " XKB ................" "$CFG_XKB"
+ report_support " XShape ............." "$CFG_XSHAPE"
+ report_support " XSync .............." "$CFG_XSYNC"
+ report_support " XVideo ............." "$CFG_XVIDEO"
+fi
+report_support " Session management ....." "$CFG_SM"
[ "$XPLATFORM_QNX" = "yes" ] && \
- echo " SLOG2 .................. $CFG_SLOG2"
-echo " SQL drivers:"
-echo " DB2 .................. $CFG_SQL_db2"
-echo " InterBase ............ $CFG_SQL_ibase"
-echo " MySQL ................ $CFG_SQL_mysql"
-echo " OCI .................. $CFG_SQL_oci"
-echo " ODBC ................. $CFG_SQL_odbc"
-echo " PostgreSQL ........... $CFG_SQL_psql"
-echo " SQLite 2 ............. $CFG_SQL_sqlite2"
-echo " SQLite ............... $CFG_SQL_sqlite ($CFG_SQLITE)"
-echo " TDS .................. $CFG_SQL_tds"
-echo " udev ................... $CFG_LIBUDEV"
-echo " xkbcommon .............. $CFG_XKBCOMMON"
-if [ "$CFG_ZLIB" = "no" ]; then
- echo " zlib ................... no"
-else
- zlib_sys=system
- [ "$CFG_ZLIB" = "yes" ] && zlib_sys=qt
- echo " zlib ................... yes ($zlib_sys)"
- unset zlib_sys
-fi
+ report_support " SLOG2 .................." "$CFG_SLOG2"
+report_support " SQL drivers:"
+report_support " DB2 .................." "$CFG_SQL_db2" plugin "plugin" yes "built into QtSql"
+report_support " InterBase ............" "$CFG_SQL_ibase" plugin "plugin" yes "built into QtSql"
+report_support " MySQL ................" "$CFG_SQL_mysql" plugin "plugin" yes "built into QtSql"
+report_support " OCI .................." "$CFG_SQL_oci" plugin "plugin" yes "built into QtSql"
+report_support " ODBC ................." "$CFG_SQL_odbc" plugin "plugin" yes "built into QtSql"
+report_support " PostgreSQL ..........." "$CFG_SQL_psql" plugin "plugin" yes "built into QtSql"
+report_support " SQLite 2 ............." "$CFG_SQL_sqlite2" plugin "plugin" yes "built into QtSql"
+report_support_plugin " SQLite ..............." "$CFG_SQL_sqlite" "$CFG_SQLITE" QtSql
+report_support " TDS .................." "$CFG_SQL_tds" plugin "plugin" yes "built into QtSql"
+report_support " udev ..................." "$CFG_LIBUDEV"
+report_support " xkbcommon .............." "$CFG_XKBCOMMON" system "system library" qt "bundled copy"
+report_support " zlib ..................." "$CFG_ZLIB" system "system library" yes "bundled copy"
echo
@@ -6780,10 +6816,9 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
echo
fi
-if [ "$CFG_XCB" != no ] && [ "$CFG_XKBCOMMON" = "no" ]; then
- echo "WARNING: XCB support enabled but libxkbcommon 0.2.0 (or higher) not found."
- echo "Not satisfying this requirement will disable the compose key functionality,"
- echo "which includes text input with dead keys."
+if [ "$ORIG_CFG_XKBCOMMON" != qt ] && [ "$CFG_XKBCOMMON" = qt ]; then
+ echo "NOTE: libxkbcommon 0.2.0 (or higher) not found on the system, will use "
+ echo "the bundled version from 3rd party directory."
fi
exec 1>&3 3>&- # restore stdout
diff --git a/configure.bat b/configure.bat
index bdc8ffd947..923f1184b3 100644
--- a/configure.bat
+++ b/configure.bat
@@ -55,7 +55,7 @@ if not exist mkspecs (
md mkspecs
if errorlevel 1 goto exit
)
-perl %QTSRC%bin\syncqt -minimal -module QtCore -outdir %QTDIR% %QTSRC%
+perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC%
if errorlevel 1 goto exit
if not exist tools\configure (
diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0
index 6d58c21133..85c41c7f55 100644
--- a/dist/changes-5.0.0
+++ b/dist/changes-5.0.0
@@ -945,7 +945,7 @@ Qt for Windows CE
* QMAKE_SUBSTITUTES can now copy files verbatim.
* MSVC desktop builds now use -Zc:wchar_t.
* The following variables were added: QMAKESPEC, _QMAKE_CONF_ & _QMAKE_SUPER_CACHE_.
- * QDBUSXML2CPP_{INTERFACES,ADAPTORS}_{HEADER,SOURCE}_FLAGS are now understood,
+ * QDBUSXML2CPP_{INTERFACE,ADAPTOR}_{HEADER,SOURCE}_FLAGS are now understood,
and DBUS_{INTERFACES,ADAPTORS} support file groups with individual flags now.
* QT_PRIVATE and PKGCONFIG_PRIVATE (analogous to LIBS_PRIVATE resp. PKGCONFIG) are now understood.
* INSTALLS entries now support copying with subdirectory (e.g., entry.base = $$dirname(PWD)).
diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0
index d89914ce1a..cb96c2debe 100644
--- a/dist/changes-5.1.0
+++ b/dist/changes-5.1.0
@@ -41,6 +41,14 @@ Third party components
* [QTBUG-8836] QAbstractItemView now allows manual deselect in
SingleSelection mode (with control modifier)
+- QtCore
+
+ * The serialization behavior for QDateTime has reverted to pre-Qt 5,
+ due to the issue mentioned in section 4 here:
+ http://lists.qt-project.org/pipermail/development/2013-March/010559.html
+
+ This means that the QDataStream version will be 14 with Qt 5.1.
+
****************************************************************************
* Library *
****************************************************************************
diff --git a/doc/global/externalsites/external-resources.qdoc b/doc/global/externalsites/external-resources.qdoc
index bc1a8d492a..194967832f 100644
--- a/doc/global/externalsites/external-resources.qdoc
+++ b/doc/global/externalsites/external-resources.qdoc
@@ -62,28 +62,28 @@
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:find_package
+ \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
\title CMake find_package Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:AUTOMOC
+ \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:AUTOMOC
\title CMake AUTOMOC Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:LOCATION
+ \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:LOCATION
\title CMake LOCATION Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
+ \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
\title CMake POSITION_INDEPENDENT_CODE Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:target_link_libraries
+ \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:target_link_libraries
\title CMake target_link_libraries Documentation
*/
@@ -259,22 +259,22 @@
*/
/*!
- \externalpage http://www.amazon.com/exec/obidos/ASIN/0134436989/trolltech/t
+ \externalpage http://www.amazon.com/Threads-Primer-Guide-Multithreaded-Programming/dp/0134436989/ref=sr_1_1?ie=UTF8&qid=1354884049&sr=8-1&keywords=a+guide+to+multithreaded+programming
\title Threads Primer: A Guide to Multithreaded Programming
*/
/*!
- \externalpage http://www.amazon.com/exec/obidos/ASIN/0131900676/trolltech/t
+ \externalpage http://www.amazon.com/Thread-Time-MultiThreaded-Programming-Guide/dp/0131900676/ref=sr_1_sc_3?ie=UTF8&qid=1354884427&sr=8-3-spell&keywords=The+Mulltithread+Programming+Guide
\title Thread Time: The Multithreaded Programming Guide
*/
/*!
- \externalpage http://www.amazon.com/exec/obidos/ASIN/1565921151/trolltech/t
+ \externalpage http://www.amazon.com/Pthreads-Programming-Standard-Multiprocessing-Nutshell/dp/1565921151/ref=sr_1_1?s=books&ie=UTF8&qid=1354884565&sr=1-1&keywords=threads+Programming%3A+A+POSIX+Standard+for+Better+Multiprocessing
\title Pthreads Programming: A POSIX Standard for Better Multiprocessing
*/
/*!
- \externalpage http://www.amazon.com/exec/obidos/ASIN/1565922964/trolltech/t
+ \externalpage http://www.amazon.com/Win32-Multithreaded-Programming-Aaron-Cohen/dp/B00007GW3Z/ref=sr_1_1?s=books&ie=UTF8&qid=1354884647&sr=1-1&keywords=Win32+Multithreaded+Programming
\title Win32 Multithreaded Programming
*/
diff --git a/doc/global/externalsites/qch-urls.qdoc b/doc/global/externalsites/qch-urls.qdoc
index e099669dd6..f8ff8df7a0 100644
--- a/doc/global/externalsites/qch-urls.qdoc
+++ b/doc/global/externalsites/qch-urls.qdoc
@@ -38,7 +38,7 @@
\title external: Publishing Applications to Ovi Store
*/
/*!
- \externalpage http://doc.qt.digia.com/qtcreator/index.html
+ \externalpage http://qt-project.org/doc/qtcreator
\title external: Qt Creator Manual
*/
/*!
@@ -90,6 +90,6 @@
\title external: Qt Mobility Examples
*/
/*!
- \externalpage http://doc-snapshot.qt-project.org/qtcreator-2.6/creator-overview.html
+ \externalpage http://qt-project.org/doc/qtcreator/creator-overview.html
\title external: Qt Creator Overview
*/
diff --git a/doc/global/externalsites/qt-webpages.qdoc b/doc/global/externalsites/qt-webpages.qdoc
index c83d5e1c94..f7bb9b1b89 100644
--- a/doc/global/externalsites/qt-webpages.qdoc
+++ b/doc/global/externalsites/qt-webpages.qdoc
@@ -90,3 +90,18 @@
\externalpage http://qt-project.org/wiki/jom
\title jom
*/
+
+/*!
+ \externalpage http://qt-project.org/doc/qt-4.8
+ \title Qt 4.8 Reference Documentation
+*/
+
+/*!
+ \externalpage http://qt-project.org/doc/qt-4.8/qtquick.html
+ \title Qt Quick 1 Reference Documentation
+*/
+
+/*!
+ \externalpage http://qt-project.org/wiki/Qt-Localization
+ \title external: Translating Qt Into Other Languages
+*/
diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf
index 3bfc3e12d4..d4b2f9f066 100644
--- a/doc/global/manifest-meta.qdocconf
+++ b/doc/global/manifest-meta.qdocconf
@@ -31,3 +31,42 @@
#
# manifestmeta.global.names = *
# manifestmeta.global.tags = qt5
+
+manifestmeta.filters = highlighted webkit1 webkit2
+
+manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
+ "QtQuick/Qt Quick Demo - Photo Surface" \
+ "QtQuick/Qt Quick Demo - Tweet Search" \
+ "QtQuick/Qt Quick Demo - Maroon*" \
+ "QtQuick/Qt Quick Demo - Calqlatr" \
+ "QtQuick/Qt Quick Particles Examples - Emitters" \
+ "QtQuick/Qt Quick Examples - Shader Effects" \
+ "QtWebKitExamples/Fancy Browser" \
+ "QtWebKitExamples/Flickr View Example" \
+ "QtWebKitExamples/YouTube View Example" \
+ "QtQuickControls/Qt Quick Controls - Gallery" \
+ "QtQuickControls/Qt Quick Controls - Text Editor Example" \
+ "QtQuickControls/Qt Quick Controls - Table View Example" \
+ "QtWidgets/Application Example"
+
+manifestmeta.highlighted.attributes = isHighlighted:true
+
+# Add 'webkit1' tag for QtWebKit1 examples
+manifestmeta.webkit1.names = "QtWebKitExamples/Tab Browser" \
+ "QtWebKitExamples/DOM Traversal Example" \
+ "QtWebKitExamples/Fancy Browser Example" \
+ "QtWebKitExamples/Form Extractor Example" \
+ "QtWebKitExamples/WebKit Frame Capture Example" \
+ "QtWebKitExamples/The Webkit Bridge Tutorial*" \
+ "QtWebKitExamples/Previewer Example" \
+ "QtWebKitExamples/Wheel Scroller Example" \
+ "QtWebKitExamples/Simple Selector Example" \
+ "QtWebKitExamples/QObject XML Model Example"
+
+manifestmeta.webkit1.tags = webkit1
+
+# Add 'webkit2' tag for QtWebKit2 examples
+manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \
+ "QtWebKitExamples/YouTube View Example"
+
+manifestmeta.webkit2.tags = webkit2
diff --git a/doc/src/images/appicon_packagecontents.png b/doc/src/images/appicon_packagecontents.png
deleted file mode 100644
index 49cb1e4229..0000000000
--- a/doc/src/images/appicon_packagecontents.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/appicon_screenshot.png b/doc/src/images/appicon_screenshot.png
deleted file mode 100644
index c29dd11d46..0000000000
--- a/doc/src/images/appicon_screenshot.png
+++ /dev/null
Binary files differ
diff --git a/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc b/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc
index c303998cd8..522b0bacc7 100644
--- a/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc
+++ b/examples/dbus/remotecontrolledcar/doc/src/dbus-remotecontrolledcar.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example dbus/remotecontrolledcar
+ \example remotecontrolledcar
\title D-Bus Remote Controlled Car Example
The Remote Controlled Car example shows how to use D-Bus to control one
diff --git a/examples/network/doc/src/network-download.qdoc b/examples/network/doc/src/network-download.qdoc
index 212252e7c9..60a6fab3c4 100644
--- a/examples/network/doc/src/network-download.qdoc
+++ b/examples/network/doc/src/network-download.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example network/download
+ \example download
\title Network Download Example
\brief Demonstrates how to use networking APIs for multiple downloads
\ingroup examples-network
diff --git a/examples/network/doc/src/network-downloadmanager.qdoc b/examples/network/doc/src/network-downloadmanager.qdoc
index d9145d5a1c..d4eacf4199 100644
--- a/examples/network/doc/src/network-downloadmanager.qdoc
+++ b/examples/network/doc/src/network-downloadmanager.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example network/downloadmanager
+ \example downloadmanager
\title Network Download Manager Example
\brief Demonstrates how to use the networking APIs for multiple downloads
\ingroup examples-network
diff --git a/examples/opengl/grabber/mainwindow.cpp b/examples/opengl/grabber/mainwindow.cpp
index 9f31733856..9f82ee10ba 100644
--- a/examples/opengl/grabber/mainwindow.cpp
+++ b/examples/opengl/grabber/mainwindow.cpp
@@ -175,7 +175,7 @@ QSlider *MainWindow::createSlider(const char *changedSignal,
void MainWindow::setPixmap(const QPixmap &pixmap)
{
pixmapLabel->setPixmap(pixmap);
- QSize size = pixmap.size();
+ QSize size = pixmap.size() / pixmap.devicePixelRatio();
if (size - QSize(1, 0) == pixmapLabelArea->maximumViewportSize())
size -= QSize(1, 0);
pixmapLabel->resize(size);
diff --git a/examples/opengl/overpainting/glwidget.cpp b/examples/opengl/overpainting/glwidget.cpp
index 78f5f96c48..420ae3e881 100644
--- a/examples/opengl/overpainting/glwidget.cpp
+++ b/examples/opengl/overpainting/glwidget.cpp
@@ -161,7 +161,8 @@ void GLWidget::paintEvent(QPaintEvent *event)
static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
- setupViewport(width(), height());
+ qreal pixelRatio = devicePixelRatio();
+ setupViewport(width() * pixelRatio, height() * pixelRatio);
//! [6]
//! [7]
@@ -200,7 +201,8 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [11]
void GLWidget::resizeGL(int width, int height)
{
- setupViewport(width, height);
+ qreal pixelRatio = devicePixelRatio();
+ setupViewport(width*pixelRatio, height*pixelRatio);
}
//! [11]
diff --git a/examples/opengl/paintedwindow/paintedwindow.cpp b/examples/opengl/paintedwindow/paintedwindow.cpp
index d891f8d563..c8f1f236ba 100644
--- a/examples/opengl/paintedwindow/paintedwindow.cpp
+++ b/examples/opengl/paintedwindow/paintedwindow.cpp
@@ -88,14 +88,10 @@ PaintedWindow::PaintedWindow()
connect(this, SIGNAL(rotationChanged(qreal)), this, SLOT(paint()));
}
-void PaintedWindow::resizeEvent(QResizeEvent *)
-{
- paint();
-}
-
void PaintedWindow::exposeEvent(QExposeEvent *)
{
- paint();
+ if (isExposed())
+ paint();
}
void PaintedWindow::mousePressEvent(QMouseEvent *)
diff --git a/examples/opengl/paintedwindow/paintedwindow.h b/examples/opengl/paintedwindow/paintedwindow.h
index c5b7976d59..f185cd3733 100644
--- a/examples/opengl/paintedwindow/paintedwindow.h
+++ b/examples/opengl/paintedwindow/paintedwindow.h
@@ -74,7 +74,6 @@ private slots:
void rotationDone();
private:
- void resizeEvent(QResizeEvent *);
void exposeEvent(QExposeEvent *);
void mousePressEvent(QMouseEvent *);
diff --git a/examples/sql/connection.h b/examples/sql/connection.h
index 46d91b6605..e6bbe642cb 100644
--- a/examples/sql/connection.h
+++ b/examples/sql/connection.h
@@ -78,55 +78,38 @@ static bool createConnection()
query.exec("insert into person values(104, 'Roberto', 'Robitaille')");
query.exec("insert into person values(105, 'Maria', 'Papadopoulos')");
- query.exec("create table offices (id int primary key,"
+ query.exec("create table items (id int primary key,"
"imagefile int,"
- "location varchar(20),"
- "country varchar(20),"
+ "itemtype varchar(20),"
"description varchar(100))");
- query.exec("insert into offices "
- "values(0, 0, 'Oslo', 'Norway',"
- "'Oslo is home to more than 500 000 citizens and has a "
- "lot to offer.It has been called \"The city with the big "
- "heart\" and this is a nickname we are happy to live up to.')");
- query.exec("insert into offices "
- "values(1, 1, 'Brisbane', 'Australia',"
- "'Brisbane is the capital of Queensland, the Sunshine State, "
- "where it is beautiful one day, perfect the next. "
- "Brisbane is Australia''s 3rd largest city, being home "
- "to almost 2 million people.')");
- query.exec("insert into offices "
- "values(2, 2, 'Redwood City', 'US',"
- "'You find Redwood City in the heart of the Bay Area "
- "just north of Silicon Valley. The largest nearby city is "
- "San Jose which is the third largest city in California "
- "and the 10th largest in the US.')");
- query.exec("insert into offices "
- "values(3, 3, 'Berlin', 'Germany',"
- "'Berlin, the capital of Germany is dynamic, cosmopolitan "
- "and creative, allowing for every kind of lifestyle. "
- "East meets West in the metropolis at the heart of a "
- "changing Europe.')");
- query.exec("insert into offices "
- "values(4, 4, 'Munich', 'Germany',"
- "'Several technology companies are represented in Munich, "
- "and the city is often called the \"Bavarian Silicon Valley\". "
- "The exciting city is also filled with culture, "
- "art and music. ')");
- query.exec("insert into offices "
- "values(5, 5, 'Beijing', 'China',"
- "'Beijing as a capital city has more than 3000 years of "
- "history. Today the city counts 12 million citizens, and "
- "is the political, economic and cultural centre of China.')");
-
- query.exec("create table images (locationid int, file varchar(20))");
- query.exec("insert into images values(0, 'images/oslo.png')");
- query.exec("insert into images values(1, 'images/brisbane.png')");
- query.exec("insert into images values(2, 'images/redwood.png')");
- query.exec("insert into images values(3, 'images/berlin.png')");
- query.exec("insert into images values(4, 'images/munich.png')");
- query.exec("insert into images values(5, 'images/beijing.png')");
-
+ query.exec("insert into items "
+ "values(0, 0, 'Qt',"
+ "'Qt is a full development framework with tools designed to "
+ "streamline the creation of stunning applications and "
+ "amazing user interfaces for desktop, embedded and mobile "
+ "platforms.')");
+ query.exec("insert into items "
+ "values(1, 1, 'Qt Quick',"
+ "'Qt Quick is a collection of techniques designed to help "
+ "developers create intuitive, modern-looking, and fluid "
+ "user interfaces using a CSS & JavaScript like language.')");
+ query.exec("insert into items "
+ "values(2, 2, 'Qt Creator',"
+ "'Qt Creator is a powerful cross-platform integrated "
+ "development environment (IDE), including UI design tools "
+ "and on-device debugging.')");
+ query.exec("insert into items "
+ "values(3, 3, 'Qt Project',"
+ "'The Qt Project governs the open source development of Qt, "
+ "allowing anyone wanting to contribute to join the effort "
+ "through a meritocratic structure of approvers and "
+ "maintainers.')");
+ query.exec("create table images (itemid int, file varchar(20))");
+ query.exec("insert into images values(0, 'images/qt-logo.png')");
+ query.exec("insert into images values(1, 'images/qt-quick.png')");
+ query.exec("insert into images values(2, 'images/qt-creator.png')");
+ query.exec("insert into images values(3, 'images/qt-project.png')");
return true;
}
diff --git a/examples/sql/doc/images/drilldown-example.png b/examples/sql/doc/images/drilldown-example.png
index 68353f704a..fd315a437e 100644
--- a/examples/sql/doc/images/drilldown-example.png
+++ b/examples/sql/doc/images/drilldown-example.png
Binary files differ
diff --git a/examples/sql/doc/src/drilldown.qdoc b/examples/sql/doc/src/drilldown.qdoc
index 3bba12317f..09f9477f4f 100644
--- a/examples/sql/doc/src/drilldown.qdoc
+++ b/examples/sql/doc/src/drilldown.qdoc
@@ -37,20 +37,19 @@
\image drilldown-example.png Screenshot of the Drill Down Example
When running the example application, a user can retrieve
- information about each of Nokia's Qt offices by clicking the
- corresponding image. The application pops up an information window
- displaying the data, and allows the users to alter the location
- description as well as the image. The main view will be updated
- when the users submit their changes.
+ information about each item by clicking the corresponding image.
+ The application pops up an information window displaying the data,
+ and allows the users to alter the description as well as the image.
+ The main view will be updated when the users submit their changes.
The example consists of three classes:
\list
\li \c ImageItem is a custom graphics item class used to
- display the office images.
+ display the images.
\li \c View is the main application widget allowing the user to
- browse through the various locations.
+ browse through the various items.
\li \c InformationWindow displays the requested information,
allowing the users to alter it and submit their changes to the
@@ -70,7 +69,7 @@
\snippet drilldown/informationwindow.h 0
When we create an information window, we pass the associated
- location ID, a parent, and a pointer to the database, to the
+ item ID, a parent, and a pointer to the database, to the
constructor. We will use the database pointer to populate our
window with data, while passing the parent parameter on to the
base class. The ID is stored for future reference.
@@ -84,7 +83,7 @@
\snippet drilldown/informationwindow.h 1
- Since we allow the users to alter some of the location data, we
+ Since we allow the users to alter some of the data, we
must provide functionality for reverting and submitting their
changes. The \c enableButtons() slot is provided for convenience
to enable and disable the various buttons when required.
@@ -93,15 +92,15 @@
The \c createButtons() function is also a convenience function,
provided to simplify the constructor. As mentioned above we store
- the location ID for future reference. We also store the name of
+ the item ID for future reference. We also store the name of
the currently displayed image file to be able to determine when to
emit the \c imageChanged() signal.
- The information window uses the QLabel class to display the office
- location and the country. The associated image file is displayed
- using a QComboBox instance while the description is displayed using
- QTextEdit. In addition, the window has three buttons to control
- the data flow and whether the window is shown or not.
+ The information window uses the QLabel class to display the name of
+ an item. The associated image file is displayed using a QComboBox
+ instance while the description is displayed using QTextEdit. In
+ addition, the window has three buttons to control the data flow and
+ whether the window is shown or not.
Finally, we declare a \e mapper. The QDataWidgetMapper class
provides mapping between a section of a data model to widgets. We
@@ -110,7 +109,7 @@
\section1 InformationWindow Class Implementation
- The constructor takes three arguments: a location ID, a database
+ The constructor takes three arguments: an item ID, a database
pointer and a parent widget. The database pointer is actually a
pointer to a QSqlRelationalTableModel object providing an editable
data model (with foreign key support) for our database table.
@@ -125,8 +124,8 @@
\snippet drilldown/informationwindow.cpp 2
- In this example, the information about the offices are stored in a
- database table called "offices". When creating the model,
+ In this example, information about the items are stored in a
+ database table called "items". When creating the model,
we will use a foreign key to establish a relation between this
table and a second data base table, "images", containing the names
of the available image files. We will get back to how this is done
@@ -140,7 +139,7 @@
the foreign key (in this case the "imagefile" column number) as
argument. We use QComboBox's \l {QComboBox::}{setModel()} function
to make the combobox use the "images" model. And, since this model
- has two columns ("locationid" and "file"), we also specify which
+ has two columns ("itemid" and "file"), we also specify which
column we want to be visible using the QComboBox::setModelColumn()
function.
@@ -156,7 +155,7 @@
section is a column in the model, otherwise it is a row. We call
the \l {QDataWidgetMapper::}{setCurrentIndex()} function to
initialize the widgets with the data associated with the given
- location ID. Every time the current index changes, all the widgets
+ item ID. Every time the current index changes, all the widgets
are updated with the contents from the model.
We also set the mapper's submit policy to
@@ -168,14 +167,14 @@
view should use for its items. The QSqlRelationalDelegate class
represents a delegate that unlike the default delegate, enables
combobox functionality for fields that are foreign keys into other
- tables (like "imagefile" in our "trolltechoffices" table).
+ tables (like "imagefile" in our "items" table).
\snippet drilldown/informationwindow.cpp 4
Finally, we connect the "something's changed" signals in the
editors to our custom \c enableButtons() slot, enabling the users
to either submit or revert their changes. We add all the widgets
- into a layout, store the location ID and the name of the displayed
+ into a layout, store the item ID and the name of the displayed
image file for future reference, and set the window title and
initial size.
@@ -189,7 +188,7 @@
application exits (i.e., if the user closes the information
window, it is only hidden). For this reason we do not want to
create more than one \c InformationWindow object for each
- location, and we provide the public \c id() function to be able to
+ item, and we provide the public \c id() function to be able to
determine whether a window already exists for a given location
when the user requests information about it.
@@ -256,16 +255,15 @@
{QDialogButtonBox::ButtonRole}{reject} role indicates that
clicking the button causes the dialog to be rejected. On the other
hand, since we only hide the information window, any changes that
- the user has made wil be preserved until the user expliclity
- revert or submit them.
+ the user has made will be preserved until the user explicitly
+ reverts or submits them.
\snippet drilldown/informationwindow.cpp 10
The \c enableButtons() slot is called to enable the buttons
whenever the user changes the presented data. Likewise, when the
- data the user choose to submit the changes, the buttons are
- disabled to indicate that the current data is stored in the
- database.
+ user chooses to submit the changes, the buttons are disabled to
+ indicate that the current data is stored in the database.
This completes the \c InformationWindow class. Let's take a look
at how we have used it in our example application.
@@ -280,19 +278,17 @@
\snippet drilldown/view.h 1
The QGraphicsView class is part of the \l {Graphics View
- Framework} which we will use to display the images of Nokia's
- Qt offices. To be able to respond to user interaction;
- i.e., showing the
- appropriate information window whenever the user clicks one of the
- office images, we reimplement QGraphicsView's \l
- {QGraphicsView::}{mouseReleaseEvent()} function.
+ Framework} which we will use to display the images. To be able to
+ respond to user interaction by displaying the appropriate
+ information window when the image is clicked, we reimplement
+ QGraphicsView's \l{QGraphicsView::}{mouseReleaseEvent()} function.
Note that the constructor expects the names of two database
- tables: One containing the detailed information about the offices,
+ tables: One containing the detailed information about the items,
and another containing the names of the available image files. We
also provide a private \c updateImage() slot to catch \c
{InformationWindow}'s \c imageChanged() signal that is emitted
- whenever the user changes a location's image.
+ whenever the user changes an image associated with the item.
\snippet drilldown/view.h 2
@@ -303,20 +299,20 @@
The \c findWindow() function, on the other hand, is frequently
used. It is called from the \c showInformation() function to
detemine whether a window is already created for the given
- location (whenever we create an \c InformationWindow object, we
+ item (whenever we create an \c InformationWindow object, we
store a reference to it in the \c informationWindows list). The
latter function is in turn called from our custom \c
mouseReleaseEvent() implementation.
\snippet drilldown/view.h 3
- Finally we declare a QSqlRelationalTableModel pointer. As
+ Finally, we declare a QSqlRelationalTableModel pointer. As
previously mentioned, the QSqlRelationalTableModel class provides
an editable data model with foreign key support. There are a
couple of things you should keep in mind when using the
QSqlRelationalTableModel class: The table must have a primary key
declared and this key cannot contain a relation to another table,
- i.e., it cannot be a foreign key. Note also that if a relational
+ that is, it cannot be a foreign key. Also note that if a relational
table contains keys that refer to non-existent rows in the
referenced table, the rows containing the invalid keys will not be
exposed through the model. It is the user's or the database's
@@ -327,11 +323,11 @@
Although the constructor requests the names of both the table
containing office details as well as the table containing the
names of the available image files, we only have to create a
- QSqlRelationalTableModel object for the office table:
+ QSqlRelationalTableModel object for the "items" table:
\snippet drilldown/view.cpp 0
- The reason is that once we have a model with the office details,
+ The reason is that once we have a model with the item details,
we can create a relation to the available image files using
QSqlRelationalTableModel's \l
{QSqlRelationalTableModel::}{setRelation()} function. This
@@ -348,20 +344,19 @@
\snippet drilldown/view.cpp 1
Then we create the contents of our view, i.e., the scene and its
- items. The location labels are regular QGraphicsTextItem objects,
- and the "Qt" logo is represented by a QGraphicsPixmapItem
- object. The images, on the other hand, are instances of the \c
- ImageItem class (derived from QGraphicsPixmapItem). We will get
- back to this shortly when reviewing the \c addItems() function.
+ items. The labels are regular QGraphicsTextItem objects, whereas
+ the images are instances of the \c ImageItem class, derived from
+ QGraphicsPixmapItem. We will get back to this shortly when reviewing
+ the \c addItems() function.
Finally, we set the main application widget's size constraints and
window title.
\snippet drilldown/view.cpp 3
- The \c addItems() function is called only once, i.e., when
- creating the main application window. For each row in the database
- table, we first extract the corresponding record using the model's
+ The \c addItems() function is called only once when creating the main
+ application window. For each row in the database table, we first
+ extract the corresponding record using the model's
\l {QSqlRelationalTableModel::}{record()} function. The QSqlRecord
class encapsulates both the functionality and characteristics of a
database record, and supports adding and removing fields as well
@@ -394,7 +389,7 @@
\snippet drilldown/view.cpp 6
The \c showInformation() function is given an \c ImageItem object
- as argument, and starts off by extracting the item's location
+ as argument, and starts off by extracting the item's item
ID. Then it determines if there already is created an information
window for this location. If it is, and the window is visible, it
ensures that the window is raised to the top of the widget stack
@@ -402,7 +397,7 @@
{QWidget::}{show()} slot gives the same result.
If no window for the given location exists, we create one by
- passing the location ID, a pointer to the model, and our view as a
+ passing the item ID, a pointer to the model, and our view as a
parent, to the \c InformationWindow constructor. Note that we
connect the information window's \c imageChanged() signal to \e
this widget's \c updateImage() slot, before we give it a suitable
@@ -410,16 +405,16 @@
\snippet drilldown/view.cpp 7
- The \c updateImage() slot takes a location ID and the name of an
- image files as arguments. It filters out the image items, and
- updates the one that correspond to the given location ID, with the
+ The \c updateImage() slot takes an item ID and the name of an
+ image file as arguments. It filters out the image items, and
+ updates the one that correspond to the given item ID, with the
provided image file.
\snippet drilldown/view.cpp 8
The \c findWindow() function simply searches through the list of
existing windows, returning a pointer to the window that matches
- the given location ID, or 0 if the window doesn't exists.
+ the given item ID, or 0 if the window doesn't exists.
Finally, let's take a quick look at our custom \c ImageItem class:
@@ -442,7 +437,7 @@
returning back to its original size when the cursor leaves its
borders.
- Finally, we store the location ID that this particular record is
+ Finally, we store the item ID that this particular record is
associated with as well as a z-value. In the \l {Graphics View
Framework}, an item's z-value determines its position in the item
stack. An item of high z-value will be drawn on top of an item
@@ -460,8 +455,8 @@
\snippet drilldown/imageitem.cpp 0
Then we store the ID for future reference, and ensure that our
- item will accept hover events. Hover events are delivered when
- there is no current mouse grabber item. They are sent when the
+ image item will accept hover events. Hover events are delivered
+ when there is no current mouse grabber item. They are sent when the
mouse cursor enters an item, when it moves around inside the item,
and when the cursor leaves an item. As we mentioned earlier, none
of the \l {Graphics View Framework}'s items accept hover
@@ -487,7 +482,7 @@
\codeline
\snippet drilldown/imageitem.cpp 2
- Whenever the mouse cursor enters or leave the image item, the
+ Whenever the mouse cursor enters or leaves the image item, the
corresponding event handlers are triggered: We first set the time
line's direction, making the item expand or shrink,
respectively. Then we alter the item's z-value if it is not already
@@ -532,6 +527,6 @@
size regardless of the size of the source image. The \c id()
function is trivial, and is simply provided to be able to identify
the item. In the \c updateItemPosition() slot we call the
- QGraphicsItem::setZValue() function, setting the elevation (i.e.,
- the position) of the item.
+ QGraphicsItem::setZValue() function, setting the elevation of the
+ item.
*/
diff --git a/examples/sql/drilldown/drilldown.qrc b/examples/sql/drilldown/drilldown.qrc
index d2fb12295b..f24edbafe4 100644
--- a/examples/sql/drilldown/drilldown.qrc
+++ b/examples/sql/drilldown/drilldown.qrc
@@ -1,11 +1,8 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource>
- <file>images/oslo.png</file>
- <file>images/brisbane.png</file>
- <file>images/redwood.png</file>
- <file>images/berlin.png</file>
- <file>images/munich.png</file>
- <file>images/beijing.png</file>
- <file>logo.png</file>
- </qresource>
+<RCC>
+ <qresource prefix="/">
+ <file>images/qt-logo.png</file>
+ <file>images/qt-quick.png</file>
+ <file>images/qt-creator.png</file>
+ <file>images/qt-project.png</file>
+ </qresource>
</RCC>
diff --git a/examples/sql/drilldown/imageitem.cpp b/examples/sql/drilldown/imageitem.cpp
index 8ebd7fd890..f1e3872e1c 100644
--- a/examples/sql/drilldown/imageitem.cpp
+++ b/examples/sql/drilldown/imageitem.cpp
@@ -100,7 +100,7 @@ void ImageItem::setFrame(int frame)
void ImageItem::adjust()
{
QMatrix matrix;
- matrix.scale(150/ boundingRect().width(), 120/ boundingRect().height());
+ matrix.scale(120/ boundingRect().width(), 120/ boundingRect().height());
setMatrix(matrix);
}
//! [4]
diff --git a/examples/sql/drilldown/images/beijing.png b/examples/sql/drilldown/images/beijing.png
deleted file mode 100644
index 45df148506..0000000000
--- a/examples/sql/drilldown/images/beijing.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/images/berlin.png b/examples/sql/drilldown/images/berlin.png
deleted file mode 100644
index ead62f0421..0000000000
--- a/examples/sql/drilldown/images/berlin.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/images/brisbane.png b/examples/sql/drilldown/images/brisbane.png
deleted file mode 100644
index 04fff57f9c..0000000000
--- a/examples/sql/drilldown/images/brisbane.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/images/munich.png b/examples/sql/drilldown/images/munich.png
deleted file mode 100644
index 741eb77b8d..0000000000
--- a/examples/sql/drilldown/images/munich.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/images/oslo.png b/examples/sql/drilldown/images/oslo.png
deleted file mode 100644
index 02fa25e5a0..0000000000
--- a/examples/sql/drilldown/images/oslo.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/images/qt-creator.png b/examples/sql/drilldown/images/qt-creator.png
new file mode 100644
index 0000000000..fa0f6ed7ce
--- /dev/null
+++ b/examples/sql/drilldown/images/qt-creator.png
Binary files differ
diff --git a/examples/sql/drilldown/images/qt-logo.png b/examples/sql/drilldown/images/qt-logo.png
new file mode 100644
index 0000000000..53bc39c38c
--- /dev/null
+++ b/examples/sql/drilldown/images/qt-logo.png
Binary files differ
diff --git a/examples/sql/drilldown/images/qt-project.png b/examples/sql/drilldown/images/qt-project.png
new file mode 100644
index 0000000000..c34d3f099d
--- /dev/null
+++ b/examples/sql/drilldown/images/qt-project.png
Binary files differ
diff --git a/examples/sql/drilldown/images/qt-quick.png b/examples/sql/drilldown/images/qt-quick.png
new file mode 100644
index 0000000000..f66127e8e7
--- /dev/null
+++ b/examples/sql/drilldown/images/qt-quick.png
Binary files differ
diff --git a/examples/sql/drilldown/images/redwood.png b/examples/sql/drilldown/images/redwood.png
deleted file mode 100644
index f39ac06578..0000000000
--- a/examples/sql/drilldown/images/redwood.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp
index 08c125e58a..d3930c6f0b 100644
--- a/examples/sql/drilldown/informationwindow.cpp
+++ b/examples/sql/drilldown/informationwindow.cpp
@@ -41,38 +41,35 @@
#include "informationwindow.h"
//! [0]
-InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
+InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *items,
QWidget *parent)
: QDialog(parent)
{
//! [0] //! [1]
- QLabel *locationLabel = new QLabel(tr("Location: "));
- QLabel *countryLabel = new QLabel(tr("Country: "));
+ QLabel *itemLabel = new QLabel(tr("Item: "));
QLabel *descriptionLabel = new QLabel(tr("Description: "));
QLabel *imageFileLabel = new QLabel(tr("Image file: "));
createButtons();
- locationText = new QLabel;
- countryText = new QLabel;
+ itemText = new QLabel;
descriptionEditor = new QTextEdit;
//! [1]
//! [2]
imageFileEditor = new QComboBox;
- imageFileEditor->setModel(offices->relationModel(1));
- imageFileEditor->setModelColumn(offices->relationModel(1)->fieldIndex("file"));
+ imageFileEditor->setModel(items->relationModel(1));
+ imageFileEditor->setModelColumn(items->relationModel(1)->fieldIndex("file"));
//! [2]
//! [3]
mapper = new QDataWidgetMapper(this);
- mapper->setModel(offices);
+ mapper->setModel(items);
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
mapper->setItemDelegate(new QSqlRelationalDelegate(mapper));
mapper->addMapping(imageFileEditor, 1);
- mapper->addMapping(locationText, 2, "text");
- mapper->addMapping(countryText, 3, "text");
- mapper->addMapping(descriptionEditor, 4);
+ mapper->addMapping(itemText, 2, "text");
+ mapper->addMapping(descriptionEditor, 3);
mapper->setCurrentIndex(id);
//! [3]
@@ -83,8 +80,7 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
this, SLOT(enableButtons()));
QFormLayout *formLayout = new QFormLayout;
- formLayout->addRow(locationLabel, locationText);
- formLayout->addRow(countryLabel, countryText);
+ formLayout->addRow(itemLabel, itemText);
formLayout->addRow(imageFileLabel, imageFileEditor);
formLayout->addRow(descriptionLabel, descriptionEditor);
@@ -93,23 +89,19 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices,
layout->addWidget(buttonBox);
setLayout(layout);
- locationId = id;
+ itemId = id;
displayedImage = imageFileEditor->currentText();
- // Commented the following line. Now the window will look like dialog and the Qt will place the QDialogBox buttons to menu area in Symbian.
- // Too bad that the revert button is missing, Should the Qt place the buttons under Option menu in the menu area?!
- // If the Qt::Window flag was used, the background of window is white in symbian and the QLabels can't be regognized from the background.
-
- //setWindowFlags(Qt::Window);
+ setWindowFlags(Qt::Window);
enableButtons(false);
- setWindowTitle(tr("Office: %1").arg(locationText->text()));
+ setWindowTitle(itemText->text());
}
//! [4]
//! [5]
int InformationWindow::id()
{
- return locationId;
+ return itemId;
}
//! [5]
@@ -128,11 +120,11 @@ void InformationWindow::submit()
if (displayedImage != newImage) {
displayedImage = newImage;
- emit imageChanged(locationId, newImage);
+ emit imageChanged(itemId, newImage);
}
mapper->submit();
- mapper->setCurrentIndex(locationId);
+ mapper->setCurrentIndex(itemId);
enableButtons(false);
}
diff --git a/examples/sql/drilldown/informationwindow.h b/examples/sql/drilldown/informationwindow.h
index e1bb9bc958..f039e120ca 100644
--- a/examples/sql/drilldown/informationwindow.h
+++ b/examples/sql/drilldown/informationwindow.h
@@ -50,7 +50,7 @@ class InformationWindow : public QDialog
Q_OBJECT
public:
- InformationWindow(int id, QSqlRelationalTableModel *offices,
+ InformationWindow(int id, QSqlRelationalTableModel *items,
QWidget *parent = 0);
int id();
@@ -70,12 +70,11 @@ private slots:
private:
void createButtons();
- int locationId;
+ int itemId;
QString displayedImage;
QComboBox *imageFileEditor;
- QLabel *locationText;
- QLabel *countryText;
+ QLabel *itemText;
QTextEdit *descriptionEditor;
QPushButton *closeButton;
diff --git a/examples/sql/drilldown/logo.png b/examples/sql/drilldown/logo.png
deleted file mode 100644
index 4b1d235488..0000000000
--- a/examples/sql/drilldown/logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp
index 2ee32e446f..956cca9ef9 100644
--- a/examples/sql/drilldown/main.cpp
+++ b/examples/sql/drilldown/main.cpp
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
if (!createConnection())
return 1;
- View view("offices", "images");
+ View view("items", "images");
view.show();
#ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);
diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp
index d80a800e62..a64252cbd2 100644
--- a/examples/sql/drilldown/view.cpp
+++ b/examples/sql/drilldown/view.cpp
@@ -43,61 +43,62 @@
#include "view.h"
//! [0]
-View::View(const QString &offices, const QString &images, QWidget *parent)
+View::View(const QString &items, const QString &images, QWidget *parent)
: QGraphicsView(parent)
{
- officeTable = new QSqlRelationalTableModel(this);
- officeTable->setTable(offices);
- officeTable->setRelation(1, QSqlRelation(images, "locationid", "file"));
- officeTable->select();
+ itemTable = new QSqlRelationalTableModel(this);
+ itemTable->setTable(items);
+ itemTable->setRelation(1, QSqlRelation(images, "itemid", "file"));
+ itemTable->select();
//! [0]
//! [1]
scene = new QGraphicsScene(this);
- scene->setSceneRect(0, 0, 465, 615);
+ scene->setSceneRect(0, 0, 465, 365);
setScene(scene);
addItems();
- QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png"));
- logo->setPos(30, 515);
+ setMinimumSize(470, 370);
+ setMaximumSize(470, 370);
- setMinimumSize(470, 620);
- setMaximumSize(470, 620);
-
- setWindowTitle(tr("Offices World Wide"));
+ QLinearGradient gradient(QPointF(0, 0), QPointF(0, 370));
+ gradient.setColorAt(0, QColor("#868482"));
+ gradient.setColorAt(1, QColor("#5d5b59"));
+ setBackgroundBrush(gradient);
}
//! [1]
//! [3]
void View::addItems()
{
- int officeCount = officeTable->rowCount();
+ int itemCount = itemTable->rowCount();
int imageOffset = 150;
int leftMargin = 70;
int topMargin = 40;
- for (int i = 0; i < officeCount; i++) {
+ for (int i = 0; i < itemCount; i++) {
ImageItem *image;
QGraphicsTextItem *label;
- QSqlRecord record = officeTable->record(i);
+ QSqlRecord record = itemTable->record(i);
int id = record.value("id").toInt();
QString file = record.value("file").toString();
- QString location = record.value("location").toString();
+ QString item = record.value("itemtype").toString();
- int columnOffset = ((i / 3) * 37);
- int x = ((i / 3) * imageOffset) + leftMargin + columnOffset;
- int y = ((i % 3) * imageOffset) + topMargin;
+ int columnOffset = ((i % 2) * 37);
+ int x = ((i % 2) * imageOffset) + leftMargin + columnOffset;
+ int y = ((i / 2) * imageOffset) + topMargin;
image = new ImageItem(id, QPixmap(":/" + file));
image->setData(0, i);
image->setPos(x, y);
scene->addItem(image);
- label = scene->addText(location);
- QPointF labelOffset((150 - label->boundingRect().width()) / 2, 120.0);
+ label = scene->addText(item);
+ label->setDefaultTextColor(QColor("#d7d6d5"));
+ QPointF labelOffset((120 - label->boundingRect().width()) / 2, 120.0);
label->setPos(QPointF(x, y) + labelOffset);
}
}
@@ -118,7 +119,7 @@ void View::mouseReleaseEvent(QMouseEvent *event)
void View::showInformation(ImageItem *image)
{
int id = image->id();
- if (id < 0 || id >= officeTable->rowCount())
+ if (id < 0 || id >= itemTable->rowCount())
return;
InformationWindow *window = findWindow(id);
@@ -129,7 +130,7 @@ void View::showInformation(ImageItem *image)
window->show();
} else {
InformationWindow *window;
- window = new InformationWindow(id, officeTable, this);
+ window = new InformationWindow(id, itemTable, this);
connect(window, SIGNAL(imageChanged(int,QString)),
this, SLOT(updateImage(int,QString)));
diff --git a/examples/sql/drilldown/view.h b/examples/sql/drilldown/view.h
index 21193b1960..c9fc040bb1 100644
--- a/examples/sql/drilldown/view.h
+++ b/examples/sql/drilldown/view.h
@@ -53,7 +53,7 @@ class View : public QGraphicsView
Q_OBJECT
public:
- View(const QString &offices, const QString &images, QWidget *parent = 0);
+ View(const QString &items, const QString &images, QWidget *parent = 0);
protected:
void mouseReleaseEvent(QMouseEvent *event);
@@ -73,7 +73,7 @@ private:
QGraphicsScene *scene;
QList<InformationWindow *> informationWindows;
//! [2] //! [3]
- QSqlRelationalTableModel *officeTable;
+ QSqlRelationalTableModel *itemTable;
};
//! [3]
diff --git a/examples/tools/doc/src/customtype.qdoc b/examples/tools/doc/src/customtype.qdoc
index 56172a4e26..6e6d08fb35 100644
--- a/examples/tools/doc/src/customtype.qdoc
+++ b/examples/tools/doc/src/customtype.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example tools/customtype
+ \example customtype
\title Custom Type Example
\brief The Custom Type example shows how to integrate a custom type into Qt's
diff --git a/examples/widgets/doc/images/orientation-landscape-ui.png b/examples/widgets/doc/images/orientation-landscape-ui.png
deleted file mode 100644
index c591ff14d2..0000000000
--- a/examples/widgets/doc/images/orientation-landscape-ui.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/doc/images/orientation-landscape.png b/examples/widgets/doc/images/orientation-landscape.png
deleted file mode 100644
index e606804d21..0000000000
--- a/examples/widgets/doc/images/orientation-landscape.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/doc/images/orientation-portrait-ui.png b/examples/widgets/doc/images/orientation-portrait-ui.png
deleted file mode 100644
index 304835b93e..0000000000
--- a/examples/widgets/doc/images/orientation-portrait-ui.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/doc/images/orientation-portrait.png b/examples/widgets/doc/images/orientation-portrait.png
deleted file mode 100644
index 3d778e8d90..0000000000
--- a/examples/widgets/doc/images/orientation-portrait.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/doc/orientation.qdoc b/examples/widgets/doc/orientation.qdoc
deleted file mode 100644
index df84595885..0000000000
--- a/examples/widgets/doc/orientation.qdoc
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*! \example widgets/orientation
- \title Orientation Example
-
- \brief The example shows a simple way to use different UIs depending on the screen
- orientation of a mobile device.
-
- \image orientation-landscape.png The UI in landscape mode
- \image orientation-portrait.png The UI in portrait mode
-
- The screen on many mobile devices can be viewed in both portrait and
- landscape orientation. The orientation can be swiched with the help of a
- hardware or software trigger. Due to the often small physical screen size,
- user interfaces has to be very simple and compact to stay usable, and
- applications usually occupy the whole screen. Designing a user interface
- that works equally well in both landscape and portrait mode is not always
- possible, however, so making a different layout for each case usually pays
- off.
-
- The example application makes use of two different UI widgets created with
- the Qt Designer, one for portrait and one for landscape orientation. The
- application has a widget that contains an image and the user is able to
- select one of three images for it to show. In addition to the two UIs, the
- application consists of a \c MainWindow class.
-
- \section1 Landscape UI
-
- If the screen is in landscape mode, the user probably holds the device with
- both hands and is ready to give full attention to the application. The
- landscape UI looks like this:
-
- \image orientation-landscape-ui.png The landscape UI
-
- To the left is a QWidget called \c choiceWidget, which will show the
- current image, and to the right are three QRadioButton instances. The
- active radio button specifies the image to show.
-
- \section1 Portrait UI
-
- When the device is in portrait mode, it usually means that the user holds
- it with one hand, and can comfortably use the thumb for small amounts of
- input. The layout is simpler, and is focused on consuming content. The
- portrait UI looks like this:
-
- \image orientation-portrait-ui.png The portrait UI
-
- Similarly, it contains a QWidget, also called \c choiceWidget, that will
- show the current image. In contrast to the landscape UI, this one doesn't
- provide any controls to change the image.
-
- \section1 MainWindow Class Definition
-
- \c MainWindow inherits from QWidget and acts as the top level widget of the
- application.
-
- \snippet widgets/orientation/mainwindow.h 0
-
- The \c resizeEvent() method is re-implemented, and used to check which
- UI to show. The \c onRadioButtonClicked() slot is connected to the
- landscape UI's radio button group and selects the current image.
-
- \c landscapeWidget and \c portraitWidget will contain the UI layouts. Only
- one of them is visible at a time.
-
- \section1 MainWindow Class Implementation
-
- In the constructor, the widgets that will hold the UIs are created and set
- up.
-
- \snippet widgets/orientation/mainwindow.cpp 0
-
- Since the exit buttons on the layouts are different from each other, both
- of them have to have their \c clicked() signal connected to the \c close()
- slot of the main widget. The first image is also made current with the call
- to \c onRadioButtonClicked().
-
- \snippet widgets/orientation/mainwindow.cpp 1
-
- On the Maemo platform, windows are stuck in landscape mode by default. The
- application has to explicitly say that rotation is supported.
-
- \snippet widgets/orientation/mainwindow.cpp 2
-
- The \c resizeEvent() is called when the main window is first created, and
- also whenever the window has been resized. If the window is shown in
- full screen, this is an indication that the orientation of the screen has
- changed.
-
- The dimensions of \c landscapeWidget is the transpose of the dimensions of
- \c portraitWidget. When the orientation is known, both are set to the
- (possibly transposed) size of the window. Depending on the orientation, one
- widget is made visible and the other invisible.
-
- \snippet widgets/orientation/mainwindow.cpp 3
-
- When the user selects one of the radio buttons in the landscape UI, the
- current image is changed. The image is displayed by specifying the
- background style of the choice widget. Since both \c portrait and
- \c landscape have a \c choiceWidget of their own, the change has to be
- reflected in both instances.
-
- \snippet widgets/orientation/mainwindow.cpp 4
-
- Synchronizing both UIs like this might become unfeasible when there are
- many things that can change. In that case it is better to make use of the
- \l{Introduction to Model/View Programming}{Model-View-Controller pattern}
- more extensively and share the content between both portrait and landscape
- widgets. Then an interface for displaying and manipulating it can be tailor
- made for both orientations.
-
- \section1 The \c main() Function
-
- The main function creates a \c MainWindow instance and shows it full
- screen.
- \snippet widgets/orientation/main.cpp 0
-*/
diff --git a/examples/widgets/doc/src/applicationicon.qdoc b/examples/widgets/doc/src/applicationicon.qdoc
deleted file mode 100644
index 8f9e133e9c..0000000000
--- a/examples/widgets/doc/src/applicationicon.qdoc
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*! \example widgets/applicationicon
- \title Application Icon Example
-
- \brief The example shows how to add an application icon to a mobile application.
-
- \image appicon_screenshot.png The icon on a Nokia XPressMusic 5800
-
- \section1 Adding the icons to the project
-
- For Maemo, we need to add that the \c .desktop and icon file should be
- installed.
-
- \quotefile widgets/applicationicon/applicationicon.pro
-
- Currently, Qt Creator doesn't include the icon and desktop files in the
- application package for Maemo, merely the executable file is included. As a
- workaround for this, the files can be added manually in the Projects tab.
- In the "Create Package" build step for the Maemo target, the \c .desktop
- file and icon can be added to be a part of the package contents.
- Unfortunately, these additions are only stored as a part of the
- \c .pro.user file. This issue will be resolved in a future release of
- Qt Creator.
-
- \image appicon_packagecontents.png Manual addition of files to the "Create Package" build step
-*/
diff --git a/examples/widgets/widgets/applicationicon/applicationicon.png b/examples/widgets/widgets/applicationicon/applicationicon.png
deleted file mode 100644
index 83a186ee56..0000000000
--- a/examples/widgets/widgets/applicationicon/applicationicon.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/widgets/applicationicon/applicationicon.pro b/examples/widgets/widgets/applicationicon/applicationicon.pro
deleted file mode 100644
index 19f8ac28f7..0000000000
--- a/examples/widgets/widgets/applicationicon/applicationicon.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-
-QT += core gui widgets
-
-TARGET = applicationicon
-TEMPLATE = app
-
-SOURCES += main.cpp
-
-OTHER_FILES += applicationicon.svg \
- applicationicon.png \
- applicationicon.desktop
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/applicationicon
-INSTALLS += target
diff --git a/examples/widgets/widgets/applicationicon/applicationicon.svg b/examples/widgets/widgets/applicationicon/applicationicon.svg
deleted file mode 100644
index aa2835b08f..0000000000
--- a/examples/widgets/widgets/applicationicon/applicationicon.svg
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" baseProfile="tiny" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 44 44">
- <defs>
- <linearGradient id="linearGradient2824" y2="1051.4" gradientUnits="userSpaceOnUse" x2="30.217" y1="1009.4" x1="15.109">
- <stop stop-color="#41a200" offset="0"/>
- <stop stop-color="#9be948" offset="0.63897"/>
- <stop stop-color="#beff61" offset="1"/>
- </linearGradient>
- <linearGradient id="linearGradient2848" y2="1009.4" gradientUnits="userSpaceOnUse" y1="1053.7" gradientTransform="matrix(0.85714286,0,0,0.85714286,2.1428572,146.19467)" x2="15.085" x1="31.027">
- <stop stop-color="#41a200" offset="0"/>
- <stop stop-color="#9be948" offset="0.88602"/>
- <stop stop-color="#beff61" offset="1"/>
- </linearGradient>
- </defs>
- <g id="layer1" transform="translate(0,-1008.3622)">
- <path id="rect2816" d="m8.412,1009h27.18c4.106,0,7.412,3.306,7.412,7.412v27.18c0,4.106-3.306,7.412-7.412,7.412h-27.18c-4.106,0-7.412-3-7.412-7v-27.18c0-4.106,3.306-7.412,7.412-7.412z" stroke-linecap="round" stroke-miterlimit="4" stroke-width="0.64300001" fill="url(#linearGradient2824)"/>
- <path id="rect2816-4" d="m9.353,1011h25.29c3.52,0,6.353,2.833,6.353,6.353v25.29c0,3.519-2.833,6.353-6.353,6.353h-25.29c-3.52-0.1-6.353-2.1-6.353-6.1v-25.29c0-3.519,2.833-6.353,6.353-6.353z" stroke-linecap="round" stroke-miterlimit="4" stroke-width="0.64300001" fill="url(#linearGradient2848)"/>
- <g id="text2893" font-weight="normal" transform="translate(-1.100281,1010.3622)" font-style="normal" font-stretch="normal" font-size="48px" font-variant="normal" font-family="Cambria Math" fill="#e5ffd5">
- <path id="path2908" fill="#e5ffd5" d="m11.92,35.44c1.359-1.719,2.672-3.828,3.938-6.328l7.522-14.742c-0.8-3.13-1.54-5.321-2.24-6.586-0.69-1.266-1.76-1.899-3.2-1.899-1.328,0.0000307-2.594,0.6563-3.797,1.969l-1.148-1.266c2.156-2.359,4.289-3.539,6.398-3.539,1.469,0.0000335,2.609,0.418,3.422,1.254,0.8125,0.836,1.492,2.168,2.039,3.996,0.5469,1.828,1.32,5.359,2.32,10.59,1.297,6.828,2.309,11.14,3.035,12.93,0.7265,1.789,1.59,2.684,2.59,2.684,0.7187,0.000002,1.383-0.25,1.992-0.75l0.8906,1.406c-1.547,1.203-2.938,1.805-4.172,1.805-1.75,0-3-0.8984-3.75-2.695-0.75-1.797-1.797-6.633-3.141-14.51h-0.1406c-2.658,5.391-5.258,11.001-7.798,16.831h-4.758z"/>
- </g>
- </g>
-</svg> \ No newline at end of file
diff --git a/examples/widgets/widgets/applicationicon/main.cpp b/examples/widgets/widgets/applicationicon/main.cpp
deleted file mode 100644
index 6fb2518d98..0000000000
--- a/examples/widgets/widgets/applicationicon/main.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtWidgets/QApplication>
-#include <QtWidgets/QLabel>
-
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
- QLabel label(QObject::tr("Hello, world!"));
- label.show();
- return a.exec();
-}
diff --git a/examples/widgets/widgets/orientation/image_a.png b/examples/widgets/widgets/orientation/image_a.png
deleted file mode 100644
index 4a1a0d3252..0000000000
--- a/examples/widgets/widgets/orientation/image_a.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/widgets/orientation/image_b.png b/examples/widgets/widgets/orientation/image_b.png
deleted file mode 100644
index 8722d1edee..0000000000
--- a/examples/widgets/widgets/orientation/image_b.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/widgets/orientation/image_c.png b/examples/widgets/widgets/orientation/image_c.png
deleted file mode 100644
index 6c9304fda0..0000000000
--- a/examples/widgets/widgets/orientation/image_c.png
+++ /dev/null
Binary files differ
diff --git a/examples/widgets/widgets/orientation/images.qrc b/examples/widgets/widgets/orientation/images.qrc
deleted file mode 100644
index b258291e6f..0000000000
--- a/examples/widgets/widgets/orientation/images.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>image_a.png</file>
- <file>image_b.png</file>
- <file>image_c.png</file>
- </qresource>
-</RCC>
diff --git a/examples/widgets/widgets/orientation/landscape.ui b/examples/widgets/widgets/orientation/landscape.ui
deleted file mode 100644
index 4616c041dc..0000000000
--- a/examples/widgets/widgets/orientation/landscape.ui
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>LandscapeUI</class>
- <widget class="QWidget" name="LandscapeUI">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>514</width>
- <height>265</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0" colspan="2">
- <widget class="QLabel" name="label">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="styleSheet">
- <string notr="true">font-weight: bold;</string>
- </property>
- <property name="text">
- <string>Landscape mode</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QPushButton" name="exitButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Exit</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QGroupBox" name="groupBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Choices</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QRadioButton" name="radioAButton">
- <property name="text">
- <string>Long description explaining choice A</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <attribute name="buttonGroup">
- <string>buttonGroup</string>
- </attribute>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="radioBButton">
- <property name="text">
- <string>Long description explaining choice B</string>
- </property>
- <attribute name="buttonGroup">
- <string>buttonGroup</string>
- </attribute>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="radioCButton">
- <property name="text">
- <string>Long description explaining choice C</string>
- </property>
- <attribute name="buttonGroup">
- <string>buttonGroup</string>
- </attribute>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QWidget" name="choiceWidget" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
- <buttongroups>
- <buttongroup name="buttonGroup"/>
- </buttongroups>
-</ui>
diff --git a/examples/widgets/widgets/orientation/main.cpp b/examples/widgets/widgets/orientation/main.cpp
deleted file mode 100644
index 53ac2d4782..0000000000
--- a/examples/widgets/widgets/orientation/main.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtWidgets/QApplication>
-#include "mainwindow.h"
-
-//! [0]
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
-
- MainWindow w;
- w.showFullScreen();
-
- return a.exec();
-}
-//! [0]
-
diff --git a/examples/widgets/widgets/orientation/mainwindow.cpp b/examples/widgets/widgets/orientation/mainwindow.cpp
deleted file mode 100644
index 4c48f2d845..0000000000
--- a/examples/widgets/widgets/orientation/mainwindow.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindow.h"
-#include "ui_landscape.h"
-#include "ui_portrait.h"
-
-#include <QDesktopWidget>
-#include <QResizeEvent>
-
-//! [0]
-MainWindow::MainWindow(QWidget *parent) :
- QWidget(parent),
- landscapeWidget(0),
- portraitWidget(0)
-{
- landscapeWidget = new QWidget(this);
- landscape.setupUi(landscapeWidget);
-
- portraitWidget = new QWidget(this);
- portrait.setupUi(portraitWidget);
-//! [0]
-
-//! [1]
- connect(portrait.exitButton, SIGNAL(clicked()), this, SLOT(close()));
- connect(landscape.exitButton, SIGNAL(clicked()), this, SLOT(close()));
- connect(landscape.buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)),
- this, SLOT(onRadioButtonClicked(QAbstractButton*)));
-
- landscape.radioAButton->setChecked(true);
- onRadioButtonClicked(landscape.radioAButton);
-//! [1]
-
-//! [2]
-}
-//! [2]
-
-//! [3]
-void MainWindow::resizeEvent(QResizeEvent *event)
-{
- QSize size = event->size();
- bool isLandscape = size.width() > size.height();
-
- if (!isLandscape)
- size.transpose();
-
- landscapeWidget->setFixedSize(size);
- size.transpose();
- portraitWidget->setFixedSize(size);
-
- landscapeWidget->setVisible(isLandscape);
- portraitWidget->setVisible(!isLandscape);
-}
-//! [3]
-
-//! [4]
-void MainWindow::onRadioButtonClicked(QAbstractButton *button)
-{
- QString styleTemplate = "background-image: url(:/image_%1.png);"
- "background-repeat: no-repeat;"
- "background-position: center center";
-
- QString imageStyle("");
- if (button == landscape.radioAButton)
- imageStyle = styleTemplate.arg("a");
- else if (button == landscape.radioBButton)
- imageStyle = styleTemplate.arg("b");
- else if (button == landscape.radioCButton)
- imageStyle = styleTemplate.arg("c");
-
- portrait.choiceWidget->setStyleSheet(imageStyle);
- landscape.choiceWidget->setStyleSheet(imageStyle);
-}
-//! [4]
-
diff --git a/examples/widgets/widgets/orientation/mainwindow.h b/examples/widgets/widgets/orientation/mainwindow.h
deleted file mode 100644
index c1705804ec..0000000000
--- a/examples/widgets/widgets/orientation/mainwindow.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QWidget>
-
-#include "ui_landscape.h"
-#include "ui_portrait.h"
-
-QT_BEGIN_NAMESPACE
-class QAbstractButton;
-QT_END_NAMESPACE
-
-//! [0]
-class MainWindow : public QWidget
-{
- Q_OBJECT
-
-public:
- MainWindow(QWidget *parent = 0);
-
-protected:
- void resizeEvent(QResizeEvent *event);
-
-private slots:
- void onRadioButtonClicked(QAbstractButton *button);
-
-private:
- Ui::LandscapeUI landscape;
- Ui::PortraitUI portrait;
- QWidget *landscapeWidget;
- QWidget *portraitWidget;
-};
-//! [0]
-
-#endif // MAINWINDOW_H
diff --git a/examples/widgets/widgets/orientation/orientation.pro b/examples/widgets/widgets/orientation/orientation.pro
deleted file mode 100644
index 47cea596d1..0000000000
--- a/examples/widgets/widgets/orientation/orientation.pro
+++ /dev/null
@@ -1,29 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2010-08-04T10:27:31
-#
-#-------------------------------------------------
-
-QT += core gui widgets
-
-TARGET = orientation
-TEMPLATE = app
-
-
-SOURCES += main.cpp\
- mainwindow.cpp
-
-HEADERS += mainwindow.h
-
-FORMS += \
- portrait.ui \
- landscape.ui
-
-RESOURCES += \
- images.qrc
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/orientation
-INSTALLS += target
-
-simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/widgets/widgets/orientation/portrait.ui b/examples/widgets/widgets/orientation/portrait.ui
deleted file mode 100644
index 31a55aff73..0000000000
--- a/examples/widgets/widgets/orientation/portrait.ui
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PortraitUI</class>
- <widget class="QWidget" name="PortraitUI">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>201</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="styleSheet">
- <string notr="true">font-weight: bold;</string>
- </property>
- <property name="text">
- <string>Portrait mode</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QPushButton" name="exitButton">
- <property name="text">
- <string>Exit</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="helpLabel">
- <property name="text">
- <string>Switch to landscape mode. In landscape mode you can change visible image.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QWidget" name="choiceWidget" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/examples/widgets/widgets/widgets.pro b/examples/widgets/widgets/widgets.pro
index de1cc81ea6..8d9e15a7e8 100644
--- a/examples/widgets/widgets/widgets.pro
+++ b/examples/widgets/widgets/widgets.pro
@@ -1,6 +1,5 @@
TEMPLATE = subdirs
SUBDIRS = analogclock \
- applicationicon \
calculator \
calendarwidget \
charactermap \
@@ -13,7 +12,6 @@ SUBDIRS = analogclock \
lineedits \
movie \
mousebuttons \
- orientation \
scribble \
shapedclock \
sliders \
diff --git a/examples/xml/doc/src/qxmlstreambookmarks.qdoc b/examples/xml/doc/src/qxmlstreambookmarks.qdoc
index fa1541608d..123058b02d 100644
--- a/examples/xml/doc/src/qxmlstreambookmarks.qdoc
+++ b/examples/xml/doc/src/qxmlstreambookmarks.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example xml/streambookmarks
+ \example streambookmarks
\title QXmlStream Bookmarks Example
\brief Demonstrates how to read and write to XBEL files
\ingroup xml-examples
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
index d1b94bb1aa..5a056b3d00 100644
--- a/mkspecs/android-g++/qmake.conf
+++ b/mkspecs/android-g++/qmake.conf
@@ -27,6 +27,10 @@ contains(QMAKE_HOST.os,Windows) {
} else {
MINGW_IN_SHELL = 1
QMAKE_DIR_SEP = /
+ # Because install's ability to set permissions is not relevant on Windows,
+ # and git's msys does not provide it to start with.
+ QMAKE_INSTALL_FILE = cp -f
+ QMAKE_INSTALL_PROGRAM = cp -f
}
}
diff --git a/mkspecs/common/ios/clang.conf b/mkspecs/common/ios/clang.conf
index 5da7e5a233..8da555e6fa 100644
--- a/mkspecs/common/ios/clang.conf
+++ b/mkspecs/common/ios/clang.conf
@@ -1,10 +1,6 @@
#
# compiler settings for iOS clang compilers
#
-# Depends on:
-#
-# QMAKE_XCODE_VERSION - set in xcode.conf
-#
# iOS build flags
QMAKE_IOS_CFLAGS += -fvisibility=hidden -fpascal-strings -fmessage-length=0
@@ -24,9 +20,6 @@ QMAKE_IOS_CFLAGS += -Wno-missing-field-initializers -Wno-missing-prototype
QMAKE_IOS_CXXFLAGS += -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors
QMAKE_IOS_OBJ_CFLAGS += -Wno-deprecated-implementations -Wprotocol -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector
-# Warn about unsupported (later than 4.5) Xcode versions
-!lessThan(QMAKE_XCODE_VERSION, "4.7"): warning("The version of Xcode installed on this system is not recognised - custom compiler settings may be necessary")
-
# Set build flags
QMAKE_CFLAGS += $$QMAKE_IOS_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_IOS_CFLAGS $$QMAKE_IOS_CXXFLAGS
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index f31db3bb4b..cf54f3f580 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -26,7 +26,4 @@ QMAKE_LIBS_THREAD =
QMAKE_AR = ar cq
QMAKE_RANLIB = ranlib -s
-# We rely on Xcode to build
-include(xcode.conf)
-
include(unix.conf)
diff --git a/mkspecs/common/xcode.conf b/mkspecs/common/xcode.conf
deleted file mode 100644
index b15266b678..0000000000
--- a/mkspecs/common/xcode.conf
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# qmake configuration for Xcode
-#
-
-# Get path of Xcode's Developer directory
-QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
-isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
- error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
-
-# Make sure Xcode path is valid
-!exists($$QMAKE_XCODE_DEVELOPER_PATH): \
- error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
-
-# Make sure Xcode is set up properly
-isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
- error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
-
-# Extract Xcode version using xcodebuild
-xcode_version = $$system("/usr/bin/xcodebuild -version")
-QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
-unset(xcode_version)
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index a9757acd17..3dae3895de 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -41,6 +41,8 @@ contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
}
+!exists($$first(QT.$${MODULE}.private_includes)): CMAKE_NO_PRIVATE_INCLUDES = true
+
CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf
index be972e0864..8eb6f3263e 100644
--- a/mkspecs/features/ctest_testcase.prf
+++ b/mkspecs/features/ctest_testcase.prf
@@ -57,7 +57,8 @@ isEmpty(CMAKE_VERSION) {
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
dependentmodules = $$cmakeModuleList($$dependentmodules)
- contains(QT_CONFIG, angle): CMAKE_ANGLE_DEFINE = -DQT_WITH_ANGLE=True
+ contains(QT_CONFIG, angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
+ !contains(QT_CONFIG, egl): CMAKE_GL_DEFINES += -DNO_EGL=True
CMAKE_MODULE_VERSIONS =
CMAKE_MODULES_UNDER_TEST =
@@ -76,7 +77,7 @@ isEmpty(CMAKE_VERSION) {
cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR \
-DCMAKE_VERBOSE_MAKEFILE=1 \
$$CMAKE_MODULE_DEFINES \
- $$CMAKE_ANGLE_DEFINE \
+ $$CMAKE_GL_DEFINES \
-DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} \
-DCMAKE_PREFIX_PATH=$$CMAKE_PREFIX_PATH \
-DQt5_MODULE_TEST_DEPENDS=\"$${dependentmodules}\" \
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index a77a6bd22d..f6fd61602f 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -28,28 +28,48 @@ set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION)
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
+macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists file)
+ if(NOT EXISTS \"${file}\" )
+ message(FATAL_ERROR \"The imported target \\\"Qt5::$${CMAKE_MODULE_NAME}\\\" references the file
+ \\\"${file}\\\"
+but this file does not exist. Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+ \\\"${CMAKE_CURRENT_LIST_FILE}\\\"
+but not all the files it references.
+\")
+ endif()
+endmacro()
+
+
macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
- \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- \"IMPORTED_LOCATION_${Configuration}\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\"
+ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
!!ELSE
- \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\"
+ set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
!!ENDIF
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+ \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+ \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
!!IF !isEmpty(CMAKE_LIB_SONAME)
\"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
!!ENDIF
)
+
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
- if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- \"IMPORTED_IMPLIB_${Configuration}\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\"
+ set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ELSE
- \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\"
+ set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ENDIF
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
+ if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
+ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+ \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
)
endif()
!!ENDIF
@@ -60,21 +80,34 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !no_module_headers
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
+!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}/$${MODULE_INCNAME}\"
)
!!ELSE
+ set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+!!ENDIF
+!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
+!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}\"
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}/$${MODULE_INCNAME}\"
)
+!!ELSE
+ set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+!!ENDIF
!!ENDIF
!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
!!ENDIF
+
+ foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS} ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS})
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir})
+ endforeach()
+
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE})
@@ -215,4 +248,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
!!ENDIF
+_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
+
endif()
diff --git a/mkspecs/features/ios/default_pre.prf b/mkspecs/features/ios/default_pre.prf
index e2956bd77d..fa0245aa2c 100644
--- a/mkspecs/features/ios/default_pre.prf
+++ b/mkspecs/features/ios/default_pre.prf
@@ -2,3 +2,9 @@
unset(MAKEFILE_GENERATOR)
load(default_pre)
+
+# Check for supported Xcode versions
+lessThan(QMAKE_XCODE_VERSION, "4.3"): \
+ error("This mkspec requires Xcode 4.3 or later")
+!lessThan(QMAKE_XCODE_VERSION, "4.7"): \
+ warning("The version of Xcode installed on this system is not recognized - custom compiler settings may be necessary")
diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf
index 25f6e66427..7360103757 100644
--- a/mkspecs/features/java.prf
+++ b/mkspecs/features/java.prf
@@ -7,6 +7,11 @@ android {
isEmpty(API_VERSION): API_VERSION = android-10
}
+ isEmpty(BUILD_TOOLS_REVISION) {
+ BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION)
+ isEmpty(BUILD_TOOLS_REVISION): BUILD_TOOLS_REVISION = 17.0.0
+ }
+
!exists($$SDK_ROOT/platforms/$$API_VERSION/android.jar) {
error("The Path $$SDK_ROOT/platforms/$$API_VERSION/android.jar does not exist. Make sure the ANDROID_SDK_ROOT and ANDROID_API_VERSION environment variables are correctly set.")
}
@@ -56,7 +61,9 @@ android:!bundled_jar_file {
DEX_CMD = $$PWD/data/android/dx $$SDK_ROOT
} else {
DEX_CMD = $$SDK_ROOT/platform-tools/dx
+ !exists($$DEX_CMD): DEX_CMD = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx
}
+ !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.")
QMAKE_LINK_SHLIB_CMD = $$DEX_CMD --dex --output $(TARGET) $$CLASS_DIR
} else {
QMAKE_LINK_SHLIB_CMD = jar cf $(TARGET) -C $$CLASS_DIR .
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 437e3d93e4..0538a81771 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -16,6 +16,14 @@ qt:!isEmpty(QT_CONFIG) {
}
}
+isEmpty(_QMAKE_CACHE_) {
+ warning("No .qmake.cache is present. This significantly slows down qmake with this makespec.")
+ warning("Call 'cache()' in the top-level project file to rectify this problem.")
+} else {
+ cache(QMAKE_XCODE_DEVELOPER_PATH)
+ cache(QMAKE_XCODE_VERSION)
+}
+
# Ensure that we process sdk.prf first, as it will update QMAKE_CXX
# and friends that other features/extra compilers may depend on.
sdk: load(sdk)
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index 81e1d061f8..e535c4d9e9 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -1,3 +1,25 @@
CONFIG = sdk rez $$CONFIG
load(default_pre)
+isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
+ # Get path of Xcode's Developer directory
+ QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
+ isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
+ error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
+
+ # Make sure Xcode path is valid
+ !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
+ error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
+
+ # Make sure Xcode is set up properly
+ isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
+ error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
+}
+
+isEmpty(QMAKE_XCODE_VERSION) {
+ # Extract Xcode version using xcodebuild
+ xcode_version = $$system("/usr/bin/xcodebuild -version")
+ QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+ isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+ unset(xcode_version)
+}
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index f5b1639a5d..0da0b65d41 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -5,8 +5,13 @@ isEmpty(QMAKE_MAC_SDK): \
contains(QMAKE_MAC_SDK, .*/.*): \
error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
-QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
-isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
+isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
+ QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
+ isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
+ !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set, QMAKE_MAC_SDK_PATH)
+} else {
+ QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)
+}
!equals(MAKEFILE_GENERATOR, XCODE) {
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
@@ -21,6 +26,11 @@ QMAKE_INCDIR_OPENGL = $$sysrootified
# Resolve SDK version of various tools
for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB)) {
+ !isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.$${tool}) {
+ $$tool = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.$${tool})
+ next()
+ }
+
value = $$eval($$tool)
isEmpty(value): next()
@@ -28,15 +38,21 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
isEmpty(sysrooted): next()
$$tool = $$sysrooted $$member(value, 1, -1)
+ !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.$${tool}, set, $$tool)
}
-# We use xml as the output format instead of json since plutil on 10.6 does not have that option
-QMAKE_MAC_PLATFORM_NAME = $$system("/usr/bin/plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - 2>/dev/null | " \
- "sed '/^<!DOCTYPE/d' | " \ # Don't look up http://www.apple.com/DTDs/PropertyList-1.0.dtd
- "PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>/dev/null | " \
- "sed 's/.*Value: \\(.*\\)/\\1/'")
+isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
+ # We use xml as the output format instead of json since plutil on 10.6 does not have that option
+ QMAKE_MAC_PLATFORM_NAME = $$system("/usr/bin/plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - 2>/dev/null | " \
+ "sed '/^<!DOCTYPE/d' | " \ # Don't look up http://www.apple.com/DTDs/PropertyList-1.0.dtd
+ "PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>/dev/null | " \
+ "sed 's/.*Value: \\(.*\\)/\\1/'")
-isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
+ isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
+ !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set, QMAKE_MAC_PLATFORM_NAME)
+} else {
+ QMAKE_MAC_PLATFORM_NAME = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name)
+}
!equals(MAKEFILE_GENERATOR, XCODE) {
# FIXME: Get the version_min_flag out of the platform's 'Native Build System.xcspec'
diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf
index ba37649201..c258d55687 100644
--- a/mkspecs/features/qt_android_deps.prf
+++ b/mkspecs/features/qt_android_deps.prf
@@ -43,7 +43,10 @@ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
!isEmpty(ANDROID_LIB_DEPENDENCIES) {
for(LIB_FILE, ANDROID_LIB_DEPENDENCIES) {
- FILE_CONTENT += "<lib file=\"$$LIB_FILE\" />"
+ EXTENDS = $$section(LIB_FILE, ":", 1, 1)
+ !isEmpty(EXTENDS): EXTENDS = "extends=\"$$EXTENDS\""
+ LIB_FILE = $$section(LIB_FILE, ":", 0, 0)
+ FILE_CONTENT += "<lib file=\"$$LIB_FILE\" $$EXTENDS />"
}
}
diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf
index 061399d78c..77d2c0ffc7 100644
--- a/mkspecs/features/qt_config.prf
+++ b/mkspecs/features/qt_config.prf
@@ -20,6 +20,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
# qt_<module>.pri forwarding file
QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS]
QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS]
+ QT_MODULE_HOST_LIB_BASE = $$[QT_HOST_LIBS]
QT_MODULE_PLUGIN_BASE = $$[QT_INSTALL_PLUGINS]
QT_MODULE_LIBEXEC_BASE = $$[QT_INSTALL_LIBEXECS]
QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS]
@@ -30,6 +31,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
}
unset(QT_MODULE_INCLUDE_BASE)
unset(QT_MODULE_LIB_BASE)
+ unset(QT_MODULE_HOST_LIB_BASE)
unset(QT_MODULE_PLUGIN_BASE)
unset(QT_MODULE_LIBEXEC_BASE)
unset(QT_MODULE_BIN_BASE)
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 8cd2473224..9ec22d57db 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -194,12 +194,10 @@ defineTest(qtPrepareTool) {
$$1 = $$eval(QT_TOOL.$${2}.command)
isEmpty($$1) {
$$1 = $$[QT_HOST_BINS]/$$2
- contains(QMAKE_HOST.os, Windows):!contains($$1, .*\\.(exe|bat)$) {
- exists($$eval($$1).bat) {
- $$1 = $$eval($$1).bat
- } else {
- $$1 = $$eval($$1).exe
- }
+ exists($$eval($$1).pl) {
+ $$1 = perl -w $$eval($$1).pl
+ } else: contains(QMAKE_HOST.os, Windows) {
+ $$1 = $$eval($$1).exe
} else:contains(QMAKE_HOST.os, Darwin) {
BUNDLENAME = $$eval($$1).app/Contents/MacOS/$$2
exists($$BUNDLENAME) {
diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
index cc720ac8c0..e82b499009 100644
--- a/mkspecs/features/qt_installs.prf
+++ b/mkspecs/features/qt_installs.prf
@@ -12,10 +12,16 @@
#library
!qt_no_install_library {
win32 {
- dlltarget.path = $$[QT_INSTALL_BINS]
+ host_build: \
+ dlltarget.path = $$[QT_HOST_BINS]
+ else: \
+ dlltarget.path = $$[QT_INSTALL_BINS]
INSTALLS += dlltarget
}
- target.path = $$[QT_INSTALL_LIBS]
+ host_build: \
+ target.path = $$[QT_HOST_LIBS]
+ else: \
+ target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target
}
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 3531d28b42..429e00bed9 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -128,7 +128,10 @@ load(qt_installs)
unix|win32-g++* {
CONFIG += create_pc
- QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
+ host_build: \
+ QMAKE_PKGCONFIG_LIBDIR = $$[QT_HOST_LIBS]
+ else: \
+ QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
@@ -139,14 +142,14 @@ unix|win32-g++* {
include_replace.match = $$rplbase/include
include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
lib_replace.match = $$rplbase/lib
- lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+ lib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR
QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace
QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
}
unix {
CONFIG += create_libtool explicitlib
- QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
+ QMAKE_LIBTOOL_LIBDIR = $$QMAKE_PKGCONFIG_LIBDIR
QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
}
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index bedcfd4c47..9e40a67b51 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -19,10 +19,18 @@ else: \
!build_pass {
# Create a module .pri file
- unix:!static: \
- module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]"
+ host_build: \
+ module_libs = "\$\$QT_MODULE_HOST_LIB_BASE"
else: \
+ module_libs = "\$\$QT_MODULE_LIB_BASE"
+ unix:!static {
+ host_build: \
+ module_rpath = "QT.$${MODULE}.rpath = $$[QT_HOST_LIBS]"
+ else: \
+ module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]"
+ } else {
module_rpath =
+ }
!isEmpty(QT_FOR_PRIVATE) {
contains(QT_FOR_PRIVATE, .*-private$):error("QT_FOR_PRIVATE may not contain *-private.")
module_privdep = "QT.$${MODULE}.private_depends = $$QT_FOR_PRIVATE"
@@ -55,15 +63,17 @@ else: \
"QT.$${MODULE}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \
"" \
"QT.$${MODULE}.name = $$TARGET" \
- "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \
+ "QT.$${MODULE}.libs = $$module_libs" \
+ $$module_rpath \
+ "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES"
+ !host_build: MODULE_PRI_CONT += \
"QT.$${MODULE}.includes = $$MODULE_INCLUDES" \
- "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" \
- "QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \
+ "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \
"QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \
- $$module_rpath \
"QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \
"QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \
- "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE" \
+ "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE"
+ MODULE_PRI_CONT += \
"QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
$$module_privdep \
$$module_rundep \
@@ -84,6 +94,7 @@ else: \
"QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \
"QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \
"QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
+ "QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
"QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \
"QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \
"include($$MODULE_PRI)"
@@ -99,6 +110,7 @@ else: \
QT_MODULE_IMPORT_BASE = $$[QT_INSTALL_IMPORTS]
QT_MODULE_QML_BASE = $$[QT_INSTALL_QML]
QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS]
+ QT_MODULE_HOST_LIB_BASE = $$[QT_HOST_LIBS]
QT_MODULE_LIBEXEC_BASE = $$[QT_INSTALL_LIBEXECS]
QT_MODULE_PLUGIN_BASE = $$[QT_INSTALL_PLUGINS]
diff --git a/mkspecs/unsupported/macx-ios-clang/qmake.conf b/mkspecs/unsupported/macx-ios-clang/qmake.conf
index 833e22e3bd..3dc2715a5f 100644
--- a/mkspecs/unsupported/macx-ios-clang/qmake.conf
+++ b/mkspecs/unsupported/macx-ios-clang/qmake.conf
@@ -22,6 +22,4 @@ include(../../common/clang-mac.conf)
include(../../common/ios/clang.conf)
include(../../common/ios/qmake.conf)
-lessThan(QMAKE_XCODE_VERSION, "4.3"): error("This mkspec requires Xcode 4.3 or later")
-
load(qt_config)
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 22277e1e82..9c776e8655 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -94,6 +94,10 @@ QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
MINGW_IN_SHELL = 1
QMAKE_DIR_SEP = /
include(../common/shell-unix.conf)
+ # Because install's ability to set permissions is not relevant on Windows,
+ # and git's msys does not provide it to start with.
+ QMAKE_INSTALL_FILE = cp -f
+ QMAKE_INSTALL_PROGRAM = cp -f
} else {
include(../common/shell-win32.conf)
}
diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf
index 6d072242c9..508db2a11c 100644
--- a/mkspecs/win32-msvc2005/qmake.conf
+++ b/mkspecs/win32-msvc2005/qmake.conf
@@ -8,7 +8,11 @@ MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM = win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
DEFINES += UNICODE WIN32
-QMAKE_COMPILER_DEFINES += _MSC_VER=1400 WIN32
+QMAKE_COMPILER_DEFINES += _MSC_VER=1400 _WIN32
+contains(QMAKE_TARGET.arch, x86_64) {
+ DEFINES += WIN64
+ QMAKE_COMPILER_DEFINES += _WIN64
+}
QMAKE_COMPILER = msvc
diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf
index bd9a83a5d1..7d1304aaed 100644
--- a/mkspecs/win32-msvc2008/qmake.conf
+++ b/mkspecs/win32-msvc2008/qmake.conf
@@ -8,7 +8,11 @@ MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM = win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
DEFINES += UNICODE WIN32
-QMAKE_COMPILER_DEFINES += _MSC_VER=1500 WIN32
+QMAKE_COMPILER_DEFINES += _MSC_VER=1500 _WIN32
+contains(QMAKE_TARGET.arch, x86_64) {
+ DEFINES += WIN64
+ QMAKE_COMPILER_DEFINES += _WIN64
+}
QMAKE_COMPILER = msvc
diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf
index f0e44078f9..ebe043ceba 100644
--- a/mkspecs/win32-msvc2010/qmake.conf
+++ b/mkspecs/win32-msvc2010/qmake.conf
@@ -8,7 +8,11 @@ MAKEFILE_GENERATOR = MSBUILD
QMAKE_PLATFORM = win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
DEFINES += UNICODE WIN32
-QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
+QMAKE_COMPILER_DEFINES += _MSC_VER=1600 _WIN32
+contains(QMAKE_TARGET.arch, x86_64) {
+ DEFINES += WIN64
+ QMAKE_COMPILER_DEFINES += _WIN64
+}
QMAKE_COMPILER = msvc
diff --git a/mkspecs/win32-msvc2012/qmake.conf b/mkspecs/win32-msvc2012/qmake.conf
index c9e3f8c8e0..253e11b1d2 100644
--- a/mkspecs/win32-msvc2012/qmake.conf
+++ b/mkspecs/win32-msvc2012/qmake.conf
@@ -5,9 +5,14 @@
#
MAKEFILE_GENERATOR = MSBUILD
+QMAKE_PLATFORM = win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
DEFINES += UNICODE WIN32
-QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
+QMAKE_COMPILER_DEFINES += _MSC_VER=1700 _WIN32
+contains(QMAKE_TARGET.arch, x86_64) {
+ DEFINES += WIN64
+ QMAKE_COMPILER_DEFINES += _WIN64
+}
QMAKE_COMPILER = msvc
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index c88f4e136f..67446b2efe 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -1412,7 +1412,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool)
<< attrTagT(_StringPooling, tool.StringPooling)
<< attrTagS(_StructMemberAlignment, toString(tool.StructMemberAlignment))
<< attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner)
-//unused << attrTagS(_TreatSpecificWarningsAsErrors, tool.TreatSpecificWarningsAsErrors)
+ << attrTagX(_TreatSpecificWarningsAsErrors, tool.TreatSpecificWarningsAsErrors, ";")
<< attrTagT(_TreatWarningAsError, tool.WarnAsError)
<< attrTagT(_TreatWChar_tAsBuiltInType, tool.TreatWChar_tAsBuiltInType)
<< attrTagT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions)
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 6fdd2f4bd2..99f69bfa72 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -779,16 +779,14 @@ bool VCCLCompilerTool::parseOption(const char* option)
found = false; break;
case 'R':
if(second == 'T' && third == 'C') {
- if(fourth == '1')
- BasicRuntimeChecks = runtimeBasicCheckAll;
- else if(fourth == 'c')
- SmallerTypeCheck = _True;
- else if(fourth == 's')
- BasicRuntimeChecks = runtimeCheckStackFrame;
- else if(fourth == 'u')
- BasicRuntimeChecks = runtimeCheckUninitVariables;
- else
- found = false; break;
+ int rtc = BasicRuntimeChecks;
+ for (size_t i = 4; option[i]; ++i) {
+ if (!parseRuntimeCheckOption(option[i], &rtc)) {
+ found = false;
+ break;
+ }
+ }
+ BasicRuntimeChecks = static_cast<basicRuntimeCheckOption>(rtc);
}
break;
case 'T':
@@ -1117,6 +1115,12 @@ bool VCCLCompilerTool::parseOption(const char* option)
case 'd':
DisableSpecificWarnings += option+3;
break;
+ case 'e':
+ if (config->CompilerVersion <= NET2008)
+ AdditionalOptions += option;
+ else
+ TreatSpecificWarningsAsErrors += option + 3;
+ break;
default:
AdditionalOptions += option;
}
@@ -1132,6 +1136,21 @@ bool VCCLCompilerTool::parseOption(const char* option)
return true;
}
+bool VCCLCompilerTool::parseRuntimeCheckOption(char c, int *rtc)
+{
+ if (c == '1')
+ *rtc = runtimeBasicCheckAll;
+ else if (c == 'c')
+ SmallerTypeCheck = _True;
+ else if (c == 's')
+ *rtc |= runtimeCheckStackFrame;
+ else if (c == 'u')
+ *rtc |= runtimeCheckUninitVariables;
+ else
+ return false;
+ return true;
+}
+
// VCLinkerTool -----------------------------------------------------
VCLinkerTool::VCLinkerTool()
: DataExecutionPrevention(unset),
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index c3fae94179..d289afe366 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -106,10 +106,10 @@ enum asmListingOption {
asmListingAsmSrc
};
enum basicRuntimeCheckOption {
- runtimeBasicCheckNone,
- runtimeCheckStackFrame,
- runtimeCheckUninitVariables,
- runtimeBasicCheckAll
+ runtimeBasicCheckNone = 0,
+ runtimeCheckStackFrame = 1,
+ runtimeCheckUninitVariables = 2,
+ runtimeBasicCheckAll = runtimeCheckStackFrame | runtimeCheckUninitVariables
};
enum browseInfoOption {
brInfoNone,
@@ -561,6 +561,7 @@ public:
QStringList UndefinePreprocessorDefinitions;
pchOption UsePrecompiledHeader;
triState UseUnicodeForAssemblerListing;
+ QStringList TreatSpecificWarningsAsErrors;
triState WarnAsError;
warningLevelOption WarningLevel;
triState WholeProgramOptimization;
@@ -579,6 +580,9 @@ public:
QString PreprocessOutputPath;
VCConfiguration* config;
+
+private:
+ bool parseRuntimeCheckOption(char c, int *rtc);
};
class VCLinkerTool : public VCToolBase
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index d3187bacb5..fb4bf08431 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -622,8 +622,6 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
QHash<QString, VcsolutionDepend*> solution_depends;
QList<VcsolutionDepend*> solution_cleanup;
- QString oldpwd = qmake_getpwd();
-
// Make sure that all temp projects are configured
// for release so that the depends are created
// without the debug <lib>dxxx.lib name mangling
@@ -997,7 +995,6 @@ void VcprojGenerator::initCompilerTool()
conf.compiler.Optimization = optimizeDisabled;
}
conf.compiler.AssemblerListingLocation = placement ;
- conf.compiler.ProgramDataBaseFileName = ".\\" ;
conf.compiler.ObjectFile = placement ;
conf.compiler.ExceptionHandling = ehNone;
// PCH
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index ebe26a46e2..b0e3414e46 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -345,7 +345,7 @@ QTextStream &operator<<(QTextStream &t, const ProString &str)
return t;
}
-static QString ProStringList_join(const ProStringList &this_, const QChar *sep, const size_t sepSize)
+static QString ProStringList_join(const ProStringList &this_, const QChar *sep, const int sepSize)
{
int totalLength = 0;
const int sz = this_.size();
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index cd7af34108..13693837b9 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -275,6 +275,7 @@ enum ProToken {
TokRemove, // variable -=
TokReplace, // variable ~=
// previous literal/expansion is a variable manipulation
+ // - lower bound for expected output length (1)
// - value expression + TokValueTerminator
TokValueTerminator, // assignment value terminator
TokLiteral, // literal string (fully dequoted)
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 0dedd64e6e..be0d8ea172 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -195,7 +195,7 @@ static bool isTrue(const ProString &_str, QString &tmp)
return !str.compare(statics.strtrue, Qt::CaseInsensitive) || str.toInt();
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && defined(PROEVALUATOR_FULL)
static QString windowsErrorCode()
{
wchar_t *string = 0;
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index 0515fe1c98..c60119615f 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -1242,10 +1242,11 @@ void QMakeEvaluator::setupProject()
{
setTemplate();
ProValueMap &vars = m_valuemapStack.top();
- vars[ProKey("TARGET")] << ProString(QFileInfo(currentFileName()).baseName());
- vars[ProKey("_PRO_FILE_")] << ProString(currentFileName());
- vars[ProKey("_PRO_FILE_PWD_")] << ProString(currentDirectory());
- vars[ProKey("OUT_PWD")] << ProString(m_outputDir);
+ ProFile *proFile = currentProFile();
+ vars[ProKey("TARGET")] << ProString(QFileInfo(currentFileName()).baseName()).setSource(proFile);
+ vars[ProKey("_PRO_FILE_")] << ProString(currentFileName()).setSource(proFile);
+ vars[ProKey("_PRO_FILE_PWD_")] << ProString(currentDirectory()).setSource(proFile);
+ vars[ProKey("OUT_PWD")] << ProString(m_outputDir).setSource(proFile);
}
void QMakeEvaluator::evaluateCommand(const QString &cmds, const QString &where)
@@ -1356,11 +1357,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
loadDefaults();
}
-#ifdef QT_BUILD_QMAKE
for (ProValueMap::ConstIterator it = m_extraVars.constBegin();
it != m_extraVars.constEnd(); ++it)
m_valuemapStack.first().insert(it.key(), it.value());
-#endif
VisitReturn vr;
@@ -1375,11 +1374,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
evaluateCommand(m_option->precmds, fL1S("(command line)"));
-#ifdef QT_BUILD_QMAKE
// After user configs, to override them
if (!m_extraConfigs.isEmpty())
- evaluateCommand("CONFIG += " + m_extraConfigs.join(' '), fL1S("(extra configs)"));
-#endif
+ evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
}
debugMsg(1, "visiting file %s", qPrintable(pro->fileName()));
@@ -1390,13 +1387,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
if (flags & LoadPostFiles) {
evaluateCommand(m_option->postcmds, fL1S("(command line -after)"));
-#ifdef QT_BUILD_QMAKE
// Again, to ensure the project does not mess with us.
// Specifically, do not allow a project to override debug/release within a
// debug_and_release build pass - it's too late for that at this point anyway.
if (!m_extraConfigs.isEmpty())
- evaluateCommand("CONFIG += " + m_extraConfigs.join(' '), fL1S("(extra configs)"));
-#endif
+ evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)"));
if ((vr = evaluateFeatureFile(QLatin1String("default_post.prf"))) == ReturnError)
goto failed;
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index 4565a2cc15..59e3295f69 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -112,10 +112,8 @@ public:
QMakeHandler *handler);
~QMakeEvaluator();
-#ifdef QT_BUILD_QMAKE
void setExtraVars(const ProValueMap &extraVars) { m_extraVars = extraVars; }
void setExtraConfigs(const ProStringList &extraConfigs) { m_extraConfigs = extraConfigs; }
-#endif
void setOutputDir(const QString &outputDir) { m_outputDir = outputDir; }
ProStringList values(const ProKey &variableName) const;
@@ -268,10 +266,8 @@ public:
QStack<Location> m_locationStack; // All execution location changes
QStack<ProFile *> m_profileStack; // Includes only
-#ifdef QT_BUILD_QMAKE
ProValueMap m_extraVars;
ProStringList m_extraConfigs;
-#endif
QString m_outputDir;
int m_listCount;
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 557a779717..49b5429130 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -298,12 +298,12 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra
// Worst-case size calculations:
// - line marker adds 1 (2-nl) to 1st token of each line
// - empty assignment "A=":2 =>
- // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) +
- // TokValueTerminator(1) == 7 (8)
+ // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + 0(1) +
+ // TokValueTerminator(1) == 8 (9)
// - non-empty assignment "A=B C":5 =>
- // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) +
+ // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + 2(1) +
// TokLiteral(1) + len(1) + "B"(1) +
- // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 13 (14)
+ // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 14 (15)
// - variable expansion: "$$f":3 =>
// TokVariable(1) + hash(2) + len(1) + "f"(1) = 5
// - function expansion: "$$f()":5 =>
diff --git a/qmake/property.cpp b/qmake/property.cpp
index c4fbcd6b78..4685440b48 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -74,6 +74,7 @@ static const struct {
{ "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true },
{ "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
{ "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
+ { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true },
{ "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true },
{ "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true },
};
diff --git a/qtbase.pro b/qtbase.pro
index 4c41cfff50..02dc11eac2 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -77,17 +77,14 @@ INSTALLS += qmake
#syncqt
syncqt.path = $$[QT_HOST_BINS]
-syncqt.files = $$PWD/bin/syncqt
-equals(QMAKE_HOST.os, Windows):syncqt.files += $$PWD/bin/syncqt.bat
+syncqt.files = $$PWD/bin/syncqt.pl
INSTALLS += syncqt
# If we are doing a prefix build, create a "module" pri which enables
# qtPrepareTool() to find the non-installed syncqt.
-prefix_build {
+prefix_build|!equals(PWD, $$OUT_PWD) {
- cmd = $$shell_path($$OUT_PWD/bin/syncqt)
- contains(QMAKE_HOST.os, Windows): \
- cmd = $${cmd}.bat
+ cmd = perl -w $$shell_path($$PWD/bin/syncqt.pl)
TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri
diff --git a/src/3rdparty/sqlite/shell.c b/src/3rdparty/sqlite/shell.c
index c6d7fa3d53..1be2871fed 100644
--- a/src/3rdparty/sqlite/shell.c
+++ b/src/3rdparty/sqlite/shell.c
@@ -1481,18 +1481,6 @@ static void open_db(struct callback_data *p){
#ifndef SQLITE_OMIT_LOAD_EXTENSION
sqlite3_enable_load_extension(p->db, 1);
#endif
-#ifdef SQLITE_ENABLE_REGEXP
- {
- extern int sqlite3_add_regexp_func(sqlite3*);
- sqlite3_add_regexp_func(db);
- }
-#endif
-#ifdef SQLITE_ENABLE_SPELLFIX
- {
- extern int sqlite3_spellfix1_register(sqlite3*);
- sqlite3_spellfix1_register(db);
- }
-#endif
}
}
@@ -1553,6 +1541,43 @@ static int booleanValue(char *zArg){
}
/*
+** Interpret zArg as an integer value, possibly with suffixes.
+*/
+static sqlite3_int64 integerValue(const char *zArg){
+ sqlite3_int64 v = 0;
+ static const struct { char *zSuffix; int iMult; } aMult[] = {
+ { "KiB", 1024 },
+ { "MiB", 1024*1024 },
+ { "GiB", 1024*1024*1024 },
+ { "KB", 1000 },
+ { "MB", 1000000 },
+ { "GB", 1000000000 },
+ { "K", 1000 },
+ { "M", 1000000 },
+ { "G", 1000000000 },
+ };
+ int i;
+ int isNeg = 0;
+ if( zArg[0]=='-' ){
+ isNeg = 1;
+ zArg++;
+ }else if( zArg[0]=='+' ){
+ zArg++;
+ }
+ while( isdigit(zArg[0]) ){
+ v = v*10 + zArg[0] - '0';
+ zArg++;
+ }
+ for(i=0; i<sizeof(aMult)/sizeof(aMult[0]); i++){
+ if( sqlite3_stricmp(aMult[i].zSuffix, zArg)==0 ){
+ v *= aMult[i].iMult;
+ break;
+ }
+ }
+ return isNeg? -v : v;
+}
+
+/*
** Close an output file, assuming it is not stderr or stdout
*/
static void output_file_close(FILE *f){
@@ -2253,8 +2278,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
" SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) "
"WHERE lower(tbl_name) LIKE shellstatic()"
" AND type!='meta' AND sql NOTNULL "
- "ORDER BY substr(type,2,1), "
- " CASE type WHEN 'view' THEN rowid ELSE name END",
+ "ORDER BY rowid",
callback, &data, &zErrMsg);
zShellStatic = 0;
}
@@ -2265,8 +2289,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
" FROM sqlite_master UNION ALL"
" SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) "
"WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'"
- "ORDER BY substr(type,2,1),"
- " CASE type WHEN 'view' THEN rowid ELSE name END",
+ "ORDER BY rowid",
callback, &data, &zErrMsg
);
}
@@ -2388,9 +2411,9 @@ static int do_meta_command(char *zLine, struct callback_data *p){
for(i=0; i<nPrintRow; i++){
for(j=i; j<nRow; j+=nPrintRow){
char *zSp = j<nPrintRow ? "" : " ";
- printf("%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : "");
+ fprintf(p->out, "%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : "");
}
- printf("\n");
+ fprintf(p->out, "\n");
}
}
for(ii=0; ii<nRow; ii++) sqlite3_free(azResult[ii]);
@@ -2447,7 +2470,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( nArg==3 ){
int opt = (int)strtol(azArg[2], 0, 0);
rc = sqlite3_test_control(testctrl, p->db, opt);
- printf("%d (0x%08x)\n", rc, rc);
+ fprintf(p->out, "%d (0x%08x)\n", rc, rc);
} else {
fprintf(stderr,"Error: testctrl %s takes a single int option\n",
azArg[1]);
@@ -2460,7 +2483,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
case SQLITE_TESTCTRL_PRNG_RESET:
if( nArg==2 ){
rc = sqlite3_test_control(testctrl);
- printf("%d (0x%08x)\n", rc, rc);
+ fprintf(p->out, "%d (0x%08x)\n", rc, rc);
} else {
fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]);
}
@@ -2469,9 +2492,9 @@ static int do_meta_command(char *zLine, struct callback_data *p){
/* sqlite3_test_control(int, uint) */
case SQLITE_TESTCTRL_PENDING_BYTE:
if( nArg==3 ){
- unsigned int opt = (unsigned int)atoi(azArg[2]);
+ unsigned int opt = (unsigned int)integerValue(azArg[2]);
rc = sqlite3_test_control(testctrl, opt);
- printf("%d (0x%08x)\n", rc, rc);
+ fprintf(p->out, "%d (0x%08x)\n", rc, rc);
} else {
fprintf(stderr,"Error: testctrl %s takes a single unsigned"
" int option\n", azArg[1]);
@@ -2484,7 +2507,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( nArg==3 ){
int opt = atoi(azArg[2]);
rc = sqlite3_test_control(testctrl, opt);
- printf("%d (0x%08x)\n", rc, rc);
+ fprintf(p->out, "%d (0x%08x)\n", rc, rc);
} else {
fprintf(stderr,"Error: testctrl %s takes a single int option\n",
azArg[1]);
@@ -2497,7 +2520,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( nArg==3 ){
const char *opt = azArg[2];
rc = sqlite3_test_control(testctrl, opt);
- printf("%d (0x%08x)\n", rc, rc);
+ fprintf(p->out, "%d (0x%08x)\n", rc, rc);
} else {
fprintf(stderr,"Error: testctrl %s takes a single char * option\n",
azArg[1]);
@@ -2542,7 +2565,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}else
if( c=='v' && strncmp(azArg[0], "version", n)==0 ){
- printf("SQLite %s %s\n" /*extra-version-info*/,
+ fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/,
sqlite3_libversion(), sqlite3_sourceid());
}else
@@ -2552,7 +2575,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( p->db ){
sqlite3_file_control(p->db, zDbName, SQLITE_FCNTL_VFSNAME, &zVfsName);
if( zVfsName ){
- printf("%s\n", zVfsName);
+ fprintf(p->out, "%s\n", zVfsName);
sqlite3_free(zVfsName);
}
}
@@ -2561,7 +2584,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){
extern int sqlite3WhereTrace;
- sqlite3WhereTrace = atoi(azArg[1]);
+ sqlite3WhereTrace = booleanValue(azArg[1]);
}else
#endif
@@ -2747,6 +2770,10 @@ static int process_input(struct callback_data *p, FILE *in){
free(zSql);
zSql = 0;
nSql = 0;
+ }else if( zSql && _all_whitespace(zSql) ){
+ free(zSql);
+ zSql = 0;
+ nSql = 0;
}
}
if( zSql ){
@@ -2882,6 +2909,7 @@ static const char zOptions[] =
" -interactive force interactive I/O\n"
" -line set output mode to 'line'\n"
" -list set output mode to 'list'\n"
+ " -mmap N default mmap size set to N\n"
#ifdef SQLITE_ENABLE_MULTIPLEX
" -multiplex enable the multiplexor VFS\n"
#endif
@@ -3001,12 +3029,7 @@ int main(int argc, char **argv){
sqlite3_int64 szHeap;
zSize = cmdline_option_value(argc, argv, ++i);
- szHeap = atoi(zSize);
- for(j=0; (c = zSize[j])!=0; j++){
- if( c=='M' ){ szHeap *= 1000000; break; }
- if( c=='K' ){ szHeap *= 1000; break; }
- if( c=='G' ){ szHeap *= 1000000000; break; }
- }
+ szHeap = integerValue(zSize);
if( szHeap>0x7fff0000 ) szHeap = 0x7fff0000;
sqlite3_config(SQLITE_CONFIG_HEAP, malloc((int)szHeap), (int)szHeap, 64);
#endif
@@ -3026,6 +3049,9 @@ int main(int argc, char **argv){
extern int sqlite3_multiple_initialize(const char*,int);
sqlite3_multiplex_initialize(0, 1);
#endif
+ }else if( strcmp(z,"-mmap")==0 ){
+ sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i));
+ sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, sz, sz);
}else if( strcmp(z,"-vfs")==0 ){
sqlite3_vfs *pVfs = sqlite3_vfs_find(cmdline_option_value(argc,argv,++i));
if( pVfs ){
@@ -3111,6 +3137,8 @@ int main(int argc, char **argv){
stdin_is_interactive = 0;
}else if( strcmp(z,"-heap")==0 ){
i++;
+ }else if( strcmp(z,"-mmap")==0 ){
+ i++;
}else if( strcmp(z,"-vfs")==0 ){
i++;
#ifdef SQLITE_ENABLE_VFSTRACE
@@ -3128,7 +3156,7 @@ int main(int argc, char **argv){
z = cmdline_option_value(argc,argv,++i);
if( z[0]=='.' ){
rc = do_meta_command(z, &data);
- if( rc && bail_on_error ) return rc;
+ if( rc && bail_on_error ) return rc==2 ? 0 : rc;
}else{
open_db(&data);
rc = shell_exec(data.db, z, shell_callback, &data, &zErrMsg);
@@ -3152,6 +3180,7 @@ int main(int argc, char **argv){
*/
if( zFirstCmd[0]=='.' ){
rc = do_meta_command(zFirstCmd, &data);
+ if( rc==2 ) rc = 0;
}else{
open_db(&data);
rc = shell_exec(data.db, zFirstCmd, shell_callback, &data, &zErrMsg);
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 53f68627bb..03fa649610 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.7.16.2. By combining all the individual C code files into this
+** version 3.7.17. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
@@ -362,11 +362,11 @@
** We support that for legacy.
*/
#if !defined(SQLITE_THREADSAFE)
-#if defined(THREADSAFE)
-# define SQLITE_THREADSAFE THREADSAFE
-#else
-# define SQLITE_THREADSAFE 1 /* IMP: R-07272-22309 */
-#endif
+# if defined(THREADSAFE)
+# define SQLITE_THREADSAFE THREADSAFE
+# else
+# define SQLITE_THREADSAFE 1 /* IMP: R-07272-22309 */
+# endif
#endif
/*
@@ -678,9 +678,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.7.16.2"
-#define SQLITE_VERSION_NUMBER 3007016
-#define SQLITE_SOURCE_ID "2013-04-12 11:52:43 cbea02d93865ce0e06789db95fd9168ebac970c7"
+#define SQLITE_VERSION "3.7.17"
+#define SQLITE_VERSION_NUMBER 3007017
+#define SQLITE_SOURCE_ID "2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -996,6 +996,8 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_FORMAT 24 /* Auxiliary database format error */
#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB 26 /* File opened that is not a database file */
+#define SQLITE_NOTICE 27 /* Notifications from sqlite3_log() */
+#define SQLITE_WARNING 28 /* Warnings from sqlite3_log() */
#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
/* end-of-error-codes */
@@ -1046,6 +1048,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8))
#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8))
#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8))
+#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8))
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -1065,6 +1068,8 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8))
#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8))
#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8))
+#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
+#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
/*
** CAPI3REF: Flags For File Open Operations
@@ -1304,6 +1309,9 @@ struct sqlite3_io_methods {
void (*xShmBarrier)(sqlite3_file*);
int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
/* Methods above are valid for version 2 */
+ int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
+ int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
+ /* Methods above are valid for version 3 */
/* Additional methods may be added in future releases */
};
@@ -1440,7 +1448,8 @@ struct sqlite3_io_methods {
** it is able to override built-in [PRAGMA] statements.
**
** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
-** ^This file-control may be invoked by SQLite on the database file handle
+** ^The [SQLITE_FCNTL_BUSYHANDLER]
+** file-control may be invoked by SQLite on the database file handle
** shortly after it is opened in order to provide a custom VFS with access
** to the connections busy-handler callback. The argument is of type (void **)
** - an array of two (void *) values. The first (void *) actually points
@@ -1451,13 +1460,24 @@ struct sqlite3_io_methods {
** current operation.
**
** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
-** ^Application can invoke this file-control to have SQLite generate a
+** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
+** to have SQLite generate a
** temporary filename using the same algorithm that is followed to generate
** temporary filenames for TEMP tables and other internal uses. The
** argument should be a char** which will be filled with the filename
** written into memory obtained from [sqlite3_malloc()]. The caller should
** invoke [sqlite3_free()] on the result to avoid a memory leak.
**
+** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
+** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
+** maximum number of bytes that will be used for memory-mapped I/O.
+** The argument is a pointer to a value of type sqlite3_int64 that
+** is an advisory maximum number of bytes in the file to memory map. The
+** pointer is overwritten with the old value. The limit is not changed if
+** the value originally pointed to is negative, and so the current limit
+** can be queried by passing in a pointer to a negative number. This
+** file-control is used internally to implement [PRAGMA mmap_size].
+**
** </ul>
*/
#define SQLITE_FCNTL_LOCKSTATE 1
@@ -1476,6 +1496,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_PRAGMA 14
#define SQLITE_FCNTL_BUSYHANDLER 15
#define SQLITE_FCNTL_TEMPFILENAME 16
+#define SQLITE_FCNTL_MMAP_SIZE 18
/*
** CAPI3REF: Mutex Handle
@@ -2142,7 +2163,9 @@ struct sqlite3_mem_methods {
** page cache implementation into that object.)^ </dd>
**
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
-** <dd> ^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
+** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
+** global [error log].
+** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
** function with a call signature of void(*)(void*,int,const char*),
** and a pointer to void. ^If the function pointer is not NULL, it is
** invoked by [sqlite3_log()] to process each logging event. ^If the
@@ -2188,12 +2211,12 @@ struct sqlite3_mem_methods {
** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
** <dd> These options are obsolete and should not be used by new code.
** They are retained for backwards compatibility but are now no-ops.
-** </dl>
+** </dd>
**
** [[SQLITE_CONFIG_SQLLOG]]
** <dt>SQLITE_CONFIG_SQLLOG
** <dd>This option is only available if sqlite is compiled with the
-** SQLITE_ENABLE_SQLLOG pre-processor macro defined. The first argument should
+** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
** The second should be of type (void*). The callback is invoked by the library
** in three separate circumstances, identified by the value passed as the
@@ -2203,7 +2226,23 @@ struct sqlite3_mem_methods {
** fourth parameter is 1, then the SQL statement that the third parameter
** points to has just been executed. Or, if the fourth parameter is 2, then
** the connection being passed as the second parameter is being closed. The
-** third parameter is passed NULL In this case.
+** third parameter is passed NULL In this case. An example of using this
+** configuration option can be seen in the "test_sqllog.c" source file in
+** the canonical SQLite source tree.</dd>
+**
+** [[SQLITE_CONFIG_MMAP_SIZE]]
+** <dt>SQLITE_CONFIG_MMAP_SIZE
+** <dd>SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
+** that are the default mmap size limit (the default setting for
+** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
+** The default setting can be overridden by each database connection using
+** either the [PRAGMA mmap_size] command, or by using the
+** [SQLITE_FCNTL_MMAP_SIZE] file control. The maximum allowed mmap size
+** cannot be changed at run-time. Nor may the maximum allowed mmap size
+** exceed the compile-time maximum mmap size set by the
+** [SQLITE_MAX_MMAP_SIZE] compile-time option.
+** If either argument to this option is negative, then that argument is
+** changed to its compile-time default.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2227,6 +2266,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
+#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -3060,6 +3100,9 @@ SQLITE_API int sqlite3_set_authorizer(
** as each triggered subprogram is entered. The callbacks for triggers
** contain a UTF-8 SQL comment that identifies the trigger.)^
**
+** The [SQLITE_TRACE_SIZE_LIMIT] compile-time option can be used to limit
+** the length of [bound parameter] expansion in the output of sqlite3_trace().
+**
** ^The callback function registered by sqlite3_profile() is invoked
** as each SQL statement finishes. ^The profile callback contains
** the original statement text and an estimate of wall-clock time
@@ -3598,7 +3641,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** <li>
** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
** always used to do, [sqlite3_step()] will automatically recompile the SQL
-** statement and try to run it again.
+** statement and try to run it again. As many as [SQLITE_MAX_SCHEMA_RETRY]
+** retries will occur before sqlite3_step() gives up and returns an error.
** </li>
**
** <li>
@@ -3802,6 +3846,9 @@ typedef struct sqlite3_context sqlite3_context;
** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999).
**
** ^The third argument is the value to bind to the parameter.
+** ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16()
+** or sqlite3_bind_blob() is a NULL pointer then the fourth parameter
+** is ignored and the end result is the same as sqlite3_bind_null().
**
** ^(In those routines that have a fourth argument, its value is the
** number of bytes in the parameter. To be clear: the value is the
@@ -4758,7 +4805,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi
** the content before returning.
**
** The typedef is necessary to work around problems in certain
-** C++ compilers. See ticket #2191.
+** C++ compilers.
*/
typedef void (*sqlite3_destructor_type)(void*);
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
@@ -5557,11 +5604,20 @@ SQLITE_API int sqlite3_table_column_metadata(
** ^This interface loads an SQLite extension library from the named file.
**
** ^The sqlite3_load_extension() interface attempts to load an
-** SQLite extension library contained in the file zFile.
+** [SQLite extension] library contained in the file zFile. If
+** the file cannot be loaded directly, attempts are made to load
+** with various operating-system specific extensions added.
+** So for example, if "samplelib" cannot be loaded, then names like
+** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might
+** be tried also.
**
** ^The entry point is zProc.
-** ^zProc may be 0, in which case the name of the entry point
-** defaults to "sqlite3_extension_init".
+** ^(zProc may be 0, in which case SQLite will try to come up with an
+** entry point name on its own. It first tries "sqlite3_extension_init".
+** If that does not work, it constructs a name "sqlite3_X_init" where the
+** X is consists of the lower-case equivalent of all ASCII alphabetic
+** characters in the filename from the last "/" to the first following
+** "." and omitting any initial "lib".)^
** ^The sqlite3_load_extension() interface returns
** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
** ^If an error occurs and pzErrMsg is not 0, then the
@@ -5587,11 +5643,11 @@ SQLITE_API int sqlite3_load_extension(
** CAPI3REF: Enable Or Disable Extension Loading
**
** ^So as not to open security holes in older applications that are
-** unprepared to deal with extension loading, and as a means of disabling
-** extension loading while evaluating user-entered SQL, the following API
+** unprepared to deal with [extension loading], and as a means of disabling
+** [extension loading] while evaluating user-entered SQL, the following API
** is provided to turn the [sqlite3_load_extension()] mechanism on and off.
**
-** ^Extension loading is off by default. See ticket #1863.
+** ^Extension loading is off by default.
** ^Call the sqlite3_enable_load_extension() routine with onoff==1
** to turn extension loading on and call it with onoff==0 to turn
** it back off again.
@@ -5603,7 +5659,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
**
** ^This interface causes the xEntryPoint() function to be invoked for
** each new [database connection] that is created. The idea here is that
-** xEntryPoint() is the entry point for a statically linked SQLite extension
+** xEntryPoint() is the entry point for a statically linked [SQLite extension]
** that is to be automatically loaded into all new database connections.
**
** ^(Even though the function prototype shows that xEntryPoint() takes
@@ -7384,9 +7440,24 @@ SQLITE_API int sqlite3_stricmp(const char *, const char *);
SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
/*
+** CAPI3REF: String Globbing
+*
+** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
+** the glob pattern P, and it returns non-zero if string X does not match
+** the glob pattern P. ^The definition of glob pattern matching used in
+** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the
+** SQL dialect used by SQLite. ^The sqlite3_strglob(P,X) function is case
+** sensitive.
+**
+** Note that this routine returns zero on a match and non-zero if the strings
+** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
+*/
+SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
+
+/*
** CAPI3REF: Error Logging Interface
**
-** ^The [sqlite3_log()] interface writes a message into the error log
+** ^The [sqlite3_log()] interface writes a message into the [error log]
** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()].
** ^If logging is enabled, the zFormat string and subsequent arguments are
** used with [sqlite3_snprintf()] to generate the final output string.
@@ -8071,6 +8142,7 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*);
*/
#ifndef SQLITE_TEMP_STORE
# define SQLITE_TEMP_STORE 1
+# define SQLITE_TEMP_STORE_xc 1 /* Exclude from ctime.c */
#endif
/*
@@ -8218,6 +8290,49 @@ SQLITE_PRIVATE const int sqlite3one;
# define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&7)==0)
#endif
+/*
+** Disable MMAP on platforms where it is known to not work
+*/
+#if defined(__OpenBSD__) || defined(__QNXNTO__)
+# undef SQLITE_MAX_MMAP_SIZE
+# define SQLITE_MAX_MMAP_SIZE 0
+#endif
+
+/*
+** Default maximum size of memory used by memory-mapped I/O in the VFS
+*/
+#ifdef __APPLE__
+# include <TargetConditionals.h>
+# if TARGET_OS_IPHONE
+# undef SQLITE_MAX_MMAP_SIZE
+# define SQLITE_MAX_MMAP_SIZE 0
+# endif
+#endif
+#ifndef SQLITE_MAX_MMAP_SIZE
+# if defined(__linux__) \
+ || defined(_WIN32) \
+ || (defined(__APPLE__) && defined(__MACH__)) \
+ || defined(__sun)
+# define SQLITE_MAX_MMAP_SIZE 0x7fff0000 /* 2147418112 */
+# else
+# define SQLITE_MAX_MMAP_SIZE 0
+# endif
+# define SQLITE_MAX_MMAP_SIZE_xc 1 /* exclude from ctime.c */
+#endif
+
+/*
+** The default MMAP_SIZE is zero on all platforms. Or, even if a larger
+** default MMAP_SIZE is specified at compile-time, make sure that it does
+** not exceed the maximum mmap size.
+*/
+#ifndef SQLITE_DEFAULT_MMAP_SIZE
+# define SQLITE_DEFAULT_MMAP_SIZE 0
+# define SQLITE_DEFAULT_MMAP_SIZE_xc 1 /* Exclude from ctime.c */
+#endif
+#if SQLITE_DEFAULT_MMAP_SIZE>SQLITE_MAX_MMAP_SIZE
+# undef SQLITE_DEFAULT_MMAP_SIZE
+# define SQLITE_DEFAULT_MMAP_SIZE SQLITE_MAX_MMAP_SIZE
+#endif
/*
** An instance of the following structure is used to store the busy-handler
@@ -8439,6 +8554,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen(
SQLITE_PRIVATE int sqlite3BtreeClose(Btree*);
SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree*,sqlite3_int64);
SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int,int);
SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*);
SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix);
@@ -8515,6 +8631,7 @@ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p);
#define BTREE_TEXT_ENCODING 5
#define BTREE_USER_VERSION 6
#define BTREE_INCR_VACUUM 7
+#define BTREE_APPLICATION_ID 8
/*
** Values that may be OR'd together to form the second argument of an
@@ -9140,6 +9257,12 @@ typedef struct PgHdr DbPage;
#define PAGER_JOURNALMODE_WAL 5 /* Use write-ahead logging */
/*
+** Flags that make up the mask passed to sqlite3PagerAcquire().
+*/
+#define PAGER_ACQUIRE_NOCONTENT 0x01 /* Do not load data from disk */
+#define PAGER_ACQUIRE_READONLY 0x02 /* Read-only page is acceptable */
+
+/*
** The remainder of this file contains the declarations of the functions
** that make up the Pager sub-system API. See source code comments for
** a detailed description of each routine.
@@ -9163,6 +9286,7 @@ SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *);
SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int);
SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int);
SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager*, int);
+SQLITE_PRIVATE void sqlite3PagerSetMmapLimit(Pager *, sqlite3_int64);
SQLITE_PRIVATE void sqlite3PagerShrink(Pager*);
SQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager*,int,int,int);
SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *, int);
@@ -9309,6 +9433,8 @@ struct PgHdr {
#define PGHDR_REUSE_UNLIKELY 0x010 /* A hint that reuse is unlikely */
#define PGHDR_DONT_WRITE 0x020 /* Do not write content to disk */
+#define PGHDR_MMAP 0x040 /* This is an mmap page object */
+
/* Initialize and shutdown the page cache subsystem */
SQLITE_PRIVATE int sqlite3PcacheInitialize(void);
SQLITE_PRIVATE void sqlite3PcacheShutdown(void);
@@ -9520,14 +9646,6 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void);
# define SQLITE_OS_WINRT 0
#endif
-/*
-** When compiled for WinCE or WinRT, there is no concept of the current
-** directory.
- */
-#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
-# define SQLITE_CURDIR 1
-#endif
-
/* If the SET_FULLSYNC macro is not defined above, then make it
** a no-op
*/
@@ -9680,6 +9798,8 @@ SQLITE_PRIVATE int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **);
SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int, int, int);
SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id);
SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int);
+SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **);
+SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
/*
@@ -9919,6 +10039,7 @@ struct sqlite3 {
int nDb; /* Number of backends currently in use */
int flags; /* Miscellaneous flags. See below */
i64 lastRowid; /* ROWID of most recent insert (see above) */
+ i64 szMmap; /* Default mmap_size setting */
unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */
int errCode; /* Most recent error code (SQLITE_*) */
int errMask; /* & result codes with this before returning */
@@ -11155,6 +11276,8 @@ struct NameContext {
#define NC_HasAgg 0x02 /* One or more aggregate functions seen */
#define NC_IsCheck 0x04 /* True if resolving names in a CHECK constraint */
#define NC_InAggFunc 0x08 /* True if analyzing arguments to an agg func */
+#define NC_AsMaybe 0x10 /* Resolve to AS terms of the result set only
+ ** if no other resolution is available */
/*
** An instance of the following structure contains all information
@@ -11590,6 +11713,8 @@ struct Sqlite3Config {
void *pHeap; /* Heap storage space */
int nHeap; /* Size of pHeap[] */
int mnReq, mxReq; /* Min and max heap requests sizes */
+ sqlite3_int64 szMmap; /* mmap() space per open file */
+ sqlite3_int64 mxMmap; /* Maximum value for szMmap */
void *pScratch; /* Scratch memory */
int szScratch; /* Size of each scratch buffer */
int nScratch; /* Number of scratch buffers */
@@ -11624,6 +11749,7 @@ struct Walker {
int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
Parse *pParse; /* Parser context. */
int walkerDepth; /* Number of subqueries */
+ u8 bSelectDepthFirst; /* Do subqueries first */
union { /* Extra data for callback */
NameContext *pNC; /* Naming context */
int i; /* Integer value */
@@ -12127,6 +12253,12 @@ SQLITE_PRIVATE void sqlite3Error(sqlite3*, int, const char*,...);
SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
SQLITE_PRIVATE u8 sqlite3HexToInt(int h);
SQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
+
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) || \
+ defined(SQLITE_DEBUG_OS_TRACE)
+SQLITE_PRIVATE const char *sqlite3ErrName(int);
+#endif
+
SQLITE_PRIVATE const char *sqlite3ErrStr(int);
SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse);
SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int);
@@ -12611,6 +12743,8 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = {
(void*)0, /* pHeap */
0, /* nHeap */
0, 0, /* mnHeap, mxHeap */
+ SQLITE_DEFAULT_MMAP_SIZE, /* szMmap */
+ SQLITE_MAX_MMAP_SIZE, /* mxMmap */
(void*)0, /* pScratch */
0, /* szScratch */
0, /* nScratch */
@@ -12734,15 +12868,15 @@ static const char * const azCompileOpt[] = {
#ifdef SQLITE_COVERAGE_TEST
"COVERAGE_TEST",
#endif
-#ifdef SQLITE_CURDIR
- "CURDIR",
-#endif
#ifdef SQLITE_DEBUG
"DEBUG",
#endif
#ifdef SQLITE_DEFAULT_LOCKING_MODE
"DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE),
#endif
+#if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc)
+ "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE),
+#endif
#ifdef SQLITE_DISABLE_DIRSYNC
"DISABLE_DIRSYNC",
#endif
@@ -12833,6 +12967,9 @@ static const char * const azCompileOpt[] = {
#ifdef SQLITE_LOCK_TRACE
"LOCK_TRACE",
#endif
+#if defined(SQLITE_MAX_MMAP_SIZE) && !defined(SQLITE_MAX_MMAP_SIZE_xc)
+ "MAX_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_MAX_MMAP_SIZE),
+#endif
#ifdef SQLITE_MAX_SCHEMA_RETRY
"MAX_SCHEMA_RETRY=" CTIMEOPT_VAL(SQLITE_MAX_SCHEMA_RETRY),
#endif
@@ -12890,11 +13027,6 @@ static const char * const azCompileOpt[] = {
#ifdef SQLITE_OMIT_CHECK
"OMIT_CHECK",
#endif
-/* // redundant
-** #ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS
-** "OMIT_COMPILEOPTION_DIAGS",
-** #endif
-*/
#ifdef SQLITE_OMIT_COMPLETE
"OMIT_COMPLETE",
#endif
@@ -13036,13 +13168,13 @@ static const char * const azCompileOpt[] = {
#ifdef SQLITE_TCL
"TCL",
#endif
-#ifdef SQLITE_TEMP_STORE
+#if defined(SQLITE_TEMP_STORE) && !defined(SQLITE_TEMP_STORE_xc)
"TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE),
#endif
#ifdef SQLITE_TEST
"TEST",
#endif
-#ifdef SQLITE_THREADSAFE
+#if defined(SQLITE_THREADSAFE)
"THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE),
#endif
#ifdef SQLITE_USE_ALLOCA
@@ -13068,8 +13200,11 @@ SQLITE_API int sqlite3_compileoption_used(const char *zOptName){
/* Since ArraySize(azCompileOpt) is normally in single digits, a
** linear search is adequate. No need for a binary search. */
for(i=0; i<ArraySize(azCompileOpt); i++){
- if( (sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0)
- && ( (azCompileOpt[i][n]==0) || (azCompileOpt[i][n]=='=') ) ) return 1;
+ if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0
+ && sqlite3CtypeMap[(unsigned char)azCompileOpt[i][n]]==0
+ ){
+ return 1;
+ }
}
return 0;
}
@@ -13127,6 +13262,14 @@ SQLITE_API const char *sqlite3_compileoption_get(int N){
#define _VDBEINT_H_
/*
+** The maximum number of times that a statement will try to reparse
+** itself before giving up and returning SQLITE_SCHEMA.
+*/
+#ifndef SQLITE_MAX_SCHEMA_RETRY
+# define SQLITE_MAX_SCHEMA_RETRY 50
+#endif
+
+/*
** SQL is translated into a sequence of instructions to be
** executed by a virtual machine. Each instruction is an instance
** of the following structure.
@@ -15096,6 +15239,26 @@ SQLITE_PRIVATE int sqlite3OsShmMap(
return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp);
}
+#if SQLITE_MAX_MMAP_SIZE>0
+/* The real implementation of xFetch and xUnfetch */
+SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
+ DO_OS_MALLOC_TEST(id);
+ return id->pMethods->xFetch(id, iOff, iAmt, pp);
+}
+SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
+ return id->pMethods->xUnfetch(id, iOff, p);
+}
+#else
+/* No-op stubs to use when memory-mapped I/O is disabled */
+SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
+ *pp = 0;
+ return SQLITE_OK;
+}
+SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
+ return SQLITE_OK;
+}
+#endif
+
/*
** The next group of routines are convenience wrappers around the
** VFS methods.
@@ -22852,7 +23015,7 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
/* #include <time.h> */
#include <sys/time.h>
#include <errno.h>
-#ifndef SQLITE_OMIT_WAL
+#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0
#include <sys/mman.h>
#endif
@@ -22951,6 +23114,11 @@ struct unixFile {
const char *zPath; /* Name of the file */
unixShm *pShm; /* Shared memory segment information */
int szChunk; /* Configured by FCNTL_CHUNK_SIZE */
+ int nFetchOut; /* Number of outstanding xFetch refs */
+ sqlite3_int64 mmapSize; /* Usable size of mapping at pMapRegion */
+ sqlite3_int64 mmapSizeActual; /* Actual size of mapping at pMapRegion */
+ sqlite3_int64 mmapSizeMax; /* Configured FCNTL_MMAP_SIZE value */
+ void *pMapRegion; /* Memory mapped region */
#ifdef __QNXNTO__
int sectorSize; /* Device sector size */
int deviceCharacteristics; /* Precomputed device characteristics */
@@ -22975,7 +23143,9 @@ struct unixFile {
unsigned char transCntrChng; /* True if the transaction counter changed */
unsigned char dbUpdate; /* True if any part of database file changed */
unsigned char inNormalWrite; /* True if in a normal write operation */
+
#endif
+
#ifdef SQLITE_TEST
/* In test mode, increase the size of this structure a bit so that
** it is larger than the struct CrashFile defined in test6.c.
@@ -22999,6 +23169,7 @@ struct unixFile {
#define UNIXFILE_DELETE 0x20 /* Delete on close */
#define UNIXFILE_URI 0x40 /* Filename might have query parameters */
#define UNIXFILE_NOLOCK 0x80 /* Do no file locking */
+#define UNIXFILE_WARNED 0x0100 /* verifyDbFile() warnings have been issued */
/*
** Include code that is common to all os_*.c files
@@ -23241,6 +23412,17 @@ SQLITE_API int sqlite3_open_file_count = 0;
#endif
/*
+** HAVE_MREMAP defaults to true on Linux and false everywhere else.
+*/
+#if !defined(HAVE_MREMAP)
+# if defined(__linux__) && defined(_GNU_SOURCE)
+# define HAVE_MREMAP 1
+# else
+# define HAVE_MREMAP 0
+# endif
+#endif
+
+/*
** Different Unix systems declare open() in different ways. Same use
** open(const char*,int,mode_t). Others use open(const char*,int,...).
** The difference is important when using a pointer to the function.
@@ -23371,6 +23553,19 @@ static struct unix_syscall {
{ "fchown", (sqlite3_syscall_ptr)posixFchown, 0 },
#define osFchown ((int(*)(int,uid_t,gid_t))aSyscall[20].pCurrent)
+ { "mmap", (sqlite3_syscall_ptr)mmap, 0 },
+#define osMmap ((void*(*)(void*,size_t,int,int,int,off_t))aSyscall[21].pCurrent)
+
+ { "munmap", (sqlite3_syscall_ptr)munmap, 0 },
+#define osMunmap ((void*(*)(void*,size_t))aSyscall[22].pCurrent)
+
+#if HAVE_MREMAP
+ { "mremap", (sqlite3_syscall_ptr)mremap, 0 },
+#else
+ { "mremap", (sqlite3_syscall_ptr)0, 0 },
+#endif
+#define osMremap ((void*(*)(void*,size_t,size_t,int,...))aSyscall[23].pCurrent)
+
}; /* End of the overrideable system calls */
/*
@@ -23702,7 +23897,6 @@ static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) {
}
-
/******************************************************************************
****************** Begin Unique File ID Utility Used By VxWorks ***************
**
@@ -24038,7 +24232,6 @@ static int unixLogErrorAtLine(
zErr = strerror(iErrno);
#endif
- assert( errcode!=SQLITE_OK );
if( zPath==0 ) zPath = "";
sqlite3_log(errcode,
"os_unix.c:%d: (%d) %s(%s) - %s",
@@ -24205,6 +24398,50 @@ static int findInodeInfo(
/*
+** Check a unixFile that is a database. Verify the following:
+**
+** (1) There is exactly one hard link on the file
+** (2) The file is not a symbolic link
+** (3) The file has not been renamed or unlinked
+**
+** Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right.
+*/
+static void verifyDbFile(unixFile *pFile){
+ struct stat buf;
+ int rc;
+ if( pFile->ctrlFlags & UNIXFILE_WARNED ){
+ /* One or more of the following warnings have already been issued. Do not
+ ** repeat them so as not to clutter the error log */
+ return;
+ }
+ rc = osFstat(pFile->h, &buf);
+ if( rc!=0 ){
+ sqlite3_log(SQLITE_WARNING, "cannot fstat db file %s", pFile->zPath);
+ pFile->ctrlFlags |= UNIXFILE_WARNED;
+ return;
+ }
+ if( buf.st_nlink==0 && (pFile->ctrlFlags & UNIXFILE_DELETE)==0 ){
+ sqlite3_log(SQLITE_WARNING, "file unlinked while open: %s", pFile->zPath);
+ pFile->ctrlFlags |= UNIXFILE_WARNED;
+ return;
+ }
+ if( buf.st_nlink>1 ){
+ sqlite3_log(SQLITE_WARNING, "multiple links to file: %s", pFile->zPath);
+ pFile->ctrlFlags |= UNIXFILE_WARNED;
+ return;
+ }
+ if( pFile->pInode!=0
+ && ((rc = osStat(pFile->zPath, &buf))!=0
+ || buf.st_ino!=pFile->pInode->fileId.ino)
+ ){
+ sqlite3_log(SQLITE_WARNING, "file renamed while open: %s", pFile->zPath);
+ pFile->ctrlFlags |= UNIXFILE_WARNED;
+ return;
+ }
+}
+
+
+/*
** This routine checks if there is a RESERVED lock held on the specified
** file by this or any other process. If such a lock is held, set *pResOut
** to a non-zero value otherwise *pResOut is set to zero. The return value
@@ -24734,9 +24971,13 @@ end_unlock:
** the requested locking level, this routine is a no-op.
*/
static int unixUnlock(sqlite3_file *id, int eFileLock){
+ assert( eFileLock==SHARED_LOCK || ((unixFile *)id)->nFetchOut==0 );
return posixUnlock(id, eFileLock, 0);
}
+static int unixMapfile(unixFile *pFd, i64 nByte);
+static void unixUnmapfile(unixFile *pFd);
+
/*
** This function performs the parts of the "close file" operation
** common to all locking schemes. It closes the directory and file
@@ -24749,6 +24990,7 @@ static int unixUnlock(sqlite3_file *id, int eFileLock){
*/
static int closeUnixFile(sqlite3_file *id){
unixFile *pFile = (unixFile*)id;
+ unixUnmapfile(pFile);
if( pFile->h>=0 ){
robust_close(pFile, pFile->h, __LINE__);
pFile->h = -1;
@@ -24775,6 +25017,7 @@ static int closeUnixFile(sqlite3_file *id){
static int unixClose(sqlite3_file *id){
int rc = SQLITE_OK;
unixFile *pFile = (unixFile *)id;
+ verifyDbFile(pFile);
unixUnlock(id, NO_LOCK);
unixEnterMutex();
@@ -26006,6 +26249,8 @@ static int unixRead(
unixFile *pFile = (unixFile *)id;
int got;
assert( id );
+ assert( offset>=0 );
+ assert( amt>0 );
/* If this is a database file (not a journal, master-journal or temp
** file), the bytes in the locking range should never be read or written. */
@@ -26016,6 +26261,23 @@ static int unixRead(
);
#endif
+#if SQLITE_MAX_MMAP_SIZE>0
+ /* Deal with as much of this read request as possible by transfering
+ ** data from the memory mapping using memcpy(). */
+ if( offset<pFile->mmapSize ){
+ if( offset+amt <= pFile->mmapSize ){
+ memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt);
+ return SQLITE_OK;
+ }else{
+ int nCopy = pFile->mmapSize - offset;
+ memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], nCopy);
+ pBuf = &((u8 *)pBuf)[nCopy];
+ amt -= nCopy;
+ offset += nCopy;
+ }
+ }
+#endif
+
got = seekAndRead(pFile, offset, pBuf, amt);
if( got==amt ){
return SQLITE_OK;
@@ -26031,46 +26293,59 @@ static int unixRead(
}
/*
-** Seek to the offset in id->offset then read cnt bytes into pBuf.
-** Return the number of bytes actually read. Update the offset.
-**
-** To avoid stomping the errno value on a failed write the lastErrno value
-** is set before returning.
+** Attempt to seek the file-descriptor passed as the first argument to
+** absolute offset iOff, then attempt to write nBuf bytes of data from
+** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise,
+** return the actual number of bytes written (which may be less than
+** nBuf).
*/
-static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
- int got;
-#if (!defined(USE_PREAD) && !defined(USE_PREAD64))
- i64 newOffset;
-#endif
- assert( cnt==(cnt&0x1ffff) );
- cnt &= 0x1ffff;
+static int seekAndWriteFd(
+ int fd, /* File descriptor to write to */
+ i64 iOff, /* File offset to begin writing at */
+ const void *pBuf, /* Copy data from this buffer to the file */
+ int nBuf, /* Size of buffer pBuf in bytes */
+ int *piErrno /* OUT: Error number if error occurs */
+){
+ int rc = 0; /* Value returned by system call */
+
+ assert( nBuf==(nBuf&0x1ffff) );
+ nBuf &= 0x1ffff;
TIMER_START;
+
#if defined(USE_PREAD)
- do{ got = osPwrite(id->h, pBuf, cnt, offset); }while( got<0 && errno==EINTR );
+ do{ rc = osPwrite(fd, pBuf, nBuf, iOff); }while( rc<0 && errno==EINTR );
#elif defined(USE_PREAD64)
- do{ got = osPwrite64(id->h, pBuf, cnt, offset);}while( got<0 && errno==EINTR);
+ do{ rc = osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
#else
do{
- newOffset = lseek(id->h, offset, SEEK_SET);
- SimulateIOError( newOffset-- );
- if( newOffset!=offset ){
- if( newOffset == -1 ){
- ((unixFile*)id)->lastErrno = errno;
- }else{
- ((unixFile*)id)->lastErrno = 0;
- }
+ i64 iSeek = lseek(fd, iOff, SEEK_SET);
+ SimulateIOError( iSeek-- );
+
+ if( iSeek!=iOff ){
+ if( piErrno ) *piErrno = (iSeek==-1 ? errno : 0);
return -1;
}
- got = osWrite(id->h, pBuf, cnt);
- }while( got<0 && errno==EINTR );
+ rc = osWrite(fd, pBuf, nBuf);
+ }while( rc<0 && errno==EINTR );
#endif
+
TIMER_END;
- if( got<0 ){
- ((unixFile*)id)->lastErrno = errno;
- }
+ OSTRACE(("WRITE %-3d %5d %7lld %llu\n", fd, rc, iOff, TIMER_ELAPSED));
- OSTRACE(("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED));
- return got;
+ if( rc<0 && piErrno ) *piErrno = errno;
+ return rc;
+}
+
+
+/*
+** Seek to the offset in id->offset then read cnt bytes into pBuf.
+** Return the number of bytes actually read. Update the offset.
+**
+** To avoid stomping the errno value on a failed write the lastErrno value
+** is set before returning.
+*/
+static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){
+ return seekAndWriteFd(id->h, offset, pBuf, cnt, &id->lastErrno);
}
@@ -26120,6 +26395,23 @@ static int unixWrite(
}
#endif
+#if SQLITE_MAX_MMAP_SIZE>0
+ /* Deal with as much of this write request as possible by transfering
+ ** data from the memory mapping using memcpy(). */
+ if( offset<pFile->mmapSize ){
+ if( offset+amt <= pFile->mmapSize ){
+ memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt);
+ return SQLITE_OK;
+ }else{
+ int nCopy = pFile->mmapSize - offset;
+ memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, nCopy);
+ pBuf = &((u8 *)pBuf)[nCopy];
+ amt -= nCopy;
+ offset += nCopy;
+ }
+ }
+#endif
+
while( amt>0 && (wrote = seekAndWrite(pFile, offset, pBuf, amt))>0 ){
amt -= wrote;
offset += wrote;
@@ -26402,6 +26694,14 @@ static int unixTruncate(sqlite3_file *id, i64 nByte){
}
#endif
+ /* If the file was just truncated to a size smaller than the currently
+ ** mapped region, reduce the effective mapping size as well. SQLite will
+ ** use read() and write() to access data beyond this point from now on.
+ */
+ if( nByte<pFile->mmapSize ){
+ pFile->mmapSize = nByte;
+ }
+
return SQLITE_OK;
}
}
@@ -26490,6 +26790,19 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
}
}
+ if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
+ int rc;
+ if( pFile->szChunk<=0 ){
+ if( robust_ftruncate(pFile->h, nByte) ){
+ pFile->lastErrno = errno;
+ return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath);
+ }
+ }
+
+ rc = unixMapfile(pFile, nByte);
+ return rc;
+ }
+
return SQLITE_OK;
}
@@ -26557,6 +26870,18 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
}
return SQLITE_OK;
}
+ case SQLITE_FCNTL_MMAP_SIZE: {
+ i64 newLimit = *(i64*)pArg;
+ if( newLimit>sqlite3GlobalConfig.mxMmap ){
+ newLimit = sqlite3GlobalConfig.mxMmap;
+ }
+ *(i64*)pArg = pFile->mmapSizeMax;
+ if( newLimit>=0 ){
+ pFile->mmapSizeMax = newLimit;
+ if( newLimit<pFile->mmapSize ) pFile->mmapSize = newLimit;
+ }
+ return SQLITE_OK;
+ }
#ifdef SQLITE_DEBUG
/* The pager calls this method to signal that it has done
** a rollback and that the database is therefore unchanged and
@@ -26869,7 +27194,7 @@ static void unixShmPurge(unixFile *pFd){
sqlite3_mutex_free(p->mutex);
for(i=0; i<p->nRegion; i++){
if( p->h>=0 ){
- munmap(p->apRegion[i], p->szRegion);
+ osMunmap(p->apRegion[i], p->szRegion);
}else{
sqlite3_free(p->apRegion[i]);
}
@@ -27109,24 +27434,32 @@ static int unixShmMap(
if( sStat.st_size<nByte ){
/* The requested memory region does not exist. If bExtend is set to
** false, exit early. *pp will be set to NULL and SQLITE_OK returned.
- **
- ** Alternatively, if bExtend is true, use ftruncate() to allocate
- ** the requested memory region.
*/
- if( !bExtend ) goto shmpage_out;
-#if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
- if( osFallocate(pShmNode->h, sStat.st_size, nByte)!=0 ){
- rc = unixLogError(SQLITE_IOERR_SHMSIZE, "fallocate",
- pShmNode->zFilename);
+ if( !bExtend ){
goto shmpage_out;
}
-#else
- if( robust_ftruncate(pShmNode->h, nByte) ){
- rc = unixLogError(SQLITE_IOERR_SHMSIZE, "ftruncate",
- pShmNode->zFilename);
- goto shmpage_out;
+
+ /* Alternatively, if bExtend is true, extend the file. Do this by
+ ** writing a single byte to the end of each (OS) page being
+ ** allocated or extended. Technically, we need only write to the
+ ** last page in order to extend the file. But writing to all new
+ ** pages forces the OS to allocate them immediately, which reduces
+ ** the chances of SIGBUS while accessing the mapped region later on.
+ */
+ else{
+ static const int pgsz = 4096;
+ int iPg;
+
+ /* Write to the last byte of each newly allocated or extended page */
+ assert( (nByte % pgsz)==0 );
+ for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
+ if( seekAndWriteFd(pShmNode->h, iPg*pgsz + pgsz-1, "", 1, 0)!=1 ){
+ const char *zFile = pShmNode->zFilename;
+ rc = unixLogError(SQLITE_IOERR_SHMSIZE, "write", zFile);
+ goto shmpage_out;
+ }
+ }
}
-#endif
}
}
@@ -27142,7 +27475,7 @@ static int unixShmMap(
while(pShmNode->nRegion<=iRegion){
void *pMem;
if( pShmNode->h>=0 ){
- pMem = mmap(0, szRegion,
+ pMem = osMmap(0, szRegion,
pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE,
MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
);
@@ -27360,6 +27693,236 @@ static int unixShmUnmap(
#endif /* #ifndef SQLITE_OMIT_WAL */
/*
+** If it is currently memory mapped, unmap file pFd.
+*/
+static void unixUnmapfile(unixFile *pFd){
+ assert( pFd->nFetchOut==0 );
+#if SQLITE_MAX_MMAP_SIZE>0
+ if( pFd->pMapRegion ){
+ osMunmap(pFd->pMapRegion, pFd->mmapSizeActual);
+ pFd->pMapRegion = 0;
+ pFd->mmapSize = 0;
+ pFd->mmapSizeActual = 0;
+ }
+#endif
+}
+
+#if SQLITE_MAX_MMAP_SIZE>0
+/*
+** Return the system page size.
+*/
+static int unixGetPagesize(void){
+#if HAVE_MREMAP
+ return 512;
+#elif defined(_BSD_SOURCE)
+ return getpagesize();
+#else
+ return (int)sysconf(_SC_PAGESIZE);
+#endif
+}
+#endif /* SQLITE_MAX_MMAP_SIZE>0 */
+
+#if SQLITE_MAX_MMAP_SIZE>0
+/*
+** Attempt to set the size of the memory mapping maintained by file
+** descriptor pFd to nNew bytes. Any existing mapping is discarded.
+**
+** If successful, this function sets the following variables:
+**
+** unixFile.pMapRegion
+** unixFile.mmapSize
+** unixFile.mmapSizeActual
+**
+** If unsuccessful, an error message is logged via sqlite3_log() and
+** the three variables above are zeroed. In this case SQLite should
+** continue accessing the database using the xRead() and xWrite()
+** methods.
+*/
+static void unixRemapfile(
+ unixFile *pFd, /* File descriptor object */
+ i64 nNew /* Required mapping size */
+){
+ const char *zErr = "mmap";
+ int h = pFd->h; /* File descriptor open on db file */
+ u8 *pOrig = (u8 *)pFd->pMapRegion; /* Pointer to current file mapping */
+ i64 nOrig = pFd->mmapSizeActual; /* Size of pOrig region in bytes */
+ u8 *pNew = 0; /* Location of new mapping */
+ int flags = PROT_READ; /* Flags to pass to mmap() */
+
+ assert( pFd->nFetchOut==0 );
+ assert( nNew>pFd->mmapSize );
+ assert( nNew<=pFd->mmapSizeMax );
+ assert( nNew>0 );
+ assert( pFd->mmapSizeActual>=pFd->mmapSize );
+ assert( MAP_FAILED!=0 );
+
+ if( (pFd->ctrlFlags & UNIXFILE_RDONLY)==0 ) flags |= PROT_WRITE;
+
+ if( pOrig ){
+ const int szSyspage = unixGetPagesize();
+ i64 nReuse = (pFd->mmapSize & ~(szSyspage-1));
+ u8 *pReq = &pOrig[nReuse];
+
+ /* Unmap any pages of the existing mapping that cannot be reused. */
+ if( nReuse!=nOrig ){
+ osMunmap(pReq, nOrig-nReuse);
+ }
+
+#if HAVE_MREMAP
+ pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE);
+ zErr = "mremap";
+#else
+ pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED, h, nReuse);
+ if( pNew!=MAP_FAILED ){
+ if( pNew!=pReq ){
+ osMunmap(pNew, nNew - nReuse);
+ pNew = 0;
+ }else{
+ pNew = pOrig;
+ }
+ }
+#endif
+
+ /* The attempt to extend the existing mapping failed. Free it. */
+ if( pNew==MAP_FAILED || pNew==0 ){
+ osMunmap(pOrig, nReuse);
+ }
+ }
+
+ /* If pNew is still NULL, try to create an entirely new mapping. */
+ if( pNew==0 ){
+ pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0);
+ }
+
+ if( pNew==MAP_FAILED ){
+ pNew = 0;
+ nNew = 0;
+ unixLogError(SQLITE_OK, zErr, pFd->zPath);
+
+ /* If the mmap() above failed, assume that all subsequent mmap() calls
+ ** will probably fail too. Fall back to using xRead/xWrite exclusively
+ ** in this case. */
+ pFd->mmapSizeMax = 0;
+ }
+ pFd->pMapRegion = (void *)pNew;
+ pFd->mmapSize = pFd->mmapSizeActual = nNew;
+}
+#endif
+
+/*
+** Memory map or remap the file opened by file-descriptor pFd (if the file
+** is already mapped, the existing mapping is replaced by the new). Or, if
+** there already exists a mapping for this file, and there are still
+** outstanding xFetch() references to it, this function is a no-op.
+**
+** If parameter nByte is non-negative, then it is the requested size of
+** the mapping to create. Otherwise, if nByte is less than zero, then the
+** requested size is the size of the file on disk. The actual size of the
+** created mapping is either the requested size or the value configured
+** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller.
+**
+** SQLITE_OK is returned if no error occurs (even if the mapping is not
+** recreated as a result of outstanding references) or an SQLite error
+** code otherwise.
+*/
+static int unixMapfile(unixFile *pFd, i64 nByte){
+#if SQLITE_MAX_MMAP_SIZE>0
+ i64 nMap = nByte;
+ int rc;
+
+ assert( nMap>=0 || pFd->nFetchOut==0 );
+ if( pFd->nFetchOut>0 ) return SQLITE_OK;
+
+ if( nMap<0 ){
+ struct stat statbuf; /* Low-level file information */
+ rc = osFstat(pFd->h, &statbuf);
+ if( rc!=SQLITE_OK ){
+ return SQLITE_IOERR_FSTAT;
+ }
+ nMap = statbuf.st_size;
+ }
+ if( nMap>pFd->mmapSizeMax ){
+ nMap = pFd->mmapSizeMax;
+ }
+
+ if( nMap!=pFd->mmapSize ){
+ if( nMap>0 ){
+ unixRemapfile(pFd, nMap);
+ }else{
+ unixUnmapfile(pFd);
+ }
+ }
+#endif
+
+ return SQLITE_OK;
+}
+
+/*
+** If possible, return a pointer to a mapping of file fd starting at offset
+** iOff. The mapping must be valid for at least nAmt bytes.
+**
+** If such a pointer can be obtained, store it in *pp and return SQLITE_OK.
+** Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK.
+** Finally, if an error does occur, return an SQLite error code. The final
+** value of *pp is undefined in this case.
+**
+** If this function does return a pointer, the caller must eventually
+** release the reference by calling unixUnfetch().
+*/
+static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
+#if SQLITE_MAX_MMAP_SIZE>0
+ unixFile *pFd = (unixFile *)fd; /* The underlying database file */
+#endif
+ *pp = 0;
+
+#if SQLITE_MAX_MMAP_SIZE>0
+ if( pFd->mmapSizeMax>0 ){
+ if( pFd->pMapRegion==0 ){
+ int rc = unixMapfile(pFd, -1);
+ if( rc!=SQLITE_OK ) return rc;
+ }
+ if( pFd->mmapSize >= iOff+nAmt ){
+ *pp = &((u8 *)pFd->pMapRegion)[iOff];
+ pFd->nFetchOut++;
+ }
+ }
+#endif
+ return SQLITE_OK;
+}
+
+/*
+** If the third argument is non-NULL, then this function releases a
+** reference obtained by an earlier call to unixFetch(). The second
+** argument passed to this function must be the same as the corresponding
+** argument that was passed to the unixFetch() invocation.
+**
+** Or, if the third argument is NULL, then this function is being called
+** to inform the VFS layer that, according to POSIX, any existing mapping
+** may now be invalid and should be unmapped.
+*/
+static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
+ unixFile *pFd = (unixFile *)fd; /* The underlying database file */
+ UNUSED_PARAMETER(iOff);
+
+ /* If p==0 (unmap the entire file) then there must be no outstanding
+ ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
+ ** then there must be at least one outstanding. */
+ assert( (p==0)==(pFd->nFetchOut==0) );
+
+ /* If p!=0, it must match the iOff value. */
+ assert( p==0 || p==&((u8 *)pFd->pMapRegion)[iOff] );
+
+ if( p ){
+ pFd->nFetchOut--;
+ }else{
+ unixUnmapfile(pFd);
+ }
+
+ assert( pFd->nFetchOut>=0 );
+ return SQLITE_OK;
+}
+
+/*
** Here ends the implementation of all sqlite3_file methods.
**
********************** End sqlite3_file Methods *******************************
@@ -27417,7 +27980,9 @@ static const sqlite3_io_methods METHOD = { \
unixShmMap, /* xShmMap */ \
unixShmLock, /* xShmLock */ \
unixShmBarrier, /* xShmBarrier */ \
- unixShmUnmap /* xShmUnmap */ \
+ unixShmUnmap, /* xShmUnmap */ \
+ unixFetch, /* xFetch */ \
+ unixUnfetch, /* xUnfetch */ \
}; \
static const sqlite3_io_methods *FINDER##Impl(const char *z, unixFile *p){ \
UNUSED_PARAMETER(z); UNUSED_PARAMETER(p); \
@@ -27434,7 +27999,7 @@ static const sqlite3_io_methods *(*const FINDER)(const char*,unixFile *p) \
IOMETHODS(
posixIoFinder, /* Finder function name */
posixIoMethods, /* sqlite3_io_methods object name */
- 2, /* shared memory is enabled */
+ 3, /* shared memory and mmap are enabled */
unixClose, /* xClose method */
unixLock, /* xLock method */
unixUnlock, /* xUnlock method */
@@ -27685,6 +28250,7 @@ static int fillInUnixFile(
pNew->pVfs = pVfs;
pNew->zPath = zFilename;
pNew->ctrlFlags = (u8)ctrlFlags;
+ pNew->mmapSizeMax = sqlite3GlobalConfig.szMmap;
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0),
"psow", SQLITE_POWERSAFE_OVERWRITE) ){
pNew->ctrlFlags |= UNIXFILE_PSOW;
@@ -27820,15 +28386,15 @@ static int fillInUnixFile(
if( h>=0 ) robust_close(pNew, h, __LINE__);
h = -1;
osUnlink(zFilename);
- isDelete = 0;
+ pNew->ctrlFlags |= UNIXFILE_DELETE;
}
- if( isDelete ) pNew->ctrlFlags |= UNIXFILE_DELETE;
#endif
if( rc!=SQLITE_OK ){
if( h>=0 ) robust_close(pNew, h, __LINE__);
}else{
pNew->pMethod = pLockingStyle;
OpenCounter(+1);
+ verifyDbFile(pNew);
}
return rc;
}
@@ -29922,7 +30488,7 @@ SQLITE_API int sqlite3_os_init(void){
/* Double-check that the aSyscall[] array has been constructed
** correctly. See ticket [bb3a86e890c8e96ab] */
- assert( ArraySize(aSyscall)==21 );
+ assert( ArraySize(aSyscall)==24 );
/* Register all VFSes defined in the aVfs[] array */
for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
@@ -30305,11 +30871,20 @@ struct winFile {
winceLock local; /* Locks obtained by this instance of winFile */
winceLock *shared; /* Global shared lock memory for the file */
#endif
+#if SQLITE_MAX_MMAP_SIZE>0
+ int nFetchOut; /* Number of outstanding xFetch references */
+ HANDLE hMap; /* Handle for accessing memory mapping */
+ void *pMapRegion; /* Area memory mapped */
+ sqlite3_int64 mmapSize; /* Usable size of mapped region */
+ sqlite3_int64 mmapSizeActual; /* Actual size of mapped region */
+ sqlite3_int64 mmapSizeMax; /* Configured FCNTL_MMAP_SIZE value */
+#endif
};
/*
** Allowed values for winFile.ctrlFlags
*/
+#define WINFILE_RDONLY 0x02 /* Connection is read only */
#define WINFILE_PERSIST_WAL 0x04 /* Persistent WAL mode */
#define WINFILE_PSOW 0x10 /* SQLITE_IOCAP_POWERSAFE_OVERWRITE */
@@ -31669,7 +32244,7 @@ static int getLastErrorMsg(DWORD lastErrno, int nBuf, char *zBuf){
}
#endif
if( 0 == dwLen ){
- sqlite3_snprintf(nBuf, zBuf, "OsError 0x%x (%u)", lastErrno, lastErrno);
+ sqlite3_snprintf(nBuf, zBuf, "OsError 0x%lx (%lu)", lastErrno, lastErrno);
}else{
/* copy a maximum of nBuf chars to output buffer */
sqlite3_snprintf(nBuf, zBuf, "%s", zOut);
@@ -31712,7 +32287,7 @@ static int winLogErrorAtLine(
for(i=0; zMsg[i] && zMsg[i]!='\r' && zMsg[i]!='\n'; i++){}
zMsg[i] = 0;
sqlite3_log(errcode,
- "os_win.c:%d: (%d) %s(%s) - %s",
+ "os_win.c:%d: (%lu) %s(%s) - %s",
iLine, lastErrno, zFunc, zPath, zMsg
);
@@ -32173,6 +32748,8 @@ static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){
DWORD dwRet; /* Value returned by SetFilePointer() */
DWORD lastErrno; /* Value returned by GetLastError() */
+ OSTRACE(("SEEK file=%p, offset=%lld\n", pFile->h, iOffset));
+
upperBits = (LONG)((iOffset>>32) & 0x7fffffff);
lowerBits = (LONG)(iOffset & 0xffffffff);
@@ -32190,9 +32767,11 @@ static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){
pFile->lastErrno = lastErrno;
winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
"seekWinFile", pFile->zPath);
+ OSTRACE(("SEEK file=%p, rc=SQLITE_IOERR_SEEK\n", pFile->h));
return 1;
}
+ OSTRACE(("SEEK file=%p, rc=SQLITE_OK\n", pFile->h));
return 0;
#else
/*
@@ -32209,13 +32788,20 @@ static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){
pFile->lastErrno = osGetLastError();
winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno,
"seekWinFile", pFile->zPath);
+ OSTRACE(("SEEK file=%p, rc=SQLITE_IOERR_SEEK\n", pFile->h));
return 1;
}
+ OSTRACE(("SEEK file=%p, rc=SQLITE_OK\n", pFile->h));
return 0;
#endif
}
+#if SQLITE_MAX_MMAP_SIZE>0
+/* Forward references to VFS methods */
+static int winUnmapfile(winFile*);
+#endif
+
/*
** Close a file.
**
@@ -32235,8 +32821,14 @@ static int winClose(sqlite3_file *id){
#ifndef SQLITE_OMIT_WAL
assert( pFile->pShm==0 );
#endif
- OSTRACE(("CLOSE %d\n", pFile->h));
assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
+ OSTRACE(("CLOSE file=%p\n", pFile->h));
+
+#if SQLITE_MAX_MMAP_SIZE>0
+ rc = winUnmapfile(pFile);
+ if( rc!=SQLITE_OK ) return rc;
+#endif
+
do{
rc = osCloseHandle(pFile->h);
/* SimulateIOError( rc=0; cnt=MX_CLOSE_ATTEMPT; ); */
@@ -32256,11 +32848,11 @@ static int winClose(sqlite3_file *id){
sqlite3_free(pFile->zDeleteOnClose);
}
#endif
- OSTRACE(("CLOSE %d %s\n", pFile->h, rc ? "ok" : "failed"));
if( rc ){
pFile->h = NULL;
}
OpenCounter(-1);
+ OSTRACE(("CLOSE file=%p, rc=%s\n", pFile->h, rc ? "ok" : "failed"));
return rc ? SQLITE_OK
: winLogError(SQLITE_IOERR_CLOSE, osGetLastError(),
"winClose", pFile->zPath);
@@ -32285,11 +32877,33 @@ static int winRead(
int nRetry = 0; /* Number of retrys */
assert( id!=0 );
+ assert( amt>0 );
+ assert( offset>=0 );
SimulateIOError(return SQLITE_IOERR_READ);
- OSTRACE(("READ %d lock=%d\n", pFile->h, pFile->locktype));
+ OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
+ pFile->h, pBuf, amt, offset, pFile->locktype));
+
+#if SQLITE_MAX_MMAP_SIZE>0
+ /* Deal with as much of this read request as possible by transfering
+ ** data from the memory mapping using memcpy(). */
+ if( offset<pFile->mmapSize ){
+ if( offset+amt <= pFile->mmapSize ){
+ memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt);
+ OSTRACE(("READ-MMAP file=%p, rc=SQLITE_OK\n", pFile->h));
+ return SQLITE_OK;
+ }else{
+ int nCopy = (int)(pFile->mmapSize - offset);
+ memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], nCopy);
+ pBuf = &((u8 *)pBuf)[nCopy];
+ amt -= nCopy;
+ offset += nCopy;
+ }
+ }
+#endif
#if SQLITE_OS_WINCE
if( seekWinFile(pFile, offset) ){
+ OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h));
return SQLITE_FULL;
}
while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){
@@ -32303,6 +32917,7 @@ static int winRead(
DWORD lastErrno;
if( retryIoerr(&nRetry, &lastErrno) ) continue;
pFile->lastErrno = lastErrno;
+ OSTRACE(("READ file=%p, rc=SQLITE_IOERR_READ\n", pFile->h));
return winLogError(SQLITE_IOERR_READ, pFile->lastErrno,
"winRead", pFile->zPath);
}
@@ -32310,9 +32925,11 @@ static int winRead(
if( nRead<(DWORD)amt ){
/* Unread parts of the buffer must be zero-filled */
memset(&((char*)pBuf)[nRead], 0, amt-nRead);
+ OSTRACE(("READ file=%p, rc=SQLITE_IOERR_SHORT_READ\n", pFile->h));
return SQLITE_IOERR_SHORT_READ;
}
+ OSTRACE(("READ file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
@@ -32335,7 +32952,26 @@ static int winWrite(
SimulateIOError(return SQLITE_IOERR_WRITE);
SimulateDiskfullError(return SQLITE_FULL);
- OSTRACE(("WRITE %d lock=%d\n", pFile->h, pFile->locktype));
+ OSTRACE(("WRITE file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n",
+ pFile->h, pBuf, amt, offset, pFile->locktype));
+
+#if SQLITE_MAX_MMAP_SIZE>0
+ /* Deal with as much of this write request as possible by transfering
+ ** data from the memory mapping using memcpy(). */
+ if( offset<pFile->mmapSize ){
+ if( offset+amt <= pFile->mmapSize ){
+ memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt);
+ OSTRACE(("WRITE-MMAP file=%p, rc=SQLITE_OK\n", pFile->h));
+ return SQLITE_OK;
+ }else{
+ int nCopy = (int)(pFile->mmapSize - offset);
+ memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, nCopy);
+ pBuf = &((u8 *)pBuf)[nCopy];
+ amt -= nCopy;
+ offset += nCopy;
+ }
+ }
+#endif
#if SQLITE_OS_WINCE
rc = seekWinFile(pFile, offset);
@@ -32388,13 +33024,16 @@ static int winWrite(
if( rc ){
if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL )
|| ( pFile->lastErrno==ERROR_DISK_FULL )){
+ OSTRACE(("WRITE file=%p, rc=SQLITE_FULL\n", pFile->h));
return SQLITE_FULL;
}
+ OSTRACE(("WRITE file=%p, rc=SQLITE_IOERR_WRITE\n", pFile->h));
return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno,
"winWrite", pFile->zPath);
}else{
logIoerr(nRetry);
}
+ OSTRACE(("WRITE file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
@@ -32404,11 +33043,12 @@ static int winWrite(
static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
winFile *pFile = (winFile*)id; /* File handle object */
int rc = SQLITE_OK; /* Return code for this function */
+ DWORD lastErrno;
assert( pFile );
-
- OSTRACE(("TRUNCATE %d %lld\n", pFile->h, nByte));
SimulateIOError(return SQLITE_IOERR_TRUNCATE);
+ OSTRACE(("TRUNCATE file=%p, size=%lld, lock=%d\n",
+ pFile->h, nByte, pFile->locktype));
/* If the user has configured a chunk-size for this file, truncate the
** file so that it consists of an integer number of chunks (i.e. the
@@ -32422,14 +33062,25 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
/* SetEndOfFile() returns non-zero when successful, or zero when it fails. */
if( seekWinFile(pFile, nByte) ){
rc = winLogError(SQLITE_IOERR_TRUNCATE, pFile->lastErrno,
- "winTruncate1", pFile->zPath);
- }else if( 0==osSetEndOfFile(pFile->h) ){
- pFile->lastErrno = osGetLastError();
+ "winTruncate1", pFile->zPath);
+ }else if( 0==osSetEndOfFile(pFile->h) &&
+ ((lastErrno = osGetLastError())!=ERROR_USER_MAPPED_FILE) ){
+ pFile->lastErrno = lastErrno;
rc = winLogError(SQLITE_IOERR_TRUNCATE, pFile->lastErrno,
- "winTruncate2", pFile->zPath);
+ "winTruncate2", pFile->zPath);
}
- OSTRACE(("TRUNCATE %d %lld %s\n", pFile->h, nByte, rc ? "failed" : "ok"));
+#if SQLITE_MAX_MMAP_SIZE>0
+ /* If the file was truncated to a size smaller than the currently
+ ** mapped region, reduce the effective mapping size as well. SQLite will
+ ** use read() and write() to access data beyond this point from now on.
+ */
+ if( pFile->pMapRegion && nByte<pFile->mmapSize ){
+ pFile->mmapSize = nByte;
+ }
+#endif
+
+ OSTRACE(("TRUNCATE file=%p, rc=%s\n", pFile->h, sqlite3ErrName(rc)));
return rc;
}
@@ -32469,13 +33120,14 @@ static int winSync(sqlite3_file *id, int flags){
|| (flags&0x0F)==SQLITE_SYNC_FULL
);
- OSTRACE(("SYNC %d lock=%d\n", pFile->h, pFile->locktype));
-
/* Unix cannot, but some systems may return SQLITE_FULL from here. This
** line is to test that doing so does not cause any problems.
*/
SimulateDiskfullError( return SQLITE_FULL );
+ OSTRACE(("SYNC file=%p, flags=%x, lock=%d\n",
+ pFile->h, flags, pFile->locktype));
+
#ifndef SQLITE_TEST
UNUSED_PARAMETER(flags);
#else
@@ -32494,9 +33146,11 @@ static int winSync(sqlite3_file *id, int flags){
rc = osFlushFileBuffers(pFile->h);
SimulateIOError( rc=FALSE );
if( rc ){
+ OSTRACE(("SYNC file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}else{
pFile->lastErrno = osGetLastError();
+ OSTRACE(("SYNC file=%p, rc=SQLITE_IOERR_FSYNC\n", pFile->h));
return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno,
"winSync", pFile->zPath);
}
@@ -32511,7 +33165,10 @@ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
int rc = SQLITE_OK;
assert( id!=0 );
+ assert( pSize!=0 );
SimulateIOError(return SQLITE_IOERR_FSTAT);
+ OSTRACE(("SIZE file=%p, pSize=%p\n", pFile->h, pSize));
+
#if SQLITE_OS_WINRT
{
FILE_STANDARD_INFO info;
@@ -32540,6 +33197,8 @@ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
}
}
#endif
+ OSTRACE(("SIZE file=%p, pSize=%p, *pSize=%lld, rc=%s\n",
+ pFile->h, pSize, *pSize, sqlite3ErrName(rc)));
return rc;
}
@@ -32581,6 +33240,7 @@ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
*/
static int getReadLock(winFile *pFile){
int res;
+ OSTRACE(("READ-LOCK file=%p, lock=%d\n", pFile->h, pFile->locktype));
if( isNT() ){
#if SQLITE_OS_WINCE
/*
@@ -32606,6 +33266,7 @@ static int getReadLock(winFile *pFile){
pFile->lastErrno = osGetLastError();
/* No need to log a failure to lock */
}
+ OSTRACE(("READ-LOCK file=%p, rc=%s\n", pFile->h, sqlite3ErrName(res)));
return res;
}
@@ -32615,6 +33276,7 @@ static int getReadLock(winFile *pFile){
static int unlockReadLock(winFile *pFile){
int res;
DWORD lastErrno;
+ OSTRACE(("READ-UNLOCK file=%p, lock=%d\n", pFile->h, pFile->locktype));
if( isNT() ){
res = winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
}
@@ -32628,6 +33290,7 @@ static int unlockReadLock(winFile *pFile){
winLogError(SQLITE_IOERR_UNLOCK, pFile->lastErrno,
"unlockReadLock", pFile->zPath);
}
+ OSTRACE(("READ-UNLOCK file=%p, rc=%s\n", pFile->h, sqlite3ErrName(res)));
return res;
}
@@ -32666,14 +33329,15 @@ static int winLock(sqlite3_file *id, int locktype){
DWORD lastErrno = NO_ERROR;
assert( id!=0 );
- OSTRACE(("LOCK %d %d was %d(%d)\n",
- pFile->h, locktype, pFile->locktype, pFile->sharedLockByte));
+ OSTRACE(("LOCK file=%p, oldLock=%d(%d), newLock=%d\n",
+ pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
/* If there is already a lock of this type or more restrictive on the
** OsFile, do nothing. Don't use the end_lock: exit path, as
** sqlite3OsEnterMutex() hasn't been called yet.
*/
if( pFile->locktype>=locktype ){
+ OSTRACE(("LOCK-HELD file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
@@ -32701,7 +33365,8 @@ static int winLock(sqlite3_file *id, int locktype){
** If you are using this code as a model for alternative VFSes, do not
** copy this retry logic. It is a hack intended for Windows only.
*/
- OSTRACE(("could not get a PENDING lock. cnt=%d\n", cnt));
+ OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, rc=%s\n",
+ pFile->h, cnt, sqlite3ErrName(res)));
if( cnt ) sqlite3_win32_sleep(1);
}
gotPendingLock = res;
@@ -32746,14 +33411,12 @@ static int winLock(sqlite3_file *id, int locktype){
if( locktype==EXCLUSIVE_LOCK && res ){
assert( pFile->locktype>=SHARED_LOCK );
res = unlockReadLock(pFile);
- OSTRACE(("unreadlock = %d\n", res));
res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, SHARED_FIRST, 0,
SHARED_SIZE, 0);
if( res ){
newLocktype = EXCLUSIVE_LOCK;
}else{
lastErrno = osGetLastError();
- OSTRACE(("error-code = %d\n", lastErrno));
getReadLock(pFile);
}
}
@@ -32771,12 +33434,14 @@ static int winLock(sqlite3_file *id, int locktype){
if( res ){
rc = SQLITE_OK;
}else{
- OSTRACE(("LOCK FAILED %d trying for %d but got %d\n", pFile->h,
- locktype, newLocktype));
+ OSTRACE(("LOCK-FAIL file=%p, wanted=%d, got=%d\n",
+ pFile->h, locktype, newLocktype));
pFile->lastErrno = lastErrno;
rc = SQLITE_BUSY;
}
pFile->locktype = (u8)newLocktype;
+ OSTRACE(("LOCK file=%p, lock=%d, rc=%s\n",
+ pFile->h, pFile->locktype, sqlite3ErrName(rc)));
return rc;
}
@@ -32790,20 +33455,23 @@ static int winCheckReservedLock(sqlite3_file *id, int *pResOut){
winFile *pFile = (winFile*)id;
SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );
+ OSTRACE(("TEST-WR-LOCK file=%p, pResOut=%p\n", pFile->h, pResOut));
assert( id!=0 );
if( pFile->locktype>=RESERVED_LOCK ){
rc = 1;
- OSTRACE(("TEST WR-LOCK %d %d (local)\n", pFile->h, rc));
+ OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (local)\n", pFile->h, rc));
}else{
rc = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0);
if( rc ){
winUnlockFile(&pFile->h, RESERVED_BYTE, 0, 1, 0);
}
rc = !rc;
- OSTRACE(("TEST WR-LOCK %d %d (remote)\n", pFile->h, rc));
+ OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (remote)\n", pFile->h, rc));
}
*pResOut = rc;
+ OSTRACE(("TEST-WR-LOCK file=%p, pResOut=%p, *pResOut=%d, rc=SQLITE_OK\n",
+ pFile->h, pResOut, *pResOut));
return SQLITE_OK;
}
@@ -32824,8 +33492,8 @@ static int winUnlock(sqlite3_file *id, int locktype){
int rc = SQLITE_OK;
assert( pFile!=0 );
assert( locktype<=SHARED_LOCK );
- OSTRACE(("UNLOCK %d to %d was %d(%d)\n", pFile->h, locktype,
- pFile->locktype, pFile->sharedLockByte));
+ OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n",
+ pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
type = pFile->locktype;
if( type>=EXCLUSIVE_LOCK ){
winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
@@ -32846,6 +33514,8 @@ static int winUnlock(sqlite3_file *id, int locktype){
winUnlockFile(&pFile->h, PENDING_BYTE, 0, 1, 0);
}
pFile->locktype = (u8)locktype;
+ OSTRACE(("UNLOCK file=%p, lock=%d, rc=%s\n",
+ pFile->h, pFile->locktype, sqlite3ErrName(rc)));
return rc;
}
@@ -32873,17 +33543,21 @@ static int getTempname(int nBuf, char *zBuf);
*/
static int winFileControl(sqlite3_file *id, int op, void *pArg){
winFile *pFile = (winFile*)id;
+ OSTRACE(("FCNTL file=%p, op=%d, pArg=%p\n", pFile->h, op, pArg));
switch( op ){
case SQLITE_FCNTL_LOCKSTATE: {
*(int*)pArg = pFile->locktype;
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_LAST_ERRNO: {
*(int*)pArg = (int)pFile->lastErrno;
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_CHUNK_SIZE: {
pFile->szChunk = *(int *)pArg;
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_SIZE_HINT: {
@@ -32898,20 +33572,25 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
SimulateIOErrorBenign(0);
}
}
+ OSTRACE(("FCNTL file=%p, rc=%s\n", pFile->h, sqlite3ErrName(rc)));
return rc;
}
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_PERSIST_WAL: {
winModeBit(pFile, WINFILE_PERSIST_WAL, (int*)pArg);
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_POWERSAFE_OVERWRITE: {
winModeBit(pFile, WINFILE_PSOW, (int*)pArg);
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_VFSNAME: {
*(char**)pArg = sqlite3_mprintf("win32");
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_WIN32_AV_RETRY: {
@@ -32926,6 +33605,7 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
}else{
a[1] = win32IoerrRetryDelay;
}
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
case SQLITE_FCNTL_TEMPFILENAME: {
@@ -32934,9 +33614,23 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
getTempname(pFile->pVfs->mxPathname, zTFile);
*(char**)pArg = zTFile;
}
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
+ return SQLITE_OK;
+ }
+#if SQLITE_MAX_MMAP_SIZE>0
+ case SQLITE_FCNTL_MMAP_SIZE: {
+ i64 newLimit = *(i64*)pArg;
+ if( newLimit>sqlite3GlobalConfig.mxMmap ){
+ newLimit = sqlite3GlobalConfig.mxMmap;
+ }
+ *(i64*)pArg = pFile->mmapSizeMax;
+ if( newLimit>=0 ) pFile->mmapSizeMax = newLimit;
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_OK\n", pFile->h));
return SQLITE_OK;
}
+#endif
}
+ OSTRACE(("FCNTL file=%p, rc=SQLITE_NOTFOUND\n", pFile->h));
return SQLITE_NOTFOUND;
}
@@ -32964,8 +33658,6 @@ static int winDeviceCharacteristics(sqlite3_file *id){
((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
}
-#ifndef SQLITE_OMIT_WAL
-
/*
** Windows will only let you create file view mappings
** on allocation size granularity boundaries.
@@ -32974,6 +33666,8 @@ static int winDeviceCharacteristics(sqlite3_file *id){
*/
SYSTEM_INFO winSysInfo;
+#ifndef SQLITE_OMIT_WAL
+
/*
** Helper functions to obtain and relinquish the global mutex. The
** global mutex is used to protect the winLockInfo objects used by
@@ -33097,6 +33791,9 @@ static int winShmSystemLock(
/* Access to the winShmNode object is serialized by the caller */
assert( sqlite3_mutex_held(pFile->mutex) || pFile->nRef==0 );
+ OSTRACE(("SHM-LOCK file=%p, lock=%d, offset=%d, size=%d\n",
+ pFile->hFile.h, lockType, ofst, nByte));
+
/* Release/Acquire the system-level lock */
if( lockType==_SHM_UNLCK ){
rc = winUnlockFile(&pFile->hFile.h, ofst, 0, nByte, 0);
@@ -33114,11 +33811,9 @@ static int winShmSystemLock(
rc = SQLITE_BUSY;
}
- OSTRACE(("SHM-LOCK %d %s %s 0x%08lx\n",
- pFile->hFile.h,
- rc==SQLITE_OK ? "ok" : "failed",
- lockType==_SHM_UNLCK ? "UnlockFileEx" : "LockFileEx",
- pFile->lastErrno));
+ OSTRACE(("SHM-LOCK file=%p, func=%s, errno=%lu, rc=%s\n",
+ pFile->hFile.h, (lockType == _SHM_UNLCK) ? "winUnlockFile" :
+ "winLockFile", pFile->lastErrno, sqlite3ErrName(rc)));
return rc;
}
@@ -33138,6 +33833,8 @@ static void winShmPurge(sqlite3_vfs *pVfs, int deleteFlag){
winShmNode *p;
BOOL bRc;
assert( winShmMutexHeld() );
+ OSTRACE(("SHM-PURGE pid=%lu, deleteFlag=%d\n",
+ osGetCurrentProcessId(), deleteFlag));
pp = &winShmNodeList;
while( (p = *pp)!=0 ){
if( p->nRef==0 ){
@@ -33145,13 +33842,11 @@ static void winShmPurge(sqlite3_vfs *pVfs, int deleteFlag){
if( p->mutex ) sqlite3_mutex_free(p->mutex);
for(i=0; i<p->nRegion; i++){
bRc = osUnmapViewOfFile(p->aRegion[i].pMap);
- OSTRACE(("SHM-PURGE pid-%d unmap region=%d %s\n",
- (int)osGetCurrentProcessId(), i,
- bRc ? "ok" : "failed"));
+ OSTRACE(("SHM-PURGE-UNMAP pid=%lu, region=%d, rc=%s\n",
+ osGetCurrentProcessId(), i, bRc ? "ok" : "failed"));
bRc = osCloseHandle(p->aRegion[i].hMap);
- OSTRACE(("SHM-PURGE pid-%d close region=%d %s\n",
- (int)osGetCurrentProcessId(), i,
- bRc ? "ok" : "failed"));
+ OSTRACE(("SHM-PURGE-CLOSE pid=%lu, region=%d, rc=%s\n",
+ osGetCurrentProcessId(), i, bRc ? "ok" : "failed"));
}
if( p->hFile.h!=NULL && p->hFile.h!=INVALID_HANDLE_VALUE ){
SimulateIOErrorBenign(1);
@@ -33430,9 +34125,9 @@ static int winShmLock(
}
}
sqlite3_mutex_leave(pShmNode->mutex);
- OSTRACE(("SHM-LOCK shmid-%d, pid-%d got %03x,%03x %s\n",
- p->id, (int)osGetCurrentProcessId(), p->sharedMask, p->exclMask,
- rc ? "failed" : "ok"));
+ OSTRACE(("SHM-LOCK pid=%lu, id=%d, sharedMask=%03x, exclMask=%03x, rc=%s\n",
+ osGetCurrentProcessId(), p->id, p->sharedMask, p->exclMask,
+ sqlite3ErrName(rc)));
return rc;
}
@@ -33553,8 +34248,8 @@ static int winShmMap(
NULL, PAGE_READWRITE, 0, nByte, NULL
);
#endif
- OSTRACE(("SHM-MAP pid-%d create region=%d nbyte=%d %s\n",
- (int)osGetCurrentProcessId(), pShmNode->nRegion, nByte,
+ OSTRACE(("SHM-MAP-CREATE pid=%lu, region=%d, size=%d, rc=%s\n",
+ osGetCurrentProcessId(), pShmNode->nRegion, nByte,
hMap ? "ok" : "failed"));
if( hMap ){
int iOffset = pShmNode->nRegion*szRegion;
@@ -33568,8 +34263,8 @@ static int winShmMap(
0, iOffset - iOffsetShift, szRegion + iOffsetShift
);
#endif
- OSTRACE(("SHM-MAP pid-%d map region=%d offset=%d size=%d %s\n",
- (int)osGetCurrentProcessId(), pShmNode->nRegion, iOffset,
+ OSTRACE(("SHM-MAP-MAP pid=%lu, region=%d, offset=%d, size=%d, rc=%s\n",
+ osGetCurrentProcessId(), pShmNode->nRegion, iOffset,
szRegion, pMap ? "ok" : "failed"));
}
if( !pMap ){
@@ -33607,6 +34302,230 @@ shmpage_out:
#endif /* #ifndef SQLITE_OMIT_WAL */
/*
+** Cleans up the mapped region of the specified file, if any.
+*/
+#if SQLITE_MAX_MMAP_SIZE>0
+static int winUnmapfile(winFile *pFile){
+ assert( pFile!=0 );
+ OSTRACE(("UNMAP-FILE pid=%lu, pFile=%p, hMap=%p, pMapRegion=%p, "
+ "mmapSize=%lld, mmapSizeActual=%lld, mmapSizeMax=%lld\n",
+ osGetCurrentProcessId(), pFile, pFile->hMap, pFile->pMapRegion,
+ pFile->mmapSize, pFile->mmapSizeActual, pFile->mmapSizeMax));
+ if( pFile->pMapRegion ){
+ if( !osUnmapViewOfFile(pFile->pMapRegion) ){
+ pFile->lastErrno = osGetLastError();
+ OSTRACE(("UNMAP-FILE pid=%lu, pFile=%p, pMapRegion=%p, "
+ "rc=SQLITE_IOERR_MMAP\n", osGetCurrentProcessId(), pFile,
+ pFile->pMapRegion));
+ return winLogError(SQLITE_IOERR_MMAP, pFile->lastErrno,
+ "winUnmap1", pFile->zPath);
+ }
+ pFile->pMapRegion = 0;
+ pFile->mmapSize = 0;
+ pFile->mmapSizeActual = 0;
+ }
+ if( pFile->hMap!=NULL ){
+ if( !osCloseHandle(pFile->hMap) ){
+ pFile->lastErrno = osGetLastError();
+ OSTRACE(("UNMAP-FILE pid=%lu, pFile=%p, hMap=%p, rc=SQLITE_IOERR_MMAP\n",
+ osGetCurrentProcessId(), pFile, pFile->hMap));
+ return winLogError(SQLITE_IOERR_MMAP, pFile->lastErrno,
+ "winUnmap2", pFile->zPath);
+ }
+ pFile->hMap = NULL;
+ }
+ OSTRACE(("UNMAP-FILE pid=%lu, pFile=%p, rc=SQLITE_OK\n",
+ osGetCurrentProcessId(), pFile));
+ return SQLITE_OK;
+}
+
+/*
+** Memory map or remap the file opened by file-descriptor pFd (if the file
+** is already mapped, the existing mapping is replaced by the new). Or, if
+** there already exists a mapping for this file, and there are still
+** outstanding xFetch() references to it, this function is a no-op.
+**
+** If parameter nByte is non-negative, then it is the requested size of
+** the mapping to create. Otherwise, if nByte is less than zero, then the
+** requested size is the size of the file on disk. The actual size of the
+** created mapping is either the requested size or the value configured
+** using SQLITE_FCNTL_MMAP_SIZE, whichever is smaller.
+**
+** SQLITE_OK is returned if no error occurs (even if the mapping is not
+** recreated as a result of outstanding references) or an SQLite error
+** code otherwise.
+*/
+static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
+ sqlite3_int64 nMap = nByte;
+ int rc;
+
+ assert( nMap>=0 || pFd->nFetchOut==0 );
+ OSTRACE(("MAP-FILE pid=%lu, pFile=%p, size=%lld\n",
+ osGetCurrentProcessId(), pFd, nByte));
+
+ if( pFd->nFetchOut>0 ) return SQLITE_OK;
+
+ if( nMap<0 ){
+ rc = winFileSize((sqlite3_file*)pFd, &nMap);
+ if( rc ){
+ OSTRACE(("MAP-FILE pid=%lu, pFile=%p, rc=SQLITE_IOERR_FSTAT\n",
+ osGetCurrentProcessId(), pFd));
+ return SQLITE_IOERR_FSTAT;
+ }
+ }
+ if( nMap>pFd->mmapSizeMax ){
+ nMap = pFd->mmapSizeMax;
+ }
+ nMap &= ~(sqlite3_int64)(winSysInfo.dwPageSize - 1);
+
+ if( nMap==0 && pFd->mmapSize>0 ){
+ winUnmapfile(pFd);
+ }
+ if( nMap!=pFd->mmapSize ){
+ void *pNew = 0;
+ DWORD protect = PAGE_READONLY;
+ DWORD flags = FILE_MAP_READ;
+
+ winUnmapfile(pFd);
+ if( (pFd->ctrlFlags & WINFILE_RDONLY)==0 ){
+ protect = PAGE_READWRITE;
+ flags |= FILE_MAP_WRITE;
+ }
+#if SQLITE_OS_WINRT
+ pFd->hMap = osCreateFileMappingFromApp(pFd->h, NULL, protect, nMap, NULL);
+#elif defined(SQLITE_WIN32_HAS_WIDE)
+ pFd->hMap = osCreateFileMappingW(pFd->h, NULL, protect,
+ (DWORD)((nMap>>32) & 0xffffffff),
+ (DWORD)(nMap & 0xffffffff), NULL);
+#elif defined(SQLITE_WIN32_HAS_ANSI)
+ pFd->hMap = osCreateFileMappingA(pFd->h, NULL, protect,
+ (DWORD)((nMap>>32) & 0xffffffff),
+ (DWORD)(nMap & 0xffffffff), NULL);
+#endif
+ if( pFd->hMap==NULL ){
+ pFd->lastErrno = osGetLastError();
+ rc = winLogError(SQLITE_IOERR_MMAP, pFd->lastErrno,
+ "winMapfile", pFd->zPath);
+ /* Log the error, but continue normal operation using xRead/xWrite */
+ OSTRACE(("MAP-FILE-CREATE pid=%lu, pFile=%p, rc=SQLITE_IOERR_MMAP\n",
+ osGetCurrentProcessId(), pFd));
+ return SQLITE_OK;
+ }
+ assert( (nMap % winSysInfo.dwPageSize)==0 );
+#if SQLITE_OS_WINRT
+ pNew = osMapViewOfFileFromApp(pFd->hMap, flags, 0, nMap);
+#else
+ assert( sizeof(SIZE_T)==sizeof(sqlite3_int64) || nMap<=0xffffffff );
+ pNew = osMapViewOfFile(pFd->hMap, flags, 0, 0, (SIZE_T)nMap);
+#endif
+ if( pNew==NULL ){
+ osCloseHandle(pFd->hMap);
+ pFd->hMap = NULL;
+ pFd->lastErrno = osGetLastError();
+ winLogError(SQLITE_IOERR_MMAP, pFd->lastErrno,
+ "winMapfile", pFd->zPath);
+ OSTRACE(("MAP-FILE-MAP pid=%lu, pFile=%p, rc=SQLITE_IOERR_MMAP\n",
+ osGetCurrentProcessId(), pFd));
+ return SQLITE_OK;
+ }
+ pFd->pMapRegion = pNew;
+ pFd->mmapSize = nMap;
+ pFd->mmapSizeActual = nMap;
+ }
+
+ OSTRACE(("MAP-FILE pid=%lu, pFile=%p, rc=SQLITE_OK\n",
+ osGetCurrentProcessId(), pFd));
+ return SQLITE_OK;
+}
+#endif /* SQLITE_MAX_MMAP_SIZE>0 */
+
+/*
+** If possible, return a pointer to a mapping of file fd starting at offset
+** iOff. The mapping must be valid for at least nAmt bytes.
+**
+** If such a pointer can be obtained, store it in *pp and return SQLITE_OK.
+** Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK.
+** Finally, if an error does occur, return an SQLite error code. The final
+** value of *pp is undefined in this case.
+**
+** If this function does return a pointer, the caller must eventually
+** release the reference by calling winUnfetch().
+*/
+static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
+#if SQLITE_MAX_MMAP_SIZE>0
+ winFile *pFd = (winFile*)fd; /* The underlying database file */
+#endif
+ *pp = 0;
+
+ OSTRACE(("FETCH pid=%lu, pFile=%p, offset=%lld, amount=%d, pp=%p\n",
+ osGetCurrentProcessId(), fd, iOff, nAmt, pp));
+
+#if SQLITE_MAX_MMAP_SIZE>0
+ if( pFd->mmapSizeMax>0 ){
+ if( pFd->pMapRegion==0 ){
+ int rc = winMapfile(pFd, -1);
+ if( rc!=SQLITE_OK ){
+ OSTRACE(("FETCH pid=%lu, pFile=%p, rc=%s\n",
+ osGetCurrentProcessId(), pFd, sqlite3ErrName(rc)));
+ return rc;
+ }
+ }
+ if( pFd->mmapSize >= iOff+nAmt ){
+ *pp = &((u8 *)pFd->pMapRegion)[iOff];
+ pFd->nFetchOut++;
+ }
+ }
+#endif
+
+ OSTRACE(("FETCH pid=%lu, pFile=%p, pp=%p, *pp=%p, rc=SQLITE_OK\n",
+ osGetCurrentProcessId(), fd, pp, *pp));
+ return SQLITE_OK;
+}
+
+/*
+** If the third argument is non-NULL, then this function releases a
+** reference obtained by an earlier call to winFetch(). The second
+** argument passed to this function must be the same as the corresponding
+** argument that was passed to the winFetch() invocation.
+**
+** Or, if the third argument is NULL, then this function is being called
+** to inform the VFS layer that, according to POSIX, any existing mapping
+** may now be invalid and should be unmapped.
+*/
+static int winUnfetch(sqlite3_file *fd, i64 iOff, void *p){
+#if SQLITE_MAX_MMAP_SIZE>0
+ winFile *pFd = (winFile*)fd; /* The underlying database file */
+
+ /* If p==0 (unmap the entire file) then there must be no outstanding
+ ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference),
+ ** then there must be at least one outstanding. */
+ assert( (p==0)==(pFd->nFetchOut==0) );
+
+ /* If p!=0, it must match the iOff value. */
+ assert( p==0 || p==&((u8 *)pFd->pMapRegion)[iOff] );
+
+ OSTRACE(("UNFETCH pid=%lu, pFile=%p, offset=%lld, p=%p\n",
+ osGetCurrentProcessId(), pFd, iOff, p));
+
+ if( p ){
+ pFd->nFetchOut--;
+ }else{
+ /* FIXME: If Windows truly always prevents truncating or deleting a
+ ** file while a mapping is held, then the following winUnmapfile() call
+ ** is unnecessary can can be omitted - potentially improving
+ ** performance. */
+ winUnmapfile(pFd);
+ }
+
+ assert( pFd->nFetchOut>=0 );
+#endif
+
+ OSTRACE(("UNFETCH pid=%lu, pFile=%p, rc=SQLITE_OK\n",
+ osGetCurrentProcessId(), fd));
+ return SQLITE_OK;
+}
+
+/*
** Here ends the implementation of all sqlite3_file methods.
**
********************** End sqlite3_file Methods *******************************
@@ -33617,7 +34536,7 @@ shmpage_out:
** sqlite3_file for win32.
*/
static const sqlite3_io_methods winIoMethod = {
- 2, /* iVersion */
+ 3, /* iVersion */
winClose, /* xClose */
winRead, /* xRead */
winWrite, /* xWrite */
@@ -33633,7 +34552,9 @@ static const sqlite3_io_methods winIoMethod = {
winShmMap, /* xShmMap */
winShmLock, /* xShmLock */
winShmBarrier, /* xShmBarrier */
- winShmUnmap /* xShmUnmap */
+ winShmUnmap, /* xShmUnmap */
+ winFetch, /* xFetch */
+ winUnfetch /* xUnfetch */
};
/****************************************************************************
@@ -33697,6 +34618,7 @@ static int getTempname(int nBuf, char *zBuf){
sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", zMulti);
sqlite3_free(zMulti);
}else{
+ OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n"));
return SQLITE_IOERR_NOMEM;
}
}
@@ -33710,6 +34632,7 @@ static int getTempname(int nBuf, char *zBuf){
sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", zUtf8);
sqlite3_free(zUtf8);
}else{
+ OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n"));
return SQLITE_IOERR_NOMEM;
}
}
@@ -33722,6 +34645,7 @@ static int getTempname(int nBuf, char *zBuf){
nTempPath = sqlite3Strlen30(zTempPath);
if( (nTempPath + sqlite3Strlen30(SQLITE_TEMP_FILE_PREFIX) + 18) >= nBuf ){
+ OSTRACE(("TEMP-FILENAME rc=SQLITE_ERROR\n"));
return SQLITE_ERROR;
}
@@ -33739,8 +34663,8 @@ static int getTempname(int nBuf, char *zBuf){
zBuf[j] = 0;
zBuf[j+1] = 0;
- OSTRACE(("TEMP FILENAME: %s\n", zBuf));
- return SQLITE_OK;
+ OSTRACE(("TEMP-FILENAME name=%s, rc=SQLITE_OK\n", zBuf));
+ return SQLITE_OK;
}
/*
@@ -33809,9 +34733,7 @@ static int winOpen(
int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE);
int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE);
int isCreate = (flags & SQLITE_OPEN_CREATE);
-#ifndef NDEBUG
int isReadonly = (flags & SQLITE_OPEN_READONLY);
-#endif
int isReadWrite = (flags & SQLITE_OPEN_READWRITE);
#ifndef NDEBUG
@@ -33822,6 +34744,9 @@ static int winOpen(
));
#endif
+ OSTRACE(("OPEN name=%s, pFile=%p, flags=%x, pOutFlags=%p\n",
+ zUtf8Name, id, flags, pOutFlags));
+
/* Check the following statements are true:
**
** (a) Exactly one of the READWRITE and READONLY flags must be set, and
@@ -33867,6 +34792,7 @@ static int winOpen(
memset(zTmpname, 0, MAX_PATH+2);
rc = getTempname(MAX_PATH+2, zTmpname);
if( rc!=SQLITE_OK ){
+ OSTRACE(("OPEN name=%s, rc=%s", zUtf8Name, sqlite3ErrName(rc)));
return rc;
}
zUtf8Name = zTmpname;
@@ -33882,11 +34808,13 @@ static int winOpen(
/* Convert the filename to the system encoding. */
zConverted = convertUtf8Filename(zUtf8Name);
if( zConverted==0 ){
+ OSTRACE(("OPEN name=%s, rc=SQLITE_IOERR_NOMEM", zUtf8Name));
return SQLITE_IOERR_NOMEM;
}
if( winIsDir(zConverted) ){
sqlite3_free(zConverted);
+ OSTRACE(("OPEN name=%s, rc=SQLITE_CANTOPEN_ISDIR", zUtf8Name));
return SQLITE_CANTOPEN_ISDIR;
}
@@ -33977,9 +34905,8 @@ static int winOpen(
#endif
logIoerr(cnt);
- OSTRACE(("OPEN %d %s 0x%lx %s\n",
- h, zName, dwDesiredAccess,
- h==INVALID_HANDLE_VALUE ? "failed" : "ok"));
+ OSTRACE(("OPEN file=%p, name=%s, access=%lx, rc=%s\n", h, zUtf8Name,
+ dwDesiredAccess, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
if( h==INVALID_HANDLE_VALUE ){
pFile->lastErrno = lastErrno;
@@ -34003,12 +34930,17 @@ static int winOpen(
}
}
+ OSTRACE(("OPEN file=%p, name=%s, access=%lx, pOutFlags=%p, *pOutFlags=%d, "
+ "rc=%s\n", h, zUtf8Name, dwDesiredAccess, pOutFlags, pOutFlags ?
+ *pOutFlags : 0, (h==INVALID_HANDLE_VALUE) ? "failed" : "ok"));
+
#if SQLITE_OS_WINCE
if( isReadWrite && eType==SQLITE_OPEN_MAIN_DB
&& (rc = winceCreateLock(zName, pFile))!=SQLITE_OK
){
osCloseHandle(h);
sqlite3_free(zConverted);
+ OSTRACE(("OPEN-CE-LOCK name=%s, rc=%s\n", zName, sqlite3ErrName(rc)));
return rc;
}
if( isTemp ){
@@ -34022,11 +34954,21 @@ static int winOpen(
pFile->pMethod = &winIoMethod;
pFile->pVfs = pVfs;
pFile->h = h;
+ if( isReadonly ){
+ pFile->ctrlFlags |= WINFILE_RDONLY;
+ }
if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){
pFile->ctrlFlags |= WINFILE_PSOW;
}
pFile->lastErrno = NO_ERROR;
pFile->zPath = zName;
+#if SQLITE_MAX_MMAP_SIZE>0
+ pFile->hMap = NULL;
+ pFile->pMapRegion = 0;
+ pFile->mmapSize = 0;
+ pFile->mmapSizeActual = 0;
+ pFile->mmapSizeMax = sqlite3GlobalConfig.szMmap;
+#endif
OpenCounter(+1);
return rc;
@@ -34058,6 +35000,8 @@ static int winDelete(
UNUSED_PARAMETER(syncDir);
SimulateIOError(return SQLITE_IOERR_DELETE);
+ OSTRACE(("DELETE name=%s, syncDir=%d\n", zFilename, syncDir));
+
zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
return SQLITE_IOERR_NOMEM;
@@ -34143,7 +35087,7 @@ static int winDelete(
logIoerr(cnt);
}
sqlite3_free(zConverted);
- OSTRACE(("DELETE \"%s\" %s\n", zFilename, (rc ? "failed" : "ok" )));
+ OSTRACE(("DELETE name=%s, rc=%s\n", zFilename, sqlite3ErrName(rc)));
return rc;
}
@@ -34163,8 +35107,12 @@ static int winAccess(
UNUSED_PARAMETER(pVfs);
SimulateIOError( return SQLITE_IOERR_ACCESS; );
+ OSTRACE(("ACCESS name=%s, flags=%x, pResOut=%p\n",
+ zFilename, flags, pResOut));
+
zConverted = convertUtf8Filename(zFilename);
if( zConverted==0 ){
+ OSTRACE(("ACCESS name=%s, rc=SQLITE_IOERR_NOMEM\n", zFilename));
return SQLITE_IOERR_NOMEM;
}
if( isNT() ){
@@ -34215,6 +35163,8 @@ static int winAccess(
assert(!"Invalid flags argument");
}
*pResOut = rc;
+ OSTRACE(("ACCESS name=%s, pResOut=%p, *pResOut=%d, rc=SQLITE_OK\n",
+ zFilename, pResOut, *pResOut));
return SQLITE_OK;
}
@@ -34655,7 +35605,6 @@ SQLITE_API int sqlite3_os_init(void){
** correctly. See ticket [bb3a86e890c8e96ab] */
assert( ArraySize(aSyscall)==74 );
-#ifndef SQLITE_OMIT_WAL
/* get memory map allocation granularity */
memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));
#if SQLITE_OS_WINRT
@@ -34663,8 +35612,8 @@ SQLITE_API int sqlite3_os_init(void){
#else
osGetSystemInfo(&winSysInfo);
#endif
- assert(winSysInfo.dwAllocationGranularity > 0);
-#endif
+ assert( winSysInfo.dwAllocationGranularity>0 );
+ assert( winSysInfo.dwPageSize>0 );
sqlite3_vfs_register(&winVfs, 1);
return SQLITE_OK;
@@ -37301,7 +38250,6 @@ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 i
# define sqlite3WalClose(w,x,y,z) 0
# define sqlite3WalBeginReadTransaction(y,z) 0
# define sqlite3WalEndReadTransaction(z)
-# define sqlite3WalRead(v,w,x,y,z) 0
# define sqlite3WalDbsize(y) 0
# define sqlite3WalBeginWriteTransaction(y) 0
# define sqlite3WalEndWriteTransaction(x) 0
@@ -37314,6 +38262,7 @@ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 i
# define sqlite3WalExclusiveMode(y,z) 0
# define sqlite3WalHeapMemory(z) 0
# define sqlite3WalFramesize(z) 0
+# define sqlite3WalFindFrame(x,y,z) 0
#else
#define WAL_SAVEPOINT_NDATA 4
@@ -37341,7 +38290,8 @@ SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *);
SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal);
/* Read a page from the write-ahead log, if it is present. */
-SQLITE_PRIVATE int sqlite3WalRead(Wal *pWal, Pgno pgno, int *pInWal, int nOut, u8 *pOut);
+SQLITE_PRIVATE int sqlite3WalFindFrame(Wal *, Pgno, u32 *);
+SQLITE_PRIVATE int sqlite3WalReadFrame(Wal *, u32, int, u8 *);
/* If the WAL is not empty, return the size of the database. */
SQLITE_PRIVATE Pgno sqlite3WalDbsize(Wal *pWal);
@@ -38041,6 +38991,11 @@ struct Pager {
PagerSavepoint *aSavepoint; /* Array of active savepoints */
int nSavepoint; /* Number of elements in aSavepoint[] */
char dbFileVers[16]; /* Changes whenever database file changes */
+
+ u8 bUseFetch; /* True to use xFetch() */
+ int nMmapOut; /* Number of mmap pages currently outstanding */
+ sqlite3_int64 szMmap; /* Desired maximum mmap size */
+ PgHdr *pMmapFreelist; /* List of free mmap page headers (pDirty) */
/*
** End of the routinely-changing class members
***************************************************************************/
@@ -38152,6 +39107,16 @@ static const unsigned char aJournalMagic[] = {
#endif
/*
+** The macro USEFETCH is true if we are allowed to use the xFetch and xUnfetch
+** interfaces to access the database using memory-mapped I/O.
+*/
+#if SQLITE_MAX_MMAP_SIZE>0
+# define USEFETCH(x) ((x)->bUseFetch)
+#else
+# define USEFETCH(x) 0
+#endif
+
+/*
** The maximum legal page number is (2^31 - 1).
*/
#define PAGER_MAX_PGNO 2147483647
@@ -39638,7 +40603,7 @@ static int pager_playback_one_page(
i64 ofst = (pgno-1)*(i64)pPager->pageSize;
testcase( !isSavepnt && pPg!=0 && (pPg->flags&PGHDR_NEED_SYNC)!=0 );
assert( !pagerUseWal(pPager) );
- rc = sqlite3OsWrite(pPager->fd, (u8*)aData, pPager->pageSize, ofst);
+ rc = sqlite3OsWrite(pPager->fd, (u8 *)aData, pPager->pageSize, ofst);
if( pgno>pPager->dbFileSize ){
pPager->dbFileSize = pgno;
}
@@ -40029,6 +40994,7 @@ static int pager_playback(Pager *pPager, int isHot){
int res = 1; /* Value returned by sqlite3OsAccess() */
char *zMaster = 0; /* Name of master journal file if any */
int needPagerReset; /* True to reset page prior to first page rollback */
+ int nPlayback = 0; /* Total number of pages restored from journal */
/* Figure out how many records are in the journal. Abort early if
** the journal is empty.
@@ -40129,7 +41095,9 @@ static int pager_playback(Pager *pPager, int isHot){
needPagerReset = 0;
}
rc = pager_playback_one_page(pPager,&pPager->journalOff,0,1,0);
- if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_OK ){
+ nPlayback++;
+ }else{
if( rc==SQLITE_DONE ){
pPager->journalOff = szJ;
break;
@@ -40199,6 +41167,10 @@ end_playback:
rc = pager_delmaster(pPager, zMaster);
testcase( rc!=SQLITE_OK );
}
+ if( isHot && nPlayback ){
+ sqlite3_log(SQLITE_NOTICE_RECOVER_ROLLBACK, "recovered %d pages from %s",
+ nPlayback, pPager->zJournal);
+ }
/* The Pager.sectorSize variable may have been updated while rolling
** back a journal created by a process with a different sector size
@@ -40220,11 +41192,10 @@ end_playback:
** If an IO error occurs, then the IO error is returned to the caller.
** Otherwise, SQLITE_OK is returned.
*/
-static int readDbPage(PgHdr *pPg){
+static int readDbPage(PgHdr *pPg, u32 iFrame){
Pager *pPager = pPg->pPager; /* Pager object associated with page pPg */
Pgno pgno = pPg->pgno; /* Page number to read */
int rc = SQLITE_OK; /* Return code */
- int isInWal = 0; /* True if page is in log file */
int pgsz = pPager->pageSize; /* Number of bytes to read */
assert( pPager->eState>=PAGER_READER && !MEMDB );
@@ -40236,11 +41207,13 @@ static int readDbPage(PgHdr *pPg){
return SQLITE_OK;
}
- if( pagerUseWal(pPager) ){
+#ifndef SQLITE_OMIT_WAL
+ if( iFrame ){
/* Try to pull the page from the write-ahead log. */
- rc = sqlite3WalRead(pPager->pWal, pgno, &isInWal, pgsz, pPg->pData);
- }
- if( rc==SQLITE_OK && !isInWal ){
+ rc = sqlite3WalReadFrame(pPager->pWal, iFrame, pgsz, pPg->pData);
+ }else
+#endif
+ {
i64 iOffset = (pgno-1)*(i64)pPager->pageSize;
rc = sqlite3OsRead(pPager->fd, pPg->pData, pgsz, iOffset);
if( rc==SQLITE_IOERR_SHORT_READ ){
@@ -40319,12 +41292,17 @@ static int pagerUndoCallback(void *pCtx, Pgno iPg){
Pager *pPager = (Pager *)pCtx;
PgHdr *pPg;
+ assert( pagerUseWal(pPager) );
pPg = sqlite3PagerLookup(pPager, iPg);
if( pPg ){
if( sqlite3PcachePageRefcount(pPg)==1 ){
sqlite3PcacheDrop(pPg);
}else{
- rc = readDbPage(pPg);
+ u32 iFrame = 0;
+ rc = sqlite3WalFindFrame(pPager->pWal, pPg->pgno, &iFrame);
+ if( rc==SQLITE_OK ){
+ rc = readDbPage(pPg, iFrame);
+ }
if( rc==SQLITE_OK ){
pPager->xReiniter(pPg);
}
@@ -40468,6 +41446,7 @@ static int pagerBeginReadTransaction(Pager *pPager){
rc = sqlite3WalBeginReadTransaction(pPager->pWal, &changed);
if( rc!=SQLITE_OK || changed ){
pager_reset(pPager);
+ if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0);
}
return rc;
@@ -40730,6 +41709,29 @@ SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager *pPager, int mxPage){
}
/*
+** Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
+*/
+static void pagerFixMaplimit(Pager *pPager){
+#if SQLITE_MAX_MMAP_SIZE>0
+ sqlite3_file *fd = pPager->fd;
+ if( isOpen(fd) ){
+ sqlite3_int64 sz;
+ pPager->bUseFetch = (fd->pMethods->iVersion>=3) && pPager->szMmap>0;
+ sz = pPager->szMmap;
+ sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_MMAP_SIZE, &sz);
+ }
+#endif
+}
+
+/*
+** Change the maximum size of any memory mapping made of the database file.
+*/
+SQLITE_PRIVATE void sqlite3PagerSetMmapLimit(Pager *pPager, sqlite3_int64 szMmap){
+ pPager->szMmap = szMmap;
+ pagerFixMaplimit(pPager);
+}
+
+/*
** Free as much memory as possible from the pager.
*/
SQLITE_PRIVATE void sqlite3PagerShrink(Pager *pPager){
@@ -40964,6 +41966,7 @@ SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nR
assert( nReserve>=0 && nReserve<1000 );
pPager->nReserve = (i16)nReserve;
pagerReportSize(pPager);
+ pagerFixMaplimit(pPager);
}
return rc;
}
@@ -41190,6 +42193,81 @@ static int pagerSyncHotJournal(Pager *pPager){
}
/*
+** Obtain a reference to a memory mapped page object for page number pgno.
+** The new object will use the pointer pData, obtained from xFetch().
+** If successful, set *ppPage to point to the new page reference
+** and return SQLITE_OK. Otherwise, return an SQLite error code and set
+** *ppPage to zero.
+**
+** Page references obtained by calling this function should be released
+** by calling pagerReleaseMapPage().
+*/
+static int pagerAcquireMapPage(
+ Pager *pPager, /* Pager object */
+ Pgno pgno, /* Page number */
+ void *pData, /* xFetch()'d data for this page */
+ PgHdr **ppPage /* OUT: Acquired page object */
+){
+ PgHdr *p; /* Memory mapped page to return */
+
+ if( pPager->pMmapFreelist ){
+ *ppPage = p = pPager->pMmapFreelist;
+ pPager->pMmapFreelist = p->pDirty;
+ p->pDirty = 0;
+ memset(p->pExtra, 0, pPager->nExtra);
+ }else{
+ *ppPage = p = (PgHdr *)sqlite3MallocZero(sizeof(PgHdr) + pPager->nExtra);
+ if( p==0 ){
+ sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1) * pPager->pageSize, pData);
+ return SQLITE_NOMEM;
+ }
+ p->pExtra = (void *)&p[1];
+ p->flags = PGHDR_MMAP;
+ p->nRef = 1;
+ p->pPager = pPager;
+ }
+
+ assert( p->pExtra==(void *)&p[1] );
+ assert( p->pPage==0 );
+ assert( p->flags==PGHDR_MMAP );
+ assert( p->pPager==pPager );
+ assert( p->nRef==1 );
+
+ p->pgno = pgno;
+ p->pData = pData;
+ pPager->nMmapOut++;
+
+ return SQLITE_OK;
+}
+
+/*
+** Release a reference to page pPg. pPg must have been returned by an
+** earlier call to pagerAcquireMapPage().
+*/
+static void pagerReleaseMapPage(PgHdr *pPg){
+ Pager *pPager = pPg->pPager;
+ pPager->nMmapOut--;
+ pPg->pDirty = pPager->pMmapFreelist;
+ pPager->pMmapFreelist = pPg;
+
+ assert( pPager->fd->pMethods->iVersion>=3 );
+ sqlite3OsUnfetch(pPager->fd, (i64)(pPg->pgno-1)*pPager->pageSize, pPg->pData);
+}
+
+/*
+** Free all PgHdr objects stored in the Pager.pMmapFreelist list.
+*/
+static void pagerFreeMapHdrs(Pager *pPager){
+ PgHdr *p;
+ PgHdr *pNext;
+ for(p=pPager->pMmapFreelist; p; p=pNext){
+ pNext = p->pDirty;
+ sqlite3_free(p);
+ }
+}
+
+
+/*
** Shutdown the page cache. Free all memory and close all files.
**
** If a transaction was in progress when this routine is called, that
@@ -41209,6 +42287,7 @@ SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager){
assert( assert_pager_state(pPager) );
disable_simulated_io_errors();
sqlite3BeginBenignMalloc();
+ pagerFreeMapHdrs(pPager);
/* pPager->errCode = 0; */
pPager->exclusiveMode = 0;
#ifndef SQLITE_OMIT_WAL
@@ -41470,7 +42549,9 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
** file size will be.
*/
assert( rc!=SQLITE_OK || isOpen(pPager->fd) );
- if( rc==SQLITE_OK && pPager->dbSize>pPager->dbHintSize ){
+ if( rc==SQLITE_OK
+ && (pList->pDirty ? pPager->dbSize : pList->pgno+1)>pPager->dbHintSize
+ ){
sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
pPager->dbHintSize = pPager->dbSize;
@@ -42024,6 +43105,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen(
/* pPager->pBusyHandlerArg = 0; */
pPager->xReiniter = xReinit;
/* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
+ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */
*ppPager = pPager;
return SQLITE_OK;
@@ -42315,9 +43397,11 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){
);
}
- if( !pPager->tempFile
- && (pPager->pBackup || sqlite3PcachePagecount(pPager->pPCache)>0)
- ){
+ if( !pPager->tempFile && (
+ pPager->pBackup
+ || sqlite3PcachePagecount(pPager->pPCache)>0
+ || USEFETCH(pPager)
+ )){
/* The shared-lock has just been acquired on the database file
** and there are already pages in the cache (from a previous
** read or write transaction). Check to see if the database
@@ -42343,7 +43427,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){
if( nPage>0 ){
IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers)));
rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24);
- if( rc!=SQLITE_OK ){
+ if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){
goto failed;
}
}else{
@@ -42352,6 +43436,16 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){
if( memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers))!=0 ){
pager_reset(pPager);
+
+ /* Unmap the database file. It is possible that external processes
+ ** may have truncated the database file and then extended it back
+ ** to its original size while this process was not holding a lock.
+ ** In this case there may exist a Pager.pMap mapping that appears
+ ** to be the right size but is not actually valid. Avoid this
+ ** possibility by unmapping the db here. */
+ if( USEFETCH(pPager) ){
+ sqlite3OsUnfetch(pPager->fd, 0, 0);
+ }
}
}
@@ -42393,7 +43487,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){
** nothing to rollback, so this routine is a no-op.
*/
static void pagerUnlockIfUnused(Pager *pPager){
- if( (sqlite3PcacheRefCount(pPager->pPCache)==0) ){
+ if( pPager->nMmapOut==0 && (sqlite3PcacheRefCount(pPager->pPCache)==0) ){
pagerUnlockAndRollback(pPager);
}
}
@@ -42452,13 +43546,27 @@ SQLITE_PRIVATE int sqlite3PagerAcquire(
Pager *pPager, /* The pager open on the database file */
Pgno pgno, /* Page number to fetch */
DbPage **ppPage, /* Write a pointer to the page here */
- int noContent /* Do not bother reading content from disk if true */
+ int flags /* PAGER_ACQUIRE_XXX flags */
){
- int rc;
- PgHdr *pPg;
+ int rc = SQLITE_OK;
+ PgHdr *pPg = 0;
+ u32 iFrame = 0; /* Frame to read from WAL file */
+ const int noContent = (flags & PAGER_ACQUIRE_NOCONTENT);
+
+ /* It is acceptable to use a read-only (mmap) page for any page except
+ ** page 1 if there is no write-transaction open or the ACQUIRE_READONLY
+ ** flag was specified by the caller. And so long as the db is not a
+ ** temporary or in-memory database. */
+ const int bMmapOk = (pgno!=1 && USEFETCH(pPager)
+ && (pPager->eState==PAGER_READER || (flags & PAGER_ACQUIRE_READONLY))
+#ifdef SQLITE_HAS_CODEC
+ && pPager->xCodec==0
+#endif
+ );
assert( pPager->eState>=PAGER_READER );
assert( assert_pager_state(pPager) );
+ assert( noContent==0 || bMmapOk==0 );
if( pgno==0 ){
return SQLITE_CORRUPT_BKPT;
@@ -42469,6 +43577,39 @@ SQLITE_PRIVATE int sqlite3PagerAcquire(
if( pPager->errCode!=SQLITE_OK ){
rc = pPager->errCode;
}else{
+
+ if( bMmapOk && pagerUseWal(pPager) ){
+ rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iFrame);
+ if( rc!=SQLITE_OK ) goto pager_acquire_err;
+ }
+
+ if( iFrame==0 && bMmapOk ){
+ void *pData = 0;
+
+ rc = sqlite3OsFetch(pPager->fd,
+ (i64)(pgno-1) * pPager->pageSize, pPager->pageSize, &pData
+ );
+
+ if( rc==SQLITE_OK && pData ){
+ if( pPager->eState>PAGER_READER ){
+ (void)sqlite3PcacheFetch(pPager->pPCache, pgno, 0, &pPg);
+ }
+ if( pPg==0 ){
+ rc = pagerAcquireMapPage(pPager, pgno, pData, &pPg);
+ }else{
+ sqlite3OsUnfetch(pPager->fd, (i64)(pgno-1)*pPager->pageSize, pData);
+ }
+ if( pPg ){
+ assert( rc==SQLITE_OK );
+ *ppPage = pPg;
+ return SQLITE_OK;
+ }
+ }
+ if( rc!=SQLITE_OK ){
+ goto pager_acquire_err;
+ }
+ }
+
rc = sqlite3PcacheFetch(pPager->pPCache, pgno, 1, ppPage);
}
@@ -42527,9 +43668,13 @@ SQLITE_PRIVATE int sqlite3PagerAcquire(
memset(pPg->pData, 0, pPager->pageSize);
IOTRACE(("ZERO %p %d\n", pPager, pgno));
}else{
+ if( pagerUseWal(pPager) && bMmapOk==0 ){
+ rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iFrame);
+ if( rc!=SQLITE_OK ) goto pager_acquire_err;
+ }
assert( pPg->pPager==pPager );
pPager->aStat[PAGER_STAT_MISS]++;
- rc = readDbPage(pPg);
+ rc = readDbPage(pPg, iFrame);
if( rc!=SQLITE_OK ){
goto pager_acquire_err;
}
@@ -42582,7 +43727,11 @@ SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
SQLITE_PRIVATE void sqlite3PagerUnref(DbPage *pPg){
if( pPg ){
Pager *pPager = pPg->pPager;
- sqlite3PcacheRelease(pPg);
+ if( pPg->flags & PGHDR_MMAP ){
+ pagerReleaseMapPage(pPg);
+ }else{
+ sqlite3PcacheRelease(pPg);
+ }
pagerUnlockIfUnused(pPager);
}
}
@@ -42917,6 +44066,7 @@ SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){
Pager *pPager = pPg->pPager;
Pgno nPagePerSector = (pPager->sectorSize/pPager->pageSize);
+ assert( (pPg->flags & PGHDR_MMAP)==0 );
assert( pPager->eState>=PAGER_WRITER_LOCKED );
assert( pPager->eState!=PAGER_ERROR );
assert( assert_pager_state(pPager) );
@@ -43116,6 +44266,11 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){
pPager->aStat[PAGER_STAT_WRITE]++;
}
if( rc==SQLITE_OK ){
+ /* Update the pager's copy of the change-counter. Otherwise, the
+ ** next time a read transaction is opened the cache will be
+ ** flushed (as the change-counter values will not match). */
+ const void *pCopy = (const void *)&((const char *)zBuf)[24];
+ memcpy(&pPager->dbFileVers, pCopy, sizeof(pPager->dbFileVers));
pPager->changeCountDone = 1;
}
}else{
@@ -43473,7 +44628,7 @@ SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
}
assert( pPager->eState==PAGER_READER || rc!=SQLITE_OK );
- assert( rc==SQLITE_OK || rc==SQLITE_FULL
+ assert( rc==SQLITE_OK || rc==SQLITE_FULL || rc==SQLITE_CORRUPT
|| rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR );
/* If an error occurs during a ROLLBACK, we can no longer trust the pager
@@ -44207,11 +45362,12 @@ static int pagerOpenWal(Pager *pPager){
** (e.g. due to malloc() failure), return an error code.
*/
if( rc==SQLITE_OK ){
- rc = sqlite3WalOpen(pPager->pVfs,
+ rc = sqlite3WalOpen(pPager->pVfs,
pPager->fd, pPager->zWal, pPager->exclusiveMode,
pPager->journalSizeLimit, &pPager->pWal
);
}
+ pagerFixMaplimit(pPager);
return rc;
}
@@ -44302,6 +45458,7 @@ SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager){
rc = sqlite3WalClose(pPager->pWal, pPager->ckptSyncFlags,
pPager->pageSize, (u8*)pPager->pTmpSpace);
pPager->pWal = 0;
+ pagerFixMaplimit(pPager);
}
}
return rc;
@@ -45550,8 +46707,9 @@ finished:
** checkpointing the log file.
*/
if( pWal->hdr.nPage ){
- sqlite3_log(SQLITE_OK, "Recovered %d frames from WAL file %s",
- pWal->hdr.nPage, pWal->zWalName
+ sqlite3_log(SQLITE_NOTICE_RECOVER_WAL,
+ "recovered %d frames from WAL file %s",
+ pWal->hdr.mxFrame, pWal->zWalName
);
}
}
@@ -46065,8 +47223,8 @@ static int walCheckpoint(
rc = sqlite3OsSync(pWal->pWalFd, sync_flags);
}
- /* If the database file may grow as a result of this checkpoint, hint
- ** about the eventual size of the db file to the VFS layer.
+ /* If the database may grow as a result of this checkpoint, hint
+ ** about the eventual size of the db file to the VFS layer.
*/
if( rc==SQLITE_OK ){
i64 nReq = ((i64)mxPage * szPage);
@@ -46076,6 +47234,7 @@ static int walCheckpoint(
}
}
+
/* Iterate through the contents of the WAL, copying data to the db file. */
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
i64 iOffset;
@@ -46630,19 +47789,17 @@ SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal){
}
/*
-** Read a page from the WAL, if it is present in the WAL and if the
-** current read transaction is configured to use the WAL.
+** Search the wal file for page pgno. If found, set *piRead to the frame that
+** contains the page. Otherwise, if pgno is not in the wal file, set *piRead
+** to zero.
**
-** The *pInWal is set to 1 if the requested page is in the WAL and
-** has been loaded. Or *pInWal is set to 0 if the page was not in
-** the WAL and needs to be read out of the database.
+** Return SQLITE_OK if successful, or an error code if an error occurs. If an
+** error does occur, the final value of *piRead is undefined.
*/
-SQLITE_PRIVATE int sqlite3WalRead(
+SQLITE_PRIVATE int sqlite3WalFindFrame(
Wal *pWal, /* WAL handle */
Pgno pgno, /* Database page number to read data for */
- int *pInWal, /* OUT: True if data is read from WAL */
- int nOut, /* Size of buffer pOut in bytes */
- u8 *pOut /* Buffer to write page data to */
+ u32 *piRead /* OUT: Frame number (or zero) */
){
u32 iRead = 0; /* If !=0, WAL frame to return data from */
u32 iLast = pWal->hdr.mxFrame; /* Last page in WAL for this reader */
@@ -46658,7 +47815,7 @@ SQLITE_PRIVATE int sqlite3WalRead(
** WAL were empty.
*/
if( iLast==0 || pWal->readLock==0 ){
- *pInWal = 0;
+ *piRead = 0;
return SQLITE_OK;
}
@@ -46729,26 +47886,31 @@ SQLITE_PRIVATE int sqlite3WalRead(
}
#endif
- /* If iRead is non-zero, then it is the log frame number that contains the
- ** required page. Read and return data from the log file.
- */
- if( iRead ){
- int sz;
- i64 iOffset;
- sz = pWal->hdr.szPage;
- sz = (sz&0xfe00) + ((sz&0x0001)<<16);
- testcase( sz<=32768 );
- testcase( sz>=65536 );
- iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE;
- *pInWal = 1;
- /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */
- return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset);
- }
-
- *pInWal = 0;
+ *piRead = iRead;
return SQLITE_OK;
}
+/*
+** Read the contents of frame iRead from the wal file into buffer pOut
+** (which is nOut bytes in size). Return SQLITE_OK if successful, or an
+** error code otherwise.
+*/
+SQLITE_PRIVATE int sqlite3WalReadFrame(
+ Wal *pWal, /* WAL handle */
+ u32 iRead, /* Frame to read */
+ int nOut, /* Size of buffer pOut in bytes */
+ u8 *pOut /* Buffer to write page data to */
+){
+ int sz;
+ i64 iOffset;
+ sz = pWal->hdr.szPage;
+ sz = (sz&0xfe00) + ((sz&0x0001)<<16);
+ testcase( sz<=32768 );
+ testcase( sz>=65536 );
+ iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE;
+ /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */
+ return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset);
+}
/*
** Return the size of the database in pages (or zero, if unknown).
@@ -47295,6 +48457,9 @@ SQLITE_PRIVATE int sqlite3WalCheckpoint(
/* Read the wal-index header. */
if( rc==SQLITE_OK ){
rc = walIndexReadHdr(pWal, &isChanged);
+ if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){
+ sqlite3OsUnfetch(pWal->pDbFd, 0, 0);
+ }
}
/* Copy data from the log to the database file. */
@@ -49966,13 +51131,17 @@ static int btreeGetPage(
BtShared *pBt, /* The btree */
Pgno pgno, /* Number of the page to fetch */
MemPage **ppPage, /* Return the page in this parameter */
- int noContent /* Do not load page content if true */
+ int noContent, /* Do not load page content if true */
+ int bReadonly /* True if a read-only (mmap) page is ok */
){
int rc;
DbPage *pDbPage;
+ int flags = (noContent ? PAGER_ACQUIRE_NOCONTENT : 0)
+ | (bReadonly ? PAGER_ACQUIRE_READONLY : 0);
+ assert( noContent==0 || bReadonly==0 );
assert( sqlite3_mutex_held(pBt->mutex) );
- rc = sqlite3PagerAcquire(pBt->pPager, pgno, (DbPage**)&pDbPage, noContent);
+ rc = sqlite3PagerAcquire(pBt->pPager, pgno, (DbPage**)&pDbPage, flags);
if( rc ) return rc;
*ppPage = btreePageFromDbPage(pDbPage, pgno, pBt);
return SQLITE_OK;
@@ -50015,9 +51184,10 @@ SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree *p){
** may remain unchanged, or it may be set to an invalid value.
*/
static int getAndInitPage(
- BtShared *pBt, /* The database file */
- Pgno pgno, /* Number of the page to get */
- MemPage **ppPage /* Write the page pointer here */
+ BtShared *pBt, /* The database file */
+ Pgno pgno, /* Number of the page to get */
+ MemPage **ppPage, /* Write the page pointer here */
+ int bReadonly /* True if a read-only (mmap) page is ok */
){
int rc;
assert( sqlite3_mutex_held(pBt->mutex) );
@@ -50025,7 +51195,7 @@ static int getAndInitPage(
if( pgno>btreePagecount(pBt) ){
rc = SQLITE_CORRUPT_BKPT;
}else{
- rc = btreeGetPage(pBt, pgno, ppPage, 0);
+ rc = btreeGetPage(pBt, pgno, ppPage, 0, bReadonly);
if( rc==SQLITE_OK ){
rc = btreeInitPage(*ppPage);
if( rc!=SQLITE_OK ){
@@ -50256,6 +51426,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen(
rc = sqlite3PagerOpen(pVfs, &pBt->pPager, zFilename,
EXTRA_SIZE, flags, vfsFlags, pageReinit);
if( rc==SQLITE_OK ){
+ sqlite3PagerSetMmapLimit(pBt->pPager, db->szMmap);
rc = sqlite3PagerReadFileheader(pBt->pPager,sizeof(zDbHeader),zDbHeader);
}
if( rc!=SQLITE_OK ){
@@ -50523,6 +51694,19 @@ SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
}
/*
+** Change the limit on the amount of the database file that may be
+** memory mapped.
+*/
+SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree *p, sqlite3_int64 szMmap){
+ BtShared *pBt = p->pBt;
+ assert( sqlite3_mutex_held(p->db->mutex) );
+ sqlite3BtreeEnter(p);
+ sqlite3PagerSetMmapLimit(pBt->pPager, szMmap);
+ sqlite3BtreeLeave(p);
+ return SQLITE_OK;
+}
+
+/*
** Change the way data is synced to disk in order to increase or decrease
** how well the database resists damage due to OS crashes and power
** failures. Level 1 is the same as asynchronous (no syncs() occur and
@@ -50747,7 +51931,7 @@ static int lockBtree(BtShared *pBt){
assert( pBt->pPage1==0 );
rc = sqlite3PagerSharedLock(pBt->pPager);
if( rc!=SQLITE_OK ) return rc;
- rc = btreeGetPage(pBt, 1, &pPage1, 0);
+ rc = btreeGetPage(pBt, 1, &pPage1, 0, 0);
if( rc!=SQLITE_OK ) return rc;
/* Do some checking to help insure the file we opened really is
@@ -50883,6 +52067,29 @@ page1_init_failed:
return rc;
}
+#ifndef NDEBUG
+/*
+** Return the number of cursors open on pBt. This is for use
+** in assert() expressions, so it is only compiled if NDEBUG is not
+** defined.
+**
+** Only write cursors are counted if wrOnly is true. If wrOnly is
+** false then all cursors are counted.
+**
+** For the purposes of this routine, a cursor is any cursor that
+** is capable of reading or writing to the databse. Cursors that
+** have been tripped into the CURSOR_FAULT state are not counted.
+*/
+static int countValidCursors(BtShared *pBt, int wrOnly){
+ BtCursor *pCur;
+ int r = 0;
+ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
+ if( (wrOnly==0 || pCur->wrFlag) && pCur->eState!=CURSOR_FAULT ) r++;
+ }
+ return r;
+}
+#endif
+
/*
** If there are no outstanding cursors and we are not in the middle
** of a transaction but there is a read lock on the database, then
@@ -50893,7 +52100,7 @@ page1_init_failed:
*/
static void unlockBtreeIfUnused(BtShared *pBt){
assert( sqlite3_mutex_held(pBt->mutex) );
- assert( pBt->pCursor==0 || pBt->inTransaction>TRANS_NONE );
+ assert( countValidCursors(pBt,0)==0 || pBt->inTransaction>TRANS_NONE );
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){
assert( pBt->pPage1->aData );
assert( sqlite3PagerRefcount(pBt->pPager)==1 );
@@ -51306,7 +52513,7 @@ static int relocatePage(
** iPtrPage.
*/
if( eType!=PTRMAP_ROOTPAGE ){
- rc = btreeGetPage(pBt, iPtrPage, &pPtrPage, 0);
+ rc = btreeGetPage(pBt, iPtrPage, &pPtrPage, 0, 0);
if( rc!=SQLITE_OK ){
return rc;
}
@@ -51390,7 +52597,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){
u8 eMode = BTALLOC_ANY; /* Mode parameter for allocateBtreePage() */
Pgno iNear = 0; /* nearby parameter for allocateBtreePage() */
- rc = btreeGetPage(pBt, iLastPg, &pLastPg, 0);
+ rc = btreeGetPage(pBt, iLastPg, &pLastPg, 0, 0);
if( rc!=SQLITE_OK ){
return rc;
}
@@ -51482,8 +52689,11 @@ SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
if( nOrig<nFin ){
rc = SQLITE_CORRUPT_BKPT;
}else if( nFree>0 ){
- invalidateAllOverflowCache(pBt);
- rc = incrVacuumStep(pBt, nFin, nOrig, 0);
+ rc = saveAllCursors(pBt, 0, 0);
+ if( rc==SQLITE_OK ){
+ invalidateAllOverflowCache(pBt);
+ rc = incrVacuumStep(pBt, nFin, nOrig, 0);
+ }
if( rc==SQLITE_OK ){
rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
put4byte(&pBt->pPage1->aData[28], pBt->nPage);
@@ -51531,7 +52741,9 @@ static int autoVacuumCommit(BtShared *pBt){
nFree = get4byte(&pBt->pPage1->aData[36]);
nFin = finalDbSize(pBt, nOrig, nFree);
if( nFin>nOrig ) return SQLITE_CORRUPT_BKPT;
-
+ if( nFin<nOrig ){
+ rc = saveAllCursors(pBt, 0, 0);
+ }
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){
rc = incrVacuumStep(pBt, nFin, iFree, 1);
}
@@ -51548,7 +52760,7 @@ static int autoVacuumCommit(BtShared *pBt){
}
}
- assert( nRef==sqlite3PagerRefcount(pPager) );
+ assert( nRef>=sqlite3PagerRefcount(pPager) );
return rc;
}
@@ -51616,7 +52828,6 @@ static void btreeEndTransaction(Btree *p){
#ifndef SQLITE_OMIT_AUTOVACUUM
pBt->bDoTruncate = 0;
#endif
- btreeClearHasContent(pBt);
if( p->inTrans>TRANS_NONE && p->db->activeVdbeCnt>1 ){
/* If there are other active statements that belong to this database
** handle, downgrade to a read-only transaction. The other statements
@@ -51691,6 +52902,7 @@ SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){
return rc;
}
pBt->inTransaction = TRANS_READ;
+ btreeClearHasContent(pBt);
}
btreeEndTransaction(p);
@@ -51712,27 +52924,6 @@ SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){
return rc;
}
-#ifndef NDEBUG
-/*
-** Return the number of write-cursors open on this handle. This is for use
-** in assert() expressions, so it is only compiled if NDEBUG is not
-** defined.
-**
-** For the purposes of this routine, a write-cursor is any cursor that
-** is capable of writing to the databse. That means the cursor was
-** originally opened for writing and the cursor has not be disabled
-** by having its state changed to CURSOR_FAULT.
-*/
-static int countWriteCursors(BtShared *pBt){
- BtCursor *pCur;
- int r = 0;
- for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
- if( pCur->wrFlag && pCur->eState!=CURSOR_FAULT ) r++;
- }
- return r;
-}
-#endif
-
/*
** This routine sets the state to CURSOR_FAULT and the error
** code to errCode for every cursor on BtShared that pBtree
@@ -51804,7 +52995,7 @@ SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode){
/* The rollback may have destroyed the pPage1->aData value. So
** call btreeGetPage() on page 1 again to make
** sure pPage1->aData is set correctly. */
- if( btreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){
+ if( btreeGetPage(pBt, 1, &pPage1, 0, 0)==SQLITE_OK ){
int nPage = get4byte(28+(u8*)pPage1->aData);
testcase( nPage==0 );
if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage);
@@ -51812,8 +53003,9 @@ SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode){
pBt->nPage = nPage;
releasePage(pPage1);
}
- assert( countWriteCursors(pBt)==0 );
+ assert( countValidCursors(pBt, 1)==0 );
pBt->inTransaction = TRANS_READ;
+ btreeClearHasContent(pBt);
}
btreeEndTransaction(p);
@@ -52238,7 +53430,7 @@ static int getOverflowPage(
assert( next==0 || rc==SQLITE_DONE );
if( rc==SQLITE_OK ){
- rc = btreeGetPage(pBt, ovfl, &pPage, 0);
+ rc = btreeGetPage(pBt, ovfl, &pPage, 0, (ppPage==0));
assert( rc==SQLITE_OK || pPage==0 );
if( rc==SQLITE_OK ){
next = get4byte(pPage->aData);
@@ -52459,7 +53651,9 @@ static int accessPayload(
{
DbPage *pDbPage;
- rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage);
+ rc = sqlite3PagerAcquire(pBt->pPager, nextPage, &pDbPage,
+ (eOp==0 ? PAGER_ACQUIRE_READONLY : 0)
+ );
if( rc==SQLITE_OK ){
aPayload = sqlite3PagerGetData(pDbPage);
nextPage = get4byte(aPayload);
@@ -52638,10 +53832,11 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){
assert( cursorHoldsMutex(pCur) );
assert( pCur->eState==CURSOR_VALID );
assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
+ assert( pCur->iPage>=0 );
if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){
return SQLITE_CORRUPT_BKPT;
}
- rc = getAndInitPage(pBt, newPgno, &pNewPage);
+ rc = getAndInitPage(pBt, newPgno, &pNewPage, (pCur->wrFlag==0));
if( rc ) return rc;
pCur->apPage[i+1] = pNewPage;
pCur->aiIdx[i+1] = 0;
@@ -52758,7 +53953,7 @@ static int moveToRoot(BtCursor *pCur){
pCur->eState = CURSOR_INVALID;
return SQLITE_OK;
}else{
- rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->apPage[0]);
+ rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->apPage[0], pCur->wrFlag==0);
if( rc!=SQLITE_OK ){
pCur->eState = CURSOR_INVALID;
return rc;
@@ -53372,7 +54567,7 @@ static int allocateBtreePage(
if( iTrunk>mxPage ){
rc = SQLITE_CORRUPT_BKPT;
}else{
- rc = btreeGetPage(pBt, iTrunk, &pTrunk, 0);
+ rc = btreeGetPage(pBt, iTrunk, &pTrunk, 0, 0);
}
if( rc ){
pTrunk = 0;
@@ -53436,7 +54631,7 @@ static int allocateBtreePage(
goto end_allocate_page;
}
testcase( iNewTrunk==mxPage );
- rc = btreeGetPage(pBt, iNewTrunk, &pNewTrunk, 0);
+ rc = btreeGetPage(pBt, iNewTrunk, &pNewTrunk, 0, 0);
if( rc!=SQLITE_OK ){
goto end_allocate_page;
}
@@ -53516,7 +54711,7 @@ static int allocateBtreePage(
}
put4byte(&aData[4], k-1);
noContent = !btreeGetHasContent(pBt, *pPgno);
- rc = btreeGetPage(pBt, *pPgno, ppPage, noContent);
+ rc = btreeGetPage(pBt, *pPgno, ppPage, noContent, 0);
if( rc==SQLITE_OK ){
rc = sqlite3PagerWrite((*ppPage)->pDbPage);
if( rc!=SQLITE_OK ){
@@ -53564,7 +54759,7 @@ static int allocateBtreePage(
MemPage *pPg = 0;
TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", pBt->nPage));
assert( pBt->nPage!=PENDING_BYTE_PAGE(pBt) );
- rc = btreeGetPage(pBt, pBt->nPage, &pPg, bNoContent);
+ rc = btreeGetPage(pBt, pBt->nPage, &pPg, bNoContent, 0);
if( rc==SQLITE_OK ){
rc = sqlite3PagerWrite(pPg->pDbPage);
releasePage(pPg);
@@ -53578,7 +54773,7 @@ static int allocateBtreePage(
*pPgno = pBt->nPage;
assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
- rc = btreeGetPage(pBt, *pPgno, ppPage, bNoContent);
+ rc = btreeGetPage(pBt, *pPgno, ppPage, bNoContent, 0);
if( rc ) return rc;
rc = sqlite3PagerWrite((*ppPage)->pDbPage);
if( rc!=SQLITE_OK ){
@@ -53646,7 +54841,7 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
/* If the secure_delete option is enabled, then
** always fully overwrite deleted information with zeros.
*/
- if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) )
+ if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0, 0))!=0) )
|| ((rc = sqlite3PagerWrite(pPage->pDbPage))!=0)
){
goto freepage_out;
@@ -53673,7 +54868,7 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
u32 nLeaf; /* Initial number of leaf cells on trunk page */
iTrunk = get4byte(&pPage1->aData[32]);
- rc = btreeGetPage(pBt, iTrunk, &pTrunk, 0);
+ rc = btreeGetPage(pBt, iTrunk, &pTrunk, 0, 0);
if( rc!=SQLITE_OK ){
goto freepage_out;
}
@@ -53719,7 +54914,7 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
** first trunk in the free-list is full. Either way, the page being freed
** will become the new first trunk page in the free-list.
*/
- if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0)) ){
+ if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0, 0)) ){
goto freepage_out;
}
rc = sqlite3PagerWrite(pPage->pDbPage);
@@ -54520,7 +55715,7 @@ static int balance_nonroot(
}
pgno = get4byte(pRight);
while( 1 ){
- rc = getAndInitPage(pBt, pgno, &apOld[i]);
+ rc = getAndInitPage(pBt, pgno, &apOld[i], 0);
if( rc ){
memset(apOld, 0, (i+1)*sizeof(MemPage*));
goto balance_cleanup;
@@ -55608,10 +56803,17 @@ static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){
u8 eType = 0;
Pgno iPtrPage = 0;
+ /* Save the positions of any open cursors. This is required in
+ ** case they are holding a reference to an xFetch reference
+ ** corresponding to page pgnoRoot. */
+ rc = saveAllCursors(pBt, 0, 0);
releasePage(pPageMove);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
/* Move the page currently at pgnoRoot to pgnoMove. */
- rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
+ rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0, 0);
if( rc!=SQLITE_OK ){
return rc;
}
@@ -55632,7 +56834,7 @@ static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){
if( rc!=SQLITE_OK ){
return rc;
}
- rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
+ rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0, 0);
if( rc!=SQLITE_OK ){
return rc;
}
@@ -55708,7 +56910,7 @@ static int clearDatabasePage(
return SQLITE_CORRUPT_BKPT;
}
- rc = getAndInitPage(pBt, pgno, &pPage);
+ rc = getAndInitPage(pBt, pgno, &pPage, 0);
if( rc ) return rc;
for(i=0; i<pPage->nCell; i++){
pCell = findCell(pPage, i);
@@ -55810,7 +57012,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
return SQLITE_LOCKED_SHAREDCACHE;
}
- rc = btreeGetPage(pBt, (Pgno)iTable, &pPage, 0);
+ rc = btreeGetPage(pBt, (Pgno)iTable, &pPage, 0, 0);
if( rc ) return rc;
rc = sqlite3BtreeClearTable(p, iTable, 0);
if( rc ){
@@ -55845,7 +57047,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
*/
MemPage *pMove;
releasePage(pPage);
- rc = btreeGetPage(pBt, maxRootPgno, &pMove, 0);
+ rc = btreeGetPage(pBt, maxRootPgno, &pMove, 0, 0);
if( rc!=SQLITE_OK ){
return rc;
}
@@ -55855,7 +57057,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
return rc;
}
pMove = 0;
- rc = btreeGetPage(pBt, maxRootPgno, &pMove, 0);
+ rc = btreeGetPage(pBt, maxRootPgno, &pMove, 0, 0);
freePage(pMove, &rc);
releasePage(pMove);
if( rc!=SQLITE_OK ){
@@ -56267,7 +57469,7 @@ static int checkTreePage(
usableSize = pBt->usableSize;
if( iPage==0 ) return 0;
if( checkRef(pCheck, iPage, zParentContext) ) return 0;
- if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){
+ if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0, 0))!=0 ){
checkAppendMsg(pCheck, zContext,
"unable to get the page. error code=%d", rc);
return 0;
@@ -56739,6 +57941,17 @@ SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void
return SQLITE_ABORT;
}
+ /* Save the positions of all other cursors open on this table. This is
+ ** required in case any of them are holding references to an xFetch
+ ** version of the b-tree page modified by the accessPayload call below.
+ **
+ ** Note that pCsr must be open on a BTREE_INTKEY table and saveCursorPosition()
+ ** and hence saveAllCursors() cannot fail on a BTREE_INTKEY table, hence
+ ** saveAllCursors can only return SQLITE_OK.
+ */
+ VVA_ONLY(rc =) saveAllCursors(pCsr->pBt, pCsr->pgnoRoot, pCsr);
+ assert( rc==SQLITE_OK );
+
/* Check some assumptions:
** (a) the cursor is open for writing,
** (b) there is a read/write transaction open,
@@ -57220,7 +58433,8 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
const Pgno iSrcPg = p->iNext; /* Source page number */
if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
DbPage *pSrcPg; /* Source page object */
- rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg);
+ rc = sqlite3PagerAcquire(pSrcPager, iSrcPg, &pSrcPg,
+ PAGER_ACQUIRE_READONLY);
if( rc==SQLITE_OK ){
rc = backupOnePage(p, iSrcPg, sqlite3PagerGetData(pSrcPg), 0);
sqlite3PagerUnref(pSrcPg);
@@ -62444,14 +63658,6 @@ end_of_step:
}
/*
-** The maximum number of times that a statement will try to reparse
-** itself before giving up and returning SQLITE_SCHEMA.
-*/
-#ifndef SQLITE_MAX_SCHEMA_RETRY
-# define SQLITE_MAX_SCHEMA_RETRY 5
-#endif
-
-/*
** This is the top-level implementation of sqlite3_step(). Call
** sqlite3Step() to do most of the work. If a schema error occurs,
** call sqlite3Reprepare() and try again.
@@ -63354,6 +64560,11 @@ static int findNextHostParameter(const char *zSql, int *pnToken){
** then the returned string holds a copy of zRawSql with "-- " prepended
** to each line of text.
**
+** If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then
+** then long strings and blobs are truncated to that many bytes. This
+** can be used to prevent unreasonably large trace strings when dealing
+** with large (multi-megabyte) strings and blobs.
+**
** The calling function is responsible for making sure the memory returned
** is eventually freed.
**
@@ -63424,30 +64635,49 @@ SQLITE_PRIVATE char *sqlite3VdbeExpandSql(
}else if( pVar->flags & MEM_Real ){
sqlite3XPrintf(&out, "%!.15g", pVar->r);
}else if( pVar->flags & MEM_Str ){
+ int nOut; /* Number of bytes of the string text to include in output */
#ifndef SQLITE_OMIT_UTF16
u8 enc = ENC(db);
+ Mem utf8;
if( enc!=SQLITE_UTF8 ){
- Mem utf8;
memset(&utf8, 0, sizeof(utf8));
utf8.db = db;
sqlite3VdbeMemSetStr(&utf8, pVar->z, pVar->n, enc, SQLITE_STATIC);
sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8);
- sqlite3XPrintf(&out, "'%.*q'", utf8.n, utf8.z);
- sqlite3VdbeMemRelease(&utf8);
- }else
+ pVar = &utf8;
+ }
#endif
- {
- sqlite3XPrintf(&out, "'%.*q'", pVar->n, pVar->z);
+ nOut = pVar->n;
+#ifdef SQLITE_TRACE_SIZE_LIMIT
+ if( nOut>SQLITE_TRACE_SIZE_LIMIT ){
+ nOut = SQLITE_TRACE_SIZE_LIMIT;
+ while( nOut<pVar->n && (pVar->z[nOut]&0xc0)==0x80 ){ nOut++; }
}
+#endif
+ sqlite3XPrintf(&out, "'%.*q'", nOut, pVar->z);
+#ifdef SQLITE_TRACE_SIZE_LIMIT
+ if( nOut<pVar->n ) sqlite3XPrintf(&out, "/*+%d bytes*/", pVar->n-nOut);
+#endif
+#ifndef SQLITE_OMIT_UTF16
+ if( enc!=SQLITE_UTF8 ) sqlite3VdbeMemRelease(&utf8);
+#endif
}else if( pVar->flags & MEM_Zero ){
sqlite3XPrintf(&out, "zeroblob(%d)", pVar->u.nZero);
}else{
+ int nOut; /* Number of bytes of the blob to include in output */
assert( pVar->flags & MEM_Blob );
sqlite3StrAccumAppend(&out, "x'", 2);
- for(i=0; i<pVar->n; i++){
+ nOut = pVar->n;
+#ifdef SQLITE_TRACE_SIZE_LIMIT
+ if( nOut>SQLITE_TRACE_SIZE_LIMIT ) nOut = SQLITE_TRACE_SIZE_LIMIT;
+#endif
+ for(i=0; i<nOut; i++){
sqlite3XPrintf(&out, "%02x", pVar->z[i]&0xff);
}
sqlite3StrAccumAppend(&out, "'", 1);
+#ifdef SQLITE_TRACE_SIZE_LIMIT
+ if( nOut<pVar->n ) sqlite3XPrintf(&out, "/*+%d bytes*/", pVar->n-nOut);
+#endif
}
}
}
@@ -67664,7 +68894,7 @@ case OP_SeekGt: { /* jump, in3 */
** u.bc.r.flags = 0;
** }
*/
- u.bc.r.flags = (u16)(UNPACKED_INCRKEY * (1 & (u.bc.oc - OP_SeekLt)));
+ u.bc.r.flags = (u8)(UNPACKED_INCRKEY * (1 & (u.bc.oc - OP_SeekLt)));
assert( u.bc.oc!=OP_SeekGt || u.bc.r.flags==UNPACKED_INCRKEY );
assert( u.bc.oc!=OP_SeekLe || u.bc.r.flags==UNPACKED_INCRKEY );
assert( u.bc.oc!=OP_SeekGe || u.bc.r.flags==0 );
@@ -70789,7 +72019,7 @@ SQLITE_API int sqlite3_blob_open(
}
sqlite3_bind_int64(pBlob->pStmt, 1, iRow);
rc = blobSeekToRow(pBlob, iRow, &zErr);
- } while( (++nAttempt)<5 && rc==SQLITE_SCHEMA );
+ } while( (++nAttempt)<SQLITE_MAX_SCHEMA_RETRY && rc==SQLITE_SCHEMA );
blob_open_out:
if( rc==SQLITE_OK && db->mallocFailed==0 ){
@@ -72474,7 +73704,9 @@ static const struct sqlite3_io_methods MemJournalMethods = {
0, /* xShmMap */
0, /* xShmLock */
0, /* xShmBarrier */
- 0 /* xShmUnlock */
+ 0, /* xShmUnmap */
+ 0, /* xFetch */
+ 0 /* xUnfetch */
};
/*
@@ -72618,7 +73850,9 @@ SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
/*
** Call sqlite3WalkExpr() for every expression in Select statement p.
** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
-** on the compound select chain, p->pPrior.
+** on the compound select chain, p->pPrior. Invoke the xSelectCallback()
+** either before or after the walk of expressions and FROM clause, depending
+** on whether pWalker->bSelectDepthFirst is false or true, respectively.
**
** Return WRC_Continue under normal conditions. Return WRC_Abort if
** there is an abort request.
@@ -72632,14 +73866,23 @@ SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
rc = WRC_Continue;
pWalker->walkerDepth++;
while( p ){
- rc = pWalker->xSelectCallback(pWalker, p);
- if( rc ) break;
+ if( !pWalker->bSelectDepthFirst ){
+ rc = pWalker->xSelectCallback(pWalker, p);
+ if( rc ) break;
+ }
if( sqlite3WalkSelectExpr(pWalker, p)
|| sqlite3WalkSelectFrom(pWalker, p)
){
pWalker->walkerDepth--;
return WRC_Abort;
}
+ if( pWalker->bSelectDepthFirst ){
+ rc = pWalker->xSelectCallback(pWalker, p);
+ /* Depth-first search is currently only used for
+ ** selectAddSubqueryTypeInfo() and that routine always returns
+ ** WRC_Continue (0). So the following branch is never taken. */
+ if( NEVER(rc) ) break;
+ }
p = p->pPrior;
}
pWalker->walkerDepth--;
@@ -73037,7 +74280,10 @@ static int lookupName(
** Note that the expression in the result set should have already been
** resolved by the time the WHERE clause is resolved.
*/
- if( cnt==0 && (pEList = pNC->pEList)!=0 && zTab==0 ){
+ if( (pEList = pNC->pEList)!=0
+ && zTab==0
+ && ((pNC->ncFlags & NC_AsMaybe)==0 || cnt==0)
+ ){
for(j=0; j<pEList->nExpr; j++){
char *zAs = pEList->a[j].zName;
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
@@ -73128,7 +74374,9 @@ static int lookupName(
lookupname_end:
if( cnt==1 ){
assert( pNC!=0 );
- sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
+ if( pExpr->op!=TK_AS ){
+ sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
+ }
/* Increment the nRef value on all name contexts from TopNC up to
** the point where the name matched. */
for(;;){
@@ -73803,11 +75051,10 @@ static int resolveSelectStep(Walker *pWalker, Select *p){
** re-evaluated for each reference to it.
*/
sNC.pEList = p->pEList;
- if( sqlite3ResolveExprNames(&sNC, p->pWhere) ||
- sqlite3ResolveExprNames(&sNC, p->pHaving)
- ){
- return WRC_Abort;
- }
+ sNC.ncFlags |= NC_AsMaybe;
+ if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
+ if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
+ sNC.ncFlags &= ~NC_AsMaybe;
/* The ORDER BY and GROUP BY clauses may not refer to terms in
** outer queries
@@ -73928,6 +75175,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames(
#endif
savedHasAgg = pNC->ncFlags & NC_HasAgg;
pNC->ncFlags &= ~NC_HasAgg;
+ memset(&w, 0, sizeof(w));
w.xExprCallback = resolveExprStep;
w.xSelectCallback = resolveSelectStep;
w.pParse = pNC->pParse;
@@ -73968,6 +75216,7 @@ SQLITE_PRIVATE void sqlite3ResolveSelectNames(
Walker w;
assert( p!=0 );
+ memset(&w, 0, sizeof(w));
w.xExprCallback = resolveExprStep;
w.xSelectCallback = resolveSelectStep;
w.pParse = pParse;
@@ -74094,12 +75343,7 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
}
assert( op!=TK_REGISTER || p->op2!=TK_COLLATE );
if( op==TK_COLLATE ){
- if( db->init.busy ){
- /* Do not report errors when parsing while the schema */
- pColl = sqlite3FindCollSeq(db, ENC(db), p->u.zToken, 0);
- }else{
- pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
- }
+ pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
break;
}
if( p->pTab!=0
@@ -75192,6 +76436,7 @@ static int selectNodeIsConstant(Walker *pWalker, Select *NotUsed){
}
static int exprIsConst(Expr *p, int initFlag){
Walker w;
+ memset(&w, 0, sizeof(w));
w.u.i = initFlag;
w.xExprCallback = exprNodeIsConstant;
w.xSelectCallback = selectNodeIsConstant;
@@ -77406,8 +78651,8 @@ SQLITE_PRIVATE void sqlite3ExprCodeConstants(Parse *pParse, Expr *pExpr){
Walker w;
if( pParse->cookieGoto ) return;
if( OptimizationDisabled(pParse->db, SQLITE_FactorOutConst) ) return;
+ memset(&w, 0, sizeof(w));
w.xExprCallback = evalConstExpr;
- w.xSelectCallback = 0;
w.pParse = pParse;
sqlite3WalkExpr(&w, pExpr);
}
@@ -83599,10 +84844,8 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex(
for(i=0; i<pList->nExpr; i++){
Expr *pExpr = pList->a[i].pExpr;
if( pExpr ){
- CollSeq *pColl = sqlite3ExprCollSeq(pParse, pExpr);
- if( pColl ){
- nExtra += (1 + sqlite3Strlen30(pColl->zName));
- }
+ assert( pExpr->op==TK_COLLATE );
+ nExtra += (1 + sqlite3Strlen30(pExpr->u.zToken));
}
}
@@ -83663,7 +84906,6 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex(
const char *zColName = pListItem->zName;
Column *pTabCol;
int requestedSortOrder;
- CollSeq *pColl; /* Collating sequence */
char *zColl; /* Collation sequence name */
for(j=0, pTabCol=pTab->aCol; j<pTab->nCol; j++, pTabCol++){
@@ -83676,11 +84918,10 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex(
goto exit_create_index;
}
pIndex->aiColumn[i] = j;
- if( pListItem->pExpr
- && (pColl = sqlite3ExprCollSeq(pParse, pListItem->pExpr))!=0
- ){
+ if( pListItem->pExpr ){
int nColl;
- zColl = pColl->zName;
+ assert( pListItem->pExpr->op==TK_COLLATE );
+ zColl = pListItem->pExpr->u.zToken;
nColl = sqlite3Strlen30(zColl) + 1;
assert( nExtra>=nColl );
memcpy(zExtra, zColl, nColl);
@@ -83689,9 +84930,7 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex(
nExtra -= nColl;
}else{
zColl = pTab->aCol[j].zColl;
- if( !zColl ){
- zColl = "BINARY";
- }
+ if( !zColl ) zColl = "BINARY";
}
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){
goto exit_create_index;
@@ -86611,6 +87850,13 @@ static int patternCompare(
}
/*
+** The sqlite3_strglob() interface.
+*/
+SQLITE_API int sqlite3_strglob(const char *zGlobPattern, const char *zString){
+ return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, 0)==0;
+}
+
+/*
** Count the number of times that the LIKE operator (or GLOB which is
** just a variation of LIKE) gets called. This is used for testing
** only.
@@ -90810,7 +92056,6 @@ SQLITE_API int sqlite3_exec(
const char *zLeftover; /* Tail of unprocessed SQL */
sqlite3_stmt *pStmt = 0; /* The current SQL statement */
char **azCols = 0; /* Names of result columns */
- int nRetry = 0; /* Number of retry attempts */
int callbackIsInit; /* True if callback data is initialized */
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
@@ -90818,12 +92063,12 @@ SQLITE_API int sqlite3_exec(
sqlite3_mutex_enter(db->mutex);
sqlite3Error(db, SQLITE_OK, 0);
- while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){
+ while( rc==SQLITE_OK && zSql[0] ){
int nCol;
char **azVals = 0;
pStmt = 0;
- rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover);
+ rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
assert( rc==SQLITE_OK || pStmt==0 );
if( rc!=SQLITE_OK ){
continue;
@@ -90880,11 +92125,8 @@ SQLITE_API int sqlite3_exec(
if( rc!=SQLITE_ROW ){
rc = sqlite3VdbeFinalize((Vdbe *)pStmt);
pStmt = 0;
- if( rc!=SQLITE_SCHEMA ){
- nRetry = 0;
- zSql = zLeftover;
- while( sqlite3Isspace(zSql[0]) ) zSql++;
- }
+ zSql = zLeftover;
+ while( sqlite3Isspace(zSql[0]) ) zSql++;
break;
}
}
@@ -91408,8 +92650,17 @@ struct sqlite3_api_routines {
#define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2
#endif /* SQLITE_CORE */
-#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0;
-#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
+#ifndef SQLITE_CORE
+ /* This case when the file really is being compiled as a loadable
+ ** extension */
+# define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
+# define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
+#else
+ /* This case when the file is being statically linked into the
+ ** application */
+# define SQLITE_EXTENSION_INIT1 /*no-op*/
+# define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
+#endif
#endif /* _SQLITE3EXT_H_ */
@@ -91812,8 +93063,23 @@ static int sqlite3LoadExtension(
void *handle;
int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
char *zErrmsg = 0;
+ const char *zEntry;
+ char *zAltEntry = 0;
void **aHandle;
int nMsg = 300 + sqlite3Strlen30(zFile);
+ int ii;
+
+ /* Shared library endings to try if zFile cannot be loaded as written */
+ static const char *azEndings[] = {
+#if SQLITE_OS_WIN
+ "dll"
+#elif defined(__APPLE__)
+ "dylib"
+#else
+ "so"
+#endif
+ };
+
if( pzErrMsg ) *pzErrMsg = 0;
@@ -91830,11 +93096,17 @@ static int sqlite3LoadExtension(
return SQLITE_ERROR;
}
- if( zProc==0 ){
- zProc = "sqlite3_extension_init";
- }
+ zEntry = zProc ? zProc : "sqlite3_extension_init";
handle = sqlite3OsDlOpen(pVfs, zFile);
+#if SQLITE_OS_UNIX || SQLITE_OS_WIN
+ for(ii=0; ii<ArraySize(azEndings) && handle==0; ii++){
+ char *zAltFile = sqlite3_mprintf("%s.%s", zFile, azEndings[ii]);
+ if( zAltFile==0 ) return SQLITE_NOMEM;
+ handle = sqlite3OsDlOpen(pVfs, zAltFile);
+ sqlite3_free(zAltFile);
+ }
+#endif
if( handle==0 ){
if( pzErrMsg ){
*pzErrMsg = zErrmsg = sqlite3_malloc(nMsg);
@@ -91847,20 +93119,57 @@ static int sqlite3LoadExtension(
return SQLITE_ERROR;
}
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
- sqlite3OsDlSym(pVfs, handle, zProc);
+ sqlite3OsDlSym(pVfs, handle, zEntry);
+
+ /* If no entry point was specified and the default legacy
+ ** entry point name "sqlite3_extension_init" was not found, then
+ ** construct an entry point name "sqlite3_X_init" where the X is
+ ** replaced by the lowercase value of every ASCII alphabetic
+ ** character in the filename after the last "/" upto the first ".",
+ ** and eliding the first three characters if they are "lib".
+ ** Examples:
+ **
+ ** /usr/local/lib/libExample5.4.3.so ==> sqlite3_example_init
+ ** C:/lib/mathfuncs.dll ==> sqlite3_mathfuncs_init
+ */
+ if( xInit==0 && zProc==0 ){
+ int iFile, iEntry, c;
+ int ncFile = sqlite3Strlen30(zFile);
+ zAltEntry = sqlite3_malloc(ncFile+30);
+ if( zAltEntry==0 ){
+ sqlite3OsDlClose(pVfs, handle);
+ return SQLITE_NOMEM;
+ }
+ memcpy(zAltEntry, "sqlite3_", 8);
+ for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){}
+ iFile++;
+ if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3;
+ for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
+ if( sqlite3Isalpha(c) ){
+ zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c];
+ }
+ }
+ memcpy(zAltEntry+iEntry, "_init", 6);
+ zEntry = zAltEntry;
+ xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
+ sqlite3OsDlSym(pVfs, handle, zEntry);
+ }
if( xInit==0 ){
if( pzErrMsg ){
- nMsg += sqlite3Strlen30(zProc);
+ nMsg += sqlite3Strlen30(zEntry);
*pzErrMsg = zErrmsg = sqlite3_malloc(nMsg);
if( zErrmsg ){
sqlite3_snprintf(nMsg, zErrmsg,
- "no entry point [%s] in shared library [%s]", zProc,zFile);
+ "no entry point [%s] in shared library [%s]", zEntry, zFile);
sqlite3OsDlError(pVfs, nMsg-1, zErrmsg);
}
- sqlite3OsDlClose(pVfs, handle);
}
+ sqlite3OsDlClose(pVfs, handle);
+ sqlite3_free(zAltEntry);
return SQLITE_ERROR;
- }else if( xInit(db, &zErrmsg, &sqlite3Apis) ){
+ }
+ sqlite3_free(zAltEntry);
+ if( xInit(db, &zErrmsg, &sqlite3Apis) ){
if( pzErrMsg ){
*pzErrMsg = sqlite3_mprintf("error during initialization: %s", zErrmsg);
}
@@ -92389,7 +93698,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
int rc; /* return value form SQLITE_FCNTL_PRAGMA */
sqlite3 *db = pParse->db; /* The database connection */
Db *pDb; /* The specific database being pragmaed */
- Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(db); /* Prepared statement */
+ Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */
if( v==0 ) return;
sqlite3VdbeRunOnlyOnce(v);
@@ -92472,11 +93781,12 @@ SQLITE_PRIVATE void sqlite3Pragma(
static const VdbeOpList getCacheSize[] = {
{ OP_Transaction, 0, 0, 0}, /* 0 */
{ OP_ReadCookie, 0, 1, BTREE_DEFAULT_CACHE_SIZE}, /* 1 */
- { OP_IfPos, 1, 7, 0},
+ { OP_IfPos, 1, 8, 0},
{ OP_Integer, 0, 2, 0},
{ OP_Subtract, 1, 2, 1},
- { OP_IfPos, 1, 7, 0},
+ { OP_IfPos, 1, 8, 0},
{ OP_Integer, 0, 1, 0}, /* 6 */
+ { OP_Noop, 0, 0, 0},
{ OP_ResultRow, 1, 1, 0},
};
int addr;
@@ -92815,6 +94125,43 @@ SQLITE_PRIVATE void sqlite3Pragma(
}else
/*
+ ** PRAGMA [database.]mmap_size(N)
+ **
+ ** Used to set mapping size limit. The mapping size limit is
+ ** used to limit the aggregate size of all memory mapped regions of the
+ ** database file. If this parameter is set to zero, then memory mapping
+ ** is not used at all. If N is negative, then the default memory map
+ ** limit determined by sqlite3_config(SQLITE_CONFIG_MMAP_SIZE) is set.
+ ** The parameter N is measured in bytes.
+ **
+ ** This value is advisory. The underlying VFS is free to memory map
+ ** as little or as much as it wants. Except, if N is set to 0 then the
+ ** upper layers will never invoke the xFetch interfaces to the VFS.
+ */
+ if( sqlite3StrICmp(zLeft,"mmap_size")==0 ){
+ sqlite3_int64 sz;
+ assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
+ if( zRight ){
+ int ii;
+ sqlite3Atoi64(zRight, &sz, 1000, SQLITE_UTF8);
+ if( sz<0 ) sz = sqlite3GlobalConfig.szMmap;
+ if( pId2->n==0 ) db->szMmap = sz;
+ for(ii=db->nDb-1; ii>=0; ii--){
+ if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){
+ sqlite3BtreeSetMmapLimit(db->aDb[ii].pBt, sz);
+ }
+ }
+ }
+ sz = -1;
+ if( sqlite3_file_control(db,zDb,SQLITE_FCNTL_MMAP_SIZE,&sz)==SQLITE_OK ){
+#if SQLITE_MAX_MMAP_SIZE==0
+ sz = 0;
+#endif
+ returnSingleInt(pParse, "mmap_size", sz);
+ }
+ }else
+
+ /*
** PRAGMA temp_store
** PRAGMA temp_store = "default"|"memory"|"file"
**
@@ -93599,6 +94946,11 @@ SQLITE_PRIVATE void sqlite3Pragma(
** PRAGMA [database.]user_version
** PRAGMA [database.]user_version = <integer>
**
+ ** PRAGMA [database.]freelist_count = <integer>
+ **
+ ** PRAGMA [database.]application_id
+ ** PRAGMA [database.]application_id = <integer>
+ **
** The pragma's schema_version and user_version are used to set or get
** the value of the schema-version and user-version, respectively. Both
** the schema-version and the user-version are 32-bit signed integers
@@ -93620,10 +94972,14 @@ SQLITE_PRIVATE void sqlite3Pragma(
if( sqlite3StrICmp(zLeft, "schema_version")==0
|| sqlite3StrICmp(zLeft, "user_version")==0
|| sqlite3StrICmp(zLeft, "freelist_count")==0
+ || sqlite3StrICmp(zLeft, "application_id")==0
){
int iCookie; /* Cookie index. 1 for schema-cookie, 6 for user-cookie. */
sqlite3VdbeUsesBtree(v, iDb);
switch( zLeft[0] ){
+ case 'a': case 'A':
+ iCookie = BTREE_APPLICATION_ID;
+ break;
case 'f': case 'F':
iCookie = BTREE_FREE_PAGE_COUNT;
break;
@@ -94504,7 +95860,6 @@ static int sqlite3Prepare(
}
#endif
- assert( db->init.busy==0 || saveSqlFlag==0 );
if( db->init.busy==0 ){
Vdbe *pVdbe = pParse->pVdbe;
sqlite3VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql), saveSqlFlag);
@@ -97980,6 +99335,69 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF
}
return SQLITE_OK;
}
+/*
+** Detect compound SELECT statements that use an ORDER BY clause with
+** an alternative collating sequence.
+**
+** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
+**
+** These are rewritten as a subquery:
+**
+** SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2)
+** ORDER BY ... COLLATE ...
+**
+** This transformation is necessary because the multiSelectOrderBy() routine
+** above that generates the code for a compound SELECT with an ORDER BY clause
+** uses a merge algorithm that requires the same collating sequence on the
+** result columns as on the ORDER BY clause. See ticket
+** http://www.sqlite.org/src/info/6709574d2a
+**
+** This transformation is only needed for EXCEPT, INTERSECT, and UNION.
+** The UNION ALL operator works fine with multiSelectOrderBy() even when
+** there are COLLATE terms in the ORDER BY.
+*/
+static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){
+ int i;
+ Select *pNew;
+ Select *pX;
+ sqlite3 *db;
+ struct ExprList_item *a;
+ SrcList *pNewSrc;
+ Parse *pParse;
+ Token dummy;
+
+ if( p->pPrior==0 ) return WRC_Continue;
+ if( p->pOrderBy==0 ) return WRC_Continue;
+ for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){}
+ if( pX==0 ) return WRC_Continue;
+ a = p->pOrderBy->a;
+ for(i=p->pOrderBy->nExpr-1; i>=0; i--){
+ if( a[i].pExpr->flags & EP_Collate ) break;
+ }
+ if( i<0 ) return WRC_Continue;
+
+ /* If we reach this point, that means the transformation is required. */
+
+ pParse = pWalker->pParse;
+ db = pParse->db;
+ pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
+ if( pNew==0 ) return WRC_Abort;
+ memset(&dummy, 0, sizeof(dummy));
+ pNewSrc = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&dummy,pNew,0,0);
+ if( pNewSrc==0 ) return WRC_Abort;
+ *pNew = *p;
+ p->pSrc = pNewSrc;
+ p->pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ALL, 0));
+ p->op = TK_SELECT;
+ p->pWhere = 0;
+ pNew->pGroupBy = 0;
+ pNew->pHaving = 0;
+ pNew->pOrderBy = 0;
+ p->pPrior = 0;
+ pNew->pLimit = 0;
+ pNew->pOffset = 0;
+ return WRC_Continue;
+}
/*
** This routine is a Walker callback for "expanding" a SELECT statement.
@@ -98296,10 +99714,13 @@ static int exprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
*/
static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
Walker w;
- w.xSelectCallback = selectExpander;
+ memset(&w, 0, sizeof(w));
+ w.xSelectCallback = convertCompoundSelectToSubquery;
w.xExprCallback = exprWalkNoop;
w.pParse = pParse;
sqlite3WalkSelect(&w, pSelect);
+ w.xSelectCallback = selectExpander;
+ sqlite3WalkSelect(&w, pSelect);
}
@@ -98354,9 +99775,11 @@ static int selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
#ifndef SQLITE_OMIT_SUBQUERY
Walker w;
+ memset(&w, 0, sizeof(w));
w.xSelectCallback = selectAddSubqueryTypeInfo;
w.xExprCallback = exprWalkNoop;
w.pParse = pParse;
+ w.bSelectDepthFirst = 1;
sqlite3WalkSelect(&w, pSelect);
#endif
}
@@ -98767,7 +100190,7 @@ SQLITE_PRIVATE int sqlite3Select(
pItem->addrFillSub = topAddr+1;
VdbeNoopComment((v, "materialize %s", pItem->pTab->zName));
if( pItem->isCorrelated==0 ){
- /* If the subquery is no correlated and if we are not inside of
+ /* If the subquery is not correlated and if we are not inside of
** a trigger, then we only need to compute the value of the subquery
** once. */
onceAddr = sqlite3CodeOnce(pParse);
@@ -101033,6 +102456,7 @@ SQLITE_PRIVATE void sqlite3Update(
}
if( j>=pTab->nCol ){
if( sqlite3IsRowid(pChanges->a[i].zName) ){
+ j = -1;
chngRowid = 1;
pRowidExpr = pChanges->a[i].pExpr;
}else{
@@ -101045,7 +102469,8 @@ SQLITE_PRIVATE void sqlite3Update(
{
int rc;
rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName,
- pTab->aCol[j].zName, db->aDb[iDb].zName);
+ j<0 ? "ROWID" : pTab->aCol[j].zName,
+ db->aDb[iDb].zName);
if( rc==SQLITE_DENY ){
goto update_cleanup;
}else if( rc==SQLITE_IGNORE ){
@@ -101788,6 +103213,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
BTREE_DEFAULT_CACHE_SIZE, 0, /* Preserve the default page cache size */
BTREE_TEXT_ENCODING, 0, /* Preserve the text encoding */
BTREE_USER_VERSION, 0, /* Preserve the user version */
+ BTREE_APPLICATION_ID, 0, /* Preserve the application id */
};
assert( 1==sqlite3BtreeIsInTrans(pTemp) );
@@ -103655,7 +105081,7 @@ static WhereTerm *findTerm(
continue;
}
}
- if( pTerm->prereqRight==0 ){
+ if( pTerm->prereqRight==0 && (pTerm->eOperator&WO_EQ)!=0 ){
pResult = pTerm;
goto findTerm_success;
}else if( pResult==0 ){
@@ -105225,9 +106651,8 @@ static void bestVirtualIndex(WhereBestIdx *p){
struct sqlite3_index_constraint *pIdxCons;
struct sqlite3_index_constraint_usage *pUsage;
WhereTerm *pTerm;
- int i, j, k;
+ int i, j;
int nOrderBy;
- int sortOrder; /* Sort order for IN clauses */
int bAllowIN; /* Allow IN optimizations */
double rCost;
@@ -105326,7 +106751,6 @@ static void bestVirtualIndex(WhereBestIdx *p){
return;
}
- sortOrder = SQLITE_SO_ASC;
pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
for(i=0; i<pIdxInfo->nConstraint; i++, pIdxCons++){
if( pUsage[i].argvIndex>0 ){
@@ -105341,17 +106765,28 @@ static void bestVirtualIndex(WhereBestIdx *p){
** repeated in the output. */
break;
}
- for(k=0; k<pIdxInfo->nOrderBy; k++){
- if( pIdxInfo->aOrderBy[k].iColumn==pIdxCons->iColumn ){
- sortOrder = pIdxInfo->aOrderBy[k].desc;
- break;
- }
- }
+ /* A virtual table that is constrained by an IN clause may not
+ ** consume the ORDER BY clause because (1) the order of IN terms
+ ** is not necessarily related to the order of output terms and
+ ** (2) Multiple outputs from a single IN value will not merge
+ ** together. */
+ pIdxInfo->orderByConsumed = 0;
}
}
}
if( i>=pIdxInfo->nConstraint ) break;
}
+
+ /* The orderByConsumed signal is only valid if all outer loops collectively
+ ** generate just a single row of output.
+ */
+ if( pIdxInfo->orderByConsumed ){
+ for(i=0; i<p->i; i++){
+ if( (p->aLevel[i].plan.wsFlags & WHERE_UNIQUE)==0 ){
+ pIdxInfo->orderByConsumed = 0;
+ }
+ }
+ }
/* If there is an ORDER BY clause, and the selected virtual table index
** does not satisfy it, increase the cost of the scan accordingly. This
@@ -105376,8 +106811,7 @@ static void bestVirtualIndex(WhereBestIdx *p){
}
p->cost.plan.u.pVtabIdx = pIdxInfo;
if( pIdxInfo->orderByConsumed ){
- assert( sortOrder==0 || sortOrder==1 );
- p->cost.plan.wsFlags |= WHERE_ORDERED + sortOrder*WHERE_REVERSE;
+ p->cost.plan.wsFlags |= WHERE_ORDERED;
p->cost.plan.nOBSat = nOrderBy;
}else{
p->cost.plan.nOBSat = p->i ? p->aLevel[p->i-1].plan.nOBSat : 0;
@@ -107114,6 +108548,7 @@ static Bitmask codeOneLoopStart(
int addrCont; /* Jump here to continue with next cycle */
int iRowidReg = 0; /* Rowid is stored in this register, if not zero */
int iReleaseReg = 0; /* Temp register to free before returning */
+ Bitmask newNotReady; /* Return value */
pParse = pWInfo->pParse;
v = pParse->pVdbe;
@@ -107124,6 +108559,7 @@ static Bitmask codeOneLoopStart(
bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0;
omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0
&& (wctrlFlags & WHERE_FORCE_TABLE)==0;
+ VdbeNoopComment((v, "Begin Join Loop %d", iLevel));
/* Create labels for the "break" and "continue" instructions
** for the current loop. Jump to addrBrk to break out of a loop.
@@ -107666,6 +109102,10 @@ static Bitmask codeOneLoopStart(
** the "interesting" terms of z - terms that did not originate in the
** ON or USING clause of a LEFT JOIN, and terms that are usable as
** indices.
+ **
+ ** This optimization also only applies if the (x1 OR x2 OR ...) term
+ ** is not contained in the ON clause of a LEFT JOIN.
+ ** See ticket http://www.sqlite.org/src/info/f2369304e4
*/
if( pWC->nTerm>1 ){
int iTerm;
@@ -107687,7 +109127,7 @@ static Bitmask codeOneLoopStart(
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){
WhereInfo *pSubWInfo; /* Info for single OR-term scan */
Expr *pOrExpr = pOrTerm->pExpr;
- if( pAndExpr ){
+ if( pAndExpr && !ExprHasProperty(pOrExpr, EP_FromJoin) ){
pAndExpr->pLeft = pOrExpr;
pOrExpr = pAndExpr;
}
@@ -107774,7 +109214,7 @@ static Bitmask codeOneLoopStart(
pLevel->p2 = 1 + sqlite3VdbeAddOp2(v, aStart[bRev], iCur, addrBrk);
pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP;
}
- notReady &= ~getMask(pWC->pMaskSet, iCur);
+ newNotReady = notReady & ~getMask(pWC->pMaskSet, iCur);
/* Insert code to test every subexpression that can be completely
** computed using the current set of tables.
@@ -107788,7 +109228,7 @@ static Bitmask codeOneLoopStart(
testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* IMP: R-30575-11662 */
testcase( pTerm->wtFlags & TERM_CODED );
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
- if( (pTerm->prereqAll & notReady)!=0 ){
+ if( (pTerm->prereqAll & newNotReady)!=0 ){
testcase( pWInfo->untestedTerms==0
&& (pWInfo->wctrlFlags & WHERE_ONETABLE_ONLY)!=0 );
pWInfo->untestedTerms = 1;
@@ -107803,6 +109243,33 @@ static Bitmask codeOneLoopStart(
pTerm->wtFlags |= TERM_CODED;
}
+ /* Insert code to test for implied constraints based on transitivity
+ ** of the "==" operator.
+ **
+ ** Example: If the WHERE clause contains "t1.a=t2.b" and "t2.b=123"
+ ** and we are coding the t1 loop and the t2 loop has not yet coded,
+ ** then we cannot use the "t1.a=t2.b" constraint, but we can code
+ ** the implied "t1.a=123" constraint.
+ */
+ for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
+ Expr *pE;
+ WhereTerm *pAlt;
+ Expr sEq;
+ if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
+ if( pTerm->eOperator!=(WO_EQUIV|WO_EQ) ) continue;
+ if( pTerm->leftCursor!=iCur ) continue;
+ pE = pTerm->pExpr;
+ assert( !ExprHasProperty(pE, EP_FromJoin) );
+ assert( (pTerm->prereqRight & newNotReady)!=0 );
+ pAlt = findTerm(pWC, iCur, pTerm->u.leftColumn, notReady, WO_EQ|WO_IN, 0);
+ if( pAlt==0 ) continue;
+ if( pAlt->wtFlags & (TERM_CODED) ) continue;
+ VdbeNoopComment((v, "begin transitive constraint"));
+ sEq = *pAlt->pExpr;
+ sEq.pLeft = pE->pLeft;
+ sqlite3ExprIfFalse(pParse, &sEq, addrCont, SQLITE_JUMPIFNULL);
+ }
+
/* For a LEFT OUTER JOIN, generate code that will record the fact that
** at least one row of the right table has matched the left table.
*/
@@ -107815,7 +109282,7 @@ static Bitmask codeOneLoopStart(
testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* IMP: R-30575-11662 */
testcase( pTerm->wtFlags & TERM_CODED );
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
- if( (pTerm->prereqAll & notReady)!=0 ){
+ if( (pTerm->prereqAll & newNotReady)!=0 ){
assert( pWInfo->untestedTerms );
continue;
}
@@ -107826,7 +109293,7 @@ static Bitmask codeOneLoopStart(
}
sqlite3ReleaseTempReg(pParse, iReleaseReg);
- return notReady;
+ return newNotReady;
}
#if defined(SQLITE_TEST)
@@ -111144,7 +112611,9 @@ static void yy_reduce(
struct SrcList_item *pOld = yymsp[-4].minor.yy347->a;
pNew->zName = pOld->zName;
pNew->zDatabase = pOld->zDatabase;
+ pNew->pSelect = pOld->pSelect;
pOld->zName = pOld->zDatabase = 0;
+ pOld->pSelect = 0;
}
sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy347);
}else{
@@ -113812,6 +115281,19 @@ SQLITE_API int sqlite3_config(int op, ...){
}
#endif
+ case SQLITE_CONFIG_MMAP_SIZE: {
+ sqlite3_int64 szMmap = va_arg(ap, sqlite3_int64);
+ sqlite3_int64 mxMmap = va_arg(ap, sqlite3_int64);
+ if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){
+ mxMmap = SQLITE_MAX_MMAP_SIZE;
+ }
+ sqlite3GlobalConfig.mxMmap = mxMmap;
+ if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE;
+ if( szMmap>mxMmap) szMmap = mxMmap;
+ sqlite3GlobalConfig.szMmap = szMmap;
+ break;
+ }
+
default: {
rc = SQLITE_ERROR;
break;
@@ -114205,6 +115687,12 @@ SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
** go ahead and free all resources.
*/
+ /* If a transaction is open, roll it back. This also ensures that if
+ ** any database schemas have been modified by an uncommitted transaction
+ ** they are reset. And that the required b-tree mutex is held to make
+ ** the pager rollback and schema reset an atomic operation. */
+ sqlite3RollbackAll(db, SQLITE_OK);
+
/* Free any outstanding Savepoint structures. */
sqlite3CloseSavepoints(db);
@@ -114305,6 +115793,15 @@ SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){
int inTrans = 0;
assert( sqlite3_mutex_held(db->mutex) );
sqlite3BeginBenignMalloc();
+
+ /* Obtain all b-tree mutexes before making any calls to BtreeRollback().
+ ** This is important in case the transaction being rolled back has
+ ** modified the database schema. If the b-tree mutexes are not taken
+ ** here, then another shared-cache connection might sneak in between
+ ** the database rollback and schema reset, which can cause false
+ ** corruption reports in some cases. */
+ sqlite3BtreeEnterAll(db);
+
for(i=0; i<db->nDb; i++){
Btree *p = db->aDb[i].pBt;
if( p ){
@@ -114322,6 +115819,7 @@ SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){
sqlite3ExpirePreparedStatements(db);
sqlite3ResetAllSchemasOfConnection(db);
}
+ sqlite3BtreeLeaveAll(db);
/* Any deferred constraint violations have now been resolved. */
db->nDeferredCons = 0;
@@ -114333,6 +115831,110 @@ SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){
}
/*
+** Return a static string containing the name corresponding to the error code
+** specified in the argument.
+*/
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) || \
+ defined(SQLITE_DEBUG_OS_TRACE)
+SQLITE_PRIVATE const char *sqlite3ErrName(int rc){
+ const char *zName = 0;
+ int i, origRc = rc;
+ for(i=0; i<2 && zName==0; i++, rc &= 0xff){
+ switch( rc ){
+ case SQLITE_OK: zName = "SQLITE_OK"; break;
+ case SQLITE_ERROR: zName = "SQLITE_ERROR"; break;
+ case SQLITE_INTERNAL: zName = "SQLITE_INTERNAL"; break;
+ case SQLITE_PERM: zName = "SQLITE_PERM"; break;
+ case SQLITE_ABORT: zName = "SQLITE_ABORT"; break;
+ case SQLITE_ABORT_ROLLBACK: zName = "SQLITE_ABORT_ROLLBACK"; break;
+ case SQLITE_BUSY: zName = "SQLITE_BUSY"; break;
+ case SQLITE_BUSY_RECOVERY: zName = "SQLITE_BUSY_RECOVERY"; break;
+ case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break;
+ case SQLITE_LOCKED_SHAREDCACHE: zName = "SQLITE_LOCKED_SHAREDCACHE";break;
+ case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break;
+ case SQLITE_READONLY: zName = "SQLITE_READONLY"; break;
+ case SQLITE_READONLY_RECOVERY: zName = "SQLITE_READONLY_RECOVERY"; break;
+ case SQLITE_READONLY_CANTLOCK: zName = "SQLITE_READONLY_CANTLOCK"; break;
+ case SQLITE_READONLY_ROLLBACK: zName = "SQLITE_READONLY_ROLLBACK"; break;
+ case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break;
+ case SQLITE_IOERR: zName = "SQLITE_IOERR"; break;
+ case SQLITE_IOERR_READ: zName = "SQLITE_IOERR_READ"; break;
+ case SQLITE_IOERR_SHORT_READ: zName = "SQLITE_IOERR_SHORT_READ"; break;
+ case SQLITE_IOERR_WRITE: zName = "SQLITE_IOERR_WRITE"; break;
+ case SQLITE_IOERR_FSYNC: zName = "SQLITE_IOERR_FSYNC"; break;
+ case SQLITE_IOERR_DIR_FSYNC: zName = "SQLITE_IOERR_DIR_FSYNC"; break;
+ case SQLITE_IOERR_TRUNCATE: zName = "SQLITE_IOERR_TRUNCATE"; break;
+ case SQLITE_IOERR_FSTAT: zName = "SQLITE_IOERR_FSTAT"; break;
+ case SQLITE_IOERR_UNLOCK: zName = "SQLITE_IOERR_UNLOCK"; break;
+ case SQLITE_IOERR_RDLOCK: zName = "SQLITE_IOERR_RDLOCK"; break;
+ case SQLITE_IOERR_DELETE: zName = "SQLITE_IOERR_DELETE"; break;
+ case SQLITE_IOERR_BLOCKED: zName = "SQLITE_IOERR_BLOCKED"; break;
+ case SQLITE_IOERR_NOMEM: zName = "SQLITE_IOERR_NOMEM"; break;
+ case SQLITE_IOERR_ACCESS: zName = "SQLITE_IOERR_ACCESS"; break;
+ case SQLITE_IOERR_CHECKRESERVEDLOCK:
+ zName = "SQLITE_IOERR_CHECKRESERVEDLOCK"; break;
+ case SQLITE_IOERR_LOCK: zName = "SQLITE_IOERR_LOCK"; break;
+ case SQLITE_IOERR_CLOSE: zName = "SQLITE_IOERR_CLOSE"; break;
+ case SQLITE_IOERR_DIR_CLOSE: zName = "SQLITE_IOERR_DIR_CLOSE"; break;
+ case SQLITE_IOERR_SHMOPEN: zName = "SQLITE_IOERR_SHMOPEN"; break;
+ case SQLITE_IOERR_SHMSIZE: zName = "SQLITE_IOERR_SHMSIZE"; break;
+ case SQLITE_IOERR_SHMLOCK: zName = "SQLITE_IOERR_SHMLOCK"; break;
+ case SQLITE_IOERR_SHMMAP: zName = "SQLITE_IOERR_SHMMAP"; break;
+ case SQLITE_IOERR_SEEK: zName = "SQLITE_IOERR_SEEK"; break;
+ case SQLITE_IOERR_DELETE_NOENT: zName = "SQLITE_IOERR_DELETE_NOENT";break;
+ case SQLITE_IOERR_MMAP: zName = "SQLITE_IOERR_MMAP"; break;
+ case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break;
+ case SQLITE_CORRUPT_VTAB: zName = "SQLITE_CORRUPT_VTAB"; break;
+ case SQLITE_NOTFOUND: zName = "SQLITE_NOTFOUND"; break;
+ case SQLITE_FULL: zName = "SQLITE_FULL"; break;
+ case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break;
+ case SQLITE_CANTOPEN_NOTEMPDIR: zName = "SQLITE_CANTOPEN_NOTEMPDIR";break;
+ case SQLITE_CANTOPEN_ISDIR: zName = "SQLITE_CANTOPEN_ISDIR"; break;
+ case SQLITE_CANTOPEN_FULLPATH: zName = "SQLITE_CANTOPEN_FULLPATH"; break;
+ case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break;
+ case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break;
+ case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break;
+ case SQLITE_TOOBIG: zName = "SQLITE_TOOBIG"; break;
+ case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break;
+ case SQLITE_CONSTRAINT_UNIQUE: zName = "SQLITE_CONSTRAINT_UNIQUE"; break;
+ case SQLITE_CONSTRAINT_TRIGGER: zName = "SQLITE_CONSTRAINT_TRIGGER";break;
+ case SQLITE_CONSTRAINT_FOREIGNKEY:
+ zName = "SQLITE_CONSTRAINT_FOREIGNKEY"; break;
+ case SQLITE_CONSTRAINT_CHECK: zName = "SQLITE_CONSTRAINT_CHECK"; break;
+ case SQLITE_CONSTRAINT_PRIMARYKEY:
+ zName = "SQLITE_CONSTRAINT_PRIMARYKEY"; break;
+ case SQLITE_CONSTRAINT_NOTNULL: zName = "SQLITE_CONSTRAINT_NOTNULL";break;
+ case SQLITE_CONSTRAINT_COMMITHOOK:
+ zName = "SQLITE_CONSTRAINT_COMMITHOOK"; break;
+ case SQLITE_CONSTRAINT_VTAB: zName = "SQLITE_CONSTRAINT_VTAB"; break;
+ case SQLITE_CONSTRAINT_FUNCTION:
+ zName = "SQLITE_CONSTRAINT_FUNCTION"; break;
+ case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break;
+ case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break;
+ case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break;
+ case SQLITE_AUTH: zName = "SQLITE_AUTH"; break;
+ case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break;
+ case SQLITE_RANGE: zName = "SQLITE_RANGE"; break;
+ case SQLITE_NOTADB: zName = "SQLITE_NOTADB"; break;
+ case SQLITE_ROW: zName = "SQLITE_ROW"; break;
+ case SQLITE_NOTICE: zName = "SQLITE_NOTICE"; break;
+ case SQLITE_NOTICE_RECOVER_WAL: zName = "SQLITE_NOTICE_RECOVER_WAL";break;
+ case SQLITE_NOTICE_RECOVER_ROLLBACK:
+ zName = "SQLITE_NOTICE_RECOVER_ROLLBACK"; break;
+ case SQLITE_WARNING: zName = "SQLITE_WARNING"; break;
+ case SQLITE_DONE: zName = "SQLITE_DONE"; break;
+ }
+ }
+ if( zName==0 ){
+ static char zBuf[50];
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "SQLITE_UNKNOWN(%d)", origRc);
+ zName = zBuf;
+ }
+ return zName;
+}
+#endif
+
+/*
** Return a static string that describes the kind of error specified in the
** argument.
*/
@@ -115632,6 +117234,7 @@ static int openDatabase(
memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
db->autoCommit = 1;
db->nextAutovac = -1;
+ db->szMmap = sqlite3GlobalConfig.szMmap;
db->nextPagesize = 0;
db->flags |= SQLITE_ShortColNames | SQLITE_AutoIndex | SQLITE_EnableTrigger
#if SQLITE_DEFAULT_FILE_FORMAT<4
@@ -117948,7 +119551,7 @@ SQLITE_PRIVATE void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *, const
/* fts3_expr.c */
SQLITE_PRIVATE int sqlite3Fts3ExprParse(sqlite3_tokenizer *, int,
- char **, int, int, int, const char *, int, Fts3Expr **
+ char **, int, int, int, const char *, int, Fts3Expr **, char **
);
SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *);
#ifdef SQLITE_TEST
@@ -117973,6 +119576,9 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iC
SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *);
SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr);
+/* fts3_tokenize_vtab.c */
+SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3*, Fts3Hash *);
+
/* fts3_unicode2.c (functions generated by parsing unicode text files) */
#ifdef SQLITE_ENABLE_FTS4_UNICODE61
SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int, int);
@@ -120669,14 +122275,12 @@ static int fts3FilterMethod(
pCsr->iLangid = 0;
if( nVal==2 ) pCsr->iLangid = sqlite3_value_int(apVal[1]);
+ assert( p->base.zErrMsg==0 );
rc = sqlite3Fts3ExprParse(p->pTokenizer, pCsr->iLangid,
- p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr
+ p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr,
+ &p->base.zErrMsg
);
if( rc!=SQLITE_OK ){
- if( rc==SQLITE_ERROR ){
- static const char *zErr = "malformed MATCH expression: [%s]";
- p->base.zErrMsg = sqlite3_mprintf(zErr, zQuery);
- }
return rc;
}
@@ -121340,9 +122944,13 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){
db, "fts4", &fts3Module, (void *)pHash, 0
);
}
+ if( rc==SQLITE_OK ){
+ rc = sqlite3Fts3InitTok(db, (void *)pHash);
+ }
return rc;
}
+
/* An error has occurred. Delete the hash table and return the error code. */
assert( rc!=SQLITE_OK );
if( pHash ){
@@ -123116,17 +124724,26 @@ static int fts3auxConnectMethod(
UNUSED_PARAMETER(pUnused);
- /* The user should specify a single argument - the name of an fts3 table. */
- if( argc!=4 ){
- *pzErr = sqlite3_mprintf(
- "wrong number of arguments to fts4aux constructor"
- );
- return SQLITE_ERROR;
- }
+ /* The user should invoke this in one of two forms:
+ **
+ ** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table);
+ ** CREATE VIRTUAL TABLE xxx USING fts4aux(fts4-table-db, fts4-table);
+ */
+ if( argc!=4 && argc!=5 ) goto bad_args;
zDb = argv[1];
nDb = (int)strlen(zDb);
- zFts3 = argv[3];
+ if( argc==5 ){
+ if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){
+ zDb = argv[3];
+ nDb = (int)strlen(zDb);
+ zFts3 = argv[4];
+ }else{
+ goto bad_args;
+ }
+ }else{
+ zFts3 = argv[3];
+ }
nFts3 = (int)strlen(zFts3);
rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA);
@@ -123149,6 +124766,10 @@ static int fts3auxConnectMethod(
*ppVtab = (sqlite3_vtab *)p;
return SQLITE_OK;
+
+ bad_args:
+ *pzErr = sqlite3_mprintf("invalid arguments to fts4aux constructor");
+ return SQLITE_ERROR;
}
/*
@@ -124162,8 +125783,10 @@ static int fts3ExprParse(
}
pNot->eType = FTSQUERY_NOT;
pNot->pRight = p;
+ p->pParent = pNot;
if( pNotBranch ){
pNot->pLeft = pNotBranch;
+ pNotBranch->pParent = pNot;
}
pNotBranch = pNot;
p = pPrev;
@@ -124251,6 +125874,7 @@ static int fts3ExprParse(
pIter = pIter->pLeft;
}
pIter->pLeft = pRet;
+ pRet->pParent = pIter;
pRet = pNotBranch;
}
}
@@ -124268,30 +125892,184 @@ exprparse_out:
}
/*
-** Parameters z and n contain a pointer to and length of a buffer containing
-** an fts3 query expression, respectively. This function attempts to parse the
-** query expression and create a tree of Fts3Expr structures representing the
-** parsed expression. If successful, *ppExpr is set to point to the head
-** of the parsed expression tree and SQLITE_OK is returned. If an error
-** occurs, either SQLITE_NOMEM (out-of-memory error) or SQLITE_ERROR (parse
-** error) is returned and *ppExpr is set to 0.
+** Return SQLITE_ERROR if the maximum depth of the expression tree passed
+** as the only argument is more than nMaxDepth.
+*/
+static int fts3ExprCheckDepth(Fts3Expr *p, int nMaxDepth){
+ int rc = SQLITE_OK;
+ if( p ){
+ if( nMaxDepth<0 ){
+ rc = SQLITE_TOOBIG;
+ }else{
+ rc = fts3ExprCheckDepth(p->pLeft, nMaxDepth-1);
+ if( rc==SQLITE_OK ){
+ rc = fts3ExprCheckDepth(p->pRight, nMaxDepth-1);
+ }
+ }
+ }
+ return rc;
+}
+
+/*
+** This function attempts to transform the expression tree at (*pp) to
+** an equivalent but more balanced form. The tree is modified in place.
+** If successful, SQLITE_OK is returned and (*pp) set to point to the
+** new root expression node.
**
-** If parameter n is a negative number, then z is assumed to point to a
-** nul-terminated string and the length is determined using strlen().
+** nMaxDepth is the maximum allowable depth of the balanced sub-tree.
**
-** The first parameter, pTokenizer, is passed the fts3 tokenizer module to
-** use to normalize query tokens while parsing the expression. The azCol[]
-** array, which is assumed to contain nCol entries, should contain the names
-** of each column in the target fts3 table, in order from left to right.
-** Column names must be nul-terminated strings.
+** Otherwise, if an error occurs, an SQLite error code is returned and
+** expression (*pp) freed.
+*/
+static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){
+ int rc = SQLITE_OK; /* Return code */
+ Fts3Expr *pRoot = *pp; /* Initial root node */
+ Fts3Expr *pFree = 0; /* List of free nodes. Linked by pParent. */
+ int eType = pRoot->eType; /* Type of node in this tree */
+
+ if( nMaxDepth==0 ){
+ rc = SQLITE_ERROR;
+ }
+
+ if( rc==SQLITE_OK && (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){
+ Fts3Expr **apLeaf;
+ apLeaf = (Fts3Expr **)sqlite3_malloc(sizeof(Fts3Expr *) * nMaxDepth);
+ if( 0==apLeaf ){
+ rc = SQLITE_NOMEM;
+ }else{
+ memset(apLeaf, 0, sizeof(Fts3Expr *) * nMaxDepth);
+ }
+
+ if( rc==SQLITE_OK ){
+ int i;
+ Fts3Expr *p;
+
+ /* Set $p to point to the left-most leaf in the tree of eType nodes. */
+ for(p=pRoot; p->eType==eType; p=p->pLeft){
+ assert( p->pParent==0 || p->pParent->pLeft==p );
+ assert( p->pLeft && p->pRight );
+ }
+
+ /* This loop runs once for each leaf in the tree of eType nodes. */
+ while( 1 ){
+ int iLvl;
+ Fts3Expr *pParent = p->pParent; /* Current parent of p */
+
+ assert( pParent==0 || pParent->pLeft==p );
+ p->pParent = 0;
+ if( pParent ){
+ pParent->pLeft = 0;
+ }else{
+ pRoot = 0;
+ }
+ rc = fts3ExprBalance(&p, nMaxDepth-1);
+ if( rc!=SQLITE_OK ) break;
+
+ for(iLvl=0; p && iLvl<nMaxDepth; iLvl++){
+ if( apLeaf[iLvl]==0 ){
+ apLeaf[iLvl] = p;
+ p = 0;
+ }else{
+ assert( pFree );
+ pFree->pLeft = apLeaf[iLvl];
+ pFree->pRight = p;
+ pFree->pLeft->pParent = pFree;
+ pFree->pRight->pParent = pFree;
+
+ p = pFree;
+ pFree = pFree->pParent;
+ p->pParent = 0;
+ apLeaf[iLvl] = 0;
+ }
+ }
+ if( p ){
+ sqlite3Fts3ExprFree(p);
+ rc = SQLITE_TOOBIG;
+ break;
+ }
+
+ /* If that was the last leaf node, break out of the loop */
+ if( pParent==0 ) break;
+
+ /* Set $p to point to the next leaf in the tree of eType nodes */
+ for(p=pParent->pRight; p->eType==eType; p=p->pLeft);
+
+ /* Remove pParent from the original tree. */
+ assert( pParent->pParent==0 || pParent->pParent->pLeft==pParent );
+ pParent->pRight->pParent = pParent->pParent;
+ if( pParent->pParent ){
+ pParent->pParent->pLeft = pParent->pRight;
+ }else{
+ assert( pParent==pRoot );
+ pRoot = pParent->pRight;
+ }
+
+ /* Link pParent into the free node list. It will be used as an
+ ** internal node of the new tree. */
+ pParent->pParent = pFree;
+ pFree = pParent;
+ }
+
+ if( rc==SQLITE_OK ){
+ p = 0;
+ for(i=0; i<nMaxDepth; i++){
+ if( apLeaf[i] ){
+ if( p==0 ){
+ p = apLeaf[i];
+ p->pParent = 0;
+ }else{
+ assert( pFree!=0 );
+ pFree->pRight = p;
+ pFree->pLeft = apLeaf[i];
+ pFree->pLeft->pParent = pFree;
+ pFree->pRight->pParent = pFree;
+
+ p = pFree;
+ pFree = pFree->pParent;
+ p->pParent = 0;
+ }
+ }
+ }
+ pRoot = p;
+ }else{
+ /* An error occurred. Delete the contents of the apLeaf[] array
+ ** and pFree list. Everything else is cleaned up by the call to
+ ** sqlite3Fts3ExprFree(pRoot) below. */
+ Fts3Expr *pDel;
+ for(i=0; i<nMaxDepth; i++){
+ sqlite3Fts3ExprFree(apLeaf[i]);
+ }
+ while( (pDel=pFree)!=0 ){
+ pFree = pDel->pParent;
+ sqlite3_free(pDel);
+ }
+ }
+
+ assert( pFree==0 );
+ sqlite3_free( apLeaf );
+ }
+ }
+
+ if( rc!=SQLITE_OK ){
+ sqlite3Fts3ExprFree(pRoot);
+ pRoot = 0;
+ }
+ *pp = pRoot;
+ return rc;
+}
+
+/*
+** This function is similar to sqlite3Fts3ExprParse(), with the following
+** differences:
**
-** The iDefaultCol parameter should be passed the index of the table column
-** that appears on the left-hand-side of the MATCH operator (the default
-** column to match against for tokens for which a column name is not explicitly
-** specified as part of the query string), or -1 if tokens may by default
-** match any table column.
+** 1. It does not do expression rebalancing.
+** 2. It does not check that the expression does not exceed the
+** maximum allowable depth.
+** 3. Even if it fails, *ppExpr may still be set to point to an
+** expression tree. It should be deleted using sqlite3Fts3ExprFree()
+** in this case.
*/
-SQLITE_PRIVATE int sqlite3Fts3ExprParse(
+static int fts3ExprParseUnbalanced(
sqlite3_tokenizer *pTokenizer, /* Tokenizer module */
int iLangid, /* Language id for tokenizer */
char **azCol, /* Array of column names for fts3 table */
@@ -124320,28 +126098,116 @@ SQLITE_PRIVATE int sqlite3Fts3ExprParse(
n = (int)strlen(z);
}
rc = fts3ExprParse(&sParse, z, n, ppExpr, &nParsed);
+ assert( rc==SQLITE_OK || *ppExpr==0 );
/* Check for mismatched parenthesis */
if( rc==SQLITE_OK && sParse.nNest ){
rc = SQLITE_ERROR;
+ }
+
+ return rc;
+}
+
+/*
+** Parameters z and n contain a pointer to and length of a buffer containing
+** an fts3 query expression, respectively. This function attempts to parse the
+** query expression and create a tree of Fts3Expr structures representing the
+** parsed expression. If successful, *ppExpr is set to point to the head
+** of the parsed expression tree and SQLITE_OK is returned. If an error
+** occurs, either SQLITE_NOMEM (out-of-memory error) or SQLITE_ERROR (parse
+** error) is returned and *ppExpr is set to 0.
+**
+** If parameter n is a negative number, then z is assumed to point to a
+** nul-terminated string and the length is determined using strlen().
+**
+** The first parameter, pTokenizer, is passed the fts3 tokenizer module to
+** use to normalize query tokens while parsing the expression. The azCol[]
+** array, which is assumed to contain nCol entries, should contain the names
+** of each column in the target fts3 table, in order from left to right.
+** Column names must be nul-terminated strings.
+**
+** The iDefaultCol parameter should be passed the index of the table column
+** that appears on the left-hand-side of the MATCH operator (the default
+** column to match against for tokens for which a column name is not explicitly
+** specified as part of the query string), or -1 if tokens may by default
+** match any table column.
+*/
+SQLITE_PRIVATE int sqlite3Fts3ExprParse(
+ sqlite3_tokenizer *pTokenizer, /* Tokenizer module */
+ int iLangid, /* Language id for tokenizer */
+ char **azCol, /* Array of column names for fts3 table */
+ int bFts4, /* True to allow FTS4-only syntax */
+ int nCol, /* Number of entries in azCol[] */
+ int iDefaultCol, /* Default column to query */
+ const char *z, int n, /* Text of MATCH query */
+ Fts3Expr **ppExpr, /* OUT: Parsed query structure */
+ char **pzErr /* OUT: Error message (sqlite3_malloc) */
+){
+ static const int MAX_EXPR_DEPTH = 12;
+ int rc = fts3ExprParseUnbalanced(
+ pTokenizer, iLangid, azCol, bFts4, nCol, iDefaultCol, z, n, ppExpr
+ );
+
+ /* Rebalance the expression. And check that its depth does not exceed
+ ** MAX_EXPR_DEPTH. */
+ if( rc==SQLITE_OK && *ppExpr ){
+ rc = fts3ExprBalance(ppExpr, MAX_EXPR_DEPTH);
+ if( rc==SQLITE_OK ){
+ rc = fts3ExprCheckDepth(*ppExpr, MAX_EXPR_DEPTH);
+ }
+ }
+
+ if( rc!=SQLITE_OK ){
sqlite3Fts3ExprFree(*ppExpr);
*ppExpr = 0;
+ if( rc==SQLITE_TOOBIG ){
+ *pzErr = sqlite3_mprintf(
+ "FTS expression tree is too large (maximum depth %d)", MAX_EXPR_DEPTH
+ );
+ rc = SQLITE_ERROR;
+ }else if( rc==SQLITE_ERROR ){
+ *pzErr = sqlite3_mprintf("malformed MATCH expression: [%s]", z);
+ }
}
return rc;
}
/*
+** Free a single node of an expression tree.
+*/
+static void fts3FreeExprNode(Fts3Expr *p){
+ assert( p->eType==FTSQUERY_PHRASE || p->pPhrase==0 );
+ sqlite3Fts3EvalPhraseCleanup(p->pPhrase);
+ sqlite3_free(p->aMI);
+ sqlite3_free(p);
+}
+
+/*
** Free a parsed fts3 query expression allocated by sqlite3Fts3ExprParse().
+**
+** This function would be simpler if it recursively called itself. But
+** that would mean passing a sufficiently large expression to ExprParse()
+** could cause a stack overflow.
*/
-SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *p){
- if( p ){
- assert( p->eType==FTSQUERY_PHRASE || p->pPhrase==0 );
- sqlite3Fts3ExprFree(p->pLeft);
- sqlite3Fts3ExprFree(p->pRight);
- sqlite3Fts3EvalPhraseCleanup(p->pPhrase);
- sqlite3_free(p->aMI);
- sqlite3_free(p);
+SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *pDel){
+ Fts3Expr *p;
+ assert( pDel==0 || pDel->pParent==0 );
+ for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){
+ assert( p->pParent==0 || p==p->pParent->pRight || p==p->pParent->pLeft );
+ }
+ while( p ){
+ Fts3Expr *pParent = p->pParent;
+ fts3FreeExprNode(p);
+ if( pParent && p==pParent->pLeft && pParent->pRight ){
+ p = pParent->pRight;
+ while( p && (p->pLeft || p->pRight) ){
+ assert( p==p->pParent->pRight || p==p->pParent->pLeft );
+ p = (p->pLeft ? p->pLeft : p->pRight);
+ }
+ }else{
+ p = pParent;
+ }
}
}
@@ -124393,6 +126259,9 @@ static int queryTestTokenizer(
** the returned expression text and then freed using sqlite3_free().
*/
static char *exprToString(Fts3Expr *pExpr, char *zBuf){
+ if( pExpr==0 ){
+ return sqlite3_mprintf("");
+ }
switch( pExpr->eType ){
case FTSQUERY_PHRASE: {
Fts3Phrase *pPhrase = pExpr->pPhrase;
@@ -124500,10 +126369,21 @@ static void fts3ExprTest(
azCol[ii] = (char *)sqlite3_value_text(argv[ii+2]);
}
- rc = sqlite3Fts3ExprParse(
- pTokenizer, 0, azCol, 0, nCol, nCol, zExpr, nExpr, &pExpr
- );
+ if( sqlite3_user_data(context) ){
+ char *zDummy = 0;
+ rc = sqlite3Fts3ExprParse(
+ pTokenizer, 0, azCol, 0, nCol, nCol, zExpr, nExpr, &pExpr, &zDummy
+ );
+ assert( rc==SQLITE_OK || pExpr==0 );
+ sqlite3_free(zDummy);
+ }else{
+ rc = fts3ExprParseUnbalanced(
+ pTokenizer, 0, azCol, 0, nCol, nCol, zExpr, nExpr, &pExpr
+ );
+ }
+
if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM ){
+ sqlite3Fts3ExprFree(pExpr);
sqlite3_result_error(context, "Error parsing expression", -1);
}else if( rc==SQLITE_NOMEM || !(zBuf = exprToString(pExpr, 0)) ){
sqlite3_result_error_nomem(context);
@@ -124526,9 +126406,15 @@ exprtest_out:
** with database connection db.
*/
SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3* db){
- return sqlite3_create_function(
+ int rc = sqlite3_create_function(
db, "fts3_exprtest", -1, SQLITE_UTF8, 0, fts3ExprTest, 0, 0
);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3_create_function(db, "fts3_exprtest_rebalance",
+ -1, SQLITE_UTF8, (void *)1, fts3ExprTest, 0, 0
+ );
+ }
+ return rc;
}
#endif
@@ -126291,6 +128177,462 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule(
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
/************** End of fts3_tokenizer1.c *************************************/
+/************** Begin file fts3_tokenize_vtab.c ******************************/
+/*
+** 2013 Apr 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains code for the "fts3tokenize" virtual table module.
+** An fts3tokenize virtual table is created as follows:
+**
+** CREATE VIRTUAL TABLE <tbl> USING fts3tokenize(
+** <tokenizer-name>, <arg-1>, ...
+** );
+**
+** The table created has the following schema:
+**
+** CREATE TABLE <tbl>(input, token, start, end, position)
+**
+** When queried, the query must include a WHERE clause of type:
+**
+** input = <string>
+**
+** The virtual table module tokenizes this <string>, using the FTS3
+** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE
+** statement and returns one row for each token in the result. With
+** fields set as follows:
+**
+** input: Always set to a copy of <string>
+** token: A token from the input.
+** start: Byte offset of the token within the input <string>.
+** end: Byte offset of the byte immediately following the end of the
+** token within the input string.
+** pos: Token offset of token within input.
+**
+*/
+#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
+
+/* #include <string.h> */
+/* #include <assert.h> */
+
+typedef struct Fts3tokTable Fts3tokTable;
+typedef struct Fts3tokCursor Fts3tokCursor;
+
+/*
+** Virtual table structure.
+*/
+struct Fts3tokTable {
+ sqlite3_vtab base; /* Base class used by SQLite core */
+ const sqlite3_tokenizer_module *pMod;
+ sqlite3_tokenizer *pTok;
+};
+
+/*
+** Virtual table cursor structure.
+*/
+struct Fts3tokCursor {
+ sqlite3_vtab_cursor base; /* Base class used by SQLite core */
+ char *zInput; /* Input string */
+ sqlite3_tokenizer_cursor *pCsr; /* Cursor to iterate through zInput */
+ int iRowid; /* Current 'rowid' value */
+ const char *zToken; /* Current 'token' value */
+ int nToken; /* Size of zToken in bytes */
+ int iStart; /* Current 'start' value */
+ int iEnd; /* Current 'end' value */
+ int iPos; /* Current 'pos' value */
+};
+
+/*
+** Query FTS for the tokenizer implementation named zName.
+*/
+static int fts3tokQueryTokenizer(
+ Fts3Hash *pHash,
+ const char *zName,
+ const sqlite3_tokenizer_module **pp,
+ char **pzErr
+){
+ sqlite3_tokenizer_module *p;
+ int nName = (int)strlen(zName);
+
+ p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1);
+ if( !p ){
+ *pzErr = sqlite3_mprintf("unknown tokenizer: %s", zName);
+ return SQLITE_ERROR;
+ }
+
+ *pp = p;
+ return SQLITE_OK;
+}
+
+/*
+** The second argument, argv[], is an array of pointers to nul-terminated
+** strings. This function makes a copy of the array and strings into a
+** single block of memory. It then dequotes any of the strings that appear
+** to be quoted.
+**
+** If successful, output parameter *pazDequote is set to point at the
+** array of dequoted strings and SQLITE_OK is returned. The caller is
+** responsible for eventually calling sqlite3_free() to free the array
+** in this case. Or, if an error occurs, an SQLite error code is returned.
+** The final value of *pazDequote is undefined in this case.
+*/
+static int fts3tokDequoteArray(
+ int argc, /* Number of elements in argv[] */
+ const char * const *argv, /* Input array */
+ char ***pazDequote /* Output array */
+){
+ int rc = SQLITE_OK; /* Return code */
+ if( argc==0 ){
+ *pazDequote = 0;
+ }else{
+ int i;
+ int nByte = 0;
+ char **azDequote;
+
+ for(i=0; i<argc; i++){
+ nByte += (int)(strlen(argv[i]) + 1);
+ }
+
+ *pazDequote = azDequote = sqlite3_malloc(sizeof(char *)*argc + nByte);
+ if( azDequote==0 ){
+ rc = SQLITE_NOMEM;
+ }else{
+ char *pSpace = (char *)&azDequote[argc];
+ for(i=0; i<argc; i++){
+ int n = (int)strlen(argv[i]);
+ azDequote[i] = pSpace;
+ memcpy(pSpace, argv[i], n+1);
+ sqlite3Fts3Dequote(pSpace);
+ pSpace += (n+1);
+ }
+ }
+ }
+
+ return rc;
+}
+
+/*
+** Schema of the tokenizer table.
+*/
+#define FTS3_TOK_SCHEMA "CREATE TABLE x(input, token, start, end, position)"
+
+/*
+** This function does all the work for both the xConnect and xCreate methods.
+** These tables have no persistent representation of their own, so xConnect
+** and xCreate are identical operations.
+**
+** argv[0]: module name
+** argv[1]: database name
+** argv[2]: table name
+** argv[3]: first argument (tokenizer name)
+*/
+static int fts3tokConnectMethod(
+ sqlite3 *db, /* Database connection */
+ void *pHash, /* Hash table of tokenizers */
+ int argc, /* Number of elements in argv array */
+ const char * const *argv, /* xCreate/xConnect argument array */
+ sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */
+ char **pzErr /* OUT: sqlite3_malloc'd error message */
+){
+ Fts3tokTable *pTab;
+ const sqlite3_tokenizer_module *pMod = 0;
+ sqlite3_tokenizer *pTok = 0;
+ int rc;
+ char **azDequote = 0;
+ int nDequote;
+
+ rc = sqlite3_declare_vtab(db, FTS3_TOK_SCHEMA);
+ if( rc!=SQLITE_OK ) return rc;
+
+ nDequote = argc-3;
+ rc = fts3tokDequoteArray(nDequote, &argv[3], &azDequote);
+
+ if( rc==SQLITE_OK ){
+ const char *zModule;
+ if( nDequote<1 ){
+ zModule = "simple";
+ }else{
+ zModule = azDequote[0];
+ }
+ rc = fts3tokQueryTokenizer((Fts3Hash*)pHash, zModule, &pMod, pzErr);
+ }
+
+ assert( (rc==SQLITE_OK)==(pMod!=0) );
+ if( rc==SQLITE_OK ){
+ const char * const *azArg = (const char * const *)&azDequote[1];
+ rc = pMod->xCreate((nDequote>1 ? nDequote-1 : 0), azArg, &pTok);
+ }
+
+ if( rc==SQLITE_OK ){
+ pTab = (Fts3tokTable *)sqlite3_malloc(sizeof(Fts3tokTable));
+ if( pTab==0 ){
+ rc = SQLITE_NOMEM;
+ }
+ }
+
+ if( rc==SQLITE_OK ){
+ memset(pTab, 0, sizeof(Fts3tokTable));
+ pTab->pMod = pMod;
+ pTab->pTok = pTok;
+ *ppVtab = &pTab->base;
+ }else{
+ if( pTok ){
+ pMod->xDestroy(pTok);
+ }
+ }
+
+ sqlite3_free(azDequote);
+ return rc;
+}
+
+/*
+** This function does the work for both the xDisconnect and xDestroy methods.
+** These tables have no persistent representation of their own, so xDisconnect
+** and xDestroy are identical operations.
+*/
+static int fts3tokDisconnectMethod(sqlite3_vtab *pVtab){
+ Fts3tokTable *pTab = (Fts3tokTable *)pVtab;
+
+ pTab->pMod->xDestroy(pTab->pTok);
+ sqlite3_free(pTab);
+ return SQLITE_OK;
+}
+
+/*
+** xBestIndex - Analyze a WHERE and ORDER BY clause.
+*/
+static int fts3tokBestIndexMethod(
+ sqlite3_vtab *pVTab,
+ sqlite3_index_info *pInfo
+){
+ int i;
+ UNUSED_PARAMETER(pVTab);
+
+ for(i=0; i<pInfo->nConstraint; i++){
+ if( pInfo->aConstraint[i].usable
+ && pInfo->aConstraint[i].iColumn==0
+ && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ
+ ){
+ pInfo->idxNum = 1;
+ pInfo->aConstraintUsage[i].argvIndex = 1;
+ pInfo->aConstraintUsage[i].omit = 1;
+ pInfo->estimatedCost = 1;
+ return SQLITE_OK;
+ }
+ }
+
+ pInfo->idxNum = 0;
+ assert( pInfo->estimatedCost>1000000.0 );
+
+ return SQLITE_OK;
+}
+
+/*
+** xOpen - Open a cursor.
+*/
+static int fts3tokOpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){
+ Fts3tokCursor *pCsr;
+ UNUSED_PARAMETER(pVTab);
+
+ pCsr = (Fts3tokCursor *)sqlite3_malloc(sizeof(Fts3tokCursor));
+ if( pCsr==0 ){
+ return SQLITE_NOMEM;
+ }
+ memset(pCsr, 0, sizeof(Fts3tokCursor));
+
+ *ppCsr = (sqlite3_vtab_cursor *)pCsr;
+ return SQLITE_OK;
+}
+
+/*
+** Reset the tokenizer cursor passed as the only argument. As if it had
+** just been returned by fts3tokOpenMethod().
+*/
+static void fts3tokResetCursor(Fts3tokCursor *pCsr){
+ if( pCsr->pCsr ){
+ Fts3tokTable *pTab = (Fts3tokTable *)(pCsr->base.pVtab);
+ pTab->pMod->xClose(pCsr->pCsr);
+ pCsr->pCsr = 0;
+ }
+ sqlite3_free(pCsr->zInput);
+ pCsr->zInput = 0;
+ pCsr->zToken = 0;
+ pCsr->nToken = 0;
+ pCsr->iStart = 0;
+ pCsr->iEnd = 0;
+ pCsr->iPos = 0;
+ pCsr->iRowid = 0;
+}
+
+/*
+** xClose - Close a cursor.
+*/
+static int fts3tokCloseMethod(sqlite3_vtab_cursor *pCursor){
+ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor;
+
+ fts3tokResetCursor(pCsr);
+ sqlite3_free(pCsr);
+ return SQLITE_OK;
+}
+
+/*
+** xNext - Advance the cursor to the next row, if any.
+*/
+static int fts3tokNextMethod(sqlite3_vtab_cursor *pCursor){
+ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor;
+ Fts3tokTable *pTab = (Fts3tokTable *)(pCursor->pVtab);
+ int rc; /* Return code */
+
+ pCsr->iRowid++;
+ rc = pTab->pMod->xNext(pCsr->pCsr,
+ &pCsr->zToken, &pCsr->nToken,
+ &pCsr->iStart, &pCsr->iEnd, &pCsr->iPos
+ );
+
+ if( rc!=SQLITE_OK ){
+ fts3tokResetCursor(pCsr);
+ if( rc==SQLITE_DONE ) rc = SQLITE_OK;
+ }
+
+ return rc;
+}
+
+/*
+** xFilter - Initialize a cursor to point at the start of its data.
+*/
+static int fts3tokFilterMethod(
+ sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */
+ int idxNum, /* Strategy index */
+ const char *idxStr, /* Unused */
+ int nVal, /* Number of elements in apVal */
+ sqlite3_value **apVal /* Arguments for the indexing scheme */
+){
+ int rc = SQLITE_ERROR;
+ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor;
+ Fts3tokTable *pTab = (Fts3tokTable *)(pCursor->pVtab);
+ UNUSED_PARAMETER(idxStr);
+ UNUSED_PARAMETER(nVal);
+
+ fts3tokResetCursor(pCsr);
+ if( idxNum==1 ){
+ const char *zByte = (const char *)sqlite3_value_text(apVal[0]);
+ int nByte = sqlite3_value_bytes(apVal[0]);
+ pCsr->zInput = sqlite3_malloc(nByte+1);
+ if( pCsr->zInput==0 ){
+ rc = SQLITE_NOMEM;
+ }else{
+ memcpy(pCsr->zInput, zByte, nByte);
+ pCsr->zInput[nByte] = 0;
+ rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr);
+ if( rc==SQLITE_OK ){
+ pCsr->pCsr->pTokenizer = pTab->pTok;
+ }
+ }
+ }
+
+ if( rc!=SQLITE_OK ) return rc;
+ return fts3tokNextMethod(pCursor);
+}
+
+/*
+** xEof - Return true if the cursor is at EOF, or false otherwise.
+*/
+static int fts3tokEofMethod(sqlite3_vtab_cursor *pCursor){
+ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor;
+ return (pCsr->zToken==0);
+}
+
+/*
+** xColumn - Return a column value.
+*/
+static int fts3tokColumnMethod(
+ sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */
+ sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */
+ int iCol /* Index of column to read value from */
+){
+ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor;
+
+ /* CREATE TABLE x(input, token, start, end, position) */
+ switch( iCol ){
+ case 0:
+ sqlite3_result_text(pCtx, pCsr->zInput, -1, SQLITE_TRANSIENT);
+ break;
+ case 1:
+ sqlite3_result_text(pCtx, pCsr->zToken, pCsr->nToken, SQLITE_TRANSIENT);
+ break;
+ case 2:
+ sqlite3_result_int(pCtx, pCsr->iStart);
+ break;
+ case 3:
+ sqlite3_result_int(pCtx, pCsr->iEnd);
+ break;
+ default:
+ assert( iCol==4 );
+ sqlite3_result_int(pCtx, pCsr->iPos);
+ break;
+ }
+ return SQLITE_OK;
+}
+
+/*
+** xRowid - Return the current rowid for the cursor.
+*/
+static int fts3tokRowidMethod(
+ sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */
+ sqlite_int64 *pRowid /* OUT: Rowid value */
+){
+ Fts3tokCursor *pCsr = (Fts3tokCursor *)pCursor;
+ *pRowid = (sqlite3_int64)pCsr->iRowid;
+ return SQLITE_OK;
+}
+
+/*
+** Register the fts3tok module with database connection db. Return SQLITE_OK
+** if successful or an error code if sqlite3_create_module() fails.
+*/
+SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3 *db, Fts3Hash *pHash){
+ static const sqlite3_module fts3tok_module = {
+ 0, /* iVersion */
+ fts3tokConnectMethod, /* xCreate */
+ fts3tokConnectMethod, /* xConnect */
+ fts3tokBestIndexMethod, /* xBestIndex */
+ fts3tokDisconnectMethod, /* xDisconnect */
+ fts3tokDisconnectMethod, /* xDestroy */
+ fts3tokOpenMethod, /* xOpen */
+ fts3tokCloseMethod, /* xClose */
+ fts3tokFilterMethod, /* xFilter */
+ fts3tokNextMethod, /* xNext */
+ fts3tokEofMethod, /* xEof */
+ fts3tokColumnMethod, /* xColumn */
+ fts3tokRowidMethod, /* xRowid */
+ 0, /* xUpdate */
+ 0, /* xBegin */
+ 0, /* xSync */
+ 0, /* xCommit */
+ 0, /* xRollback */
+ 0, /* xFindFunction */
+ 0, /* xRename */
+ 0, /* xSavepoint */
+ 0, /* xRelease */
+ 0 /* xRollbackTo */
+ };
+ int rc; /* Return code */
+
+ rc = sqlite3_create_module(db, "fts3tokenize", &fts3tok_module, (void*)pHash);
+ return rc;
+}
+
+#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
+
+/************** End of fts3_tokenize_vtab.c **********************************/
/************** Begin file fts3_write.c **************************************/
/*
** 2009 Oct 23
diff --git a/src/3rdparty/sqlite/sqlite3.h b/src/3rdparty/sqlite/sqlite3.h
index 69b4586a3f..e398838287 100644
--- a/src/3rdparty/sqlite/sqlite3.h
+++ b/src/3rdparty/sqlite/sqlite3.h
@@ -107,9 +107,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.7.16.2"
-#define SQLITE_VERSION_NUMBER 3007016
-#define SQLITE_SOURCE_ID "2013-04-12 11:52:43 cbea02d93865ce0e06789db95fd9168ebac970c7"
+#define SQLITE_VERSION "3.7.17"
+#define SQLITE_VERSION_NUMBER 3007017
+#define SQLITE_SOURCE_ID "2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -425,6 +425,8 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_FORMAT 24 /* Auxiliary database format error */
#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB 26 /* File opened that is not a database file */
+#define SQLITE_NOTICE 27 /* Notifications from sqlite3_log() */
+#define SQLITE_WARNING 28 /* Warnings from sqlite3_log() */
#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
/* end-of-error-codes */
@@ -475,6 +477,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8))
#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8))
#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8))
+#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8))
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@@ -494,6 +497,8 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8))
#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8))
#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8))
+#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
+#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
/*
** CAPI3REF: Flags For File Open Operations
@@ -733,6 +738,9 @@ struct sqlite3_io_methods {
void (*xShmBarrier)(sqlite3_file*);
int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
/* Methods above are valid for version 2 */
+ int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
+ int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
+ /* Methods above are valid for version 3 */
/* Additional methods may be added in future releases */
};
@@ -869,7 +877,8 @@ struct sqlite3_io_methods {
** it is able to override built-in [PRAGMA] statements.
**
** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
-** ^This file-control may be invoked by SQLite on the database file handle
+** ^The [SQLITE_FCNTL_BUSYHANDLER]
+** file-control may be invoked by SQLite on the database file handle
** shortly after it is opened in order to provide a custom VFS with access
** to the connections busy-handler callback. The argument is of type (void **)
** - an array of two (void *) values. The first (void *) actually points
@@ -880,13 +889,24 @@ struct sqlite3_io_methods {
** current operation.
**
** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
-** ^Application can invoke this file-control to have SQLite generate a
+** ^Application can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
+** to have SQLite generate a
** temporary filename using the same algorithm that is followed to generate
** temporary filenames for TEMP tables and other internal uses. The
** argument should be a char** which will be filled with the filename
** written into memory obtained from [sqlite3_malloc()]. The caller should
** invoke [sqlite3_free()] on the result to avoid a memory leak.
**
+** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
+** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
+** maximum number of bytes that will be used for memory-mapped I/O.
+** The argument is a pointer to a value of type sqlite3_int64 that
+** is an advisory maximum number of bytes in the file to memory map. The
+** pointer is overwritten with the old value. The limit is not changed if
+** the value originally pointed to is negative, and so the current limit
+** can be queried by passing in a pointer to a negative number. This
+** file-control is used internally to implement [PRAGMA mmap_size].
+**
** </ul>
*/
#define SQLITE_FCNTL_LOCKSTATE 1
@@ -905,6 +925,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_PRAGMA 14
#define SQLITE_FCNTL_BUSYHANDLER 15
#define SQLITE_FCNTL_TEMPFILENAME 16
+#define SQLITE_FCNTL_MMAP_SIZE 18
/*
** CAPI3REF: Mutex Handle
@@ -1571,7 +1592,9 @@ struct sqlite3_mem_methods {
** page cache implementation into that object.)^ </dd>
**
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
-** <dd> ^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
+** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
+** global [error log].
+** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
** function with a call signature of void(*)(void*,int,const char*),
** and a pointer to void. ^If the function pointer is not NULL, it is
** invoked by [sqlite3_log()] to process each logging event. ^If the
@@ -1617,12 +1640,12 @@ struct sqlite3_mem_methods {
** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
** <dd> These options are obsolete and should not be used by new code.
** They are retained for backwards compatibility but are now no-ops.
-** </dl>
+** </dd>
**
** [[SQLITE_CONFIG_SQLLOG]]
** <dt>SQLITE_CONFIG_SQLLOG
** <dd>This option is only available if sqlite is compiled with the
-** SQLITE_ENABLE_SQLLOG pre-processor macro defined. The first argument should
+** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
** The second should be of type (void*). The callback is invoked by the library
** in three separate circumstances, identified by the value passed as the
@@ -1632,7 +1655,23 @@ struct sqlite3_mem_methods {
** fourth parameter is 1, then the SQL statement that the third parameter
** points to has just been executed. Or, if the fourth parameter is 2, then
** the connection being passed as the second parameter is being closed. The
-** third parameter is passed NULL In this case.
+** third parameter is passed NULL In this case. An example of using this
+** configuration option can be seen in the "test_sqllog.c" source file in
+** the canonical SQLite source tree.</dd>
+**
+** [[SQLITE_CONFIG_MMAP_SIZE]]
+** <dt>SQLITE_CONFIG_MMAP_SIZE
+** <dd>SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
+** that are the default mmap size limit (the default setting for
+** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
+** The default setting can be overridden by each database connection using
+** either the [PRAGMA mmap_size] command, or by using the
+** [SQLITE_FCNTL_MMAP_SIZE] file control. The maximum allowed mmap size
+** cannot be changed at run-time. Nor may the maximum allowed mmap size
+** exceed the compile-time maximum mmap size set by the
+** [SQLITE_MAX_MMAP_SIZE] compile-time option.
+** If either argument to this option is negative, then that argument is
+** changed to its compile-time default.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -1656,6 +1695,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
+#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -2489,6 +2529,9 @@ SQLITE_API int sqlite3_set_authorizer(
** as each triggered subprogram is entered. The callbacks for triggers
** contain a UTF-8 SQL comment that identifies the trigger.)^
**
+** The [SQLITE_TRACE_SIZE_LIMIT] compile-time option can be used to limit
+** the length of [bound parameter] expansion in the output of sqlite3_trace().
+**
** ^The callback function registered by sqlite3_profile() is invoked
** as each SQL statement finishes. ^The profile callback contains
** the original statement text and an estimate of wall-clock time
@@ -3027,7 +3070,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** <li>
** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
** always used to do, [sqlite3_step()] will automatically recompile the SQL
-** statement and try to run it again.
+** statement and try to run it again. As many as [SQLITE_MAX_SCHEMA_RETRY]
+** retries will occur before sqlite3_step() gives up and returns an error.
** </li>
**
** <li>
@@ -3231,6 +3275,9 @@ typedef struct sqlite3_context sqlite3_context;
** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999).
**
** ^The third argument is the value to bind to the parameter.
+** ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16()
+** or sqlite3_bind_blob() is a NULL pointer then the fourth parameter
+** is ignored and the end result is the same as sqlite3_bind_null().
**
** ^(In those routines that have a fourth argument, its value is the
** number of bytes in the parameter. To be clear: the value is the
@@ -4187,7 +4234,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi
** the content before returning.
**
** The typedef is necessary to work around problems in certain
-** C++ compilers. See ticket #2191.
+** C++ compilers.
*/
typedef void (*sqlite3_destructor_type)(void*);
#define SQLITE_STATIC ((sqlite3_destructor_type)0)
@@ -4986,11 +5033,20 @@ SQLITE_API int sqlite3_table_column_metadata(
** ^This interface loads an SQLite extension library from the named file.
**
** ^The sqlite3_load_extension() interface attempts to load an
-** SQLite extension library contained in the file zFile.
+** [SQLite extension] library contained in the file zFile. If
+** the file cannot be loaded directly, attempts are made to load
+** with various operating-system specific extensions added.
+** So for example, if "samplelib" cannot be loaded, then names like
+** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might
+** be tried also.
**
** ^The entry point is zProc.
-** ^zProc may be 0, in which case the name of the entry point
-** defaults to "sqlite3_extension_init".
+** ^(zProc may be 0, in which case SQLite will try to come up with an
+** entry point name on its own. It first tries "sqlite3_extension_init".
+** If that does not work, it constructs a name "sqlite3_X_init" where the
+** X is consists of the lower-case equivalent of all ASCII alphabetic
+** characters in the filename from the last "/" to the first following
+** "." and omitting any initial "lib".)^
** ^The sqlite3_load_extension() interface returns
** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
** ^If an error occurs and pzErrMsg is not 0, then the
@@ -5016,11 +5072,11 @@ SQLITE_API int sqlite3_load_extension(
** CAPI3REF: Enable Or Disable Extension Loading
**
** ^So as not to open security holes in older applications that are
-** unprepared to deal with extension loading, and as a means of disabling
-** extension loading while evaluating user-entered SQL, the following API
+** unprepared to deal with [extension loading], and as a means of disabling
+** [extension loading] while evaluating user-entered SQL, the following API
** is provided to turn the [sqlite3_load_extension()] mechanism on and off.
**
-** ^Extension loading is off by default. See ticket #1863.
+** ^Extension loading is off by default.
** ^Call the sqlite3_enable_load_extension() routine with onoff==1
** to turn extension loading on and call it with onoff==0 to turn
** it back off again.
@@ -5032,7 +5088,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
**
** ^This interface causes the xEntryPoint() function to be invoked for
** each new [database connection] that is created. The idea here is that
-** xEntryPoint() is the entry point for a statically linked SQLite extension
+** xEntryPoint() is the entry point for a statically linked [SQLite extension]
** that is to be automatically loaded into all new database connections.
**
** ^(Even though the function prototype shows that xEntryPoint() takes
@@ -6813,9 +6869,24 @@ SQLITE_API int sqlite3_stricmp(const char *, const char *);
SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
/*
+** CAPI3REF: String Globbing
+*
+** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
+** the glob pattern P, and it returns non-zero if string X does not match
+** the glob pattern P. ^The definition of glob pattern matching used in
+** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the
+** SQL dialect used by SQLite. ^The sqlite3_strglob(P,X) function is case
+** sensitive.
+**
+** Note that this routine returns zero on a match and non-zero if the strings
+** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
+*/
+SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
+
+/*
** CAPI3REF: Error Logging Interface
**
-** ^The [sqlite3_log()] interface writes a message into the error log
+** ^The [sqlite3_log()] interface writes a message into the [error log]
** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()].
** ^If logging is enabled, the zFormat string and subsequent arguments are
** used with [sqlite3_snprintf()] to generate the final output string.
diff --git a/src/3rdparty/xcb/README b/src/3rdparty/xcb/README
index 0a66dafd03..4d275ef5a8 100644
--- a/src/3rdparty/xcb/README
+++ b/src/3rdparty/xcb/README
@@ -1,6 +1,7 @@
Contains the header and sources files from selected xcb libraries:
libxcb-1.5 together with xcb-proto-1.6 (sync, xfixes, randr sources)
+ libxcb-1.8.1 together with xcb-proto-1.8 (xkb sources)
libxcb-util-image-0.3.9
libxcb-util-keysyms-0.3.9
libxcb-util-renderutil-0.3.8
diff --git a/src/3rdparty/xcb/include/xcb/xkb.h b/src/3rdparty/xcb/include/xcb/xkb.h
new file mode 100644
index 0000000000..44b0a8d1ae
--- /dev/null
+++ b/src/3rdparty/xcb/include/xcb/xkb.h
@@ -0,0 +1,14871 @@
+/*
+ * This file generated automatically from xkb.xml by c_client.py.
+ * Edit at your peril.
+ */
+
+/**
+ * @defgroup XCB_xkb_API XCB xkb API
+ * @brief xkb XCB Protocol Implementation.
+ * @{
+ **/
+
+#ifndef __XKB_H
+#define __XKB_H
+
+#include "xcb.h"
+#include "xproto.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define XCB_XKB_MAJOR_VERSION 1
+#define XCB_XKB_MINOR_VERSION 0
+
+extern xcb_extension_t xcb_xkb_id;
+
+typedef enum xcb_xkb_const_t {
+ XCB_XKB_CONST_MAX_LEGAL_KEY_CODE = 255,
+ XCB_XKB_CONST_PER_KEY_BIT_ARRAY_SIZE = 32,
+ XCB_XKB_CONST_KEY_NAME_LENGTH = 4
+} xcb_xkb_const_t;
+
+typedef enum xcb_xkb_event_type_t {
+ XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY = 1,
+ XCB_XKB_EVENT_TYPE_MAP_NOTIFY = 2,
+ XCB_XKB_EVENT_TYPE_STATE_NOTIFY = 4,
+ XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY = 8,
+ XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY = 16,
+ XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY = 32,
+ XCB_XKB_EVENT_TYPE_NAMES_NOTIFY = 64,
+ XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY = 128,
+ XCB_XKB_EVENT_TYPE_BELL_NOTIFY = 256,
+ XCB_XKB_EVENT_TYPE_ACTION_MESSAGE = 512,
+ XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY = 1024,
+ XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY = 2048
+} xcb_xkb_event_type_t;
+
+typedef enum xcb_xkb_nkn_detail_t {
+ XCB_XKB_NKN_DETAIL_KEYCODES = 1,
+ XCB_XKB_NKN_DETAIL_GEOMETRY = 2,
+ XCB_XKB_NKN_DETAIL_DEVICE_ID = 4
+} xcb_xkb_nkn_detail_t;
+
+typedef enum xcb_xkb_axn_detail_t {
+ XCB_XKB_AXN_DETAIL_SK_PRESS = 1,
+ XCB_XKB_AXN_DETAIL_SK_ACCEPT = 2,
+ XCB_XKB_AXN_DETAIL_SK_REJECT = 4,
+ XCB_XKB_AXN_DETAIL_SK_RELEASE = 8,
+ XCB_XKB_AXN_DETAIL_BK_ACCEPT = 16,
+ XCB_XKB_AXN_DETAIL_BK_REJECT = 32,
+ XCB_XKB_AXN_DETAIL_AXK_WARNING = 64
+} xcb_xkb_axn_detail_t;
+
+typedef enum xcb_xkb_map_part_t {
+ XCB_XKB_MAP_PART_KEY_TYPES = 1,
+ XCB_XKB_MAP_PART_KEY_SYMS = 2,
+ XCB_XKB_MAP_PART_MODIFIER_MAP = 4,
+ XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS = 8,
+ XCB_XKB_MAP_PART_KEY_ACTIONS = 16,
+ XCB_XKB_MAP_PART_KEY_BEHAVIORS = 32,
+ XCB_XKB_MAP_PART_VIRTUAL_MODS = 64,
+ XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP = 128
+} xcb_xkb_map_part_t;
+
+typedef enum xcb_xkb_set_map_flags_t {
+ XCB_XKB_SET_MAP_FLAGS_RESIZE_TYPES = 1,
+ XCB_XKB_SET_MAP_FLAGS_RECOMPUTE_ACTIONS = 2
+} xcb_xkb_set_map_flags_t;
+
+typedef enum xcb_xkb_state_part_t {
+ XCB_XKB_STATE_PART_MODIFIER_STATE = 1,
+ XCB_XKB_STATE_PART_MODIFIER_BASE = 2,
+ XCB_XKB_STATE_PART_MODIFIER_LATCH = 4,
+ XCB_XKB_STATE_PART_MODIFIER_LOCK = 8,
+ XCB_XKB_STATE_PART_GROUP_STATE = 16,
+ XCB_XKB_STATE_PART_GROUP_BASE = 32,
+ XCB_XKB_STATE_PART_GROUP_LATCH = 64,
+ XCB_XKB_STATE_PART_GROUP_LOCK = 128,
+ XCB_XKB_STATE_PART_COMPAT_STATE = 256,
+ XCB_XKB_STATE_PART_GRAB_MODS = 512,
+ XCB_XKB_STATE_PART_COMPAT_GRAB_MODS = 1024,
+ XCB_XKB_STATE_PART_LOOKUP_MODS = 2048,
+ XCB_XKB_STATE_PART_COMPAT_LOOKUP_MODS = 4096,
+ XCB_XKB_STATE_PART_POINTER_BUTTONS = 8192
+} xcb_xkb_state_part_t;
+
+typedef enum xcb_xkb_bool_ctrl_t {
+ XCB_XKB_BOOL_CTRL_REPEAT_KEYS = 1,
+ XCB_XKB_BOOL_CTRL_SLOW_KEYS = 2,
+ XCB_XKB_BOOL_CTRL_BOUNCE_KEYS = 4,
+ XCB_XKB_BOOL_CTRL_STICKY_KEYS = 8,
+ XCB_XKB_BOOL_CTRL_MOUSE_KEYS = 16,
+ XCB_XKB_BOOL_CTRL_MOUSE_KEYS_ACCEL = 32,
+ XCB_XKB_BOOL_CTRL_ACCESS_X_KEYS = 64,
+ XCB_XKB_BOOL_CTRL_ACCESS_X_TIMEOUT_MASK = 128,
+ XCB_XKB_BOOL_CTRL_ACCESS_X_FEEDBACK_MASK = 256,
+ XCB_XKB_BOOL_CTRL_AUDIBLE_BELL_MASK = 512,
+ XCB_XKB_BOOL_CTRL_OVERLAY_1_MASK = 1024,
+ XCB_XKB_BOOL_CTRL_OVERLAY_2_MASK = 2048,
+ XCB_XKB_BOOL_CTRL_IGNORE_GROUP_LOCK_MASK = 4096
+} xcb_xkb_bool_ctrl_t;
+
+typedef enum xcb_xkb_control_t {
+ XCB_XKB_CONTROL_GROUPS_WRAP = 134217728,
+ XCB_XKB_CONTROL_INTERNAL_MODS = 268435456,
+ XCB_XKB_CONTROL_IGNORE_LOCK_MODS = 536870912,
+ XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824,
+ XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648
+} xcb_xkb_control_t;
+
+typedef enum xcb_xkb_axfb_opt_t {
+ XCB_XKB_AXFB_OPT_SK_PRESS_FB = 1,
+ XCB_XKB_AXFB_OPT_SK_ACCEPT_FB = 2,
+ XCB_XKB_AXFB_OPT_FEATURE_FB = 4,
+ XCB_XKB_AXFB_OPT_SLOW_WARN_FB = 8,
+ XCB_XKB_AXFB_OPT_INDICATOR_FB = 16,
+ XCB_XKB_AXFB_OPT_STICKY_KEYS_FB = 32,
+ XCB_XKB_AXFB_OPT_SK_RELEASE_FB = 64,
+ XCB_XKB_AXFB_OPT_SK_REJECT_FB = 128,
+ XCB_XKB_AXFB_OPT_BK_REJECT_FB = 256,
+ XCB_XKB_AXFB_OPT_DUMB_BELL = 512
+} xcb_xkb_axfb_opt_t;
+
+typedef enum xcb_xkb_axsk_opt_t {
+ XCB_XKB_AXSK_OPT_TWO_KEYS = 64,
+ XCB_XKB_AXSK_OPT_LATCH_TO_LOCK = 128
+} xcb_xkb_axsk_opt_t;
+
+/**
+ * @brief xcb_xkb_ax_option_t
+ **/
+typedef union xcb_xkb_ax_option_t {
+ uint16_t fbopt; /**< */
+ uint16_t skopt; /**< */
+} xcb_xkb_ax_option_t;
+
+/**
+ * @brief xcb_xkb_ax_option_iterator_t
+ **/
+typedef struct xcb_xkb_ax_option_iterator_t {
+ xcb_xkb_ax_option_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_ax_option_iterator_t;
+
+typedef uint16_t xcb_xkb_device_spec_t;
+
+/**
+ * @brief xcb_xkb_device_spec_iterator_t
+ **/
+typedef struct xcb_xkb_device_spec_iterator_t {
+ xcb_xkb_device_spec_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_device_spec_iterator_t;
+
+typedef enum xcb_xkb_led_class_result_t {
+ XCB_XKB_LED_CLASS_RESULT_KBD_FEEDBACK_CLASS = 0,
+ XCB_XKB_LED_CLASS_RESULT_LED_FEEDBACK_CLASS = 4
+} xcb_xkb_led_class_result_t;
+
+typedef enum xcb_xkb_led_class_t {
+ XCB_XKB_LED_CLASS_DFLT_XI_CLASS = 768,
+ XCB_XKB_LED_CLASS_ALL_XI_CLASSES = 1280
+} xcb_xkb_led_class_t;
+
+typedef uint16_t xcb_xkb_led_class_spec_t;
+
+/**
+ * @brief xcb_xkb_led_class_spec_iterator_t
+ **/
+typedef struct xcb_xkb_led_class_spec_iterator_t {
+ xcb_xkb_led_class_spec_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_led_class_spec_iterator_t;
+
+typedef enum xcb_xkb_bell_class_result_t {
+ XCB_XKB_BELL_CLASS_RESULT_KBD_FEEDBACK_CLASS = 0,
+ XCB_XKB_BELL_CLASS_RESULT_BELL_FEEDBACK_CLASS = 5
+} xcb_xkb_bell_class_result_t;
+
+typedef enum xcb_xkb_bell_class_t {
+ XCB_XKB_BELL_CLASS_DFLT_XI_CLASS = 768
+} xcb_xkb_bell_class_t;
+
+typedef uint16_t xcb_xkb_bell_class_spec_t;
+
+/**
+ * @brief xcb_xkb_bell_class_spec_iterator_t
+ **/
+typedef struct xcb_xkb_bell_class_spec_iterator_t {
+ xcb_xkb_bell_class_spec_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_bell_class_spec_iterator_t;
+
+typedef enum xcb_xkb_id_t {
+ XCB_XKB_ID_USE_CORE_KBD = 256,
+ XCB_XKB_ID_USE_CORE_PTR = 512,
+ XCB_XKB_ID_DFLT_XI_CLASS = 768,
+ XCB_XKB_ID_DFLT_XI_ID = 1024,
+ XCB_XKB_ID_ALL_XI_CLASS = 1280,
+ XCB_XKB_ID_ALL_XI_ID = 1536,
+ XCB_XKB_ID_XI_NONE = 65280
+} xcb_xkb_id_t;
+
+typedef uint16_t xcb_xkb_id_spec_t;
+
+/**
+ * @brief xcb_xkb_id_spec_iterator_t
+ **/
+typedef struct xcb_xkb_id_spec_iterator_t {
+ xcb_xkb_id_spec_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_id_spec_iterator_t;
+
+typedef enum xcb_xkb_group_t {
+ XCB_XKB_GROUP_1 = 0,
+ XCB_XKB_GROUP_2 = 1,
+ XCB_XKB_GROUP_3 = 2,
+ XCB_XKB_GROUP_4 = 3
+} xcb_xkb_group_t;
+
+typedef enum xcb_xkb_groups_t {
+ XCB_XKB_GROUPS_ANY = 254,
+ XCB_XKB_GROUPS_ALL = 255
+} xcb_xkb_groups_t;
+
+typedef enum xcb_xkb_set_of_group_t {
+ XCB_XKB_SET_OF_GROUP_GROUP_1 = 1,
+ XCB_XKB_SET_OF_GROUP_GROUP_2 = 2,
+ XCB_XKB_SET_OF_GROUP_GROUP_3 = 4,
+ XCB_XKB_SET_OF_GROUP_GROUP_4 = 8
+} xcb_xkb_set_of_group_t;
+
+typedef enum xcb_xkb_set_of_groups_t {
+ XCB_XKB_SET_OF_GROUPS_ANY = 128
+} xcb_xkb_set_of_groups_t;
+
+typedef enum xcb_xkb_groups_wrap_t {
+ XCB_XKB_GROUPS_WRAP_WRAP_INTO_RANGE = 0,
+ XCB_XKB_GROUPS_WRAP_CLAMP_INTO_RANGE = 64,
+ XCB_XKB_GROUPS_WRAP_REDIRECT_INTO_RANGE = 128
+} xcb_xkb_groups_wrap_t;
+
+typedef enum xcb_xkb_v_mods_high_t {
+ XCB_XKB_V_MODS_HIGH_15 = 128,
+ XCB_XKB_V_MODS_HIGH_14 = 64,
+ XCB_XKB_V_MODS_HIGH_13 = 32,
+ XCB_XKB_V_MODS_HIGH_12 = 16,
+ XCB_XKB_V_MODS_HIGH_11 = 8,
+ XCB_XKB_V_MODS_HIGH_10 = 4,
+ XCB_XKB_V_MODS_HIGH_9 = 2,
+ XCB_XKB_V_MODS_HIGH_8 = 1
+} xcb_xkb_v_mods_high_t;
+
+typedef enum xcb_xkb_v_mods_low_t {
+ XCB_XKB_V_MODS_LOW_7 = 128,
+ XCB_XKB_V_MODS_LOW_6 = 64,
+ XCB_XKB_V_MODS_LOW_5 = 32,
+ XCB_XKB_V_MODS_LOW_4 = 16,
+ XCB_XKB_V_MODS_LOW_3 = 8,
+ XCB_XKB_V_MODS_LOW_2 = 4,
+ XCB_XKB_V_MODS_LOW_1 = 2,
+ XCB_XKB_V_MODS_LOW_0 = 1
+} xcb_xkb_v_mods_low_t;
+
+typedef enum xcb_xkb_v_mod_t {
+ XCB_XKB_V_MOD_15 = 32768,
+ XCB_XKB_V_MOD_14 = 16384,
+ XCB_XKB_V_MOD_13 = 8192,
+ XCB_XKB_V_MOD_12 = 4096,
+ XCB_XKB_V_MOD_11 = 2048,
+ XCB_XKB_V_MOD_10 = 1024,
+ XCB_XKB_V_MOD_9 = 512,
+ XCB_XKB_V_MOD_8 = 256,
+ XCB_XKB_V_MOD_7 = 128,
+ XCB_XKB_V_MOD_6 = 64,
+ XCB_XKB_V_MOD_5 = 32,
+ XCB_XKB_V_MOD_4 = 16,
+ XCB_XKB_V_MOD_3 = 8,
+ XCB_XKB_V_MOD_2 = 4,
+ XCB_XKB_V_MOD_1 = 2,
+ XCB_XKB_V_MOD_0 = 1
+} xcb_xkb_v_mod_t;
+
+typedef enum xcb_xkb_explicit_t {
+ XCB_XKB_EXPLICIT_V_MOD_MAP = 128,
+ XCB_XKB_EXPLICIT_BEHAVIOR = 64,
+ XCB_XKB_EXPLICIT_AUTO_REPEAT = 32,
+ XCB_XKB_EXPLICIT_INTERPRET = 16,
+ XCB_XKB_EXPLICIT_KEY_TYPE_4 = 8,
+ XCB_XKB_EXPLICIT_KEY_TYPE_3 = 4,
+ XCB_XKB_EXPLICIT_KEY_TYPE_2 = 2,
+ XCB_XKB_EXPLICIT_KEY_TYPE_1 = 1
+} xcb_xkb_explicit_t;
+
+typedef enum xcb_xkb_sym_interpret_t {
+ XCB_XKB_SYM_INTERPRET_NONE_OF = 0,
+ XCB_XKB_SYM_INTERPRET_ANY_OF_OR_NONE = 1,
+ XCB_XKB_SYM_INTERPRET_ANY_OF = 2,
+ XCB_XKB_SYM_INTERPRET_ALL_OF = 3,
+ XCB_XKB_SYM_INTERPRET_EXACTLY = 4
+} xcb_xkb_sym_interpret_t;
+
+typedef enum xcb_xkb_sym_interp_match_t {
+ XCB_XKB_SYM_INTERP_MATCH_LEVEL_ONE_ONLY = 128,
+ XCB_XKB_SYM_INTERP_MATCH_OP_MASK = 127
+} xcb_xkb_sym_interp_match_t;
+
+typedef enum xcb_xkb_im_flag_t {
+ XCB_XKB_IM_FLAG_NO_EXPLICIT = 128,
+ XCB_XKB_IM_FLAG_NO_AUTOMATIC = 64,
+ XCB_XKB_IM_FLAG_LED_DRIVES_KB = 32
+} xcb_xkb_im_flag_t;
+
+typedef enum xcb_xkb_im_mods_which_t {
+ XCB_XKB_IM_MODS_WHICH_USE_COMPAT = 16,
+ XCB_XKB_IM_MODS_WHICH_USE_EFFECTIVE = 8,
+ XCB_XKB_IM_MODS_WHICH_USE_LOCKED = 4,
+ XCB_XKB_IM_MODS_WHICH_USE_LATCHED = 2,
+ XCB_XKB_IM_MODS_WHICH_USE_BASE = 1
+} xcb_xkb_im_mods_which_t;
+
+typedef enum xcb_xkb_im_groups_which_t {
+ XCB_XKB_IM_GROUPS_WHICH_USE_COMPAT = 16,
+ XCB_XKB_IM_GROUPS_WHICH_USE_EFFECTIVE = 8,
+ XCB_XKB_IM_GROUPS_WHICH_USE_LOCKED = 4,
+ XCB_XKB_IM_GROUPS_WHICH_USE_LATCHED = 2,
+ XCB_XKB_IM_GROUPS_WHICH_USE_BASE = 1
+} xcb_xkb_im_groups_which_t;
+
+/**
+ * @brief xcb_xkb_indicator_map_t
+ **/
+typedef struct xcb_xkb_indicator_map_t {
+ uint8_t flags; /**< */
+ uint8_t whichGroups; /**< */
+ uint8_t groups; /**< */
+ uint8_t whichMods; /**< */
+ uint8_t mods; /**< */
+ uint8_t realMods; /**< */
+ uint16_t vmods; /**< */
+ uint32_t ctrls; /**< */
+} xcb_xkb_indicator_map_t;
+
+/**
+ * @brief xcb_xkb_indicator_map_iterator_t
+ **/
+typedef struct xcb_xkb_indicator_map_iterator_t {
+ xcb_xkb_indicator_map_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_indicator_map_iterator_t;
+
+typedef enum xcb_xkb_cm_detail_t {
+ XCB_XKB_CM_DETAIL_SYM_INTERP = 1,
+ XCB_XKB_CM_DETAIL_GROUP_COMPAT = 2
+} xcb_xkb_cm_detail_t;
+
+typedef enum xcb_xkb_name_detail_t {
+ XCB_XKB_NAME_DETAIL_KEYCODES = 1,
+ XCB_XKB_NAME_DETAIL_GEOMETRY = 2,
+ XCB_XKB_NAME_DETAIL_SYMBOLS = 4,
+ XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS = 8,
+ XCB_XKB_NAME_DETAIL_TYPES = 16,
+ XCB_XKB_NAME_DETAIL_COMPAT = 32,
+ XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES = 64,
+ XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES = 128,
+ XCB_XKB_NAME_DETAIL_INDICATOR_NAMES = 256,
+ XCB_XKB_NAME_DETAIL_KEY_NAMES = 512,
+ XCB_XKB_NAME_DETAIL_KEY_ALIASES = 1024,
+ XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES = 2048,
+ XCB_XKB_NAME_DETAIL_GROUP_NAMES = 4096,
+ XCB_XKB_NAME_DETAIL_RG_NAMES = 8192
+} xcb_xkb_name_detail_t;
+
+typedef enum xcb_xkb_gbn_detail_t {
+ XCB_XKB_GBN_DETAIL_TYPES = 1,
+ XCB_XKB_GBN_DETAIL_COMPAT_MAP = 2,
+ XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS = 4,
+ XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS = 8,
+ XCB_XKB_GBN_DETAIL_INDICATOR_MAPS = 16,
+ XCB_XKB_GBN_DETAIL_KEY_NAMES = 32,
+ XCB_XKB_GBN_DETAIL_GEOMETRY = 64,
+ XCB_XKB_GBN_DETAIL_OTHER_NAMES = 128
+} xcb_xkb_gbn_detail_t;
+
+typedef enum xcb_xkb_xi_feature_t {
+ XCB_XKB_XI_FEATURE_KEYBOARDS = 1,
+ XCB_XKB_XI_FEATURE_BUTTON_ACTIONS = 2,
+ XCB_XKB_XI_FEATURE_INDICATOR_NAMES = 4,
+ XCB_XKB_XI_FEATURE_INDICATOR_MAPS = 8,
+ XCB_XKB_XI_FEATURE_INDICATOR_STATE = 16
+} xcb_xkb_xi_feature_t;
+
+typedef enum xcb_xkb_per_client_flag_t {
+ XCB_XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT = 1,
+ XCB_XKB_PER_CLIENT_FLAG_GRABS_USE_XKB_STATE = 2,
+ XCB_XKB_PER_CLIENT_FLAG_AUTO_RESET_CONTROLS = 4,
+ XCB_XKB_PER_CLIENT_FLAG_LOOKUP_STATE_WHEN_GRABBED = 8,
+ XCB_XKB_PER_CLIENT_FLAG_SEND_EVENT_USES_XKB_STATE = 16
+} xcb_xkb_per_client_flag_t;
+
+/**
+ * @brief xcb_xkb_mod_def_t
+ **/
+typedef struct xcb_xkb_mod_def_t {
+ uint8_t mask; /**< */
+ uint8_t realMods; /**< */
+ uint16_t vmods; /**< */
+} xcb_xkb_mod_def_t;
+
+/**
+ * @brief xcb_xkb_mod_def_iterator_t
+ **/
+typedef struct xcb_xkb_mod_def_iterator_t {
+ xcb_xkb_mod_def_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_mod_def_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_name_t
+ **/
+typedef struct xcb_xkb_key_name_t {
+ uint8_t name[4]; /**< */
+} xcb_xkb_key_name_t;
+
+/**
+ * @brief xcb_xkb_key_name_iterator_t
+ **/
+typedef struct xcb_xkb_key_name_iterator_t {
+ xcb_xkb_key_name_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_name_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_alias_t
+ **/
+typedef struct xcb_xkb_key_alias_t {
+ uint8_t real[4]; /**< */
+ uint8_t alias[4]; /**< */
+} xcb_xkb_key_alias_t;
+
+/**
+ * @brief xcb_xkb_key_alias_iterator_t
+ **/
+typedef struct xcb_xkb_key_alias_iterator_t {
+ xcb_xkb_key_alias_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_alias_iterator_t;
+
+/**
+ * @brief xcb_xkb_counted_string_8_t
+ **/
+typedef struct xcb_xkb_counted_string_8_t {
+ uint8_t length; /**< */
+} xcb_xkb_counted_string_8_t;
+
+/**
+ * @brief xcb_xkb_counted_string_8_iterator_t
+ **/
+typedef struct xcb_xkb_counted_string_8_iterator_t {
+ xcb_xkb_counted_string_8_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_counted_string_8_iterator_t;
+
+/**
+ * @brief xcb_xkb_counted_string_16_t
+ **/
+typedef struct xcb_xkb_counted_string_16_t {
+ uint16_t length; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_counted_string_16_t;
+
+/**
+ * @brief xcb_xkb_counted_string_16_iterator_t
+ **/
+typedef struct xcb_xkb_counted_string_16_iterator_t {
+ xcb_xkb_counted_string_16_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_counted_string_16_iterator_t;
+
+/**
+ * @brief xcb_xkb_kt_map_entry_t
+ **/
+typedef struct xcb_xkb_kt_map_entry_t {
+ uint8_t active; /**< */
+ uint8_t level; /**< */
+ uint8_t mods_mask; /**< */
+ uint8_t mods_mods; /**< */
+ uint16_t mods_vmods; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_kt_map_entry_t;
+
+/**
+ * @brief xcb_xkb_kt_map_entry_iterator_t
+ **/
+typedef struct xcb_xkb_kt_map_entry_iterator_t {
+ xcb_xkb_kt_map_entry_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_kt_map_entry_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_type_t
+ **/
+typedef struct xcb_xkb_key_type_t {
+ uint8_t mods_mask; /**< */
+ uint8_t mods_mods; /**< */
+ uint16_t mods_vmods; /**< */
+ uint8_t numLevels; /**< */
+ uint8_t nMapEntries; /**< */
+ uint8_t hasPreserve; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_key_type_t;
+
+/**
+ * @brief xcb_xkb_key_type_iterator_t
+ **/
+typedef struct xcb_xkb_key_type_iterator_t {
+ xcb_xkb_key_type_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_type_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_sym_map_t
+ **/
+typedef struct xcb_xkb_key_sym_map_t {
+ uint8_t kt_index[4]; /**< */
+ uint8_t groupInfo; /**< */
+ uint8_t width; /**< */
+ uint16_t nSyms; /**< */
+} xcb_xkb_key_sym_map_t;
+
+/**
+ * @brief xcb_xkb_key_sym_map_iterator_t
+ **/
+typedef struct xcb_xkb_key_sym_map_iterator_t {
+ xcb_xkb_key_sym_map_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_sym_map_iterator_t;
+
+/**
+ * @brief xcb_xkb_common_behavior_t
+ **/
+typedef struct xcb_xkb_common_behavior_t {
+ uint8_t type; /**< */
+ uint8_t data; /**< */
+} xcb_xkb_common_behavior_t;
+
+/**
+ * @brief xcb_xkb_common_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_common_behavior_iterator_t {
+ xcb_xkb_common_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_common_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_default_behavior_t
+ **/
+typedef struct xcb_xkb_default_behavior_t {
+ uint8_t type; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_default_behavior_t;
+
+/**
+ * @brief xcb_xkb_default_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_default_behavior_iterator_t {
+ xcb_xkb_default_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_default_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_lock_behavior_t
+ **/
+typedef struct xcb_xkb_lock_behavior_t {
+ uint8_t type; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_lock_behavior_t;
+
+/**
+ * @brief xcb_xkb_lock_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_lock_behavior_iterator_t {
+ xcb_xkb_lock_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_lock_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_radio_group_behavior_t
+ **/
+typedef struct xcb_xkb_radio_group_behavior_t {
+ uint8_t type; /**< */
+ uint8_t group; /**< */
+} xcb_xkb_radio_group_behavior_t;
+
+/**
+ * @brief xcb_xkb_radio_group_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_radio_group_behavior_iterator_t {
+ xcb_xkb_radio_group_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_radio_group_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_overlay_1_behavior_t
+ **/
+typedef struct xcb_xkb_overlay_1_behavior_t {
+ uint8_t type; /**< */
+ xcb_keycode_t key; /**< */
+} xcb_xkb_overlay_1_behavior_t;
+
+/**
+ * @brief xcb_xkb_overlay_1_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_overlay_1_behavior_iterator_t {
+ xcb_xkb_overlay_1_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_overlay_1_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_overlay_2_behavior_t
+ **/
+typedef struct xcb_xkb_overlay_2_behavior_t {
+ uint8_t type; /**< */
+ uint8_t key; /**< */
+} xcb_xkb_overlay_2_behavior_t;
+
+/**
+ * @brief xcb_xkb_overlay_2_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_overlay_2_behavior_iterator_t {
+ xcb_xkb_overlay_2_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_overlay_2_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_permament_lock_behavior_t
+ **/
+typedef struct xcb_xkb_permament_lock_behavior_t {
+ uint8_t type; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_permament_lock_behavior_t;
+
+/**
+ * @brief xcb_xkb_permament_lock_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_permament_lock_behavior_iterator_t {
+ xcb_xkb_permament_lock_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_permament_lock_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_permament_radio_group_behavior_t
+ **/
+typedef struct xcb_xkb_permament_radio_group_behavior_t {
+ uint8_t type; /**< */
+ uint8_t group; /**< */
+} xcb_xkb_permament_radio_group_behavior_t;
+
+/**
+ * @brief xcb_xkb_permament_radio_group_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_permament_radio_group_behavior_iterator_t {
+ xcb_xkb_permament_radio_group_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_permament_radio_group_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_permament_overlay_1_behavior_t
+ **/
+typedef struct xcb_xkb_permament_overlay_1_behavior_t {
+ uint8_t type; /**< */
+ xcb_keycode_t key; /**< */
+} xcb_xkb_permament_overlay_1_behavior_t;
+
+/**
+ * @brief xcb_xkb_permament_overlay_1_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_permament_overlay_1_behavior_iterator_t {
+ xcb_xkb_permament_overlay_1_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_permament_overlay_1_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_permament_overlay_2_behavior_t
+ **/
+typedef struct xcb_xkb_permament_overlay_2_behavior_t {
+ uint8_t type; /**< */
+ uint8_t key; /**< */
+} xcb_xkb_permament_overlay_2_behavior_t;
+
+/**
+ * @brief xcb_xkb_permament_overlay_2_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_permament_overlay_2_behavior_iterator_t {
+ xcb_xkb_permament_overlay_2_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_permament_overlay_2_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_behavior_t
+ **/
+typedef union xcb_xkb_behavior_t {
+ xcb_xkb_common_behavior_t common; /**< */
+ xcb_xkb_default_behavior_t _default; /**< */
+ xcb_xkb_lock_behavior_t lock; /**< */
+ xcb_xkb_radio_group_behavior_t radioGroup; /**< */
+ xcb_xkb_overlay_1_behavior_t overlay1; /**< */
+ xcb_xkb_overlay_2_behavior_t overlay2; /**< */
+ xcb_xkb_permament_lock_behavior_t permamentLock; /**< */
+ xcb_xkb_permament_radio_group_behavior_t permamentRadioGroup; /**< */
+ xcb_xkb_permament_overlay_1_behavior_t permamentOverlay1; /**< */
+ xcb_xkb_permament_overlay_2_behavior_t permamentOverlay2; /**< */
+ uint8_t type; /**< */
+} xcb_xkb_behavior_t;
+
+/**
+ * @brief xcb_xkb_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_behavior_iterator_t {
+ xcb_xkb_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_behavior_iterator_t;
+
+typedef enum xcb_xkb_behavior_type_t {
+ XCB_XKB_BEHAVIOR_TYPE_DEFAULT = 0,
+ XCB_XKB_BEHAVIOR_TYPE_LOCK = 1,
+ XCB_XKB_BEHAVIOR_TYPE_RADIO_GROUP = 2,
+ XCB_XKB_BEHAVIOR_TYPE_OVERLAY_1 = 3,
+ XCB_XKB_BEHAVIOR_TYPE_OVERLAY_2 = 4,
+ XCB_XKB_BEHAVIOR_TYPE_PERMAMENT_LOCK = 129,
+ XCB_XKB_BEHAVIOR_TYPE_PERMAMENT_RADIO_GROUP = 130,
+ XCB_XKB_BEHAVIOR_TYPE_PERMAMENT_OVERLAY_1 = 131,
+ XCB_XKB_BEHAVIOR_TYPE_PERMAMENT_OVERLAY_2 = 132
+} xcb_xkb_behavior_type_t;
+
+/**
+ * @brief xcb_xkb_set_behavior_t
+ **/
+typedef struct xcb_xkb_set_behavior_t {
+ xcb_keycode_t keycode; /**< */
+ xcb_xkb_behavior_t behavior; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_set_behavior_t;
+
+/**
+ * @brief xcb_xkb_set_behavior_iterator_t
+ **/
+typedef struct xcb_xkb_set_behavior_iterator_t {
+ xcb_xkb_set_behavior_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_set_behavior_iterator_t;
+
+/**
+ * @brief xcb_xkb_set_explicit_t
+ **/
+typedef struct xcb_xkb_set_explicit_t {
+ xcb_keycode_t keycode; /**< */
+ uint8_t explicit; /**< */
+} xcb_xkb_set_explicit_t;
+
+/**
+ * @brief xcb_xkb_set_explicit_iterator_t
+ **/
+typedef struct xcb_xkb_set_explicit_iterator_t {
+ xcb_xkb_set_explicit_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_set_explicit_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_mod_map_t
+ **/
+typedef struct xcb_xkb_key_mod_map_t {
+ xcb_keycode_t keycode; /**< */
+ uint8_t mods; /**< */
+} xcb_xkb_key_mod_map_t;
+
+/**
+ * @brief xcb_xkb_key_mod_map_iterator_t
+ **/
+typedef struct xcb_xkb_key_mod_map_iterator_t {
+ xcb_xkb_key_mod_map_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_mod_map_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_v_mod_map_t
+ **/
+typedef struct xcb_xkb_key_v_mod_map_t {
+ xcb_keycode_t keycode; /**< */
+ uint8_t pad0; /**< */
+ uint16_t vmods; /**< */
+} xcb_xkb_key_v_mod_map_t;
+
+/**
+ * @brief xcb_xkb_key_v_mod_map_iterator_t
+ **/
+typedef struct xcb_xkb_key_v_mod_map_iterator_t {
+ xcb_xkb_key_v_mod_map_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_v_mod_map_iterator_t;
+
+/**
+ * @brief xcb_xkb_kt_set_map_entry_t
+ **/
+typedef struct xcb_xkb_kt_set_map_entry_t {
+ uint8_t level; /**< */
+ uint8_t realMods; /**< */
+ uint16_t virtualMods; /**< */
+} xcb_xkb_kt_set_map_entry_t;
+
+/**
+ * @brief xcb_xkb_kt_set_map_entry_iterator_t
+ **/
+typedef struct xcb_xkb_kt_set_map_entry_iterator_t {
+ xcb_xkb_kt_set_map_entry_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_kt_set_map_entry_iterator_t;
+
+/**
+ * @brief xcb_xkb_set_key_type_t
+ **/
+typedef struct xcb_xkb_set_key_type_t {
+ uint8_t mask; /**< */
+ uint8_t realMods; /**< */
+ uint16_t virtualMods; /**< */
+ uint8_t numLevels; /**< */
+ uint8_t nMapEntries; /**< */
+ uint8_t preserve; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_set_key_type_t;
+
+/**
+ * @brief xcb_xkb_set_key_type_iterator_t
+ **/
+typedef struct xcb_xkb_set_key_type_iterator_t {
+ xcb_xkb_set_key_type_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_set_key_type_iterator_t;
+
+typedef char xcb_xkb_string8_t;
+
+/**
+ * @brief xcb_xkb_string8_iterator_t
+ **/
+typedef struct xcb_xkb_string8_iterator_t {
+ xcb_xkb_string8_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_string8_iterator_t;
+
+/**
+ * @brief xcb_xkb_property_t
+ **/
+typedef struct xcb_xkb_property_t {
+ uint16_t nameLength; /**< */
+ uint16_t valueLength; /**< */
+} xcb_xkb_property_t;
+
+/**
+ * @brief xcb_xkb_property_iterator_t
+ **/
+typedef struct xcb_xkb_property_iterator_t {
+ xcb_xkb_property_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_property_iterator_t;
+
+/**
+ * @brief xcb_xkb_outline_t
+ **/
+typedef struct xcb_xkb_outline_t {
+ uint8_t nPoints; /**< */
+ uint8_t cornerRadius; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_outline_t;
+
+/**
+ * @brief xcb_xkb_outline_iterator_t
+ **/
+typedef struct xcb_xkb_outline_iterator_t {
+ xcb_xkb_outline_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_outline_iterator_t;
+
+/**
+ * @brief xcb_xkb_shape_t
+ **/
+typedef struct xcb_xkb_shape_t {
+ xcb_atom_t name; /**< */
+ uint8_t nOutlines; /**< */
+ uint8_t primaryNdx; /**< */
+ uint8_t approxNdx; /**< */
+ uint8_t pad0; /**< */
+} xcb_xkb_shape_t;
+
+/**
+ * @brief xcb_xkb_shape_iterator_t
+ **/
+typedef struct xcb_xkb_shape_iterator_t {
+ xcb_xkb_shape_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_shape_iterator_t;
+
+/**
+ * @brief xcb_xkb_key_t
+ **/
+typedef struct xcb_xkb_key_t {
+ xcb_xkb_string8_t name[4]; /**< */
+ int16_t gap; /**< */
+ uint8_t shapeNdx; /**< */
+ uint8_t colorNdx; /**< */
+} xcb_xkb_key_t;
+
+/**
+ * @brief xcb_xkb_key_iterator_t
+ **/
+typedef struct xcb_xkb_key_iterator_t {
+ xcb_xkb_key_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_key_iterator_t;
+
+/**
+ * @brief xcb_xkb_overlay_key_t
+ **/
+typedef struct xcb_xkb_overlay_key_t {
+ xcb_xkb_string8_t over[4]; /**< */
+ xcb_xkb_string8_t under[4]; /**< */
+} xcb_xkb_overlay_key_t;
+
+/**
+ * @brief xcb_xkb_overlay_key_iterator_t
+ **/
+typedef struct xcb_xkb_overlay_key_iterator_t {
+ xcb_xkb_overlay_key_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_overlay_key_iterator_t;
+
+/**
+ * @brief xcb_xkb_overlay_row_t
+ **/
+typedef struct xcb_xkb_overlay_row_t {
+ uint8_t rowUnder; /**< */
+ uint8_t nKeys; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_overlay_row_t;
+
+/**
+ * @brief xcb_xkb_overlay_row_iterator_t
+ **/
+typedef struct xcb_xkb_overlay_row_iterator_t {
+ xcb_xkb_overlay_row_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_overlay_row_iterator_t;
+
+/**
+ * @brief xcb_xkb_overlay_t
+ **/
+typedef struct xcb_xkb_overlay_t {
+ xcb_atom_t name; /**< */
+ uint8_t nRows; /**< */
+ uint8_t pad0[3]; /**< */
+} xcb_xkb_overlay_t;
+
+/**
+ * @brief xcb_xkb_overlay_iterator_t
+ **/
+typedef struct xcb_xkb_overlay_iterator_t {
+ xcb_xkb_overlay_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_overlay_iterator_t;
+
+/**
+ * @brief xcb_xkb_row_t
+ **/
+typedef struct xcb_xkb_row_t {
+ int16_t top; /**< */
+ int16_t left; /**< */
+ uint8_t nKeys; /**< */
+ uint8_t vertical; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_row_t;
+
+/**
+ * @brief xcb_xkb_row_iterator_t
+ **/
+typedef struct xcb_xkb_row_iterator_t {
+ xcb_xkb_row_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_row_iterator_t;
+
+typedef enum xcb_xkb_doodad_type_t {
+ XCB_XKB_DOODAD_TYPE_OUTLINE = 1,
+ XCB_XKB_DOODAD_TYPE_SOLID = 2,
+ XCB_XKB_DOODAD_TYPE_TEXT = 3,
+ XCB_XKB_DOODAD_TYPE_INDICATOR = 4,
+ XCB_XKB_DOODAD_TYPE_LOGO = 5
+} xcb_xkb_doodad_type_t;
+
+/**
+ * @brief xcb_xkb_common_doodad_t
+ **/
+typedef struct xcb_xkb_common_doodad_t {
+ xcb_atom_t name; /**< */
+ uint8_t type; /**< */
+ uint8_t priority; /**< */
+ int16_t top; /**< */
+ int16_t left; /**< */
+ int16_t angle; /**< */
+} xcb_xkb_common_doodad_t;
+
+/**
+ * @brief xcb_xkb_common_doodad_iterator_t
+ **/
+typedef struct xcb_xkb_common_doodad_iterator_t {
+ xcb_xkb_common_doodad_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_common_doodad_iterator_t;
+
+/**
+ * @brief xcb_xkb_shape_doodad_t
+ **/
+typedef struct xcb_xkb_shape_doodad_t {
+ xcb_atom_t name; /**< */
+ uint8_t type; /**< */
+ uint8_t priority; /**< */
+ int16_t top; /**< */
+ int16_t left; /**< */
+ int16_t angle; /**< */
+ uint8_t colorNdx; /**< */
+ uint8_t shapeNdx; /**< */
+ uint8_t pad0[6]; /**< */
+} xcb_xkb_shape_doodad_t;
+
+/**
+ * @brief xcb_xkb_shape_doodad_iterator_t
+ **/
+typedef struct xcb_xkb_shape_doodad_iterator_t {
+ xcb_xkb_shape_doodad_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_shape_doodad_iterator_t;
+
+/**
+ * @brief xcb_xkb_text_doodad_t
+ **/
+typedef struct xcb_xkb_text_doodad_t {
+ xcb_atom_t name; /**< */
+ uint8_t type; /**< */
+ uint8_t priority; /**< */
+ int16_t top; /**< */
+ int16_t left; /**< */
+ int16_t angle; /**< */
+ uint16_t width; /**< */
+ uint16_t height; /**< */
+ uint8_t colorNdx; /**< */
+ uint8_t pad0[3]; /**< */
+} xcb_xkb_text_doodad_t;
+
+
+/*****************************************************************************
+ **
+ ** xcb_xkb_counted_string_16_t * xcb_xkb_text_doodad_text
+ **
+ ** @param const xcb_xkb_text_doodad_t *R
+ ** @returns xcb_xkb_counted_string_16_t *
+ **
+ *****************************************************************************/
+
+xcb_xkb_counted_string_16_t *
+xcb_xkb_text_doodad_text (const xcb_xkb_text_doodad_t *R /**< */);
+
+
+/*****************************************************************************
+ **
+ ** xcb_xkb_counted_string_16_t * xcb_xkb_text_doodad_font
+ **
+ ** @param const xcb_xkb_text_doodad_t *R
+ ** @returns xcb_xkb_counted_string_16_t *
+ **
+ *****************************************************************************/
+
+xcb_xkb_counted_string_16_t *
+xcb_xkb_text_doodad_font (const xcb_xkb_text_doodad_t *R /**< */);
+
+/**
+ * @brief xcb_xkb_text_doodad_iterator_t
+ **/
+typedef struct xcb_xkb_text_doodad_iterator_t {
+ xcb_xkb_text_doodad_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_text_doodad_iterator_t;
+
+/**
+ * @brief xcb_xkb_indicator_doodad_t
+ **/
+typedef struct xcb_xkb_indicator_doodad_t {
+ xcb_atom_t name; /**< */
+ uint8_t type; /**< */
+ uint8_t priority; /**< */
+ int16_t top; /**< */
+ int16_t left; /**< */
+ int16_t angle; /**< */
+ uint8_t shapeNdx; /**< */
+ uint8_t onColorNdx; /**< */
+ uint8_t offColorNdx; /**< */
+ uint8_t pad0[5]; /**< */
+} xcb_xkb_indicator_doodad_t;
+
+/**
+ * @brief xcb_xkb_indicator_doodad_iterator_t
+ **/
+typedef struct xcb_xkb_indicator_doodad_iterator_t {
+ xcb_xkb_indicator_doodad_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_indicator_doodad_iterator_t;
+
+/**
+ * @brief xcb_xkb_logo_doodad_t
+ **/
+typedef struct xcb_xkb_logo_doodad_t {
+ xcb_atom_t name; /**< */
+ uint8_t type; /**< */
+ uint8_t priority; /**< */
+ int16_t top; /**< */
+ int16_t left; /**< */
+ int16_t angle; /**< */
+ uint8_t colorNdx; /**< */
+ uint8_t shapeNdx; /**< */
+ uint8_t pad0[6]; /**< */
+} xcb_xkb_logo_doodad_t;
+
+
+/*****************************************************************************
+ **
+ ** xcb_xkb_counted_string_16_t * xcb_xkb_logo_doodad_logo_name
+ **
+ ** @param const xcb_xkb_logo_doodad_t *R
+ ** @returns xcb_xkb_counted_string_16_t *
+ **
+ *****************************************************************************/
+
+xcb_xkb_counted_string_16_t *
+xcb_xkb_logo_doodad_logo_name (const xcb_xkb_logo_doodad_t *R /**< */);
+
+/**
+ * @brief xcb_xkb_logo_doodad_iterator_t
+ **/
+typedef struct xcb_xkb_logo_doodad_iterator_t {
+ xcb_xkb_logo_doodad_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_logo_doodad_iterator_t;
+
+/**
+ * @brief xcb_xkb_doodad_t
+ **/
+typedef union xcb_xkb_doodad_t {
+ xcb_xkb_common_doodad_t common; /**< */
+ xcb_xkb_shape_doodad_t shape; /**< */
+ xcb_xkb_text_doodad_t *text; /**< */
+ xcb_xkb_indicator_doodad_t indicator; /**< */
+ xcb_xkb_logo_doodad_t *logo; /**< */
+} xcb_xkb_doodad_t;
+
+/**
+ * @brief xcb_xkb_doodad_iterator_t
+ **/
+typedef struct xcb_xkb_doodad_iterator_t {
+ xcb_xkb_doodad_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_doodad_iterator_t;
+
+/**
+ * @brief xcb_xkb_section_t
+ **/
+typedef struct xcb_xkb_section_t {
+ xcb_atom_t name; /**< */
+ int16_t top; /**< */
+ int16_t left; /**< */
+ uint16_t width; /**< */
+ uint16_t height; /**< */
+ int16_t angle; /**< */
+ uint8_t priority; /**< */
+ uint8_t nRows; /**< */
+ uint8_t nDoodads; /**< */
+ uint8_t nOverlays; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_section_t;
+
+/**
+ * @brief xcb_xkb_section_iterator_t
+ **/
+typedef struct xcb_xkb_section_iterator_t {
+ xcb_xkb_section_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_section_iterator_t;
+
+/**
+ * @brief xcb_xkb_listing_t
+ **/
+typedef struct xcb_xkb_listing_t {
+ uint16_t flags; /**< */
+ uint16_t length; /**< */
+} xcb_xkb_listing_t;
+
+/**
+ * @brief xcb_xkb_listing_iterator_t
+ **/
+typedef struct xcb_xkb_listing_iterator_t {
+ xcb_xkb_listing_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_listing_iterator_t;
+
+/**
+ * @brief xcb_xkb_device_led_info_t
+ **/
+typedef struct xcb_xkb_device_led_info_t {
+ xcb_xkb_led_class_spec_t ledClass; /**< */
+ xcb_xkb_id_spec_t ledID; /**< */
+ uint32_t namesPresent; /**< */
+ uint32_t mapsPresent; /**< */
+ uint32_t physIndicators; /**< */
+ uint32_t state; /**< */
+} xcb_xkb_device_led_info_t;
+
+/**
+ * @brief xcb_xkb_device_led_info_iterator_t
+ **/
+typedef struct xcb_xkb_device_led_info_iterator_t {
+ xcb_xkb_device_led_info_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_device_led_info_iterator_t;
+
+typedef enum xcb_xkb_error_t {
+ XCB_XKB_ERROR_BAD_DEVICE = 255,
+ XCB_XKB_ERROR_BAD_CLASS = 254,
+ XCB_XKB_ERROR_BAD_ID = 253
+} xcb_xkb_error_t;
+
+/** Opcode for xcb_xkb_keyboard. */
+#define XCB_XKB_KEYBOARD 0
+
+/**
+ * @brief xcb_xkb_keyboard_error_t
+ **/
+typedef struct xcb_xkb_keyboard_error_t {
+ uint8_t response_type; /**< */
+ uint8_t error_code; /**< */
+ uint16_t sequence; /**< */
+ uint32_t value; /**< */
+ uint16_t minorOpcode; /**< */
+ uint8_t majorOpcode; /**< */
+ uint8_t pad0[21]; /**< */
+} xcb_xkb_keyboard_error_t;
+
+typedef enum xcb_xkb_sa_t {
+ XCB_XKB_SA_CLEAR_LOCKS = 1,
+ XCB_XKB_SA_LATCH_TO_LOCK = 2,
+ XCB_XKB_SA_USE_MOD_MAP_MODS = 4,
+ XCB_XKB_SA_GROUP_ABSOLUTE = 4
+} xcb_xkb_sa_t;
+
+typedef enum xcb_xkb_sa_type_t {
+ XCB_XKB_SA_TYPE_NO_ACTION = 0,
+ XCB_XKB_SA_TYPE_SET_MODS = 1,
+ XCB_XKB_SA_TYPE_LATCH_MODS = 2,
+ XCB_XKB_SA_TYPE_LOCK_MODS = 3,
+ XCB_XKB_SA_TYPE_SET_GROUP = 4,
+ XCB_XKB_SA_TYPE_LATCH_GROUP = 5,
+ XCB_XKB_SA_TYPE_LOCK_GROUP = 6,
+ XCB_XKB_SA_TYPE_MOVE_PTR = 7,
+ XCB_XKB_SA_TYPE_PTR_BTN = 8,
+ XCB_XKB_SA_TYPE_LOCK_PTR_BTN = 9,
+ XCB_XKB_SA_TYPE_SET_PTR_DFLT = 10,
+ XCB_XKB_SA_TYPE_ISO_LOCK = 11,
+ XCB_XKB_SA_TYPE_TERMINATE = 12,
+ XCB_XKB_SA_TYPE_SWITCH_SCREEN = 13,
+ XCB_XKB_SA_TYPE_SET_CONTROLS = 14,
+ XCB_XKB_SA_TYPE_LOCK_CONTROLS = 15,
+ XCB_XKB_SA_TYPE_ACTION_MESSAGE = 16,
+ XCB_XKB_SA_TYPE_REDIRECT_KEY = 17,
+ XCB_XKB_SA_TYPE_DEVICE_BTN = 18,
+ XCB_XKB_SA_TYPE_LOCK_DEVICE_BTN = 19,
+ XCB_XKB_SA_TYPE_DEVICE_VALUATOR = 20
+} xcb_xkb_sa_type_t;
+
+/**
+ * @brief xcb_xkb_sa_no_action_t
+ **/
+typedef struct xcb_xkb_sa_no_action_t {
+ uint8_t type; /**< */
+ uint8_t pad0[7]; /**< */
+} xcb_xkb_sa_no_action_t;
+
+/**
+ * @brief xcb_xkb_sa_no_action_iterator_t
+ **/
+typedef struct xcb_xkb_sa_no_action_iterator_t {
+ xcb_xkb_sa_no_action_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_no_action_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_set_mods_t
+ **/
+typedef struct xcb_xkb_sa_set_mods_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t mask; /**< */
+ uint8_t realMods; /**< */
+ uint8_t vmodsHigh; /**< */
+ uint8_t vmodsLow; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_sa_set_mods_t;
+
+/**
+ * @brief xcb_xkb_sa_set_mods_iterator_t
+ **/
+typedef struct xcb_xkb_sa_set_mods_iterator_t {
+ xcb_xkb_sa_set_mods_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_set_mods_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_latch_mods_t
+ **/
+typedef struct xcb_xkb_sa_latch_mods_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t mask; /**< */
+ uint8_t realMods; /**< */
+ uint8_t vmodsHigh; /**< */
+ uint8_t vmodsLow; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_sa_latch_mods_t;
+
+/**
+ * @brief xcb_xkb_sa_latch_mods_iterator_t
+ **/
+typedef struct xcb_xkb_sa_latch_mods_iterator_t {
+ xcb_xkb_sa_latch_mods_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_latch_mods_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_mods_t
+ **/
+typedef struct xcb_xkb_sa_lock_mods_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t mask; /**< */
+ uint8_t realMods; /**< */
+ uint8_t vmodsHigh; /**< */
+ uint8_t vmodsLow; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_sa_lock_mods_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_mods_iterator_t
+ **/
+typedef struct xcb_xkb_sa_lock_mods_iterator_t {
+ xcb_xkb_sa_lock_mods_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_lock_mods_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_set_group_t
+ **/
+typedef struct xcb_xkb_sa_set_group_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ int8_t group; /**< */
+ uint8_t pad0[5]; /**< */
+} xcb_xkb_sa_set_group_t;
+
+/**
+ * @brief xcb_xkb_sa_set_group_iterator_t
+ **/
+typedef struct xcb_xkb_sa_set_group_iterator_t {
+ xcb_xkb_sa_set_group_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_set_group_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_latch_group_t
+ **/
+typedef struct xcb_xkb_sa_latch_group_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ int8_t group; /**< */
+ uint8_t pad0[5]; /**< */
+} xcb_xkb_sa_latch_group_t;
+
+/**
+ * @brief xcb_xkb_sa_latch_group_iterator_t
+ **/
+typedef struct xcb_xkb_sa_latch_group_iterator_t {
+ xcb_xkb_sa_latch_group_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_latch_group_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_group_t
+ **/
+typedef struct xcb_xkb_sa_lock_group_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ int8_t group; /**< */
+ uint8_t pad0[5]; /**< */
+} xcb_xkb_sa_lock_group_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_group_iterator_t
+ **/
+typedef struct xcb_xkb_sa_lock_group_iterator_t {
+ xcb_xkb_sa_lock_group_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_lock_group_iterator_t;
+
+typedef enum xcb_xkb_sa_move_ptr_flag_t {
+ XCB_XKB_SA_MOVE_PTR_FLAG_NO_ACCELERATION = 1,
+ XCB_XKB_SA_MOVE_PTR_FLAG_MOVE_ABSOLUTE_X = 2,
+ XCB_XKB_SA_MOVE_PTR_FLAG_MOVE_ABSOLUTE_Y = 4
+} xcb_xkb_sa_move_ptr_flag_t;
+
+/**
+ * @brief xcb_xkb_sa_move_ptr_t
+ **/
+typedef struct xcb_xkb_sa_move_ptr_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ int8_t xHigh; /**< */
+ uint8_t xLow; /**< */
+ int8_t yHigh; /**< */
+ uint8_t yLow; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_sa_move_ptr_t;
+
+/**
+ * @brief xcb_xkb_sa_move_ptr_iterator_t
+ **/
+typedef struct xcb_xkb_sa_move_ptr_iterator_t {
+ xcb_xkb_sa_move_ptr_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_move_ptr_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_ptr_btn_t
+ **/
+typedef struct xcb_xkb_sa_ptr_btn_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t count; /**< */
+ uint8_t button; /**< */
+ uint8_t pad0[4]; /**< */
+} xcb_xkb_sa_ptr_btn_t;
+
+/**
+ * @brief xcb_xkb_sa_ptr_btn_iterator_t
+ **/
+typedef struct xcb_xkb_sa_ptr_btn_iterator_t {
+ xcb_xkb_sa_ptr_btn_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_ptr_btn_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_ptr_btn_t
+ **/
+typedef struct xcb_xkb_sa_lock_ptr_btn_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t pad0; /**< */
+ uint8_t button; /**< */
+ uint8_t pad1[4]; /**< */
+} xcb_xkb_sa_lock_ptr_btn_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_ptr_btn_iterator_t
+ **/
+typedef struct xcb_xkb_sa_lock_ptr_btn_iterator_t {
+ xcb_xkb_sa_lock_ptr_btn_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_lock_ptr_btn_iterator_t;
+
+typedef enum xcb_xkb_sa_set_ptr_dflt_flag_t {
+ XCB_XKB_SA_SET_PTR_DFLT_FLAG_DFLT_BTN_ABSOLUTE = 2,
+ XCB_XKB_SA_SET_PTR_DFLT_FLAG_AFFECT_DFLT_BUTTON = 1
+} xcb_xkb_sa_set_ptr_dflt_flag_t;
+
+/**
+ * @brief xcb_xkb_sa_set_ptr_dflt_t
+ **/
+typedef struct xcb_xkb_sa_set_ptr_dflt_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t affect; /**< */
+ int8_t value; /**< */
+ uint8_t pad0[4]; /**< */
+} xcb_xkb_sa_set_ptr_dflt_t;
+
+/**
+ * @brief xcb_xkb_sa_set_ptr_dflt_iterator_t
+ **/
+typedef struct xcb_xkb_sa_set_ptr_dflt_iterator_t {
+ xcb_xkb_sa_set_ptr_dflt_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_set_ptr_dflt_iterator_t;
+
+typedef enum xcb_xkb_sa_iso_lock_flag_t {
+ XCB_XKB_SA_ISO_LOCK_FLAG_NO_LOCK = 1,
+ XCB_XKB_SA_ISO_LOCK_FLAG_NO_UNLOCK = 2,
+ XCB_XKB_SA_ISO_LOCK_FLAG_USE_MOD_MAP_MODS = 4,
+ XCB_XKB_SA_ISO_LOCK_FLAG_GROUP_ABSOLUTE = 4,
+ XCB_XKB_SA_ISO_LOCK_FLAG_ISO_DFLT_IS_GROUP = 8
+} xcb_xkb_sa_iso_lock_flag_t;
+
+typedef enum xcb_xkb_sa_iso_lock_no_affect_t {
+ XCB_XKB_SA_ISO_LOCK_NO_AFFECT_CTRLS = 8,
+ XCB_XKB_SA_ISO_LOCK_NO_AFFECT_PTR = 16,
+ XCB_XKB_SA_ISO_LOCK_NO_AFFECT_GROUP = 32,
+ XCB_XKB_SA_ISO_LOCK_NO_AFFECT_MODS = 64
+} xcb_xkb_sa_iso_lock_no_affect_t;
+
+/**
+ * @brief xcb_xkb_sa_iso_lock_t
+ **/
+typedef struct xcb_xkb_sa_iso_lock_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t mask; /**< */
+ uint8_t realMods; /**< */
+ int8_t group; /**< */
+ uint8_t affect; /**< */
+ uint8_t vmodsHigh; /**< */
+ uint8_t vmodsLow; /**< */
+} xcb_xkb_sa_iso_lock_t;
+
+/**
+ * @brief xcb_xkb_sa_iso_lock_iterator_t
+ **/
+typedef struct xcb_xkb_sa_iso_lock_iterator_t {
+ xcb_xkb_sa_iso_lock_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_iso_lock_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_terminate_t
+ **/
+typedef struct xcb_xkb_sa_terminate_t {
+ uint8_t type; /**< */
+ uint8_t pad0[7]; /**< */
+} xcb_xkb_sa_terminate_t;
+
+/**
+ * @brief xcb_xkb_sa_terminate_iterator_t
+ **/
+typedef struct xcb_xkb_sa_terminate_iterator_t {
+ xcb_xkb_sa_terminate_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_terminate_iterator_t;
+
+typedef enum xcb_xkb_switch_screen_flag_t {
+ XCB_XKB_SWITCH_SCREEN_FLAG_APPLICATION = 1,
+ XCB_XKB_SWITCH_SCREEN_FLAG_ABSOLUTE = 4
+} xcb_xkb_switch_screen_flag_t;
+
+/**
+ * @brief xcb_xkb_sa_switch_screen_t
+ **/
+typedef struct xcb_xkb_sa_switch_screen_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ int8_t newScreen; /**< */
+ uint8_t pad0[5]; /**< */
+} xcb_xkb_sa_switch_screen_t;
+
+/**
+ * @brief xcb_xkb_sa_switch_screen_iterator_t
+ **/
+typedef struct xcb_xkb_sa_switch_screen_iterator_t {
+ xcb_xkb_sa_switch_screen_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_switch_screen_iterator_t;
+
+typedef enum xcb_xkb_bool_ctrls_high_t {
+ XCB_XKB_BOOL_CTRLS_HIGH_ACCESS_X_FEEDBACK = 1,
+ XCB_XKB_BOOL_CTRLS_HIGH_AUDIBLE_BELL = 2,
+ XCB_XKB_BOOL_CTRLS_HIGH_OVERLAY_1 = 4,
+ XCB_XKB_BOOL_CTRLS_HIGH_OVERLAY_2 = 8,
+ XCB_XKB_BOOL_CTRLS_HIGH_IGNORE_GROUP_LOCK = 16
+} xcb_xkb_bool_ctrls_high_t;
+
+typedef enum xcb_xkb_bool_ctrls_low_t {
+ XCB_XKB_BOOL_CTRLS_LOW_REPEAT_KEYS = 1,
+ XCB_XKB_BOOL_CTRLS_LOW_SLOW_KEYS = 2,
+ XCB_XKB_BOOL_CTRLS_LOW_BOUNCE_KEYS = 4,
+ XCB_XKB_BOOL_CTRLS_LOW_STICKY_KEYS = 8,
+ XCB_XKB_BOOL_CTRLS_LOW_MOUSE_KEYS = 16,
+ XCB_XKB_BOOL_CTRLS_LOW_MOUSE_KEYS_ACCEL = 32,
+ XCB_XKB_BOOL_CTRLS_LOW_ACCESS_X_KEYS = 64,
+ XCB_XKB_BOOL_CTRLS_LOW_ACCESS_X_TIMEOUT = 128
+} xcb_xkb_bool_ctrls_low_t;
+
+/**
+ * @brief xcb_xkb_sa_set_controls_t
+ **/
+typedef struct xcb_xkb_sa_set_controls_t {
+ uint8_t type; /**< */
+ uint8_t pad0[3]; /**< */
+ uint8_t boolCtrlsHigh; /**< */
+ uint8_t boolCtrlsLow; /**< */
+ uint8_t pad1[2]; /**< */
+} xcb_xkb_sa_set_controls_t;
+
+/**
+ * @brief xcb_xkb_sa_set_controls_iterator_t
+ **/
+typedef struct xcb_xkb_sa_set_controls_iterator_t {
+ xcb_xkb_sa_set_controls_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_set_controls_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_controls_t
+ **/
+typedef struct xcb_xkb_sa_lock_controls_t {
+ uint8_t type; /**< */
+ uint8_t pad0[3]; /**< */
+ uint8_t boolCtrlsHigh; /**< */
+ uint8_t boolCtrlsLow; /**< */
+ uint8_t pad1[2]; /**< */
+} xcb_xkb_sa_lock_controls_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_controls_iterator_t
+ **/
+typedef struct xcb_xkb_sa_lock_controls_iterator_t {
+ xcb_xkb_sa_lock_controls_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_lock_controls_iterator_t;
+
+typedef enum xcb_xkb_action_message_flag_t {
+ XCB_XKB_ACTION_MESSAGE_FLAG_ON_PRESS = 1,
+ XCB_XKB_ACTION_MESSAGE_FLAG_ON_RELEASE = 2,
+ XCB_XKB_ACTION_MESSAGE_FLAG_GEN_KEY_EVENT = 4
+} xcb_xkb_action_message_flag_t;
+
+/**
+ * @brief xcb_xkb_sa_action_message_t
+ **/
+typedef struct xcb_xkb_sa_action_message_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t message[6]; /**< */
+} xcb_xkb_sa_action_message_t;
+
+/**
+ * @brief xcb_xkb_sa_action_message_iterator_t
+ **/
+typedef struct xcb_xkb_sa_action_message_iterator_t {
+ xcb_xkb_sa_action_message_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_action_message_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_redirect_key_t
+ **/
+typedef struct xcb_xkb_sa_redirect_key_t {
+ uint8_t type; /**< */
+ xcb_keycode_t newkey; /**< */
+ uint8_t mask; /**< */
+ uint8_t realModifiers; /**< */
+ uint8_t vmodsMaskHigh; /**< */
+ uint8_t vmodsMaskLow; /**< */
+ uint8_t vmodsHigh; /**< */
+ uint8_t vmodsLow; /**< */
+} xcb_xkb_sa_redirect_key_t;
+
+/**
+ * @brief xcb_xkb_sa_redirect_key_iterator_t
+ **/
+typedef struct xcb_xkb_sa_redirect_key_iterator_t {
+ xcb_xkb_sa_redirect_key_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_redirect_key_iterator_t;
+
+/**
+ * @brief xcb_xkb_sa_device_btn_t
+ **/
+typedef struct xcb_xkb_sa_device_btn_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t count; /**< */
+ uint8_t button; /**< */
+ uint8_t device; /**< */
+ uint8_t pad0[3]; /**< */
+} xcb_xkb_sa_device_btn_t;
+
+/**
+ * @brief xcb_xkb_sa_device_btn_iterator_t
+ **/
+typedef struct xcb_xkb_sa_device_btn_iterator_t {
+ xcb_xkb_sa_device_btn_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_device_btn_iterator_t;
+
+typedef enum xcb_xkb_lock_device_flags_t {
+ XCB_XKB_LOCK_DEVICE_FLAGS_NO_LOCK = 1,
+ XCB_XKB_LOCK_DEVICE_FLAGS_NO_UNLOCK = 2
+} xcb_xkb_lock_device_flags_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_device_btn_t
+ **/
+typedef struct xcb_xkb_sa_lock_device_btn_t {
+ uint8_t type; /**< */
+ uint8_t flags; /**< */
+ uint8_t pad0; /**< */
+ uint8_t button; /**< */
+ uint8_t device; /**< */
+} xcb_xkb_sa_lock_device_btn_t;
+
+/**
+ * @brief xcb_xkb_sa_lock_device_btn_iterator_t
+ **/
+typedef struct xcb_xkb_sa_lock_device_btn_iterator_t {
+ xcb_xkb_sa_lock_device_btn_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_lock_device_btn_iterator_t;
+
+typedef enum xcb_xkb_sa_val_what_t {
+ XCB_XKB_SA_VAL_WHAT_IGNORE_VAL = 0,
+ XCB_XKB_SA_VAL_WHAT_SET_VAL_MIN = 1,
+ XCB_XKB_SA_VAL_WHAT_SET_VAL_CENTER = 2,
+ XCB_XKB_SA_VAL_WHAT_SET_VAL_MAX = 3,
+ XCB_XKB_SA_VAL_WHAT_SET_VAL_RELATIVE = 4,
+ XCB_XKB_SA_VAL_WHAT_SET_VAL_ABSOLUTE = 5
+} xcb_xkb_sa_val_what_t;
+
+/**
+ * @brief xcb_xkb_sa_device_valuator_t
+ **/
+typedef struct xcb_xkb_sa_device_valuator_t {
+ uint8_t type; /**< */
+ uint8_t device; /**< */
+ uint8_t val1what; /**< */
+ uint8_t val1index; /**< */
+ uint8_t val1value; /**< */
+ uint8_t val2what; /**< */
+ uint8_t val2index; /**< */
+ uint8_t val2value; /**< */
+} xcb_xkb_sa_device_valuator_t;
+
+/**
+ * @brief xcb_xkb_sa_device_valuator_iterator_t
+ **/
+typedef struct xcb_xkb_sa_device_valuator_iterator_t {
+ xcb_xkb_sa_device_valuator_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_sa_device_valuator_iterator_t;
+
+/**
+ * @brief xcb_xkb_action_t
+ **/
+typedef union xcb_xkb_action_t {
+ xcb_xkb_sa_no_action_t noaction; /**< */
+ xcb_xkb_sa_set_mods_t setmods; /**< */
+ xcb_xkb_sa_latch_mods_t latchmods; /**< */
+ xcb_xkb_sa_lock_mods_t lockmods; /**< */
+ xcb_xkb_sa_set_group_t setgroup; /**< */
+ xcb_xkb_sa_latch_group_t latchgroup; /**< */
+ xcb_xkb_sa_lock_group_t lockgroup; /**< */
+ xcb_xkb_sa_move_ptr_t moveptr; /**< */
+ xcb_xkb_sa_ptr_btn_t ptrbtn; /**< */
+ xcb_xkb_sa_lock_ptr_btn_t lockptrbtn; /**< */
+ xcb_xkb_sa_set_ptr_dflt_t setptrdflt; /**< */
+ xcb_xkb_sa_iso_lock_t isolock; /**< */
+ xcb_xkb_sa_terminate_t terminate; /**< */
+ xcb_xkb_sa_switch_screen_t switchscreen; /**< */
+ xcb_xkb_sa_set_controls_t setcontrols; /**< */
+ xcb_xkb_sa_lock_controls_t lockcontrols; /**< */
+ xcb_xkb_sa_action_message_t message; /**< */
+ xcb_xkb_sa_redirect_key_t redirect; /**< */
+ xcb_xkb_sa_device_btn_t devbtn; /**< */
+ xcb_xkb_sa_lock_device_btn_t lockdevbtn; /**< */
+ xcb_xkb_sa_device_valuator_t devval; /**< */
+ uint8_t type; /**< */
+} xcb_xkb_action_t;
+
+/**
+ * @brief xcb_xkb_action_iterator_t
+ **/
+typedef struct xcb_xkb_action_iterator_t {
+ xcb_xkb_action_t *data; /**< */
+ int rem; /**< */
+ int index; /**< */
+} xcb_xkb_action_iterator_t;
+
+/**
+ * @brief xcb_xkb_use_extension_cookie_t
+ **/
+typedef struct xcb_xkb_use_extension_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_use_extension_cookie_t;
+
+/** Opcode for xcb_xkb_use_extension. */
+#define XCB_XKB_USE_EXTENSION 0
+
+/**
+ * @brief xcb_xkb_use_extension_request_t
+ **/
+typedef struct xcb_xkb_use_extension_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ uint16_t wantedMajor; /**< */
+ uint16_t wantedMinor; /**< */
+} xcb_xkb_use_extension_request_t;
+
+/**
+ * @brief xcb_xkb_use_extension_reply_t
+ **/
+typedef struct xcb_xkb_use_extension_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t supported; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint16_t serverMajor; /**< */
+ uint16_t serverMinor; /**< */
+ uint8_t pad0[20]; /**< */
+} xcb_xkb_use_extension_reply_t;
+
+/**
+ * @brief xcb_xkb_select_events_details_t
+ **/
+typedef struct xcb_xkb_select_events_details_t {
+ uint16_t affectNewKeyboard; /**< */
+ uint16_t newKeyboardDetails; /**< */
+ uint16_t affectState; /**< */
+ uint16_t stateDetails; /**< */
+ uint32_t affectCtrls; /**< */
+ uint32_t ctrlDetails; /**< */
+ uint32_t affectIndicatorState; /**< */
+ uint32_t indicatorStateDetails; /**< */
+ uint32_t affectIndicatorMap; /**< */
+ uint32_t indicatorMapDetails; /**< */
+ uint16_t affectNames; /**< */
+ uint16_t namesDetails; /**< */
+ uint8_t affectCompat; /**< */
+ uint8_t compatDetails; /**< */
+ uint8_t affectBell; /**< */
+ uint8_t bellDetails; /**< */
+ uint8_t affectMsgDetails; /**< */
+ uint8_t msgDetails; /**< */
+ uint16_t affectAccessX; /**< */
+ uint16_t accessXDetails; /**< */
+ uint16_t affectExtDev; /**< */
+ uint16_t extdevDetails; /**< */
+} xcb_xkb_select_events_details_t;
+
+/** Opcode for xcb_xkb_select_events. */
+#define XCB_XKB_SELECT_EVENTS 1
+
+/**
+ * @brief xcb_xkb_select_events_request_t
+ **/
+typedef struct xcb_xkb_select_events_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t affectWhich; /**< */
+ uint16_t clear; /**< */
+ uint16_t selectAll; /**< */
+ uint16_t affectMap; /**< */
+ uint16_t map; /**< */
+} xcb_xkb_select_events_request_t;
+
+/** Opcode for xcb_xkb_bell. */
+#define XCB_XKB_BELL 3
+
+/**
+ * @brief xcb_xkb_bell_request_t
+ **/
+typedef struct xcb_xkb_bell_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ xcb_xkb_bell_class_spec_t bellClass; /**< */
+ xcb_xkb_id_spec_t bellID; /**< */
+ int8_t percent; /**< */
+ uint8_t forceSound; /**< */
+ uint8_t eventOnly; /**< */
+ uint8_t pad0; /**< */
+ int16_t pitch; /**< */
+ int16_t duration; /**< */
+ uint8_t pad1[2]; /**< */
+ xcb_atom_t name; /**< */
+ xcb_window_t window; /**< */
+} xcb_xkb_bell_request_t;
+
+/**
+ * @brief xcb_xkb_get_state_cookie_t
+ **/
+typedef struct xcb_xkb_get_state_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_state_cookie_t;
+
+/** Opcode for xcb_xkb_get_state. */
+#define XCB_XKB_GET_STATE 4
+
+/**
+ * @brief xcb_xkb_get_state_request_t
+ **/
+typedef struct xcb_xkb_get_state_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_get_state_request_t;
+
+/**
+ * @brief xcb_xkb_get_state_reply_t
+ **/
+typedef struct xcb_xkb_get_state_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint8_t mods; /**< */
+ uint8_t baseMods; /**< */
+ uint8_t latchedMods; /**< */
+ uint8_t lockedMods; /**< */
+ uint8_t group; /**< */
+ uint8_t lockedGroup; /**< */
+ int16_t baseGroup; /**< */
+ int16_t latchedGroup; /**< */
+ uint8_t compatState; /**< */
+ uint8_t grabMods; /**< */
+ uint8_t compatGrabMods; /**< */
+ uint8_t lookupMods; /**< */
+ uint8_t compatLookupMods; /**< */
+ uint8_t pad0; /**< */
+ uint16_t ptrBtnState; /**< */
+ uint8_t pad1[6]; /**< */
+} xcb_xkb_get_state_reply_t;
+
+/** Opcode for xcb_xkb_latch_lock_state. */
+#define XCB_XKB_LATCH_LOCK_STATE 5
+
+/**
+ * @brief xcb_xkb_latch_lock_state_request_t
+ **/
+typedef struct xcb_xkb_latch_lock_state_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t affectModLocks; /**< */
+ uint8_t modLocks; /**< */
+ uint8_t lockGroup; /**< */
+ uint8_t groupLock; /**< */
+ uint8_t affectModLatches; /**< */
+ uint8_t pad0; /**< */
+ uint8_t latchGroup; /**< */
+ uint16_t groupLatch; /**< */
+} xcb_xkb_latch_lock_state_request_t;
+
+/**
+ * @brief xcb_xkb_get_controls_cookie_t
+ **/
+typedef struct xcb_xkb_get_controls_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_controls_cookie_t;
+
+/** Opcode for xcb_xkb_get_controls. */
+#define XCB_XKB_GET_CONTROLS 6
+
+/**
+ * @brief xcb_xkb_get_controls_request_t
+ **/
+typedef struct xcb_xkb_get_controls_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_get_controls_request_t;
+
+/**
+ * @brief xcb_xkb_get_controls_reply_t
+ **/
+typedef struct xcb_xkb_get_controls_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint8_t mouseKeysDfltBtn; /**< */
+ uint8_t numGroups; /**< */
+ uint8_t groupsWrap; /**< */
+ uint8_t internalModsMask; /**< */
+ uint8_t ignoreLockModsMask; /**< */
+ uint8_t internalModsRealMods; /**< */
+ uint8_t ignoreLockModsRealMods; /**< */
+ uint8_t pad0; /**< */
+ uint16_t internalModsVmods; /**< */
+ uint16_t ignoreLockModsVmods; /**< */
+ uint16_t repeatDelay; /**< */
+ uint16_t repeatInterval; /**< */
+ uint16_t slowKeysDelay; /**< */
+ uint16_t debounceDelay; /**< */
+ uint16_t mouseKeysDelay; /**< */
+ uint16_t mouseKeysInterval; /**< */
+ uint16_t mouseKeysTimeToMax; /**< */
+ uint16_t mouseKeysMaxSpeed; /**< */
+ int16_t mouseKeysCurve; /**< */
+ xcb_xkb_ax_option_t accessXOption; /**< */
+ uint16_t accessXTimeout; /**< */
+ xcb_xkb_ax_option_t accessXTimeoutOptionsMask; /**< */
+ xcb_xkb_ax_option_t accessXTimeoutOptionsValues; /**< */
+ uint8_t pad1[2]; /**< */
+ uint32_t accessXTimeoutMask; /**< */
+ uint32_t accessXTimeoutValues; /**< */
+ uint32_t enabledControls; /**< */
+ uint8_t perKeyRepeat[32]; /**< */
+} xcb_xkb_get_controls_reply_t;
+
+/** Opcode for xcb_xkb_set_controls. */
+#define XCB_XKB_SET_CONTROLS 7
+
+/**
+ * @brief xcb_xkb_set_controls_request_t
+ **/
+typedef struct xcb_xkb_set_controls_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t affectInternalRealMods; /**< */
+ uint8_t internalRealMods; /**< */
+ uint8_t affectIgnoreLockRealMods; /**< */
+ uint8_t ignoreLockRealMods; /**< */
+ uint16_t affectInternalVirtualMods; /**< */
+ uint16_t internalVirtualMods; /**< */
+ uint16_t affectIgnoreLockVirtualMods; /**< */
+ uint16_t ignoreLockVirtualMods; /**< */
+ uint8_t mouseKeysDfltBtn; /**< */
+ uint8_t groupsWrap; /**< */
+ xcb_xkb_ax_option_t accessXOptions; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t affectEnabledControls; /**< */
+ uint32_t enabledControls; /**< */
+ uint32_t changeControls; /**< */
+ uint16_t repeatDelay; /**< */
+ uint16_t repeatInterval; /**< */
+ uint16_t slowKeysDelay; /**< */
+ uint16_t debounceDelay; /**< */
+ uint16_t mouseKeysDelay; /**< */
+ uint16_t mouseKeysInterval; /**< */
+ uint16_t mouseKeysTimeToMax; /**< */
+ uint16_t mouseKeysMaxSpeed; /**< */
+ int16_t mouseKeysCurve; /**< */
+ uint16_t accessXTimeout; /**< */
+ uint32_t accessXTimeoutMask; /**< */
+ uint32_t accessXTimeoutValues; /**< */
+ xcb_xkb_ax_option_t accessXTimeoutOptionsMask; /**< */
+ xcb_xkb_ax_option_t accessXTimeoutOptionsValues; /**< */
+ uint8_t perKeyRepeat[32]; /**< */
+} xcb_xkb_set_controls_request_t;
+
+/**
+ * @brief xcb_xkb_get_map_cookie_t
+ **/
+typedef struct xcb_xkb_get_map_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_map_cookie_t;
+
+/** Opcode for xcb_xkb_get_map. */
+#define XCB_XKB_GET_MAP 8
+
+/**
+ * @brief xcb_xkb_get_map_request_t
+ **/
+typedef struct xcb_xkb_get_map_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t full; /**< */
+ uint16_t partial; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint8_t nKeySyms; /**< */
+ xcb_keycode_t firstKeyAction; /**< */
+ uint8_t nKeyActions; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehaviors; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_get_map_request_t;
+
+/**
+ * @brief xcb_xkb_get_map_map_t
+ **/
+typedef struct xcb_xkb_get_map_map_t {
+ xcb_xkb_key_type_t *types_rtrn; /**< */
+ xcb_xkb_key_sym_map_t *syms_rtrn; /**< */
+ uint8_t *acts_rtrn_count; /**< */
+ xcb_xkb_action_t *acts_rtrn_acts; /**< */
+ xcb_xkb_set_behavior_t *behaviors_rtrn; /**< */
+ uint8_t *vmods_rtrn; /**< */
+ xcb_xkb_set_explicit_t *explicit_rtrn; /**< */
+ xcb_xkb_key_mod_map_t *modmap_rtrn; /**< */
+ xcb_xkb_key_v_mod_map_t *vmodmap_rtrn; /**< */
+} xcb_xkb_get_map_map_t;
+
+/**
+ * @brief xcb_xkb_get_map_reply_t
+ **/
+typedef struct xcb_xkb_get_map_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_keycode_t minKeyCode; /**< */
+ xcb_keycode_t maxKeyCode; /**< */
+ uint16_t present; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t totalTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint16_t totalSyms; /**< */
+ uint8_t nKeySyms; /**< */
+ xcb_keycode_t firstKeyAction; /**< */
+ uint16_t totalActions; /**< */
+ uint8_t nKeyActions; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehaviors; /**< */
+ uint8_t totalKeyBehaviors; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ uint8_t totalKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ uint8_t totalModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint8_t totalVModMapKeys; /**< */
+ uint8_t pad1; /**< */
+ uint16_t virtualMods; /**< */
+} xcb_xkb_get_map_reply_t;
+
+/**
+ * @brief xcb_xkb_set_map_values_t
+ **/
+typedef struct xcb_xkb_set_map_values_t {
+ xcb_xkb_set_key_type_t *types; /**< */
+ xcb_xkb_key_sym_map_t *syms; /**< */
+ uint8_t *actionsCount; /**< */
+ xcb_xkb_action_t *actions; /**< */
+ xcb_xkb_set_behavior_t *behaviors; /**< */
+ uint8_t *vmods; /**< */
+ xcb_xkb_set_explicit_t *explicit; /**< */
+ xcb_xkb_key_mod_map_t *modmap; /**< */
+ xcb_xkb_key_v_mod_map_t *vmodmap; /**< */
+} xcb_xkb_set_map_values_t;
+
+/** Opcode for xcb_xkb_set_map. */
+#define XCB_XKB_SET_MAP 9
+
+/**
+ * @brief xcb_xkb_set_map_request_t
+ **/
+typedef struct xcb_xkb_set_map_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t present; /**< */
+ uint16_t flags; /**< */
+ xcb_keycode_t minKeyCode; /**< */
+ xcb_keycode_t maxKeyCode; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint8_t nKeySyms; /**< */
+ uint16_t totalSyms; /**< */
+ xcb_keycode_t firstKeyAction; /**< */
+ uint8_t nKeyActions; /**< */
+ uint16_t totalActions; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehaviors; /**< */
+ uint8_t totalKeyBehaviors; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ uint8_t totalKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ uint8_t totalModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint8_t totalVModMapKeys; /**< */
+ uint16_t virtualMods; /**< */
+} xcb_xkb_set_map_request_t;
+
+/**
+ * @brief xcb_xkb_get_compat_map_cookie_t
+ **/
+typedef struct xcb_xkb_get_compat_map_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_compat_map_cookie_t;
+
+/** Opcode for xcb_xkb_get_compat_map. */
+#define XCB_XKB_GET_COMPAT_MAP 10
+
+/**
+ * @brief xcb_xkb_get_compat_map_request_t
+ **/
+typedef struct xcb_xkb_get_compat_map_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t groups; /**< */
+ uint8_t getAllSI; /**< */
+ uint16_t firstSI; /**< */
+ uint16_t nSI; /**< */
+} xcb_xkb_get_compat_map_request_t;
+
+/**
+ * @brief xcb_xkb_get_compat_map_reply_t
+ **/
+typedef struct xcb_xkb_get_compat_map_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint8_t groupsRtrn; /**< */
+ uint8_t pad0; /**< */
+ uint16_t firstSIRtrn; /**< */
+ uint16_t nSIRtrn; /**< */
+ uint16_t nTotalSI; /**< */
+ uint8_t pad1[16]; /**< */
+} xcb_xkb_get_compat_map_reply_t;
+
+/** Opcode for xcb_xkb_set_compat_map. */
+#define XCB_XKB_SET_COMPAT_MAP 11
+
+/**
+ * @brief xcb_xkb_set_compat_map_request_t
+ **/
+typedef struct xcb_xkb_set_compat_map_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0; /**< */
+ uint8_t recomputeActions; /**< */
+ uint8_t truncateSI; /**< */
+ uint8_t groups; /**< */
+ uint16_t firstSI; /**< */
+ uint16_t nSI; /**< */
+ uint8_t pad1[2]; /**< */
+} xcb_xkb_set_compat_map_request_t;
+
+/**
+ * @brief xcb_xkb_get_indicator_state_cookie_t
+ **/
+typedef struct xcb_xkb_get_indicator_state_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_indicator_state_cookie_t;
+
+/** Opcode for xcb_xkb_get_indicator_state. */
+#define XCB_XKB_GET_INDICATOR_STATE 12
+
+/**
+ * @brief xcb_xkb_get_indicator_state_request_t
+ **/
+typedef struct xcb_xkb_get_indicator_state_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_get_indicator_state_request_t;
+
+/**
+ * @brief xcb_xkb_get_indicator_state_reply_t
+ **/
+typedef struct xcb_xkb_get_indicator_state_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t state; /**< */
+ uint8_t pad0[20]; /**< */
+} xcb_xkb_get_indicator_state_reply_t;
+
+/**
+ * @brief xcb_xkb_get_indicator_map_cookie_t
+ **/
+typedef struct xcb_xkb_get_indicator_map_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_indicator_map_cookie_t;
+
+/** Opcode for xcb_xkb_get_indicator_map. */
+#define XCB_XKB_GET_INDICATOR_MAP 13
+
+/**
+ * @brief xcb_xkb_get_indicator_map_request_t
+ **/
+typedef struct xcb_xkb_get_indicator_map_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t which; /**< */
+} xcb_xkb_get_indicator_map_request_t;
+
+/**
+ * @brief xcb_xkb_get_indicator_map_reply_t
+ **/
+typedef struct xcb_xkb_get_indicator_map_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t which; /**< */
+ uint32_t realIndicators; /**< */
+ uint8_t nIndicators; /**< */
+ uint8_t pad0[15]; /**< */
+} xcb_xkb_get_indicator_map_reply_t;
+
+/** Opcode for xcb_xkb_set_indicator_map. */
+#define XCB_XKB_SET_INDICATOR_MAP 14
+
+/**
+ * @brief xcb_xkb_set_indicator_map_request_t
+ **/
+typedef struct xcb_xkb_set_indicator_map_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t which; /**< */
+} xcb_xkb_set_indicator_map_request_t;
+
+/**
+ * @brief xcb_xkb_get_named_indicator_cookie_t
+ **/
+typedef struct xcb_xkb_get_named_indicator_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_named_indicator_cookie_t;
+
+/** Opcode for xcb_xkb_get_named_indicator. */
+#define XCB_XKB_GET_NAMED_INDICATOR 15
+
+/**
+ * @brief xcb_xkb_get_named_indicator_request_t
+ **/
+typedef struct xcb_xkb_get_named_indicator_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ xcb_xkb_led_class_spec_t ledClass; /**< */
+ xcb_xkb_id_spec_t ledID; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_atom_t indicator; /**< */
+} xcb_xkb_get_named_indicator_request_t;
+
+/**
+ * @brief xcb_xkb_get_named_indicator_reply_t
+ **/
+typedef struct xcb_xkb_get_named_indicator_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ xcb_atom_t indicator; /**< */
+ uint8_t found; /**< */
+ uint8_t on; /**< */
+ uint8_t realIndicator; /**< */
+ uint8_t ndx; /**< */
+ uint8_t map_flags; /**< */
+ uint8_t map_whichGroups; /**< */
+ uint8_t map_groups; /**< */
+ uint8_t map_whichMods; /**< */
+ uint8_t map_mods; /**< */
+ uint8_t map_realMods; /**< */
+ uint16_t map_vmod; /**< */
+ uint32_t map_ctrls; /**< */
+ uint8_t pad0[3]; /**< */
+} xcb_xkb_get_named_indicator_reply_t;
+
+/** Opcode for xcb_xkb_set_named_indicator. */
+#define XCB_XKB_SET_NAMED_INDICATOR 16
+
+/**
+ * @brief xcb_xkb_set_named_indicator_request_t
+ **/
+typedef struct xcb_xkb_set_named_indicator_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ xcb_xkb_led_class_spec_t ledClass; /**< */
+ xcb_xkb_id_spec_t ledID; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_atom_t indicator; /**< */
+ uint8_t setState; /**< */
+ uint8_t on; /**< */
+ uint8_t setMap; /**< */
+ uint8_t createMap; /**< */
+ uint8_t pad1; /**< */
+ uint8_t map_flags; /**< */
+ uint8_t map_whichGroups; /**< */
+ uint8_t map_groups; /**< */
+ uint8_t map_whichMods; /**< */
+ uint8_t map_realMods; /**< */
+ uint16_t map_vmods; /**< */
+ uint32_t map_ctrls; /**< */
+} xcb_xkb_set_named_indicator_request_t;
+
+/**
+ * @brief xcb_xkb_get_names_cookie_t
+ **/
+typedef struct xcb_xkb_get_names_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_names_cookie_t;
+
+/** Opcode for xcb_xkb_get_names. */
+#define XCB_XKB_GET_NAMES 17
+
+/**
+ * @brief xcb_xkb_get_names_request_t
+ **/
+typedef struct xcb_xkb_get_names_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t which; /**< */
+} xcb_xkb_get_names_request_t;
+
+/**
+ * @brief xcb_xkb_get_names_value_list_t
+ **/
+typedef struct xcb_xkb_get_names_value_list_t {
+ xcb_atom_t keycodesName; /**< */
+ xcb_atom_t geometryName; /**< */
+ xcb_atom_t symbolsName; /**< */
+ xcb_atom_t physSymbolsName; /**< */
+ xcb_atom_t typesName; /**< */
+ xcb_atom_t compatName; /**< */
+ xcb_atom_t *typeNames; /**< */
+ uint8_t *nLevelsPerType; /**< */
+ xcb_atom_t *ktLevelNames; /**< */
+ xcb_atom_t *indicatorNames; /**< */
+ xcb_atom_t *virtualModNames; /**< */
+ xcb_atom_t *groups; /**< */
+ xcb_xkb_key_name_t *keyNames; /**< */
+ xcb_xkb_key_alias_t *keyAliases; /**< */
+ xcb_atom_t *radioGroupNames; /**< */
+} xcb_xkb_get_names_value_list_t;
+
+/**
+ * @brief xcb_xkb_get_names_reply_t
+ **/
+typedef struct xcb_xkb_get_names_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t which; /**< */
+ xcb_keycode_t minKeyCode; /**< */
+ xcb_keycode_t maxKeyCode; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t groupNames; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_keycode_t firstKey; /**< */
+ uint8_t nKeys; /**< */
+ uint32_t indicators; /**< */
+ uint8_t nRadioGroups; /**< */
+ uint8_t nKeyAliases; /**< */
+ uint16_t nKTLevels; /**< */
+ uint8_t pad0[4]; /**< */
+} xcb_xkb_get_names_reply_t;
+
+/**
+ * @brief xcb_xkb_set_names_values_t
+ **/
+typedef struct xcb_xkb_set_names_values_t {
+ xcb_atom_t keycodesName; /**< */
+ xcb_atom_t geometryName; /**< */
+ xcb_atom_t symbolsName; /**< */
+ xcb_atom_t physSymbolsName; /**< */
+ xcb_atom_t typesName; /**< */
+ xcb_atom_t compatName; /**< */
+ xcb_atom_t *typeNames; /**< */
+ uint8_t *nLevelsPerType; /**< */
+ xcb_atom_t *ktLevelNames; /**< */
+ xcb_atom_t *indicatorNames; /**< */
+ xcb_atom_t *virtualModNames; /**< */
+ xcb_atom_t *groups; /**< */
+ xcb_xkb_key_name_t *keyNames; /**< */
+ xcb_xkb_key_alias_t *keyAliases; /**< */
+ xcb_atom_t *radioGroupNames; /**< */
+} xcb_xkb_set_names_values_t;
+
+/** Opcode for xcb_xkb_set_names. */
+#define XCB_XKB_SET_NAMES 18
+
+/**
+ * @brief xcb_xkb_set_names_request_t
+ **/
+typedef struct xcb_xkb_set_names_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t virtualMods; /**< */
+ uint32_t which; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t firstKTLevelt; /**< */
+ uint8_t nKTLevels; /**< */
+ uint32_t indicators; /**< */
+ uint8_t groupNames; /**< */
+ uint8_t nRadioGroups; /**< */
+ xcb_keycode_t firstKey; /**< */
+ uint8_t nKeys; /**< */
+ uint8_t nKeyAliases; /**< */
+ uint8_t pad0; /**< */
+ uint16_t totalKTLevelNames; /**< */
+} xcb_xkb_set_names_request_t;
+
+/**
+ * @brief xcb_xkb_get_geometry_cookie_t
+ **/
+typedef struct xcb_xkb_get_geometry_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_geometry_cookie_t;
+
+/** Opcode for xcb_xkb_get_geometry. */
+#define XCB_XKB_GET_GEOMETRY 19
+
+/**
+ * @brief xcb_xkb_get_geometry_request_t
+ **/
+typedef struct xcb_xkb_get_geometry_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_atom_t name; /**< */
+} xcb_xkb_get_geometry_request_t;
+
+/**
+ * @brief xcb_xkb_get_geometry_reply_t
+ **/
+typedef struct xcb_xkb_get_geometry_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ xcb_atom_t name; /**< */
+ uint8_t found; /**< */
+ uint8_t pad0; /**< */
+ uint16_t widthMM; /**< */
+ uint16_t heightMM; /**< */
+ uint16_t nProperties; /**< */
+ uint16_t nColors; /**< */
+ uint16_t nShapes; /**< */
+ uint16_t nSections; /**< */
+ uint16_t nDoodads; /**< */
+ uint16_t nKeyAliases; /**< */
+ uint8_t baseColorNdx; /**< */
+ uint8_t labelColorNdx; /**< */
+} xcb_xkb_get_geometry_reply_t;
+
+/** Opcode for xcb_xkb_set_geometry. */
+#define XCB_XKB_SET_GEOMETRY 20
+
+/**
+ * @brief xcb_xkb_set_geometry_request_t
+ **/
+typedef struct xcb_xkb_set_geometry_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t nShapes; /**< */
+ uint8_t nSections; /**< */
+ xcb_atom_t name; /**< */
+ uint16_t widthMM; /**< */
+ uint16_t heightMM; /**< */
+ uint16_t nProperties; /**< */
+ uint16_t nColors; /**< */
+ uint16_t nDoodads; /**< */
+ uint16_t nKeyAliases; /**< */
+ uint8_t baseColorNdx; /**< */
+ uint8_t labelColorNdx; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_set_geometry_request_t;
+
+/**
+ * @brief xcb_xkb_per_client_flags_cookie_t
+ **/
+typedef struct xcb_xkb_per_client_flags_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_per_client_flags_cookie_t;
+
+/** Opcode for xcb_xkb_per_client_flags. */
+#define XCB_XKB_PER_CLIENT_FLAGS 21
+
+/**
+ * @brief xcb_xkb_per_client_flags_request_t
+ **/
+typedef struct xcb_xkb_per_client_flags_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t change; /**< */
+ uint32_t value; /**< */
+ uint32_t ctrlsToChange; /**< */
+ uint32_t autoCtrls; /**< */
+ uint32_t autoCtrlsValues; /**< */
+} xcb_xkb_per_client_flags_request_t;
+
+/**
+ * @brief xcb_xkb_per_client_flags_reply_t
+ **/
+typedef struct xcb_xkb_per_client_flags_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t supported; /**< */
+ uint32_t value; /**< */
+ uint32_t autoCtrls; /**< */
+ uint32_t autoCtrlsValues; /**< */
+ uint8_t pad0[8]; /**< */
+} xcb_xkb_per_client_flags_reply_t;
+
+/**
+ * @brief xcb_xkb_list_components_cookie_t
+ **/
+typedef struct xcb_xkb_list_components_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_list_components_cookie_t;
+
+/** Opcode for xcb_xkb_list_components. */
+#define XCB_XKB_LIST_COMPONENTS 22
+
+/**
+ * @brief xcb_xkb_list_components_request_t
+ **/
+typedef struct xcb_xkb_list_components_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t maxNames; /**< */
+ uint8_t keymapsSpecLen; /**< */
+ uint8_t keycodesSpecLen; /**< */
+ uint8_t typesSpecLen; /**< */
+ uint8_t compatMapSpecLen; /**< */
+ uint8_t symbolsSpecLen; /**< */
+ uint8_t geometrySpecLen; /**< */
+} xcb_xkb_list_components_request_t;
+
+/**
+ * @brief xcb_xkb_list_components_reply_t
+ **/
+typedef struct xcb_xkb_list_components_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint16_t nKeymaps; /**< */
+ uint16_t nKeycodes; /**< */
+ uint16_t nTypes; /**< */
+ uint16_t nCompatMaps; /**< */
+ uint16_t nSymbols; /**< */
+ uint16_t nGeometries; /**< */
+ uint16_t extra; /**< */
+ uint8_t pad0[10]; /**< */
+} xcb_xkb_list_components_reply_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_cookie_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_kbd_by_name_cookie_t;
+
+/** Opcode for xcb_xkb_get_kbd_by_name. */
+#define XCB_XKB_GET_KBD_BY_NAME 23
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_request_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t need; /**< */
+ uint16_t want; /**< */
+ uint8_t load; /**< */
+ uint8_t pad0; /**< */
+ uint8_t keymapsSpecLen; /**< */
+ uint8_t keycodesSpecLen; /**< */
+ uint8_t typesSpecLen; /**< */
+ uint8_t compatMapSpecLen; /**< */
+ uint8_t symbolsSpecLen; /**< */
+ uint8_t geometrySpecLen; /**< */
+} xcb_xkb_get_kbd_by_name_request_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_replies_types_map_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_replies_types_map_t {
+ xcb_xkb_key_type_t *types_rtrn; /**< */
+ xcb_xkb_key_sym_map_t *syms_rtrn; /**< */
+ uint8_t *acts_rtrn_count; /**< */
+ xcb_xkb_action_t *acts_rtrn_acts; /**< */
+ xcb_xkb_set_behavior_t *behaviors_rtrn; /**< */
+ uint8_t *vmods_rtrn; /**< */
+ xcb_xkb_set_explicit_t *explicit_rtrn; /**< */
+ xcb_xkb_key_mod_map_t *modmap_rtrn; /**< */
+ xcb_xkb_key_v_mod_map_t *vmodmap_rtrn; /**< */
+} xcb_xkb_get_kbd_by_name_replies_types_map_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_replies_client_symbols_map_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_replies_client_symbols_map_t {
+ xcb_xkb_key_type_t *types_rtrn; /**< */
+ xcb_xkb_key_sym_map_t *syms_rtrn; /**< */
+ uint8_t *acts_rtrn_count; /**< */
+ xcb_xkb_action_t *acts_rtrn_acts; /**< */
+ xcb_xkb_set_behavior_t *behaviors_rtrn; /**< */
+ uint8_t *vmods_rtrn; /**< */
+ xcb_xkb_set_explicit_t *explicit_rtrn; /**< */
+ xcb_xkb_key_mod_map_t *modmap_rtrn; /**< */
+ xcb_xkb_key_v_mod_map_t *vmodmap_rtrn; /**< */
+} xcb_xkb_get_kbd_by_name_replies_client_symbols_map_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_replies_server_symbols_map_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_replies_server_symbols_map_t {
+ xcb_xkb_key_type_t *types_rtrn; /**< */
+ xcb_xkb_key_sym_map_t *syms_rtrn; /**< */
+ uint8_t *acts_rtrn_count; /**< */
+ xcb_xkb_action_t *acts_rtrn_acts; /**< */
+ xcb_xkb_set_behavior_t *behaviors_rtrn; /**< */
+ uint8_t *vmods_rtrn; /**< */
+ xcb_xkb_set_explicit_t *explicit_rtrn; /**< */
+ xcb_xkb_key_mod_map_t *modmap_rtrn; /**< */
+ xcb_xkb_key_v_mod_map_t *vmodmap_rtrn; /**< */
+} xcb_xkb_get_kbd_by_name_replies_server_symbols_map_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t {
+ xcb_atom_t keycodesName; /**< */
+ xcb_atom_t geometryName; /**< */
+ xcb_atom_t symbolsName; /**< */
+ xcb_atom_t physSymbolsName; /**< */
+ xcb_atom_t typesName; /**< */
+ xcb_atom_t compatName; /**< */
+ xcb_atom_t *typeNames; /**< */
+ uint8_t *nLevelsPerType; /**< */
+ xcb_atom_t *ktLevelNames; /**< */
+ xcb_atom_t *indicatorNames; /**< */
+ xcb_atom_t *virtualModNames; /**< */
+ xcb_atom_t *groups; /**< */
+ xcb_xkb_key_name_t *keyNames; /**< */
+ xcb_xkb_key_alias_t *keyAliases; /**< */
+ xcb_atom_t *radioGroupNames; /**< */
+} xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_replies_other_names_value_list_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_replies_other_names_value_list_t {
+ xcb_atom_t keycodesName; /**< */
+ xcb_atom_t geometryName; /**< */
+ xcb_atom_t symbolsName; /**< */
+ xcb_atom_t physSymbolsName; /**< */
+ xcb_atom_t typesName; /**< */
+ xcb_atom_t compatName; /**< */
+ xcb_atom_t *typeNames; /**< */
+ uint8_t *nLevelsPerType; /**< */
+ xcb_atom_t *ktLevelNames; /**< */
+ xcb_atom_t *indicatorNames; /**< */
+ xcb_atom_t *virtualModNames; /**< */
+ xcb_atom_t *groups; /**< */
+ xcb_xkb_key_name_t *keyNames; /**< */
+ xcb_xkb_key_alias_t *keyAliases; /**< */
+ xcb_atom_t *radioGroupNames; /**< */
+} xcb_xkb_get_kbd_by_name_replies_other_names_value_list_t;
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_replies_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_replies_t {
+ struct _types {
+ uint8_t getmap_type; /**< */
+ uint8_t typeDeviceID; /**< */
+ uint16_t getmap_sequence; /**< */
+ uint32_t getmap_length; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_keycode_t typeMinKeyCode; /**< */
+ xcb_keycode_t typeMaxKeyCode; /**< */
+ uint16_t present; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t totalTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint16_t totalSyms; /**< */
+ uint8_t nKeySyms; /**< */
+ xcb_keycode_t firstKeyAction; /**< */
+ uint16_t totalActions; /**< */
+ uint8_t nKeyActions; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehaviors; /**< */
+ uint8_t totalKeyBehaviors; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ uint8_t totalKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ uint8_t totalModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint8_t totalVModMapKeys; /**< */
+ uint8_t pad1; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_xkb_get_kbd_by_name_replies_types_map_t map; /**< */
+ } types;
+ struct _compat_map {
+ uint8_t compatDeviceID; /**< */
+ uint8_t groupsRtrn; /**< */
+ uint8_t pad0; /**< */
+ uint16_t firstSIRtrn; /**< */
+ uint16_t nSIRtrn; /**< */
+ uint16_t nTotalSI; /**< */
+ uint8_t pad1[16]; /**< */
+ uint8_t *si_rtrn; /**< */
+ xcb_xkb_mod_def_t *group_rtrn; /**< */
+ } compat_map;
+ struct _client_symbols {
+ uint8_t clientDeviceID; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_keycode_t clientMinKeyCode; /**< */
+ xcb_keycode_t clientMaxKeyCode; /**< */
+ uint16_t present; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t totalTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint16_t totalSyms; /**< */
+ uint8_t nKeySyms; /**< */
+ xcb_keycode_t firstKeyAction; /**< */
+ uint16_t totalActions; /**< */
+ uint8_t nKeyActions; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehaviors; /**< */
+ uint8_t totalKeyBehaviors; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ uint8_t totalKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ uint8_t totalModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint8_t totalVModMapKeys; /**< */
+ uint8_t pad1; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_xkb_get_kbd_by_name_replies_client_symbols_map_t map; /**< */
+ } client_symbols;
+ struct _server_symbols {
+ uint8_t serverDeviceID; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_keycode_t serverMinKeyCode; /**< */
+ xcb_keycode_t serverMaxKeyCode; /**< */
+ uint16_t present; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t totalTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint16_t totalSyms; /**< */
+ uint8_t nKeySyms; /**< */
+ xcb_keycode_t firstKeyAction; /**< */
+ uint16_t totalActions; /**< */
+ uint8_t nKeyActions; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehaviors; /**< */
+ uint8_t totalKeyBehaviors; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ uint8_t totalKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ uint8_t totalModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint8_t totalVModMapKeys; /**< */
+ uint8_t pad1; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_xkb_get_kbd_by_name_replies_server_symbols_map_t map; /**< */
+ } server_symbols;
+ struct _indicator_maps {
+ uint8_t indicatorDeviceID; /**< */
+ uint32_t which; /**< */
+ uint32_t realIndicators; /**< */
+ uint8_t nIndicators; /**< */
+ uint8_t pad0[15]; /**< */
+ xcb_xkb_indicator_map_t *maps; /**< */
+ } indicator_maps;
+ struct _key_names {
+ uint8_t keyDeviceID; /**< */
+ uint32_t which; /**< */
+ xcb_keycode_t keyMinKeyCode; /**< */
+ xcb_keycode_t keyMaxKeyCode; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t groupNames; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_keycode_t firstKey; /**< */
+ uint8_t nKeys; /**< */
+ uint32_t indicators; /**< */
+ uint8_t nRadioGroups; /**< */
+ uint8_t nKeyAliases; /**< */
+ uint16_t nKTLevels; /**< */
+ uint8_t pad0[4]; /**< */
+ xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t valueList; /**< */
+ } key_names;
+ struct _other_names {
+ uint8_t otherDeviceID; /**< */
+ uint32_t which; /**< */
+ xcb_keycode_t otherMinKeyCode; /**< */
+ xcb_keycode_t otherMaxKeyCode; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t groupNames; /**< */
+ uint16_t virtualMods; /**< */
+ xcb_keycode_t firstKey; /**< */
+ uint8_t nKeys; /**< */
+ uint32_t indicators; /**< */
+ uint8_t nRadioGroups; /**< */
+ uint8_t nKeyAliases; /**< */
+ uint16_t nKTLevels; /**< */
+ uint8_t pad0[4]; /**< */
+ xcb_xkb_get_kbd_by_name_replies_other_names_value_list_t valueList; /**< */
+ } other_names;
+ struct _geometry {
+ uint8_t geometryDeviceID; /**< */
+ xcb_atom_t name; /**< */
+ uint8_t geometryFound; /**< */
+ uint8_t pad0; /**< */
+ uint16_t widthMM; /**< */
+ uint16_t heightMM; /**< */
+ uint16_t nProperties; /**< */
+ uint16_t nColors; /**< */
+ uint16_t nShapes; /**< */
+ uint16_t nSections; /**< */
+ uint16_t nDoodads; /**< */
+ uint16_t nKeyAliases; /**< */
+ uint8_t baseColorNdx; /**< */
+ uint8_t labelColorNdx; /**< */
+ xcb_xkb_counted_string_16_t *labelFont; /**< */
+ xcb_xkb_property_t *properties; /**< */
+ xcb_xkb_counted_string_16_t *colors; /**< */
+ xcb_xkb_shape_t *shapes; /**< */
+ xcb_xkb_section_t *sections; /**< */
+ xcb_xkb_doodad_t *doodads; /**< */
+ xcb_xkb_key_alias_t *keyAliases; /**< */
+ } geometry;
+} xcb_xkb_get_kbd_by_name_replies_t;
+
+
+/*****************************************************************************
+ **
+ ** xcb_xkb_get_kbd_by_name_replies_types_map_t * xcb_xkb_get_kbd_by_name_replies_types_map
+ **
+ ** @param const xcb_xkb_get_kbd_by_name_replies_t *R
+ ** @returns xcb_xkb_get_kbd_by_name_replies_types_map_t *
+ **
+ *****************************************************************************/
+
+xcb_xkb_get_kbd_by_name_replies_types_map_t *
+xcb_xkb_get_kbd_by_name_replies_types_map (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */);
+
+/**
+ * @brief xcb_xkb_get_kbd_by_name_reply_t
+ **/
+typedef struct xcb_xkb_get_kbd_by_name_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ xcb_keycode_t minKeyCode; /**< */
+ xcb_keycode_t maxKeyCode; /**< */
+ uint8_t loaded; /**< */
+ uint8_t newKeyboard; /**< */
+ uint16_t found; /**< */
+ uint16_t reported; /**< */
+ uint8_t pad0[16]; /**< */
+} xcb_xkb_get_kbd_by_name_reply_t;
+
+/**
+ * @brief xcb_xkb_get_device_info_cookie_t
+ **/
+typedef struct xcb_xkb_get_device_info_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_get_device_info_cookie_t;
+
+/** Opcode for xcb_xkb_get_device_info. */
+#define XCB_XKB_GET_DEVICE_INFO 24
+
+/**
+ * @brief xcb_xkb_get_device_info_request_t
+ **/
+typedef struct xcb_xkb_get_device_info_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint16_t wanted; /**< */
+ uint8_t allButtons; /**< */
+ uint8_t firstButton; /**< */
+ uint8_t nButtons; /**< */
+ uint8_t pad0; /**< */
+ xcb_xkb_led_class_spec_t ledClass; /**< */
+ xcb_xkb_id_spec_t ledID; /**< */
+} xcb_xkb_get_device_info_request_t;
+
+/**
+ * @brief xcb_xkb_get_device_info_reply_t
+ **/
+typedef struct xcb_xkb_get_device_info_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t deviceID; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint16_t present; /**< */
+ uint16_t supported; /**< */
+ uint16_t unsupported; /**< */
+ uint16_t nDeviceLedFBs; /**< */
+ uint8_t firstBtnWanted; /**< */
+ uint8_t nBtnsWanted; /**< */
+ uint8_t firstBtnRtrn; /**< */
+ uint8_t nBtnsRtrn; /**< */
+ uint8_t totalBtns; /**< */
+ uint8_t hasOwnState; /**< */
+ uint16_t dfltKbdFB; /**< */
+ uint16_t dfltLedFB; /**< */
+ uint8_t pad0[2]; /**< */
+ xcb_atom_t devType; /**< */
+ uint16_t nameLen; /**< */
+} xcb_xkb_get_device_info_reply_t;
+
+/** Opcode for xcb_xkb_set_device_info. */
+#define XCB_XKB_SET_DEVICE_INFO 25
+
+/**
+ * @brief xcb_xkb_set_device_info_request_t
+ **/
+typedef struct xcb_xkb_set_device_info_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ xcb_xkb_device_spec_t deviceSpec; /**< */
+ uint8_t firstBtn; /**< */
+ uint8_t nBtns; /**< */
+ uint16_t change; /**< */
+ uint16_t nDeviceLedFBs; /**< */
+} xcb_xkb_set_device_info_request_t;
+
+/**
+ * @brief xcb_xkb_set_debugging_flags_cookie_t
+ **/
+typedef struct xcb_xkb_set_debugging_flags_cookie_t {
+ unsigned int sequence; /**< */
+} xcb_xkb_set_debugging_flags_cookie_t;
+
+/** Opcode for xcb_xkb_set_debugging_flags. */
+#define XCB_XKB_SET_DEBUGGING_FLAGS 101
+
+/**
+ * @brief xcb_xkb_set_debugging_flags_request_t
+ **/
+typedef struct xcb_xkb_set_debugging_flags_request_t {
+ uint8_t major_opcode; /**< */
+ uint8_t minor_opcode; /**< */
+ uint16_t length; /**< */
+ uint16_t msgLength; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t affectFlags; /**< */
+ uint32_t flags; /**< */
+ uint32_t affectCtrls; /**< */
+ uint32_t ctrls; /**< */
+} xcb_xkb_set_debugging_flags_request_t;
+
+/**
+ * @brief xcb_xkb_set_debugging_flags_reply_t
+ **/
+typedef struct xcb_xkb_set_debugging_flags_reply_t {
+ uint8_t response_type; /**< */
+ uint8_t pad0; /**< */
+ uint16_t sequence; /**< */
+ uint32_t length; /**< */
+ uint32_t currentFlags; /**< */
+ uint32_t currentCtrls; /**< */
+ uint32_t supportedFlags; /**< */
+ uint32_t supportedCtrls; /**< */
+ uint8_t pad1[8]; /**< */
+} xcb_xkb_set_debugging_flags_reply_t;
+
+/** Opcode for xcb_xkb_new_keyboard_notify. */
+#define XCB_XKB_NEW_KEYBOARD_NOTIFY 0
+
+/**
+ * @brief xcb_xkb_new_keyboard_notify_event_t
+ **/
+typedef struct xcb_xkb_new_keyboard_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t oldDeviceID; /**< */
+ xcb_keycode_t minKeyCode; /**< */
+ xcb_keycode_t maxKeyCode; /**< */
+ xcb_keycode_t oldMinKeyCode; /**< */
+ xcb_keycode_t oldMaxKeyCode; /**< */
+ uint8_t requestMajor; /**< */
+ uint8_t requestMinor; /**< */
+ uint16_t changed; /**< */
+ uint8_t pad0[14]; /**< */
+} xcb_xkb_new_keyboard_notify_event_t;
+
+/** Opcode for xcb_xkb_map_notify. */
+#define XCB_XKB_MAP_NOTIFY 1
+
+/**
+ * @brief xcb_xkb_map_notify_event_t
+ **/
+typedef struct xcb_xkb_map_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t ptrBtnActions; /**< */
+ uint16_t changed; /**< */
+ xcb_keycode_t minKeyCode; /**< */
+ xcb_keycode_t maxKeyCode; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ xcb_keycode_t firstKeySym; /**< */
+ uint8_t nKeySyms; /**< */
+ xcb_keycode_t firstKeyAct; /**< */
+ uint8_t nKeyActs; /**< */
+ xcb_keycode_t firstKeyBehavior; /**< */
+ uint8_t nKeyBehavior; /**< */
+ xcb_keycode_t firstKeyExplicit; /**< */
+ uint8_t nKeyExplicit; /**< */
+ xcb_keycode_t firstModMapKey; /**< */
+ uint8_t nModMapKeys; /**< */
+ xcb_keycode_t firstVModMapKey; /**< */
+ uint8_t nVModMapKeys; /**< */
+ uint16_t virtualMods; /**< */
+ uint8_t pad0[2]; /**< */
+} xcb_xkb_map_notify_event_t;
+
+/** Opcode for xcb_xkb_state_notify. */
+#define XCB_XKB_STATE_NOTIFY 2
+
+/**
+ * @brief xcb_xkb_state_notify_event_t
+ **/
+typedef struct xcb_xkb_state_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t mods; /**< */
+ uint8_t baseMods; /**< */
+ uint8_t latchedMods; /**< */
+ uint8_t lockedMods; /**< */
+ uint8_t group; /**< */
+ int16_t baseGroup; /**< */
+ int16_t latchedGroup; /**< */
+ uint8_t lockedGroup; /**< */
+ uint8_t compatState; /**< */
+ uint8_t grabMods; /**< */
+ uint8_t compatGrabMods; /**< */
+ uint8_t lookupMods; /**< */
+ uint8_t compatLoockupMods; /**< */
+ uint16_t ptrBtnState; /**< */
+ uint16_t changed; /**< */
+ xcb_keycode_t keycode; /**< */
+ uint8_t eventType; /**< */
+ uint8_t requestMajor; /**< */
+ uint8_t requestMinor; /**< */
+} xcb_xkb_state_notify_event_t;
+
+/** Opcode for xcb_xkb_controls_notify. */
+#define XCB_XKB_CONTROLS_NOTIFY 3
+
+/**
+ * @brief xcb_xkb_controls_notify_event_t
+ **/
+typedef struct xcb_xkb_controls_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t numGroups; /**< */
+ uint8_t pad0[2]; /**< */
+ uint32_t changedControls; /**< */
+ uint32_t enabledControls; /**< */
+ uint32_t enabledControlChanges; /**< */
+ xcb_keycode_t keycode; /**< */
+ uint8_t eventType; /**< */
+ uint8_t requestMajor; /**< */
+ uint8_t requestMinor; /**< */
+ uint8_t pad1[4]; /**< */
+} xcb_xkb_controls_notify_event_t;
+
+/** Opcode for xcb_xkb_indicator_state_notify. */
+#define XCB_XKB_INDICATOR_STATE_NOTIFY 4
+
+/**
+ * @brief xcb_xkb_indicator_state_notify_event_t
+ **/
+typedef struct xcb_xkb_indicator_state_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t pad0[3]; /**< */
+ uint32_t state; /**< */
+ uint32_t stateChanged; /**< */
+ uint8_t pad1[12]; /**< */
+} xcb_xkb_indicator_state_notify_event_t;
+
+/** Opcode for xcb_xkb_indicator_map_notify. */
+#define XCB_XKB_INDICATOR_MAP_NOTIFY 5
+
+/**
+ * @brief xcb_xkb_indicator_map_notify_event_t
+ **/
+typedef struct xcb_xkb_indicator_map_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t pad0[3]; /**< */
+ uint32_t state; /**< */
+ uint32_t mapChanged; /**< */
+ uint8_t pad1[12]; /**< */
+} xcb_xkb_indicator_map_notify_event_t;
+
+/** Opcode for xcb_xkb_names_notify. */
+#define XCB_XKB_NAMES_NOTIFY 6
+
+/**
+ * @brief xcb_xkb_names_notify_event_t
+ **/
+typedef struct xcb_xkb_names_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t pad0; /**< */
+ uint16_t changed; /**< */
+ uint8_t firstType; /**< */
+ uint8_t nTypes; /**< */
+ uint8_t firstLevelName; /**< */
+ uint8_t nLevelNames; /**< */
+ uint8_t pad1; /**< */
+ uint8_t nRadioGroups; /**< */
+ uint8_t nKeyAliases; /**< */
+ uint8_t changedGroupNames; /**< */
+ uint16_t changedVirtualMods; /**< */
+ xcb_keycode_t firstKey; /**< */
+ uint8_t nKeys; /**< */
+ uint32_t changedIndicators; /**< */
+ uint8_t pad2[4]; /**< */
+} xcb_xkb_names_notify_event_t;
+
+/** Opcode for xcb_xkb_compat_map_notify. */
+#define XCB_XKB_COMPAT_MAP_NOTIFY 7
+
+/**
+ * @brief xcb_xkb_compat_map_notify_event_t
+ **/
+typedef struct xcb_xkb_compat_map_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t changedGroups; /**< */
+ uint16_t firstSI; /**< */
+ uint16_t nSI; /**< */
+ uint16_t nTotalSI; /**< */
+ uint8_t pad0[16]; /**< */
+} xcb_xkb_compat_map_notify_event_t;
+
+/** Opcode for xcb_xkb_bell_notify. */
+#define XCB_XKB_BELL_NOTIFY 8
+
+/**
+ * @brief xcb_xkb_bell_notify_event_t
+ **/
+typedef struct xcb_xkb_bell_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t bellClass; /**< */
+ uint8_t bellID; /**< */
+ uint8_t percent; /**< */
+ uint16_t pitch; /**< */
+ uint16_t duration; /**< */
+ xcb_atom_t name; /**< */
+ xcb_window_t window; /**< */
+ uint8_t eventOnly; /**< */
+ uint8_t pad0[7]; /**< */
+} xcb_xkb_bell_notify_event_t;
+
+/** Opcode for xcb_xkb_action_message. */
+#define XCB_XKB_ACTION_MESSAGE 9
+
+/**
+ * @brief xcb_xkb_action_message_event_t
+ **/
+typedef struct xcb_xkb_action_message_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ xcb_keycode_t keycode; /**< */
+ uint8_t press; /**< */
+ uint8_t keyEventFollows; /**< */
+ uint8_t mods; /**< */
+ uint8_t group; /**< */
+ xcb_xkb_string8_t message[8]; /**< */
+ uint8_t pad0[10]; /**< */
+} xcb_xkb_action_message_event_t;
+
+/** Opcode for xcb_xkb_access_x_notify. */
+#define XCB_XKB_ACCESS_X_NOTIFY 10
+
+/**
+ * @brief xcb_xkb_access_x_notify_event_t
+ **/
+typedef struct xcb_xkb_access_x_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ xcb_keycode_t keycode; /**< */
+ uint16_t detailt; /**< */
+ uint16_t slowKeysDelay; /**< */
+ uint16_t debounceDelay; /**< */
+ uint8_t pad0[16]; /**< */
+} xcb_xkb_access_x_notify_event_t;
+
+/** Opcode for xcb_xkb_extension_device_notify. */
+#define XCB_XKB_EXTENSION_DEVICE_NOTIFY 11
+
+/**
+ * @brief xcb_xkb_extension_device_notify_event_t
+ **/
+typedef struct xcb_xkb_extension_device_notify_event_t {
+ uint8_t response_type; /**< */
+ uint8_t xkbType; /**< */
+ uint16_t sequence; /**< */
+ xcb_timestamp_t time; /**< */
+ uint8_t deviceID; /**< */
+ uint8_t pad0; /**< */
+ uint16_t reason; /**< */
+ uint16_t ledClass; /**< */
+ uint8_t ledID; /**< */
+ uint32_t ledsDefined; /**< */
+ uint32_t ledState; /**< */
+ uint8_t firstButton; /**< */
+ uint8_t nButtons; /**< */
+ uint16_t supported; /**< */
+ uint16_t unsupported; /**< */
+ uint8_t pad1[2]; /**< */
+} xcb_xkb_extension_device_notify_event_t;
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_ax_option_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_ax_option_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_ax_option_next
+ **
+ ** @param xcb_xkb_ax_option_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_ax_option_next (xcb_xkb_ax_option_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_ax_option_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_ax_option_end
+ **
+ ** @param xcb_xkb_ax_option_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_ax_option_end (xcb_xkb_ax_option_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_device_spec_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_device_spec_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_device_spec_next
+ **
+ ** @param xcb_xkb_device_spec_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_device_spec_next (xcb_xkb_device_spec_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_device_spec_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_device_spec_end
+ **
+ ** @param xcb_xkb_device_spec_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_device_spec_end (xcb_xkb_device_spec_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_led_class_spec_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_led_class_spec_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_led_class_spec_next
+ **
+ ** @param xcb_xkb_led_class_spec_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_led_class_spec_next (xcb_xkb_led_class_spec_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_led_class_spec_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_led_class_spec_end
+ **
+ ** @param xcb_xkb_led_class_spec_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_led_class_spec_end (xcb_xkb_led_class_spec_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_bell_class_spec_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_bell_class_spec_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_bell_class_spec_next
+ **
+ ** @param xcb_xkb_bell_class_spec_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_bell_class_spec_next (xcb_xkb_bell_class_spec_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_bell_class_spec_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_bell_class_spec_end
+ **
+ ** @param xcb_xkb_bell_class_spec_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_bell_class_spec_end (xcb_xkb_bell_class_spec_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_id_spec_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_id_spec_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_id_spec_next
+ **
+ ** @param xcb_xkb_id_spec_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_id_spec_next (xcb_xkb_id_spec_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_id_spec_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_id_spec_end
+ **
+ ** @param xcb_xkb_id_spec_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_id_spec_end (xcb_xkb_id_spec_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_indicator_map_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_indicator_map_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_indicator_map_next
+ **
+ ** @param xcb_xkb_indicator_map_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_indicator_map_next (xcb_xkb_indicator_map_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_indicator_map_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_indicator_map_end
+ **
+ ** @param xcb_xkb_indicator_map_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_indicator_map_end (xcb_xkb_indicator_map_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_mod_def_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_mod_def_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_mod_def_next
+ **
+ ** @param xcb_xkb_mod_def_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_mod_def_next (xcb_xkb_mod_def_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_mod_def_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_mod_def_end
+ **
+ ** @param xcb_xkb_mod_def_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_mod_def_end (xcb_xkb_mod_def_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_key_name_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_key_name_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_key_name_next
+ **
+ ** @param xcb_xkb_key_name_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_key_name_next (xcb_xkb_key_name_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_key_name_iterator_t
+ * @return The iterator pointing to the last element
+ *
+ * Set the current element in the iterator to the last element.
+ * The member rem is set to 0. The member data points to the
+ * last element.
+ */
+
+/*****************************************************************************
+ **
+ ** xcb_generic_iterator_t xcb_xkb_key_name_end
+ **
+ ** @param xcb_xkb_key_name_iterator_t i
+ ** @returns xcb_generic_iterator_t
+ **
+ *****************************************************************************/
+
+xcb_generic_iterator_t
+xcb_xkb_key_name_end (xcb_xkb_key_name_iterator_t i /**< */);
+
+/**
+ * Get the next element of the iterator
+ * @param i Pointer to a xcb_xkb_key_alias_iterator_t
+ *
+ * Get the next element in the iterator. The member rem is
+ * decreased by one. The member data points to the next
+ * element. The member index is increased by sizeof(xcb_xkb_key_alias_t)
+ */
+
+/*****************************************************************************
+ **
+ ** void xcb_xkb_key_alias_next
+ **
+ ** @param xcb_xkb_key_alias_iterator_t *i
+ ** @returns void
+ **
+ *****************************************************************************/
+
+void
+xcb_xkb_key_alias_next (xcb_xkb_key_alias_iterator_t *i /**< */);
+
+/**
+ * Return the iterator pointing to the last element
+ * @param i An xcb_xkb_key_alias_iterator_t
+