From: Carsten Schoenert Date: Wed, 8 Sep 2021 17:57:22 +0000 (+0100) Subject: Import thunderbird_78.14.0-1.debian.tar.xz X-Git-Tag: archive/raspbian/1%78.14.0-1+rpi1^2~40^3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2bdc228375e215de9a5391174812b2130024a40a;p=thunderbird.git Import thunderbird_78.14.0-1.debian.tar.xz [dgit import tarball thunderbird 1:78.14.0-1 thunderbird_78.14.0-1.debian.tar.xz] --- 2bdc228375e215de9a5391174812b2130024a40a diff --git a/README.Debian b/README.Debian new file mode 100644 index 0000000000..d21c8449ea --- /dev/null +++ b/README.Debian @@ -0,0 +1,253 @@ +WebExtension AddOn interface in Thunderbird >= 68.0 +--------------------------------------------------- + +Starting with version 68.0 the only supported interface for Add-ons is the +WebExtension interface. No old XUL-based, sometimes called legacy Add-ons will +work anymore. Starting with 78.0 also no legacy WebExtensions will not work +any more. + +This sentence is not only true for Debian packaged extensions but also for +previously pulled Add-ons from addons.thunderbird.net or some other external +resources. +If you encounter any incompatible packaged Add-ons please open a bug report for +the package, if not already a bug report is created. + +If you are developing own WebExtension based Add-ons you might help to migrate +other still not ready to use Add-ons. Help is really appreciated in any way. + +The API documentation of WebExtension can be found here. + + https://thunderbird-webextensions.readthedocs.io/en/68 + +Some guideline how to migrate to WebExtension from a Legacy Add-on you will +find here. + + https://developer.thunderbird.net/add-ons/tb68 + +Christopher Leidigh (a full-time Thunderbird contributor) has collected a list +of available Add-ons and their status. So you might find his list useful. + + https://cleidigh.github.io/ThunderKdB/index.html + +OpenPGP support within Thunderbird >= 78.0 +------------------------------------------ + +By dropping even support of the legacy WebExtension API in 78.x the typical +used Add-on Enigmail for GPG encryption would not fully working any more. This +is basically grounded on limitations of the WebExtension API to restrict full +access on file system level. +The developer ob Enigmail and MZLNA decided to include OpenPGP support within +Thunderbird directly starting with Thunderbird 78.0. But this now included +native OpenPGP support has some downside, Thunderbird is using it's own key +storage system within the users profile. This means, OpenPGG is working +independently of installed GPG related packages! Also no automatically sync +between Thunderbird and $(HOME)/.gnupg will happen! + +Migration from Enigmail to native OpenPGP support: +This step is optional but user are encouraged to use the migration wizard of +Enigmail. +The Enigmail developer did create a final Enigmail version 2.2.x which is +helping to migrate from the old Enigmail supported workflow over to the OpenPGP +included support. +To use this migration wizard you will need to install Enigmail >= 2.2 as Debian +package (if available) or install this extension by using the menu +'Tools' -> 'Add-ons' and search for it. +There will be a pop up window directly after the installation which is asking +the user if he wanted to be guided through the GPG migration. The user can also +start the migration wizard later at any time by calling it from the 'Tool' menu +the entry 'Migrate Enigmail Settings'. + +You can found more information about the OpenPGP support on the following web +resources. + + https://wiki.mozilla.org/Thunderbird:OpenPGP + https://wiki.mozilla.org/Thunderbird:OpenPGP:2020 + https://wiki.mozilla.org/Thunderbird:OpenPGP:Smartcards + https://wiki.mozilla.org/Thunderbird:OpenPGP:Status + https://www.thunderbird.net/en-US/thunderbird/78.0/releasenotes/ + https://www.enigmail.net/index.php/en/home/news + https://addons.thunderbird.net/en/thunderbird/addon/enigmail/ + + -- Carsten Schoenert Sun, 20 Oct 2020 9:05:00 +0200 + +De-Branding of Icedove, Reintroduce Thunderbird in Debian +--------------------------------------------------------- + +Debian and Mozilla has done some new rethinking and talking about the old legal +questions about trademark issues [1]. +Based on this revaluation the Debian project got now an agreement from Mozilla +Corp. that the rebranded packages Iceweasel, Debian rebranded version for +Firefox, and Icedove, Debian rebranded version for Thunderbird are no longer +needed. + +The maintainers of the Iceweasel package followed that agreement and did a +de-branding of Iceweasel back to Firefox. More information on this process can +be found on [1]. +For Icedove the maintainers followed too the new agreement and remove the old +branding after almost 10 years for Icedove and Iceowl-Extension and switched +back to the official branding from Mozilla. The according bug for this process +can be found under [2]. + +For versions greater 1:45.6.0-2 the following packages were introduced as a +replacement. + +old package .... --> new package usage +--------------------------------------------------------------------------------- +icedove ........ --> thunderbird (Thunderbird Main application) +icedove-dev .... --> thunderbird-dev (Thunderbird Development files) +icedove-dbg .... --> thunderbird-dbg (Thunderbird with debugging symbols) +iceowl-extension --> lightning (Lightning, aka Calendar for Thunderbird) +icedove-l10n-* . --> thunderbird-l10n-* (l10n localization for Thunderbird) +iceowl-l10n-* .. --> lightning-l10n-* (l10n localization for Lightning) + +The old packages were changed to transitional packages and can be safely +removed after the automatically installation of the new packages. + += Profile Migration = +===================== + +Due the removing of the rebranding for Icedove Thunderbird will use the default +profile folder $HOME/.thunderbird for storing all the various user related +stuff! +With the new Thunderbird packages there is a wrapper script included, placed as +/usr/bin/thunderbird that will do a adoption of the existing profile folder +$HOME/.icedove into the new default folder for the user profile +$HOME/.thunderbird by setting up a symlink to the existing profile if possible. + +The automatism in the script will check the following parts: + + 1. Check if there is a folder or a symbolic link $HOME/.icedove existing and + there is NO folder or symbolic link $HOME/.thunderbird. + + 2. Create a symlink from $HOME/.thunderbird to $HOME/.icedove . + + 3. Fixing Mime type registration for' http(s)' and 'file' inside mimeTypes.rdf + if they registered for iceweasel. Before starting the fixup a backup will + be created name $FILE.backup_thunderbird_migration-${DATE}. + + 4. Also check for desktop type registrations of 'userapp-icedove*.desktop' in + '$HOME/.config/mimeapps.list' and $HOME/.local/share/applications/mimeapps.list, + but only if this file exists, users of tiling window managers won't have + this file. Read further for more information on this. + Like above, a backup of the existing file with same schema will be created + if needed. + + 7. If all was going well, starting Thunderbird. + + 8. If there is no folder $HOME/.icedove or $HOME/.thunderbird exists the + wrapper script will start Thunderbird without any extra action. + + 9. The above steps from 3.) will be also done if you already have a symlink + $HOME/.thunderbird that is pointing to $HOME/.icedove or the opposite, + $HOME/.thunderbird is pointing to $HOME/.icedove. + + So if you don't have one of the following four cases the wrapper script + will exit with a error message. + + 1. $HOME/.icedove is existing and holds valid profile data + 2. $HOME/.thunderbird points to $HOME/.icedove and 1. is true + 3. $HOME/.icedove points to $HOME/.thunderbird and 1. is true + 4. $HOME/.thunderbird is existing and holds valid profile data + (Note: Not the script, but Thunderbird will error out here if no + profiles are found!) + +If there is anything going wrong there will be splash screens displayed with +some additional notes, the logger mechanism will write some information about +what's going wrong into /var/log/syslog. + +So don't panic if there is something not working automatically. If the starter +script can't do the adoptions you will need to look by yourself and solve the +situation. Mostly there can be already a folder or symlink $HOME/.thunderbird +that prevents a automatic migration by the script. In such a case save a +existing folder $HOME/.thunderbird else where if needed and restart the +Thunderbird application. Other things like extra special mountpoints by the +system administrator can't also be handled by the script. Please ask the +service desk if you have trouble then. + +What else can you do? +You can call '/usr/bin/thunderbird --verbose' from a command line to see a +verbose output of the wrapper script. For more options of the wrapper script +and how to use them call '/usr/bin/thunderbird --help'. + +The Debian wiki is holding also extra information about the migration of +Icedove to Thunderbird. + + https://wiki.debian.org/Thunderbird + +For backward compatibility whithin the Stretch release there will be that +migration functionality until the release of Buster (aka Debian 10). +Afterwards you can still do this on your on by moving the folders manually. + += Avoid the pop-up information about migration globally = +========================================================= + +Within some use cases (e.g. bigger company environments) it can sometimes not +be useful that a user will see the dialogue window about the profile migration +as this can be more confusing than helpful. +To avoid this dialogue for all users on the system the administrator can create +a file '/etc/thunderbird/no_migration_popup' and the starting wrapper will +not pop-up the information dialogue if the migration isn't already done. + += User specific MIME Associations = +=================================== + +The desktop environment (usually Gnome, KDE, Mate etc.) is holding the +specific associations between MIME types and applications in various +places. In order the user can override system settings and adding new +ones the according place in the users home is the file +'$(HOME)/.config/mimeapps.list'. + +The migration is taking care for old 'icedove.desktop' associations and +is rewriting them to 'thunderbird.desktop'. +Like already done for the user profile, there will be always a backup +of the existing file created before the replacement can be done. In case +of problems you can safely move back to the original file. You will lost +then the needed association for the thunderbird binary. + +You can call '/usr/bin/thunderbird --show-backup' to see created backups from +the various possible modified files while the profile adoption. + +See also: + + https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html + += Migration of global configurations = +====================================== + +If you have some own special preferences files placed in '/etc/icedove/pref/' +they will be moved to '/etc/thunderbird/pref/'. +In case you have a modified file '/etc/icedove/pref/icedove.js' it will be +moved to '/etc/thunderbird/pref/icedove.js.dpkg-backup' to keep your changes. +Please adjust this file to the Thunderbird specific configuration file +'/etc/thunderbird/pref/thunderbird.js'. The old folder '/etc/icedove' is gone +be removed only if it is completely empty. + +There are still some corner cases where this automatism with configuration +files in /etc/thunderbird/pref is not fully working. Please note #806955 [4] +about such issues. + +[1] https://en.wikipedia.org/wiki/Mozilla_software_rebranded_by_Debian +[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815006 +[3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816679 +[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=806955 + + -- Carsten Schoenert Sun, 21 Aug 2016 10:12:00 +0200 + +Mozilla Crash Reporter for Thunderbird +-------------------------------------- + +The crash reporter for Thunderbird is enabled since version > 1:45.6.0-3. By +this a possible crash could be automatically send to Mozilla if the user is +accepting this. There is nothing send to Mozilla without a user action. More +information about the crash reporter can be found on: + +https://support.mozilla.org/en-US/kb/mozilla-crash-reporter-tb + +Please consider to use the crash reporter for getting crashes reported +upstream, this also helps the maintainers if Thunderbird to get crash reports +send upstream. +Submitted crash reports can be found, if any was send, in + + ~/.thunderbird/Crash Reports/submitted/ + + -- Carsten Schoenert Sun, 29 Jan 2017 14:15:00 +0100 diff --git a/README.apparmor b/README.apparmor new file mode 100644 index 0000000000..3974689953 --- /dev/null +++ b/README.apparmor @@ -0,0 +1,30 @@ +AppArmor policy +--------------- + +The thunderbird package includes an AppArmor profile +(/etc/apparmor.d/usr.bin.thunderbird). This profile is disabled by +default because it has to break a number of common use cases in order +to provide meaningful application confinement. + +If you want to trade additional security against potential +functionality breakage, you can enable this profile by running: + + sudo rm /etc/apparmor.d/disable/usr.bin.thunderbird && \ + sudo apparmor_parser -r -T -W /etc/apparmor.d/usr.bin.thunderbird + +To display the current state of the Thunderbird profile, run: + + sudo apt install jq && \ + sudo aa-status --pretty-json | jq .profiles.thunderbird + +To debug issues with this AppArmor profile, see: + + https://wiki.debian.org/AppArmor/Debug + +This AppArmor profile is maintained collaboratively, in +a cross-distribution manner, within the AppArmor upstream project. +You can report issues or propose improvements there: + + https://gitlab.com/apparmor/apparmor-profiles + + -- Carsten Schoenert Sun, 3 Dec 2017 18:03:00 +0200 diff --git a/README.source b/README.source new file mode 100644 index 0000000000..0d5de1d62a --- /dev/null +++ b/README.source @@ -0,0 +1,90 @@ +This package is maintained with git-buildpackage(1). + +It uses pristine-tar(1) to store enough information in git to generate +bit identical tarballs when building the package without having +downloaded an upstream tarball first. + +When working with patches it is recommended to use "gbp pq import" to +import the patches, modify the source and then use "gbp pq export +--commit" to commit the modifications. + +The changelog is generated using "gbp dch" so if you submit any +changes don't bother to add changelog entries but rather provide +a nice git commit message that can then end up in the changelog. + +It is recommended to build the package with pbuilder using: + + gbp builpackage --git-pbuilder + +For information on how to set up a pbuilder environment see the +git-pbuilder(1) manpage. In short: + + DIST=sid git-pbuilder create + gbp clone + cd + gbp buildpackage --git-pbuilder + +src:thunderbird uses component tarballs for the l10n packages (see below). + + +Creating a source tarball thunderbird +===================================== + +Download the source from the Mozilla CDN [1], then use debian/repack.py +to repackage the Thunderbird upstream tarball: + + debian/repack.py -p thunderbird -u 52.4.0 -c xz ../thunderbird-52.4.0.source.tar.xz + +[1] http://ftp.mozilla.org/pub/thunderbird/releases/ + + +Creating a source tarball thunderbird-l10n +========================================== + +We need to create the component tarball for the thunderbird l10n: + + thunderbird_[xx].orig-thunderbird-l10n.tar.xz + +using + + debian/create-thunderbird-l10n-tarball.sh + +You need to run the script on top of the Thunderbird Git repository. + +Importing the source tarballs +============================= + +Since version 45.0 the source package Icedove was using component +tarballs to include the l10n source for iceowl-extension and thunderbird. +The same is now also true for src:thunderbird starting with 52.4.0 with +lightning and thunderbird l10n component tarballs. + +git-buildpackage supports component tarballs since version 0.8.0 so +you can import the tarballs using "gbp import-orig". Make sure the +component tarballs are placed in the same folder as +thunderbird_[version].orig.tar.xz then import the new upstream version as +usual: + + gbp import-orig --sign-tags [--verbose] /path/to/thunderbird_[version].orig.tar.xz + + +Pre-shipped Font file(s) +======================= +The source of Firefox is shipping a pre-build font EmojiOneMozilla.ttf in +the folder + + mozilla/browser/fonts/ + +Currently this font isn't provided by any package in Debian but Thunderbird is +needing this font as well in case users are working and using the HTML modus for +email reading or writing. Thus we ship that font starting with > 52.4.0-1 in + + /usr/lib/thunderbird/font + +Once the font is provided by a package we can drop the shipped file. There is +RFP #881475 about packaging the EmojiOne font. + +See also bug reports #849602 and #881299 + + https://bugs.debian.org/849602 + https://bugs.debian.org/881299 diff --git a/account-autoconfig/riseup.net.xml b/account-autoconfig/riseup.net.xml new file mode 100644 index 0000000000..75952efad1 --- /dev/null +++ b/account-autoconfig/riseup.net.xml @@ -0,0 +1,45 @@ + + + + riseup.net + + Riseup Networks Mail + Riseup + + + imap.riseup.net + 993 + SSL + %EMAILLOCALPART% + plain + + + + pop.riseup.net + 995 + SSL + plain + %EMAILLOCALPART% + + + + mail.riseup.net + 465 + SSL + %EMAILLOCALPART% + plain + true + false + + + + + + + Configure Thunderbird for Riseup Mail + + + + + diff --git a/apparmor/usr.bin.thunderbird b/apparmor/usr.bin.thunderbird new file mode 100644 index 0000000000..5c69ecdf9f --- /dev/null +++ b/apparmor/usr.bin.thunderbird @@ -0,0 +1,433 @@ +# vim:syntax=apparmor +# Author: Simon Deziel +# This apparmor profile is derived from firefox profile +# by Jamie Strandboge + +# Declare an apparmor variable to help with overrides +@{MOZ_LIBDIR}=/usr/lib/thunderbird + +#include + +profile thunderbird /usr/lib/thunderbird/thunderbird{,-bin} { + #include + #include + #include + # TODO: finetune this for required accesses + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + # Backported from the mesa abstraction, available in AppArmor >2.13 + # System files + /dev/dri/ r, # libGLX_mesa.so calls drmGetDevice2() + + # User files + owner @{HOME}/.cache/ w, # if user clears all caches + owner @{HOME}/.cache/mesa_shader_cache/ w, + owner @{HOME}/.cache/mesa_shader_cache/index rw, + owner @{HOME}/.cache/mesa_shader_cache/??/ w, + owner @{HOME}/.cache/mesa_shader_cache/??/* rw, + # End of backported mesa abstraction + + # Backported from the dri-enumerate abstraction, available in AppArmor 2.13 + /sys/devices/pci[0-9]*/**/{device,subsystem_device,subsystem_vendor,uevent,vendor} r, + + # Allow opening attachments + # TODO: create and use abstractions for opening various file formats + /{usr/local/,usr/,}bin/* Cx -> sanitized_helper, + /usr/lib/libreoffice/program/soffice Cxr -> sanitized_helper, + + # Allow opening links + # GDesktopAppInfo in GLib 2.64.x uses a very small shell script + # to launch .desktop files, instead of gio-launch-desktop + /{usr/,}bin/{dash,bash} ixr, + # With older GLib we might still be on the fallback code path + # (remove this after Debian 11 and Ubuntu 20.04) + /usr/lib/@{multiarch}/glib-[0-9]*/gio-launch-desktop ix, + + # For Xubuntu to launch the browser + /usr/bin/exo-open ixr, + /usr/lib/@{multiarch}/xfce4/exo-[1-9]/exo-helper-[1-9] ixr, + /etc/xdg/xdg-xubuntu/xfce4/helpers.rc r, + /etc/xdg/xfce4/helpers.rc r, + owner @{HOME}/.config/xfce4/helpers.rc r, + + # for crash reports? + ptrace (read,trace) peer=@{profile_name}, + + /usr/lib/thunderbird/thunderbird{,-bin} ixr, + + # Pulseaudio + /usr/bin/pulseaudio Pixr, + + owner @{HOME}/.{cache,config}/dconf/user rw, + owner @{HOME}/.cache/thumbnails/** r, + owner /run/user/[0-9]*/dconf/user rw, + owner @{HOME}/.config/gtk-3.0/bookmarks r, + deny owner @{HOME}/.local/share/gvfs-metadata/* r, + + # potentially extremely sensitive files + audit deny @{HOME}/.gnupg/** mrwkl, + audit deny @{HOME}/.ssh/** mrwkl, + + # rw access to HOME is useful when sending/receiving attachments + owner @{HOME}/[^.]** rw, + + # other commonly used locations + /{data,media,mnt,srv}/** r, + owner /{data,media,mnt,srv}/** rw, + owner @{HOME}/.signature* r, + + # Required for LVM setups + /sys/devices/virtual/block/dm-[0-9]*/uevent r, + + # Addons (too lax for thunderbird) + ##include + + # for networking + network inet stream, + network inet6 stream, + @{PROC}/[0-9]*/net/if_inet6 r, + @{PROC}/[0-9]*/net/ipv6_route r, + @{PROC}/[0-9]*/net/dev r, + @{PROC}/[0-9]*/net/wireless r, + @{PROC}/[0-9]*/net/arp r, + + # should maybe be in abstractions + /etc/ r, + /etc/mime.types r, + /etc/mailcap r, + /etc/xdg/*buntu/applications/defaults.list r, # for all derivatives + /etc/xfce4/defaults.list r, + /usr/share/xubuntu/applications/defaults.list r, + owner /dev/shm/org.chromium.* rw, # for Chromium IPC + owner /dev/shm/org.mozilla.ipc.[0-9]*.[0-9]* rw, # for Chromium IPC + owner @{HOME}/.cache/fontconfig/*.cache-* rwk, + owner @{HOME}/.local/share/applications/defaults.list r, + owner @{HOME}/.local/share/applications/mimeapps.list r, + owner @{HOME}/.local/share/applications/mimeinfo.cache r, + owner @{HOME}/.recently-used r, + /tmp/.X[0-9]*-lock r, + /etc/udev/udev.conf r, + # Doesn't seem to be required, but noisy. Maybe allow 'r' for 'b*' if needed. + # Possibly move to an abstraction if anything else needs it. + deny /run/udev/data/** r, + + /etc/timezone r, + /etc/wildmidi/wildmidi.cfg r, + + # thunderbird specific + /etc/thunderbird/ r, + /etc/thunderbird/** r, + /etc/xul-ext/** r, + /etc/xulrunner-2.0*/ r, + /etc/xulrunner-2.0*/** r, + /etc/gre.d/ r, + /etc/gre.d/* r, + + # noisy + deny @{MOZ_LIBDIR}/** w, + deny /usr/lib/thunderbird-addons/** w, + deny /usr/lib/xulrunner-addons/** w, + deny /usr/lib/xulrunner-*/components/*.tmp w, + deny /.suspended r, + deny /boot/initrd.img* r, + deny /boot/vmlinuz* r, + deny /var/cache/fontconfig/ w, + + # noisy file dialog: + # + # TODO: remove these rules when file dialogs becomes "trusted helpers" that can + # read anything, or ability to override `deny` rules is implemented [0]. + # + # NOTE: modify `local/usr.bin.thunderbird` to add `deny` rules for cases not + # mentioned here when `DENIED` messages appear for dot files in kernel (or audit) + # logs. If that case is believed to be common enough, please report bug against + # package shipping this profile in order to extend this list. + # + # [0] https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/451422 + deny @{HOME}/.KiCad r, + deny @{HOME}/.abbrev_defs r, + deny @{HOME}/.aspell.*.{prepl,pws} r, + deny @{HOME}/.bashrc r, + deny @{HOME}/.bash_logout r, + deny @{HOME}/.bbdb r, + deny @{HOME}/.caffrc r, + deny @{HOME}/.colordiffrc r, + deny @{HOME}/.cvpcb r, + deny @{HOME}/.cvspass r, + deny @{HOME}/.devscripts r, + deny @{HOME}/.directory r, + deny @{HOME}/.dpt.conf r, + deny @{HOME}/.dput.cf r, + deny @{HOME}/.dupload.conf r, + deny @{HOME}/.eeschema r, + deny @{HOME}/.emacs r, + deny @{HOME}/.emacs.bmk r, + deny @{HOME}/.emacs.desktop* r, + deny @{HOME}/.fehbg r, + deny @{HOME}/.forward r, + deny @{HOME}/.gbp.conf r, + deny @{HOME}/.gerbview r, + deny @{HOME}/.gitconfig r, + deny @{HOME}/.gitk r, + deny @{HOME}/.gtk-recordmydesktop r, + deny @{HOME}/.gtkrc-2.0 r, + deny @{HOME}/.i18n r, + deny @{HOME}/.ido.last r, + deny @{HOME}/.iftoprc r, + deny @{HOME}/.inputrc r, + deny @{HOME}/.jigdo-lite r, + deny @{HOME}/.kicad r, + deny @{HOME}/.kicad_common r, + deny @{HOME}/.lesshst r, + deny @{HOME}/.listadmin.ini r, + deny @{HOME}/.minicpanrc r, + deny @{HOME}/.mostrc r, + deny @{HOME}/.mrconfig r, + deny @{HOME}/.mrlog r, + deny @{HOME}/.mrtrust r, + deny @{HOME}/.my.cnf r, + deny @{HOME}/.newsrc-dribble r, + deny @{HOME}/.newsrc.eld r, + deny @{HOME}/.notmuch-config r, + deny @{HOME}/.offlineimaprc r, + deny @{HOME}/.pam_environment r, + deny @{HOME}/.pbuilderrc r, + deny @{HOME}/.pcbnew r, + deny @{HOME}/.perldb r, + deny @{HOME}/.perltidyrc r, + deny @{HOME}/.pgadmin3 r, + deny @{HOME}/.pgadmin_histoqueries r, + deny @{HOME}/.pgpass r, + deny @{HOME}/.python_history r, + deny @{HOME}/.pythonhist r, + deny @{HOME}/.quiltrc r, + deny @{HOME}/.reportbug-ng r, + deny @{HOME}/.reportbugrc r, + deny @{HOME}/.rnd r, + deny @{HOME}/.screenrc r, + deny @{HOME}/.selected_editor r, + deny @{HOME}/.steam/bin{32,64}/steam r, # through a symlink + deny @{HOME}/.steam/steam.pid r, # through a symlink + deny @{HOME}/.steam/ubuntu12_{32,64}/steam r, # through a symlink + deny @{HOME}/.sudo_as_admin_successful r, + deny @{HOME}/.swp r, + deny @{HOME}/.taskrc r, + deny @{HOME}/.tmux.conf r, + deny @{HOME}/.vboxclient-*.pid r, + deny @{HOME}/.vimrc r, + deny @{HOME}/.wget-hsts r, + deny @{HOME}/.xchm r, + deny @{HOME}/.xfce4-session.verbose-log* r, + deny @{HOME}/.xim.template r, + deny @{HOME}/.xinitrc.template r, + deny @{HOME}/.xinputrc r, + deny @{HOME}/.xscreensaver r, + deny @{HOME}/.xsession*errors* r, + deny @{HOME}/.xsessionrc r, + deny @{HOME}/.Xresources r, + deny @{HOME}/.Xsession r, + deny @{HOME}/.zcompdump r, + deny @{HOME}/.zlogout r, + deny @{HOME}/.zshrc r, + + # TODO: investigate + deny /usr/bin/gconftool-2 x, + + # Deny proprietary NVIDIA driver optimizations + # TODO: remove once it can be disabled via conditionals set up in nvidia abstraction + deny /tmp/#[0-9][0-9][0-9][0-9][0-9][0-9][0-9] m, + deny /tmp/.gl?????? mrw, + deny @{HOME}/#[0-9][0-9][0-9][0-9][0-9][0-9][0-9]{,[0-9]} m, + deny @{HOME}/.nv/.gl?????? mrw, + + owner @{PROC}/[0-9]*/mountinfo r, + owner @{PROC}/[0-9]*/stat r, + owner @{PROC}/[0-9]*/task/[0-9]*/stat r, + /sys/devices/pci[0-9]*/**/uevent r, + /sys/devices/pci*/**/config r, + /sys/devices/system/node/node[0-9]*/meminfo r, + /etc/mtab r, + /etc/fstab r, + + # Needed for the crash reporter + owner @{PROC}/[0-9]*/environ r, + owner @{PROC}/[0-9]*/auxv r, + owner @{PROC}/[0-9]*/status r, + owner @{PROC}/[0-9]*/cmdline r, + /etc/lsb-release r, + /etc/ssl/openssl.cnf r, + /usr/lib/thunderbird/crashreporter ix, + /usr/bin/expr ix, + /sys/devices/system/cpu/ r, + /sys/devices/system/cpu/** r, + + # about:memory + owner @{PROC}/[0-9]*/statm r, + owner @{PROC}/[0-9]*/smaps r, + + # Needed for container to work in xul builds + /usr/lib/xulrunner-*/plugin-container ixr, + + # allow access to documentation and other files the user may want to look + # at in /usr and /opt + /usr/ r, + /usr/** r, + /opt/ r, + /opt/** r, + + # so browsing directories works + / r, + /**/ r, + + # per-user thunderbird configuration + owner @{HOME}/.{icedove,thunderbird}/ rw, + owner @{HOME}/.{icedove,thunderbird}/** rw, + owner @{HOME}/.{icedove,thunderbird}/**/storage.sdb k, + owner @{HOME}/.{icedove,thunderbird}/**/*.{db,parentlock,sqlite}* k, + owner @{HOME}/.{icedove,thunderbird}/plugins/** rm, + owner @{HOME}/.{icedove,thunderbird}/**/plugins/** rm, + owner @{HOME}/.cache/thunderbird/ rw, + owner @{HOME}/.cache/thunderbird/** rw, + + # system emails + owner /var/mail/* rwlk, + + # + # Extensions + # /usr/share/.../extensions/... is already covered by '/usr/** r', above. + # Allow 'x' for downloaded extensions, but inherit policy for safety + owner @{HOME}/.{icedove,thunderbird}/**/extensions/** mixrw, + owner @{HOME}/.mozilla/ rw, + owner @{HOME}/.mozilla/extensions/ rw, + owner @{HOME}/.mozilla/extensions/** mixr, + /usr/share/xul-ext/**/*.sqlite rk, + /usr/lib/mozilla/plugins/*.so rm, + /usr/lib/xul-ext/**/*.sqlite rk, + /usr/lib/thunderbird-addons/extensions/**/*.sqlite rk, + + deny @{MOZ_LIBDIR}/update.test w, + deny /usr/lib/mozilla/extensions/**/ w, + deny /usr/lib/xulrunner-addons/extensions/**/ w, + deny /usr/share/mozilla/extensions/**/ w, + deny /usr/share/mozilla/ w, + + /usr/bin/gpg Cx -> gpg, + /usr/bin/gpg2 Cx -> gpg, + /usr/bin/gpgconf Cx -> gpg, + /usr/bin/gpg-connect-agent Cx -> gpg, + /usr/lib/gnupg/gpg-wks-client ix, + /{,usr/}bin/ps ix, + + # TB tries to create this file but has no business doing so + deny @{HOME}/.gnupg/gpg-agent.conf w, + + profile gpg { + #include + + # Required to import keys from keyservers + #include + #include + + /usr/share/xul-ext/enigmail/chrome/** r, + + # silence noise from enigmail 1.9+ + deny owner @{HOME}/.{icedove,thunderbird}/*/.parentlock w, + deny owner @{HOME}/.{icedove,thunderbird}/*/panacea.dat w, + deny owner @{HOME}/.{icedove,thunderbird}/*/*.mab w, + deny owner @{HOME}/.{icedove,thunderbird}/**/*.msf w, + deny owner @{HOME}/.cache/thunderbird/**/_CACHE_* w, + + # noise from inherited files + deny @{HOME}/.{icedove,thunderbird}/*/ImapMail/*/INBOX w, + deny /usr/{lib,share}/thunderbird/omni.ja r, + deny /usr/share/thunderbird/extensions/** r, + + # For smartcards? + /dev/bus/usb/ r, + /dev/bus/usb/[0-9]*/ r, + /dev/bus/usb/[0-9]*/[0-9]* r, + + # LDAP key servers + /etc/ldap/ldap.conf r, + + /usr/bin/gpg mr, + /usr/bin/gpg2 mr, + /usr/bin/gpgconf mr, + /usr/bin/gpg-connect-agent mr, + /usr/lib/gnupg/gpgkeys_* ix, + /usr/lib/gnupg2/gpg2keys_* ix, + owner @{HOME}/.gnupg/ rw, + owner @{HOME}/.gnupg/gpg.conf r, + owner @{HOME}/.gnupg/random_seed rwk, + owner @{HOME}/.gnupg/pubring.{gpg,kbx}{,~} rw, + owner @{HOME}/.gnupg/secring.gpg rw, + owner @{HOME}/.gnupg/trustdb.gpg rw, + owner @{HOME}/.gnupg/tofu.db{,-journal} rwk, + owner @{HOME}/.gnupg/S.gpg-agent rw, + owner @{HOME}/.gnupg/S.dirmngr rw, + owner @{HOME}/.gnupg/*.{gpg,kbx}.{lock,tmp} rwl, + owner @{HOME}/.gnupg/.gpg-*.lock rwl, + owner @{HOME}/.gnupg/gnupg_spawn_*.lock rwl, + owner @{HOME}/.gnupg/.#*[0-9] rw, + owner @{HOME}/.gnupg/.#*[0-9]x rwl, + owner @{HOME}/.gnupg/.#lk0x[0-9a-f]* rwl, + owner @{HOME}/.gnupg/.gpg-v[0-9]*-migrated rw, + owner @{HOME}/.gnupg/openpgp-revocs.d/{,[A-F0-9]*.rev} rw, + owner @{HOME}/** r, + owner @{PROC}/@{pids}/mountinfo r, + + # For gpgconf + owner @{PROC}/@{pids}/fd/ r, + + owner /run/user/[0-9]*/keyring-*/gpg rw, + + # For encryption + signature + owner /tmp/gpgOutput.* rw, + + # for inline pgp + owner /tmp/encfile rw, + owner /tmp/encfile-[0-9]* rw, + + # for key import + owner /tmp/enigmail_import/.#lk0x[0-9a-f]* rw, + owner /tmp/enigmail_import/.#lk0x[0-9a-f]*x rwl, + owner /tmp/enigmail_import/{keyring,trustdb}.lock rwl, + owner /tmp/enigmail_import/{keyring,trustdb}{,~,.tmp} rw, + /usr/bin/dirmngr ix, + owner @{PROC}/@{pids}/task/@{tid}/comm rw, + + # for revocation certificate generation in the Enigmail setup wizard + owner @{HOME}/.{icedove,thunderbird}/*/0x[A-F0-9]*_rev.asc rw, + # for revocation certificate generation in the Enigmail key manager + owner @{HOME}/*0x[A-F0-9]**.asc rw, + + # for signature generation + owner /tmp/nsemail.eml w, + owner /tmp/nsemail-[0-9]*.eml w, + + # for signature verifications + owner /tmp/data.sig r, + owner /tmp/data-[0-9]*.sig r, + + owner /tmp/gpg-[a-zA-Z0-9]*/S.gpg-agent rw, + + /usr/share/sounds/** r, + } + + # Site-specific additions and overrides. See local/README for details. + #include +} + diff --git a/changelog b/changelog new file mode 100644 index 0000000000..8d86a98d57 --- /dev/null +++ b/changelog @@ -0,0 +1,6621 @@ +thunderbird (1:78.14.0-1) unstable; urgency=medium + + * [6dc6817] d/changelog: Correct TB version for referenced MFSA + * [38f01f4] d/rules: Don't run dh_autoreconf + (Closes: #993494) + * [09c4cde] New upstream version 78.14.0 + Fixed CVE issues in upstream version 78.14.0 (MFSA 2021-42): + CVE-2021-38493: Memory safety bugs fixed in Thunderbird 78.14 and + Thunderbird 91.1 + + -- Carsten Schoenert Wed, 08 Sep 2021 19:57:22 +0200 + +thunderbird (1:78.13.0-1) unstable; urgency=medium + + * [b4498b0] New upstream version 78.13.0 + Fixed CVE issues in upstream version 78.13.0 (MFSA 2021-35): + CVE-2021-29986: Race condition when resolving DNS names could have led to + memory corruption + CVE-2021-29988: Memory corruption as a result of incorrect style treatment + CVE-2021-29984: Incorrect instruction reordering during JIT optimization + CVE-2021-29980: Uninitialized memory in a canvas object could have led to + memory corruption + CVE-2021-29985: Use-after-free media channels + CVE-2021-29989: Memory safety bugs fixed in Thunderbird 78.13 + + -- Carsten Schoenert Thu, 12 Aug 2021 16:13:25 +0200 + +thunderbird (1:78.12.0-1) unstable; urgency=medium + + * [74d3cdb] New upstream version 78.12.0 + Fixed CVE issues in upstream version 78.12 (MFSA 2021-30): + CVE-2021-29969: IMAP server responses sent by a MITM prior to STARTTLS + could be processed + CVE-2021-29970: Use-after-free in accessibility features of a document + CVE-2021-30547: Out of bounds write in ANGLE + CVE-2021-29976: Memory safety bugs fixed in Thunderbird 78.12 + + -- Carsten Schoenert Sat, 17 Jul 2021 09:33:28 +0200 + +thunderbird (1:78.11.0-2) unstable; urgency=medium + + [ Carsten Schoenert ] + * [241e539] d/thunderbird.1: Correct debugger option + Remove parts that are no longer valid, especially there is no dedicated + shell script any more the user has to start, calling 'thunderbird -g' is + enough to start a GDB call. + * [66deb37] thunderbird: Use internal NSS source while package built + (Closes: #989839, #989843, #989979, #989983, #989922, #990012) + * [07fb6ef] d/thunderbird-wrapper.sh: Use '${}' syntax for variables + + [ Kevin Locke ] + * [d003e26] d/thunderbird-wrapper.sh: Make gdb call more fail safe + (Closes: #942799) + + -- Carsten Schoenert Sun, 20 Jun 2021 07:20:41 +0200 + +thunderbird (1:78.11.0-1) unstable; urgency=medium + + * [42c4a87] New upstream version 78.11.0 + Fixed CVE issues in upstream version 78.11 (MFSA 2021-26): + CVE-2021-29967: Memory safety bugs fixed in Thunderbird 78.11 + + -- Carsten Schoenert Thu, 03 Jun 2021 17:22:34 +0200 + +thunderbird (1:78.10.2-1) unstable; urgency=medium + + * [69552d8] New upstream version 78.10.2 + Fixed CVE issues in upstream version 78.10.2 (MFSA 2021-22): + CVE-2021-29957: Partial protection of inline OpenPGP message not indicated + CVE-2021-29956: Thunderbird stored OpenPGP secret keys without master + password protection + + -- Carsten Schoenert Wed, 19 May 2021 21:57:11 +0200 + +thunderbird (1:78.10.0-1) unstable; urgency=medium + + * [f38d78f] New upstream version 78.10.0 + Fixed CVE issues in upstream version 78.10 (MFSA 2021-15): + CVE-2021-23994: Out of bound write due to lazy initialization + CVE-2021-23995: Use-after-free in Responsive Design Mode + CVE-2021-23998: Secure Lock icon could have been spoofed + CVE-2021-23961: More internal network hosts could have been probed by a + malicious webpage + CVE-2021-23999: Blob URLs may have been granted additional privileges + CVE-2021-24002: Arbitrary FTP command execution on FTP servers using an + encoded URL + CVE-2021-29945: Incorrect size computation in WebAssembly JIT could lead + to null-reads (This issue only affected x86-32 platforms.) + CVE-2021-29946: Port blocking could be bypassed + CVE-2021-29948: Race condition when reading from disk while verifying + signatures + + -- Carsten Schoenert Mon, 19 Apr 2021 20:00:32 +0200 + +thunderbird (1:78.9.0-1) unstable; urgency=medium + + [ Colomban Wendling ] + * [7d454de] d/thunderbird.desktop: Switch StartupWMClass + (Closes: #985366) + + [ Carsten Schoenert ] + * [23fe9ce] d/source.filter: small update to filtering list + * [828b9d7] New upstream version 78.9.0 + Fixed CVE issues in upstream version 78.9 (MFSA 2021-12): + CVE-2021-23981: Texture upload into an unbound backing buffer resulted in + an out-of-bound read + CVE-2021-23982: Internal network hosts could have been probed by a + malicious webpage + CVE-2021-23984: Malicious extensions could have spoofed popup information + CVE-2021-23987: Memory safety bugs fixed in Thunderbird 78.9 + * [cf4fbde] rebuild patch queue from patch-queue branch + Removed patch (included upstream): + porting-s390x/Explicitly-instantiate-TIntermTraverser-traverse-TIntermN.patch + + -- Carsten Schoenert Tue, 23 Mar 2021 15:55:43 +0100 + +thunderbird (1:78.8.0-1) unstable; urgency=medium + + [ Pino Toscano ] + * [f2f1f3f] thunderbird: Stop shipping /u/s/p/thunderbird.png symlink + + [ Carsten Schoenert ] + * [f5707a7] New upstream version 78.8.0 + Fixed CVE issues in upstream version 78.8 (MFSA 2021-09): + CVE-2021-23969: Content Security Policy violation report could have + contained the destination of a redirect + CVE-2021-23968: Content Security Policy violation report could have + contained the destination of a redirect + CVE-2021-23973: MediaError message property could have leaked information + about cross-origin resources + CVE-2021-23978: Memory safety bugs fixed in Thunderbird 78.8 + + -- Carsten Schoenert Sun, 21 Feb 2021 14:58:05 +0100 + +thunderbird (1:78.7.1-1) unstable; urgency=medium + + * [406f9d7] New upstream version 78.7.1 + + -- Carsten Schoenert Fri, 05 Feb 2021 20:12:59 +0100 + +thunderbird (1:78.7.0-1) unstable; urgency=medium + + * [8751354] New upstream version 78.7.0 + Fixed CVE issues in upstream version 78.7 (MFSA 2021-05): + CVE-2021-23953: Cross-origin information leakage via redirected PDF + requests + CVE-2021-23954: Type confusion when using logical assignment operators in + JavaScript switch statements + CVE-2020-15685: IMAP Response Injection when using STARTTLS + CVE-2020-26976: HTTPS pages could have been intercepted by a registered + service worker when they should not have been + CVE-2021-23960: Use-after-poison for incorrectly redeclared JavaScript + variables during GC + CVE-2021-23964: Memory safety bugs fixed in Thunderbird 78.7 + * [4b0c0a7] rebuild patch queue from patch-queue branch + removed patch (included upstream): + porting-mips/Bug-1642265-MIPS64-Add-branchTestSymbol-and-fallibleUnbox.patch + + -- Carsten Schoenert Fri, 29 Jan 2021 20:45:49 +0100 + +thunderbird (1:78.6.1-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [67f6117] Add Apache2 notice for third_party/python/coverage + * [38b9ff7] lintian: adding override for false positive in SVG file + + [ Carles Pina i Estany ] + * [529d53a] d/thunderbird-wrapper.sh: Unset DEBUG/DEBUGGER variables + (Closes: #960230) + * [6d48708] d/thunderbird-wrapper-helper.sh: Adjust help text + + [ Carsten Schoenert ] + * [5309e91] d/thunderbird-wrapper*.sh: Prefixing some local variables + * [07b4733] New upstream version 78.6.1 + Fixed CVE issues in upstream version 78.6.1 (MFSA 2021-02): + CVE-2020-16044: Use-after-free write when handling a malicious + COOKIE-ECHO SCTP chunk + + -- Carsten Schoenert Sat, 16 Jan 2021 14:59:02 +0100 + +thunderbird (1:78.6.0-1) unstable; urgency=medium + + * [1410f1e] d/watch: update to version 4 + * [a8303b7] d/rules: use python3 explicitly while calling mach + * [f3f535e] New upstream version 78.6.0 + Fixed CVE issues in upstream version 78.6 (MFSA 2020-56): + CVE-2020-16042: Operations on a BigInt could have caused uninitialized + memory to be exposed + CVE-2020-26971: Heap buffer overflow in WebGL + CVE-2020-26973: CSS Sanitizer performed incorrect sanitization + CVE-2020-26974: Incorrect cast of StyleGenericFlexBasis resulted in a heap + use-after-free + CVE-2020-26978: Internal network hosts could have been probed by a + malicious webpage + CVE-2020-35111: The proxy.onRequest API did not catch view-source URLs + CVE-2020-35112: Opening an extension-less download may have inadvertently + launched an executable instead + CVE-2020-35113: Memory safety bugs fixed in Thunderbird 78.6 + (Closes: #972072, #973697) + * [16a7ab7] /u/l/thunderbird: Correct escape sequencing for gdb calling + We need to do a better escaping of values of the '-ex' option otherwise + the shell is refusing the concatenated string we want to use as call. + (Closes: #976979) + + -- Carsten Schoenert Tue, 15 Dec 2020 10:12:34 +0100 + +thunderbird (1:78.5.1-1) unstable; urgency=medium + + * [08556c2] New upstream version 78.5.1 + Fixed CVE issues in upstream version 78.5.1 (MFSA 2020-53): + CVE-2020-26970: Stack overflow due to incorrect parsing of SMTP server + response codes + * [7047340] rebuild patch queue from patch-queue branch + removed patch (included upstream): + fixes/fix-function-nsMsgComposeAndSend-to-respect-Replo.patch + * [40663bb] debian/control: increase Standards-Version to 4.5.1 + No further changes needed. + + -- Carsten Schoenert Thu, 03 Dec 2020 05:35:04 +0100 + +thunderbird (1:78.5.0-1) unstable; urgency=medium + + * [7842f02] New upstream version 78.5.0 + Fixed CVE issues in upstream version 78.5 (MFSA 2020-51): + CVE-2020-26951: Parsing mismatches could confuse and bypass security + sanitizer for chrome privileged code + CVE-2020-16012: Variable time processing of cross-origin images during + drawImage calls + CVE-2020-26953: Fullscreen could be enabled without displaying the + security UI + CVE-2020-26956: XSS through paste (manual and clipboard API) + CVE-2020-26958: Requests intercepted through ServiceWorkers lacked MIME + type restrictions + CVE-2020-26959: Use-after-free in WebRequestService + CVE-2020-26960: Potential use-after-free in uses of nsTArray + CVE-2020-15999: Heap buffer overflow in freetype + CVE-2020-26961: DoH did not filter IPv4 mapped IP Addresses + CVE-2020-26965: Software keyboards may have remembered typed passwords + CVE-2020-26966: Single-word search queries were also broadcast to local + network + CVE-2020-26968: Memory safety bugs fixed in Thunderbird 78.5 + * [e19743e] rebuild patch queue from patch-queue branch + removed patch (included upstream): + fixes/Bug-1663715-Update-syn-and-proc-macro2-so-that-Firefox-ca.patch + + -- Carsten Schoenert Wed, 18 Nov 2020 20:06:09 +0100 + +thunderbird (1:78.4.2-1) unstable; urgency=medium + + * [c7f4ed2] New upstream version 78.4.2 + Fixed CVE issues in upstream version 78.4 (MFSA 2020-49): + CVE-2020-26950: Write side effects in MCallGetProperty opcode not + accounted for + * [c3a617d] rebuild patch queue from patch-queue branch + added patch: + fixes/Bug-1663715-Update-syn-and-proc-macro2-so-that-Firefox-ca.patch + * [8e4e7ad] thunderbird-l10n-all: add thunderbird-l10n-cy + (Closes: #974127) + + -- Carsten Schoenert Tue, 10 Nov 2020 21:19:15 +0100 + +thunderbird (1:78.4.1-1) unstable; urgency=medium + + * [cf8bf1e] New upstream version 78.4.1 + * [529000c] rebuild patch queue from patch-queue branch + added patches: + fixes/Bug-1650299-Unify-the-inclusion-of-the-ICU-data-file.-r-f.patch + fixes/Don-t-build-ICU-in-parallel.patch + Patches are picked from Firefox and fixing FTBFS on s390x within buster. + + -- Carsten Schoenert Fri, 06 Nov 2020 21:53:24 +0100 + +thunderbird (1:78.4.0-1) unstable; urgency=medium + + [ Emilio Pozuelo Monfort ] + * [652f8de] install the apparmor profile in thunderbird.install + + [ Carsten Schoenert ] + * [5240d53] Revert "thunderbird.install: adjust.desktop renamed file name" + (Closes: #972601) + * [861b21a] Revert "Rename .desktop file for AppStream compliance" + (Closes: #972578) + * [ffc5818] New upstream version 78.4.0 + Fixed CVE issues in upstream version 78.4 (MFSA 2020-47): + CVE-2020-15969: Use-after-free in usersctp + CVE-2020-15683: Memory safety bugs fixed in Thunderbird 78.4 + * [81396e3] rebuild patch queue from patch-queue branch + removed patches (fixed upstream): + porting-mips/Bug-1649655-MIPS-Add-CodeGenerator-visitWasmRegisterResul.patch + porting/Bug-1666646-Bump-CodeAlignment-to-8-in-MacroAssembler-non.patch + + modified patches: + fixes/Appdata-Adding-some-German-translations.patch + fixes/Appdata-Fix-up-AppStream-error-by-adding-missing-field.patch + + Minor fine tuning to the AppStream specific parts but also revert some + translation entries as they are not intend to be translatable. + These modification also in correlation with the mentioned bug reports above + which are closed by the other adjustments. + + -- Carsten Schoenert Thu, 22 Oct 2020 18:48:25 +0200 + +thunderbird (1:78.3.3-1) unstable; urgency=medium + + [ Emilio Pozuelo Monfort ] + * [6f18974] Remove duplicated --disable-debug-symbols flag + * [1119d50] Print a verbose build log by not calling the mach wrapper + * [fcf7c11] Exclude -g from CXXFLAGS as well + + [ Carsten Schoenert ] + * [9eb159f] New upstream version 78.3.3 + * [47171dc] rebuild patch queue from patch-queue branch + added patches: + fixes/Appdata-Adding-some-German-translations.patch + fixes/Appdata-Fix-up-AppStream-error-by-adding-missing-field.patch + * [1474d91] Rename .desktop file for AppStream compliance + * [10e49a9] thunderbird.install: adjust.desktop renamed file name + * [018bbc1] thunderbird.pc: remove left over cruft + + -- Carsten Schoenert Sun, 18 Oct 2020 08:49:20 +0200 + +thunderbird (1:78.3.2-1) unstable; urgency=medium + + * [0b2f19f] d/rules: remove hand crafted icu build + Cherry-picked from debian/buster branch. + The possible required build of the ICU if the usage of an external ICU + library is now handled by the upstream build system. + * [1583517] d/rules: rewrite dpkg_buildflags to remove option '-g' + Cherry-picked from debian/buster branch. + We need to remove the option '-g' from the dpkg_buildflags variable for + real if we want a build without debugging information (e.g. on 32bit + architectures). + * [fb4c9c4] New upstream version 78.3.2 + * [9d5e2b9] d/rules: install the language Add-ons into /u/l/t/e + Do not install the thunderbird-l10n packages into /usr/share/thunderbird + any more, install them directly into /usr/libt/thunderbird/extensions. + This simplifies the package structures as there is no real need to install + the packages into /usr/share/thunderbird and linking them back. + + -- Carsten Schoenert Fri, 09 Oct 2020 19:49:45 +0200 + +thunderbird (1:78.3.1-2) unstable; urgency=medium + + * [649f664] rebuild patch queue from patch-queue branch + added patches: + fixes/reduce-the-rust-debuginfo-level-on-selected-architectures.patch + porting-s390x/Explicitly-instantiate-TIntermTraverser-traverse-TIntermN.patch + + -- Carsten Schoenert Wed, 30 Sep 2020 19:10:27 +0200 + +thunderbird (1:78.3.1-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [6bd965f] New upstream version 78.3.1 + Fixed CVE issues in upstream version 78.3.1 (MFSA 2020-44): + CVE-2020-15677: Download origin spoofing via redirect + CVE-2020-15676: XSS when pasting attacker-controlled data into a + contenteditable element + CVE-2020-15678: When recursing through layers while scrolling, an iterator + may have become invalid, resulting in a potential + use-after-free scenario + CVE-2020-15673: Memory safety bugs fixed in Thunderbird 78.3 + * [8ba13c5] rebuild patch queue from patch-queue branch + added patches(picked from firefox packaging): + fixes/Add-missing-bindings-for-mips-in-the-authenticator-crate.patch + porting-mips/Bug-1642265-MIPS64-Add-branchTestSymbol-and-fallibleUnbox.patch + porting-mips/Bug-1649655-MIPS-Add-CodeGenerator-visitWasmRegisterResul.patch + porting/Bug-1666646-Bump-CodeAlignment-to-8-in-MacroAssembler-non.patch + removed patch(fixed upstream): + fixes/Bug-1664607-Don-t-try-to-load-what-s-new-page-when-built-.patch + * [c6d282d] calendar-google-provider*: removing left over cruft + There are two left over sequencer files from the calendar-google-package, + not need any more since 1:68.2.2-1 + * [cf37615] d/README.Debian: Update and adding new information + Some updated information regarding the now included OpenPGP support, also + updating some grammar for 'Add-on'. + * [faf225b] thunderbird.NEWS: Add hint about integration of OpenPGP support + Giving the user a information about the OpenPGP status within Thunderbird + since the version 78.0. + * [d6f4f0e] Revert "d/tb.lintian-overrides: ignore warning about none + versioned breaks" + * [9e6cbec] d/copyright: update content + + -- Carsten Schoenert Sun, 27 Sep 2020 09:08:29 +0200 + +thunderbird (1:78.2.2-1) experimental; urgency=medium + + * [c6592e8] New upstream version 78.2.2 + * [28f5fce] rebuild patch queue from patch-queue branch + added patches: + fixes/Bug-1664607-Don-t-try-to-load-what-s-new-page-when-built-.patch + porting-s390x/Use-more-recent-embedded-version-of-sqlite3.patch + * [4866c06] d/mozconfig.default: add extra config options for ppc64el + + -- Carsten Schoenert Sun, 13 Sep 2020 08:58:44 +0200 + +thunderbird (1:78.2.1-1) experimental; urgency=medium + + * [1f3f76b] d/rules: drop C{,XX}FLAGS originally intended for GCC6 + * [4490e37] d/mozconfig.default: add options for mips64el + * [17b4e5c] d/rules: Don't build debug symbols on 32Bit arch + * [6dff7e0] d/rules: adding -Wl,--as-needed to linker flags + * [a213a7f] New upstream version 78.2.1 + + -- Carsten Schoenert Sun, 30 Aug 2020 14:38:17 +0200 + +thunderbird (1:78.2.0-1) experimental; urgency=medium + + [ intrigeri ] + * [f6fcafd] d/control: drop hard dependency on libgtk2.0-0 + (Closes: #908654) + * [85b7a2e] autopkgtests: fix typo in comment + * [4bd70ae] d/mozconfig.default: fix typos in comments + * [d986a6d] d/control: allow Enigmail 2.2.0 and newer + (Closes: #968707) + + [ Carsten Schoenert ] + * [52b4006] d/control: increase B-D for libnss3 + (Closes: #966805) + * [7794563] New upstream version 78.2.0 + Fixed CVE issues in upstream version 78.2.0 (MFSA 2020-41): + CVE-2020-15663: Downgrade attack on the Mozilla Maintenance Service could + have resulted in escalation of privilege + CVE-2020-15664: Attacker-induced prompt for extension installation + CVE-2020-15670: Memory safety bugs fixed in Thunderbird 78.2 + * [623f853] rebuild patch queue from patch-queue branch + No modifications made, just updating the index. + + -- Carsten Schoenert Wed, 26 Aug 2020 20:41:28 +0200 + +thunderbird (1:78.1.1-1) experimental; urgency=medium + + * [5fb842b] d/mozconfig.default: adding new option regarding Add-Ons + Adding additional options --allow-addon-sideload and + --with-unsigned-addon-scopes=app,system. These option are adopted and + taken from the firefox package. + * [8de0b35] New upstream version 78.1.1 + * [4abe5ed] d/copyright: update content + Some small updates to the copyright information. + * [3caa541] d/control: adding new B-D for botan and json-c + The upstream source now offers the possibility to use the system + libraries for botan and json-c, for this we need to have both libraries + installed for building Thunderbird. + * [251d524] d/mozconfig.default: use botan and json-c system libraries + Turn on the configuration flags for botan and also for json-c that let + the build use the installed provided system libraries instead of using + internal versions. + * [a32a163] rebuild patch queue from patch-queue branch + removed patch: + debian-hacks/stop-configure-if-with-system-bz2-was-passed-but-no-.patch + Upstream has now (again) a configure option for using a installed system + bzip2 library that makes our added patch for this not needed anymore. + * [16c91c0] lintian: remove override for embedded bzip2 in librnp.so + + -- Carsten Schoenert Sat, 08 Aug 2020 19:16:08 +0200 + +thunderbird (1:78.1.0-1) experimental; urgency=medium + + * [c4099cd] New upstream version 78.1.0 + Fixed CVE issues in upstream version 78.1.0 (MFSA 2020-33): + CVE-2020-15652: Potential leak of redirect targets when loading scripts in + a worker + CVE-2020-6514: WebRTC data channel leaks internal address to peer + CVE-2020-15655: Extension APIs could be used to bypass Same-Origin Policy + CVE-2020-15653: Bypassing iframe sandbox when allowing popups + CVE-2020-6463: Use-after-free in ANGLE gl::Texture::onUnbindAsSamplerTexture + CVE-2020-15656: Type confusion for special arguments in IonMonkey + CVE-2020-15658: Overriding file type when saving to disk + CVE-2020-15657: DLL hijacking due to incorrect loading path + CVE-2020-15654: Custom cursor can overlay user interface + CVE-2020-15659: Memory safety bugs fixed in Thunderbird 78.1 + + -- Carsten Schoenert Fri, 31 Jul 2020 19:35:57 +0200 + +thunderbird (1:78.0.1-1) experimental; urgency=medium + + * [5450d8d] d/control: increase B-D for libnss3 + * [9749d1d] d/control: drop B-D on python2 and move over to python3 + * [b31360b] d/xpi-pack.sh: adding xpi-pack shell script + * [89ede80] Drop mozilla-devscripts as B-D + * [f3b2ced] New upstream version 78.0.1 + * [1847202] d/tb.lintian-overrides: ignore warning about none versioned + breaks + * [d56c922] d/lightning.links: removing left over sequencer file + + -- Carsten Schoenert Wed, 22 Jul 2020 20:11:25 +0200 + +thunderbird (1:78.0-1) experimental; urgency=medium + + * [1016cc5] New upstream version 78.0 + Fixed CVE issues in upstream version 78.0 (MFSA 2020-29): + CVE-2020-12415: AppCache manifest poisoning due to url encoded character + processing + CVE-2020-12416: Use-after-free in WebRTC VideoBroadcaster + CVE-2020-12417: Memory corruption due to missing sign-extension for + ValueTags on ARM64 + CVE-2020-12418: Information disclosure due to manipulated URL object + CVE-2020-12419: Use-after-free in nsGlobalWindowInner + CVE-2020-12420: Use-After-Free when trying to connect to a STUN server + CVE-2020-15648: X-Frame-Options bypass using object or embed tags + CVE-2020-12402: RSA Key Generation vulnerable to side-channel attack + CVE-2020-12421: Add-On updates did not respect the same certificate trust + rules as software updates + CVE-2020-12422: Integer overflow in nsJPEGEncoder::emptyOutputBuffer + CVE-2020-12424: WebRTC permission prompt could have been bypassed by a + compromised content process + CVE-2020-12425: Out of bound read in Date.parse() + CVE-2020-12426: Memory safety bugs fixed in Thunderbird 78 + * [ad66b04] rebuild patch queue from patch-queue branch + reworked patch: + porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + * [4a2039c] d/mozconfig.default: enable OpenPGP feature build + + -- Carsten Schoenert Thu, 16 Jul 2020 19:15:25 +0200 + +thunderbird (1:78.0~b2-1) experimental; urgency=medium + + * [c8da927] d/source.filter: fix obviously happen typo + * [c513a96] New upstream version 78.0~b2 + * [6e9104e] d/control: tb, adding binary version to lightning provides + Make the Provides for Lightning a versioned provide. + * [8adec8f] enigmail: let any version of Enigmail break + We now can break on any Enigmail version, the Enigmail functions are now + included in Thunderbird and don't want to have an Enigmail package get + installed in parallel. + * [696b1fc] xul-ext-*/webext-*: adding more extensions to break + Quite all of the current packaged Thunderbird extensions will not work + for now with Thunderbird 78.*, adding/renaming the current know packages + with recent versions to Breaks for thunderbird. + * [e488d0c] thunderbird: remove some non-existing packages from Breaks + The listed packages + xul-ext-foxyproxy-standard + xul-ext-gnome-keyring + xul-ext-nostalgy + aren't in any supported release so we don't need them any more within a + Breaks for thunderbird. + * [039ee90] thunderbird: remove outdated myspell packages from Breaks + All previously listed myspell packages in Breaks for thunderbird aren't + reachable with the given version any more. We can remove them safely. + * [08ea0ba] thunderbird: remove outdated hunspell packages from Breaks + The same is true for the hunspell packages that were listed in the Breaks + field for thunderbird. + + -- Carsten Schoenert Sat, 20 Jun 2020 18:04:59 +0200 + +thunderbird (1:78.0~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [625efa9] d/source.filter: some updates to filtering list + Recent modification of the shipped files in the upstream tarball do + require small updates of the filter list we use to repack the tarball. + * [967ee19] New upstream version 78.0~b1 + * [240991e] rebuild patch queue from patch-queue branch + removed patch: + debian-hacks/use-icudt-b-l-.dat-depending-on-architecture.patch + This will require some additional adjustment later for the stable-security + uploads as this patch was required to get a recent ICU version build + before the build of the thunderbird sources did start. + reworked patch: + debian-hacks/stop-configure-if-with-system-bz2-was-passed-but-no-.patch + * [07cab53] d/mozconfig.default: remove no longer existing options + By this release a lot of old configure options are kicked out, some of + them we have used until now. We need to remove these from the config. + * [df2e99b] d/copyright: update content + As usual some required update of the copyright file, more files are not + shipped anymore. + + [ intrigeri ] + * [82a4b03] AppArmor: update profile from upstream at commit 860d2d9 + (cherry-picked from unstable) + + -- Carsten Schoenert Sat, 13 Jun 2020 20:01:39 +0200 + +thunderbird (1:77.0~b3-1) experimental; urgency=medium + + * [82de2f6] New upstream version 77.0~b3 + * [8beaf6f] rebuild patch queue from patch-queue branch + removed patch (included upstream): + fixes/Bug-1634994-fix-disable-av1-r-tnikkel.patch + * [ab2d7a2] d/copyright: Add license for appstream xml file + * [1533187] d/source.filter: Remove some *.wasm files as well + * [7cdfe03] d/thunderbird.lintian-overrides: Some more needed overrides + We need currently the included bzip library. Also add a false positive + about the misread postinst script. + * [9385fd4b] d/control: Remove doubled listed package libglib2.0-dev + Drop a doubled listed package libglib2.0-dev within B-D. + + -- Carsten Schoenert Wed, 20 May 2020 20:58:09 +0200 + +thunderbird (1:77.0~b2-1) experimental; urgency=medium + + * [185d4f7] New upstream version 77.0~b2 + * [e918036] rebuild patch queue from patch-queue branch + removed patch: + fixes/Bug-1635671-Upgrade-typename-to-1.12.0.-r-emilio.patch + * [c1979ce] d/mozconfig.default: Remove obsolete options + Drop the options '--with-distribution-id' and '--with-user-appdir'. + The former is basically only supporting the given default 'org.mozilla' + and the latter was set to the default '.mozilla' anyway. + + -- Carsten Schoenert Sat, 16 May 2020 14:04:02 +0200 + +thunderbird (1:77.0~b1-1) experimental; urgency=medium + + * [ee06e6e] New upstream version 77.0~b1 + * [a21b649] rebuild patch queue from patch-queue branch + removed patches (not needed any more): + lower-down-required-version-on-NSS3.patch + + added patches: + fixes/Bug-1634994-fix-disable-av1-r-tnikkel.patch + fixes/Bug-1635671-Upgrade-typename-to-1.12.0.-r-emilio.patch + * [295cc4d] d/control: increase B-D for libnss3 + The build requires now libnss3-dev >= 2:3.52. + * [f998baf] lintian-overrides: remove overrides for kinto-http-client.js + No override needed for this file, it's not included any more. + + -- Carsten Schoenert Fri, 08 May 2020 15:18:44 +0200 + +thunderbird (1:76.0~b2-1) experimental; urgency=medium + + * [87988db] d/control: increase B-D for cargo to 0.42 + * [b9b0dfd] rebuild patch queue from patch-queue branch + removed patch: + debian-hacks/Ignore-version-check-for-cargo.patch + * [8386db0] d/control: Remove B-D on libjson-dev and libsqlite3-dev + The built uses internal copies for libjson and libsqlite as there are + made modifications to them. For now we can decrease the list of build + dependencies by removing this two packages. + * [6324222] New upstream version 76.0~b2 + * [629b3bb] d/rules: Remove default compiler flag + No needed for '-Wl,--as-needed' any more, it's default now. + + -- Carsten Schoenert Mon, 27 Apr 2020 09:55:43 +0200 + +thunderbird (1:76.0~b1-1) experimental; urgency=medium + + * [b52cd52] d/c-thunderbird-l10n-tarball.sh: change upstream resource + Upstream has changed the folder were we can find the language providing + XPI packages. They simply moved over from linux-i686 to linux-x86_64. + * [22e697a] d/rules: drop set up of LIGHTNING_VERSION variable + We don't need this variable any more for building the packages (like all + the lightning-foo named stuff), there is no dedicated Lighting named stuff + around. + * [4ad871b] d/gbp.conf: Remove additional tarball for lightning-l10n + git-buildpackage won't find this additional tarball as it's not needed + starting by the import of the next upstream version (this is 76.0b1). + * [25d8d42] d/c-l-l10n-t.sh: Remove helper script + We also don't need to build the l10n specific additional tarball for + Lighting related parts any more. Dropping this helper script. + * [9d33d06] d/README.source: Remove part of lightning-l10n + * [b063d7f] New upstream version 76.0~b1 + * [e7a23ec] rebuild patch queue from patch-queue branch + removed patches (not needed or included upstream): + debian-hacks/Build-against-system-libjsoncpp.patch + debian-hacks/Downgrade-SQlite-version-to-3.27.2.patch + fixes/Bug-1531309-Don-t-use-__PRETTY_FUNCTION__-or-__FUNCTION__.patch + fixes/Bug-1560340-Only-add-confvars.sh-as-a-dependency-to-confi.patch + + added patches: + debian-hacks/Ignore-version-check-for-cargo.patch + lower-down-required-version-on-NSS3.patch + * [94d8593] d/control: adding new packages thunderbird-l10n-{cak,kab,uz} + After the final release of Thunderbird 68.0 new l10n support for the + languages Kacqhikel, Georgian and Uzbek was added. Reflect this by adding + new binary packages for those languages. + * [5397182] d/mozconfig.default: remove option for system-sqlite + Upstream is using their own version of an modified SQLite now and has + dropping the additional configure option about this. + * [abb0ded] d/control: increase various versions in B-D + The current source requires some more recent versions of the helping tools + for building the sources as usual. + * [abfc8b2] d/rules: remove any action related to old lightning stuff + As the sources doesn't have any Lightning specific parts any more we need + to adjust the build process within debian/rules a bit. Thus dropping all + the rules around Lighting things. + * [f95b3ad] d/control: Turn lightning into transitional package + For now switch the behaviour of the lightning package into a transitional + one. We might can drop the whole package rather soon. + * [c3062cb] d/thunderbird.install: Remove blocklist.xml + Don't install the file blocklist.xml any more, it's now not shipped by + upstream any more. + * [856e99e] d/mozconfig.thunderbird: Remove --enable-calendar + Previously the build of the Lightning extension was needed to get enabled + to built this as an extension. Now it's fully integrated into the core + this configure option isn't needed any longer. + * [5551a8a] d/copyright: update content + As usual there is some moving within the source code between the major + versions, reflect this by adjusting the content of the copyright file. + * [21e9b7f] lintian-overrides: adjust overrides for needed files + Also the override file for the source is needing some adjustments. + * [f25ddc4] d/source.filter: update the filter sequences + The control for filtering non needed stuff from the upstream tarball must + also get adjusted due changed versions, moved folders etc. + * [e4a81ba] d/thunderbird.install: Install also appdata.xml + Upstream is providing an AppStream data file which we want install mow + also. + * [80385c9] d/source.filter: Sorting entries alphabetically + No functional modifications, just sorting entries to find stuff more easily. + * [585cf0a] d/thunderbird.lintian-overrides: update after config changes + We also need to modify the content for Lintian overrides for the + thunderbird package a bit. Thunderbird comes now (again) with own versions + of the libraries libtheora and libjsoncpp. Mostly because Mozilla has made + some own modifications within these libraries. + + -- Carsten Schoenert Sat, 18 Apr 2020 08:28:25 +0200 + +thunderbird (1:68.12.0-1) unstable; urgency=medium + + * [103cab7] New upstream version 68.12.0 + Fixed CVE issues in upstream version 68.11.0 (MFSA 2020-35): + CVE-2020-15663: Downgrade attack on the Mozilla Maintenance Service could + have resulted in escalation of privilege + CVE-2020-15664: Attacker-induced prompt for extension installation + CVE-2020-15669: Use-After-Free when aborting an operation + + -- Carsten Schoenert Thu, 27 Aug 2020 21:23:55 +0200 + +thunderbird (1:68.11.0-3) unstable; urgency=medium + + * [28707fd] d/xpi-pack.sh: adding xpi-pack shell script + As we can't depend on mozilla-devscripts anymore we pick up the shell + script from that package as this builds XPI files we need. + * [037212e] Drop mozilla-devscripts as B-D + mozilla-devscripts isn't ported to Python3 yet and depends on Python2 so. + We don't need that package as B-D as we picked the main shell script from + that and we can drop that package from the build dependencies. + * [31eda41] Drop python-{minimal,ply} from B-D + These packages are removed from teh archive and we don't need them for + building Thunderbird as long we have python2 as package available. + (Closes: #967223) + + -- Carsten Schoenert Tue, 04 Aug 2020 19:06:20 +0200 + +thunderbird (1:68.11.0-2) unstable; urgency=medium + + * [110a375] d/control: increase B-D for libnss3 + * [73fa23e] d/control: tb manually set dep on libnss3 to 2:3.55 + (Closes: #966806) + + -- Carsten Schoenert Sun, 02 Aug 2020 20:12:49 +0200 + +thunderbird (1:68.11.0-1) unstable; urgency=medium + + * [093b080] New upstream version 68.11.0 + Fixed CVE issues in upstream version 68.11.0 (MFSA 2020-35): + CVE-2020-15652: Potential leak of redirect targets when loading scripts + in a worker + CVE-2020-6514: WebRTC data channel leaks internal address to peer + CVE-2020-6463: Use-after-free in ANGLE gl::Texture::onUnbindAsSamplerTexture + CVE-2020-15659: Memory safety bugs fixed in Thunderbird 68.11 + + -- Carsten Schoenert Wed, 29 Jul 2020 22:26:14 +0200 + +thunderbird (1:68.10.0-1) unstable; urgency=medium + + * [7537684] New upstream version 68.10.0 + Fixed CVE issues in upstream version 68.10.0 (MFSA 2020-26): + CVE-2020-12417: Memory corruption due to missing sign-extension for + ValueTags on ARM64 + CVE-2020-12418: Information disclosure due to manipulated URL object + CVE-2020-12419: Use-after-free in nsGlobalWindowInner + CVE-2020-12420: Use-After-Free when trying to connect to a STUN server + MFSA-2020-0001: Automatic account setup leaks Microsoft Exchange login + credentials + CVE-2020-12421: Add-On updates did not respect the same certificate trust + rules as software updates + + -- Carsten Schoenert Sat, 04 Jul 2020 10:55:31 +0200 + +thunderbird (1:68.9.0-1) unstable; urgency=medium + + [ intrigeri ] + * [fd13825] AppArmor: update profile from upstream at commit 860d2d9 + (Closes: #960465) + + [ Carsten Schoenert ] + * [c310c40] New upstream version 68.9.0 + Fixed CVE issues in upstream version 68.9.0 (MFSA 2020-22): + CVE-2020-12399: Timing attack on DSA signatures in NSS library + CVE-2020-12405: Use-after-free in SharedWorkerService + CVE-2020-12406: JavaScript Type confusion with NativeTypes + CVE-2020-12410: Memory safety bugs fixed in Thunderbird 68.9.0 + CVE-2020-12398: Security downgrade with IMAP STARTTLS leads to + information leakage + + -- Carsten Schoenert Fri, 05 Jun 2020 20:29:35 +0200 + +thunderbird (1:68.8.1-1) unstable; urgency=medium + + * [7495e7a] New upstream version 68.8.1 + + -- Carsten Schoenert Fri, 22 May 2020 19:04:20 +0200 + +thunderbird (1:68.8.0-1) unstable; urgency=medium + + * [9b5ae46] New upstream version 68.8.0 + Fixed CVE issues in upstream version 68.8.0 (MFSA 2020-18): + CVE-2020-12397: Sender Email Address Spoofing using encoded Unicode + characters + CVE-2020-12387: Use-after-free during worker shutdown + CVE-2020-6831: Buffer overflow in SCTP chunk input validation + CVE-2020-12392: Arbitrary local file access with 'Copy as cURL' + CVE-2020-12393: Devtools' 'Copy as cURL' feature did not fully escape + website-controlled data, potentially leading to command + injection + CVE-2020-12395: Memory safety bugs fixed in Thunderbird 68.8.0 + + -- Carsten Schoenert Tue, 05 May 2020 20:47:29 +0200 + +thunderbird (1:68.7.0-1) unstable; urgency=medium + + * [c0052af] New upstream version 68.7.0 + Fixed CVE issues in upstream version 68.7.0 (MFSA 2020-14): + CVE-2020-6819: Use-after-free while running the nsDocShell destructor + CVE-2020-6820: Use-after-free when handling a ReadableStream + CVE-2020-6821: Uninitialized memory could be read when using the WebGL + copyTexSubImage method + CVE-2020-6822: Out of bounds write in GMPDecodeData when processing large + images + CVE-2020-6825: Memory safety bugs fixed in Thunderbird 68.7 + + -- Carsten Schoenert Sun, 12 Apr 2020 07:40:41 +0200 + +thunderbird (1:68.6.0-1) unstable; urgency=medium + + * [5709774] New upstream version 68.6.0 + Fixed CVE issues in upstream version 68.6.0 (MFSA 2020-10): + CVE-2019-20503: Out of bounds reads in sctp_load_addresses_from_init + CVE-2020-6805: Use-after-free when removing data about origins + CVE-2020-6806: BodyStream::OnInputStreamReady was missing protections + against state confusion + CVE-2020-6807: Use-after-free in cubeb during stream destruction + CVE-2020-6811: Devtools' 'Copy as cURL' feature did not fully escape + website-controlled data, potentially leading to + command injection + CVE-2020-6812: The names of AirPods with personally identifiable + information were exposed to websites with camera or + microphone permission + CVE-2020-6814: Memory safety bugs fixed in Thunderbird 68.6 + + -- Carsten Schoenert Mon, 16 Mar 2020 20:01:29 +0100 + +thunderbird (1:68.5.0-1) unstable; urgency=medium + + * [d79bf82] New upstream version 68.5.0 + Fixed CVE issues in upstream version 68.5.0 (MFSA 2020-07): + CVE-2020-6793: Out-of-bounds read when processing certain email messages + CVE-2020-6794: Setting a master password post-Thunderbird 52 does not + delete unencrypted previously stored passwords + CVE-2020-6795: Crash processing S/MIME messages with multiple signatures + CVE-2020-6798: Incorrect parsing of template tag could result in + JavaScript injection + CVE-2020-6792: Message ID calculcation was based on uninitialized data + CVE-2020-6800: Memory safety bugs fixed in Thunderbird 68.5 + (Closes: #891848) + * [0884df6] d/control: increase Standards-Version to 4.5.0 + No further changes needed. + + -- Carsten Schoenert Thu, 13 Feb 2020 17:58:44 +0100 + +thunderbird (1:68.4.2-1) unstable; urgency=medium + + * [7ab7786] d/gbp.conf: add some more files we need to filter out + * [9c02c34] New upstream version 68.4.2 + + -- Carsten Schoenert Sun, 26 Jan 2020 13:13:49 +0100 + +thunderbird (1:68.4.1-1) unstable; urgency=medium + + * [a00f3e9] New upstream version 68.4.1 + Fixed CVE issues in upstream version 68.4.1 (MFSA 2020-04): + CVE-2019-17026: IonMonkey type confusion with StoreElementHole and + FallibleStoreElement + CVE-2019-17015: Memory corruption in parent process during new content + process initialization on Windows + CVE-2019-17016: Bypass of @namespace CSS sanitization during pasting + CVE-2019-17017: Type Confusion in XPCVariant.cpp + CVE-2019-17022: CSS sanitization does not escape HTML tags + CVE-2019-17024: Memory safety bugs fixed in Thunderbird 68.4.1 + * [6b1fd82] rebuild patch queue from patch-queue branch + removed patch (included upstream) + fixes/Update-bindgen-in-ESR68.-r-glandium-a-RyanVM.patch + + -- Carsten Schoenert Fri, 10 Jan 2020 18:33:43 +0100 + +thunderbird (1:68.3.1-1) unstable; urgency=medium + + [ Emilio Pozuelo Monfort ] + * [6f59313] Fix MOZ_BUILD_DATE to have the expected format + + [ Carsten Schoenert ] + * [5d0f4b1] d/rules: don't use SOURCE_DATE_EPOCH for MOZ_BUILD_DATE + (Closes: #946588) + * [1467af5] New upstream version 68.3.1 + + -- Carsten Schoenert Wed, 18 Dec 2019 15:54:44 +0100 + +thunderbird (1:68.3.0-2) unstable; urgency=medium + + * [0625d30] rebuild patch queue from patch-queue branch + added patches: + fixes/Bug-1531309-Don-t-use-__PRETTY_FUNCTION__-or-__FUNCTION__.patch + fixes/Update-bindgen-in-ESR68.-r-glandium-a-RyanVM.patch + * [ea8d98c] Breaks: add versioned birdtray package + + -- Carsten Schoenert Mon, 09 Dec 2019 18:22:15 +0100 + +thunderbird (1:68.3.0-1) unstable; urgency=medium + + * [fe289ec] /u/b/thunderbird: export variable DICPATH before start + (Closes: #944295) + * [a9a48c6] New upstream version 68.3.0 + Fixed CVE issues in upstream version 68.3 (MFSA 2019-38): + CVE-2019-17008: Use-after-free in worker destruction + CVE-2019-13722: Stack corruption due to incorrect number of arguments in + WebRTC code + CVE-2019-11745: Out of bounds write in NSS when encrypting with a block + cipher + CVE-2019-17009: Updater temporary files accessible to unprivileged + processes + CVE-2019-17010: Use-after-free when performing device orientation checks + CVE-2019-17005: Buffer overflow in plain text serializer + CVE-2019-17011: Use-after-free when retrieving a document in + antitracking + CVE-2019-17012: Memory safety bugs fixed in Firefox 71, Firefox ESR + 68.3, and Thunderbird 68.3 + * [fb23473] d/control: increase B-D version on NSS to 3.44.3 + * [6f59938] Breaks: adding more non compatible packaged AddOns + + -- Carsten Schoenert Thu, 05 Dec 2019 10:03:22 +0100 + +thunderbird (1:68.2.2-1) unstable; urgency=medium + + * [198d539] xul-ext-compactheader: allow also version << 3.0.0 + * [0e93753] d/control: add incompatibility with jsunit << 0.2.2 + * [87c84cb] New upstream version 68.2.2 + This upstream version has removed the source for calendar-google-provider, + thus we can't provide the related binary package any more. + * [a3cea2a] rebuild patch queue from patch-queue branch + rebuild patch queue from patch-queue branch + + removed patches (included upstream): + debian/patches/fixes/Bug-1470701-Use-run-time-page-size-when-changing-map.patch + debian/patches/fixes/Bug-1505608-Try-to-ensure-the-bss-section-of-the-elf.patch + debian/patches/fixes/Bug-1526744-find-dupes.py-Calculate-md5-by-chunk.patch + debian/patches/fixes/Build-also-gdata-provider-as-xpi-file.patch + debian/patches/fixes/rust-ignore-not-available-documentation.patch + debian/patches/porting-kfreebsd-hurd/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch + debian/patches/porting-mips/Bug-1444303-MIPS-Fix-build-failures-after-Bug-1425580-par.patch + debian/patches/porting-mips/Bug-1444834-MIPS-Stubout-MacroAssembler-speculationBarrie.patch + debian/patches/porting-powerpc/powerpc-Don-t-use-static-page-sizes-on-powerpc.patch + debian/patches/porting-sparc64/Bug-1434726-Early-startup-crash-on-Linux-sparc64-in-HashI.patch + * [1730f5f] d/control: remove references to calendar-google-provider + Don't build calendar-google-provider any more and remove any references + from other binary packages. + * [1b0bbb8] d/rules: remove any calendar-google-provider stuff + * [92f681c] thunderbird.NEWS: Adding hint about removal of gdata + Give out an announcement about the removal of a possible previously + installed package calendar-google-provider. + + -- Carsten Schoenert Sun, 10 Nov 2019 12:09:17 +0100 + +thunderbird (1:68.2.1-1) unstable; urgency=medium + + [ intrigeri ] + * [c48e2cb] AppArmor: update profile from upstream at commit a27a1a5 + (Closes: #941290) + + [ Carsten Schoenert ] + * [98497ae] New upstream version 68.2.0 + Fixed CVE issues in upstream version 68.2 (MFSA 2019-35): + CVE-2019-15903: Heap overflow in expat library in XML_GetCurrentLineNumber + CVE-2019-11757: Use-after-free when creating index updates in IndexedDB + CVE-2019-11758: Potentially exploitable crash due to 360 Total Security + CVE-2019-11759: Stack buffer overflow in HKDF output + CVE-2019-11760: Stack buffer overflow in WebRTC networking + CVE-2019-11761: Unintended access to a privileged JSONView object + CVE-2019-11762: document.domain-based origin isolation has + same-origin-property violation + CVE-2019-11763: Incorrect HTML parsing results in XSS bypass technique + CVE-2019-11764: Memory safety bugs fixed in Thunderbird 68.2 + (Closes: #925841) + * [a104c51] d/control: increase Standards-Version to 4.4.1 + * [6c9d012] xul-ext-dispmua: set current min usable version + * [b3bf16f] New upstream version 68.2.1 + * [8f89b90] d/control: decrease build architecture list + Decreasing the current list of build architectures. Not meant to keep this + forever, removed RC architectures needing support and volunteering to get + them back. + (Closes: #921258) + + -- Carsten Schoenert Fri, 01 Nov 2019 20:36:59 +0100 + +thunderbird (1:68.1.2-1~exp1) experimental; urgency=medium + + * [81f4144] xul-ext-compactheader: increase minimal usable version + * [a815589] Update the global information about TB in Debian + * [bb5f5f7] rebuild patch queue from patch-queue branch + * [6fe7d3f] xul-ext-sogo-connector: increase minimal usable version + * [2e29af5] New upstream version 68.1.2 + + -- Carsten Schoenert Sat, 26 Oct 2019 08:41:50 +0200 + +thunderbird (1:68.1.1-1~exp1) experimental; urgency=medium + + [ intrigeri ] + * [3f49653] AppArmor: update profile from upstream at commit ed52e4a + + [ Carsten Schoenert ] + * [348f476] New upstream version 68.0~b5 + * [2a2f101] New upstream version 68.1.1 + Fixed CVE issues in upstream version 68.1 (MFSA 2019-20): + CVE-2019-11711: Script injection within domain through inner window reuse + CVE-2019-11712: Cross-origin POST requests can be made with NPAPI plugins + by following 308 redirects + CVE-2019-11713: Use-after-free with HTTP/2 cached stream + CVE-2019-11714: NeckoChild can trigger crash when accessed off of main + thread + CVE-2019-11729: Empty or malformed p256-ECDH public keys may trigger a + segmentation fault + CVE-2019-11715: HTML parsing error can contribute to content XSS + CVE-2019-11716: globalThis not enumerable until accessed + CVE-2019-11717: Caret character improperly escaped in origins + CVE-2019-11719: Out-of-bounds read when importing curve25519 private key + CVE-2019-11720: Character encoding XSS vulnerability + CVE-2019-11721: Domain spoofing through unicode latin 'kra' character + CVE-2019-11730: Same-origin policy treats all files in a directory as + having the same-origin + CVE-2019-11723: Cookie leakage during add-on fetching across private + browsing boundaries + CVE-2019-11724: Retired site input.mozilla.org has remote troubleshooting + permissions + CVE-2019-11725: Websocket resources bypass safebrowsing protections + CVE-2019-11727: PKCS#1 v1.5 signatures can be used for TLS 1.3 + CVE-2019-11728: Port scanning through Alt-Svc header + CVE-2019-11710: Memory safety bugs fixed in Firefox 68 and Thunderbird 68 + CVE-2019-11709: Memory safety bugs fixed in Firefox 68, Firefox ESR 60.8, + and Thunderbird 68 + + Fixed CVE issues in upstream version 68.1 (MFSA 2019-20): + CVE-2019-11739: Covert Content Attack on S/MIME encryption using a crafted + multipart/alternative message + CVE-2019-11746: Use-after-free while manipulating video + CVE-2019-11744: XSS by breaking out of title and textarea elements using + innerHTML + CVE-2019-11742: Same-origin policy violation with SVG filters and canvas + to steal cross-origin images + CVE-2019-11752: Use-after-free while extracting a key value in IndexedDB + CVE-2019-11743: Cross-origin access to unload event attributes + CVE-2019-11740: Memory safety bugs fixed in Firefox 69, Firefox ESR 68.1, + Firefox ESR 60.9, Thunderbird 68.1, and Thunderbird 60.9 + + Fixed CVE issues in upstream version 68.1.1 (MFSA 2019-32): + CVE-2019-11755: Spoofing a message author via a crafted S/MIME message + + * [9342624] rebuild patch queue from patch-queue branch + added patches: + debian-hacks/Set-program-name-from-the-remoting-name.patch + debian-hacks/Use-remoting-name-for-call-to-gdk_set_program_class.patch + debian-hacks/Work-around-Debian-bug-844357.patch + fixes/Allow-.js-preference-files-to-set-locked-prefs-with-lockP.patch + fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch + fixes/Bug-1560340-Only-add-confvars.sh-as-a-dependency-to-confi.patch + porting-armhf/Bug-1526653-Include-struct-definitions-for-user_vfp-and-u.patch + + removed patch (fixed upstream): + porting-mips/Fix-CPU_ARCH-test-for-libjpeg-on-mips.patch + porting/Work-around-GCC-ICE-on-mips-i386-and-s390x.patch + + * [25cb500] d/control: increase various versions in B-D + * [ee5b713] d/control: remove B-D on librust-cbindgen-dev + Use librust-toml-dev instead, we only need some files from this package, + librust-cbindgen-dev is a metapackage which is broken while packaging. + * [442a6b1] d/rules: work around cargo needs a HOME dir + * [4894a4c] d/control: increase Standards-Version to 4.4.0 + No further changes needed. + * [bb47b68] d/control: update upstream homepage for Thunderbird + Since some time Mozilla Thunderbird has a new homepage placed on URI + https://www.thunderbird.net/ + * [a3b680e] d/source.filter: update the filter sequences + New Thunderbird upstream versions bringing some new unwanted files within + the source. + * [7290ff4] d/control: remove transitional lightning l10n packages + The Lightning l10n packages moved into transitional packages before Buster + was released, now after the Buster release removing these transitional + packages. All required l10n files are available in the packages + thunderbird-$(locale) even for Lightning. + * [3d1d27d] enigmail: increase minimal usable version + Thunderbird 68.x needs at least Enigmal in version 2.1, but increase the + version on Enigmail to the most recent version which is released while + packaging. + * [66069d9] calendar-exchange-provider: removed from Breaks + This package isn't alive in unstable and testing. + * [3b9f936] d/control: remove Xb-Xul-AppId field + Thunderbird don't has any Xul based AddOns since version 68.0 + * [7d8cd7d] lintian-overrides: remove not needed overrides + + -- Carsten Schoenert Sat, 28 Sep 2019 15:38:28 +0200 + +thunderbird (1:68.0~b1-1) experimental; urgency=medium + + * [0eabe70] New upstream version 68.0~b1 + * [2febf67] rebuild patch queue from patch-queue branch + added patch: + debian-hacks/Downgrade-SQlite-version-to-3.27.2.patch + * [cfa5973] d/s/lintian-overrides: adjust overrides for needed files + * [46077e2] d/copyright: update after upstream changes + + -- Carsten Schoenert Sun, 16 Jun 2019 10:28:52 +0200 + +thunderbird (1:67.0~b3-1) experimental; urgency=medium + + [ intrigeri ] + * [9ad75ad] d/rules: drop useless usage of dpkg-parsechangelog + + [ Carsten Schoenert ] + * [d6f6747] New upstream version 67.0~b3 + * [90f73be] rebuild patch queue from patch-queue branch + removed patch: + fixes/Bug-1515641-Turn-enable-av1-around.-r-nalexander.patch + * [7dd5c54] d/control: increase various B-D versions + Increasing the version for the build depending packages of cargo, cbindgen, + libnspr4-dev, libnss3-dev, libsqlite3-dev and rustc. + + -- Carsten Schoenert Tue, 11 Jun 2019 19:36:00 +0200 + +thunderbird (1:66.0~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [afe31d9] New upstream version 66.0~b1 + * [4ec53cc] apparmor: update profile from upstream (commit 7ace41b1) + (cherry-picked from debian/sid) + * [b3657a0] d/rules: make dh_clean more robust + Remove some regenerated files in dh_clean to the build will not fail in + case the build needs to be started twice within the same build environment. + (cherry-picked from debian/sid) + * [dceb027] d/rules: move disable debug option into configure step + Adding the option '--disable-debug-symbols' to the file mozconfig.default + in case the build is running on a 32bit architecture instead of expanding + the variable 'CONFIGURE_FLAGS'. The configuration approach for this option + taken from firefox-esr was not working for the thunderbird package. + (cherry-picked from debian/sid) + * [f7f02a9] d/rules: reorder LDFLAGS for better readability + Make the used additional options for LDFLAGS better readable by reordering + the various used options. Also adding the option '-Wl, --as-needed' to the + list of used options here. + (cherry-picked from debian/sid) + * [79801fb] d/rules: use 'compress-debug-sections' only on 64bit + Do not set 'LDFLAGS += -Wl,--compress-debug-sections=zlib' globally, lets + use this option only if we are on a 64bit architecture as otherwise the + build is failing on 32bit architectures again. We don't want to build any + debug information on 32bit anyway so we don't need this option on these + platforms. + (cherry-picked from debian/sid) + * [11f9e14] d/mozconfig.default: adding option for mipsel + We don't have set up any options for the mipsel platform before, but the + build needs some additional options too on this platform to succeed. + (cherry-picked from debian/sid) + * [e46e178] d/mozconfig.default: disable ion on mips and mipsel + The build will fail on mips{,el} if we have enabled ION, the JavaScript + JIT compiler on these platforms will loose some performance by this. + (cherry-picked from debian/sid) + + [ Alexander Nitsch ] + * [31b87e9] Make the logo SVG square + The original SVG source isn't completely square, modifying the SVG file + so all generated other files from the input are also exactly square. + * [c0f19a3] Add script for generating PNGs from logo SVG + * [c153c5f] Update icon PNGs to be properly scaled + + [ Carsten Schoenert ] + * [c372e1f] d/source.filter: add some configure scripts + Filter out some files that are named 'configure', they are rebuild later + anyway. The filtering of these files is moved from gbp.conf to + source.filter. + (cherry-picked from debian/sid) + * [a40c5df] d/c-lightning-l10n-t.sh: drop version checking + Remove an old check for a version string within the file install.rdf. + It's not created any more by upstream since > 60.0. + * [05b325e] d/source.filter: don't ignore files in root folder + Try to not ignore files which are in the top root folder of the upstream + source tarball. + * [d2ca267] rebuild patch queue from patch-queue branch + added patch: + fixes/Bug-1515641-Turn-enable-av1-around.-r-nalexander.patch + + modified (refreshed) patches: + porting-armel/Avoid-using-vmrs-vmsr-on-armel.patch + porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch + porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-hurd.patch + porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch + porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + porting-kfreebsd-hurd/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch + porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch + porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch + porting-m68k/Add-m68k-support-to-Thunderbird.patch + + removed patches (applied upstream): + fixes/Fix-big-endian-build-for-SKIA.patch + porting-kfreebsd-hurd/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch + porting-s390x/FTBFS-s390x-Use-jit-none-AtomicOperations-sparc.h-on-s390.patch + * [cb1dde9] d/control: increase version in B-D for libsqlite3-dev + * [54e8890] d/mozconfig.default: add new configure option + We need to disable the usage of libav1 for an successful build. The used + configure option was added by the new added patch to the patch queue. + * [ecd3ade] d/copyright: update after upstream changes + * [af58ed8] d/source.filter: add extra content to ignore + + -- Carsten Schoenert Sun, 17 Feb 2019 10:58:46 +0100 + +thunderbird (1:65.0~b1-1) experimental; urgency=medium + + * [e5956ef] Merge tag 'debian/1%60.4.0-1' into debian/experimental + * [389748b] d/source.filter: adjust files to filter while repack + Rework of the file filter list due new upstream version but also to no + filter out files we obviously need later, e.g. for the omni.jar archive. + * [4b86a78] New upstream version 65.0~b1 + * [3db29ed] rebuild patch queue from patch-queue branch + removed patches (fixed upstream): + debian-hacks/icu-use-locale.h-instead-of-xlocale.h.patch + debian-hacks/shellutil.py-ignore-tilde-as-special-character.patch + fixes/Build-also-gdata-provider-as-xpi-file.patch + fixes/Use-msse-2-fpmath-C-CXXFLAGS-only-on-x86_64-platforms.patch + porting-mips/Bug-1444303-MIPS-Fix-build-failures-after-Bug-1425580-par.patch + porting-mips/Bug-1444834-MIPS-Stubout-MacroAssembler-speculationBarrie.patch + porting-sparc64/Bug-1434726-Early-startup-crash-on-Linux-sparc64-in-HashI.patch + + removed patches (dropped for Debian specific build): + debian-hacks/Don-t-build-testing-suites-and-stuff.patch + debian-hacks/Don-t-build-testing-suites-and-stuff-part-2.patch + adjusted patches: + + debian-hacks/Add-another-preferences-directory-for-applications-p.patch + debian-hacks/stop-configure-if-with-system-bz2-was-passed-but-no-.patch + patches/fixes/Fix-big-endian-build-for-SKIA.patch (but currently disabled) + porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch + porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch + porting-s390x/FTBFS-s390x-Use-jit-none-AtomicOperations-sparc.h-on-s390.patch + * [e918c6c] d/control: increase versions in B-D + New Thunderbirds version typically need other packages available with + higher versions like NSS, NSPR, rust ... + Also adding cbindgen and nodejs()!!). + * [b6c63bf] d/mozconfig.default: remove dead options + More old configure option are now not available anymore and we need to + drop them. + * [0f959ad] remove GCC specific options + LLVM's clang is now widely used, and clang isn't knowing the GCC options + '-fno-schedule-insns2' and '-fno-lifetime-dse', removing these options + from CFLAGS and CXXFLAGS. + * [d0b1f4b] d/rules: work around about strong quotings in .mk files + After the configuration of the source some Makefiles in the build folder + 'obj-thunderbird' have a strong qouting on some entries. This will + later provoke a build failure if we don't remove the single quotes + before in the Makefiles. + * [093053e] copyright: update after upstream changes + * [95eaacf] d/s/lintian-overrides: adjust overrides for needed files + + -- Carsten Schoenert Sun, 20 Jan 2019 15:48:06 +0100 + +thunderbird (1:60.4.0-1) unstable; urgency=medium + + * [2e5a9d0] d/control: don't hard code LLVM packages in B-D + (Closes: #912797) + * [3aaa4a6] New upstream version 60.4.0 + No MFSA published yet by Mozilla Security while packaging this version. + (Closes: #913645) + * [12d3be3] debian/control: increase Standards-Version to 4.3.0 + No further changes needed. + + -- Carsten Schoenert Mon, 24 Dec 2018 17:04:10 +0100 + +thunderbird (1:60.3.1-1) unstable; urgency=medium + + * [e1b489a] New upstream version 60.3.1 + * [f376b38] lightning: use ${source:Version} in Breaks and Recommends + (Closes: #914175) + * [7e560b3] Revert "lintian: adding a semi automated lintian-override" + The override about a misspelled word Synopsys isn't needed any more. + * [893c0e6] rebuild patch queue from patch-queue branch + modified patches: + debian-hacks/Don-t-build-testing-suites-and-stuff.patch + debian-hacks/Don-t-build-testing-suites-and-stuff-part-2.patch + * [20d8827] d/source.filter: update the filter sequences + + -- Carsten Schoenert Sun, 25 Nov 2018 10:02:50 +0100 + +thunderbird (1:60.3.0-1) unstable; urgency=medium + + [ intrigeri ] + * [7949b31] AppArmor: update profile from upstream at commit f3d9a8b + (Closes: #903898) + * [e31dc14] AppArmor: update profile from upstream at commit 81c9457 + (Closes: #908206) + + [ Carsten Schoenert ] + * [0dcbe22] d/control: add xul-ext-gnome-keyring to Breaks for thunderbird + (Closes: #907979) + * [65db00d] armel: adding extra LDFLAGS so rust compiler isn't confused + The settings that are builtin within rust are conflicting with the GCC. + * [9c65884] New upstream version 60.3.0 + Fixed CVE issues in upstream version 60.3.0 (MFSA 2018-28) + CVE-2018-12392: Crash with nested event loops + CVE-2018-12393: Integer overflow during Unicode conversion while loading + JavaScript + CVE-2018-12389: Memory safety bugs fixed in Firefox ESR 60.3 and + Thunderbird 60.3 + CVE-2018-12390: Memory safety bugs fixed in Firefox 63, Firefox ESR 60.3, + and Thunderbird 60.3 + * [8726bb1] rebuild patch queue from patch-queue branch + removed patches (included upstream) + fixes/Bug-1479540-Accept-triplet-strings-with-only-two-parts-in.patch + fixes/Bug-1492064-Disable-baseline-JIT-when-SSE2-is-not-support.patch + fixes/Bug-1492065-Use-Swizzle-fallback-when-SSE2-is-not-support.patch + porting-mips/Add-struct-ucred-for-Linux-on-MIPS.patch + + -- Carsten Schoenert Thu, 01 Nov 2018 12:19:34 +0100 + +thunderbird (1:60.2.1-1) unstable; urgency=medium + + * [ba75ca3] logo: move old TB graphics into dedicated folder + * [ba47234] logo: adding new TB icon *.png graphics + Like Firefox Thunderbird has also got a reworked logo. As we use some own + icon created from a SVG graphic this commit adds the new icons in the + various sizes. The source of the SVG graphic is taken from + https://demo.identihub.co/thunderbird#/view/icon/element/612 + (Closes: #909108) + * [0b16a87] d/source.filter: don't remove react files from source + (Closes: #909046) + * [d01dfd6] rebuild patch queue from patch-queue branch + added patches: + fixes/Bug-1479540-Accept-triplet-strings-with-only-two-parts-in.patch + fixes/Bug-1482248-don-t-crash-on-empty-file-name-in-nsMsgLocalS.patch + fixes/Bug-1492064-Disable-baseline-JIT-when-SSE2-is-not-support.patch + fixes/Bug-1492065-Use-Swizzle-fallback-when-SSE2-is-not-support.patch + (Closes: #909628, #909039, #906816) + * [bf64065] New upstream version 60.2.1 + Fixed CVE issues in upstream version 60.2.1 (MFSA 2018-25) + CVE-2018-12377: Use-after-free in refresh driver timers + CVE-2018-12378: Use-after-free in IndexedDB + CVE-2018-12379: Out-of-bounds write with malicious MAR file + CVE-2018-12376: Memory safety bugs fixed in Firefox 62 and Firefox ESR 60.2 + CVE-2018-12385: Crash in TransportSecurityInfo due to cached data + CVE-2018-12383: Setting a master password post-Firefox 58 does not delete + unencrypted previously stored passwords + * [b4712af] rebuild patch queue from patch-queue branch + removed patches (fixed upstream): + fixes/Bug-1482248-don-t-crash-on-empty-file-name-in-nsMsgLocalS.patch + * [79057f6] d/control: make lightning-l10n packages transitional + The l10n content for Lightning and a specific language is now much more + related to the Thunderbird l10n content. By this the existing lightning + l10n packages are not really useful any more as we move the Lightning + l10n content into the respective Thunderbird l10n package a we need to + turn the existing Lightning l10n packages into transitional packages. + * [a0ac3b7] d/control: adding Replaces, Breaks, Provides to thunderbird-l10n-* + Related to the previous commit the Thunderbird l10n packages need some + more fields in the control file so the transition from lightning-l10n into + thunderbird-l10n can work. + * [c82ee7c] d/rules: install lightning l10n into thunderbird-l10n-* packages + The content for the lightning l10n stuff needs now to be installed into + thunderbird-l10n packages. + * [72cd535] d/control: add thunderbird-l10n-cy + Oops, seems like we never have introduced this language for Thunderbird + before. Now required to provide the l10n content for Lightning. + * [510bea6] d/thunderbird-wrapper.sh: improve GDB switch + Since TB 60 upstream isn't installing the old wrapper script + run-mozilla.sh any more. By this we need to adjust our starting wrapper + so the call to start Thunderbird within the GDB debugger is working. + + -- Carsten Schoenert Fri, 05 Oct 2018 17:43:49 +0200 + +thunderbird (1:60.0-3) unstable; urgency=medium + + * [daa0dd7] locale: use 'intl.locale.requested' correctly + Thanks to hint from Sven Joachim we can use the preference setting + 'intl.locale.requested' in way that users don't need to use this setting + within their prefs.js to control the language of the Thunderbird UI. + 'intl.locale.requested' is somehow the successor of 'intl.locale.matchOS'. + (Closes: #908034) + * [f8ac1b2] debian/control: increase Standards-Version to 4.2.1 + No further changes needed. + * [a001579] d/control: remove empty 'Replaces' in thunderbird-l10n-da + We can remove that line of Replaces without any key. + + -- Carsten Schoenert Thu, 06 Sep 2018 18:46:31 +0200 + +thunderbird (1:60.0-2) unstable; urgency=medium + + [ Carsten Schoenert ] + * [71ac5e7] rebuild patch queue from patch-queue branch + added patches: + porting-mips/Add-struct-ucred-for-Linux-on-MIPS.patch + porting-mips/Bug-1444303-MIPS-Fix-build-failures-after-Bug-1425580-par.patch + porting-mips/Bug-1444834-MIPS-Stubout-MacroAssembler-speculationBarrie.patch + * [d94e5dc] d/control: B-D on {lib}clang-6.0* and llvm-6.0-dev + (Closes: #906707) + + -- Carsten Schoenert Mon, 20 Aug 2018 17:57:07 +0200 + +thunderbird (1:60.0-1) unstable; urgency=medium + + [ Cyril Brulebois ] + * [4f1fcd4] Bump B-D libsqlite3-dev version + Upstream requires a more recent version that is already available in + unstable but not in Stretch later e.g. + * [5a790c2] Add libicu-dev to Build-Depends (required for icu-i18n.pc) + This package was pulled from some other package already but we need this + explicit now again as we don't use the internal ICU version any more. + * [8c86207] Bump libhunspell-dev version + The same as for libsqlite3-dev, adding the correct B-D version. + (Closes: #905465) + + [ Carsten Schoenert ] + * [901f257] New upstream version 60.0 + Fixed CVE issues in upstream version 60.0 (MFSA 2018-19) + CVE-2018-12359: Buffer overflow using computed size of canvas element + CVE-2018-12360: Use-after-free when using focus() + CVE-2018-12361: Integer overflow in SwizzleData + CVE-2018-12362: Integer overflow in SSSE3 scaler + CVE-2018-5156: Media recorder segmentation fault when track type is + changed during capture + CVE-2018-12363: Use-after-free when appending DOM nodes + CVE-2018-12364: CSRF attacks through 307 redirects and NPAPI plugins + CVE-2018-12365: Compromised IPC child process can list local filenames + CVE-2018-12371: Integer overflow in Skia library during edge builder + allocation + CVE-2018-12366: Invalid data handling during QCMS transformations + CVE-2018-12367: Timing attack mitigation of PerformanceNavigationTiming + CVE-2018-5187: Memory safety bugs fixed in Firefox 61, Firefox ESR 60.1, + and Thunderbird 60 + CVE-2018-5188: Memory safety bugs fixed in Firefox 61, Firefox ESR 60.1, + Firefox ESR 52.9, and Thunderbird 60 + * [44ab834] rebuild patch queue from patch-queue branch + removed patches (applied upstream): + porting-arm64/Bug-1453892-Only-use-SkJumper-s-arm64-half-float-optimiza.patch + porting-arm64/Bug-1463036-Use-HAVE_ARM_NEON-instead-of-BUILD_ARM_NEON-f.patch + porting-armel/Bug-1463036-Add-mfloat-abi-softfp-to-NEON_FLAGS-when-it-m.patch + * [3168b29] debian/control: increase Standards-Version to 4.2.0 + No further changes needed. + * [f2f206e] d/rules: use MOZ_LANGPACK_ID instead of hard coding + * [996352a] d/rules: ensure l10n MOZ_LANGPACK_ID matches variable from + makefile + Previous beta versions for the thunderbird-l10n data have used + '@firefox.mozilla.org' within their application.id setting. Thunderbird + now expects '@thunderbird.mozilla.org' instead. Make the build more + flexible so we can detect mismatches here. + (Closes: #906176) + + -- Carsten Schoenert Sun, 19 Aug 2018 11:32:11 +0200 + +thunderbird (1:60.0~b10-1) experimental; urgency=medium + + [ intrigeri ] + * [596869d] AppArmor: update profile from upstream (at commit edc9487) + (Closes: #901471) + + [ Carsten Schoenert ] + * [57195ff] New upstream version 60.0~b10 + * [770c9a6] rebuild patch queue from patch-queue branch + added patches: + porting-arm64/Bug-1463036-Use-HAVE_ARM_NEON-instead-of-BUILD_ARM_NEON-f.patch + porting-armel/Avoid-using-vmrs-vmsr-on-armel.patch + porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch + porting-armel/Bug-1463036-Add-mfloat-abi-softfp-to-NEON_FLAGS-when-it-m.patch + * [7fa6ebd] debian/control: increase Standards-Version to 4.1.5 + No further changes needed. + * [22e701c] c-l-l10n-t.sh: adjust the path to the python helper + Adjust the shell script helper to use the changed path to makeversion.py. + * [90a1d9e] sticky prefs: use the new syntax in vendor.js + The syntax for locked preferences has been changed a while ago, it's + time to adjust the entry within vendor.js to disable automatic updates + for AddOns. + + -- Carsten Schoenert Thu, 12 Jul 2018 17:52:27 +0200 + +thunderbird (1:60.0~b9-2) experimental; urgency=medium + + [ intrigeri ] + * [eb7cb44] Revert "apparmor: allow access to @{HOME}/.gnupg/tofu.db" + * [4cd8baf] AppArmor: update profile from upstream + (Closes: #900840) + * [807eb99] AppArmor: update profile from upstream (at commit 104da32) + + [ Carsten Schoenert ] + * [c980546] rebuild patch queue from patch-queue branch + added patch: + porting-arm64/Bug-1453892-Only-use-SkJumper-s-arm64-half-float-optimiza.patch + + -- Carsten Schoenert Sun, 01 Jul 2018 19:15:00 +0200 + +thunderbird (1:60.0~b9-1) experimental; urgency=medium + + * [be64a3e] d/source.filter: update due upstream changes + Writing the import filter file source.filter mostly complete new from + scratch. Needed because upstream has changed the structure of the source + completely. + * [c4b9113] New upstream version 60.0~b9 + * [3dc900a] rebuild patch queue from patch-queue branch + Related to the changed source structure the patches for the patch queue + needs to be adjusted to the new folders and their structure. Thanks to + git this wasn't that painful as git did all of the job. Two new patches + are needed to add. + added patches: + fixes/Build-also-gdata-provider-as-xpi-file.patch + debian-hacks/Don-t-build-testing-suites-and-stuff-part-2.patch + * [e50ae04] d/rules: remove references to folder 'mozilla' + To get the source built some targets in debian/rules are needed to be + modified. All references to the old used folder 'mozilla/' are removed + now. + * [a650500] ICU: don't build the Paragraph Layout library + Disable the build of the Paragraph Layout library, we don't need them if + we need to built the ICU stuff. Cherry-picked from current ESR 52 + packaging. + * [977b7fe] d/mozconfig.default: use the ICU package from system + The Debian packages of icu are recent enough so we don't need to build + own dedicated ICU binaries. + * [0c7ed7e] adjust the configuration of the built + Because of the modified source structure some more adjustments are needed + while going through the built targets like different paths, and built + calls of the Thunderbird source. + * [1c09011] adjust the install temporary folder + Upstream is now wrapping all internal make calls through a Python wrapper + called 'mach'. This also involves a changed behavior for installing the + Thunderbird files into the temporary folder we later use by the debhelper + sequencer. + * [bfbc9ca] d/s/lintian-overrides: update content due changed source.filter + The modified file debian/source.filter make some adjustments needed in + the lintian-overrides file for the source files related part. + * [44a4c5a] d/thunderbird.lintian-overrides: update after config changes + Like before some adjustments are needed for the lintian override rules + for the source files. + * [dd48091] d/copyright: adjust the content due folder changes + And one more file that needs to be adjusted due the changed source files. + + -- Carsten Schoenert Sun, 01 Jul 2018 16:12:33 +0200 + +thunderbird (1:60.0~b6-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [3d91710] create-lightning-l10n: adjust folder structure + To build more easy lightning-l10n packages let's modify the helper script + for building the additional tarball. Change the content structure so we + can simple copy the needed l10n stuff into the l10n packages. + * [f1d6031] New upstream version 60.0~b6 + * [6643c31] Revert the linking into /u/l/tb/d/extensions + Thunderbird in Debian won't detecting extension which are placed in + /usr/lib/thunderbird/distribution/extensions, going back to the old + folder /usr/lib/thunderbird/extensions to link extensions into + Thunderbird. + * [26549a3] lightning: turning package into Architecture all + Change the architecture for the lightning package from 'any' to 'all'. + Lightning is only build by Javascript, CSS, JSM and other text based + files and we don't need to build and install it as a architecture + dependent package. + * [86cd48f] mozconfig.default: disable webrtc build and inclusion + Let's drop the build of support for WebRTC, Thunderbird isn't able to use + this as there is no component which is depending on this. The chat + component would be a potential use case but right now it lacks any + functionality by webrtc features. + + -- Carsten Schoenert Sat, 05 May 2018 13:56:36 +0200 + +thunderbird (1:60.0~b5-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [b8625ea] New upstream version 60.0~b5 + + -- Carsten Schoenert Sat, 28 Apr 2018 19:15:07 +0200 + +thunderbird (1:60.0~b4-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [62ae939] New upstream version 60.0~b4 + + -- Carsten Schoenert Mon, 23 Apr 2018 18:19:11 +0200 + +thunderbird (1:60.0~b3-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [94f8505] debian/control: increase Standards-Version to 4.1.4 + No further changes needed.f2f206eb34a619f7a684d1216fcd918454135d41 + * [3ba10c6] rebuild patch queue from patch-queue branch + added patches: + porting-sparc64/Bug-1434726-Early-startup-crash-on-Linux-sparc64-in-HashI.patch + fixes/Use-msse-2-fpmath-C-CXXFLAGS-only-on-x86_64-platforms.patch + fixes/Fix-big-endian-build-for-SKIA.patch (re-added) + Thanks Andreas Glaubitz for providing these patches! + * [dabf294] New upstream version 60.0~b3 + * [24f8a38] re-enable usage of lib{nspr4,nss3}-dev while built + The available versions of these libraries now recent enough so we can + drop the usage of the embedded code copies. + + -- Carsten Schoenert Sun, 15 Apr 2018 12:47:43 +0200 + +thunderbird (1:60.0~b2-1) experimental; urgency=medium + + [ Agustin Henze ] + * [3639717] apparmor: allow access to @{HOME}/.gnupg/tofu.db + (Closes: #894907) + + [ intrigeri ] + * [3895bba] AppArmor: fix empty black windows in Thunderbird 58+ + (Closes: #887973) + * [353ca25] AppArmor: update profile from upstream + (Closes: #882048, #882122) + + [ Carsten Schoenert ] + * [37e0bbe] New upstream version 59.0~b1 + * [d75c4be] rebuild patch queue from patch-queue branch + added patches: + fixes/Fix-build-against-libcairo2-dev-1.15.10.patch + patches/fixes/Fix-big-endian-build-for-SKIA.patch + + removed patches: + debian-hacks/Allow-usage-of-libnspr4-dev-4.16.patch + fixes/Bug-1418598-Make-cargo-linker-properly-handle-quoted-stri.patch + thunderbird/Thunderbird-fix-installdir-for-icons.patch + * [9615d6a] New upstream version 60.0~b1 + * [431006c] d/source.filter: update due upstream changes + Update the list of files we filter out, Upstream added various new files + mostly used for auto-testing we don't use. + * [2cb4635] d/s/lintian-overrides: remove entries about brace expansion + We can remove the override about brace expansion in dh sequencer files. + * [4c9f185] debian/rules: using 'rm -f' because probably non existing files + The file app.ini isn't existing in some l10n folders for lightning, + simply use '-f' for convenience. + * [ed00442] debian/rules: fix typo to grep app ID of calendar-g-p + * [4a993c5] adding additional packages to Breaks with thunderbird + The packages calendar-exchange-provider and enigmail + xul-ext-sogo-connector aren't compatible to the webextension interface + and we need to add a versioned Breaks. + * [9bd8286] adjust Breaks for enigmail + Also enigmail needs an adjusted version for Breaks. + * [24382c2] Revert "Use gcc-6 and g++-6 due broken GUI with GCC-7" + (Closes: #892404) + * [f0ac8a5] rebuild patch queue from patch-queue branch + removed patches: + debian-hacks/Allow-to-override-ICU_DATA_FILE-from-the-environment.patch + debian-hacks/remove-non-free-W3C-icon-valid.png.patch + fixes/Allow-.js-preference-files-to-set-locked-prefs-with-lockP.patch + fixes/Fix-build-against-libcairo2-dev-1.15.10.patch + + modified patches: + debian-hacks/Build-against-system-libjsoncpp.patch + debian-hacks/Don-t-build-testing-suites-and-stuff.patch + porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch + * [6ab35ad] d/mozconfig.default: don't use nspr and nss from system + We need to switch back to the embedded source for NSS and NSPR, the + versions in unstable aren't usable. + * [055ed65] d/mozconfig.default: remove no longer alive option + The option '--enable-system-cairo' is gone with TB 60. + * [663d6f1] lightning-l10n-bn-bd: remove Bengali (Bangladesh) l10n package + * [02b21cb] lightning-l10n-pa-in: remove Punjabi (India) l10ng package + * [0cc0b5d] lightning-l10n-ta-lk: remove Tamil (Sri Lanka) l10n package + * [62f23a5] thunderbird-l10n-bn-bd: remove (Bangladesh) l10n package + * [61bfdf4] thunderbird-l10n-pa-in: remove Punjabi (India) l10n package + * [a361750] thunderbird-l10n-ta-lk: remove Tamil (Sri Lanka) l10n package + * [8ba5b0d] debian/control: add new packages for *-kk language + * [e4280ac] debian/control: add new packages for *-ms language + * [aaef9fe] adjust Vcs fields to salsa.debian.org + * [144c492, 009b145] debian/copyright: update after upstream changes + Upstream removed some files/folders, which reflects in needed adjustments + for the copyright file. + * [3623f84] d/thunderbird.lintian-overrides: add libnspr4.so and libnss3.so + We now need to ship (again) embedded libraries for NSPR and NSS. + * [0d3de65] lightning: move linking into /u/l/tb/distribution/extensions + Following upstream with the folder for the Lightning to not differ. + * [4d6cefe] New upstream version 60.0~b2 + * [e1c40a7] rebuild patch queue from patch-queue branch + removed patches: + fixes/Fix-big-endian-build-for-SKIA.patch + * [4834a1d] add entries to README and NEWS for thunderbird + Adding notes about the current situation foe the l10n packages and their + integration into the UI of Thunderbird and Lightning. + + -- Carsten Schoenert Sat, 07 Apr 2018 11:12:37 +0200 + +thunderbird (1:58.0~b3-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [d114338] d/source.filter: update due upstream changes + Update the filtering list for excluding some unwanted source files as + usual while preparing new major upstream versions. + * [91d23a9] New upstream version 58.0~b3 + * [f34e555] rebuild patch queue from patch-queue branch + added patches: + debian-hacks/Allow-usage-of-libnspr4-dev-4.16.patch + debian-hacks/icu-use-locale.h-instead-of-xlocale.h.patch + debian-hacks/shellutil.py-ignore-tilde-as-special-character.patch + fixes/Bug-1418598-Make-cargo-linker-properly-handle-quoted-stri.patch + + modified patches: + debian-hacks/Build-against-system-libjsoncpp.patch + debian-hacks/Don-t-build-testing-suites-and-stuff.patch + porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch + porting-m68k/Add-m68k-support-to-Thunderbird.patch + porting-sh4/Add-sh4-support-to-Thunderbird.patch + porting/Disable-optimization-on-alpha-for-the-url-classifier.patch + prefs/Don-t-auto-disable-extensions-in-system-directories.patch + prefs/Set-javascript.options.showInConsole.patch + + obsolete patches (included somehow or fixed upstream): + debian-hacks/Force-use-the-i686-rust-target.patch + porting-alpha/FTBFS-alpha-adjust-some-source-to-prevent-build-issues.patch + patches/porting-alpha/fix-FTBFS-on-alpha.patch + patches/porting-arm64/Bug-1257055-Use-jit-arm64-Architecture-arm64.h-on-non-JIT.patch + patches/porting-hppa/FTBFS-hppa-xpcshell-segfaulting-during-make-install.patch + porting-kfreebsd-hurd/FTBFS-hurd-adding-GNU-Hurd-to-the-list-of-OS-systems.patch + porting-mips/FTBFS-mips-add-missing-char-variable.patch + porting/ppc-fix-divide-page-size-in-jemalloc.patch + thunderbird-l10n/thunderbird-l10n-disable-external-extension-update.patch + * [bd45d47] debian/control: adding new Build-Depends + Since this is the first version > 52 we need now cargo, clang, rustc and + llvm development files. + * [c63a03f] d/mozconfig.default: remove no longer alive options + Some old options like --disable-gnomeui, --enable-gio, and + --with-default-mozilla-five-home are history now. + * [609dbbe] l10n lightning: modify script to work with recent version + We still need to use the shellscript create-lightning-l10n-tarball.sh + (and also *-thunderbird-l10n-*) to create the additional tarballs. + * [2f276b7] thunderbird-l10n: change tb-l10n package installation + Due the changed structure from upstream for the thunderbird l10n files + the packaging needs also to be adopted. + * [ee476f8] d/thunderbird.install: update install sequencer file + Also small adjustments are needed for the installation of the thunderbird + binary files. The old script run-mozilla.sh (which we didn't have used + within the Debian packaging) isn't shipped now, and there is now a new + folder gtk2 which includes the libmozgtk library linked against GTK2. + * [ced9d18] thunderbird-dev: remove the package and adjustments on this + The complete content that was packaged previously in thunderbird-dev + isn't created and installed now. Thus makes the old package + thunderbird-dev obsolete. + * [484a142] autopkgtests: disable tests around thunderbird-dev + Disable all autopkgtests which have used thunderbird-dev. + * [0aa2546] switch to system libraries back + We can now use the system libararies libnspr4, libnss3 and libsqlite3 + again, the version of libicu is still to old for usage within the + package build. + * [858ae82] d/control: thunderbird, remove variable ${gnome:Depends} + * [7c3a258] d/control: lightning, remove variable ${shlibs:Depends} + * [aabf0d4] debian/source/lintian-overrides: update entries + * [94b00db] debian/control: increase Standards-Version to 4.1.3 + No further changes needed. + * [245e8c2] debian/copyright: update after upstream changes + Also almost needed with new major upstream versions reflect the + changes from upstream in the copyright file. + * [72507b2] d/control: enigmail < 1.9.9 isn't working with TB > 55 + Due the new plugin interface some old plugins doesn't work with this + thunderbird version anymore, or behaving unexpected. Enigmal is one of + the this (known) plugins which needs to be at least in version 2.0a2pre + installed to work with Thunderbird. + * [6cf0133] lightning-l1on: change l10n installation + Related to [4abc7f2] the various thunderbird-l10n packages need to be + installed differently to old package installations. + * [6af7054] calendar-google-provider: tweak installation a bit + More a hack but the Mozilla plugin installation by mozilla-devscripts + isn't prepared for the new webextension logic by Mozilla. Symlinking the + c-g-p plugin for now directly from the thunderbird extension folder. + + -- Carsten Schoenert Sun, 21 Jan 2018 14:03:39 +0100 + +thunderbird (1:52.9.1-1) unstable; urgency=high + + [ intrigeri ] + * [1259eaa] AppArmor: update profile from upstream (at commit edc9487) + (Closes: #901471) + + [ Carsten Schoenert ] + * [d706f5b] debian/control: increase Standards-Version to 4.1.5 + No further changes needed. + * [f5a3eb2] New upstream version 52.9.1 + (Closes: #903160) + + -- Carsten Schoenert Tue, 10 Jul 2018 19:40:41 +0200 + +thunderbird (1:52.9.0-1) unstable; urgency=high + + [ intrigeri ] + * [c33dba2] Revert "apparmor: allow access to @{HOME}/.gnupg/tofu.db" + * [cb64397] AppArmor: update profile from upstream (Closes: #900840) + * [b5d6545] AppArmor: update profile from upstream (at commit 104da32) + + [ Carsten Schoenert ] + * [099b525] d/source.filter: add some more files to filter + There are some more files we want to filter out. + * [376e5f3] New upstream version 52.9.0 + Fixed CVE issues in upstream version 52.9 (MFSA 2018-18) + CVE-2018-12359: Buffer overflow using computed size of canvas element + CVE-2018-12360: Use-after-free when using focus() + CVE-2018-12372: S/MIME and PGP decryption oracles can be built with HTML + emails + CVE-2018-12373: S/MIME plaintext can be leaked through HTML reply/forward + CVE-2018-12362: Integer overflow in SSSE3 scaler + CVE-2018-12363: Use-after-free when appending DOM nodes + CVE-2018-12364: CSRF attacks through 307 redirects and NPAPI plugins + CVE-2018-12365: Compromised IPC child process can list local filenames + CVE-2018-12366: Invalid data handling during QCMS transformations + CVE-2018-12374: Using form to exfiltrate encrypted mail part by pressing + enter in form field + CVE-2018-5188: Memory safety bugs fixed in Firefox 60, Firefox ESR 60.1, + Firefox ESR 52.9, and Thunderbird 52.9 + * [83a9c9b] rebuild patch queue from patch-queue branch + As we have filtered more files out from the source we need to modify the + list of tests we won't to built while built the source too so a small + adjustment on that. + Also fixing some spelling issues which Lintian has found. + modified patches: + debian-hacks/Don-t-build-testing-suites-and-stuff.patch + porting-alpha/fix-FTBFS-on-alpha.patch + porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch + renamed patches: + Allow-to-override-ICU_DATA_FILE-from-the-environment.patch -> + Allow-one-to-override-ICU_DATA_FILE-from-the-environment.patch + fix-function-nsMsgComposeAndSend-to-to-respect-Replo.patch -> + fix-function-nsMsgComposeAndSend-to-respect-ReploToSend.patch + * [d5254e2] Removed unneded lintian override about brace expansion + + -- Carsten Schoenert Wed, 04 Jul 2018 21:44:26 +0200 + +thunderbird (1:52.8.0-1) unstable; urgency=high + + [ intrigeri ] + * [4656ebf] AppArmor: update profile from upstream + (Closes: #882048, #882122) + + [ Agustin Henze ] + * [840cbc8] apparmor: allow access to @{HOME}/.gnupg/tofu.db + (Closes: #894907) + + [ Carsten Schoenert ] + * [514e9e8] New upstream version 52.8.0 + Fixed CVE issues in upstream version 52.8 (MFSA 2018-13) + CVE-2018-5183: Backport critical security fixes in Skia + CVE-2018-5184: Full plaintext recovery in S/MIME via chosen-ciphertext + attack (aka Efail) + CVE-2018-5154: Use-after-free with SVG animations and clip paths + CVE-2018-5155: Use-after-free with SVG animations and text paths + CVE-2018-5159: Integer overflow and out-of-bounds write in Skia + CVE-2018-5161: Hang via malformed headers + CVE-2018-5162: Encrypted mail leaks plaintext through src attribute + (aka Efail) + CVE-2018-5170: Filename spoofing for external attachments + CVE-2018-5168: Lightweight themes can be installed without user + interaction + CVE-2018-5178: Buffer overflow during UTF-8 to Unicode string conversion + through legacy extension + CVE-2018-5185: Leaking plaintext through HTML forms (aka Efail) + CVE-2018-5150: Memory safety bugs fixed in Firefox 60, Firefox ESR 52.8, + and Thunderbird 52.8 + (Closes: #898631) + * [7845229] ICU: don't build the Paragraph Layout library + Disable the build of the layout library in the internal ICU build as we + don't need this and can cause build issues. + * [e0a79fc] debian/control: increase Standards-Version to 4.1.4 + No further changes needed. + + -- Carsten Schoenert Thu, 17 May 2018 21:04:15 +0200 + +thunderbird (1:52.7.0-1) unstable; urgency=medium + + * [9eb2692] New upstream version 52.7.0 + Fixed CVE issues in upstream version 52.7 (MFSA 2018-09) + CVE-2018-5127: Buffer overflow manipulating SVG animatedPathSegList + CVE-2018-5129: Out-of-bounds write with malformed IPC messages + CVE-2018-5144: Integer overflow during Unicode conversion + CVE-2018-5146: Out of bounds memory write in libvorbis + CVE-2018-5125: Memory safety bugs fixed in Firefox 59, Firefox ESR 52.7, + and Thunderbird 52.7 + CVE-2018-5145: Memory safety bugs fixed in Firefox ESR 52.7 and + Thunderbird 52.7 + * [a01cf4b] Revert "Use gcc-6 and g++-6 due broken GUI with GCC-7" + Switching now back to GCC7 as we don't have any longer issues with + broken visuals in the GUI. + (Closes: #892404) + + -- Carsten Schoenert Mon, 26 Mar 2018 17:21:40 +0200 + +thunderbird (1:52.6.0-1) unstable; urgency=high + + * [97e1cd7] New upstream version 52.6.0 + Fixed CVE issues in upstream version 52.6 (MFSA 2018-04) + CVE-2018-5095: Integer overflow in Skia library during edge builder + allocation + CVE-2018-5096: Use-after-free while editing form elements + CVE-2018-5097: Use-after-free when source document is manipulated + during XSLT + CVE-2018-5098: Use-after-free while manipulating form input elements + CVE-2018-5099: Use-after-free with widget listener + CVE-2018-5102: Use-after-free in HTML media elements + CVE-2018-5103: Use-after-free during mouse event handling + CVE-2018-5104: Use-after-free during font face manipulation + CVE-2018-5117: URL spoofing with right-to-left text aligned left-to-right + CVE-2018-5089: Memory safety bugs fixed in Firefox 58, Firefox ESR 52.6, + and Thunderbird 52.6 + * [0300242] rebuild patch queue from patch-queue branch + Added patch debian-hacks/icu-use-locale.h-instead-of-xlocale.h.patch + that fixes the build of the included ICU source against glibc 2.26. + (Closes: #887766) + * [4bf22e0] debian/control: increase Standards-Version to 4.1.3 + No further changes needed. + * [3616443] adjust Vcs fields to salsa.debian.org + The Vcs for Thunderbird packaging live now on Salsa as Alioth will be + shutdown in the future. + * [c2f3e14] lintian: ignore non multiarch install folder for thunderbird.pc + Ignore a lintian warning about unavailable pkg-config file thunderbird.pc + as the ESR versions 52.x are the last series which will have a + thunderbird-dev. The next ESR version will be 60.x which uses + webextension and makes thunderbird-dev obsolete. + + -- Carsten Schoenert Thu, 25 Jan 2018 20:21:10 +0100 + +thunderbird (1:52.5.2-2) unstable; urgency=medium + + [ Carsten Schoenert ] + * [f597157] Revert "d/thunderbird.postinst: reload AA profile on updates" + The trigger automatics for appamor already is handling the + needed reload on profile updates for the applications. + (Closes: #885158) + * [8ebdb96] debian/control: increase Standards-Version to 4.1.2 + No further changes needed. + * [81a8c00] use inverse logic on version for AA profile status check + By this change we don't enforce the disabled profile from the + previous version in some cases and can also handle possible + version strings from -security and -backports. + (Closes: #885157) + + -- Carsten Schoenert Tue, 26 Dec 2017 14:56:40 +0100 + +thunderbird (1:52.5.2-1) unstable; urgency=high + + [ intrigeri ] + * [b791221] AppArmor: support new thunderbird executable path + (Closes: #883561, #884217) + + [ Carsten Schoenert ] + * [1f46308] New upstream version 52.5.2 + Fixed CVE issues in upstream version 52.5 (MFSA 2017-30) + CVE-2017-7829: Mailsploit part 1: From address with encoded null character + is cut off in message header display + CVE-2017-7846: JavaScript Execution via RSS in mailbox:// origin + CVE-2017-7847: Local path string can be leaked from RSS feed + CVE-2017-7848: RSS Feed vulnerable to new line Injection + * [0dd21b9] d/thunderbird.postinst: reload AA profile on updates + * [8c57218] don't disable AA profile on package updates + As people want to re-enable the AA profile a update of + thunderbird doesn't have to disable this again. + (Closes: #884191) + + -- Carsten Schoenert Sun, 24 Dec 2017 11:30:09 +0100 + +thunderbird (1:52.5.0-1) unstable; urgency=high + + [ intrigeri ] + * [48e6b65] AppArmor: fix the Crash Reporter and avoid noisy denial logs + (Closes: #880953) + * [ad8b3b5] AppArmor: fix compatibility with NVIDIA hardware + (Closes: #880532) + * [d8ff6b6] Disable the AppArmor profile by default + Due the various side effects by the enabled AppArmor profile in + Thunderbird it's currently better for a user experience we + disabling the AppArmor profile for to not get people get mad with + to many broken things. + Users can always enable the profile by themselves again. + (Closes: #882672) + * [e50eac5] README.Debian: document how to opt-in for AppArmor confinement + * [860d325] README.Debian: document how one can debug the AppArmor profile + + [ Guido Günther ] + * [50a8f60] Drop myself from maintainers + Thank you Guido for always helping out if we had some questions! + + [ Carsten Schoenert ] + * [b64509b] New upstream version 52.5.0 + Fixed CVE issues in upstream version 52.5 (MFSA 2017-26) + CVE-2017-7828: Use-after-free of PressShell while restyling layout + CVE-2017-7830: Cross-origin URL information leak through Resource Timing API + CVE-2017-7826: Memory safety bugs fixed in Firefox 57, Firefox ESR 52.5, + and Thunderbird 52.5 + * [3166018] thunderbird.links: let thunderbird pointing to thunderbird-bin + (Closes: #856492) + * [6fff70c] [buster] tb-wrapper: searching the correct dbgsym package + * [4763ca6] adding a NEWS file for thunderbird package + Giving a note about the now disabled AppArmor profile. + * [0b9d656] disabling crashreporter for now + Also don't build and ship the Crashreporter any more, it's useless + until we can collect all symbols correctly. + * [a285647] move AppArmor specific things into own README file + Put all AppArmor related information into one dedicated file. + * [5d56439] d/thunderbird.js: prepare a line for extra X-Debbugs-Cc + A really old bug report ... building a compromise and put the + requested extra header config into the configuration file but keep + it deactivated as default. + (Closes: #379304) + + -- Carsten Schoenert Sun, 03 Dec 2017 19:58:57 +0100 + +thunderbird (1:52.4.0-2~exp1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [a3e73e9] disable usage of libgnomeui parts + The libgnomeui stuff (only relevant for GTK+2) is deprecated + for a long time and will be removed in buster, and we don't need + this at all. + See https://lists.debian.org/debian-devel/2017/10/msg00299.html + * [9efc5c9] debian/watch: switch to https + * [bd5a635] rebuild patch queue from patch-queue branch + Fixup for [da3c5cc], add ppc64 to the list of BE architectures. + Thanks Adrian Glaubitz for pointing the issue. (Closes: #879270) + * [42f5ab5] apparmor: update profile from upstream (Closes: #876333, #855346) + + [ intrigeri ] + * [d7febc8, b026d28] AppArmor: update profile from upstream + (Closes: #880425, #877324) + * [377e7b5] README.Debian: fixing small typo + * [3b0a63a] AppArmor: fix importing public OpenPGP keys from file + (Closes: #880715) + + [ Carsten Schoenert ] + * [241690e] d/control: s/Icedove/Thunderbird in desc's for lightning-l10n-* + The lightning-l10n package were still using the name 'Icdeove' + instead of 'Thunderbird'. + * [f17f735] debian/control: moving transitional packages at bottom + * [91f9897] autopkg: adjust icedove to thunderbird depends + Now move over to depend in favor of thunderbird for some of + the autopkg tests. + * [8ae2ad7] autopkg: adjust icedove-dev to thunderbird-dev depends + Doing the same as before for thunderbird-dev as the native + replacement for icedove-dev. + * [fa0134c] bump debhelper >= 10.2.5 + * [8752789] debian/rules: try to build extensions reproducible + The two extensions (lightning and calendar-google-provider) + don't build reproducible right now. Trying to fix this by using + the timestamp from the changelog entry for the files. May not + work correctly and we need to tune more. + * [1496368] d/thunderbird.install: also install the fonts folder + Recent versions of Thunderbird needing the font EmojiOne which + isn't provided by any other package. + (Closes: #881299) + + The following changes are take effect in removing all transitional packages + related to the old icedove packaging only for buster. We still need all the + transitional packages in wheezy, jessie and stretch! + * [54c8a9b] [buster] remove transitional iceowl-l10n-* packages + * [c338630] [buster] remove Replace, Breaks and Provides for iceowl-l10n-* + * [4311683] [buster] remove transitional icedove-l10n-* packages + * [f6e3a01] [buster] remove Replace, Breaks and Provides for icedove-l10n-* + * [a9117e4] [buster] remove transitional iceowl-extension package + * [5aed012] [buster] remove Replace, Breaks and Provides for iceowl-extension + * [27fc04b] [buster] remove transitional icedove-dbg package + * [53b4825] [buster] remove transitional icedove-dev package + * [e2d808f] [buster] remove Replace, Breaks and Provides for icedove-dev + * [97edfbe] [buster] remove transitional icedove package + * [3748054] [buster] remove Replace and Breaks for icedove + * [611a704] [buster] move thunderbird-dbg into *-dbgsym package + + -- Carsten Schoenert Sun, 12 Nov 2017 16:01:07 +0100 + +thunderbird (1:52.4.0-1) unstable; urgency=medium + + [ Guido Günther ] + * [da3c5cc] Simplify endianness selection for ICU + Since we need to build ICU on the various Debian releases we + need to ensure the architecture detection isn't to strict. + Thanks Guido for helping out here! + + [ Carsten Schoenert ] + * [47748ca] debian/control: be more relaxed on Breaks for enigmail + * [6a54666] thunderbird-wrapper: fix small typo in help output + A small typo was happen in the example call with the JS console. + * [6d5266e] README.Debian: update info around tls fallback-limit + The default behavior on the TLS fallback has changed some + versions ago, document this accordingly. + * [24ad883] debian/control: change maintainer + Thanks Christoph for the work over the past years! + * [c78200e] debian/control: move src pkg name to thunderbird + By this version we move the source package name also back to + thunderbird. This follows the changes that are already made to + the binary package names and we can call the source package now + also again thunderbird. + (Closes: #857075) + * [c26133d] debian/gbp.conf: rename components to real used names + Due the changes of the source package the names for the + sub-folders within the additional tarballs can also be changed + to be closer on the real upstream used names. + * [a5ce4f7] New upstream version 52.4.0 + (Closes: #878845, #878870) + Fixed CVE issues in upstream version 52.4 (MFSA 2017-23) + CVE-2017-7793: Use-after-free with Fetch API + CVE-2017-7818: Use-after-free during ARIA array manipulation + CVE-2017-7819: Use-after-free while resizing images in design mode + CVE-2017-7824: Buffer overflow when drawing and validating elements with + ANGLE + CVE-2017-7805: Use-after-free in TLS 1.2 generating handshake hashes + CVE-2017-7814: Blob and data URLs bypass phishing and malware protection + warnings + CVE-2017-7825: OS X fonts render some Tibetan and Arabic unicode characters + as spaces + CVE-2017-7823: CSP sandbox directive did not create a unique origin + CVE-2017-7810: Memory safety bugs fixed in Firefox 56 and Firefox ESR 52.4, + and Thunderbird 52.4 + * [104b4e5] rebuild patch queue from patch-queue branch + * [d63662a] lintian: move oldlibs/extra -> oldlibs/optional + By moving all transitional package to oldlibs/optional we can + help deborphan to detect better not needed packages. + * [fb56001] d/rules: reflect changes from renamed component tarballs + The additional tarballs are stored in folders which reflect + the upstream names of those components. This also needs to be + respected for the build instructions of the package. + * [61288fb] debian/control: change Vcs* fields due the src name change + Addressing the changed source package name in the Git Vcs urls. + * [ef95ab5] debian/control: increase Standards-Version to 4.1.1 + No further changes needed. + * [45e8fe2] apparmor: update profile from upstream + Thanks to Simon Deziel and intrigeri we can simply use the + apparmor profile changes done for the Ubuntu releases. + * [6b1649c] lintian: adding a override for thunderbird-l10n-all + * [ceab93f] debian/README.source: reflect src package name change + + -- Carsten Schoenert Tue, 17 Oct 2017 18:20:29 +0200 + +icedove (1:52.3.0-4) unstable; urgency=medium + + [ Carsten Schoenert ] + * [3ddf57b] rebuild patch queue from patch-queue branch + * [3bd845d] debian/control: increase Standards-Version to 4.1.0 + + -- Carsten Schoenert Tue, 29 Aug 2017 16:17:24 +0200 + +icedove (1:52.3.0-3) unstable; urgency=medium + + [ Carsten Schoenert ] + * [c08f005] rebuild patch queue from patch-queue branch + * [f658cab] debian/rules: enable verbose build for ICU + + -- Carsten Schoenert Mon, 28 Aug 2017 19:44:07 +0200 + +icedove (1:52.3.0-2) unstable; urgency=medium + + [ Carsten Schoenert ] + * [d544a01] debian/rules: correct icu build sequence + + -- Carsten Schoenert Tue, 22 Aug 2017 18:57:36 +0200 + +icedove (1:52.3.0-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [8e852be] New upstream version 52.3.0 + Fixed CVE issues in upstream version 52.3 (MFSA 2017-20) + CVE-2017-7800: Use-after-free in WebSockets during disconnection + CVE-2017-7801: Use-after-free with marquee during window resizing + CVE-2017-7809: Use-after-free while deleting attached editor DOM node + CVE-2017-7784: Use-after-free with image observers + CVE-2017-7802: Use-after-free resizing image elements + CVE-2017-7785: Buffer overflow manipulating ARIA attributes in DOM + CVE-2017-7786: Buffer overflow while painting non-displayable SVG + CVE-2017-7753: Out-of-bounds read with cached style data and + pseudo-elements + CVE-2017-7787: Same-origin policy bypass with iframes through page reloads + CVE-2017-7807: Domain hijacking through AppCache fallback + CVE-2017-7792: Buffer overflow viewing certificates with an extremely + long OID + CVE-2017-7804: Memory protection bypass through WindowsDllDetourPatcher + CVE-2017-7791: Spoofing following page navigation with data: protocol and + modal alerts + CVE-2017-7782: WindowsDllDetourPatcher allocates memory without DEP + protections + CVE-2017-7803: CSP containing 'sandbox' improperly applied + CVE-2017-7779: Memory safety bugs fixed in Firefox 55, Firefox ESR 52.3, + and Thunderbird 52.3 + * [0b7243b] debian/rules: build icudt5*.dat on our own if needed + If we need to use the internal sources of ICU (triggered by + using --with-system-icu) we need to build the platform depended file + icudt*[b,l].dat before we can call the configure run. + This is needed as Mozilla only ships a precompiled little endian version + of the file icudt*.dat and all platforms with big endianness are failing + later due issues related to the wrong endianness. + * [1964469] debian/mozconfig.default: enable i18n on big endian + * [6b58ac5] debian/control: increase Standards-Version to 4.0.1 + * [e59cf81] rebuild patch queue from patch-queue branch + removed patche(s) (applied upstream): + - fixes/Bug-1308908-Compare-the-whole-accessible-name-when-checki.patch + updated/refreshed patches (no changes): + - porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch + + [ Simon Deziel ] + * [a574010] apparmor/usr.bin.thunderbird: small update to avoid noise + + -- Carsten Schoenert Sat, 19 Aug 2017 18:27:19 +0200 + +icedove (1:52.2.1-5) unstable; urgency=high + + [ Carsten Schoenert ] + * [133a574] Use gcc-6 and g++-6 due broken GUI with GCC-7 + The usage of the GCC-7 suite introduces a broken GUI currently that make + using thunderbird mostly impossible. + (Closes: #871629) + * [3ebacd1] d/rules: use DEB_* variables for entries from changelog + By using variables that are prepared by dpkg we don't need to manually + search for dates and versions. etc. + * [52c2b83] d/copyright: MPL-1.1 and MPL-2.0 now provided by common-licenses + Since policy 4.0.0 the two Mozilla related licenses are included and don't + need to be added extra. + * [3f37967] adjust X-Debian-Homepage to existing Thunderbird page + * [41b5c03] debian/control: increase Standards-Version to 4.0.0 + * [e3c3994] mozconfig.default: use proper disabled options + * [2d4b846] debian/control: increase Breaks for enigmail version + (Closes: #869789) + + [ John Paul Adrian Glaubitz ] + * [4879401] sh4: disable option --disable-pie (Closes: #867553) + + [ Carsten Schoenert ] + * [2646f3f] autpkgtests: disable the idlTest.sh test case + + -- Carsten Schoenert Fri, 11 Aug 2017 22:02:47 -0400 + +icedove (1:52.2.1-4) unstable; urgency=medium + + [ Guido Günther ] + * [04de899] Don't use different profile folder for jessie and wheezy + + [ Carsten Schoenert ] + * [692d3ce] rebuild patch queue from patch-queue branch (Closes: #867013) + added patch (provided by Adrian): + - porting-alpha/FTBFS-alpha-adjust-some-source-to-prevent-build-issues.patch + removed patch: + - porting-hurd/FTBFS-hurd-adding-GNU-to-the-configure-platform-detection.patch + (wrong approach, the Python wrapper around configure isn't yet smart enough) + + [ John Paul Adrian Glaubitz ] + * [5153ce2] mips: final fixups to prevent FTBFS + + -- Carsten Schoenert Thu, 06 Jul 2017 16:53:30 +0200 + +icedove (1:52.2.1-3) unstable; urgency=medium + + [ John Paul Adrian Glaubitz ] + * [99b323a] d/mozconfig.default: fixups for --without-intl-api + + -- Carsten Schoenert Sat, 01 Jul 2017 10:18:05 +0200 + +icedove (1:52.2.1-2) unstable; urgency=medium + + [ Carsten Schoenert ] + * [e8ce299] disabling ICU support on some big endian systems + This hack should enable at least successful building of all RC platforms + and needs to be solved in a not such agressive way without loosing ICU + support on the problematic platforms. + Thanks John Paul Adrian Glaubitz for catching the root of the issue. + * [a66e812] rebuild patch queue from patch-queue branch + Adding a small needed fix for getting mips* out od FTBFS. Also GNU/Hurd + should pass the configure script now. + + -- Carsten Schoenert Fri, 30 Jun 2017 19:38:28 +0200 + +icedove (1:52.2.1-1) unstable; urgency=medium + + [ Guido Günther ] + * [4e87d6b] d/rules: Make sure DIST is not passed on to configure + + [ Carsten Schoenert ] + * [35b84ef] rebuild patch queue from patch-queue branch + added patches: + - porting-mips/Fix-CPU_ARCH-test-for-libjpeg-on-mips.patch + - porting-s390x/FTBFS-s390x-Use-jit-none-AtomicOperations-sparc.h-on-s390.patch + (Closes: #864974) + * [c818874] New upstream version 52.2.1 + (Closes: #861840) + * [8c776c9] Icedove2Thunderbird: add opt out for dialogue pop-up + (Closes: #860381) + + -- Carsten Schoenert Wed, 28 Jun 2017 20:01:44 +0200 + +icedove (1:52.2.0-1) unstable; urgency=medium + + [ Christoph Goehre ] + * [9ebc11d] mozconfig.default: remove configure option + '--disable-methodjit' on armel + This options isn't alive any more and was forgotten to removed on the + previous upload. + [ Simon Deziel ] + * [d8e5d42] usr.bin.thunderbird: merge gpg(1) and gpg2 subprofiles + (Closes: #859179) + * [f18884e] usr.bin.thunderbird: allow accessing gpgconf in gpg subprofile + * [e73afbb] usr.bin.thunderbird: allow accessing any gpg2keys providers + + [ Carsten Schoenert ] + * [066ddb9] mozconfig.default: switch back to internal libjpeg + Going back and using the libjpeg library that's shipped by Mozilla, the + system library probably provoking broken builds on various platforms. + As we prepare the uploads for (old-)stable-security we need to use the + internal libjpeg library at all. + * [ff92bfa] rebuild patch queue from patch-queue branch + modified patches: + - porting-m68k/Add-m68k-support-to-Thunderbird.patch + - porting-sh4/Add-sh4-support-to-Thunderbird.patch + (Closes: #859271, #859508) + * [0a89f76] New upstream version 52.2.0 + Fixed CVE issues in upstream version 52.2 (MFSA 2017-17) + CVE-2017-5472: Use-after-free using destroyed node when regenerating trees + CVE-2017-7749: Use-after-free during docshell reloading + CVE-2017-7750: Use-after-free with track elements + CVE-2017-7751: Use-after-free with content viewer listeners + CVE-2017-7752: Use-after-free with IME input + CVE-2017-7754: Out-of-bounds read in WebGL with ImageInfo object + CVE-2017-7756: Use-after-free and use-after-scope logging XHR header + errors + CVE-2017-7757: Use-after-free in IndexedDB + CVE-2017-7778: Vulnerabilities in the Graphite 2 library + CVE-2017-7758: Out-of-bounds read in Opus encoder + CVE-2017-7764: Domain spoofing with combination of Canadian Syllabics and + other unicode blocks + CVE-2017-5470: Memory safety bugs fixed in Firefox 54 and Firefox ESR 52.2, + and Thunderbird 52 + * [e03380e] rebuild patch queue from patch-queue branch + modified patch: + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + + -- Carsten Schoenert Fri, 16 Jun 2017 20:37:06 +0200 + +icedove (1:52.1.1-1) experimental; urgency=medium + + [ Guido Günther ] + * [db8d0db] Tighten meta package dependencies + Be more strict on depends and add a version to all related + Thunderbird specific packages. + * [defb689] Copy-edit thunderbird-wrapper-helper.sh + * [54b35d4] Allow one to override the location of the wrapper-helper + Make $TB_HELPER more flexible and give the variable a default value, so a + user can override it with it's own. + * [a187364] dh-exec: avoid multiple spaces around filenames + * [a85bc7a] thunderbird-wrapper: robustness when sourcing helper + * [eee56ab] Drop replaces on packages no longer in any release + + [ Carsten Schoenert ] + * [1d85980] rebuild patch queue from patch-queue branch + added patches: + - porting-mk68/Add-m68k-support-to-Thunderbird.patch + - porting-sparc64/Add-sparc64-support-to-Thunderbird.patch + (Closes: #859151, #859271) + * [2717849] tb-wrapper: call thunderbird starting with exec + (Closes: #858100) + * [8afa31b] d/gbp.conf: adjust upstream branch to new ESR version + * [43d2e70] New upstream version 52.1.1 + Fixed CVE issues in upstream version 52.1 (MFSA 2017-09) + CVE-2017-5413: Segmentation fault during bidirectional operations + CVE-2017-5414: File picker can choose incorrect default directory + CVE-2017-5416: Null dereference crash in HttpChannel + CVE-2017-5426: Gecko Media Plugin sandbox is not started if seccomp-bpf + filter is running + CVE-2017-5418: Out of bounds read when parsing HTTP digest authorization + responses + CVE-2017-5419: Repeated authentication prompts lead to DOS attack + CVE-2017-5405: FTP response codes can cause use of uninitialized values + for ports + CVE-2017-5421: Print preview spoofing + CVE-2017-5422: DOS attack by using view-source: protocol repeatedly in one + hyperlink + CVE-2017-5399: Memory safety bugs fixed in Thunderbird 52 + Fixed CVE issues in upstream version 52.1 (MFSA 2017-13) + CVE-2017-5433: Use-after-free in SMIL animation functions + CVE-2017-5435: Use-after-free during transaction processing in the editor + CVE-2017-5436: Out-of-bounds write with malicious font in Graphite 2 + CVE-2017-5461: Out-of-bounds write in Base64 encoding in NSS + CVE-2017-5459: Buffer overflow in WebGL + CVE-2017-5466: Origin confusion when reloading isolated data:text/html URLs + CVE-2017-5434: Use-after-free during focus handling + CVE-2017-5432: Use-after-free in text input selection + CVE-2017-5460: Use-after-free in frame selection + CVE-2017-5438: Use-after-free in nsAutoPtr during XSLT processing + CVE-2017-5439: Use-after-free in nsTArray Length() during XSLT processing + CVE-2017-5440: Use-after-free in txExecutionState destructor during XSLT + processing + CVE-2017-5441: Use-after-free with selection during scroll events + CVE-2017-5442: Use-after-free during style changes + CVE-2017-5464: Memory corruption with accessibility and DOM manipulation + CVE-2017-5443: Out-of-bounds write during BinHex decoding + CVE-2017-5444: Buffer overflow while parsing application/http-index-format + contents + CVE-2017-5446: Out-of-bounds read when HTTP/2 DATA frames are sent with + incorrect data + CVE-2017-5447: Out-of-bounds read during glyph processing + CVE-2017-5465: Out-of-bounds read in ConvolvePixel + CVE-2016-10196: Vulnerabilities in Libevent library + CVE-2017-5454: Sandbox escape allowing file system read access through + file picker + CVE-2017-5469: Potential Buffer overflow in flex-generated code + CVE-2017-5445: Uninitialized values used while parsing + application/http-index-format content + CVE-2017-5449: Crash during bidirectional unicode manipulation with + animation + CVE-2017-5451: Addressbar spoofing with onblur event + CVE-2017-5462: DRBG flaw in NSS + CVE-2017-5467: Memory corruption when drawing Skia content + CVE-2017-5430: Memory safety bugs fixed in Firefox 53, Firefox ESR 52.1, + Thunderbird 52.1 + CVE-2017-5429: Memory safety bugs fixed in Firefox 53, Firefox ESR 45.9, + Firefox ESR 52.1, and Thunderbird 52.1 + (Closes: #855344, #495372, #861480, #682208, #698244, #859909, #857593, + #837771) + * [de561ef] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/Allow-to-override-ICU_DATA_FILE-from-the-environment.patch + - debian-hacks/Build-against-system-libjsoncpp.patch + - debian-hacks/Don-t-build-testing-suites-and-stuff.patch + - debian-hacks/Force-use-the-i686-rust-target.patch + - fixes/Bug-1308908-Compare-the-whole-accessible-name-when-checki.patch + (Closes: #826325) + - porting-sh4/Add-sh4-support-to-Thunderbird.patch + (Closes: #859508) + removed patches (obsoleted by upstream changes): + - debian-hacks/Don-t-build-example-component.patch + - debian-hacks/fix-identification-of-ObjdirMismatchException.patch + - fixes/Bug-1245076-Don-t-include-mozalloc.h-from-the-cstdlib-wra.patch + - fixes/Bug-1273020-Add-missing-null-checks-in-ApplicationAccessi.patch + - fixes/Bug-1277295-Remove-obsolete-reference-to-storage-service-.patch + - fixes/Bug-1340724-fix-SMTP-server-name-output-in-SMTP-logging.-.patch + - fixes/Bug-497488-Implement-verify-mode-in-the-subscribe-dialog-.patch + - fixes/Bug-497488-RSS-feeds-with-an-invalid-certificate-fail-wit-1.patch + - fixes/Bug-497488-RSS-feeds-with-an-invalid-certificate-fail-wit.patch + - porting-arm64/Bug-1091515-Don-t-set-64KB-page-size-on-aarch64.-r-glandi.patch + - porting-kfreebsd-hurd/CrossProcessMutex.h-fix-build-on-kfreebsd-and-GNU-hurd.patch + - porting-kfreebsd-hurd/FTBFS-hurd-adding-the-HURD-platform-to-the-configure.patch + - porting-kfreebsd-hurd/correcting-file-inclusion-for-kfreebsd-and-hurd.patch + - porting-mips/Fix-build-error-in-MIPS-SIMD-when-compiling-with-mfp.patch + - porting-mips/libyuv_disable-mips-assembly-for-MIPS64.patch + - porting-powerpcspe/FTBFS-powerpcspe-disable-AltiVec-instructions.patch + - porting-sparc64/Add-sparc64-support-to-Thunderbird.patch + (unclear state, will be added later again) + - porting/Add-xptcall-support-for-SH4-processors.patch + (Closes: #859362) + - debian-hacks/Move-profile.patch + modified or adjusted patches: + - debian-hacks/changing-the-default-search-engine.patch + - debian-hacks/stop-configure-if-with-system-bz2-was-passed-but-no-.patch + - icedove-l10n/disable-extension-update-extension-is-managed-by-apt.patch + --> icedove-l10n/thunderbird-l10n-disable-external-extension-update.patch + (renamed to and modified due new languages) + - icedove/fix-installdir.patch + --> debian-hacks/Thunderbird-fix-installdir-for-icons.patch + * [684ad58] d/source.filter: update due upstream changes + * [d005649] debian/control: modify various B-D + * [7a8a98d] debian/rules: add some extra C*FLAGS + Adding '-fno-lifetime-dse' to not enable dead store elimination of + objects within their lifetime, some parts of the source is relying + on the persistent values of such objects. + Some other distributions as Ubuntu, Fedora and Arch e.g. use this flag too + (at least with ESR52) to prevent possible segfaults. + * [56f8f4b] debian/rules: adding hack to preserve correct config.status + * [fb500a6] mozconfig.default: remove no longer existing options + * [c9a3e60] mozconfig.default: some minor adjustments to configure options + * [f584857] mozconfig.default: enable GTK3 theme explicit + (Closes: #857593) + * [3cbe1fb] debian/control: add packages for *-dsb language + * [8317735] debian/control: add packages for *-hsb language + * [39d90c1] debian/control: add packages for *-kab language + * [82b4f50] debian/control: add missing packages for *-ast language + * [0edde96] debian/rules: include also l10n folder with 3 characters + * [47f17a4] lintian-overrides: modify the list for the js files to ignore + * [8872d34] debian/copyright: update after upstream changes + * [6755547] mozconfig.default: use some internal libraries + Use libicu-dev, libnspr4-dev, libnss3-dev, libsqlite3-dev from + shipped source as Stretch versions not recent enough. + * [5b04b32] thunderbird.install: pick up icu*.dat if around + * [edf24d7] debian/control: mark thunderbird-dbg as Multi-Arch: same + * [5d5392b] apparmor/usr.bin.thunderbird: update for version 52 + (cherry-picked from upstream) + (Closes: #859179) + * [f49ad79] apparmor/usr.bin.thunderbird: grant access to commonly used + locations (cherry-picked from upstream) + * [510fd6f] debian/rules: install lightning-l10n files into correct place + * [d70ade4] lightning-l10n: adjust min/max version for ESR 52 cycle + With the new ESR version tweaking the extension version of l10n packages + for lightning > 52.0 and < 52.*. + * [c0dd18f] debian/rules: install icudt5*.dat file more flexible + * [b5136f7] autopkg: improve the output of idlTest.sh + * [7ac04f6] autopkg: add extra test icudatfileTest.sh + + [ Christoph Goehre ] + * [13f5178] lintian-overrides: we build against internal nspr and nss + * [56bbf23] rebuild patch queue from patch-queue branch + added patches: + - porting-sparc64/Add-sparc64-support-to-Thunderbird.patch + (Closes: #859151) + modified patches: + - porting-mk68/Add-m68k-support-to-Thunderbird.patch + -> porting-m68k/Add-m68k-support-to-Thunderbird.patch (renamed) + * [6a7ef60] tests/idlTest.sh: remove duplicated 'done' output + * [42bf8e1] debian/rules: remove duplicate .so files in thunderbird-dev + * [5dc08bc] tests/soSymlinkTest.sh: check for symlinked .so files + + -- Carsten Schoenert Sat, 03 Jun 2017 19:54:43 +0200 + +icedove (1:45.8.0-3) unstable; urgency=medium + + [ Carsten Schoenert ] + * [d923505] AppArmor: be more flexible on profile folders + (Closes: #858735, #858737) + * [1e04099] tb-wrapper: use readlink also on ${ID_PROFILE_FOLDER} + (Closes: #858771) + * [9f6b771] tb-wrapper: correct check for -dbg package (Closes: #858804) + * [8b5271a] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-1273020-Add-missing-null-checks-in-ApplicationAccessi.patch + + -- Christoph Goehre Wed, 29 Mar 2017 19:28:32 -0400 + +icedove (1:45.8.0-2) unstable; urgency=medium + + [ Carsten Schoenert ] + * [c2a1d77] tb-helper: pass arguments correctly through tb call + (Closes: #855334) + * [5c49348] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-1340724-fix-SMTP-server-name-output-in-SMTP-logging.patch + (Closes: #855470) + * [9d420c0] Revert "register MIME type application/octet-stream for + Thunderbird" (Closes: #857755) + * [c9960e5] tb-helper: pass arguments by using a array to TB call + + -- Christoph Goehre Tue, 14 Mar 2017 20:37:48 -0400 + +icedove (1:45.8.0-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [3388899] New upstream version 45.8.0 + * [24d25e9] tb-helper*: fix up that silly comments behind the if statement + (Closes: #857029, #857032, #857098, #857112) + * [788b7fa] bash-completion: adding a completion script for /u/b/thunderbird + * [9ac9d07] rebuild patch queue from patch-queue branch + added patches: + - p-arm64/Bug-1091515-Don-t-set-64KB-page-size-on-aarch64.-r-glandi.patch + - p-arm64/Bug-1257055-Use-jit-arm64-Architecture-arm64.h-on-non-JIT.patch + * [ad0860b] copyright: small updates reflecting upstream changes + + [ Christoph Goehre ] + * [69577cf] lintian: replace hardlink in thunderbird-dev with symbolic link + + -- Christoph Goehre Thu, 09 Mar 2017 20:24:49 -0500 + +icedove (1:45.7.1-2) unstable; urgency=medium + + [ Christoph Goehre ] + * [5e2c618] crashreporter: build only on amd64, armel, armhf and i386 + * [36a922f] Apparmor: replace '·' with spaces (Closes: #855343) + * [bbbc917] rebuild patch queue from patch-queue branch + added patches: + - p-hppa/FTBFS-hppa-xpcshell-segfaulting-during-make-install.patch + * [8b5d601] icedove|thunderbird.desktop: update danish (da) translation + + [ Carsten Schoenert ] + * [f8debbd] debian/control: separate transitional mark by extra line + (Closes: #855806) + * [583c798] {tb,id}.maintscript: modify start-version (Closes: #854587) + * [94e557c] thunderbird: adding x11-utils to Depends (Closes: #854488) + * [dc878e7] thunderbird-wrapper.sh: fix command line transfer to TB + (Closes: #855334) + * [9734349] thunderbird helper: split helper function into extra file + (Closes: #855286) + * [3089a97] tb-helper*: wrapping X11 dialog calls + * [e0331e1] tb-helper*: rework option parsing for wrapper script + (Closes: #855872) + * [31d9899] thunderbird.postinst: try to remove empty profile folder + (Closes: #855228) + * [c9e5b70] tb-wrapper*: complete rework and moving over for symlinking + (Closes: #855265, #855391, #855501, #856490) + * [9ef920f] README.Debian: adopt content to current wrapper script behavior + * [4cf88e5] icedove|thunderbird.desktop: adopt binary call + * [101e0ad] tb-helper*: call subfunctions not within the case loop + * [c061107] register MIME type application/octet-stream for Thunderbird + + -- Christoph Goehre Mon, 06 Mar 2017 20:39:23 -0500 + +icedove (1:45.7.1-1) unstable; urgency=medium + + * Bye-bye Icedove (Closes: #749965, #776359, #816679, #363811) + + [ Carsten Schoenert ] + * [90c0d6f] New upstream version 45.7.1 + * [a6d21de] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-497488-Implement-verify-mode-in-the-subscribe-dialog-.patch + - fixes/Bug-497488-RSS-feeds-with-an-invalid-certificate-fail-wit-1.patch + - fixes/Bug-497488-RSS-feeds-with-an-invalid-certificate-fail-wit.patch + (Closes: #837177) + removed patches (fixed upstream): + - debian-hacks/icu.m4-adding-extra-bracket-to-not-confuse-grep.patch + * [8572e34] lintian: adding a semi automated lintian-override + * [aa2bda2] crashreporter: enable the reporter for thunderbird + * [b96ae57] move icedove.desktop into package icedove + (Closes: #850865, #851829) + * [304921f] debian/rules: set SHELL explicit to /bin/bash (Closes: #852867) + * [072b899] thunderbird: adding extra check while migration + * [284912d] debian/README.Debian: update after recent changes + * [6dc7e32] icedove-l10n-bn-bd: fix typo in Depends field (Closes: #854135) + * [c5d4bf5] {tb,id}.maintscript: modify start-version (Closes: #854587) + * [f3d64ae] thunderbird-wrapper.sh: adding extra information window + (Closes: #854488) + * [6b432c7] README.Debian: hint about issue in global configuration + + [ Douglas Bagnall ] + * [e2c8a23] Apparmor: allowing exo-open-ixr launcher (Closes: #853929) + + [ Christoph Goehre ] + * [ef36e0b] thunderbird-wrapper.sh: fix typos + * [f98d5d1] thunderbird-wrapper.sh: add small changes from Guido and Carsten + * [7dd6841] README.Debian: fix/correct spelling + * [e038694] debian/control: remove depends-on-essential-package 'sed' + + [ Jens Reyer ] + * [ea58e17] thunderbird-wrapper.sh: add extra function for migration + (Closes: #849592) + + -- Christoph Goehre Tue, 14 Feb 2017 18:46:23 -0500 + +icedove (1:45.6.0-3) experimental; urgency=medium + + [ Carsten Schoenert ] + * [78b3296] rebuild patch queue from patch-queue branch + added patch: + - debian-hacks/icu.m4-adding-extra-bracket-to-not-confuse-grep.patch + * [a272f85] thunderbird-wrapper.sh: also migrate mimeapps.list + (Closes: #850864) + * [3d4e303] icedove.desktop: don't use categories and mimetypes + (Closes: #850866) + * [db15d43] icedove: link icedove to thunderbird + * [59a9e05] debian/control: change Replaces and Breaks versions + + [ Christoph Goehre ] + * [55cce4a] thunderbird-wrapper.sh: remove 'set -e' + + -- Christoph Goehre Tue, 17 Jan 2017 18:26:06 -0500 + +icedove (1:45.6.0-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [26f8f2d] New upstream version 45.6.0 + * [15b7797] iceowl-l10n-*: rearrange Recommends field for various packages + (Closes: #824727, #824750, #824763, #824764, #824768, #824780) + * [3f75b56] debian/vendor.js: adjust to new version related wiki site + * [6bd7f89] d/c-id-l10n: adjusting download URL for stable versions + * [f15d1a2] icedove-l10n-all: change Section into metapackages + (Closes: #824785) + * [25c3ba1] debian/README.source: info about import of multitarballs + * [3ebcf59] debian/control: adding Recommends to icedove-l10n-uk + (Closes: #825806) + * [3e57d5e] debian/control: Icedove, adding dependency on libatk-adaptor + * [e19c59d] debian/control: rework Recommends for icedove-l10n-* + * [4741d80] debian/control: small fixup Recommends on iceowl-l10n-* + * [f9f5193] debian/control: sort iceowl-l10n-* alphabetical + * [5220187] de-branding: move iceowl* back to lightning* + * [6e28ce5] de-branding: remove Icedove naming from icedove-l10n* + * [3dc3b4b] de-branding: remove Icedove branding in the main binary + * [8b715cf] de-branding: remove hard name branding in addon managger + * [9f609fa] de-branding: adopting dh files for icedove package + * [caba322] de-branding: adopting dh files for icedove-dev package + * [6538f66] de-branding: change debian/rules to reflect appname change + * [871588d] de-branding: adopting dh files for iceowl-extension package + * [a0b20e7] debian/tests/*: adopt change of the binary icedove + * [29025cc] de-branding: adjust icedove-l10n installation folder + * [2b8dd99] de-branding: adjust iceowl-l10n installation folder + * [1f3043c] de-branding: remove the Debian visual branding + * [272e420] de-branding: removing icedove branding files and folder + * [093bc58] de-branding: revitalize *.desktop file with Thunderbird + * [4a35d9d] de-branding: move iceowl-l10n-* into lightning-l10n-* + * [68d8d79] de-branding: adding transitional iceowl-l10n packages + * [4b2febd] de-branding: adding 'Breaks', 'Replaces', 'Provides' to + lightning-l10n-* + * [9cdb427] de-branding: rework d/r to reflect changes for lightning-l10n + * [ec3b427] de-branding: move icedove-l10n-* into thunderbird-l10n-* + * [387bfa2] de-branding: adding transitional icedove-l10n packages + * [f3cfecb] de-branding: adding 'Breaks', 'Replaces', 'Provides' to + thunderbird-l10n-* + * [03b222e] de-branding: rework d/r to reflect changes for thunderbird-l10n + * [0c9a6ab] de-branding: (re)adding a wrapper script for TB starting + * [f9c8aef] de-branding: move icedove-dev to thunderbird-dev + * [a4313e6] de-branding: adding transitional icedove-dev package + * [0508866] de-branding: rework d/r to reflect changes for thunderbird-dev + * [048b29f] de-branding: move icedove-dbg to thunderbird-dbg + * [da01077] de-branding: adding transitional icedove-dbg package + * [a371079] de-branding: rework d/r to reflect changes for thunderbird-dbg + * [b34b8f8] de-branding: move iceowl-extension to lightning + * [fa8f9b3] de-branding: adding transitional iceowl-extension package + * [848f178] de-branding: rework d/r to reflect changes for lightning + * [a708c35] de-branding: move icedove to thunderbird + * [cccef90] de-branding: moving icedove dh files into thunderbird + * [8c2b27d] de-branding: rework icedove.1 into thunderbird.1 + * [19406fe] de-branding: transition of mozconfig.* + * [88ed684] de-branding: rework d/r to reflect changes for thunderbird + * [c8011d3] de-branding: adding transitional icedove package + * [5e399aa] de-branding: adjusting package calendar-google-provider + * [a03329c] debian/tests/help.sh: use absolute path for binary call + * [10adb34] move old icedove graphic stuff into own folder + * [abc6c8c] create various thunderbird png graphics from SVG file + * [a2067ae] debian/copyright: update copyright information + * [a9c6f9f] de-branding: add own created thunderbird icons to install + * [1d8b524] mozconfig.default: enable the official brandind + * [9f3a673] debian/control: adding dh-exec to the Build-Depends + * [cddbc63] move Thunderbird install files into thunderbird.install + * [5037bb5] de-branding: transition of apparmor profile for TB + * [14f094d] de-branding: remove extra URL for What's New inside + * [c2a06db] manpage thunderbird; adjust and correct manpage entries + * [8fa3365] debian/control: adding package dpkg to Build-Depends + * [ba84ede] thunderbird: switching dpkg-maintscript-helper to *.maintscript + * [d0e675b] debian/thunderbird.postinst: adding some moving mechanism + * [cbae415] de-branding: let helper scripts reflect thunderbird change + * [da402a4] thunderbird-wrapper.sh: adding fixing inside mimeTypes.rdf + (Closes: #837516) + * [030d49e] de-branding: adding some hints about the debranding + * [662f7af] debian/README.source: adjusting hints due name changes + * [8fbedc1] debian/thunderbird.install: install additional icedove.desktop + * [9089d9f] debian/*lintian-overrides: adopt name changes + * [b9b7665] debian/rules: use the old profile folder for wheezy and jessie + * [f9c137e] fix *.desktop files for proper GNOME app mechanism + (Closes: #817973, #832302) + * [1c85ff7] debian/rules: chmod certain *.py tb-devel files + * [356694a] thunderbird.links: linking the default TB icon to u/s/p + + [ Guido Günther ] + * [24bbee9] Wrap and sort control information (Closes: #825806) + * [fcfe4ac] Add minimalistic autopkgtest + * [f7a32e8] Add autopkgtest to test header and typelib generation + * [189d835] Add autopkgtest to smoke test xpcshell + + [ Christoph Goehre ] + * [354f836] turn the reduce of memory usage of the linker on again + * [5e48e17] don't build dbgsym packages on unreleased builds + * [09679eb] rebuild patch queue from patch-queue branch (Closes: #808183) + * [ec3a50b] debian/NEWS: change urgency to medium + + -- Christoph Goehre Sat, 31 Dec 2016 10:26:36 +0100 + +icedove (1:45.5.1-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [efe836f] New upstream version 45.5.1 + * [48999ac] rebuild patch queue from patch-queue branch + + -- Carsten Schoenert Wed, 30 Nov 2016 18:27:57 +0100 + +icedove (1:45.4.0-1) unstable; urgency=medium + + [ Guido Günther ] + * [a159bc9] autopkgtests: let xfvb-run pick the port to avoid clashes with + already running servers + * [5384838] Snapshot 1:45.3.0-1~1.gbpa159bc + * [8d3ac18] autopkgtest: Dont print on stderr + * [8afc7be] Put test deps on a simgle line + + [ Carsten Schoenert ] + * [99e9c40] New upstream version 45.4.0 + (Closes: #835866, #836798, #837107) + * [6195d7b] debian/README.source: update instructions for importing + * [5150624] debian/icedove.js: disabling baselinejit functionality + (Closes: #837930) + + -- Carsten Schoenert Mon, 03 Oct 2016 12:18:09 +0200 + +icedove (1:45.3.0-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [3cc29ee] Imported Upstream version 45.3.0 + * [ed8cf89] Imported icedove-l10n Upstream version 45.3.0 + * [bc20676] Imported iceowl-l10n Upstream version 45.3.0 + * [54bd9c4] debian/README.source: fix up some hints + * [756ec86] mozconfig.default: enable build of PIE binaries + * [1cef6f8] rebuild patch queue from patch-queue branch + added patch: + - porting-mips/libyuv_disable-mips-assembly-for-MIPS64.patch + (Closes: #836400) + * [7a1ec74] AppArmor: grant access to local mailboxes and enigmail(2) + (Closes: #837656) + + -- Carsten Schoenert Wed, 28 Sep 2016 22:52:03 +0200 + +icedove (1:45.2.0-4) unstable; urgency=medium + + [ Carsten Schoenert ] + * [cc8cd76] mozconfig.default: relaxe optimization on arm{64,el,hf} to -O1 + + -- Christoph Goehre Thu, 18 Aug 2016 10:45:17 -0400 + +icedove (1:45.2.0-3) unstable; urgency=medium + + [ Guido Günther ] + * [9a8f4e1] tests: Fix typo + + [ Carsten Schoenert ] + * [53aab10] AppArmor: allow self execution for -ProfileManager + (Closes: #833742) + * [a459d6a] debian/rules: adding one more CFLAGS/CXXFLAGS compiler flag + (Closes: #833864, #833532, #833591, #833635, #833698) + * [e32c460] AppArmor: grant access to local mailboxes and enigmail + (Closes: #833184) + * [f34e41e] debian/rules: fix typo CXLAGS -> CFLAGS + + -- Christoph Goehre Fri, 12 Aug 2016 12:00:44 -0400 + +icedove (1:45.2.0-2) unstable; urgency=medium + + [ Christoph Goehre ] + * [8b4f306] rebuild patch queue from patch-queue branch + added patches: + - p-kfree-hurd/CrossProcessMutex.h-fix-build-on-kfreebsd-and-GNU-hur.patch + (Closes: #808183) + + [ Carsten Schoenert ] + * [08e20a0] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-1277295-Remove-obsolete-reference-to-storage-service-.patch + (Closes: #827592) + - fixes/Bug-1245076-Don-t-include-mozalloc.h-from-the-cstdlib-wra.patch + (Closes: #831192) + * [1ea97f1] debian/icedove.js: disable Icedove startup check + (Closes: #817973) + * [83bdcdf] debian/rules: adding additional CFLAGS and CXXFLAGS + * [7dc0588] debian/control: addjust breaks for xul-ext-foxyproxy-standard + (Closes: #825749) + * [50a0f1e] autopkg: fixup small type within test call + + [ Ulrike Uhlig ] + * [b24bbaa] Add rebranded apparmor profile from upstream (Closes: #829731) + * [0a28f91] apparmor/usr.bin.icedove: refresh Icedove AppArmor profile + + [ Guido Günther ] + * [6fe4897] Fix apparmor profile installation + + -- Christoph Goehre Tue, 26 Jul 2016 13:25:21 -0400 + +icedove (1:45.2.0-1) unstable; urgency=medium + + [ Guido Günther ] + * [f777843] Wrap and sort control information + via 'wrap-and-sort -ast' to simplify backporting (Closes: #825806) + * [457dffe] Register components with gbp + * [8e73822] Rediff patches + + [ Carsten Schoenert ] + * [789ed6f] Imported Upstream version 45.1.1 + * [8b8bd3c] Imported icedove-l10n Upstream version 45.1.1 + * [23b2984] Imported iceowl-l10n Upstream version 45.1.1 + * [411b27d] Imported Upstream version 45.2.0 + * [975287a] Imported icedove-l10n Upstream version 45.2.0 + * [09b6652] Imported iceowl-l10n Upstream version 45.2.0 + * [2b99997] icedove-l10n-all: change Section into metapackages. + As Jonas Smedegaard pointed out, the icedove-l10n-all package is a + metapackage and localization. + (Closes: #824785) + * [a7eec24] debian/README.source: info about import of multitarballs. + As the VCS is using git-buildpackage for package maintenace adding some + hints on how to handle the impoert of the used mutitarballs since + version 45.0. + * [73e8b1a] debian/control: adding Recommends to icedove-l10n-uk + (Closes: #825806) + * [f118470] debian/control: Icedove, adding dependency on libatk-adaptor. + After the adding of some first small autopkg test it turns out that we + miss a dependency on libatk-adaptor. + * [e6e95c9] debian/control: rework Recommends for icedove-l10n-* + As addition to 711468b933f280fe9d6ed78bb1d7d763dede9ea7 also rework the + various Recommends for the icedove-l10n packages. + * [1275b3d] debian/control: small fixup Recommends on iceowl-l10n-* + Fix small typos for iceowl-l10n-{pt-pt,sl} + * [c4c9a02] debian/control: sort iceowl-l10n-* alphabetical + + -- Guido Günther Fri, 08 Jul 2016 15:55:46 +0200 + +icedove (1:45.2~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [68883af] rebuild patch queue from patch-queue branch + added patches: + - porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch + * [ee509d2] debian/mozconfig.default: switching back to gtk2 as default + (Closes: #821744) + * [f72fe06] adding helper script create-iceowl-l10n-tarball.sh + * [28fba93] debian/README.source: adding additional info for iceowl-l10n + * [826af5b] adding iceowl-l10n related patches to the patch queue + * [1aa6f37] debian/iceowl-*.in: adding needed base files + * [a5946b4] debian/rules: adding iceowl-l10n related rules + * [b1da616] debian/control: adding the current iceowl-l10n-* packages + * [b359c95] debian/source.filter: some adjustments to the filter + * [e45ab44] debian/README.source: use recent version and reformating + * [50b3830] debian/control: increase Standards-Version to 3.9.8 + * [3a767b8] debian/rules: remove no longer needed LDFLAGS + * [29a7739] Imported Upstream version 45.2~b1 + * [15b7797] iceowl-l10n-*: rearrange Recommends field for various packages + (Closes: #824727, #824750, #824763, #824764, #824768, #824780) + * [3f75b56] debian/vendor.js: adjust to new version related wiki site + * [6bd7f89] d/c-id-l10n: adjusting download URL for stable versions + * [f15d1a2] icedove-l10n-all: change Section into metapackages + (Closes: #824785) + * [25c3ba1] debian/README.source: info about import of multitarballs + * [3ebcf59] debian/control: adding Recommends to icedove-l10n-uk + (Closes: #825806) + * [3e57d5e] debian/control: Icedove, adding dependency on libatk-adaptor + * [e19c59d] debian/control: rework Recommends for icedove-l10n-* + * [4741d80] debian/control: small fixup Recommends on iceowl-l10n-* + * [f9f5193] debian/control: sort iceowl-l10n-* alphabetical + + [ Christoph Goehre ] + * [ce58560] debian/rules: add option to dh_auto_clean + * [8cfbeca] debian/rules: export necessary DEB_ vars into environment + (Closes: #819020) + * [7512da8] debian/rules: ignore build folder and run 'build' target instead + (Closes: #819020) + * [354f836] turn the reduce of memory usage of the linker on again + * [5e48e17] don't build dbgsym packages on unreleased builds + * [09679eb] rebuild patch queue from patch-queue branch + added patches: + - p-kfree-hurd/CrossProcessMutex.h-fix-build-on-kfreebsd-and-GNU-hu.patch + (Closes: #808183) + + [ Guido Günther ] + * [24bbee9] Wrap and sort control information (Closes: #825806) + * [fcfe4ac] Add minimalistic autopkgtest + * [f7a32e8] Add autopkgtest to test header and typelib generation + * [189d835] Add autopkgtest to smoke test xpcshell + + -- Christoph Goehre Wed, 01 Jun 2016 17:56:29 -0400 + +icedove (1:45.0~b4-2) experimental; urgency=medium + + * [fa7bc47] debian/control: fix FTBFS by moving Build-Depends-Indep to + Build-Depends + + -- Christoph Goehre Sun, 10 Apr 2016 15:24:39 -0400 + +icedove (1:45.0~b4-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [3bf50c7] Imported Upstream version 45.0~b4 + * [11744a7] debian/source.filter: fixup for previous change + * [0bd3753] debian/gbp.conf: adding default filter out pattern + * [a9f6cfa] rebuild patch queue from patch-queue branch + removed patches (fixed upstream): + - fixes/Bug-1178266-Link-against-libatomic-when-necessary.patch + - p-arm64/FTBFS-arm64-Adding-configure-option-for-aarch64-platform.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-1-4.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-2-4.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-3-4.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-4-4.patch + modified patches: + - p-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch + * [9dcb46e] debian/control: increase B-D on libnspr-dev + * [b31fba5] debian/control: increase Standards-Version to 3.9.7 + * [623250d] Icedove Branding: adopt usptream changes to branding + * [2fa9b24] debian/copyright: update copyright information + * [c5dd11d] debian/copyright: include the license text for MPL-1.0 + * [3a90ecd] debian/copyright: include the license text for MPL-1.1 + * [7291650] debian/copyright: include the license text for MPL-2.0 + * [0ebdd3f] debian/copyright: include the license text for libpng + * [9ee79fa] d/icedove.install: remove no longer existing parts + * [880c9e9] debian/rules: remove obsolet dpkg-shlibdeps call + * [e4fb8a2] adding helper script create-icedove-l10n-tarball.sh + * [8826951] debian/README.source: adding hint for creating l10n tarball + * [08f9071] debian/control: adding the current icedove-l10n-* packages + (Closes: #680488) + * [d839f37] debian/rules: adding icedove.l10n install to targets + * [5b0df21] debian/gbp.conf: use a Tuple for selecting multiple files + * [e32519f] debian/control: increase B-D on libnss-dev + * [2200691] debian/control: increase B-D on libnspr4-dev + * [0f5660e] debian/control: increase increase B-D on libnss3-dev + * [5fd8af8] mozconfig.default: adding new configure option + * [e288c6e] debian/control: adding a B-D on libpng-dev + + [ Christoph Goehre ] + * [f8c7ca5] debian/control: make depends between icedove-l10n and icedove + dynamic + * [ac760d7] debian/control: add section localization to all l10n packages + * [72ef6c7] debian/NEWS: rename to icedove.NEWS to ship only in icedove core + package + * add epoch in version number to update l10n packages smoothly + + -- Christoph Goehre Sat, 09 Apr 2016 18:56:59 -0400 + +icedove (44.0~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [a24f78b] Imported Upstream version 44.0~b1 + * [7f52453] rebuild patch queue from patch-queue branch + removed patches: + - d-hacks/Add-unminified-jquery-and-jquery-ui-files.patch + - d-hacks/Allow-unsigned-addons-in-usr-lib-share-mozilla-extensions.patch + - d-hacks/creating-a-dummy-.deps-directory-to-get-make-happy.patch + added patches: + - p-arm64/FTBFS-arm64-Adding-configure-option-for-aarch64-platform.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-1-4.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-2-4.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-3-4.patch + - p-mips/FTBFS-mips-adoptions-to-get-build-on-mips-el-working-4-4.patch + modified patches: + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + * [ecf1110] debian/watch: adjust to new CDN structure + * [dd5efe8] debian/control: increase Build-Depends on libsqlite3-dev + * [57165b5] debian/control: switch URI for the Vcs fields to https + * [c9ded96] debian/source.filter: adding more filters on testings js files + * [31ce42f] debian/copyright: update due upstream/import changes + + -- Christoph Goehre Sat, 13 Feb 2016 19:08:55 -0500 + +icedove (43.0~b1-1) experimental; urgency=medium + + [ Christoph Goehre ] + * [ef5b1ef] debian/rules: split override_dh_install into arch and indep + section (Closes: #806047) + * [02d5d7c] debian/source.filter: remove filter for searchplugins + + [ Guido Günther ] + * [2008a71] Clarify relation between icedove and the calendar extensions + (Closes: #809017) + + [ Carsten Schoenert ] + * [11ffac0] debian/source.filter: modifying file list to ignore + * [926912b] Imported Upstream version 43.0~b1 + * [32cd8c0] rebuild patch queue from patch-queue branch + added patches: + - d-hacks/Allow-unsigned-addons-in-usr-lib-share-mozilla-extensions.patch + removed patches (fixed upstream): + - reproducible/Generate-sorted-libical-header-list.patch + * [a1637e4] debian/control: increase B-D on libnspr-dev and libnss3-dev + * [f9937c1] debian/source.filter: sort entries alphabetical + * [326f74d] debian/source.filter: adding new files to filter out + * [9b9d9b9] debian/copyright: update due upstream changes + * [69664c7] d/icedove.install: searchplugins isn't alive anymore + + -- Christoph Goehre Tue, 19 Jan 2016 11:41:50 -0500 + +icedove (42.0~b2-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [8842d85] Imported Upstream version 42.0~b2 + * [6d14aca] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-1178266-Link-against-libatomic-when-necessary.patch + * [320c43d] add myself to the uploaders + * [797a290] lintian: remove icedove.menu file due CTTE#741573 + + [ Guido Günther ] + * [caca7c2] Add unminified jquery and jquery-ui files (Closes: #802281) + + -- Christoph Goehre Sun, 08 Nov 2015 15:30:56 -0500 + +icedove (42.0~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [c599b6b] Imported Upstream version 42.0~b1 + * [41285cb] debian/copyright: fixup's and update + * [6b270be] debian/control: increase various build depends + * [be75969] adopting needed changes for GTK3 into the Debian branding + * [245161e] fixup branding about.png file + + -- Christoph Goehre Sat, 10 Oct 2015 21:26:24 -0400 + +icedove (41.0~b2-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [b1d982c] Imported Upstream version 41.0~b2 + * [8389b9b] rebuild patch queue from patch-queue branch + added patches: + - porting-mips/Fix-build-error-in-MIPS-SIMD-when-compiling-with-mfp.patch + modified patches: + - icedove/fix-branding-in-migration-wizard-and-the-addon-manag.patch + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + dropped patches (fixed upstream): + - fixes/Bug-1168231-Fixup-to-keep-file-type.patch + - fixes/Bug-1168231-Normalize-file-mode-in-jars.patch + - reproducible/Bug-1166243-Remove-build-function-from-js-and-xpc-sh.patch + - reproducible/Bug-1168316-Remove-build-machine-name-from-about-bui.patch + * [9ebf7b9] debian/source.filter: modifying file list to ignore + * [b25d990] debian/copyright: fixup's and update + + [ Christoph Goehre ] + * [8ebffb0] relax optimize to -O1 on s390x (Closes: #797551) + * [dea1627] debian/rules: Disable jit on mips (Closes: #797548) + + -- Christoph Goehre Fri, 25 Sep 2015 18:43:44 -0400 + +icedove (40.0~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [9d358dc] debian/source.filter: adjust new files + * [328cdc7] Imported Upstream version 40.0~b1 + * [8813d89] debian/rules: setting MOZ_BUILD_DATE explicitly. + This patch is based on work from Mike Hommey within the Iceweasel + package to enable reproducible builds. It defines the MOZ_BUILD_DATE + with a pre defined timezone. + * [8dd5b9f] debian/rules: add switch to skip icedove-dbg build to + speed up the build. + * [a6beec7] debian/control: Let icedove recommendiceowl-extension + * [691dfe9] add release related information + * [bdfdfd8] debian/vendor.js: adjusting WhatNew link to more dedicated URL + * [5ba6ec7] rebuild patch queue from patch-queue branch + added patches: + debian-hacks/changing-the-default-search-engine.patch + fixes/Bug-1168231-Fixup-to-keep-file-type.patch + fixes/Bug-1168231-Normalize-file-mode-in-jars.patch + reproducible/Bug-1166243-Remove-build-function-from-js-and-xpc-sh.patch + reproducible/Bug-1168316-Remove-build-machine-name-from-about-bui.patc + reproducible/Generate-sorted-libical-header-list + modified patches: + fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch + porting-kfreebsd-hurd/FTBFS-hurd-adding-the-HURD-platform-to-the-configure.patch + porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + porting/Disable-optimization-on-alpha-for-the-url-classifier.patch + deleted patches: + debian-hacks/pass-OS_LDFLAGS-to-all-ldap-libraries.patch + debian-hacks/remove-timestamps-from-c_cpp-macros-for-reproducibil.patch + debian/patches/fixes/Link-libldap-against-libpthread.patch + debian/patches/icedove/no-dynamic-nss-softokn.patch + debian/patches/porting/Remove-duplicate-SkDiscardableMemory_none.cpp-from-g.patch + * [59046ae,12d4f4b] debian/copyright: update due upstream changes + * [7c1f002] debian/iceowl-extension.lintian-overrides: remove file, no longer needed + * [23eed8c] debian/source.lintian-overrides: adding new entries. + Lintian is detecting the braces within the folder names incorrectly as + brace expansion. + * [2f95cd3] add changes due ldap restructure. + + [ Christoph Goehre ] + * [ff66528] lintian: fix spelling error in debian/README.Debian + + -- Guido Guenther Wed, 19 Aug 2015 09:39:23 +0200 + +icedove (38.7.2-1) unstable; urgency=medium + + * [397cd7a] Imported Upstream version 38.7.2 + + -- Christoph Goehre Wed, 13 Apr 2016 12:05:05 -0400 + +icedove (38.7.0-1) unstable; urgency=medium + + [ Christoph Goehre ] + * [cb9c003] Imported Upstream version 38.7.0 + * [7273cb9] bump up standards version to 3.9.7 (no changes needed) + + [ Carsten Schoenert ] + * [0341a8c] debian/control: switch URI for the Vcs fields to https + + -- Christoph Goehre Wed, 16 Mar 2016 13:22:57 +0100 + +icedove (38.6.0-1) unstable; urgency=medium + + [ Guido Günther ] + * [195730d] Clarify relation between icedove and the calendar extensions + (Closes: #809017) + + [ Christoph Goehre ] + * [988ce5b] Imported Upstream version 38.6.0 + * [6763f6f] debian/source.filter: remove evil-licensed jshint.js + (Closes: #813053) + + -- Christoph Goehre Sun, 14 Feb 2016 16:08:13 -0500 + +icedove (38.5.0-1) unstable; urgency=medium + + [ Christoph Goehre ] + * [6d45b0b] Imported Upstream version 38.5.0 + * [316798f] debian/rules: split override_dh_install into arch and indep + section (Closes: #806047) + + [ Carsten Schoenert ] + * [5b3cb7a] add myself to the uploaders + + -- Christoph Goehre Thu, 24 Dec 2015 22:36:37 -0500 + +icedove (38.4.0-1) unstable; urgency=medium + + [ Christoph Goehre ] + * [754392e] Imported Upstream version 38.4.0 + * [ef4b733] debian/watch: adjust download url + + [ Carsten Schoenert ] + * [f3f5455] lintian: remove icedove.menu file due CTTE#741573 + + -- Christoph Goehre Fri, 27 Nov 2015 12:54:27 -0500 + +icedove (38.3.0-2) unstable; urgency=medium + + * [c988747] Add unminified jquery and jquery-ui files with the exact + version as used by upstream thunderbird. + We don't want to use the minified versions mozilla ships and can't use + what is currently packaged in Jessie or Stretch since these are too + recent. + (Closes: #802281) + + -- Guido Günther Sun, 01 Nov 2015 18:06:33 +0100 + +icedove (38.3.0-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [0f8b6a4] Imported Upstream version 38.3.0 + * [566273a] debian/copyright: fixup's and update + + -- Christoph Goehre Sat, 10 Oct 2015 13:21:05 -0400 + +icedove (38.2.0-2) unstable; urgency=medium + + * [8bcb08b] relax optimize to -O1 on s390x (Closes: #797551) + * [6aa0915] debian/rules: Disable jit on mips (Closes: #797548) + + -- Christoph Goehre Thu, 24 Sep 2015 19:09:54 -0400 + +icedove (38.2.0-1) unstable; urgency=medium + + * [d46d5f6] rebuild patch queue from patch-queue branch + added patches: + - porting-mips/Fix-build-error-in-MIPS-SIMD-when-compiling-with-mfp.patch + + -- Christoph Goehre Mon, 21 Sep 2015 19:42:03 -0400 + +icedove (38.2.0-1~stretch) stretch; urgency=medium + + [ Carsten Schoenert ] + * [05b245f] Imported Upstream version 38.2.0 (Closes: #796323) + - MFSA 2015-59 aka CVE-2015-2724, CVE-2015-2725, CVE-2015-2726 + - MFSA 2015-63 aka CVE-2015-2731 + - MFSA 2015-66 aka CVE-2015-2734, CVE-2015-2735, CVE-2015-2736, + CVE-2015-2737, CVE-2015-2738, CVE-2015-2739, CVE-2015-2740 + - MFSA 2015-70 aka CVE-2015-4000 + - MFSA 2015-71 aka CVE-2015-2721 + - MFSA 2015-65 aka CVE-2015-2741 + - MFSA 2015-79 aka CVE-2015-4474 + * [43c8195] rebuild patch queue from patch-queue branch + * [c75bdad] debian/control: increase B-D on libnss3-dev + * [942bcbe] debian/iceowl-extension.lintian-overrides: remove file + * [7131e4d] debian/source.lintian-overrides: adding new entries + * [8882360] mozconfig.default: don't use icu from system + + -- Carsten Schoenert Fri, 21 Aug 2015 12:29:42 +0200 + +icedove (38.1.0-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [3d27760] Imported Upstream version 38.1.0 (Closes: #790651) + * [2cb6cd7] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-1165654-Cleanup-how-libjpeg-turbo-assembly-build.patch + - reproducible/Generate-sorted-libical-header-list (Closes: #794456) + + -- Christoph Goehre Tue, 04 Aug 2015 20:20:53 -0400 + +icedove (38.0.1-1) unstable; urgency=medium + + [ Carsten Schoenert ] + * [5acef6a] debian/gbp.conf: adopt new upstream branch + * [6f88792] Imported Upstream version 38.0.1 (Closes: #358680, #472601, + #634316, #691176, #751786, #777908) + * [18bba9d] debian/gbp.conf: respect new git-buildpackage behaviour + * [26bbdac] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/changing-the-default-search-engine.patch (Closes: #780595) + - fixes/Bug-1168231-Fixup-to-keep-file-type.patch + - fixes/Bug-1168231-Normalize-file-mode-in-jars.patch + - reproducible/Bug-1166243-Remove-build-function-from-js-and-xpc-sh.patch + - reproducible/Bug-1168316-Remove-build-machine-name-from-about-bui.patc + deleted patches: + - debian-hacks/remove-timestamps-from-c_cpp-macros-for-reproducibil.patch + * [71938b9] debian/rules: setting MOZ_BUILD_DATE explicitly + * [e50d708] debian/copyright: more minor updates to the copyright file + * [b232895] debian/rules: adding switch for no icedove-dbg build + * [bcc15aa] debian/control: icedove is now recommending iceowl-extension + * [564a19e] adding release related information + * [2ec0053] debian/vendor.js: adjusting WhatNew link to more dedicated URL + + [ Christoph Goehre ] + * [a9c25b6] lintian: fix spelling error in debian/README.Debian + * [2cc2c07] debian/rules: fix icedove-dbg build switch + + -- Christoph Goehre Mon, 27 Jul 2015 17:46:40 -0400 + +icedove (38.0~b5-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [7e3cab4] Imported Upstream version 38.0~b5 + * [3edbafc] Revert "debian/control: remove build-dep on libnotify-dev" + * [5e69bab] debian/control: increase b-d versions + * [6e6ae36] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/remove-timestamps-from-c_cpp-macros-for-reproducibil.patch + obsolete patches (fixed in Debian): + - adopting-SQLITE3-version.patch + * [ac7b760] mozconfig.default: adding some explicit configure options + * [81fd6e6] complete rewrite of copyright information + * [327dd45] switching to libgstreamer1.0* + + [ Christoph Goehre ] + * [9877ea3] lintian: add override for libpng + + -- Christoph Goehre Fri, 22 May 2015 20:42:19 -0400 + +icedove (38.0~b2-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [b08d966] debian/source.filter: modifying file list to ignore + * [88fd018] Imported Upstream version 38.0~b2 + * [e9da8f8] icedove branding: adopt upstream changes + * [3610daa] debian/control: increase b-d versions + * [950fae7] rebuild patch queue from patch-queue branch + modified patches: + - system-libs/Allow-to-build-against-system-libffi.patch + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + obsolete patches (fixed upstream): + - porting/Reintroduce-pixman-code-path-removed-in-bug-1097776-.patch + * [1820d7c] debian/control: adding xul-ext-compactheader to Breaks field + + [ Dominik George ] + * [4181126] debian/control: Upgrade Breaks relation to enigmail + (Closes: #782686) + + -- Christoph Goehre Tue, 28 Apr 2015 18:19:00 -0400 + +icedove (36.0~b1-2) experimental; urgency=medium + + * [26c0027] rebuild patch queue from patch-queue branch + added patches: + - porting/Reintroduce-pixman-code-path-removed-in-bug-1097776-.patch + - porting/Remove-duplicate-SkDiscardableMemory_none.cpp-from-g.patch + - porting/ppc-fix-divide-page-size-in-jemalloc.patch (Closes: #780404) + + -- Christoph Goehre Sat, 28 Mar 2015 15:35:58 -0400 + +icedove (36.0~b1-1) experimental; urgency=medium + + [ Carsten Schoenert ] + * [68112a3] Imported Upstream version 36.0~b1 + * [3120361] rebuild patch queue from patch-queue branch + obsolete patches (fixed upstream): + - debian-hacks/fixing-various-FTBFS-due-different-datatype-char-beh.patch + - porting-arm/FTBFS-armhf-fixing-ARM-CPU-detection.patch + modified patches: + - debian-hacks/Strip-version-number.patch + - p-kfree-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + - p-kfree-hurd/correcting-file-inclusion-for-kfreebsd.patch + - p-kfree-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch + * [ee185a2] d/icedove.install: mozilla-xremote-client was removed + * [64adc44] debian/source.filter: modifying file list to ignore + * [dbdd152] debian/control: increase package versions + * [fb3307c] lintian: adding one more source override + * [2a07495] lintian: adding new override for the icedove package + * [38c21ad] debian/README.Debian: adding note around HTTPS Everythere + (Closes: #774790) + + [ Christoph Goehre ] + * [3dce89c] debian/icedove.desktop: correct StartupWMClass to 'Icedove' + (Closes: #773876) + * [deb3f58] debian/icedove.desktop: add MimeType text/calendar + (Closes: #762190) + * [4dd96fe] rebuild patch queue from patch-queue branch + added patches: + - p-kfree-hurd/FTBFS-hurd-adding-the-HURD-platform-to-the-configure.patch + - p-powerpcspe/FTBFS-powerpcspe-disable-AltiVec-instructions.patch + (Closes: #772933) + modified patches: + - p-kfree-hurd/FTBFS-hurd-adding-GNU-Hurd-to-the-list-of-OS-systems.patch + - p-kfree-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + - p-kfree-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + - p-kfree-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch + * [373ed05] add missing epoch in libnss3-dev build depends + + -- Christoph Goehre Wed, 11 Mar 2015 19:19:28 -0400 + +icedove (34.0~b1-2) experimental; urgency=low + + [ Carsten Schoenert ] + * [7a4edc4] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/fixing-various-FTBFS-due-different-datatype-char-beh.patch + - porting-arm/FTBFS-armhf-fixing-ARM-CPU-detection.patch + + -- Christoph Goehre Mon, 24 Nov 2014 18:56:21 -0500 + +icedove (34.0~b1-1) experimental; urgency=low + + [ Carsten Schoenert ] + * [1be8ab1] debian/source.filter: more files to ignore + * [66e6488] debian/README.source: adjust description for beta versions + * [e63d375] Imported Upstream version 34.0~b1 (Closes: #770180) + * [1cb54d2] rebuild patch queue from patch-queue branch + obsolete patches (fixed upstream): + - porting-armel/disable-some-libopus-feature-for-ARCH-ARMv6.patch + * [ad29bb1] debian/rules: be more flexible on *.xpi files + * [b055e78] debian/NEWS: fixing default SSL/TLS behavior description + * [d64a847] debian/NEWS: adding notes around new security changes + + -- Christoph Goehre Wed, 19 Nov 2014 19:15:46 -0500 + +icedove (33.0~b1-1) experimental; urgency=low + + [ Carsten Schoenert ] + * [5029c8b] debian/source.filter: more files to ignore + * [d4b03d9] README.source: let's use xz while creating the orig.tar.xz + * [ebd442f] debian/gbp.conf: some instructions for git-dch + * [cc594ea] Imported Upstream version 33.0~b1 + * [23b57cf] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/fix-identification-of-ObjdirMismatchException.patch + - debian-hacks/pass-OS_LDFLAGS-to-all-ldap-libraries.patch + modified patches: + - debian-hacks/Strip-version-number.patch + - icedove/fix-branding-in-migration-wizard-and-the-addon-manag.patch + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + - obsolete patches (fixed upstream): + - fixes/Include-cstdlib-in-gfx-angle-src-compiler-Types.h-fo.patch + - porting-alpha/fix-FTBFS-on-alpha.patch + * [a5a2a1b] adding additional config options for hppa and ppc64 + Both platforms failing on running xpcshell. + + [ Christoph Goehre ] + * [5a0ba43] linitan: bump up standards version to 3.9.6 + * [aaca6a7] debian/NEWS: adding note around increased default TLS version 1.2 + (Closes: #761245) + + -- Christoph Goehre Sat, 25 Oct 2014 12:47:37 -0400 + +icedove (32.0~b1-1) experimental; urgency=low + + [ Christoph Goehre ] + * [65ad797] icedove.postinst: remove obsolete symlink handling + + [ Carsten Schoenert ] + * [baef95a] debian/gbp.conf: adopting experimental branch + * [8384eee] Imported Upstream version 32.0~b1 + * [75145f3] rebuild patch queue from patch-queue branch + modified patches: + - icedove/fix-branding-in-migration-wizard-and-the-addon-manag.patch + - debian-hacks/remove-non-free-W3C-icon-valid.png.patch + obsolete patches (fixed upstream): + - porting-armel/fix-skia-for-ARMv4.patch + + [ Christoph Goehre ] + * [51c3cee] cleanup branding patch + + -- Christoph Goehre Thu, 28 Aug 2014 15:52:51 -0700 + +icedove (31.0-2) unstable; urgency=low + + [ Carsten Schoenert ] + * [d2bc0ef] armel: correcting #if statement for skia fix + * [959b801] adding GNU/Hurd to gyp.mozbuild + * [215bc7d] kfreebsd*: adding CrossProcessMutex_posix.cpp to list + * [892c39c] d/icedove.links: remove unneeded link to /u/s/i/e + (Closes: #638489) + * [928158c] debian/source.filter: more files to ignore + * [b81c238] fixing lintian warning 'unused-override' + * [7bc2568] fixing lintian warning 'jar-not-in-usr-share' + * [cd0d289] fixing lintian warning 'image-file-in-usr-lib' + * [045a960] fixing lintian error 'source-is-missing' + * [1fe016a] correcting FTBFS patch for alpha + + [ Christoph Goehre ] + * [c827d81] iceowl-extension: replace skin and icon dir with symlink + + -- Christoph Goehre Sat, 23 Aug 2014 18:42:23 -0700 + +icedove (31.0-1) unstable; urgency=low + + [ Carsten Schoenert ] + * [b7cdeb4] Imported Upstream version 31.0 (Closes: #756769) + * [1f2ff0b] debian/rules: fixing file permissions in iceowl-extension + * [c8d2036] adding fix for skia on armel + * [77093e2] fixing FTBFS on armel (Closes: #754633) + * [a458959] debian/control: increase b-d on libsqlite-dev + * [a98ebca] fix runtime error on alpha while jemalloc run + * [6f6b576] disable optimization on alpha while linking + + -- Christoph Goehre Mon, 04 Aug 2014 10:23:09 -0400 + +icedove (31.0~b2-1) unstable; urgency=low + + [ Carsten Schoenert ] + * [76059a9] debian/source.filter: more files to ignore + * [5067b0e] Imported Upstream version 31.0~b2 (Closes: #754464) + * [e31ac79] debian/control: remove build-dep on libnotify-dev + * [35324a5] debian/control: increase build-depends on libnss3-dev to 3.16.2~ + + -- Christoph Goehre Fri, 18 Jul 2014 21:47:06 +0200 + +icedove (31.0~b1-2) unstable; urgency=low + + * [7ba4d01] lintian: add override for embedded srtp library + + -- Christoph Goehre Sun, 22 Jun 2014 18:18:04 -0400 + +icedove (31.0~b1-1) unstable; urgency=low + + * [02dc94c] remove example file, which cause git-archive to change the + source tree + * [ba233b1] Imported Upstream version 31.0~b1 + * [4c2380f] rebuild patch queue from patch-queue branch + modified patches: + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + - porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-.patch + obsolete patches (fixed upstream): + - fixes/unbreak-with-system-pixman-in-mailnews.patch + - porting-hppa/FTBFS-hppa-correcting-code-inside-JS_STACK_GROWTH_DI.patch + + -- Christoph Goehre Sun, 22 Jun 2014 11:50:07 -0400 + +icedove (30.0~b1-1) unstable; urgency=low + + [ Carsten Schoenert ] + * [b3eadf1] debian/source.filter: more files to ignore + * [fb71012] debian/control: bumping build-depends for debhelper + * [dc4ad0c] debian/control: add libpulse-dev build dependency + * [b8d3ee7] debian/control: bumping some version of build dependencies + * [3443df9] debian/icedove-dev.install: adopt upstream changes + * [d0f9d0e] icedove.lintian-overrides: adding libtheora + * [982c8a6] debian/rules: adding removing for temporary files + + [ Christoph Goehre ] + * [f6292d5] Imported Upstream version 30.0~b1 (Closes: #743421) + * [dacd658] rebuild patch queue from patch-queue branch + modified patches: + - porting-hppa/FTBFS-hppa-correcting-code-inside-JS_STACK_GROWTH_DI.patch + - porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-hurd.patch + - porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + - porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-.patch + - prefs/Set-javascript.options.showInConsole.patch + - debian-hacks/Icedove-branding.patch + - fixes/unbreak-with-system-pixman-in-mailnews.patch + obsolete patches (fixed upstream): + - debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch + - debian-hacks/Fix-build-failure-for-header.py-and-typelib.py.patch + - fixes/Make-system-cairo-work-again.patch + - porting-powerpcspe/FTBFS-Altivec-is-not-available-on-powerpcspe.patch + * [df93d26] branding: add jar.mn to moz.build + * [648853d] only copy debian/mozconfig.default into mozilla subdir + * [4f9dc9e] MOZ_OBJDIR need a absolute path, $(pwd) didn't work + * [33794c3] icedove.pc: remove non-existent library mozjs (Closes: #748746) + * [dcbce5c] iceowl-extension: use breaks instead of conflicts against + calendar-timezones (Closes: #747532) + * [545415a] add breaks to enigmail (<< 2:1.6-4~deb7u1) which won't work with + us (Closes: #747546) + + -- Christoph Goehre Fri, 30 May 2014 12:11:53 -0400 + +icedove (24.5.0-2) unstable; urgency=low + + * [e4a43ed] debian/rules: remove duplicate LDFLAGS += -Wl,--stats + * [f9dba4b] debian/rules: export all compiler flags into build environment + * [8dc0712] debian/rules: run autoconf for all configue files + * [95d4b48] debian/rules: export MOZCONFIG onces + * [577bd03] debian/rules: update config.sub and config.guess before autoconf + run + * [7f958c7] parse DEB_BUILD_OPTIONS for how many parallel buildjobs to start + (Closes: #746984) + * [0f8b062] debian/rules: export MOZILLA_OFFICIAL + * [1c3d277] run configure with --build and --host + * [f190e19] don't build a shared js library (Closes: #724688, #729073, + #745593) + + -- Christoph Goehre Thu, 08 May 2014 20:07:06 -0400 + +icedove (24.5.0-1) unstable; urgency=low + + [ Carsten Schoenert ] + * [7c13dbf] calender-timezones: remove no longer needed helper files + * [2d4328c] debian/control: sort various fields alphabetically + * [436c212] debian/control: remove build-depens on cdbs + * [dae8b3e] icedove branding: adopt current Makefile.in style to upstream + * [045be10] debian/rules: switch to debhelper + * [b852c8c] debian/mozconfig*: adding mozconfig files + * [7bac68c] debian/icedove.configopts: Remove no longer needed file + * [6c597b9] Switch the old thunderbird*.in files to icedove.* + * [9781e61] debian/icedove.links: adding /u/b/i link + * [f325194] debian/icedove.dirs: add helper file for needed directories + * [fe0376a] debian/icedove.install: sort entrys alphabetical + * [0111ccc] debian/icedove.js: fix small typo and reformat + * [a7e5b05] debian/rules: add override for dh_fixperms + * [8e44df2] debian/rules: add override for dh_install + * [24fa03a] debian/rules: add override for dh_shlibdeps + * [2f22ed0] debian/rules: add override for dh_strip + * [259a6f4] debian/control: remove ${shlibs:Depends} from c-g-p depends + * [cdc9272] debian/rules: add additional LDFLAGS + * [9d620d5] debian/rules: correct Icedove version inside icedove.pc during + install + + [ Christoph Goehre ] + * [460818b] Imported Upstream version 24.5.0 + * [4c65ecc] rebuild patch queue from patch-queue branch + added patches: + - porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch + obsolete patches: + - porting-kfreebsd-hurd/Another-fix-to-build-ipc-code-on-GNU-hurd-an.patch + + -- Christoph Goehre Tue, 29 Apr 2014 17:56:40 -0400 + +icedove (24.4.0-1) unstable; urgency=low + + * [a2b13c0] Imported Upstream version 24.4.0 + * [fd90463] rebuild patch queue from patch-queue branch + added patches: + - porting-hppa/FTBFS-hppa-correcting-code-inside-JS_STACK_GROWTH_DI.patch + (Closes: #741245) + + -- Christoph Goehre Sat, 22 Mar 2014 11:10:18 -0400 + +icedove (24.3.0-2) unstable; urgency=low + + [ Christoph Goehre ] + * [122ffe9] remove ldif60 from pkgconfig file (Closes: #732652) + * [b64ccac] rebuild patch queue from patch-queue branch + added patches: + - porting-powerpcspe/FTBFS-Altivec-is-not-available-on-powerpcspe.patch + (Closes: #734859) + + [ Carsten Schoenert ] + * [aa4f5b1] thunderbird.install.in: shipping all files in /u/l/i/components + (Closes: #737811) + * [3bf4738] debian/rules: fix *.js file-permissions for iceowl-extension + * [50ab7a5] debian/rules: remove -Wl,--as-needed linker option + (Closes: #732652, #730450, #724688) + + -- Christoph Goehre Sun, 09 Mar 2014 15:33:05 -0400 + +icedove (24.3.0-1) unstable; urgency=low + + * [a656560] lintian: remove non-free w3c valid.png icon (Closes: #735119) + * [f4e6c08] lintian: remove prebuild javascript objects from upstream + tarball (Closes: #735234) + * [adf9c96] Imported Upstream version 24.3.0 + * [8419e65] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/remove-non-free-W3C-icon-valid.png.patch + - debian-hacks/use-system-jquery-jquery-ui.patch + * [948af3e] a newer icedove will break iceowl-extension (Closes: #732742) + + -- Christoph Goehre Mon, 10 Feb 2014 19:44:36 -0500 + +icedove (24.2.0-1) unstable; urgency=low + + [ Christoph Goehre ] + * [963a61e] Imported Upstream version 24.2.0 + * [852abe3] rebuild patch queue from patch-queue branch + obsolete patches (fixed upstream): + - fixes/Wrap-non-prefixed-freetype-headers-from-newer-freety.patch + - porting/Don-t-hardcode-page-size-on-ia64-sparc-or-mipsel.patch + (Closes: #734074) + * [a9d6680] lintian: remove prebuild-binaries from upstream tarball + * [fc25943] linitan: remove prebuilt-windows-binary from upstream tarball + * [faa24eb] lintian: fix comma separated files copyright + * [835790d] lintian: declare public-domain license at the beginning + + [ Carsten Schoenert ] + * [c583a2f] debian/copyright: fix indentation for 'public domain' license + * [78ddee2] linitan: bump up standards version to 3.9.5 + + -- Christoph Goehre Sat, 11 Jan 2014 20:17:24 -0500 + +icedove (24.1.1-1) experimental; urgency=low + + [ Carsten Schoenert ] + * [e8cbac4] debian/copyright: correcting wrong comma usage. + * [d24a6be] debian/copyright: adjusting copyright infos + * [51a32a1] debian/copyright: correcting various lintian warning. + * [50874e0] debian/control: expanding icedove-dev dependency on python + * [2996a33] debian/control: adding a more specific description for + iceowl-extension and google-cal-prov. + * [85b4400] debian/control: adjust proper version dependencies. + (Closes: #729712) + * [4d6b204] debian/control: adding metadata for mozilla-devscripts. + (Closes: #562984) + + [ Christoph Goehre ] + * [aa7782b] Imported Upstream version 24.1.1 (Closes: #720931, #723630) + * [e4ca9cd] rebuild patch queue from patch-queue branch + added patches: + - fixes/Wrap-non-prefixed-freetype-headers-from-newer-freety.patch + - porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and.patch + * [849988b] make python scripts in /usr/lib/icedove-devel/sdk/bin executable + * [9890b1c] ship python config scripts to make building of extensions easier + (Closes: #729431) + * [8b08106] remove libxpcom.so from pkgconfig file (Closes: #729168) + * [4759bde] add libldif60 to pkgconfig file + * [db575b4] lintian: remove unsafe symlink from upstream tarball + + -- Christoph Goehre Sun, 08 Dec 2013 10:08:19 -0500 + +icedove (24.0-1) experimental; urgency=low + + [ Guido Günther ] + * [6f9d98e] New upstream version 24.0 + * [ef58a98] Refresh patches + * [435516d] Switch to xz compressed upstream tarball + * [f529a99] repack.py: port to python3 + * [50423d9] repack.py: allow to specify compression + + [ Christoph Goehre ] + * [b45b2b9] remove superfluous gstreamer build depends + * [96ac1d0] Reduce memory usage of the linker. Thanks to Mike Hommey + * [af55374] ia64 don't like LDFLAG --no-keep-memory + * [c3cb093] remove export-subst in mozilla/addon-sdk/source/.gitattributes. + + [ Carsten Schoenert ] + * [ac4caea] debian/copyright: correcting out-of-date-copyright-format-uri. + * [585bf84] debian/copyright: remove obsolete field 'Name:' + + -- Christoph Goehre Tue, 15 Oct 2013 18:51:16 -0400 + +icedove (24.0~b3-2) experimental; urgency=low + + * [47fe004] Add lintian override for our use of the embedded libjpeg + * [3c103e6] Make sure xpcshell is executable so dh_shlibdeps picks it up to + calculate lib dependencies + + -- Guido Günther Tue, 24 Sep 2013 20:03:33 +0200 + +icedove (24.0~b3-1) experimental; urgency=low + + [ Guido Günther ] + * Upload to experimental + * [eae533c] Adjust watch file once again + * [5280050] Invoke repack.py directly + * [0f4e8de] New upstream version 24.0~b3 + (Closes: #706859, #720931, #723630) + * [3b6374b] Don't use system jpeg + since it doesn't have the needed features + * [f6aeba2] Don't try to remove nonexistent libxpcom.so + + [ Carsten Schoenert ] + * [04844ae] icedove-branding: adopt new build schema to Debian branding + by using moz.build. + * [11c4677] icedove-branding: change the target directory for preview.png. + * [55f6762] debian/control: remove package calendar-timezones. + The calendar-timezones related files are now inside the lightning + package. + * [6f4948d] debian/rules: catch any gdata-provider*.xpi file. + The gdata-provider XPI file now has a version appended. + * [d5a63c9] debian/rules: catch any lightning*.xpi file. + The lightning XPI file now has a version appended. + * [e77e911] debian/thunderbird.install.in: + remove mozilla/components/binary.manifest since it no longer exists. + * [ef3f3b1] debian/control: Build-Depend on gstreamer an yasm now used by + icedove. + * [9f5fe3e] Drop patches fixed upstream. + Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch + Bug-723497-Saving-message-to-disk-fails-silently-fai.patch + Bug-746112-Don-t-decommit-if-page-size-is-too-large.patch + Bug-814693-Allow-webrtc-to-build-on-more-architectur.patch + Bug-840242-Use-the-runtime-page-size-to-control-aren.patch + virtualenv-changing-the-path-to-virtualenv.py.patch + * [4503610] Adjust to build system changes: + debian-hacks/Don-t-build-example-component.patch + * [290f1e0] Partially applied upstream: + Support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + * [2eaf6ae] Rediff remaining patches + * [4217c0e] Create missing .deps dir. + Workaround to make build complete + * [f95db9c] Drop autoconf.mk mangling since it confuses the build system + + -- Guido Günther Thu, 19 Sep 2013 20:10:24 +0200 + +icedove (17.0.8-1) unstable; urgency=low + + [ Carsten Schoenert ] + * [af98dad] The vendorShortName is of course "Mozilla" and not "Icedove" The + packages in icedove-l10n already use the correct substition. + (Closes: #707207, #715326) + * [8ceae38] Sawfish: fix wrong size of resized window. + Backported from the TB20 release. + https://bugzilla.mozilla.org/show_bug.cgi?id=813997 (Closes: #715464) + * [b69cb68] Fix error while saving a message to disk or network. + If the user tries to save a message to disk or network share without + enough user rights to write the message Icedove fails silently. This + backport from TB 21 fixes this. + * [fd8f588] Desktop file: shorten the icon name to 'Icedove' (Closes: #507962) + * [24b1b45] fix JS compiler segfault errors for various platforms + (Closes: #708331) + + [ Christoph Goehre ] + * [01f6b7a] add README.Debian to describe upstream status of Thunderbird + (Closes: #710888) + * [7fa36d6] rebuild patch queue from patch-queue branch added patches: + - porting/Fix-ipc-chromium-on-kFreeBSD-and-Hurd.patch + + [ Guido Günther ] + * [455bfe7] New upstream version 17.0.8 + + -- Guido Günther Tue, 20 Aug 2013 16:12:17 +0200 + +icedove (17.0.7-1) unstable; urgency=low + + * [b8fd345] Imported Upstream version 17.0.7 + * [3133999] rebuild patch queue from patch-queue branch + modified patches: + - porting/Don-t-hardcode-page-size-on-ia64-sparc-or-mipsel.patch + * [3332f92] lintian: change url to version control system + * [534e2d1] linitan: bump up standards version to 3.9.4 + * [2b511d2] lintian: remove obsolete thunderbird dependency in + iceowl-extension + * [2081e7e] lintian: add Keywords to icedove desktop file + * [7f8333c] lintian: mask minus signs in manpage with a backslash + + -- Christoph Goehre Sun, 30 Jun 2013 18:46:16 -0400 + +icedove (17.0.5-2) unstable; urgency=low + + [ Guido Günther ] + * [4c7a88a] Install calendar-google-provider to /u/s/xul-ext + (Closes: #638480) + * [4c97096] Move calendar-timezones to /u/s/xul-ext (Closes: #638481) + * [e9d0085] Move arch indep parts to common-install-indep + + [ Carsten Schoenert ] + * [40d68d5] Fix build error on IA64 and Sparc + * [59939c3] manpage: add example section and convert to UTF-8 + * [10647cf] fixing build failure depended on python-2.7 changes + + [ Christoph Goehre ] + * [0a7bb8b] create links for extension in + /usr/share/mozilla/extensions/APPID + * [5047e6b] remove + icedove/save-a-copy-of-a-attached-file-when-sending-from-OOo.patch + (Closes: #695323) + + -- Christoph Goehre Sat, 18 May 2013 17:53:21 -0400 + +icedove (17.0.5-1) experimental; urgency=low + + [ Guido Günther ] + * [894ea6d] Include all needed libs to link against icedove's libxpcom + (Closes: #477747) + + [ Carsten Schoenert ] + * [6e00625] Point "Help->What's new" to the Debian Wiki (Closes: #570577) + + [ Christoph Goehre ] + * [4766bc9] replace icon in searchplugin (bing, twitter) with download url + * [e3dc726] Imported Upstream version 17.0.5 + + -- Christoph Goehre Sat, 13 Apr 2013 12:19:06 -0400 + +icedove (17.0.4-1) experimental; urgency=low + + [ Guido Günther ] + * [9ed54cb] Add Homepage + * [bd41337] Add X-Debian-Homepage + + [ Carsten Schoenert ] + * [1fba87f] New patch + fix-function-nsMsgComposeAndSend-to-to-respect-Replo.patch fix function + nsMsgComposeAndSend to respect ReploToSend + Thanks to Emilio Pozuelo Monfort for the patch (Closes: #565903) + + [ Christoph Goehre ] + * [7a1071b] update debug section in icedove manpage (Closes: #698163) + * [017f5b5] Imported Upstream version 17.0.4 (Closes: #702927) + * [7c35529] compress debian packages with xz + + -- Christoph Goehre Wed, 13 Mar 2013 19:00:07 -0400 + +icedove (17.0.2-1) experimental; urgency=low + + * [8911b88] Finally set Christoph as Maintainer. + Thanks for your work Alexander. + * [d456018] parallel build: Use number or available cores by default + * [daeee47] Don't refer to paths containing thunderbird (Closes: #486617) + * [52a202a] New upstream version 17.0.2 + * [fa07537] Allow webrtc to build on more architectures. + Thanks to Mike Hommey and Christoph Göhre + + -- Guido Günther Fri, 11 Jan 2013 17:37:46 +0100 + +icedove (17.0.2-1~1) experimental; urgency=low + + * [8911b88] Finally set Christoph as Maintainer. Thanks for your work + Alexander. + * [d456018] parallel build: Use number or available cores by default + * [daeee47] Don't refer to paths containing thunderbird (Closes: #486617) + * [52a202a] New upstream version 17.0.2 + * [fa07537] Allow webrtc to build on more architectures. + Thanks to Mike Hommey and Christoph Göhre + + -- Guido Günther Fri, 11 Jan 2013 17:35:22 +0100 + +icedove (17.0-1) experimental; urgency=low + + [ Christoph Goehre ] + * [0b8ac79] replace transitional depens ttf-lyx with fonts-lyx + (Closes: #676505) + * [4473d67] fix typo in calendar-google-provider description + * [b3a57c0] rebuild patch queue from patch-queue branch + added patches: + porting/Another-fix-to-build-ipc-code-on-GNU-hurd-and-kfreeb.patch + + [ Jens Reyer ] + * [c0e30b6] clarify the relation between iceowl, lightning and sunbird + (Closes: #686206) + + [ Guido Günther ] + * [394b6a1] New upstream version 17.0 + * [a17c23f] Update patches. + The thunderbird-3-profile.patch got split into three since it + addresses different issues: + * Strip-version-number.patch + * Icedove-branding.patch + * Move-profile.patch + * [01eef04] Don't overwrite DEB_BUILD_OPTIONS + and drop dependency on essential package + + [ Ritesh Raj Sarraf ] + * [1ab9095] Add parallel build support + + -- Guido Günther Sat, 24 Nov 2012 19:26:19 +0100 + +icedove (16.0.2-1) experimental; urgency=low + + [ Christoph Goehre ] + * [e94445f] cleanup source.filer file + * [33b9f4c] Imported Upstream version 12.0.1 + + [ Guido Günther ] + * [88a39e3] watch: only look for two digit versions since 3.1.20 lacks the + source/ dir + * [eb4f5c3] New upstream version 14.0 + * [b451442] Update patches for 14.0 + obsolete patches: + Avoid-libxpcom-being-excluded-from-linked-libraries-.patch + Bug-515232-Try-getting-general.useragent.locale-as-a.patch + Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch + Bug-710972-Define-G_VARIANT_TYPE_STRING_ARRAY-when-b.patch + Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch + Bug-728136-Port-bug-528687-to-comm-central.patch + Bug-728229-Allow-to-build-with-system-python-ply-lib.patch + Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch + Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch + Bug-734335-Only-build-SPS-on-supported-platforms.patch + Revert-investigation-patch-for-bug-621446.patch + Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch + Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch + modified patches: + Add-another-preferences-directory-for-applications-p.patch + Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch + Don-t-build-example-component.patch + Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch + Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch + Gross-workaround-to-avoid-installing-test-idl-and-in.patch + Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch + stop-configure-if-with-system-bz2-was-passed-but-no-.patch + Allow-.js-preference-files-to-set-locked-prefs-with-.patch + Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch + Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch + Include-cstdlib-in-gfx-angle-src-compiler-Types.h-fo.patch + Link-libldap-against-libpthread.patch + Load-dependent-libraries-with-their-real-path-to-avo.patch + Properly-launch-applications-set-in-HOME-.mailcap.patch + Remove-the-js-shell-from-the-build-directory-during-.patch + fix-branding-in-migration-wizard-and-the-addon-manag.patch + fix-installdir.patch + save-a-copy-of-a-attached-file-when-sending-from-OOo.patch + thunderbird-3-profile.patch + Change-extension-s-name-to-Iceowl.patch + Add-xptcall-support-for-SH4-processors.patch + Allow-ipc-code-to-build-on-GNU-hurd.patch + Allow-ipc-code-to-build-on-GNU-kfreebsd.patch + Bug-703833-Avoid-invalid-conversion-from-const-size_.patch + Disable-optimization-on-alpha-for-the-url-classifier.patch + Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch + Support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + Don-t-auto-disable-extensions-in-system-directories.patch + Set-javascript.options.showInConsole.patch + Allow-to-build-against-system-libffi.patch + * [907be61] Make sure we only match the generated files. Patch taken from + iceowl 1.5 package + * [772b9a0] Make system cairo work again. Patch taken from iceweasel. + * [0b6a8b3] Update + Add-another-preferences-directory-for-applications-p.patch to new method + name. + * [3395f21] Don't use APP_UA_NAME in application.ini since the replacement + fails and isn't needed. + * [6dea9fb] New upstream version 16.0.1 + * [664153d] Add README.source describing howto import new upstream versions + * [a653bd0] Adjust to upstream changes: + * stop-configure-if-with-system-bz2-was-passed-but-no-.patch + * [f088193] Add a proper patch header + * to Fix-build-failure-for-header.py-and-typelib.py.patch + so we don't lose the patch description. + * [268cca5] New upstream version 16.0.2 + * [a453a92] Rediff patches - no content changes + * [263bbeb] BUILD_OFFICIAL is now MOZILLA_OFFICIAL + * [a798e6b] Install dependentlibs.list to fix dlopen() of XPCOM + + [ Ritesh Raj Sarraf ] + * [f871ba9] Refresh patches. + Droped patches: + * fixes/Remove-the-js-shell-from-the-build-directory-during-.patch + * porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch + * fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch + * debian-hacks/Make-sure-we-only-match-the-generated-files.patch + * [9b02e4c] Refreshed patches for TB16 + * [dc83dd7] Fix build failure for header.py and typelib.py. + Earlier builds were passing the --cachedir option + Sometime during TB15, Mozilla changed that to variables. + This change was not passing the --cachedir option, hence the build + failure. This patch just hacks the build by passing the cachedir option + manually + + -- Guido Günther Tue, 30 Oct 2012 22:05:49 +0100 + +icedove (11.0-1) experimental; urgency=low + + * [ffb767a] Imported Upstream version 11.0 (Closes: #663897) + * [2b75f48] relax optimize to -O1 on sparc to fix FTBFS + * [fa9a610] update build dependencies (Thanks to Mike) (Closes: #666722) + * [5b552f2] rebuild patch queue from patch-queue branch + added patches: + - fixes/Bug-710972-Define-G_VARIANT_TYPE_STRING_ARRAY-when-b.patch + - fixes/Bug-734335-Only-build-SPS-on-supported-platforms.patch + - fixes/Revert-investigation-patch-for-bug-621446.patch + modified patches: + - fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch + - icedove/fix-branding-in-migration-wizard-and-the-addon-manag.patch + - icedove/save-a-copy-of-a-attached-file-when-sending-from-OOo.patch + obsolete patches (fixed upstream): + - debian-hacks/Fix-tracejit-to-build-against-nanojit-headers-in-dis.patch + - debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch + - fixes/Bug-710268-Sign-NSS-libraries-only-when-they-exist-r.patch + - fixes/Fixup-bz-730195-for-Linux-ARM-use-_URC_FOREIGN_EXCEP.patch + - fixes/mozilla-config.h-was-renamed-js-confdefs.h-in-js-src.patch + - fixes/Remove-generated-files-from-js-src-during-make-distc.patch + - porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch + - porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch + - porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch + + -- Christoph Goehre Wed, 18 Apr 2012 18:36:31 +0200 + +icedove (10.0.3-2) unstable; urgency=low + + [ Christoph Goehre ] + * [1223204] bump up standards version to 3.9.3 + + [ Guido Günther ] + * [7d7b5f5] Don't put symlinks into iceowl/extensions + + [ Christoph Goehre ] + * [94c07e5] update copyright file + * [88098a8] GNOME 3 integration: Use GIO instead of deprecated GnomeVFS. + Thanks to Michael Biebl (Closes: #658688) + * [9543fd1] add build depends python + * [ec62dcb] build a debug package, if DEB_BUILD_OPTIONS contains 'debug' + + -- Christoph Goehre Tue, 27 Mar 2012 18:21:52 +0200 + +icedove (10.0.3-1) unstable; urgency=low + + [ Christoph Goehre ] + * [ee4b49c] adjust source.filter list + * [b5f3064] New Upstream version 10.0.3 (Closes: #661115, #663897) + * [fd35da8] build against system python-ply + * [4964bb2] build against system libreadline + * [5412685] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/Don-t-build-example-component.patch + - fixes/Bug-515232-Try-getting-general.useragent.locale-as-a.patch + - fixes/Bug-628252-os2.cc-fails-to-compile-against-GCC-4.6-m.patch + - fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch + - fixes/Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch + - fixes/Bug-710268-Sign-NSS-libraries-only-when-they-exist-r.patch + - fixes/Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch + - fixes/Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch + - fixes/Bug-728136-Port-bug-528687-to-comm-central.patch + - fixes/Bug-728229-Allow-to-build-with-system-python-ply-lib.patch + - fixes/Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch + - fixes/Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch + - fixes/Fixup-bz-730195-for-Linux-ARM-use-_URC_FOREIGN_EXCEP.patch + - fixes/Include-cstdlib-in-gfx-angle-src-compiler-Types.h-fo.patch + - fixes/Link-libldap-against-libpthread.patch + - fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch + - porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch + - prefs/Don-t-auto-disable-extensions-in-system-directories.patch + (Closes: #648712) + modified patches: + - debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch + - fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch + - fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch + - icedove/fix-branding-in-migration-wizard-and-the-addon-manag.patch + - porting/Allow-ipc-code-to-build-on-GNU-hurd.patch + - porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch + - prefs/Set-javascript.options.showInConsole.patch + obsolete patches (fixed upstream): + - debian-hacks/get-ride-of-default-debian-hardering-options.patch + - iceowl/Install-calendar-timezones-mode-0644-not-0755.patch + - porting/Add-mips-hppa-ia64-s390-and-sparc-defines-in-ipc-chr.patch + - porting/Bug-680917-Use-a-pool-size-of-16kB-on-ia64-for-bump-.patch + - porting/Bug-694533-LDRH-STRH-LDRSB-STRSB-are-supported-on-AR.patch + - porting/Bug-696393-Reimplement-NS_InvokeByIndex-in-C-on-S390.patch + - porting/Revert-bz-164580.patch + + [ Michael Biebl ] + * [c0a3ee2] Install chrome.manifest file to ensure the various components + (like GNOME support module) are correctly loaded. (Closes: #658479) + + [ Christoph Goehre ] + * [02687fc] adjust install/link files for new upstream + * [b551d6a] omni.jar was renamed to omni.ja + + -- Christoph Goehre Sat, 24 Mar 2012 23:10:47 +0100 + +icedove (9.0.1-1) experimental; urgency=low + + * [e2002b8] New Upstream version 9.0.1 (Closes: #653266, #653556) + * [9c14e8b] replace dfsg cleanup script with Mike's repack.py + * [2a34bd8] rebuild patch queue from patch-queue branch + added patches: + - porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch + - porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch + - porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch + - porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch + - porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch + - porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch + * [03ed85d] remove Build-Depends python-ply, it's shipped and searched in + mozilla/other-licenses + + -- Christoph Goehre Tue, 24 Jan 2012 19:13:30 +0100 + +icedove (8.0-2) unstable; urgency=low + + * Upload to unstable + * [b02c21d] fix crash in xpcshell on sparc linux + + -- Christoph Goehre Wed, 04 Jan 2012 18:09:14 +0100 + +icedove (8.0-1) experimental; urgency=low + + [ Guido Günther ] + * [17a7a80] Add x-scheme-handler/mailto to. Thanks to Michael Biebl for the + patch (Closes: #645556) + + [ Christoph Goehre ] + * [4066038] New Upstream version 8.0 + * [aa9105e] update autoconfig for e-mail accounts from riseup.net + (Closes: #648907) + * [decc1ac] fix wrong description text in iceowl-extension (Closes: #649073) + * [c97dda6] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/Statically-link-jemalloc-to-all-programs.patch + - fixes/Bug-670719-Only-add-DENABLE_JIT-1-to-CXXFLAGS-if-any.patch + - fixes/Bug-680642-Don-t-enable-YARR-JIT-on-MIPS-as-the-impl.patch + - porting/Bug-589735-Allocate-memory-with-an-address-with-high.patch + - porting/Bug-589735-Allow-static-JS-strings-to-be-turned-off-.patch + - porting/Bug-680917-Use-a-pool-size-of-16kB-on-ia64-for-bump-.patch + - porting/Bug-694533-LDRH-STRH-LDRSB-STRSB-are-supported-on-AR.patch + - porting/Bug-696393-Reimplement-NS_InvokeByIndex-in-C-on-S390.patch + - porting/Revert-bz-164580.patch + + -- Christoph Goehre Sun, 20 Nov 2011 19:58:37 +0100 + +icedove (8.0~b4-2) experimental; urgency=low + + [ Guido Günther ] + * [5d043ec] Install calendar extension + * [07feb49] Change extension's name to Iceowl + * [c597212] iceowl-extension: don't ignore errors in postinst + * [30ec51d] Disable patch numbers + * [73f80ed] Don't install timezones file mode 0755 + + [ Christoph Goehre ] + * [0fa13be] remove duplicate build depends unzip + + -- Christoph Goehre Tue, 08 Nov 2011 22:29:19 +0100 + +icedove (8.0~b4-1) experimental; urgency=low + + * [4e90977] New Upstream Version 8.0b4 (Closes: #591771, #638161) + * [955423a] replace duplicate .so files in icedove and icedove-dev with + symlinks + * [6ffb325] remove obsolete cdbs rule to extract tarball + * [f98837b] build against libnotify4 (libnotify-dev >= 0.7)(Closes: #637194) + * [66f72bc] Build-depend on libjpeg-dev instead of libjpeg62-dev + * [8af21a2] rebuild patch queue from patch-queue branch + added patches: + - debian-hacks/get-ride-of-default-debian-hardering-options.patch + - fixes/packager-fails-when-MOZILLA_DIR-is-a-relative-path.patch + modified patches: + - icedove/save-a-copy-of-a-attached-file-when-sending-from-OOo.patch + obsolete patches (fixed upstream): + - debian-hacks/bzXXX-ftbfs-static-with-system-hunspell.patch + - fixes/Bug-626035-Modify-the-way-arm-compiler-flags-are-set.patch + - fixes/Bug-639554-Install-sdk-bin-with-make-install.-r-bsme.patch + - fixes/Bug-640494-part-1-Get-rid-of-STL-algorithm-use-in-js.patch + - fixes/Bug-640494-part-2-Use-bitwise-operations-in-JSDOUBLE.patch + - fixes/Bug-652139-Use-an-integer-type-in-DocumentViewerImpl.patch + - fixes/Bug-662224-Define-NS_ATTR_MALLOC-and-NS_WARN_UNUSED_.patch + - fixes/Bug-668906-Do-not-call-openUnsharedDatabase-with-a-n.patch + - fixes/Bug-671564-Initialize-NS_XPCOM_LIBRARY_FILE-from-NS_.patch + - fixes/Disable-building-embedded-libjpeg-turbo-when-buildin.patch + - porting/Allow-to-build-yuv_convert_arm.cpp-on-armv4t.patch + - porting/Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch + - porting/Fix-FTBFS-in-IPC-on-Linux-PPC.patch + - porting/Fix-FTBFS-in-xpcom-base-on-armv4t.patch + - system-libs/libxul-linking-error-with-enable-system-ffi-and-stat.patch + * [5f6e50f] add Japanese translation for desktop menu entry. Thanks to + Hideki Yamane (Closes: #640679) + * [591f76c] add build depends unzip + * [0af372f] remove upstream integrated CFLAGS and CXXFLAGS '-g -std=gnu++0x' + * [a4c8b2f] adjust install and links file to new upstream + * [332b7a8] Revert "override libtheora embedded-library error" no longer + needed + + -- Christoph Goehre Sat, 05 Nov 2011 20:31:29 +0100 + +icedove (5.0-2) experimental; urgency=low + + * [7f92927] fix FTBFS on ia64: use gcc with -O2 instead of -Os + * [b6b8dea] Disable methodjit on armel + * [5b45336] remove obsolete conffiles with dpkg-maintscript-helper + (Closes: #636819) + * [868cfa3] rebuild patch queue from patch-queue branch + added patches: + - porting/Allow-ipc-code-to-build-on-GNU-hurd.patch - fix building on + GNU/hurd - Thanks to Pino Toscano + + -- Christoph Goehre Sun, 07 Aug 2011 15:35:09 +0200 + +icedove (5.0-1) experimental; urgency=low + + * New Upstream Version (Closes: #632037) + * [98c5a8f] build against libffi and libvpx + * [52dff12] build javascript lib as shared library + * [6f1c24d] build against mozilla png library + * [9e16beb] c-sdk moved from directory/sdks/c-sdk to ldap/sdks/c-sdk + * [57763a0] override libtheora embedded-library error + * [fc71b62] adjust install/links files for new upstream version + * [6e83a58] Revert "lintian: override ancient-libtool warning" override no + longer needed + * [d65b463] change hardcoded list of non-Linux build depends into linux-any + (Closes: #634301) + * [ff3a8f3] remove file compare in build run + * [a21efa9] add branding for icedove 5.0 + * [7023939] update porting/Fix-FTBFS-in-xpcom-base-on-armv4t.patch - fix + building on armhf + + -- Christoph Goehre Wed, 03 Aug 2011 18:25:17 +0200 + +icedove (3.1.11-1) unstable; urgency=high + + * New Upstream Version + - MFSA 2011-19 aka CVE-2011-2364, CVE-2011-2365, CVE-2011-2374, + CVE-2011-2376: + Miscellaneous memory safety hazards (rv:3.0/1.9.2.18) + - MFSA 2011-20 aka CVE-2011-2373: Use-after-free vulnerability when + viewing XUL document with script disabled + - MFSA 2011-21 aka CVE-2011-2377: Memory corruption due to + multipart/x-mixed-replace images + - MFSA 2011-22 aka CVE-2011-2371: Integer overflow and arbitrary code + execution in Array.reduceRight() + - MFSA 2011-23 aka CVE-2011-0083, CVE-2011-0085, CVE-2011-2363: + Multiple dangling pointer vulnerabilities + - MFSA 2011-24 aka CVE-2011-2362: Cookie isolation error + * [2a82ce8] DM-Upload-Allowed is superfluous since I'm DD + + -- Christoph Goehre Sun, 26 Jun 2011 10:35:31 +0200 + +icedove (3.1.10-2) unstable; urgency=low + + * [de81b7f] remove obsolete build depends libxp-dev (Closes: #623668) + * [633782d] change DEB_HOST_MULTIARCH back to DEB_HOST_GNU_TYPE and + downgrade sqlite version (Closes: #627598) + + -- Christoph Goehre Mon, 06 Jun 2011 20:53:54 +0200 + +icedove (3.1.10-1) unstable; urgency=high + + * New Upstream Version (Closes: #625207) + - MFSA 2011-12 aka CVE-2011-0069, CVE-2011-0070, CVE-2011-0072, + CVE-2011-0074, CVE-2011-0075, CVE-2011-0077, + CVE-2011-0078, CVE-2011-0080, CVE-2011-0081: + Miscellaneous memory safety hazards (rv:2.0.1/ 1.9.2.17/ 1.9.1.19) + - MFSA 2011-16 aka CVE-2011-0071: Directory traversal in resource: protocol + * [78e0217] build against system libbz2 + * [e6af761] build against system libpng + * [4b57c30] build against system libhunspell + * [937f0bd] double check to build against most system libraries + * [d6de723] rebuild patch queue from patch-queue branch + added patches (Closes: #624969): + - 0072-fix-building-with-gcc-4.6-Add-constructor-to-placate.patch + - 0073-fix-building-with-gcc-4.6-os2.cc-missing-include-cst.patch + - 0074-Add-constructor-for-nsCaseInsensitiveStringComparato.patch + - 0075-Add-constructor-for-nsXULAppInfo-which-inherits-from.patch + - 0076-Add-constructor-for-GTKEmbedDirectoryProvider.patch + modified patches: + - 0056-Disable-APNG-support-when-system-libpng-doesn-t-supp.patch + obsolete patches (fixed upstream): + - 0051-Do-exec-instead-of-uselessly-forking-in-xulrunner-la.patch + - 0072-Add-support-for-libnotify-0.7.patch + * [e190ef1] bump up standards version to 3.9.2 (change DEB_HOST_GNU_TYPE to + DEB_HOST_MULTIARCH) + + -- Christoph Goehre Tue, 10 May 2011 20:03:04 +0200 + +icedove (3.1.9-2) unstable; urgency=low + + * Upload to unstable + * [ace3b6f] rebuild patch queue from patch-queue branch + added patches: + - 0072-Add-support-for-libnotify-0.7.patch + * [910f213] use DEP5 for copyright file + * [3ae4c8b] set global section to 'mail' + * [42c9c89] icedove.1: icedove is derived from Thunderbird instead of + Mozilla suite + + -- Christoph Goehre Sat, 02 Apr 2011 09:43:04 +0200 + +icedove (3.1.9-1) experimental; urgency=low + + * New Upstream Version + - MFSA 2011-01 aka CVE-2011-0053, CVE-2011-0062: Miscellaneous memory + safety hazards (rv:1.9.2.14/ 1.9.1.17) + - MFSA 2011-08 aka CVE-2010-1585: ParanoidFragmentSink allows javascript: + URLs in chrome documents + - MFSA 2011-09 aka CVE-2011-0061: Crash caused by corrupted JPEG image + * [699536a] rebuild patch queue from patch-queue branch + added patches: + - 0069-save-a-copy-of-a-attached-file-when-sending-from-OOo.patch + (Closes: #505875) + - 0070-News-article-is-empty-if-selected-during-download-fr.patch + (Closes: #487494) + - 0071-restore-icedove-on-login-by-session-management.patch + (Closes: #403458) + modified patches: + - 0003-no_dynamic_nss_softokn.patch + - 0010-Support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + - 0030-Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch + * [98d8ac0] c-sdk move to sdks/c-sdk - adjust + debian/{copyright,remove.nonfree,rules} + + -- Christoph Goehre Wed, 09 Mar 2011 20:21:59 +0100 + +icedove (3.1.7-1) experimental; urgency=low + + * New Upstream Version (Closes: #606977) + - MFSA 2010-74 aka CVE-2010-3776, CVE-2010-3777: Miscellaneous memory + safety hazards (rv:1.9.2.13/ 1.9.1.16) + - MFSA 2010-75 aka CVE-2010-3769: Buffer overflow while line breaking + after document.write with long string + - MFSA 2010-78 aka CVE-2010-3768: Add support for OTS font sanitizer + * [46e3e8a] rebuild patch queue from patch-queue branch + added patches: + - 0068-fix-forwarding-of-Simple-HTML-email.patch + obsolete patches (fixed upstream): + - 0017-Implement-sync_instruction_memory-for-sparc-linux.patch + - 0059-Fix-startup-problem-with-symlinked-components-e.g.-e.patch + * [9fcce0c] add license info for gfx/ots + + -- Christoph Goehre Mon, 13 Dec 2010 17:59:50 +0100 + +icedove (3.1.6-1) experimental; urgency=low + + * New Upstream Version (Closes: #601334) + - MFSA 2010-64 aka CVE-2010-3175, CVE-2010-3176: Miscellaneous memory + safety hazards (rv:1.9.2.11/ 1.9.1.14) + - MFSA 2010-65 aka CVE-2010-3179: Buffer overflow and memory corruption + using document.write + - MFSA 2010-66 aka CVE-2010-3180: Use-after-free error in nsBarProp + - MFSA 2010-67 aka CVE-2010-3183: Dangling pointer vulnerability in + LookupGetterOrSetter + - MFSA 2010-69 aka CVE-2010-3178: Cross-site information disclosure via + modal calls + - MFSA 2010-71 aka CVE-2010-3182: Unsafe library loading vulnerabilities + - MFSA 2010-73 aka CVE-2010-3765: Heap buffer overflow mixing + document.write and DOM insertion + * [270fd51] rebuild patch queue from patch-queue branch + added patches: + - 0069-Use-errno.ENOENT-instead-of-2-in-JarMaker.py.patch + modified patches: + - 0009-fix-branding-in-migration-wizard-and-the-addon-manag.patch + * [24421f4] bump build depends for libnspr4-dev, libnss3-dev and + libsqlite3-dev + + -- Christoph Goehre Wed, 10 Nov 2010 07:11:17 +0100 + +icedove (3.1.4-1) experimental; urgency=low + + * New Upstream Version + + -- Christoph Goehre Sat, 18 Sep 2010 18:25:37 +0200 + +icedove (3.1.3-1) experimental; urgency=low + + * New Upstream Version + - MFSA 2010-49 aka CVE-2010-3169: Miscellaneous memory safety hazards + (rv:1.9.2.9/ 1.9.1.12) + - MFSA 2010-50 aka CVE-2010-2765: Frameset integer overflow vulnerability + - MFSA 2010-51 aka CVE-2010-2767: Dangling pointer vulnerability using DOM + plugin array + - MFSA 2010-53 aka CVE-2010-3166: Heap buffer overflow in + nsTextFrameUtils::TransformText + - MFSA 2010-54 aka CVE-2010-2760: Dangling pointer vulnerability in + nsTreeSelection + - MFSA 2010-55 aka CVE-2010-3168: XUL tree removal crash and remote code + execution + - MFSA 2010-56 aka CVE-2010-3167: Dangling pointer vulnerability in + nsTreeContentView + - MFSA 2010-57 aka CVE-2010-2766: Crash and remote code execution in + normalizeDocument + - MFSA 2010-59 aka CVE-2010-2762: SJOW creates scope chains ending in + outer object + - MFSA 2010-61 aka CVE-2010-2768: UTF-7 XSS by overriding document charset + using type attribute + - MFSA 2010-62 aka CVE-2010-2769: Copy-and-paste or drag-and-drop into + designMode document allows XSS + - MFSA 2010-63 aka CVE-2010-2764: Information leak via XMLHttpRequest + statusText + * [9a03eb1] rebuild patch queue from patch-queue branch + added patches: + - 0060-fix-FTBFS-on-hurd.patch (Closes: #595665) + - 0061-Enable-x64-JIT-backend-by-default.patch + - 0062-Fix-unaligned-reads-in-qcms.patch + - 0063-Import-js-src-nanojit-njcpudetect.h.patch + - 0064-Use-clz-on-android-even-for-armv5-target.patch + - 0065-Fix-ARM-verbose-assembly-output-for-BLX.patch + - 0066-Get-rid-of-blx_lr_bug.patch + - 0067-Avoid-some-ARM-CPU-arch-related-runtime-tests-depend.patch + - 0068-ARMv4T-support-for-nanojit.patch + + -- Christoph Goehre Tue, 14 Sep 2010 13:41:19 +0200 + +icedove (3.1.2-2) experimental; urgency=low + + * [e1435dc] rebuild patch queue from patch-queue branch + added patches: + - 0060-Fix-startup-problem-with-symlinked-components-e.g.-e.patch + (Closes: #592531) + modified patches: + - 0048-Add-nanojit-support-for-ARMv4T.patch - Fix FTBFS on armel + + -- Christoph Goehre Sat, 21 Aug 2010 14:51:03 +0200 + +icedove (3.1.2-1) experimental; urgency=low + + * New Upstream Version (Closes: #589666, #591899) + - MFSA 2010-34 aka CVE-2010-1211, CVE-2010-1212: Miscellaneous memory + safety hazards (rv:1.9.2.7/ 1.9.1.11) + - MFSA 2010-38 aka CVE-2010-1215: Arbitrary code execution using SJOW and + fast native function + - MFSA 2010-39 aka CVE-2010-2752: nsCSSValue::Array index integer overflow + - MFSA 2010-40 aka CVE-2010-2753: nsTreeSelection dangling pointer remote + code execution vulnerability + - MFSA 2010-41 aka CVE-2010-1205: Remote code execution using malformed PNG + image + - MFSA 2010-42 aka CVE-2010-1213: Cross-origin data disclosure via Web + Workers and importScripts + - MFSA 2010-43 aka CVE-2010-1207: Same-origin bypass using canvas context + - MFSA 2010-44 aka CVE-2010-1210: Characters mapped to U+FFFD in 8 bit + encodings cause subsequent character to vanish + - MFSA 2010-46 aka CVE-2010-0654: Cross-domain data theft using CSS + - MFSA 2010-47 aka CVE-2010-2754: Cross-origin data leakage from script + filename in error messages + * [6b9976e] rebuild patch queue from patch-queue branch + modified patches: + - 0010-Support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + - 0015-Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch + - 0018-Work-around-FTBFS-on-mips-by-disabling-TLS-support.patch + - 0034-Fix-compiler-errors-with-g-4.4-with-std-gnu-0x.patch + - 0045-Expose-fullpath-from-nsIPluginTag.patch + - 0047-Use-syscall-for-mmap-and-munmap-and-disable-ncpus-in.patch + - 0050-Set-javascript.options.showInConsole.patch + - 0057-Allow-to-build-against-system-libffi.patch + - 0058-Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch + - 0059-Disable-APNG-support-when-system-libpng-doesn-t-supp.patch + * [16b0e7e] fix FTBFS on kfreebsd-* and hurd-i386 by passing + --disable-necko-wifi to configure (Closes: #589476) + * [15a02c7] bump up standards version to 3.9.1 + + -- Christoph Goehre Fri, 13 Aug 2010 12:18:21 +0200 + +icedove (3.1-1) experimental; urgency=low + + * New Upstream Version + * [124a316] add additional build depends libnotify-dev + * [5ed6a72] adjust branding for Icedove 3.1 + * [bed8969] install further js files shipped with Icedove 3.1 + * [02456e6] replace blue icedove icons with green version + * [036921f] regenerate patch queue for 3.1 Icedove release + * [a7fa393] build with system ffi + * [d8650f7] ship icedove svg file for low resolution icons too + * [7718c55] bump Standards Version to 3.9.0 and downgrade Conflicts to + Breaks + * [9621fc6] lintian: override ancient-libtool warning + + -- Christoph Goehre Sat, 17 Jul 2010 17:19:58 +0200 + +icedove (3.0.5-1) unstable; urgency=low + + * New Upstream Version + - MFSA 2010-25 aka CVE-2010-1121: Re-use of freed object due to scope + confusion + - MFSA 2010-26 aka CVE-2010-1200, CVE-2010-1201, CVE-2010-1202: Crashes + with evidence of memory corruption (rv:1.9.2.4/ 1.9.1.10) + - MFSA 2010-29 aka CVE-2010-1196: Heap buffer overflow in + nsGenericDOMDataNode::SetTextInternal + - MFSA 2010-30 aka CVE-2010-1199: Integer Overflow in XSLT Node Sorting + * [9774410] rebuild patch queue from patch-queue branch + added patches: + - 0045-Fix-misalignments-in-help-command-line.patch + - 0046-Fix-misalignments-in-help-command-line.patch + - 0047-KDE-Gnome-startup-notification-not-disappearing-when.patch + - 0048-KDE-Gnome-startup-notification-not-disappearing-for-.patch + - 0049-Use-char16_t-when-available-and-when-it-is-don-t-tes.patch + - 0050-Fix-compiler-errors-with-g-4.4-with-std-gnu-0x.patch + - 0051-Add-xptcall-support-for-SH4-processors.patch + modified patches: + - 0028-Avoid-crashing-when-trying-to-kill-a-nsProcess-that-.patch + obsolete patches (fixed upstream): + - 0021-Avoid-creating-the-updates-directory-when-update-ser.patch + - 0035-Fix-stack-alignment-on-function-calls-in-JIT-on-ARM.patch + * [3b98c84] avoid unneeded package depends by building with + '-Wl,--as-needed' + * [0067020] Build with -std=gnu++0x + * [72d4300] add pkg-config file for icedove (Closes: #577740) + * [e6af35d] enlarge package description with specification from icedove 2.0 + (Closes: #565887) + * [ef0bc10] add support for new Debian arch: powerpcspe (Closes: #586100) - + thanks to Sebastian Andrzej Siewior + * [5ae6099] use high bandwidth server in watch file to get new upstream + release + * [5e6d641] remove obsolete build depends libkrb5-dev + * [8ed7848] remove unused DEBIAN_VERSION vars in rules file + * [9959bd5] DEB_HOST_GNU_TYPE, DEB_BUILD_GNU_TYPE and DEB_BUILD_ARCH are + defined by cdbs too + * [9f6c088] Fix misalignments in --help command line + + -- Christoph Goehre Sat, 19 Jun 2010 23:26:55 +0200 + +icedove (3.0.4-3) unstable; urgency=low + + * [4026b50] icedove-dev need depend on libnspr4-dev and libnss3-dev + (Closes: #455725) + * [1fee936] don't run configure with --enable-optimize and --disable- + optimize if DEB_BUILD_OPTIONS contains noopt + * [02c0ea3] ship account autoconfig file for Riseup Networks (riseup.net) + (Closes: #577616) + * [e710d08] suggest libgssapi-krb5-2 for Kerberos login possibility + * [7609291] build a shared icedove binary. This avoid crashes because of + mixed functions from system and icedove itself (e.g. str2charray from + libldap_r-2.4.so.2 and libldap60.so). (Closes: #578916) + * [68f4b49] downgrade gnome stuff from Recommends to Suggests + (Closes: #579714) + * [bcff10b] install mailViews.dat into usr/share/icedove/defaults/messenger + + -- Christoph Goehre Fri, 14 May 2010 22:21:32 +0200 + +icedove (3.0.4-2) unstable; urgency=low + + * [57f0a8b] remove icedove-3.0 transitional package (Closes: #576741) + * [8008231] remove wrong mime types in desktop file + * [a12edde] set StartupWMClass in desktop file to Icedove-bin + * [7512224] extend package description of icedove, icedove-dev and + icedove-dbg + * [7e725b9] fix FTBFS on alpha by passing '-Wl,--no-relax' to gcc + * [92d3515] Switch to dpkg-source 3.0 (quilt) format + * [14d5894] rebuild patch queue from patch-queue branch + added patches: + - 0046-add-missing-headers-for-icedove-dev-package.patch (Closes: #577021) + modified patches: + - 0012-Support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + - 0020-Work-around-FTBFS-on-mips-by-disabling-TLS-support.patch + * [2cdd850] remove obsolete thunderbird 3.0a1pre postinst stuff + * [443f44b] process directory/c-sdk/configure with autoconf too + * [66c2f65] remove obsolete build depends librsvg2-bin and patchutils + + -- Christoph Goehre Sun, 11 Apr 2010 12:44:26 +0200 + +icedove (3.0.4-1) unstable; urgency=low + + [ Guido Günther ] + * [01983a4] Add missing message/rfc822 mime type for eml files + (Closes: #574528) + + [ Christoph Goehre ] + * New Upstream Version fixes: + - MFSA 2010-16 aka CVE-2010-0173, CVE-2010-0174: Crashes with evidence of + memory corruption (rv:1.9.2.2/ 1.9.1.9/ 1.9.0.19) + - MFSA 2010-17 aka CVE-2010-0175: Remote code execution with + use-after-free in nsTreeSelection + - MFSA 2010-18 aka CVE-2010-0176: Dangling pointer vulnerability in + nsTreeContentView + - MFSA 2010-22 aka CVE-2009-3555: Update NSS to support TLS renegotiation + indication + - MFSA 2010-24 aka CVE-2010-0182: XMLDocument::load() doesn't check + nsIContentPolicy + * upload icedove 3 to unstable (Closes: #401848, #422886, #425497, #430644, + #483550, #495522, #501113, #552617, #574188) + * rebuild patch queue from patch-queue branch: + added patches: + - 0044-don-t-remove-xpt-tools.patch + - 0045-Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch + modified patches: + - 0011-fix-branding-in-migration-wizard-and-the-addon-manag.patch + - 0012-Support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch + - 0030-Force-better-nsAutoT-Ptr-Array-buffer-alignment.patch + - 0035-Fix-stack-alignment-on-function-calls-in-JIT-on-ARM.patch + obsolete patches (fixed upstream): + - 0021-Fix-crash-with-SwitchProxy-installed.patch + - 0023-Don-t-remove-build-automationutils.py-on-make-clean.patch + - 0039-Don-t-show-the-SVG-output-option-in-the-print-dialog.patch + * [a7f3529] Revert "disable prefetch service". This bug was already fixed in + 3.0.2 (CVE-2009-4629) and 'network.prefetch-next' has no effect in + icedove. + * [fecc0b4] install versioned build depends instead of checking on build + time + * [4806890] enable building of icedove-dev package + * [412b8ac] be more explicit on installing file into icedove package + * [23b1d4b] depends on newer version of libnspr4-dev and libnss3-dev + * [809c723] lintian: idl files didn't need to be executable + * [ecd284e] lintian: add ${shlibs:Depends} to icedove-dev package + * [da75ee2] replace/remove non-free searchplugin icons and doubtful + origin file in mozilla folder (Closes: #567917) + * [eaf405e] update /usr/lib/icedove/dictionaries symlink to point to + /usr/share/hunspell + * [fe362ba] describe profile renaming on update to icedove 3.0 + (Closes: #566329) + + -- Christoph Goehre Mon, 05 Apr 2010 21:11:42 +0200 + +icedove (3.0.3-1) experimental; urgency=low + + * New Upstream Version fixes: + - missing folders or empty folder pane after updating to version 3.0.2 + * [a69cdfd] rebuild patches from patch-queue: + - additional fix for FTBFS on kfreeBSD + * [e4bffd4] disable prefetch service (Closes: #572789) + * [3838bbe] branding files shouldn't be executable + * [3dc6688] add missing newline in logo license file + + -- Christoph Goehre Sat, 06 Mar 2010 21:48:50 +0100 + +icedove (3.0.2-1) experimental; urgency=low + + * New Upstream Version fixes: + - MFSA 2010-01 aka CVE-2010-0159: Crashes with evidence of memory + corruption (rv:1.9.1.8/ 1.9.0.18) + - MFSA 2010-03 aka CVE-2009-1571: Use-after-free crash in HTML parser + * [1fd705f] install menu file (Closes: #569166) + * [8df3f99] generate desktop files at build process + * [5b0bb84] add icedove branding logos + * [1ef1c10] copyright explanation of icedove artwork (Closes: #406849) + * [6cdc0b0] remove forgotten firefox branding icons (Closes: #567917) + * [cec6a38] swedish translation for desktop file (Closes: #420050) + * [0256328] readd translation for desktop file + * [20311f4] rebuild patches (most patches from Mike Hommey) + - fix FTBFS on kFreeBSD, hppa, mips + - stability patched for mips, alpha, sparc, ppc and arm + - really cleanup build directory on 'make clean/distclean' + - allow intl.locale.matchOS to be modified in user profile + * [0098f90] write manpage for icedove (Closes: #425490, #487493) + * [fbccfaa] no longer suggest libthai0 (Closes: #524436) + * [26d3e39] change suggests from transitional package latex-xft-fonts + to ttf-lyx (Closes: #539535) + * [e24801a] improve desktop file (remove deprecated items and + warnings/errors) + * [68885c4] bump up standards version to 3.8.4 + * [df39ede] use xpm icon in menu file to calm lintian + * [8303887] adjust sqlite version to new upstream dependency + + -- Christoph Goehre Sun, 28 Feb 2010 18:19:13 +0100 + +icedove (3.0.1-2) experimental; urgency=low + + [ Guido Günther ] + * [7ea7367] Explicitly pass build and host type to configure (Closes: + #546011) - thanks to Sven Joachim for the patch + * [7fca9e1] Add back icedove changelog of earlier versions + + [ Christoph Goehre ] + * [72b78cc] Support both - and _ separators in dictionary names - patch from + Reed Loden + * [9a96759] fix branding in migration wizard and the addon manager (Closes: + #565559)- patch from Edward J. Shornock + + -- Christoph Goehre Tue, 02 Feb 2010 20:32:24 +0100 + +icedove (3.0.1-1) experimental; urgency=low + + * New Upstream Version + * [8a2f5dc] define default options for git-import-orig + * [ac65b1b] refresh debian patches + * [851c5dc] rename binary packages to icedove (without version number) + * [6e12d1b] adjust cairo version to 1.8.8 + * [cd7cd6f] moving the old profile dir instead of copy + * [c342380] replace theme directory always by link to /usr/share if we + update to version 3 + * [c88eaa7] expansion of lib{dbusservice,mozgnome,nkgnomevfs}.so didn't work + with dpkg-shlibdeps - lets use the '-e' switch + + -- Christoph Goehre Thu, 21 Jan 2010 20:53:57 +0100 + +icedove (3.0-2) experimental; urgency=low + + * [f07e702] Add Replaces for icedove-gnome-support + * [72e66e7] Fix typo + + -- Guido Günther Fri, 08 Jan 2010 16:05:10 +0100 + +icedove (3.0-1) experimental; urgency=low + + * Final upstream version without any source code changes against RC2 + + [ Guido Günther ] + * [77d611e] Add Vcs-{Git,Browser} + * [ec7ddd6] Move VCS to where they belong + + [ Christoph Goehre ] + * [524d1f5] don't hardcode $MOZ_APP_NAME in Makefile.in file + * [0407ff3] mailclient bin called now $DEB_MOZ_APPLICATION + * [e6040b5] merge icedove-3.0-gnome-support into icedove-3.0 package + * [07417e0] install default theme and components/*.js into + /usr/share/icedove-3.0 + * [3d37478] add missed components files + * [f09cfad] add another preferences directory for applications: + preferences/syspref - thanks to Mike Hommey + * [d92e265] install debian config into /etc/icedove-3.0/pref and link + into defaults/syspref + * [18a886b] disable application update + * [76ea38a] let lockPref() in .js files work - thanks to Mike Hommey + * [e44133e] gnome-default-mail-client: check for MOZ_APP_NAME instead + for hardcoded 'thunderbird' + * [8573c8d] set DM-Upload-Allowed to yes + * [1c63920] install modules directory into /usr/share/icedove-3.0 + * [3a85ac6] add gbp.conf for easier package build with + git-buildpackage + * [7feb54a] add watch file + * [e0a1624] document how to clean upstream source code + + -- Christoph Goehre Fri, 08 Jan 2010 10:42:09 +0100 + +icedove (3.0~rc2-2) experimental; urgency=low + + [ Christoph Goehre ] + * [5b7992b] rename source package to unversioned name + * [cde3507] change Maintainer back to asac, add Uploaders Guido and me + * [978c58d] disable icedove-3.0-dev package build for now until it is fixed + upstream + * Upstream is identical to 3.0 final + + -- Guido Günther Thu, 17 Dec 2009 18:36:58 +0100 + +icedove-3.0 (3.0~rc2-1) experimental; urgency=low + + [ Christoph Goehre ] + * New Upstream Version (RC2) + - fixes 494014, 516950, 531278, 531502 in Mozilla Bugzilla + * [fc3fa5c] Revert "mark icedove-3.0-dev as transitional package for + xulrunner-dev" + + [ Guido Günther ] + * [51c1cca] Bump standards version + * [5e2a53c] Refer to versioned license + * [171f382] s/explicitely/explicitly/ + + -- Christoph Goehre Tue, 08 Dec 2009 18:46:28 +0100 + +icedove-3.0 (3.0~rc1-1) experimental; urgency=low + + * New Upstream Version (RC1) + * [cce57db] ship extracted upstream tarball in orig file + * [ee7677f] remove obsolet licence fix + * [7051ca8] install TB_ICON only once + * [4f20bb1] add unbranded preview theme icon + * [0002285] install non-binary stuff in /usr/share and link it into + /usr/lib + * [c9ce50f] get right of system myspell + * [5c96edf] remove version check for hunspell in debian/rules + * [13b57a3] mark icedove-3.0-dev as transitional package for + xulrunner-dev + * [8ecaec9] all packages need ${misc:Depends} as depends, if we use + debhelper + * [fc0dd78] dbg package must have section debug and priority extra + * [3a00f22] enable more config options and add build depends (filched from + iceape 2.0) + * [fd8e3ca] build against system sqlite if available + * [81165e1] build with 'export BUILD_OFFICIAL=1' + + -- Christoph Goehre Thu, 03 Dec 2009 10:16:46 +0100 + +icedove-3.0 (3.0~b3~hg20090713r3057-1~gbp253e4ab) sid; urgency=low + + * New snapshot. + + -- Guido Günther Tue, 14 Jul 2009 10:24:57 +0200 + +icedove-3.0 (3.0~b3~hg20090713r3057-1~gbpefd0706) sid; urgency=low + + * New snapshot. + + -- Guido Günther Tue, 14 Jul 2009 10:24:50 +0200 + +icedove-3.0 (3.0~b3~hg20090713r3057-1~gbpfeeee47) sid; urgency=low + + * New snapshot. + + -- Guido Günther Tue, 14 Jul 2009 10:11:10 +0200 + +icedove-3.0 (3.0~b3~hg20090505r2552-1~gbp595a0b7) sid; urgency=low + + * New snapshot. + + -- Guido Günther Tue, 05 May 2009 18:03:25 +0200 + +icedove-3.0 (3.0~b3~hg20090427r2499-1~gbpbeb7cd6) sid; urgency=low + + * New snapshot. + + -- Guido Günther Mon, 27 Apr 2009 20:05:51 +0200 + +icedove-3.0 (3.0~b3~hg20090427r2499-1~gbp80a8829) sid; urgency=low + + * New snapshot. + + -- Guido Günther Mon, 27 Apr 2009 19:56:09 +0200 + +icedove-3.0 (3.0~b3~hg20090422r2448-1~gbpd4ee3b3) pkg-mozext; urgency=low + + * New snapshot. + + -- Guido Günther Wed, 22 Apr 2009 09:14:54 +0200 + +icedove-3.0 (3.0~b3~hg20090421r2441-1~gbp66d9bed) pkg-mozext; urgency=low + + * New snapshot. + + -- Guido Günther Tue, 21 Apr 2009 19:35:09 +0200 + +icedove-3.0 (3.0~b3~hg20090420r2424-1~gbp47b25b8) pkg-mozext; urgency=low + + * New snapshot. + + -- Guido Günther Mon, 20 Apr 2009 11:28:56 +0200 + +icedove-3.0 (3.0~b3~hg20090418r2418+nobinonly-1~0~gbpa19783) pkg-mozext; urgency=low + + * Initial release + + -- Guido Günther Sun, 19 Apr 2009 13:44:33 +0200 + +icedove (2.0.0.22-1.1) unstable; urgency=low + + * Non-maintainer upload. + * update /usr/lib/icedove/dictionaries symlink to point to + /usr/share/hunspell (closes: #549876) + * add $[shlibs:Depends} to iceape-dev + + -- Rene Engelhard Mon, 09 Nov 2009 17:11:50 +0100 + +icedove (2.0.0.22-1) unstable; urgency=low + + * New upstream security/stability update (v2.0.0.21/v2.0.0.22) (Closes: 535124) + * MFSA 2009-33: Crash viewing multipart/alternative message with text/enhanced part + * MFSA 2009-32 aka CVE-2009-1841: JavaScript chrome privilege escalation + * MFSA 2009-29 aka CVE-2009-1838: Arbitrary code execution using event listeners + attached to an element whose owner document is null + * MFSA 2009-27 aka CVE-2009-1836: SSL tampering via non-200 responses to proxy + CONNECT requests + * MFSA 2009-24 aka CVE-2009-1832+CVE-2009-1831: Crashes with evidence of memory + corruption (rv:1.9.0.11) + * MFSA 2009-17 aka CVE-2009-1307: Same-origin violations when Adobe Flash loaded + via view-source: scheme + * MFSA 2009-14 aka CVE-2009-1303+CVE-2009-1302: Crashes with evidence of memory + corruption (rv:1.9.0.9) + * MFSA 2009-15 aka CVE-2009-0652: URL spoofing with box drawing character + * MFSA 2009-10 aka CVE-2009-0040: Upgrade PNG library to fix memory safety hazards + * MFSA 2009-09 aka CVE-2009-0776: XML data theft via RDFXMLDataSource and cross-domain + redirect + * MFSA 2009-07 aka CVE-2009-0771,-0772,-0773,-0774: Crashes with evidence of memory + corruption (rv:1.9.0.7) + * MFSA 2009-01 aka CVE-2009-0352,CVE-2009-0353 Crashes with evidence of memory + corruption (rv:1.9.0.6) + * adjust patches to changed codebase + - update debian/patches/ubuntu-mail-app-xre-name + + -- Alexander Sack Wed, 01 Jul 2009 12:18:03 +0200 + +icedove (2.0.0.19-1) unstable; urgency=medium + + * New upstream security/stability update (v.2.0.0.18/2.0.0.19) Closes: 505563 + 2.0.0.18: + * MFSA 2008-48 aka CVE-2008-5012 - Image stealing via canvas and HTTP + redirect + * MFSA 2008-50 aka CVE-2008-5014 - Crash and remote code execution via + __proto__ tampering + * MFSA 2008-52 aka CVE-2008-5017 - Crashes with evidence of memory + corruption (rv:1.9.0.4/1.8.1.18); Browser engine crash in "Firefox 2 + and 3" + * MFSA 2008-52 aka CVE-2008-5018 - Crashes with evidence of memory + corruption (rv:1.9.0.4/1.8.1.18); JavaScript engine crash - "Firefox 2 + and 3" + * MFSA 2008-55 aka CVE-2008-5021 - Crash and remote code execution in + nsFrameManager + * MFSA 2008-56 aka CVE-2008-5022 - nsXMLHttpRequest::NotifyEventListeners() + same-origin violation + * MFSA 2008-58 aka CVE-2008-5024 - Parsing error in E4X default namespace + * MFSA 2008-59 aka CVE-2008-4582 - Script access to .documentURI and + .textContent in mail + 2.0.0.19: + * MFSA 2008-60 aka CVE-2008-5500 - Crashes with evidence of memory + corruption (rv:1.9.0.5/1.8.1.19); Layout engine crashes - Firefox 2 and 3 + * MFSA 2008-61 aka CVE-2008-5503 - Information stealing via + loadBindingDocument + * MFSA 2008-64 aka CVE-2008-5506 - XMLHttpRequest 302 response disclosure + * MFSA 2008-65 aka CVE-2008-5507 - Cross-domain data theft via script + redirect error message + * MFSA 2008-66 aka CVE-2008-5508 - Errors parsing URLs with leading + whitespace and control characters + * MFSA 2008-67 aka CVE-2008-5510 - Escaped null characters ignored by CSS + parser + * apply Maintainers, Uploaders changes done in 2.0.0.17 upload to + debian/control + - update debian/control + * adjust/refresh patches to changed upstream code + - update debian/patches/moz-app-name-as-mail-binary-name + - update debian/patches/autoconf2.13-rerun + + -- Alexander Sack Sat, 03 Jan 2009 16:27:42 +0100 + +icedove (2.0.0.17-1) unstable; urgency=low + + * New upstream security/stability update (v.2.0.0.17), Closes: #500721 + * MFSA 2008-37 aka CVE-2008-0016 - UTF-8 URL stack buffer overflow + * MFSA 2008-38 aka CVE-2008-3835 - nsXMLDocument::OnChannelRedirect() + same-origin violation + * MFSA 2008-41 aka CVE-2008-4058, CVE-2008-4059, CVE-2008-4060 - Privilege + escalation via XPCnativeWrapper pollution + * MFSA 2008-42 aka CVE-2008-4061, CVE-2008-4062, CVE-2008-4063, + CVE-2008-4064 - Crashes with evidence of memory corruption + (rv:1.9.0.2/1.8.1.17) + * MFSA 2008-43 aka CVE-2008-4065, CVE-2008-4066 - BOM characters, low + surrogates stripped from JavaScript before execution + * MFSA 2008-44 aka CVE-2008-4067, CVE-2008-4068 - resource: traversal + vulnerabilities + * MFSA 2008-46 aka CVE-2008-4070 - Heap overflow when canceling newsgroup + message + + [ Michael Casadevall ] + * debian/control: + - Changed maintainer to Ubuntu Mozillateam + - Added Uploaders to the team + - Set DM-Upload-Allowed + - Bumped standards version to 3.8.0 + + [ Alexander Sack ] + * Closes: #497491 - Icedove inappropriately sets file-/MIME-type + associations in .desktop database; we drop the Mime-Type= entry + from debian/icedove.desktop + - update debian/icedove.desktop + + -- Michael Casadevall Sat, 18 Oct 2008 09:07:20 -0400 + +icedove (2.0.0.16-1) unstable; urgency=low + + * New upstream security/stability update (v2.0.0.16) fixes: + * MFSA 2008-21 aka CVE-2008-2798 - Crashes with evidence of memory + corruption + * MFSA 2008-21 aka CVE-2008-2799 - Crashes with evidence of memory + corruption + * MFSA 2008-24 aka CVE-2008-2802 - Chrome script loading from fastload file + * MFSA 2008-25 aka CVE-2008-2803 - Arbitrary code execution in + mozIJSSubScriptLoader.loadSubScript() + * MFSA 2008-26 aka CVE-2008-0304 - (followup) Buffer length checks in MIME + processing + * MFSA 2008-29 aka CVE-2008-2807 - Faulty .properties file results in + uninitialized memory being used + * MFSA 2008-31 aka CVE-2008-2809 - Peer-trusted certs can use alt names to + spoof + * MFSA 2008-33 aka CVE-2008-2811 - Crash and remote code execution in block + reflow + * MFSA 2008-34 aka CVE-2008-2785 - Remote code execution by overflowing CSS + reference counter + + * Closes: #483938 - add .desktop file translations (contributed by Timo + Jyrinki ) + - update debian/icedove.desktop + + (cherry pick rev77 from lp:~mozillateam/thunderbird/thunderbird.dev branch) + * drop patches applied upstream + - drop debian/patches/bz419350_attachment_306066.patch + - update debian/patches/series + + (cherry pick rev78 from lp:~mozillateam/thunderbird/thunderbird.dev branch) + * adjust patches diverged upstream + - update debian/patches/ubuntu-look-and-feel-report-a-bug-menuitem + + (cherry pick rev80 from lp:~mozillateam/thunderbird/thunderbird.dev branch) + * Closes: #489093 - add explicit -lfontconfig to linker flags used for gfx/ps + module to fix ftbfs in intrepid + - add debian/patches/bzXXX_ftbfs_fontconfig.patch + - update debian/patches/series + + -- Alexander Sack Thu, 24 Jul 2008 17:38:51 +0200 + +icedove (2.0.0.14-1) unstable; urgency=medium + + * Upstream stability/security release, fixes + + MFSA 2008-15 aka CVE-2008-1236 - Crashes with evidence of memory corruption + (rv:1.8.1.13) - browser engine + + MFSA 2008-15 aka CVE-2008-1237 - Crashes with evidence of memory corruption + (rv:1.8.1.13) - javascript engine + + MFSA 2008-14 aka CVE-2008-1233, CVE-2008-1234, CVE-2008-1235 - JavaScript + privilege escalation and arbitrary code execution + * update debian/remove.nonfree script to pull branding from bzr branch hosted + at https://code.edge.launchpad.net/~mozillateam/thunderbird/icedove-branding-2.0.0.x + - update debian/remove.nonfree + * fix fallback https handler by adding pref("network.protocol-handler.app.https", + "x-www-browser") to default system preference file. (Closes: #460954) + - update debian/icedove.js + * drop patches applied upstream: + - delete debian/patches/bz399589_fix_missing_symbol_with_new_nss.patch + - update debian/patches/series + * fix broken reply-to-list extension (Closes: #439369) + - add debian/patches/replytolist_2.x.patch + - update debian/patches/series + * fix ftbfs on ia64 (Closes: #477281) + - add debian/patches/bz419350_attachment_306066.patch + - update debian/patches/series + * drop forced use of gcc/g++ 4.2 and use default compiler again; in turn we + drop gcc-4.2 and g++-4.2 from Build-Depends + - update debian/control + - update debian/rules + + -- Alexander Sack Fri, 09 May 2008 17:57:55 +0200 + +icedove (2.0.0.12-1) unstable; urgency=low + + * New Upstream stability/security release, fixes various advisories: + + CVE-2008-0416 aka MFSA 2008-13 Multiple XSS vulnerabilities from + character encoding + + CVE-2008-0304 aka MFSA 2008-12 Heap buffer overflow in external MIME + bodies + + CVE-2008-0418 aka MFSA 2008-05 Directory traversal via chrome: URI + + CVE-2008-0415 aka MFSA 2008-03 Privilege escalation, XSS, Remote Code + Execution + + CVE-2008-0412 and CVE-2008-0413 aka MFSA 2008-01 Crashes with evidence + of memory corruption (rv:1.8.1.12) - layout and javascript + * Fix severe problems for powerpc architecture, by reverting arch-detect + patch to introduce special behaviour only when FORCE_USE_HOST_OS is set in + environment. For now only s390 is special cased in rules - as thats the + architecture we introduced this patch for (Closes: #461981). + - update debian/rules + - debian/patches/arch-detect + * fix "FTBFS with libnss3-dev=3.12.0~beta2-1" by introducing symbols not + exported by new nss anymore. Reuse thunderbird patch from ubuntu. + (Closes: #470128) + - added debian/patches/bz399589_fix_missing_symbol_with_new_nss.patch + - update debian/patches/series + * add Vcs-Bzr: header to control pointing to the mozillateam packaging + branch https://code.launchpad.net/~mozillateam/thunderbird/icedove-2.0.0.x + - update debian/control + * introduce .autoreg feature and touch /usr/lib/icedove/.autoreg in + icedove-gnome-support.postinst and icedove-gnome-support.prerm iif that + file exists. + - update debian/rules + - added debian/icedove-gnome-support.postinst + - added debian/icedove-gnome-support.prerm + * Adjust multiple patches because of changed upstream code base + - update debian/patches/ubuntu-mail-app-xre-name + - update debian/patches/autoconf2.13-rerun + + -- Alexander Sack Sat, 05 Apr 2008 23:05:11 +0200 + +icedove (2.0.0.9-3) unstable; urgency=low + + * drop network.protocol-handler.external.http setting as it caused + regressions (Closes: 459564) + - update debian/icedove.js + + -- Alexander Sack Wed, 09 Jan 2008 18:56:28 +0100 + +icedove (2.0.0.9-2) unstable; urgency=low + + * pass host arch information to configure and trust the supplied architecture + information. Thanks to Bastian Blank. (Closes: 445959) + - update debian/rules + - add debian/patches/arch-detect + - update debian/patches/autoconf2.13-rerun + - update debian/patches/series + * use /usr/lib/icedove/icedove as gnome integration command used to update + gconf protocol handler. (Closes: 452919) + - add debian/patches/icedove_gnome_command + - update debian/patches/series + * prefer gnome registry to lookup protocol handler if we are in a gnome + session; in turn we enable x-www-browser as the http protocol by default + (Closes: 452882) + - add debian/patches/prefer_gnome_registry_in_gnome_session + - update debian/patches/series + - update debian/icedove.js + + -- Alexander Sack Sun, 30 Dec 2007 20:21:26 +0100 + +icedove (2.0.0.9-1) unstable; urgency=medium + + * new upstream stability/security update (v2.0.0.9): + - MFSA 2007-36 aka CVE-2007-4841: "URIs with invalid %-encoding mishandled + by Windows" + - MFSA 2007-29 aka CVE-2007-5339: "Crashes with evidence of memory + corruption (rv:1.8.1.8) - browser engine" + - MFSA 2007-29 aka CVE-2007-5340: "Crashes with evidence of memory + corruption (rv:1.8.1.8) - javascript engine" + * adapt adapt patches to new upstream codebase: + - drop debian/patches/bz389801_deb443454_fix_gtk_theme_crashes.patch + - update debian/patches/68_mips_performance.dpatch + - update debian/patches/series + - update debian/patches/autoconf2.13-rerun + * fix ftbfs due to changed cairo pc Requires: (Closes: 453179) + - add debian/patches/bz344818_att264996.patch + - update debian/patches/autoconf2.13-rerun + - update debian/patches/series + * add copyright file (Closes: 453365) + - add debian/copyright + * quote some if test ! ... lines to fix preinst errors (Closes: 427336) + - update debian/icedove.preinst + * update icedove menu section - use "Applications/Network/Communication" + (Closes: 444903) + - update debian/icedove.menu + * don't try to install debian/tmp/usr/lib/icedove/defaults/isp as its not + shipped by make install anymore + - update debian/icedove.install + + -- Alexander Sack Fri, 28 Dec 2007 16:05:05 +0100 + +icedove (2.0.0.6-1) unstable; urgency=low + + * new upstream release 2.0.0.6-1 fixes various security issues + (Closes: #444010): + - MFSA 2007-18 aka CVE-2007-3734, CVE-2007-3735 - Crashes with evidence of + memory corruption (rv:1.8.1.5). + - MFSA 2007-23 aka CVE-2007-3670 - Remote code execution by launching + Firefox from Internet Explorer (doesn't apply to linux). + - MFSA 2007-26 aka CVE-2007-3844 - Privilege escalation through + chrome-loaded about:blank windows. + - MFSA 2007-27 aka # CVE-2007-3845 - Unescaped URIs passed to external + programs. + * debian/patches/debian/patches/credits-rebranding: refresh patch because of + code-base change in new upstream release. + * debian/patche/bz389801_deb443454_fix_gtk_theme_crashes.patch,series: + import fix for theme crashes from bugzilla (Closes: 443454). + + -- Alexander Sack Mon, 08 Oct 2007 12:09:42 +0000 + +icedove (2.0.0.4.dfsg1-2) unstable; urgency=low + + * debian/patches/autoconf2.13-rerun: rerun to apply last commits + configure.in patch addition to configure. + * debian/patches/force-no-pragma-visibility-for-gcc-4.2_4.3, + debian/patches/series: don't use pragma for visibility as visibility + hints are not perfect yet in mozilla code base. + * debian/icedove.desktop: drop explicit .png extension from desktop icon name + * debian/icedove.desktop, debian/icedove.links, debian/icedove.menu: fix various + icon issues, by using /usr/share/icedove/icons/default.png instead of + mozicon128.png as source for standard icedove pixmaps link + (Closes: #427076, #437064, #437090). + * debian/control, debian/rules: use gcc-4.2 and g++-4.2 on all archs; add gcc-4.2 + and g++-4.2 to build-depends in control file. + * debian/icedove.links: provide usr/share/icedove/chrome/icons/default/messengerWindow16.png + as a link to usr/share/icedove/icons/mozicon16.png (Closes: #427723). + * debian/icedove.install, debian/icedove.links: install isp directories + /usr/share/icedove/isp and /usr/share/icedove/defaults/isp and link them to + pkglibdir accordingly (Closes: #428421). + + -- Alexander Sack Mon, 27 Aug 2007 23:48:53 +0200 + +icedove (2.0.0.4.dfsg1-1) unstable; urgency=low + + * debian/remove.nonfree: update list of non-free/binary-only file from + latest iceape updates" debian/remove.nonfree; update orig + tarball accordingly. (Closes: 400340) + * debian/control[.in]: icedove package now provides mail-reader, + imap-client, news-reader instead of www-browser (Closes: 425167) + + -- Alexander Sack Tue, 19 Jun 2007 15:00:12 +0200 + +icedove (2.0.0.4-1) unstable; urgency=low + + * stability/security upstream release 2.0.0.4 + - CVE-2007-2867 aka MFSA 2007-12 (l): Crashes with evidence of memory + corruption (rv:1.8.0.12/1.8.1.4) - layout engine + - CVE-2007-2868 aka MFSA 2007-12 (j): Crashes with evidence of memory + corruption (rv:1.8.0.12/1.8.1.4) - javascript engine + - CVE-2007-1558 aka MFSA 2007-15: Security Vulnerability in APOP + Authentication + * debian/patches/gcc-workaround-visibility-hidden, debian/patches/series: + applied upstream -> dropped visibility workaround patch + * debian/patches/gnome-mime-handling: updated patch for bz273524 in + response to upstream landing of bz373955 + * debian/patches/autoconf-regen: rerun autoconf accordingly + * debian/patches/82_prefs.dpatch|series: import default font fixes + from xulrunner 1.8.1.4-1 patchset (thanks to Mike Hommey + ) + * debian/control[.in]: libnss3-dev build-depend is now versioned + (Closes: 429202) + + -- Alexander Sack Mon, 18 Jun 2007 16:50:34 +0200 + +icedove (2.0.0.0-4) unstable; urgency=low + + * One that fix them all release - maybe. + * fix symlinks for chrome/greprefs/defaults in .preinst + (Closes: 425390, 425438, 425476, 425479, 425550, 425552, 425559, 425564, 425672, 425727, 426019) + * debian/control[.in]: fix section -> s/web/mail/ + + -- Alexander Sack Fri, 1 Jun 2007 13:13:13 +0200 + +icedove (2.0.0.0-3) unstable; urgency=low + + * fixing links in preinst (Closes: 424963, 425061, 425223) + greprefs, chrome and defaults need to point to + /usr/share/icedove/* + * drop searchplugin link which even had a typo :) + * debian/icedove.menu: ship debian menu entry + (Closes: 425224) + + -- Alexander Sack Sat, 20 May 2007 16:48:00 +0200 + +icedove (2.0.0.0-2) unstable; urgency=low + + * adding icedove-dbg package + + -- Alexander Sack Sat, 19 May 2007 17:33:00 +0200 + +icedove (2.0.0.0-1) unstable; urgency=low + + * icedovising + * add debian/remove.nonfree + * set upstream application fixed to 'thunderbird' in update-orig, + so you can just drop thunderbird tarball and produce new orig + * fix debian/control.in, drop transition packages. update debian/control + for these modifications. + * no autogen of configure and debian/control for release + + -- Alexander Sack Thu, 17 May 2007 14:00:00 +0200 + +thunderbird (1.99.rc1+2.0-1) feisty; urgency=low + + * branch firefox-trunk package for 2.0 thunderbird package + * debian/control.in, debian/control: add transition packages: + mozilla-thunderbird, mozilla-thunderbird-dev; disable dom-inspector + package as there is nearly no hope that it ever will get maintained + upstream again. + * debian/rules: remove inspector extension from configure; add excludes + to dh_install of thunderbird and thunderbird-dev package: + - + DEB_DH_INSTALL_ARGS_thunderbird := -Xgnome -Ximgicon -Xmozlibthai + DEB_DH_INSTALL_ARGS_thunderbird-dev := -Xnspr -Xnss + + -- Alexander Sack Wed, 18 Apr 2007 13:35:34 +0200 + +icedove (1.5.0.10.dfsg1-3) unstable; urgency=low + + * debian/icedove*.xpm updated to use correct icon + (Closes: 413976, 416476) + * debian/patches/25_gnome_helpers_with_params.dpatch: + Make helper applications with parameters work (bz#273524); + this is an improved version of bugzilla patch by Mike Hommey + + + -- Alexander Sack Wed, 28 Mar 2007 21:55:08 +0200 + +icedove (1.5.0.10.dfsg1-2) unstable; urgency=low + + * debian/tmpls-typeaheadfind/install.rdf: fix version depends of + typeaheadfind (Closes: 413770) + + -- Alexander Sack Wed, 7 Mar 2007 13:13:13 +0100 + +icedove (1.5.0.10.dfsg1-1) unstable; urgency=low + + * new upstream release fixing security issues: + - CVE-2007-0008, MFSA 2006-06: SSLv2 Client Integer Underflow + Vulnerability + - CVE-2007-0009, MFSA 2006-06: SSLv2 Server Stack Overflow + Vulnerability + - CVE-2007-0775, CVE-2007-0776, CVE-2007-0777, MFSA 2007-01: + Crashes with evidence of memory corruption + * 91_credits_icedove.dpatch: dump new xml entities from + credits dialog (Closes: 404984, 412423) + * 50_kbsd_nspr.dpatch, 50_kbsd.dpatch: adapt kbsd patches to apply to + latest upstream code-base + + [ Christian Perrier ] + + * Rewrite debconf templates to fit the current Developer's Reference + recommendations + * Correct the name of the debconf templates file in debian/po/POTFILES.in + Closes: #407220 + * Debconf translations: + - Bulgarian added. Closes: #410627 + - Basque updated. Closes: #410633 + - German updated. Closes: #410672 + - Catalan updated. Closes: #410676 + - Spanish updated. Closes: #410709 + - Galician updated. Closes: #410720, #407944 + - Japanese updated. Closes: #410753 + - Tamil added. Closes: #410892 + - Portuguese updated. Closes: #409562 + - Vietnamese updated. + - Malayalam added. Closes: #408109 + - Russian updated. Closes: #411064, #405741 + - Swedish. Closes: #410632 + - Polish. Closes: #411302 + - Fix typo in Italian translation. Closes: #363806 + - Romanian. Closes: #411361 + - Czech. Closes: #411409 + - Danish. Closes: #411402 + - Dutch. Closes: #411406 + - Italian. Closes: #411452 + - Brazilian Portuguese. Closes: #411538 + - Korean. Closes: #411624, #411581 + - Malayalam. Closes: #411647 + - Finnish. Closes: #411765 + + -- Alexander Sack Fri, 23 Feb 2007 09:00:00 +0100 + +icedove (1.5.0.10.dfsg1-1.1) unstable; urgency=low + + * Non-maintainer upload to fix pending l10n issues. + * Debconf translations: + - Italian fixed. Closes: #363806 + - Russian added. Closes: #405741 + - Galician added. Closes: #407944 + - Malayalam added. Closes: #408109 + - Portuguese updated. Closes: #409562 + + -- Christian Perrier Tue, 6 Feb 2007 06:55:08 +0100 + +icedove (1.5.0.9.dfsg1-1) unstable; urgency=high + + * new upstream version, fixes various security issues: + - CVE-2006-6497 mfsa2006-68 layout engine + - CVE-2006-6498 mfsa2006-68 javascript engine + - CVE-2006-6499 mfsa2006-68 floating point + - CVE-2006-6500 mfsa2006-69 + - CVE-2006-6501 mfsa2006-70 + - CVE-2006-6502 mfsa2006-71 + - CVE-2006-6503 mfsa2006-72 + - CVE-2006-6504 mfsa2006-73 + - CVE-2006-6505 mfsa2006-74 + - CVE-2006-6506 mfsa2006-75 + - CVE-2006-6507 mfsa2006-76 + * landing icedove artwork contributed by Ricardo Fernández + ; svgs are in debian/branding. xpms and some + pngs are generated with rsvg-convert and convert -> adding + build-depends to librsvg2-bin, imagemagick + * including es.po translation contributed by Felipe Caminos + (Closes: 402928) + * updateing pt_BR.po provided by André Luís Lopes + (Closes: 403827) + * adapting credits dialog and Icedove Motto in 91_credits_icedove.dpatch + * fix bad link in icedove manpage (icedove.sgml) (Closes: 398344) + * rebranding install.rdf of default theme for icedove in + 91_rebranding_theme.dpatch (Closes: 393134) + * adapt README.Debian to new icedove directories and name + * clean old/not-needed files from debian/ directory: + theme.part.defaultclassic, mail-jar.mn, messenger_jar_includes.csv + * disabling patch: 99_bz360409_deb400383, which is applied + upstream now. + + -- Alexander Sack Tue, 19 Dec 2006 12:00:00 +0100 + +icedove (1.5.0.8.dfsg1-1) unstable; urgency=medium + + * removing all currently known non-free and sourceless binaries + from source package by running the script included for + reference in debian/remove.nonfree from the gnuzilla project + (Closes: 400340) + * added upstream approved quickfix for grave bug in + debian/patches/99_bz360409_deb400383.dpatch (Closes: 400383) + * last chance kbsd upload ... reenabling kbsd patch with fix + by Petr Salinger (Closes: 399692) + * remove missed non-free icons from + debian/fhunderbird-branding.tmpl/ : background.png.uu, disk.icns.uu + + -- Alexander Sack Sun, 26 Nov 2006 19:00:00 +0100 + +icedove (1.5.0.8-3) unstable; urgency=low + + * disable kbsd patches in 00list because they appear to break + build on other platforms. In consequence, 399692 and 363865 + will be reopened. Reenable 90_ppc64-build-fix (Closes: 400090) + + -- Alexander Sack Mon, 22 Nov 2006 15:10:00 +0100 + +icedove (1.5.0.8-2) unstable; urgency=low + + * fix mozilla.in for real (for transitional thunderbird link + (Closes: 393123, 398037) + * apply basque debconf translation (eu.po) for real + (Closes: 398468) + * included nl.po provided by Nick Niktaris + renaming as icedove first (Closes: 378360) + * include greek translation in icedove.desktop provided by + Nick Niktaris (Closes: 384359) + * include updated de.po translation provided by + Alwin Meschede (Closes: 399083) + * apply FTBFS on GNU/kFreeBSD porters patch provided by + Petr Salinger (Closes: 399692), + which is claimed to provide a fix for ppc64 ftbfs too + (Closes: 363865) + * remove debug echo from icedove.preinst (Closes: 399723) + + -- Alexander Sack Mon, 21 Nov 2006 19:35:00 +0100 + +icedove (1.5.0.8-1) unstable; urgency=medium + + * new upstream version fixes various security issues + * added transition package: thunderbird-gnome-support + -> icedove-gnome-support as well as thunderbird-dbg + -> icedove-dbg (Closes: 393105) + * fix typo in postinst to fix browser integration scheme + recognition as selected by debconf (Closes: 393765, 398427) + * apply patch by Ted Percival to fix broken + transitional thunderbird symlink (Closes: 393123, 398037) + * apply patch by Andre Lehovich that fixes + icedove package description typos (Closes: 398468) + * add basque debconf translation (eu.po) provided by Piarres + Beobide (Closes: 398719) + * remove non-free rfc files from source tarball (Closes: 395095) + + -- Alexander Sack Wed, 15 Nov 2006 18:00:00 +0100 + +icedove (1.5.0.7-3) unstable; urgency=medium + + * unbrand thunderbird mail -> Icedove Mail/News due + to trademark issues (Closes: 354622) + + -- Alexander Sack Thu, 12 Oct 2006 13:00:00 +0100 + +thunderbird (1.5.0.7-2) unstable; urgency=low + + * go through new upload ... reenable thunderbird-dbg + * increase reference count for fontconfig charset + 91_fontconfig_reference_increment_388739 (Closes: 388739) + + -- Alexander Sack Wed, 27 Sep 2006 02:00:00 +0100 + +thunderbird (1.5.0.7-1) unstable; urgency=high + + * disabled new package to avoid queue new: thunderbird-dbg + * new upstream release fixes security issues: + + MFSA 2006-64 - CVE-2006-4571 + + MFSA 2006-63 - CVE-2006-4570 + + MFSA 2006-62 - CVE-2006-4569 + + MFSA 2006-61 - CVE-2006-4568 + + MFSA 2006-60 - CVE-2006-4340 (related to CVE-2006-4339) + + MFSA 2006-59 - CVE-2006-4253 + + MFSA 2006-58 - CVE-2006-4567 + + MFSA 2006-57 - CVE-2006-4565, CVE-2006-4566 + * disable patch 90_gcc-extern-fix, because it has been pulled in upstream + * disable 91_271815.overthespot.v1.2, because applied upstream + + -- Alexander Sack Fri, 15 Sep 2006 16:00:00 +0100 + +thunderbird (1.5.0.5-2) unstable; urgency=low + + * new package: thunderbird-dbg + + improve configure options + + enable svg + + use debian build options to determine optimization flags + * added build depends on libcairo-dev + + -- Alexander Sack Sat, 12 Aug 2006 15:00:00 +0100 + +thunderbird (1.5.0.5-1) unstable; urgency=high + + * new upstream release fixes various security flaws: + + MFSA 2006-44, CVE-2006-3801 + + MFSA 2006-46, CVE-2006-3113 + + MFSA 2006-47, CVE-2006-3802 + + MFSA 2006-48, CVE-2006-3803 + + MFSA 2006-49, CVE-2006-3804 + + MFSA 2006-50, CVE-2006-3805, CVE-2006-3806 + + MFSA 2006-51, CVE-2006-3807 + + MFSA 2006-52, CVE-2006-3808 + + MFSA 2006-53, CVE-2006-3809 + + MFSA 2006-54, CVE-2006-3810 + + MFSA 2006-55, CVE-2006-3811 + * including patch 91_271815.overthespot.v1.2.dpatch + (Closes: 379936, 363814) + * improve manpage: Document -g, --debug options (Closes: 381096) + * update for ja.po, contributed by Kenshi Muto + (Closes: 379946) + * update for pt.po, contributed by Rui Branco + (Closes: 381444) + * Provide virtual package news-reader (Closes: 363834) + * Apply patch which introduces ReplyToList MessageType. This is + the base to allow extensions that provide ReplyToList button to + get installed. Thanks to Armin Berres + for pointing out this unintrusive patch. (Closes: 381273) + * fix README.Debian for firefox integration as well as example of + global pref.js (firefox.js.tmpl) (Closes: 363723) + * further improvements for README.Debian + * fix gnome integration program path in a hard-coded fashion + in 91_gnome_path_fix.dpatch (Closes: 365610) + + -- Alexander Sack Sat, 12 Aug 2006 15:00:00 +0100 + +thunderbird (1.5.0.4-3) unstable; urgency=critical + + * fixing gcc-4.1 ftbfs (Closes: 377176) + * improved manpage by Bastian Kleineidam + documenting -safe-mode option (Closes: 370254) + * include *no xgot* patch for mips/mipsel contributed by + Thiemo Seufer (Closes: 374882) + + -- Alexander Sack Thu, 13 Jul 2006 15:00:00 +0100 + +thunderbird (1.5.0.4-2) unstable; urgency=critical + + * fix version in install.rdf for inspector and + typeaheafind (Closes: 374382) + * (last one was a new upstream release fixing + various security issues (Closes: 373878, 373553) + * urgency=critical + + -- Alexander Sack Mon, 19 Jun 2006 10:00:00 +0100 + +thunderbird (1.5.0.4-1) unstable; urgency=low + + * new upstream release fixing various security issues: + MFSA 2006-42, CVE-2006-2783: Web site XSS using BOM on UTF-8 pages + MFSA 2006-40, CVE-2006-2781: Double-free on malformed VCard + MFSA 2006-38, CVE-2006-2778: Buffer overflow in crypto.signText() + MFSA 2006-37, CVE-2006-2776: Remote compromise via content-defined + setter on object prototypes + MFSA 2006-35, CVE-2006-2775: Privilege escalation through XUL persist + MFSA 2006-33, CVE-2006-2786: HTTP response smuggling + MFSA 2006-32, CVE-2006-2779, CVE-2006-2780: Fixes for crashes with + potential memory corruption + MFSA 2006-31, CVE-2006-2787: EvalInSandbox escape (Proxy Autoconfig, + Greasemonkey) + * build depends: + + xorg-dev -> libx11-dev, libxt-dev, libxinerama-dev, + libxft-dev, libfreetype6-dev, libxrender-dev + + removed binutils, coreutils and po-debconf + * enable xinerama in debian/rules + * fixed lintian errors: + + do not depend on xorg dev meta package + + debhelper depend is now versioned + + changed package description(s) to not start with 'thunderbird' + + -- Alexander Sack Tue, 23 May 2006 15:00:00 +0100 + +thunderbird (1.5.0.2-3) unstable; urgency=low + + * patch-robbery from firefox package: + + removed old mips and arm patches + + added 50_arch_arm_fix + + added 50_arch_alpha_fix + + added 50_arch_m68k_fix + + added 50_arch_mips_Makefile_fix + + added 50_arch_mips_fix (Closes: 357755) + + added 50_arch_parisc_Makefile_fix + + added 50_arch_parisc_fix + * included install.rdf for default theme in extensions dir + (Closes: 363956) + * removed chrome.d locales.d extensions.d from var/lib/thunderbird + + -- Alexander Sack Tue, 16 May 2006 19:45:00 +0100 + +thunderbird (1.5.0.2-2) unstable; urgency=critical + + * debian/thunderbird.sgml. Greatly improved manpage for thunderbird, + thanks to Sam Morris for contributing this + (Closes: 361069) + * add missing build depend to sharutils to fix ftbfs (Closes: 365539) + * fix gnome-support package removing gnome dependencies from + pure thunderbird package. + * set urgency to critical which I forgot to set properly + for the last upload + + -- Alexander Sack Sat, 29 Apr 2006 14:00:00 +0100 + +thunderbird (1.5.0.2-1) unstable; urgency=low + + * removed enable xprint in order to build after X11R7 transition. + * removed xprint recommends from control file. + * 91_fontsfix_359763.dpatch: fix for 'thunderbird shows text illegibly' + for some encodings. (Closes: 359763) + * myspell is now depends (Closes: 357623) + * (re-)including 10_mips_optimization_patch + * debian/patches/90_ppc64-build-fix.dpatch: patch for + 'FTBFS (ppc64)', thanks to Andreas Jochens + for adding the final patch to the report. (Closes: 361036) + * Thanks to Bastian Kleineidam for + contributing: + * Standards version 3.6.2.1 + * Use debhelper v5 with debian/compat + * Remove unneeded thunderbird.conffiles now that debhelper v5 is used + * Remove CVS directories in debian/ + * Fix debian/changelog syntax errors, and convert to UTF-8 + * Fix bashism in debian/thunderbird.postrm, using 2> instead of &>. + * Add ${misc:Depends} to thunderbird* dependencies, fixing a missing + dependency on debconf + * Move db_input commands from postinst into a separate thunderbird.config + file. + * distinct gnome-support package added. adds a good bunch + of gnome build depends to allow module linking against + gnome libs. + * added new fhunderbird-branding in debian/fhunderbird-branding.tmpl + (Closes: 358198) + * use only one profile directory in configure + (Closes: 358378) + * Various security issues are fixed in this release. Namely: + CVE-2006-1741 CVE-2006-1742 CVE-2006-1737 CVE-2006-1738 + CVE-2006-1739 CVE-2006-1740 CVE-2006-1736 CVE-2006-1735 + CVE-2006-1734 CVE-2006-1733 CVE-2006-1732 CVE-2006-0749 + CVE-2006-1731 CVE-2006-1724 CVE-2006-0884 CVE-2006-1730 + CVE-2006-1729 CVE-2006-1728 CVE-2006-1727 CVE-2006-1045 + CVE-2006-0748 CVE-2006-1726 CVE-2006-1725 CVE-2005-2353 + CVE-2006-1529 CVE-2006-1530 CVE-2006-1531 CVE-2006-1723 + CVE-2006-0292/CVE-2006-0293 (Closes: 349242) + CVE-2006-0294 CVE-2006-0295 CVE-2006-0296 CVE-2006-0297 + CVE-2006-0298 CVE-2006-0299 + + -- Alexander Sack Thu, 20 Mar 2006 21:00:00 +0100 + +thunderbird (1.5-4) unstable; urgency=low + + * great package renaming release: mozilla-thunderbird -> thunderbird + * removed not maintained and not needed update-mozilla-thunderbird + facilities. Extensions/locales etc. don't need to call this anymore + in order to install themselves globally. + * added -fno-strict-aliasing -fno-unsigned-char as parameters to build + * patch: 10_visibility_hidden_patch.dpatch - by Adam Conrad + * new upstream version fixes various bugs + (Closes: 288601, 291912, 295662) + * included new fr.po translation by Mohammed Adnène Trojette + (Closes: 323367) + * included new cs.po translation by Jan Outrata + (Closes: 321736, 335354) + * included new pt.po translation by Traduz! + (Closes: 348440) + * included new da.po translation by Claus Hindsgaul + (Closes: 350687) + * added intl.locale.matchOS, true to debian/global-config.js instead + of hacking startup script + + -- Alexander Sack Tue, 28 Feb 2006 15:00:00 +0100 + +mozilla-thunderbird (1.5-2) experimental; urgency=low + + * reenable patch 20_mailnews_mime_makefile_in.dpatch + to export proper headers to -dev package for enigmail + * last upload with old package name + + -- Alexander Sack Thu, 12 Jan 2006 15:00:00 +0100 + +mozilla-thunderbird (1.5-1) experimental; urgency=low + + * experimental upload of 1.5 (Closes: 348007) + * major package housekeeping + + removed extension template pieces + + bye -offline extension release - this is now completely + integrated in thunderbird default install + + disable all patches ... but those that are obviously + needed - please shout if you got struck by a regression + due to this :). + + use upstream startup script in the hope that they + did fix it! + + branding removed again. Keep it white labeled - for + now. + + -- Alexander Sack Thu, 12 Jan 2006 15:00:00 +0100 + +mozilla-thunderbird (1.0.7-3) unstable; urgency=high + + * apply backported patch for amd64 (Closes: 332481,332484) + Thanks to Martin Sarsale + for testing and preparing the patch + + debian/patches/91_gcc4_imgLoader.fix.dpatch + * updated vietnam translation contributed by Clytie Siddall + (Closes: 324224) + * added swedish translation contributed by Daniel Nylander + (Closes: 331606) + + -- Alexander Sack Mon, 17 Oct 2005 23:30:00 +0100 + +mozilla-thunderbird (1.0.7-2) unstable; urgency=high + + * still high to indicate that security bugs have not been + fixed in etch. + * apply debian/patches/90_xptcinvoke_arm.dpatch to fix ftbfs on + arm/sid + + -- Alexander Sack Mon, 10 Oct 2005 19:00:00 +0100 + +mozilla-thunderbird (1.0.7-1) unstable; urgency=high + * MFSA-2005-57: IDN heap overrun + Summary: Tom Ferris reported a Firefox crash when processing a domain + name consisting solely of soft-hyphen characters. + Closes: - + CVE-Ids: CAN-2005-2871 + Bugzilla: 307259 + Issues addressed: + + CAN-2005-2871 - IDN heap overrun + * MFSA-2005-58: Accumulated vendor advisory for multiple vulnerabilities + Summary: Fixes for multiple vulnerabilities with an overall severity + of "critical" have been released in Mozilla Firefox 1.0.7 and + the Mozilla Suite 1.7.12 + Closes: - + CVE-Ids: CAN-2005-2701 CAN-2005-2702 CAN-2005-2703 CAN-2005-2704 + CAN-2005-2705 CAN-2005-2706 CAN-2005-2707 + Bugzilla: 300936 296134 297078 302263 299518 303213 304754 306261 + 306804 291178 300853 301180 302100 + Issues addressed: + + CAN-2005-2701 - Heap overrun in XBM image processing + + CAN-2005-2702 - Crash on "zero-width non-joiner" sequence + + CAN-2005-2703 - XMLHttpRequest header spoofing + + CAN-2005-2704 - Object spoofing using XBL + + CAN-2005-2705 - JavaScript integer overflow + + CAN-2005-2706 - Privilege escalation using about: scheme + + CAN-2005-2707 - Chrome window spoofing + + Regression fixes + * MFSA-2005-59: Command-line handling on Linux allows shell execution + -> was addressed in 1.0.6-4 already. Reverting upstream changes + to mozilla/mail/mozilla.in by copying debian/mozilla.in_1.0.6 over + to allow our patches to still apply. debian/patches/01_old_mozilla.in.dpatch + + -- Alexander Sack Sat, 1 Oct 2005 17:00:00 +0100 + +mozilla-thunderbird (1.0.6-4) unstable; urgency=high + + * now using bash to overcome possible security flaws of + our thunderbird start script (mozilla-thunderbird). Patch + by Florian Weimer + debian/mfsa_2005-59.debian.patch (Closes: 329664, 329667) + * added patch 50_ftbfs_alpha+arm+ia64_325536_fix.dpatch + to build on alpha, arm, and ia64 that now uses + __attribute__((used)) instead of ((unused)) by + Steve Langasek + (Closes: 325536) + * fix debsums error reported by Y Giridhar Appaji Nag + . Now removing files in postrm. + Further moved /usr/lib/mozilla-thunderbird/chrome/chrome.rdf + to the /var/... adding a link to the new location. + (Closes: 292475) + * added depends for system libs: mng, png, jpeg to not build with + unmaintained image included libs. + * modified 21_mozilla_in-patch.dpatch to recognize -mail as a -compose + alias. This makes thunderbird work well with current gnome default + mailto: command for thunderbird. Thanks to Sam Morris + for the workaround patch (Closes: 330168) + * still work left: fix window.open(); overlay problem. + added rejar-chrome.sh util script below debian. It + rejars .jar files by extracting paths given in + _jar_includes.csv from the .jar zip file + and zipping only those files to a new jar file again. Anyway, still + broken, thus disabled for this build. + (See: 306522) + + -- Alexander Sack Mon, 23 Sep 2005 17:00:00 +0100 + +mozilla-thunderbird (1.0.6-3) unstable; urgency=low + + * remove gcc-3.4 from amd64 build ... this time for sure + (Closes: 320723) + * remove special optimization flags for other archs too + + -- Alexander Sack Mon, 2 Aug 2005 17:00:00 +0100 + +mozilla-thunderbird (1.0.6-2) unstable; urgency=low + + * remove gcc-3.4 from amd64 build (Closes: 320723) + * added arabic po translation by Mohammed Adnène Trojette + (Closes: 320771) + + -- Alexander Sack Mon, 1 Aug 2005 17:00:00 +0100 + +mozilla-thunderbird (1.0.6-1) unstable; urgency=high + + * GCC/G++ 4.0 API transition upload. + * include 90_new_freetype_fix.dpatch to fix new freetype API + (Closes: 301481, 301481) - consumed from mozilla-firefox packages ... + thx to Eric Dorland + * include 90_gcc4_fix.dpatch + * fixes multiple security bugs (Closes: 318728) + CAN-2005-2270: Code execution through shared function objects + CAN-2005-2269: XHTML node spoofing + CAN-2005-2266: Same origin violation: frame calling top.focus() + CAN-2005-2265: Possible exploitable crash in InstallVersion.compareTo() + CAN-2005-2261: XML scripts ran even when Javascript disabled + CAN-2005-1532: Privilege escalation via non-DOM property overrides + CAN-2005-1160: Privilege escalation via DOM property overrides + CAN-2005-1159: Missing Install object instance checks + CAN-2005-0989: Javascript "lambda" replace exposes memory contents + * fix gdk_property_get problem that might cause a segfault (Closes: 317937) + patch by Loic Minier + debian/patches/gdk_property_get.dpatch + * fix CAN-2005-2353: insecure tmp file usage in run-mozilla.sh (Closes: 306893) + debian/patches/20_run-mozilla_sh_306893_fix.dpatch + * include german de.po translation (Closes: 318747) + by Alwin Meschede + * fixed whitespace in mozilla-thunderbird.templates (Closes: 308961) + hint by Clytie Siddall + * apply fix for seamonkey migration crash (Closes: 285728) + 90_mail_components_miration_src_nsSeamonkeyProfileMigrator_cpp + * fix 'find' in update-mozilla-thunderbird-chrome (Closes: 315588) + patch by Michael Spang + + -- Alexander Sack Thu, 21 Jul 2005 21:00:00 +0100 + +mozilla-thunderbird (1.0.2-3) unstable; urgency=high + + * last maybe sarge upload with urgency high, contains only + translations (po files + gnome .desktop file lines) + + cs translation by Jan Outrata + (Closes: 309023) + + fi translation by Matti Pöllä + (Closes: 303805) + + ja translation by Kenshi Muto + (Closes: 307005) + + pt_BR translation by Andre Luis Lopes + (Closes: 304261) + + vi translation by Clytie Siddall + (Closes: 308959) + + added missed translation entries in gnome .desktop files + for it, ko, pl + + -- Alexander Sack Thu, 02 Jun 2005 22:00:00 +0100 + +mozilla-thunderbird (1.0.2-2) unstable; urgency=low + + * fixed TYPO in 71_extensionManagerAutoReRegister.dpatch, + probably causing #302218 (Closes: 302218) + * extended patch 71_extensionManagerAutoReRegister.dpatch, + now checking components.ini timestamp instead of + compreg.dat timestamp. removing components.ini compreg.dat + and XUL.mfasl if global Extensions.rdf file is newer then + components.ini. Probably helping to fix #302218 too. + * renamed xprt-xprintorg recommends to xprint (Closes: 300975) + * (re-)enabled pref extension (Closes: 302130) + + -- Alexander Sack Thu, 31 Mar 2005 07:00:00 +0100 + +mozilla-thunderbird (1.0.2-1) unstable; urgency=medium + * new upstream version (Closes: 301542) fixes some + security issues according to upstream + (http://www.mozilla.org/projects/security/known-vulnerabilities.html) + 1.0.2 fixes the following security related issues. + + MFSA 2005-30 GIF heap overflow parsing Netscape extension 2 + MFSA 2005-25 Image drag and drop executable spoofing + MFSA 2005-21 Overwrite arbitrary files downloading .lnk twice + MFSA 2005-18 Memory overwrite in string library + MFSA 2005-17 Install source spoofing with user:pass@host + MFSA 2005-15 Heap overflow possible in UTF8 to Unicode conversion + + -- Alexander Sack Sun, 27 Mar 2005 16:00:00 +0100 + +mozilla-thunderbird (1.0-4) unstable; urgency=low + + * removed not needed build-deps: csh + * included debconf (and gnome .desktop file) translations for + various languages: (Closes: 292072, 294622, 291477, 292507) + + debian/po/fr.po (Mohammed Adnène TROJETTE , + Aurelien Jarno ) + + debian/po/nl.po (Luk Claes ) + + debian/po/ca.po (Jordi Mallach ) + + debian/po/ko.po (Yooseong Yang ) + + debian/po/it.po (Vittorio Palmisano ) + + debian/po/pl.po (Robert Luberda ) + * fixed startscript problem + - updated 21_mozilla_in-patch.dpatch - thanks to + Kevin B. McCarty + * moved code of component debCleanComp.js to + nsExtensionManager, so it can automatically restart the + application if needed. + This should again lower the probabilty that + some upgrade, downgrade of thunderbird or extensions + breaks the chrome or component registry in your profile + dir. + + -- Alexander Sack Sun, 13 Mar 2005 13:00:00 +0100 + +mozilla-thunderbird (1.0-3) unstable; urgency=low + + * first upload to official archive for tbird 1.0 + (first since 0.9-6) + * finally I decided to upload this package to unstable, + though there is a debian-legal discussion going on + about the mozilla trademark. Since it might take some + time until a solution is found, I decided to upload + as usual. + * started to debrand the app to 'Debian Thunderbird' + + -- Alexander Sack Sun, 16 Jan 2005 14:00:00 +0100 + +mozilla-thunderbird (1.0-2) unstable; urgency=low + + * Uninstall file and dummy-empty-file must not be empty + * Included latest patch for extension manager + * Included Jaap Haitsma icons (Closes: 257640) + * fixed regression compared to 0.9-6 official package + that had problems to build because empty files where + not included in diff.gz + + -- Alexander Sack Fri, 10 Dec 2004 23:00:00 +0100 + +mozilla-thunderbird (1.0-1) unstable; urgency=low + + * new upstream release - 1.0 (Closes: 284560) + * includes new icons as default theme + * changed start.html page to not use the mozilla partical + in the package naming. This app is now officially called + 'Debian Thunderbird' + * removed -O from sparch arch (See: 284532) + * README.Debian improved + * adapted new manpage inspired by Ralf Katz + + -- Alexander Sack Tue, 08 Dec 2004 12:00:00 +0100 + +mozilla-thunderbird (0.9-7) unstable; urgency=low + + * added debconf capability to define what browser + integration is wanted + -> added /etc/mozilla-thunderbird/auto-config.js + to store automatically generated configs by debconf + + -- Alexander Sack Thu, 24 Nov 2004 12:00:00 +0100 + +mozilla-thunderbird (0.9-6) unstable; urgency=low + + * fixed bug in preinst script by strictly testing + the existance of files before invoking mv + operations (Closes: 282186) + * fixed stupid upgrade bug in preinst script. + ls uses now -d to produce no garbage when + used as source for moving. This closes + a bug reported against enigmail, but is a + bug of the thunderbird package. This release + fixes it (Closes: 282505) + * still missing reply for current grave bug + 282506. I think this is due to the initial + upgrade problems. Those problem should not + occur anymore with the fixes of this packages + upgrade mechanism (Closes: 282506) + + -- Alexander Sack Thu, 24 Nov 2004 12:00:00 +0100 + +mozilla-thunderbird (0.9-5) unstable; urgency=low + + * added patch by Kevin B. McCarty + adds In-Reply-To mailto: link capability (Closes: 268055) + * late verification of bug fixed by preview package: + fixes: message editor steals keyboard focus (Closes: 274313) + + -- Alexander Sack Thu, 18 Nov 2004 12:00:00 +0100 + +mozilla-thunderbird (0.9-4) unstable; urgency=low + + * fixed upgrade bug - when /usr/lib/mozilla-thunderbird/extensions + is a link, remove it and create a directory for it! After that + move all extensions from /var/lib/mozilla-thunderbird/extensions + to the new folder. + * added example firefox-config.js.tmpl to use the new wrapper + script. This config should only be used if you are in a non + gconf capable window environment, e.g. pure openbox, etc. + See the README.Debian for further details on howto integrate + thunderbird properly. + * added uninstall and extension directory for default theme + extension. This should make it possible to remove the package + cleanly. + * Bug#280254: mozilla-thunderbird: Please package + thunderbird 0.9 (Closes: 280076) + * patch by Kevin McCarty , fixes + Subject munging if thunderbird is running (Closes: 263971) + * fixed: typo in welcome message for preview pane (Closes: 278690) + * thx to bug submitters that verified the fix of the following + bugs in my preview package at people.debian.org: + + Bug#277304: mozilla-thunderbird: thunderbird dies silently on + some mails (Closes: 277304) + + no sound when new mail arrives (Closes: 274044) + + Focus Problem when a filter is selected (Closes: 272157) + + "Get Mail" button fails intermittently on additional accounts + (Closes: 280482) + * added patch to fix /tmp/ file permissions during processing of + imap directory (Closes: 280363) + * cleaning up compreg.dat on Extensions.rdf change, so after + restart all troubles with this issue are gone (Closes: 273213) + * Already since 0.9-1, but I forgot to mention: + + set default smtp server option should work now + (Closes: 274177) + + with view filter: unread on, newly read messages are + not removed from the message list anymore (Closes: 275708) + * other bugs resolved by upstream: + + problems while threads refresh (Closes: 239203) + + Shortcuts conflict with ISO 14755 (Closes: 246916) + + -- Alexander Sack Mon, 15 Nov 2004 22:45:00 +0100 + +mozilla-thunderbird (0.9-3) unstable; urgency=low + + * rm -f /usr/lib/mozilla-thunderbird/extensions + in postinst if it is a link! After that move + stuff from /var/lib/mozilla-thunderbird/extensions + to /usr/lib/mozilla-thunderbird/extensions. + The rest will be done by update-mozilla-thunderbird-chrome + + -- Alexander Sack Thu, 11 Nov 2004 22:45:00 +0100 + +mozilla-thunderbird (0.9-2) unstable; urgency=low + + * fixed bad bug in mozilla-thunderbird.install, + that removed the fulls extensions dir + * fixed broken upgrade problem due to + mozilla-thunderbird-inspector that tried to + install resource files under /usr/lib/.../res, + but that is a link. Now storing under /usr/share/ + + -- Alexander Sack Wed, 10 Nov 2004 22:00:00 +0100 + +mozilla-thunderbird (0.9-1) unstable; urgency=low + + * new upstream version (0.9) + * include patch amd64: + by Frederik Schueler + -> use gcc-3.4,g++3.4 (Closes: 261365) + * pasting issues partially fixed (See: 279656) + * Local Folders needed, cannot be deleted anymore + (Closes: 226253) + * including great patch of Mike Hommey + who brought the final fix for the extension manager + problems; changed update-mozilla-thunderbird-chrome + according to the new -register capability + + -- Alexander Sack Wed, 10 Nov 2004 20:00:00 +0100 + +mozilla-thunderbird (0.8-3) unstable; urgency=medium + + * respin for new binutils version (Closes: 273354) + * removing essential and build-essential build + dependencies to: base-files, libc6-dev + * update-mozilla-thunderbird-chrome: output of find(s) + to /dev/null (Closes: 267661) + * included mozilla-thunderbird-compose script in docs + section + + -- Alexander Sack Sat, 26 Sep 2004 13:00:00 +0100 + +mozilla-thunderbird (0.8-2) unstable; urgency=medium + + * include good build_id during build fixes + upgrade problems + (Closes: 272175, 272182) + * fixed some startup-script regressions. Remote + commands are almost ready by upstream. Only + -compose argument is interpreted in a debian + specific way. Of course, locale settings + are still debian specific too. + * improved changelog to list important notes + for upgrading to 0.8 + * 10_mips_optimization_patch.dpatch: + thiemo seufers mips(el) workaround + removing CFLAGS="$CFLAGS -Wa,-xgot" and + CXXFLAGS="$CXXFLAGS -Wa,-xgot" and adding + inline when DEBUG is true (Closes: 272162). + + -- Alexander Sack Sat, 18 Sep 2004 21:00:00 +0100 + +mozilla-thunderbird (0.8-1) unstable; urgency=medium + + * new upstream version 0.8 + * fixes various security issues in sarge and sid + (Closes: 263752) + * hacked a tiny patch for nsExtensionManager.js.in bug that + lets thunderbird (and firefox) loop on startup if + launched with non-root account. + + -- Alexander Sack Fri, 17 Sep 2004 10:00:00 +0100 + +mozilla-thunderbird (0.7.3-6) unstable; urgency=high + + * still fixes the security bug in sarge (see #263752) + ... thus urgency=high + * applied 50_mozilla-thunderbird-xpcom-xptcall-mips.dpatch + provided by Thiemo Seufer + (Closes: 267017) + * removed as Uploader as he expressed + that he has no more time to co-maintaining this package. + Thanks for your work! + + -- Alexander Sack Sun, 12 Sep 2004 17:30:00 +0100 + +mozilla-thunderbird (0.7.3-5) unstable; urgency=high + + * ping tbird to find a running instance instead of searching + for lock file that could still be there after a crash (redone) + (Closes: 267144) + * still fixes the security bug in sarge ... thus urgency=high + + -- Alexander Sack Thu, 21 Aug 2004 14:00:00 +0100 + +mozilla-thunderbird (0.7.3-4) unstable; urgency=high + + * ping tbird to find a running instance instead of searching + for lock file that could still be there after a crash + (Closes: 267144) + * still fixes the security bug in sarge ... thus urgency=high + + -- Alexander Sack Thu, 21 Aug 2004 14:00:00 +0100 + +mozilla-thunderbird (0.7.3-3) unstable; urgency=high + + * extended patch for mips: 50_xpcom_xptcall_xptcstubs_asm_mips_s + (Closes: 266851) + * still fixes the security bug in sarge ... thus urgency=high + + -- Alexander Sack Thu, 19 Aug 2004 17:00:00 +0100 + +mozilla-thunderbird (0.7.3-2) unstable; urgency=high + + * included patch for mips: 50_xpcom_xptcall_xptcstubs_asm_mips_s + * made global-config.js more up to date (Closes: 261815) + * recommend myspell-en-us | myspell-dictionary (Closes: 265272) + * enigmail is now suggested and not recommended anymore + * still fixes the security bug in sarge ... thus urgency=high + + -- Alexander Sack Wed, 18 Aug 2004 16:00:00 +0100 + +mozilla-thunderbird (0.7.3-1) unstable; urgency=high + + * new upstream release 0.7.3 - fixes security issues + (Closes: 263752) + * changed maintainer email to debian address + * removing /var/lib/mozilla-thunderbird dir on purge + (Closes: 260212). + * reverting gcc-3.2 and g++-3.2 for hppa architecture to back to + default gcc/g++ compiler + * fixed package description of mozilla-thunderbird-inspector and + mozilla-thunderbird-offline (Closes: 260374, 260376) + * plain mozilla-thunderbird now opens Inbox window to front + instead of profile manager when already running (Closes: 259476) + + -- Alexander Sack Wed, 04 Aug 2004 20:00:00 +0100 + +mozilla-thunderbird (0.7.1-3) unstable; urgency=low + + * updated README.Debian to be more specific + on the lost profile workaround! + * added 10_profile_migration.dpatch to fix + profile migration issues (Closes: 258741, 258747) + * updated .desktop file Comment (Closes: 257596) + * trying gcc-3.2 and g++-3.2 for hppa architecture + + -- Alexander Sack Tue, 13 Jul 2004 11:00:00 +0100 + +mozilla-thunderbird (0.7.1-2) unstable; urgency=low + + * added 10_profile_migration.dpatch to fix + profile migration issues (Closes: 258741, 258747) + * updated .desktop file Comment (Closes: 257596) + * trying gcc-3.2 and g++-3.2 for alpha and amd64 + architecture + + -- Alexander Sack Mon, 12 Jul 2004 11:00:00 +0100 + +mozilla-thunderbird (0.7.1-1) unstable; urgency=low + + * new upstream source 0.7.1 (Closes: 257320, 256843) + * fixed broken theme ID + * include extension descriptions and set them + to locked + * fixed typo in branding patch ( Hompage ->Homepage ) + * included movemail for handling local mail (Closes: 219893) + * provides new mozilla-thunderbird-dev + * does not build enigmail anymore. enigmail has got its + own source package for now. Hopefully this package will + build soon against mozilla-mailnews and mozilla-thunderbird, + so only one package is needed for both. + * update-mozilla-thunderbird-chrome: LD_LIBRARY_PATH bug fixed + (Closes: 254144) + * verified that -compose mailto:email@host.com works (Closes: 252261) + * include upgrade info in README.debian. Documented + new global-config.js file in README.debian too (Closes: 253315) + * crash on corrupt bmp fixed by upstream (Closes: 248857) + * added Provides: mail-reader, imap-client (Closes: 257199) + * renamed menu entry to 'Thunderbird Mail' (Closes: 257596) + + -- Alexander Sack Mon, 5 Jul 2004 11:00:00 +0100 + +mozilla-thunderbird (0.7.1-0.0.asac1) unstable; urgency=low + + * new upstream source 0.7.1 + * fixed broken theme ID + * include extension descriptions and set them + to locked + * fixed typo in branding patch ( Hompage ->Homepage ) + * included movemail for handling local mail + + -- Alexander Sack Thu, 1 Jul 2004 11:00:00 +0100 + +mozilla-thunderbird (0.7-0.0.asac1) unstable; urgency=low + + * new upstream source 0.7 + * provides new mozilla-thunderbird-dev + * does not build enigmail anymore. enigmail has got its + own source package for now. Hopefully this package will + build soon against mozilla-mailnews and mozilla-thunderbird, + so only one package is needed for both. + * update-mozilla-thunderbird-chrome: LD_LIBRARY_PATH bug fixed + (Closes: 254144) + * verified that -compose mailto:email@host.com works (Closes: 252261) + * include upgrade info in README.debian (Closes: 253315) + * crash on corrupt bmp fixed by upstream (Closes: 248857) + + -- Alexander Sack Wed, 23 Jun 2004 11:00:00 +0100 + +mozilla-thunderbird (0.6-asac1) unstable; urgency=low + + * new binary package for development files + mozilla-thunderbird-dev + * mozilla-thunderbird now Provides: mail-reader and imap-client + + -- Alexander Sack Tue, 08 Jun 2004 15:00:00 +0100 + +mozilla-thunderbird (0.6-3) unstable; urgency=low + + * added libx11-dev, libxp-dev, libxt-dev to Build-Depends + * removed xlibs-dev from Build-Depends + * fixed typo in starting screen (Closes: 249850) + * removed duplicate readme file (Closes: 247162) + * added readme file upgrade note to remove the + chrome.rdf in the users profile directory after + upgrade. + + -- Alexander Sack Thu, 03 Jun 2004 00:20:00 +0100 + +mozilla-thunderbird (0.6-2) unstable; urgency=low + + * Fix missing build-dep on xlibs-dev, causing FTBFS errors + (closes: Bug#251166) + + -- Soeren Boll Overgaard Fri, 28 May 2004 11:02:07 +0000 + +mozilla-thunderbird (0.6-1) unstable; urgency=low + * accumulated changelog: 0.6-0.1rc1 + 0.6-0.1rc2 + * repackaged upstream source tarball to not-include + non-free icons of the trademarked new branding + * changed menu icon size to 32x32 + * added suggestions for mozilla-thunderbird-typeaheadfind + mozilla-thunderbird-offline and mozilla-thunderbird-inspector + * new upstream version: 0.6 + * MAP users can now benefit from support for the IMAP IDLE command + which allows the mail server to push notifications such as new + mail arriving as soon as it arrives (Closes: 232544) + * Thunderbird supports server wide news filters that apply to all + news groups on a server + * Mail filters can now mark messages as junk + * Offline support is now available as an extension package + (Closes: 231920) + * Command line parsing problems fixed (Closes: 232342) + * Find broken in view source is fixed (Closes: 232580) + * Alerts and crash when deleting multiple nested + folders inside the trash folder is fixed (Closes: 237705, 244414) + * shift-c selects all as read (Closes: 245039) + * menu hint changed to mail (Closes: 246211) + * Alt-A selects all messages (Closes: 229518) + * typeahead find extension added as extra package + (Closes: 232562) + * suggesting mozilla-firefox now (Closes: 240708, 234918) + * changed mozilla-thunderbird.xpm to envelope with flames + (Closes: 243028) + * new enigmail upstream version included (0.86.6), + (Closes: 235553) + * now bulding with -O2 on all platforms, but ia64, arm, + sparc, alpha, powerpc + * global enigmail config file now in + /etc/mozilla-thunderbird/pref/enigmail.js + * new binary targets: + mozilla-thunderbird-inspector, + mozilla-thunderbird-offline, + mozilla-thunderbird-typeaheadfind + * restructured conffiles: now a single global config + file exists: /etc/mozilla-thunderbird/global-config.js, + which may be used by admins to make their + preconfigurations. + Old config files in /etc/mozilla-thunderbird/pref + will be reserved till next --purge + + -- Alexander Sack Sat, 08 May 2004 08:45:00 +0100 + +mozilla-thunderbird (0.5+.040427-1) unstable; urgency=low + + * new snapshot of 040427 + * added build depend: libgnomevfs2-dev + * increased debian policy standard version to 3.6.1 + + -- Alexander Sack Tue, 27 Apr 2004 12:45:00 +0100 + +mozilla-thunderbird (0.5+.040418-1) unstable; urgency=low + + * new snapshot of 040418 + * changed desktop icon to envelope with flames (Closes: 243028) + + -- Alexander Sack Sun, 18 Apr 2004 12:45:00 +0100 + +mozilla-thunderbird (0.5+.040412-1) unstable; urgency=low + + * new snapshot of 040412 + * Updated enigmail to 0.83.6 + + -- Alexander Sack Mon, 12 Apr 2004 01:37:00 +0100 + +mozilla-thunderbird (0.5+.040330-1) unstable; urgency=low + + * new snapshot of 040320 + * Updated enigmail to 0.83.5 (Closes: 235553) + + -- Alexander Sack Tue, 30 Mar 2004 17:30:20 +0100 + +mozilla-thunderbird (0.5-4) unstable; urgency=low + + * reenabled hppa patch, which apparently led to FTBFS on hppa + + -- Alexander Sack Thu, 04 Mar 2004 21:30:20 +0100 + +mozilla-thunderbird (0.5-3) unstable; urgency=medium + + * preinst added to allow clean upgrade path to this + (Closes: 234118, Closes: 234267) + * added prerm script to allow a clean remove of package + + -- Alexander Sack Sun, 29 Feb 2004 10:30:20 +0100 + +mozilla-thunderbird (0.5-2) unstable; urgency=low + + * new source package layout!! Now using orig.tar.gz with diff.gz + (Closes: 232055) + * moved arch-indep chrome stuff to /usr/share/mozilla-thunderbird/chrome + * moved images to /usr/share/mozilla-thunderbird/res + /usr/share/mozilla-thunderbird/icons + /usr/share/mozilla-thunderbird/chrome/icons + + -- Alexander Sack Thu, 19 Feb 2004 19:30:20 +0100 + +mozilla-thunderbird (0.5-1.1) unstable; urgency=low + + * new source package layout!! Now using orig.tar.gz with diff.gz + + -- Alexander Sack Mon, 11 Feb 2003 19:30:20 +0100 + +mozilla-thunderbird (0.5-1) unstable; urgency=low + + * Aggregated changes since 0.4-1: + * new upstream release 0.5 included + * added xprt-xprintorg to Recommends (Closes: 226626) + * upgraded enigmail to 0.83.2 (Closes: 228678) + + includes a workaround for mozilla bug + leading to a crash in rare situations + (fixed in 0.82.6) + * improved package structure. Sources now are included as original archives + & are extracted to build-dir. (Closes: 225033) + * Minor wording changes in package description, pointed out by + Mark Stevenson. + * New debianization of appearance (branding) + * added switches for pref.js config entries for + individual doubleclick timeout & drag threshold + settings in gtk2 (Closes: 229146) + + -- Alexander Sack Mon, 09 Feb 2003 19:30:20 +0100 + +mozilla-thunderbird (0.5-0.1) unstable; urgency=low + + * preview of thunderbird-0.5 rc2 + + -- Alexander Sack Mon, 07 Feb 2003 19:30:20 +0100 + +mozilla-thunderbird (0.4-1.6) unstable; urgency=low + + * added basic gtk settings as mozilla prefs: + + widget.gtk2.dnd.threshold - treshold in pixel before a drag starts + + widget.gtk2.double_click_timeout - + maximum time in milliseconds between two clicks + to become recognized as double-click e.g. to get + rid of unexpected folder moves, etc. + * upgraded enigmail to 0.83.2 + + -- Alexander Sack Mon, 05 Feb 2003 10:30:20 +0100 + +mozilla-thunderbird (0.4-1.5) unstable; urgency=low + + * added xprt-xprintorg to Recommends + * upgraded enigmail to 0.83.1 + + -- Alexander Sack Mon, 04 Feb 2003 10:30:20 +0100 + +mozilla-thunderbird (0.4-1.4) unstable; urgency=low + + * improved package structure. Sources now are included as original archives + & are extracted to build-dir. (Closes: 225033) + * late checkin. Already uploaded to mentors + + -- Alexander Sack Mon, 27 Jan 2003 10:30:20 +0100 + +mozilla-thunderbird (0.4-1.31) unstable; urgency=low + + * Minor wording changes in package description, pointed out by + Mark Stevenson. + + -- Soeren Boll Overgaard Wed, 14 Jan 2004 12:46:23 +0000 + +mozilla-thunderbird (0.4-1.3) unstable; urgency=low + + * further debinized branding. updated 10_debian-branding patch + * do not use MOZILLA_FIVE_HOME. Always set the MOZILLA_FIVE_HOME + correctly. -> This is not anymore mozilla suite, so it is obsolete. + + -- Alexander Sack Mon, 06 Jan 2003 10:30:20 +0100 + +mozilla-thunderbird (0.4-1.2) unstable; urgency=low + + * updated enigmail to 0.82.6 - includes a workaround for mozilla bug + leading to a crash. + + -- Alexander Sack Mon, 30 Dec 2003 20:30:20 +0100 + +mozilla-thunderbird (0.4-1.1) unstable; urgency=low + + * switched to .orig.tgz file approach + + -- Alexander Sack Mon, 12 Dec 2003 00:30:20 +0100 + +mozilla-thunderbird (0.4-1) unstable; urgency=low + + * version for first debian official upload of 0.4 + + -- Alexander Sack Mon, 12 Dec 2003 00:30:20 +0100 + +mozilla-thunderbird (0.4-0.3) unstable; urgency=low + + * updated latest enigmail source to version 0.82.5 + + -- Alexander Sack Mon, 12 Dec 2003 00:30:20 +0100 + +mozilla-thunderbird (0.4-0.2) unstable; urgency=low + + * added locale support: default locale is en-US + + -- Alexander Sack Mon, 12 Dec 2003 00:30:20 +0100 + +mozilla-thunderbird (0.4-0.1) unstable; urgency=low + + * upgraded official 0.4 release + * browser integration works on gnome/kde + * new mozilla-theme + * latest engimail included + + -- Alexander Sack Mon, 10 Nov 2003 00:30:20 +0100 + +mozilla-thunderbird (0.3-7) unstable; urgency=low + + * added patches for hppa & alpha, arm & mips specfic stuff. took the patches from + the debian mozilla package + + -- Alexander Sack Mon, 10 Nov 2003 00:30:20 +0100 + +mozilla-thunderbird (0.3-6) unstable; urgency=low + + * added patch to switch from ex to sed which certainly won't + have terminal problems + * added .desktop file for menu integration in gnome, kde, etc. + + -- Alexander Sack Sun, 2 Nov 2003 22:23:40 +0100 + + +mozilla-thunderbird (0.3-5) unstable; urgency=low + + * Alexander Sack: + - added build depend nvi. + * Soeren Boll Overgaard + - added dependency on gnupg for enigmail. + + -- Alexander Sack Thu, 29 Oct 2003 21:00:59 +0200 + +mozilla-thunderbird (0.3-4) unstable; urgency=low + + * Soeren Boll Overgaard: + - Improve wording in long descriptions. + - Fix dependency problem of the enigmail-package. + + -- Soeren Boll Overgaard Tue, 28 Oct 2003 17:08:55 +0100 + +mozilla-thunderbird (0.3-3) unstable; urgency=low + + * Build-depend on m4 + * Actually do something in binary-arch + * asac: Applied Patch for myspell issue (closes: Bug#217555) + * fixed mozilla-thunderbird.sgml according to docbook DTD (closes: Bug#217708) + + -- Soeren Boll Overgaard Sun, 26 Oct 2003 23:24:25 +0100 + +mozilla-thunderbird (0.3-2) unstable; urgency=low + + * Build-depend on dpatch. + + -- Soeren Boll Overgaard Sun, 26 Oct 2003 13:26:31 +0100 + +mozilla-thunderbird (0.3-1) unstable; urgency=low + + * Make my name look right in Uploaders. + * Change version to one suited to Debian. + * Update standards version to 3.6.1 (No changes). + + -- Soeren Boll Overgaard Sun, 26 Oct 2003 09:38:24 +0000 + +mozilla-thunderbird (0.3-0.3) unstable; urgency=low + + * readded forgotten patch hunks + + -- Alexander Sack Thu, 24 Oct 2003 09:00:59 +0200 + +mozilla-thunderbird (0.3-0.2) unstable; urgency=low + + * New upstream release + * latest patches of mozilla-thunderbird-0.2-3 are included + + -- Alexander Sack Thu, 21 Oct 2003 20:55:59 +0200 + +mozilla-thunderbird (0.2-3) unstable; urgency=low + + * fixed sudo bug (closes: Bug#216469) + * repackaging because of enigmail build exception + + -- Alexander Sack Wed, 15 Oct 2003 17:56:59 +0200 + +mozilla-thunderbird (0.2-2) unstable; urgency=low + + * Don't limit archs to i386. + + -- Soeren Boll Overgaard Sat, 18 Oct 2003 10:27:05 +0000 + +mozilla-thunderbird (0.2-1) unstable; urgency=low + + * restarted versioning for official debian upload + * Uploaded by S. Boll Overgaard + - Closes thunderbird ITP (closes: Bug#196504) + + -- Alexander Sack Wed, 15 Oct 2003 17:56:59 +0200 + +mozilla-thunderbird (0.3-0.1) unstable; urgency=low + + * New upstream release + + -- Alexander Sack Thu, 16 Oct 2003 10:51:59 +0200 + +mozilla-thunderbird (0.2asac-5) unstable; urgency=low + + * some more lintian cleaning of source package + * added boll@debian.org as co-maintainer + * reduction of build depends redundancy + + -- Alexander Sack Wed, 15 Oct 2003 17:56:50 +0000 + +mozilla-thunderbird (0.2asac-4) unstable; urgency=low + + * minimized build-depends & removed version constraints from build-deps to ease backporting + * added lintian override + * added long description for enigmail + * adjusted preference directory to $HOME/.mozilla-thunderbird + + -- Alexander Sack Mon, 13 Oct 2003 20:53:45 +0000 + +mozilla-thunderbird (0.2asac-3) unstable; urgency=low + + * needed to get the the source archive up again :( + + -- Alexander Sack Thu, 9 Oct 2003 18:51:01 +0200 + +mozilla-thunderbird (0.2asac-2) unstable; urgency=high + + * fixed the build procedure for enigmail binary package + + -- Alexander Sack Tue, 7 Oct 2003 23:04:01 +0200 + +mozilla-thunderbird (0.2asac-1) unstable; urgency=low + + * New upstream release + * added binary package mozilla-thunderbird-enigmail + * now update-chrome enabled + * startup hooks (currently for enigmail) allowed in + /var/lib/mozilla-thunderbird/startup-hooks.d + + -- Alexander Sack Fri, 3 Oct 2003 22:16:05 +0200 + +mozilla-thunderbird (0.2-5) unstable; urgency=low + + * changed menu entry image to gif image of size 32x32 -> lintian --check + tested + * added manual pages for mozilla-thunderbird & thunderbird + * remove mozilla-thunderbird-config from binary package + + -- Alexander Sack Thu, 2 Oct 2003 02:30:44 +0200 + +mozilla-thunderbird (0.2-4) unstable; urgency=low + + * fixed conflict with snapshot build + + + -- Alexander Sack Wed, 1 Oct 2003 16:50:33 +0200 + +mozilla-thunderbird (0.2-3) unstable; urgency=low + + * apply quickfix for bug #212604 (bugzilla.mozilla.org) + -> firebird ist remote startable even if thunderbird is + running + * added basic man pages + + -- Alexander Sack Wed, 1 Oct 2003 12:21:04 +0200 + +mozilla-thunderbird (0.2-2) unstable; urgency=low + + * corrected menu entry command to thunderbird + + -- Alexander Sack Thu, 25 Sep 2003 12:00:36 +0200 + +mozilla-thunderbird (0.2-1) unstable; urgency=low + + * Initial Release. + + -- Alexander Sack Wed, 24 Sep 2003 18:55:50 +0200 diff --git a/compat b/compat new file mode 100644 index 0000000000..f599e28b8a --- /dev/null +++ b/compat @@ -0,0 +1 @@ +10 diff --git a/control b/control new file mode 100644 index 0000000000..3392cffda3 --- /dev/null +++ b/control @@ -0,0 +1,1533 @@ +Source: thunderbird +Section: mail +Priority: optional +Maintainer: Carsten Schoenert +Uploaders: + Christoph Goehre , +Build-Depends: + autoconf2.13, + bash-completion, + bzip2, + cargo (>= 0.42), + cbindgen (>= 0.14), + clang, + debhelper (>= 10.2.5~), + dh-apparmor, + dh-exec, + dpkg (>= 1.16.18~), + dpkg-dev (>= 1.16.18~), + libasound2-dev [linux-any], + libatk-adaptor, + libbotan-2-dev (>= 2.8.0), + libbz2-dev, + libcairo2-dev (>= 1.10.2-1.1~), + libclang-dev, + libdbus-glib-1-dev (>= 0.60), + libevent-dev (>= 1.4.1), + libffi-dev, + libfontconfig1-dev, + libglib2.0-dev (>= 2.22.0), + libgtk2.0-dev, + libgtk-3-dev (>= 3.4), + libjson-c-dev (>= 0.11), + libhunspell-dev (>= 1.5.1~), + libicu-dev (>= 64.1~), + libidl-dev (>= 0.8.0), + libiw-dev [linux-any], + libnotify-dev, + libnspr4-dev (>= 2:4.25~), + libpng-dev, + libpulse-dev, + libreadline-dev, + librust-toml-dev, + libstartup-notification0-dev, + libvpx-dev (>= 1.5.0), + libx11-dev, + libx11-xcb-dev, + libxau-dev, + libxft-dev, + libxt-dev, + llvm-dev, + mesa-common-dev, + nodejs (>= 10.19.0), + python3, + rustc (>= 1.41), + unzip, + yasm (>= 1.1), + zip, + zlib1g-dev, +Vcs-Git: https://salsa.debian.org/mozilla-team/thunderbird.git +Vcs-Browser: https://salsa.debian.org/mozilla-team/thunderbird +Homepage: https://www.thunderbird.net/ +X-Debian-Homepage: http://wiki.debian.org/Thunderbird +Standards-Version: 4.5.1 + +Package: thunderbird +Architecture: amd64 arm64 i386 mips64el ppc64el s390x ppc64 +Depends: + debianutils (>= 1.16), + fontconfig, + psmisc, + x11-utils, + ${misc:Depends}, + ${shlibs:Depends}, +Recommends: + myspell-en-us | hunspell-dictionary | myspell-dictionary, +Suggests: + apparmor, + fonts-lyx, + libgssapi-krb5-2, + libgtk2.0-0, +Provides: + lightning (= ${binary:Version}), + mail-reader, +Breaks: + birdtray (<< 1.7.0+ds-1~), + calendar-google-provider (<=1:68.2.1-1), + enigmail (<< 2:2.2.0~), + jsunit (<< 0.2.2-1~), + lightning (<< 1:76.0~b1-1~), + webext-compactheader (<= 3.0.0~), + xul-ext-dispmua (<= 1.8.4.6-1), + webext-exteditor (<= 2.0.4-1), + xul-ext-firetray (<= 0.6.1+dfsg-1.2), + xul-ext-quotecolors (<=0.3-6), + xul-ext-sieve (<= 0.3.1+dfsg-1~), + webext-sogo-connector (<= 68.0.1-2~), +Replaces: + lightning (<< 1:76.0~b1-1~), +Description: mail/news client with RSS, chat and integrated spam filter support + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + It supports different mail accounts, no matter of the used protocol like + POP(s) or IMAP(s), has an integrated learning Spam filter, and offers easy + organization of mails with tagging and virtual folders. Also, more features + can be added by installing extensions. + . + Thunderbird also includes an integrated calendar for handling events, events + invitations and tasks in multiple calendars. It supports local calendars, + CalDAV and plain ics files on CardDAV and WebDAV. + . + The goal of Thunderbird is to produce a cross platform standalone mail + application using the XUL user interface language. + +Package: lightning +Architecture: all +Section: oldlibs +Depends: + thunderbird (>= ${binary:Version}), + ${misc:Depends}, +Description: Calendar Extension for Thunderbird - Transitional package + Lightning is the calendar extension for Thunderbird. It can handle events, + event invitations and tasks in multiple calendars. + . + It supports local calendars, CalDAV and plain ics files on CardDAV and WebDAV. + . + This is a transitional package that pulls in the required package for + lightning. It can be safely removed. + +Package: thunderbird-l10n-all +Architecture: all +Section: metapackages +Depends: + thunderbird-l10n-ar (>= ${binary:Version}), + thunderbird-l10n-ast (>= ${binary:Version}), + thunderbird-l10n-be (>= ${binary:Version}), + thunderbird-l10n-bg (>= ${binary:Version}), + thunderbird-l10n-br (>= ${binary:Version}), + thunderbird-l10n-ca (>= ${binary:Version}), + thunderbird-l10n-cak (>= ${binary:Version}), + thunderbird-l10n-cs (>= ${binary:Version}), + thunderbird-l10n-cy (>= ${binary:Version}), + thunderbird-l10n-da (>= ${binary:Version}), + thunderbird-l10n-de (>= ${binary:Version}), + thunderbird-l10n-dsb (>= ${binary:Version}), + thunderbird-l10n-el (>= ${binary:Version}), + thunderbird-l10n-en-gb (>= ${binary:Version}), + thunderbird-l10n-es-ar (>= ${binary:Version}), + thunderbird-l10n-es-es (>= ${binary:Version}), + thunderbird-l10n-et (>= ${binary:Version}), + thunderbird-l10n-eu (>= ${binary:Version}), + thunderbird-l10n-fi (>= ${binary:Version}), + thunderbird-l10n-fr (>= ${binary:Version}), + thunderbird-l10n-fy-nl (>= ${binary:Version}), + thunderbird-l10n-ga-ie (>= ${binary:Version}), + thunderbird-l10n-gd (>= ${binary:Version}), + thunderbird-l10n-gl (>= ${binary:Version}), + thunderbird-l10n-he (>= ${binary:Version}), + thunderbird-l10n-hr (>= ${binary:Version}), + thunderbird-l10n-hsb (>= ${binary:Version}), + thunderbird-l10n-hu (>= ${binary:Version}), + thunderbird-l10n-hy-am (>= ${binary:Version}), + thunderbird-l10n-id (>= ${binary:Version}), + thunderbird-l10n-is (>= ${binary:Version}), + thunderbird-l10n-it (>= ${binary:Version}), + thunderbird-l10n-ja (>= ${binary:Version}), + thunderbird-l10n-ka (>= ${binary:Version}), + thunderbird-l10n-kab (>= ${binary:Version}), + thunderbird-l10n-kk (>= ${binary:Version}), + thunderbird-l10n-ko (>= ${binary:Version}), + thunderbird-l10n-lt (>= ${binary:Version}), + thunderbird-l10n-ms (>= ${binary:Version}), + thunderbird-l10n-nb-no (>= ${binary:Version}), + thunderbird-l10n-nl (>= ${binary:Version}), + thunderbird-l10n-nn-no (>= ${binary:Version}), + thunderbird-l10n-pl (>= ${binary:Version}), + thunderbird-l10n-pt-br (>= ${binary:Version}), + thunderbird-l10n-pt-pt (>= ${binary:Version}), + thunderbird-l10n-rm (>= ${binary:Version}), + thunderbird-l10n-ro (>= ${binary:Version}), + thunderbird-l10n-ru (>= ${binary:Version}), + thunderbird-l10n-si (>= ${binary:Version}), + thunderbird-l10n-sk (>= ${binary:Version}), + thunderbird-l10n-sl (>= ${binary:Version}), + thunderbird-l10n-sq (>= ${binary:Version}), + thunderbird-l10n-sr (>= ${binary:Version}), + thunderbird-l10n-sv-se (>= ${binary:Version}), + thunderbird-l10n-tr (>= ${binary:Version}), + thunderbird-l10n-uk (>= ${binary:Version}), + thunderbird-l10n-uz (>= ${binary:Version}), + thunderbird-l10n-vi (>= ${binary:Version}), + thunderbird-l10n-zh-cn (>= ${binary:Version}), + thunderbird-l10n-zh-tw (>= ${binary:Version}), + ${misc:Depends}, +Description: All language packages for Thunderbird (meta) + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package is a metapackage depending on all available localization of + Thunderbird. + +Package: thunderbird-l10n-ar +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ar +Replaces: + lightning-l10n-ar (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ar (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ar, +Recommends: + hunspell-ar, +Description: Arabic language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Arabic. + +Package: thunderbird-l10n-ast +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ast +Replaces: + lightning-l10n-ast (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ast (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ast, +Description: Asturian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Asturian. + +Package: thunderbird-l10n-be +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:be +Replaces: + lightning-l10n-be (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-be (<< 1:60.2.1-1~), +Provides: + lightning-l10n-be, +Recommends: + hunspell-be, +Description: Belarusian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Belarusian. + +Package: thunderbird-l10n-bg +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:bg +Replaces: + lightning-l10n-bg (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-bg (<< 1:60.2.1-1~), +Provides: + lightning-l10n-bg, +Recommends: + hunspell-bg | myspell-bg, +Description: Bulgarian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Bulgarian. + +Package: thunderbird-l10n-br +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:br +Replaces: + lightning-l10n-br (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-br (<< 1:60.2.1-1~), +Provides: + lightning-l10n-br, +Recommends: + hunspell-br, +Description: Breton language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Breton. + +Package: thunderbird-l10n-ca +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ca +Replaces: + lightning-l10n-ca (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ca (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ca, +Recommends: + hunspell-ca | myspell-ca, +Description: Catalan/Valencian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Catalan/Valencian. + +Package: thunderbird-l10n-cak +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:cak-GT +Description: Kacqhikel language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Kacqhikel. + +Package: thunderbird-l10n-cs +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:cs +Replaces: + lightning-l10n-cs (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-cs (<< 1:60.2.1-1~), +Provides: + lightning-l10n-cs, +Recommends: + hunspell-cs | myspell-cs-cz, +Description: Czech language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Czech. + +Package: thunderbird-l10n-cy +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:cy +Replaces: + lightning-l10n-cy (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-cy (<< 1:60.2.1-1~), +Provides: + lightning-l10n-cy, +Description: Welsh language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Welsh. + +Package: thunderbird-l10n-da +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:da +Replaces: + lightning-l10n-da (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-da (<< 1:60.2.1-1~), +Provides: + lightning-l10n-da, +Recommends: + myspell-da | hunspell-da, +Description: Danish language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Danish. + +Package: thunderbird-l10n-de +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:de +Replaces: + lightning-l10n-de (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-de (<< 1:60.2.1-1~), +Provides: + lightning-l10n-de, +Recommends: + hunspell-de-de | hunspell-de-at | hunspell-de-ch | myspell-de-de | myspell-de-at | myspell-de-ch, +Description: German language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in German. + +Package: thunderbird-l10n-dsb +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:dsb +Replaces: + lightning-l10n-dsb (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-dsb (<< 1:60.2.1-1~), +Provides: + lightning-l10n-dsb, +Description: Lower Sorbian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Lower Sorbian. + +Package: thunderbird-l10n-el +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:el +Replaces: + lightning-l10n-el (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-el (<< 1:60.2.1-1~), +Provides: + lightning-l10n-el, +Recommends: + hunspell-el | myspell-el-gr, +Description: Greek language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Greek. + +Package: thunderbird-l10n-en-gb +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:en-GB +Replaces: + lightning-l10n-en-gb (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-en-gb (<< 1:60.2.1-1~), +Provides: + lightning-l10n-en-gb, +Recommends: + hunspell-en-gb | hunspell-en-au | hunspell-en-ca | hunspell-en-za, +Description: English (Great Britain) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in English (Great + Britain). + +Package: thunderbird-l10n-es-ar +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:es-AR +Replaces: + lightning-l10n-es-ar (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-es-ar (<< 1:60.2.1-1~), +Provides: + lightning-l10n-es-ar, +Recommends: + hunspell-es | myspell-es, +Description: Spanish (Argentina) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Spanish (Argentina). + +Package: thunderbird-l10n-es-es +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:es-ES +Replaces: + lightning-l10n-es-es (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-es-es (<< 1:60.2.1-1~), +Provides: + lightning-l10n-es-es, +Recommends: + hunspell-es | myspell-es, +Description: Spanish (Spain) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Spanish (Spain). + +Package: thunderbird-l10n-et +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:et +Replaces: + lightning-l10n-et (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-et (<< 1:60.2.1-1~), +Provides: + lightning-l10n-et, +Recommends: + myspell-et, +Description: Estonian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Estonian. + +Package: thunderbird-l10n-eu +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:eu +Replaces: + lightning-l10n-eu (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-eu (<< 1:60.2.1-1~), +Provides: + lightning-l10n-eu, +Recommends: + hunspell-eu, +Description: Basque language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Basque. + +Package: thunderbird-l10n-fi +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:fi +Replaces: + lightning-l10n-fi (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-fi (<< 1:60.2.1-1~), +Provides: + lightning-l10n-fi, +Recommends: + myspell-fi, + xul-ext-mozvoikko, +Description: Finnish language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Finnish. + +Package: thunderbird-l10n-fr +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:fr +Replaces: + lightning-l10n-fr (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-fr (<< 1:60.2.1-1~), +Provides: + lightning-l10n-fr, +Recommends: + hunspell-fr | myspell-fr | myspell-fr-gut, +Description: French language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in French. + +Package: thunderbird-l10n-fy-nl +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:fy-NL +Replaces: + lightning-l10n-fy-nl (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-fy-nl (<< 1:60.2.1-1~), +Provides: + lightning-l10n-fy-nl, +Description: Frisian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Frisian. + +Package: thunderbird-l10n-ga-ie +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ga-IE +Replaces: + lightning-l10n-ga-ie (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ga-ie (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ga-ie, +Description: Irish (Ireland) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Irish (Ireland). + +Package: thunderbird-l10n-gd +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:gd +Replaces: + lightning-l10n-gd (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-gd (<< 1:60.2.1-1~), +Provides: + lightning-l10n-gd, +Recommends: + hunspell-gd | myspell-gd, +Description: Gaelic (Scottish) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Gaelic (Scottish). + +Package: thunderbird-l10n-gl +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:gl +Replaces: + lightning-l10n-gl (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-gl (<< 1:60.2.1-1~), +Provides: + lightning-l10n-gl, +Recommends: + hunspell-gl | hunspell-gl-es, +Description: Galician language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Galician. + +Package: thunderbird-l10n-he +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:he +Replaces: + lightning-l10n-he (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-he (<< 1:60.2.1-1~), +Provides: + lightning-l10n-he, +Recommends: + hunspell-he | myspell-he, +Description: Hebrew language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Hebrew. + +Package: thunderbird-l10n-hr +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:hr +Replaces: + lightning-l10n-hr (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-hr (<< 1:60.2.1-1~), +Provides: + lightning-l10n-hr, +Recommends: + hunspell-hr | myspell-hr, +Description: Croatian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Croatian. + +Package: thunderbird-l10n-hsb +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:hsb +Replaces: + lightning-l10n-hsb (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-hsb (<< 1:60.2.1-1~), +Provides: + lightning-l10n-hsb, +Recommends: + aspell-hsb, +Description: Upper Sorbian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Upper Sorbian. + +Package: thunderbird-l10n-hu +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:hu +Replaces: + lightning-l10n-hu (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-hu (<< 1:60.2.1-1~), +Provides: + lightning-l10n-hu, +Recommends: + hunspell-hu | myspell-hu, +Description: Hungarian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Hungarian. + +Package: thunderbird-l10n-hy-am +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:hy-AM +Replaces: + lightning-l10n-hy-am (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-hy-am (<< 1:60.2.1-1~), +Provides: + lightning-l10n-hy-am, +Recommends: + myspell-hy, +Description: Armenian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Armenian. + +Package: thunderbird-l10n-id +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:id +Replaces: + lightning-l10n-id (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-id (<< 1:60.2.1-1~), +Provides: + lightning-l10n-id, +Description: Indonesian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Indonesian. + +Package: thunderbird-l10n-is +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:is +Replaces: + lightning-l10n-is (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-is (<< 1:60.2.1-1~), +Provides: + lightning-l10n-is, +Recommends: + hunspell-is, +Description: Icelandic language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Icelandic. + +Package: thunderbird-l10n-it +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:it +Replaces: + lightning-l10n-it (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-it (<< 1:60.2.1-1~), +Provides: + lightning-l10n-it, +Recommends: + hunspell-it | myspell-it, +Description: Italian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Italian. + +Package: thunderbird-l10n-ja +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ja +Replaces: + lightning-l10n-ja (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ja (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ja, +Description: Japanese language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Japanese. + +Package: thunderbird-l10n-ka +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ka +Description: Georgian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Georgian. + +Package: thunderbird-l10n-kab +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:kab +Replaces: + lightning-l10n-kab (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-kab (<< 1:60.2.1-1~), +Provides: + lightning-l10n-kab, +Description: Kabyle language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Kabyle. + +Package: thunderbird-l10n-kk +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:kk +Replaces: + lightning-l10n-kk (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-kk (<< 1:60.2.1-1~), +Provides: + lightning-l10n-kk, +Recommends: + hunspell-kk, +Description: Kazakh language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Kazakh. + +Package: thunderbird-l10n-ko +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ko +Replaces: + lightning-l10n-ko (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ko (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ko, +Recommends: + hunspell-ko, +Description: Korean language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Korean. + +Package: thunderbird-l10n-lt +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:lt +Replaces: + lightning-l10n-lt (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-lt (<< 1:60.2.1-1~), +Provides: + lightning-l10n-lt, +Recommends: + hunspell-lt | myspell-lt, +Description: Lithuanian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Lithuanian. + +Package: thunderbird-l10n-ms +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ms +Replaces: + lightning-l10n-ms (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ms (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ms, +Description: Malay language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Malay. + +Package: thunderbird-l10n-nb-no +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:nb-NO +Replaces: + lightning-l10n-nb-no (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-nb-no (<< 1:60.2.1-1~), +Provides: + lightning-l10n-nb-no, +Recommends: + hunspell-no | myspell-nb, +Description: Bokmaal (Norway) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Bokmaal (Norway). + +Package: thunderbird-l10n-nl +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:nl +Replaces: + lightning-l10n-nl (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-nl (<< 1:60.2.1-1~), +Provides: + lightning-l10n-nl, +Recommends: + hunspell-nl | myspell-nl, +Description: Dutch language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Dutch. + +Package: thunderbird-l10n-nn-no +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:nn-NO +Replaces: + lightning-l10n-nn-no (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-nn-no (<< 1:60.2.1-1~), +Provides: + lightning-l10n-nn-no, +Recommends: + hunspell-no | myspell-nn, +Description: Nynorsk (Norway) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Nynorsk (Norway). + +Package: thunderbird-l10n-pl +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:pl +Replaces: + lightning-l10n-pl (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-pl (<< 1:60.2.1-1~), +Provides: + lightning-l10n-pl, +Recommends: + hunspell-pl | myspell-pl, +Description: Polish language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Polish. + +Package: thunderbird-l10n-pt-br +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:pt-BR +Replaces: + lightning-l10n-pt-br (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-pt-br (<< 1:60.2.1-1~), +Provides: + lightning-l10n-pt-br, +Recommends: + hunspell-pt-br | myspell-pt-br | myspell-pt, +Description: Portuguese (Brazil) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Portuguese (Brazil). + +Package: thunderbird-l10n-pt-pt +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:pt-PT +Replaces: + lightning-l10n-pt-pt (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-pt-pt (<< 1:60.2.1-1~), +Provides: + lightning-l10n-pt-pt, +Recommends: + hunspell-pt-pt | myspell-pt-pt | myspell-pt, +Description: Portuguese (Portugal) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Portuguese (Portugal). + +Package: thunderbird-l10n-rm +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:rm +Replaces: + lightning-l10n-rm (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-rm (<< 1:60.2.1-1~), +Provides: + lightning-l10n-rm, +Description: Romansh language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Romansh. + +Package: thunderbird-l10n-ro +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ro +Replaces: + lightning-l10n-ro (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ro (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ro, +Recommends: + hunspell-ro, +Description: Romania language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Romania. + +Package: thunderbird-l10n-ru +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:ru +Replaces: + lightning-l10n-ru (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-ru (<< 1:60.2.1-1~), +Provides: + lightning-l10n-ru, +Recommends: + hunspell-ru | myspell-ru, +Description: Russian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Russian. + +Package: thunderbird-l10n-si +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:si +Replaces: + lightning-l10n-si (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-si (<< 1:60.2.1-1~), +Provides: + lightning-l10n-si, +Recommends: + hunspell-si, +Description: Sinhala language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Sinhala. + +Package: thunderbird-l10n-sk +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:sk +Replaces: + lightning-l10n-sk (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-sk (<< 1:60.2.1-1~), +Provides: + lightning-l10n-sk, +Recommends: + hunspell-sk | myspell-sk, +Description: Slovak language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Slovak. + +Package: thunderbird-l10n-sl +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:sl +Replaces: + lightning-l10n-sl (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-sl (<< 1:60.2.1-1~), +Provides: + lightning-l10n-sl, +Recommends: + hunspell-sl | myspell-sl, +Description: Slovenian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Slovenian. + +Package: thunderbird-l10n-sq +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:sq +Replaces: + lightning-l10n-sq (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-sq (<< 1:60.2.1-1~), +Provides: + lightning-l10n-sq, +Description: Albanian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Albanian. + +Package: thunderbird-l10n-sr +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:sr +Replaces: + lightning-l10n-sr (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-sr (<< 1:60.2.1-1~), +Provides: + lightning-l10n-sr, +Recommends: + hunspell-sr, +Description: Serbian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Serbian. + +Package: thunderbird-l10n-sv-se +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:sv-SE +Replaces: + lightning-l10n-sv-se (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-sv-se (<< 1:60.2.1-1~), +Provides: + lightning-l10n-sv-se, +Recommends: + hunspell-sv | myspell-sv-se, +Description: Swedish (Sweden) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Swedish (Sweden). + +Package: thunderbird-l10n-tr +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:tr +Replaces: + lightning-l10n-tr (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-tr (<< 1:60.2.1-1~), +Provides: + lightning-l10n-tr, +Description: Turkish language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Turkish. + +Package: thunderbird-l10n-uk +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:uk +Replaces: + lightning-l10n-uk (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-uk (<< 1:60.2.1-1~), +Provides: + lightning-l10n-uk, +Recommends: + hunspell-uk | myspell-uk +Description: Ukrainian language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Ukrainian. + +Package: thunderbird-l10n-uz +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:uz +Recommends: + hunspell-uz | myspell-uz +Description: Uzbek language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Uzbek. + +Package: thunderbird-l10n-vi +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:vi +Replaces: + lightning-l10n-vi (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-vi (<< 1:60.2.1-1~), +Provides: + lightning-l10n-vi, +Recommends: + hunspell-vi, +Description: Vietnamese language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Vietnamese. + +Package: thunderbird-l10n-zh-cn +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:zh-CN +Replaces: + lightning-l10n-zh-cn (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-zh-cn (<< 1:60.2.1-1~), +Provides: + lightning-l10n-zh-cn, +Description: Chinese (China) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Chinese (China). + +Package: thunderbird-l10n-zh-tw +Architecture: all +Section: localization +Depends: + thunderbird (<< ${source:Version}.1~), + thunderbird (>= ${source:Version}), + ${misc:Depends}, +Homepage: https://wiki.mozilla.org/L10n:Teams:zh-TW +Replaces: + lightning-l10n-zh-tw (<< 1:60.2.1-1~), +Breaks: + lightning-l10n-zh-tw (<< 1:60.2.1-1~), +Provides: + lightning-l10n-zh-tw, +Description: Chinese (Taiwan) language package for Thunderbird + Thunderbird is an mail client suitable for free distribution. The goal of + Thunderbird is to produce a cross platform stand-alone mail application using + the XUL user interface language. + . + This package contains the localization of Thunderbird in Chinese (Taiwan). diff --git a/copyright b/copyright new file mode 100644 index 0000000000..70698619af --- /dev/null +++ b/copyright @@ -0,0 +1,3371 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Thunderbird +Source: https://ftp.mozilla.org/pub/mozilla.org/thunderbird/ +Disclaimer: The original upstream tarball is modified from upstream by + removing a set of sourceless binary, non-free, and VCS-related files. You + can find a repack.py script in the debian directory doing this cleanup, + using filtering data present in a source.filter file in the same directory. + If this file is incomplete, which I'm pretty sure is the case, because it's + difficult not to forget anything in this huge amount of data, please file + a bug or contact me. + Some licensing terms are not included verbatim in this file on purpose, for + terms that are available in a file in subdirectories that are not used to + build the binary packages. + +Files: * +Copyright: 1998-2016, Mozilla Project +License: MPL-2.0 or GPL-2 or LGPL-2.1 + +Files: debian/* +Copyright: 2003-2009, Alexander Sack + 2008, Fabien Tassin + 2013-2018, Carsten Schoenert + 2009-2013, Guido Günther + 2010-2016, Christoph Goehre +License: MPL-1.1 or MPL-2.0 or GPL-2 or LGPL-2.1 + +Files: debian/logo/icedove/icedove_icon_plain.svg + debian/logo/icedove/icedove_icon_profile_plain.svg + debian/logo/icedove/icedove_icon_profile.svg + debian/logo/icedove/icedove_icon.svg + debian/logo/icedove/icedove_lettering.svg + debian/logo/icedove/icedove_logo_plain.svg + debian/logo/icedove/icedove_logo.svg +Copyright: 2006-2007, Ricardo Fernández Fuentes +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: debian/logo/icedove/icedove_icon_plain.svg +Copyright: 1998-2016, Mozilla Foundation +License: MPL-2.0 or GPL-2 or LGPL-2.1 + +Files: comm/calendar/* +Copyright: no-info-found +License: MPL-2.0 + +Files: comm/calendar/base/modules/* +Copyright: 2011-2012, Philipp Kewisch +License: MPL-2.0 + +Files: comm/calendar/itip/* +Copyright: 2007, Simdesk Technologies +License: MPL-1.1 + +Files: comm/calendar/libical/* +Copyright: Eric Busboom +License: MPL-1.1 or LGPL-2.1 + +Files: comm/calendar/libical/scripts/mkneticali.pl +Copyright: 1999, Eric Busboom +License: MPL-1.0 + +Files: comm/calendar/libical/scripts/mkparameterrestrictions.pl + comm/calendar/libical/scripts/mkrestrictionrecords.pl +Copyright: 1999, Graham Davison +License: MPL-1.0 + +Files: comm/calendar/libical/src/libical/astime.h + comm/calendar/libical/src/libical/caldate.c +Copyright: 1986-2000, Hiram Clawson +License: BSD-2-clause + +Files: comm/calendar/libical/src/libical/icalarray.c + comm/calendar/libical/src/libical/icalarray.h +Copyright: 2001, Ximian, Inc +License: MPL-1.0 + +Files: comm/calendar/libical/src/libical/icalattach.c +Copyright: 2000, Andrea Campi +License: MPL-1.0 + +Files: comm/calendar/libical/src/libical/icalattach.h + comm/calendar/libical/src/libical/icalattachimpl.h +Copyright: 2000, 2002, Andrea Campi +License: MPL-1.0 + +Files: comm/calendar/libical/src/libical/icalcomponent.c + comm/calendar/libical/src/libical/icalduration.c + comm/calendar/libical/src/libical/icalmime.c +Copyright: 2008, dothebart + 2000, Eric Busboom, http://www.softwarestudio.org +License: MPL-1.0 or LGPL-2.1 + +Files: comm/calendar/libical/src/libical/icalmemory.c + comm/calendar/libical/src/libical/icaltimezone.c + comm/calendar/libical/src/libical/icaltimezone.h + comm/calendar/libical/src/libical/icalparser.c + comm/calendar/libical/src/libical/sspm.c + comm/calendar/libical/src/libical/sspm.h +Copyright: 2008, dothebart +License: MPL-1.0 or LGPL-2.1 + +Files: comm/calendar/libical/src/libical/icptrholder.h + comm/calendar/libical/src/libical/vcomponent.h +Copyright: 2001, Critical Path +License: MPL-1.0 or LGPL-2.1 + +Files: comm/calendar/libical/src/libical/vsnprintf.c +Copyright: 1997, Theo de Raadt +License: BSD-2-clause + +Files: comm/chat/protocols/irc/test/test_sendBufferedCommand.js +Copyright: no-info-found +License: MPL-2.0 + +Files: comm/ldap/c-sdk/libraries/libldap/authzidctrl.c + comm/ldap/c-sdk/libraries/libldap/geteffectiverightsctrl.c + comm/ldap/c-sdk/libraries/libldap/pwmodext.c + comm/ldap/c-sdk/libraries/libldap/pwpctrl.c + comm/ldap/c-sdk/libraries/libldap/saslio.c + comm/ldap/c-sdk/libraries/libldap/userstatusctrl.c + comm/ldap/c-sdk/libraries/libldap/whoami.c +Copyright: 2005, Sun Microsystems +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/include/disptmpl.h + comm/ldap/c-sdk/include/ldif.h + comm/ldap/c-sdk/include/portable.h + comm/ldap/c-sdk/include/regex.h + comm/ldap/c-sdk/include/srchpref.h + comm/ldap/c-sdk/libraries/liblber/* +Copyright: 1998-1999, Netscape Communications Coportation + 1990-1996, Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/libraries/libldap/abandon.c + comm/ldap/c-sdk/libraries/libldap/add.c + comm/ldap/c-sdk/libraries/libldap/cldap.c + comm/ldap/c-sdk/libraries/libldap/compare.c + comm/ldap/c-sdk/libraries/libldap/friendly.c + comm/ldap/c-sdk/libraries/libldap/getattr.c + comm/ldap/c-sdk/libraries/libldap/getentry.c + comm/ldap/c-sdk/libraries/libldap/getfilter.c + comm/ldap/c-sdk/libraries/libldap/getvalues.c + comm/ldap/c-sdk/libraries/libldap/modify.c + comm/ldap/c-sdk/libraries/libldap/open.c + comm/ldap/c-sdk/libraries/libldap/os-ip.c + comm/ldap/c-sdk/libraries/libldap/rename.c + comm/ldap/c-sdk/libraries/libldap/request.c + comm/ldap/c-sdk/libraries/libldap/reslist.c + comm/ldap/c-sdk/libraries/libldap/result.c + comm/ldap/c-sdk/libraries/libldap/sbind.c + comm/ldap/c-sdk/libraries/libldap/search.c + comm/ldap/c-sdk/libraries/libldap/ufn.c + comm/ldap/c-sdk/libraries/libldap/unbind.c +Copyright: 1998-1999, Netscape Communications Coportation + 1990, 1993-1995, Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/libraries/libldap/bind.c + comm/ldap/c-sdk/libraries/libldap/delete.c +Copyright: 1998-1999, Netscape Communications Coportation + 1990, Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/libraries/libldap/cache.c +Copyright: 1998-1999, Netscape Communications Coportation + 1993, The Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/libraries/libldap/charset.c + comm/ldap/c-sdk/libraries/libldap/countvalues.c + comm/ldap/c-sdk/libraries/libldap/disptmpl.c + comm/ldap/c-sdk/libraries/libldap/dsparse.c + comm/ldap/c-sdk/libraries/libldap/freevalues.c + comm/ldap/c-sdk/libraries/libldap/getdxbyname.c + comm/ldap/c-sdk/libraries/libldap/sort.c + comm/ldap/c-sdk/libraries/libldap/srchpref.c + comm/ldap/c-sdk/libraries/libldap/url.c +Copyright: 1998-1999, Netscape Communications Coportation + 1990-1996, Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/libraries/libldap/compat.c + comm/ldap/c-sdk/libraries/libldap/free.c +Copyright: 1998-1999, Netscape Communications Coportation + 1994, The Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/ldap/c-sdk/libraries/libldap/getdn.c +Copyright: 1998-1999, Netscape Communications Coportation + 1994, Regents of the University of Michigan +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: comm/mail/base/test/unit/resources/* + comm/mail/base/test/unit/test_alertHook.js + comm/mail/base/test/unit/test_attachmentChecker.js + comm/mail/base/test/unit/test_windows_font_migration.js + comm/mail/components/test/unit/test_about_support.js + comm/mail/locales/en-US/all-l10n.js +Copyright: no-info-found +License: MPL-2.0 + +Files: comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml +Copyright: 2020, MZLA Technologies Corporation +License: CC0-1.0 + +Files: comm/mailnews/* + browser/* +Copyright: no-info-found +License: MPL-2.0 + +Files: comm/mailnews/base/src/nsMsgAccountManager.h + comm/mailnews/local/src/nsPop3Protocol.cpp + comm/mailnews/mime/src/mimebuf.cpp + comm/mailnews/mime/src/mimebuf.h + comm/mailnews/mime/src/mimedrft.cpp + comm/mailnews/mime/src/mimei.cpp + comm/mailnews/mime/src/mimemrel.cpp + comm/mailnews/mime/src/mimeobj.cpp + comm/mailnews/mime/src/mimetext.cpp +Copyright: 2000, International Business Machines (IBM) Corporation +License: MPL-2.0 + +Files: comm/mailnews/mime/src/modmimee.h +Copyright: 1996, Netscape Communications Corporation +License: MPL-2.0 + +Files: browser/components/translation/cld2/* +Copyright: 2013-2014, Google Inc. +License: Apache-2.0 + +Files: browser/extensions/pdfjs/test/* +Copyright: no-info-found +License: public-domain + +Files: browser/extensions/pdfjs/content/* +Copyright: 2012-2015, Mozilla Foundation +License: Apache-2.0 + +Files: config/tests/unit-mozunit.py + config/tests/unitMozZipFile.py +Copyright: no-info-found +License: MPL-2.0 + +Files: docshell/test/* +Copyright: no-info-found +License: MPL-2.0 + +Files: dom/base/nsPropertyTable.cpp + dom/base/nsPropertyTable.h +Copyright: 2000, International Business Machines (IBM) +License: MPL-2.0 + +Files: dom/canvas/WebGLTexelConversions.h +Copyright: 2010, Mozilla Corporation + 2010, Google Inc. + 2010, Apple Inc. +License: BSD-2-clause + +Files: dom/canvas/WebGLValidateStrings.h +Copyright: 2011, Mozilla Corporation + 2011, Apple Inc. +License: BSD-2-clause + +Files: dom/imptests/testharnessreport.js + dom/indexedDB/test/browser_bug839193.js + dom/indexedDB/test/bug839193.js +Copyright: no-info-found +License: MPL-2.0 + +Files: dom/events/PointerEvent.cpp + dom/events/PointerEvent.h +Copyright: 2013, Microsoft Open Technologies, Inc. +License: MPL-2.0 + +Files: dom/media/gmp/GMPVideoEncodedFrameImpl.h +Copyright: 2014, Mozilla Corporation +License: BSD-2-clause + +Files: dom/media/gmp/gmp-api/* +Copyright: 2014, Mozilla Foundation + 2011, The WebRTC project authors. +License: BSD-3-clause + +Files: dom/media/gmp/gmp-api/gmp-storage.h +Copyright: 2012-2014, Mozilla Foundation and contributors +License: Apache-2.0 + +Files: dom/media/gmp/gmp-api/gmp-errors.h + dom/media/gmp/gmp-api/gmp-platform.h +Copyright: 2014, Mozilla +License: BSD-3-clause + +Files: dom/media/test/make-headers.sh +Copyright: no-info-found +License: MPL-2.0 + +Files: dom/media/webaudio/FFTBlock.cpp + dom/media/webaudio/blink/* +Copyright: 2005-2006, 2008-2013, Google Inc. +License: BSD-3-clause + +Files: dom/media/webaudio/blink/DenormalDisabler.h + dom/media/webaudio/blink/HRTFPanner.cpp + dom/media/webaudio/blink/HRTFPanner.h +Copyright: 2010-2011, Google Inc. +License: BSD-2-clause + +Files: dom/media/webaudio/blink/IRC_Composite_C_R0195-incl.cpp +Copyright: no-info-found +License: MPL-2.0 + +Files: dom/media/webspeech/recognition/endpointer.cc + dom/media/webspeech/recognition/endpointer.h + dom/media/webspeech/recognition/energy_endpointer.cc + dom/media/webspeech/recognition/energy_endpointer.h + dom/media/webspeech/recognition/energy_endpointer_params.cc + dom/media/webspeech/recognition/energy_endpointer_params.h +Copyright: 2006-2013, The Chromium Authors +License: BSD-3-clause + +Files: dom/plugins/base/npruntime.h +Copyright: 2004, Apple Computer, Inc. and The Mozilla Foundation +License: BSD-3-clause + +Files: dom/plugins/ipc/PluginInterposeOSX.h +Copyright: 2006-2013, The Chromium Authors +License: BSD-3-clause + +Files: dom/plugins/test/testplugin/* +Copyright: 2008, 2010, Mozilla Corporation +License: BSD-3-clause + +Files: dom/plugins/test/testplugin/nptest_utils.cpp + dom/plugins/test/testplugin/nptest_utils.h +Copyright: 2006-2009, 2012, Apple Inc. +License: BSD-2-clause + +Files: dom/plugins/test/testplugin/secondplugin/* + dom/plugins/test/unit/* + dom/svg/test/matrixUtils.js + dom/tests/browser/browser_ConsoleAPITests.js + dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js + dom/tests/browser/browser_bug1004814.js + dom/tests/browser/browser_bug1008941_dismissGeolocationHanger.js + dom/tests/browser/browser_frame_elements.js + dom/tests/mochitest/dom-level1-core/* + dom/tests/mochitest/dom-level2-core/* + dom/tests/unit/test_bug319968.js + dom/tests/unit/test_bug465752.js +Copyright: no-info-found +License: MPL-2.0 + +Files: dom/tests/mochitest/ajax/jquery/dist/* +Copyright: 2006-2008, John Resig (jquery.com) +License: GPL-2 or Expat + +Files: dom/tests/mochitest/ajax/prototype/test/lib/* +Copyright: 2005, Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) + 2005, Michael Schuerig (http://www.schuerig.de/michael/) + 2005, Jon Tirsen (http://www.tirsen.com) +License: Expat + +Files: dom/tests/mochitest/ajax/scriptaculous/src/scriptaculous.js +Copyright: 2005-2007, Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +License: Expat + +Files: dom/xul/nsXULElement.cpp +Copyright: 2000, International Business Machines (IBM) +License: MPL-2.0 + +Files: editor/libeditor/tests/* +Copyright: 2007-2008, 2010, 2012, Google Inc +License: Apache-2.0 + +Files: extensions/auth/gssapi.h +Copyright: 1993, OpenVision Technologies, Inc +License: other-1 + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that the above copyright notice appears in all copies and + that both that copyright notice and this permission notice appear in + supporting documentation, and that the name of OpenVision not be used + in advertising or publicity pertaining to distribution of the software + without specific, written prior permission. OpenVision makes no + representations about the suitability of this software for any + purpose. It is provided "as is" without express or implied warranty. + . + OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + +Files: extensions/spellcheck/hunspell/* +Copyright: 2002-2005 Kevin B. Hendricks, Stratford, Ontario, Canada + 2002-2005 László Németh +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: extensions/spellcheck/hunspell/src/phonet.cxx + extensions/spellcheck/hunspell/src/phonet.hxx +Copyright: 2000, 2007 Bjoern Jacke + 2007, László Németh +License: LGPL-2.1 + +Files: extensions/spellcheck/locales/en-US/hunspell/* +Copyright: various contributors +License: other-2 + The complete text of the hunspell License can be found in the + `README_en_US.txt' file in the same directory as this file. + +Files: gfx/cairo/cairo/* +Copyright: 2005-2008, RedHat, Inc. + 2003, University of Southern California + 2007-2008, Carl D. Worth , + Kristian Høgsberg , + Keith Packard , + Adrian Johnson + various contributors +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-analysis-surface-private.h + gfx/cairo/cairo/src/cairo-scaled-font.c + gfx/cairo/cairo/src/cairo-wideint-private.h + gfx/cairo/cairo/src/cairo-wideint-type-private.h + gfx/cairo/cairo/src/cairo-wideint.c +Copyright: 2004-2005, Keith Packard +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-analysis-surface.c +Copyright: 2007, Adrian Johnson + 2006, Keith Packard +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-arc.c + gfx/cairo/cairo/src/cairo-directfb-surface.c + gfx/cairo/cairo/src/cairo-directfb.h + gfx/cairo/cairo/src/cairo-fixed.c + gfx/cairo/cairo/src/cairo-glitz.h + gfx/cairo/cairo/src/cairo-hull.c + gfx/cairo/cairo/src/cairo-matrix.c + gfx/cairo/cairo/src/cairo-path-bounds.c + gfx/cairo/cairo/src/cairo-path-fill.c + gfx/cairo/cairo/src/cairo-path-stroke.c + gfx/cairo/cairo/src/cairo-pdf.h + gfx/cairo/cairo/src/cairo-png.c + gfx/cairo/cairo/src/cairo-polygon.c + gfx/cairo/cairo/src/cairo-ps.h + gfx/cairo/cairo/src/cairo-skia.h + gfx/cairo/cairo/src/cairo-slope.c + gfx/cairo/cairo/src/cairo-spline.c + gfx/cairo/cairo/src/cairo-xcb-xrender.h + gfx/cairo/cairo/src/cairo-xlib-xrender.h + gfx/cairo/cairo/src/cairo-xlib.h +Copyright: 2002-2003, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-atomic-private.h +Copyright: 2010, Andrea Canciani + 2007, Chris Wilson +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-atomic.c + gfx/cairo/cairo/src/cairo-combsort-private.h + gfx/cairo/cairo/src/cairo-drm.h + gfx/cairo/cairo/src/cairo-freed-pool-private.h + gfx/cairo/cairo/src/cairo-freed-pool.c + gfx/cairo/cairo/src/cairo-list-private.h + gfx/cairo/cairo/src/cairo-path-in-fill.c + gfx/cairo/cairo/src/cairo-reference-count-private.h + gfx/cairo/cairo/src/cairo-rtree-private.h + gfx/cairo/cairo/src/cairo-rtree.c + gfx/cairo/cairo/src/cairo-script-surface.c + gfx/cairo/cairo/src/cairo-script.h + gfx/cairo/cairo/src/cairo-surface-clipper-private.h + gfx/cairo/cairo/src/cairo-surface-clipper.c + gfx/cairo/cairo/src/cairo-tee-surface-private.h + gfx/cairo/cairo/src/cairo-tee.h + gfx/cairo/cairo/src/cairo-xlib-display.c + gfx/cairo/cairo/src/cairo-xml-surface.c + gfx/cairo/cairo/src/cairo-xml.h +Copyright: 2007-2009, Chris Wilson +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-base64-stream.c +Copyright: 2009, Chris Wilson + 2005-2007, Emmanuel Pacaud +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-bentley-ottmann-rectangular.c + gfx/cairo/cairo/src/cairo-bentley-ottmann-rectilinear.c + gfx/cairo/cairo/src/cairo-bentley-ottmann.c +Copyright: 2008-2009, Chris Wilson + 2006, Red Hat, Inc + 2004, Carl Worth +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-beos-surface.cpp + gfx/cairo/cairo/src/cairo-beos.h +Copyright: 2005, Christian Biesinger +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-botor-scan-converter.c +Copyright: 2009, Intel Corporation + 2008, M Joonas Pihlaja + 2008, Chris Wilson + 2007, David Turner + 2006, Red Hat, Inc + 2004, Carl Worth +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-boxes-private.h + gfx/cairo/cairo/src/cairo-boxes.c + gfx/cairo/cairo/src/cairo-composite-rectangles-private.h + gfx/cairo/cairo/src/cairo-composite-rectangles.c + gfx/cairo/cairo/src/cairo-device-private.h + gfx/cairo/cairo/src/cairo-device.c + gfx/cairo/cairo/src/cairo-observer.c + gfx/cairo/cairo/src/cairo-rectangular-scan-converter.c + gfx/cairo/cairo/src/cairo-surface-snapshot-private.h + gfx/cairo/cairo/src/cairo-surface-subsurface-private.h + gfx/cairo/cairo/src/cairo-surface-subsurface.c +Copyright: 2009-2010, Intel Corporation +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-cff-subset.c + gfx/cairo/cairo/src/cairo-deflate-stream.c + gfx/cairo/cairo/src/cairo-image-info-private.h + gfx/cairo/cairo/src/cairo-image-info.c + gfx/cairo/cairo/src/cairo-type3-glyph-surface-private.h + gfx/cairo/cairo/src/cairo-type3-glyph-surface.c + gfx/cairo/cairo/src/cairo-win32-printing-surface.c +Copyright: 2006-2008, Adrian Johnson +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-clip.c + gfx/cairo/cairo/src/cairo-surface-offset-private.h + gfx/cairo/cairo/src/cairo-surface-wrapper-private.h +Copyright: 2009, Chris Wilson + 2005, Red Hat, Inc. + 2002, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-color.c + gfx/cairo/cairo/src/cairo-compiler-private.h + gfx/cairo/cairo/src/cairo-error-private.h + gfx/cairo/cairo/src/cairo-gstate.c + gfx/cairo/cairo/src/cairo-path-fixed.c + gfx/cairo/cairo/src/cairo-ps-surface-private.h + gfx/cairo/cairo/src/cairo-rectangle.c + gfx/cairo/cairo/src/cairo-scaled-font-private.h + gfx/cairo/cairo/src/cairo-slope-private.h + gfx/cairo/cairo/src/cairo-surface-fallback-private.h + gfx/cairo/cairo/src/cairo-surface-fallback.c + gfx/cairo/cairo/src/cairo-surface-private.h + gfx/cairo/cairo/src/cairo-surface.c + gfx/cairo/cairo/src/cairo-types-private.h + gfx/cairo/cairo/src/cairo-version.c + gfx/cairo/cairo/src/cairo-xlib-surface.c + gfx/cairo/cairo/src/cairo.c + gfx/cairo/cairo/src/cairo.h + gfx/cairo/cairo/src/cairoint.h +Copyright: 2005, 2006, Red Hat, Inc. + 2002, 2003, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-dwrite-font.cpp + gfx/cairo/cairo/src/cairo-dwrite-private.h + gfx/cairo/cairo/src/cairo-win32-refptr.h +Copyright: 2010, Mozilla Foundation +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-eagle-context.c + gfx/cairo/cairo/src/cairo-gl-private.h + gfx/cairo/cairo/src/cairo-gl-surface.c + gfx/cairo/cairo/src/cairo-glx-context.c +Copyright: 2009, Eric Anholt + 2009, Chris Wilson + 2005, 2010, Red Hat, Inc +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-fixed-private.h + gfx/cairo/cairo/src/cairo-fixed-type-private.h + gfx/cairo/cairo/src/cairo-malloc-private.h + gfx/cairo/cairo/src/cairo-qt-surface.cpp + gfx/cairo/cairo/src/cairo-qt.h + gfx/cairo/cairo/src/cairo-quartz-font.c + gfx/cairo/cairo/src/cairo-quartz-image-surface.c + gfx/cairo/cairo/src/cairo-quartz-image.h + gfx/cairo/cairo/src/cairo-quartz-surface.c + gfx/cairo/cairo/src/cairo-quartz.h +Copyright: 2006-2008, Mozilla Corporation +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-font-face-twin.c + gfx/cairo/cairo/src/cairo-ft-font.c + gfx/cairo/cairo/src/cairo-traps.c + gfx/cairo/cairo/src/cairo-xlib-screen.c +Copyright: 2005, 2007, 2008, Red Hat, Inc + 2000, 2002, 2004, Keith Packard +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-font-face.c + gfx/cairo/cairo/src/cairo-toy-font-face.c +Copyright: 2005, 2008, Red Hat, Inc. + 2002, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-font-options.c +Copyright: 2005, Red Hat, Inc. +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-fontconfig-private.h +Copyright: 2010, Intel Corporation + 2005, Red Hat, Inc. + 2000, Keith Packard +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-gl-glyphs.c +Copyright: 2010, Red Hat, Inc., Intel Corporation + 2009, Chris Wilson +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-gl-shaders.c +Copyright: 2010, Red Hat, Inc., Eric Anholt + 2009, T. Zachary Laine +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-gl.h +Copyright: 2009, Eric Anholt + 2009, Chris Wilson +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-image-surface.c + gfx/cairo/cairo/src/cairo-xcb-surface.c + gfx/cairo/cairo/src/cairo-xcb.h +Copyright: 2009-2010, Intel Corporation + 2002, 2003, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-misc.c + gfx/cairo/cairo/src/cairo-ps-surface.c +Copyright: 2007, 2008, Adrian Johnson + 2005, Red Hat, Inc. +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-mutex-impl-private.h + gfx/cairo/cairo/src/cairo-mutex-private.h + gfx/cairo/cairo/src/cairo-mutex-type-private.h +Copyright: 2007, Mathias Hasselmann + 2005, 2007, Red Hat, Inc. + 2002, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-mutex-list-private.h + gfx/cairo/cairo/src/cairo-mutex.c +Copyright: 2007, Mathias Hasselmann +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-os2-private.h + gfx/cairo/cairo/src/cairo-os2-surface.c + gfx/cairo/cairo/src/cairo-os2.h +Copyright: 2005, 2006, netlabs.org +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-paginated-surface.c + gfx/cairo/cairo/src/cairo-pdf-operators-private.h + gfx/cairo/cairo/src/cairo-pdf-operators.c + gfx/cairo/cairo/src/cairo-pdf-surface-private.h + gfx/cairo/cairo/src/cairo-pdf-surface.c + gfx/cairo/cairo/src/cairo-recording-surface.c +Copyright: 2007, 2008, Adrian Johnson + 2004-2006, Red Hat, Inc +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-pen.c +Copyright: 2008, Chris Wilson + 2002, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-platform.h +Copyright: 2005, Mozilla Foundation +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-quartz-private.h +Copyright: 2006-2007, Mozilla Corporation + 2004, Calum Robinson +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-scaled-font-subsets.c +Copyright: 2006, Keith Packard + 2005, 2006, Red Hat, Inc. + 2003, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-spans-private.h + gfx/cairo/cairo/src/cairo-spans.c +Copyright: 2008, M Joonas Pihlaja +License: Expat + +Files: gfx/cairo/cairo/src/cairo-surface-offset.c + gfx/cairo/cairo/src/cairo-surface-wrapper.c +Copyright: 2009, Chris Wilson + 2007, Adrian Johnson + 2005, Red Hat, Inc. +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-surface-snapshot.c +Copyright: 2009, Intel Corporation + 2005, Red Hat, Inc + 2002, University of Southern California +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-svg-surface-private.h + gfx/cairo/cairo/src/cairo-svg-surface.c +Copyright: 2005-2007, Emmanuel Pacaud + 2004, 2006, Red Hat, Inc. +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-svg.h +Copyright: 2005, Emmanuel Pacaud +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-tee-surface.c +Copyright: 2009, Chris Wilson + 2005, Red Hat, Inc. +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-tor-scan-converter.c +Copyright: 2008, M Joonas Pihlaja + 2007, David Turner +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-unicode.c +Copyright: 2005, Red Hat, Inc + 1999, Tom Tromey +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-vg-surface.c +Copyright: 2009, Chris Wilson + 2008, Opened Hand Ltd +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/cairo/src/cairo-vg.h +Copyright: 2009, Chris Wilson + 2007, Mozilla Corporation +License: MPL-1.1 or LGPL-2.1 + +Files: gfx/cairo/libpixman/src/* +Copyright: 2000 Keith Packard, member of The XFree86 Project, Inc., + 2005 Lars Knoll & Zack Rusin, Trolltech + 2008 Aaron Plattner, NVIDIA Corporation + 2008 Mozilla Corporation + 1999,2004 Keith Packard + 2000 SuSE, Inc. + 2004,2005,2007,2008 Red Hat, Inc. + 2004 Nicholas Miell + 2005 Trolltech AS + 2008 Rodrigo Kumpera + 2008 André Tupinambá + 2007 Luca Barbato +License: other-3 + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation, and that the name of the copyright holder not be used in + advertising or publicity pertaining to distribution of the software without + specific, written prior permission. The copyright holder makes no + representations about the suitability of this software for any purpose. It + is provided "as is" without express or implied warranty. + . + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + +Files: gfx/cairo/libpixman/src/pixman-arm-common.h + gfx/cairo/libpixman/src/pixman-arm-neon-asm.h +Copyright: 2009-2010, Nokia Corporation +License: Expat + +Files: gfx/cairo/libpixman/src/pixman-combine-float.c +Copyright: 2010, 2012, Soren Sandmann Pedersen + 2010, 2012, Red Hat, Inc. +License: Expat + +Files: gfx/cairo/libpixman/src/pixman-filter.c +Copyright: 2012, Soren Sandmann + 2012, Red Hat, Inc. +License: Expat + +Files: gfx/cairo/libpixman/src/pixman-glyph.c +Copyright: 2010-2012, Red Hat, Inc. + 2010, 2012, Soren Sandmann +License: Expat + +Files: gfx/cairo/libpixman/src/pixman-mips-dspr2-asm.h + gfx/cairo/libpixman/src/pixman-mips-dspr2.c + gfx/cairo/libpixman/src/pixman-mips-dspr2.h +Copyright: 2012, MIPS Technologies, Inc. +License: BSD-3-clause + +Files: gfx/cairo/libpixman/src/pixman-noop.c + gfx/cairo/libpixman/src/pixman-version.h +Copyright: 1996, 1998-1999, 2007-2009, 2011, 2013, Red Hat, Inc. +License: Expat + +Files: gfx/cairo/libpixman/src/pixman-region.c +Copyright: 1998, Keith Packard + 1987-1989, Digital Equipment Coportation + 1987-1989, The Open Group +License: other-4 + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + Except as contained in this notice, the name of The Open Group shall not be + used in advertising or otherwise to promote the sale, use or other dealings + in this Software without prior written authorization from The Open Group. + . + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Digital not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + . + DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + +Files: gfx/cairo/libpixman/src/pixman.h +Copyright: 2007, Red Hat, Inc. + 1998, 2004, Keith Packard + 1987, Digital Equipment Corporation, Maynard, Massachusetts + 1987, 1998, The Open Group +License: other-5 + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + Except as contained in this notice, the name of The Open Group shall not be + used in advertising or otherwise to promote the sale, use or other dealings + in this Software without prior written authorization from The Open Group. + . + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Digital not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + . + DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + +Files: gfx/gl/ForceDiscreteGPUHelperCGL.h +Copyright: The Chromium Authors +License: MPL-2.0 + +Files: gfx/graphite2/* +Copyright: 2010-2013, SIL International +License: LGPL-2.1 + +Files: gfx/graphite2/src/MozGrMalloc.h +Copyright: no-info-found +License: MPL-2.0 + +Files: gfx/harfbuzz/* +Copyright: 1998-2004 David Turner and Werner Lemberg + 2005 David Turner + 2004, 2007-2009, 2010 Red Hat, Inc. + 2006 Behdad Esfahbod + 2007 Chris Wilson + 2009 Martin Hosken and SIL International + 2009 Keith Stribley + 2010, 2012 Mozilla Foundation + 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) + 2011 Codethink Limited + 2010,2011,2012 Google, Inc. +License: old-MIT + +Files: gfx/harfbuzz/src/hb-blob.cc + gfx/harfbuzz/src/hb-blob.h + gfx/harfbuzz/src/hb-face.h + gfx/harfbuzz/src/hb-font.h + gfx/harfbuzz/src/hb-ft.h + gfx/harfbuzz/src/hb-ot-layout.h + gfx/harfbuzz/src/hb-ot-shape.h + gfx/harfbuzz/src/hb-ot.h + gfx/harfbuzz/src/hb.h + gfx/harfbuzz/src/main.cc +Copyright: 1996, 1998-1999, 2007-2009, 2011, 2013, Red Hat, Inc. +License: Expat + +Files: gfx/harfbuzz/src/hb-buffer.cc + gfx/harfbuzz/src/hb-buffer.h +Copyright: 2011-2012, Google, Inc. + 2004, 2007, 2009, 2010, Red Hat, Inc. + 1998-2004, David Turner and Werner Lemberg +License: Expat + +Files: gfx/harfbuzz/src/hb-common.cc + gfx/harfbuzz/src/hb-common.h + gfx/harfbuzz/src/hb-face.cc + gfx/harfbuzz/src/hb-font.cc + gfx/harfbuzz/src/hb-glib.cc + gfx/harfbuzz/src/hb-glib.h + gfx/harfbuzz/src/hb-icu.h + gfx/harfbuzz/src/hb-ot-head-table.hh + gfx/harfbuzz/src/hb-ot-layout-gdef-table.hh + gfx/harfbuzz/src/hb-ot-layout-gpos-table.hh + gfx/harfbuzz/src/hb-ot-layout-gsub-table.hh + gfx/harfbuzz/src/hb-ot-map.cc + gfx/harfbuzz/src/hb-ot-shape.cc + gfx/harfbuzz/src/hb-ot-tag.cc + gfx/harfbuzz/src/hb-shape.cc + gfx/harfbuzz/src/hb-shape.h +Copyright: 2010-2013, Google, Inc. + 2007-2010, Red Hat, Inc. +License: Expat + +Files: gfx/harfbuzz/src/hb-coretext.cc +Copyright: 2012-2013, Mozilla Foundation + 2012-2013, Google, Inc. +License: Expat + +Files: gfx/harfbuzz/src/hb-coretext.h +Copyright: 2008-2014, Mozilla Foundation +License: Expat + +Files: gfx/harfbuzz/src/hb-ft.cc +Copyright: 2009, Red Hat, Inc. + 2009, Keith Stribley +License: Expat + +Files: gfx/harfbuzz/src/hb-graphite2.cc +Copyright: 2011, SIL International + 2011, Martin Hosken + 2011-2012, Google, Inc. +License: Expat + +Files: gfx/harfbuzz/src/hb-graphite2.h +Copyright: 2011, SIL International + 2011, Martin Hosken +License: Expat + +Files: gfx/harfbuzz/src/hb-icu.cc +Copyright: 2011, Google, Inc. + 2009, Red Hat, Inc. + 2009, Keith Stribley +License: Expat + +Files: gfx/harfbuzz/src/hb-ot-layout.cc +Copyright: 2012-2013, Google, Inc. + 2007-2009, Red Hat, Inc. + 2006, Behdad Esfahbod + 1998-2004, David Turner and Werner Lemberg +License: Expat + +Files: gfx/harfbuzz/src/hb-unicode.cc + gfx/harfbuzz/src/hb-unicode.h +Copyright: 2011, Codethink Limited + 2010-2012, Google, Inc. + 2009, Red Hat, Inc. +License: Expat + +Files: gfx/ots/* +Copyright: 2009 The Chromium Authors +License: BSD-3-clause + +Files: gfx/ots/sync.sh +Copyright: no-info-found +License: MPL-2.0 + +Files: gfx/qcms/* +Copyright: 2009, Mozilla Foundation + 1998-2007, Marti Maria +License: Expat + +Files: gfx/qcms/chain.c +Copyright: 2009, Mozilla Corporation + 1998-2007, Marti Maria +License: Expat + +Files: gfx/qcms/qcms.h +Copyright: 1994-1996, SunSoft, Inc. +License: Expat + +Files: gfx/thebes/gfxScriptItemizer.cpp + gfx/thebes/gfxScriptItemizer.h +Copyright: 1995-2009, International Business Machines (IBM) +License: MPL-2.0 or Expat + +Files: gfx/ycbcr/* +Copyright: 2006-2008 The Chromium Authors +License: BSD-3-clause + +Files: gfx/ycbcr/YCbCrUtils.cpp + gfx/ycbcr/YCbCrUtils.h + gfx/ycbcr/chromium_types.h + gfx/ycbcr/ycbcr_to_rgb565.cpp +Copyright: no-info-found +License: MPL-2.0 + +Files: intl/icu/source/tools/tzcode/* +Copyright: no-info-found +License: public-domain + +Files: intl/unicharutil/util/nsBidiUtils.cpp + intl/unicharutil/util/nsUnicharUtils.h +Copyright: 2000-2002, Japan Network Information Center +License: MPL-2.0 or BSD-3-clause + +Files: intl/unicharutil/util/nsUnicodePropertyData.cpp + intl/unicharutil/util/nsUnicodeScriptCodes.h +Copyright: 1991-2014, Unicode, Inc. +License: MPL-2.0 + +Files: ipc/chromium/* +Copyright: 2006-2008 The Chromium Authors +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/* +Copyright: 2007-2012, Niels Provos and Nick Mathewson + 2000-2009, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/* +Copyright: 2000-2002 Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/WIN32-Code/tree.h +Copyright: 2002, Niels Provos +License: BSD-2-clause + +Files: ipc/chromium/src/third_party/libevent/arc4random.c +Copyright: 2010-2012, Niels Provos and Nick Mathewson + 2010, Chris Davis, Niels Provos, and Nick Mathewson + 2008, Damien Miller + 1996, David Mazieres +License: ISC + +Files: ipc/chromium/src/third_party/libevent/buffer_iocp.c + ipc/chromium/src/third_party/libevent/bufferevent-internal.h + ipc/chromium/src/third_party/libevent/bufferevent_async.c + ipc/chromium/src/third_party/libevent/bufferevent_openssl.c + ipc/chromium/src/third_party/libevent/changelist-internal.h + ipc/chromium/src/third_party/libevent/defer-internal.h + ipc/chromium/src/third_party/libevent/evmap-internal.h + ipc/chromium/src/third_party/libevent/evmap.c + ipc/chromium/src/third_party/libevent/evthread_pthread.c + ipc/chromium/src/third_party/libevent/evthread_win32.c + ipc/chromium/src/third_party/libevent/evutil.c + ipc/chromium/src/third_party/libevent/evutil_rand.c + ipc/chromium/src/third_party/libevent/iocp-internal.h + ipc/chromium/src/third_party/libevent/ipv6-internal.h + ipc/chromium/src/third_party/libevent/mm-internal.h + ipc/chromium/src/third_party/libevent/ratelim-internal.h + ipc/chromium/src/third_party/libevent/util-internal.h +Copyright: 2007-2012, Niels Provos and Nick Mathewson +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/bufferevent.c + ipc/chromium/src/third_party/libevent/epoll.c +Copyright: 2007-2012, Niels Provos, Nick Mathewson + 2000-2007, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/bufferevent_pair.c + ipc/chromium/src/third_party/libevent/event_iocp.c + ipc/chromium/src/third_party/libevent/evthread-internal.h + ipc/chromium/src/third_party/libevent/evthread.c + ipc/chromium/src/third_party/libevent/listener.c +Copyright: 2008-2012, Niels Provos, Nick Mathewson +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/compat/* +Copyright: 1991, 1993, University of California +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/evdns.c +Copyright: 2007-2012, Nick Mathewson and Niels Provos + 2006-2007, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/evport.c +Copyright: 2007-2012, Niels Provos and Nick Mathewson + 2007, Sun Microsystems + 2006-2007, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/include/event2/buffer.h + ipc/chromium/src/third_party/libevent/include/event2/buffer_compat.h + ipc/chromium/src/third_party/libevent/include/event2/bufferevent_ssl.h + ipc/chromium/src/third_party/libevent/include/event2/thread.h + ipc/chromium/src/third_party/libevent/include/event2/util.h +Copyright: 2007-2012, Niels Provos and Nick Mathewson +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/include/event2/bufferevent_compat.h +Copyright: 2007-2012, Niels Provos, Nick Mathewson + 2000-2007, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/include/event2/dns.h +Copyright: 2007-2012, Niels Provos and Nick Mathewson + 2006-2007, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/log.c +Copyright: 2005-2012, Niels Provos and Nick Mathewson + 2000, Dug Song + 1993, University of California +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/minheap-internal.h +Copyright: 2007-2012, Niels Provos and Nick Mathewson + 2006, Maxim Yegorushkin +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/strlcpy.c +Copyright: 1998, Todd C. Miller +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/test/* +Copyright: 2007-2012, Niels Provos and Nick Mathewson +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/test/bench.c + ipc/chromium/src/third_party/libevent/test/regress.c + ipc/chromium/src/third_party/libevent/test/regress.h + ipc/chromium/src/third_party/libevent/test/regress_buffer.c + ipc/chromium/src/third_party/libevent/test/regress_bufferevent.c + ipc/chromium/src/third_party/libevent/test/regress_dns.c + ipc/chromium/src/third_party/libevent/test/regress_http.c + ipc/chromium/src/third_party/libevent/test/regress_main.c + ipc/chromium/src/third_party/libevent/test/regress_rpc.c + ipc/chromium/src/third_party/libevent/test/test-eof.c + ipc/chromium/src/third_party/libevent/test/test-init.c + ipc/chromium/src/third_party/libevent/test/test-time.c + ipc/chromium/src/third_party/libevent/test/test-weof.c +Copyright: 2007-2012, Niels Provos and Nick Mathewson + 2000-2009, Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/test/regress_util.c +Copyright: 2009-2012, Nick Mathewson and Niels Provos +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/test/tinytest.c + ipc/chromium/src/third_party/libevent/test/tinytest.h + ipc/chromium/src/third_party/libevent/test/tinytest_macros.h +Copyright: 2009-2012, Nick Mathewson +License: BSD-3-clause + +Files: ipc/chromium/src/third_party/libevent/win32select.c +Copyright: 2007-2012, Niels Provos and Nick Mathewson + 2003, Michael A. Davis + 2000-2007, Niels Provos +License: BSD-3-clause + +Files: ipc/glue/StringUtil.cpp +Copyright: 2006-2008, The Chromium Authors. +License: MPL-2.0 + +Files: ipc/ipdl/test/cxx/IPDLUnitTestProcessChild.cpp + ipc/ipdl/test/cxx/IPDLUnitTestProcessChild.h + ipc/ipdl/test/cxx/IPDLUnitTestSubprocess.cpp + ipc/ipdl/test/cxx/IPDLUnitTestSubprocess.h + ipc/ipdl/test/cxx/IPDLUnitTestTypes.h + ipc/ipdl/test/cxx/IPDLUnitTests.h + ipc/ipdl/test/cxx/TestHighestPrio.cpp + ipc/ipdl/test/cxx/genIPDLUnitTests.py + ipc/ipdl/test/cxx/app/* +Copyright: no-info-found +License: MPL-2.0 + +Files: js/src/builtin/embedjs.py +Copyright: 2012, the V8 project authors +License: MPL-2.0 or BSD-3-clause + +Files: js/src/ctypes/libffi/ltmain.sh +Copyright: 1996-2001, 2003-2006, Free Software Foundation +License: GPL-2+ + +Files: js/src/ctypes/libffi/msvcc.sh +Copyright: 2009, Daniel Witte +License: MPL-1.1 or GPL-2 or LGPL-2.1 + +Files: js/src/ctypes/libffi/src/* +Copyright: 2011-2013, Anthony Green + 1996-2004, 2007, 2008, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/aarch64/* +Copyright: 2009-2012, ARM Ltd. +License: Expat + +Files: js/src/ctypes/libffi/src/arc/* +Copyright: 2013, Synopsys, Inc. (www.synopsys.com) + 2012, Anthony Green +License: Expat + +Files: js/src/ctypes/libffi/src/arc/ffi.c +Copyright: 2013, Synopsys, Inc. (www.synopsys.com) +License: Expat + +Files: js/src/ctypes/libffi/src/arm/* +Copyright: 2012, Anthony Green + 2010, CodeSourcery + 1996-2003, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/arm/ffi.c +Copyright: 2011, Timothy Wall + 2011, Plausible Labs Cooperative, Inc. + 2011, Free Software Foundation + 2011, Anthony Green + 1998, 2008, 2011, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/arm/gentramp.sh +Copyright: 2010, Plausible Labs Cooperative, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/avr32/* +Copyright: 2011-2012, Anthony Green + 2009, Bradley Smith +License: Expat + +Files: js/src/ctypes/libffi/src/bfin/* +Copyright: 2012, Alexandre K. I. de Mendonca +License: Expat + +Files: js/src/ctypes/libffi/src/closures.c +Copyright: 2011, Plausible Labs Cooperative, Inc + 2007, 2009-2010, Red Hat, Inc + 2007, 2009-2010, Free Software Foundation, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/cris/ffi.c +Copyright: 2007, Free Software Foundation, Inc. + 2005, Axis Communications AB + 2004, Simon Posnjak + 1998, Cygnus Solutions +License: Expat + +Files: js/src/ctypes/libffi/src/debug.c + js/src/ctypes/libffi/src/java_raw_api.c + js/src/ctypes/libffi/src/raw_api.c + js/src/ctypes/libffi/src/types.c +Copyright: 1996, 1998, 1999, 2007-2009, 2011, 2013, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/frv/ffi.c +Copyright: 2008, Red Hat, Inc. + 2007, Free Software Foundation, Inc. + 2004, Anthony Green +License: Expat + +Files: js/src/ctypes/libffi/src/ia64/ffi.c +Copyright: 2011, Anthony Green + 2000, Hewlett Packard Company + 1998, 2007, 2008, 2012, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/ia64/ia64_flags.h +Copyright: 2000, Hewlett Packard Company +License: Expat + +Files: js/src/ctypes/libffi/src/m32r/* +Copyright: 2008, Red Hat, Inc. + 2004, Renesas Technology +License: Expat + +Files: js/src/ctypes/libffi/src/m32r/ffitarget.h +Copyright: 2012, Anthony Green + 2004, Renesas Technology +License: Expat + +Files: js/src/ctypes/libffi/src/m88k/* +Copyright: 2013, Miodrag Vallat. +License: Expat + +Files: js/src/ctypes/libffi/src/metag/* +Copyright: 2013, Imagination Technologies Ltd. +License: Expat + +Files: js/src/ctypes/libffi/src/metag/ffi.c +Copyright: 2013, Imagination Technologies +License: Expat + +Files: js/src/ctypes/libffi/src/microblaze/* +Copyright: 2012, 2013, Xilinx, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/mips/ffi.c +Copyright: 2011, Anthony Green + 2008, David Daney + 1996, 2007, 2008, 2011, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/moxie/* +Copyright: 2012, 2013, Anthony Green +License: Expat + +Files: js/src/ctypes/libffi/src/nios2/* +Copyright: 2013, Mentor Graphics +License: Expat + +Files: js/src/ctypes/libffi/src/pa/ffi.c +Copyright: 2011, Anthony Green + 2008, Red Hat, Inc. + 2006, Free Software Foundation, Inc. + 2003, 2004, Randolph Chung +License: Expat + +Files: js/src/ctypes/libffi/src/powerpc/* +Copyright: 2013, IBM + 2011, Kyle Moffett + 2011, Anthony Green + 2008, Red Hat, Inc. + 2007, 2008, Free Software Foundation, Inc. + 1998, Geoffrey Keating +License: Expat + +Files: js/src/ctypes/libffi/src/powerpc/asm.h +Copyright: 1998, Geoffrey Keating +License: Expat + +Files: js/src/ctypes/libffi/src/powerpc/ffi_darwin.c +Copyright: 2002, 2006, 2007-2009-2010, Free Software Foundation, Inc. + 2001, John Hornkvist + 1998, Geoffrey Keating +License: Expat + +Files: js/src/ctypes/libffi/src/powerpc/ffitarget.h +Copyright: 2012, Anthony Green + 2007-2008, 2010, Free Software Foundation, Inc. + 1996-2003, 2010, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/s390/ffi.c +Copyright: 2008, Red Hat, Inc. + 2000-2007, Software AG +License: Expat + +Files: js/src/ctypes/libffi/src/sh/ffi.c +Copyright: 2008, Red Hat, Inc. + 2002-2008, 2012, Kaz Kojima +License: Expat + +Files: js/src/ctypes/libffi/src/sh64/ffi.c +Copyright: 2008, Anthony Green + 2003, 2004, 2006-2007, 2012, Kaz Kojima +License: Expat + +Files: js/src/ctypes/libffi/src/tile/* +Copyright: 2012, Tilera Corp +License: Expat + +Files: js/src/ctypes/libffi/src/vax/* +Copyright: 2013, Miodrag Vallat. +License: Expat + +Files: js/src/ctypes/libffi/src/x86/* +Copyright: 2012, Anthony Green + 2007, 2008, 2010, Free Software Foundation, Inc. + 1996-2003, 2010, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/x86/ffi.c +Copyright: 2008, 2010, Free Software Foundation, Inc. + 2002, Roger Sayle + 2002, Ranjit Mathew + 2002, Bo Thorsen + 1996, 1998-1999, 2001, 2007-2008, Red Hat, Inc. +License: Expat + +Files: js/src/ctypes/libffi/src/x86/ffi64.c +Copyright: 2013, The Written Word, Inc. + 2011, Anthony Green + 2008, 2010, Red Hat, Inc. + 2002, 2007, Bo Thorsen +License: Expat + +Files: js/src/ctypes/libffi/src/xtensa/* +Copyright: 2013, Tensilica, Inc. +License: Expat + +Files: js/src/ctypes/libffi/texinfo.tex +Copyright: 1985-1986, 1988, 1990-1995, +License: GPL-3 + +Files: js/src/devtools/rootAnalysis/analyze.py + js/src/devtools/vprof/testVprofMT.c + js/src/jit/BacktrackingAllocator.h +Copyright: no-info-found +License: MPL-2.0 + +Files: js/src/editline/* +Copyright: 1992-1993, Simmule Turner and Rich Salz +License: MPL-2.0 + +Files: js/src/irregexp/* +Copyright: 2006-2014, the V8 project authors +License: BSD-3-clause + +Files: js/src/jit/ExecutableAllocator.cpp + js/src/jit/ExecutableAllocator.h +Copyright: 2006-2009, 2012, Apple Inc. +License: BSD-2-clause + +Files: js/src/jit/arm/Simulator-arm.cpp + js/src/jit/arm/Simulator-arm.h + js/src/octane/* +Copyright: 2006-2014, the V8 project authors +License: BSD-3-clause + +Files: js/src/octane/code-load.js +Copyright: 2013, the Octane Benchmark project authors + 2012, The Closure Library Authors + 2012, John Resig, http://jquery.com +License: Apache-2.0 or BSD-3-clause or Expat + +Files: js/src/octane/deltablue.js +Copyright: 2008, the V8 project authors + 1996, John Maloney and Mario Wolczko +License: GPL-2+ + +Files: js/src/octane/gbemu-part1.js + js/src/octane/gbemu-part2.js +Copyright: 2013, Google, Inc. + 2010-2012, Grant Galitz +License: GPL-2 + +Files: js/src/octane/mandreel.js +Copyright: 2012, Onan Games + 2012, Google, Inc.F +License: BSD-3-clause + +Files: js/src/octane/navier-stokes.js +Copyright: 2013, the V8 project authors + 2009, Oliver Hunt +License: Expat + +Files: js/src/octane/typescript.js +Copyright: 2013, the Octane Benchmark project authors +License: BSD-3-clause + +Files: js/src/tests/lib/jittests.py + js/src/tests/shell/shell.js + js/src/tests/test262/browser.js + js/src/tests/test262/intl402/shell.js + js/xpconnect/tests/unit/component-blob.js + js/xpconnect/tests/unit/component-file.js + js/xpconnect/tests/unit/component_import.js + js/xpconnect/tests/unit/head_watchdog.js + js/xpconnect/tests/unit/test_attributes.js + js/xpconnect/tests/unit/test_blob.js + js/xpconnect/tests/unit/test_blob2.js + js/xpconnect/tests/unit/test_bogus_files.js + js/xpconnect/tests/unit/test_bug1021312.js + js/xpconnect/tests/unit/test_bug408412.js + js/xpconnect/tests/unit/test_bug451678.js + js/xpconnect/tests/unit/test_bug780370.js + js/xpconnect/tests/unit/test_bug809652.js + js/xpconnect/tests/unit/test_bug809674.js + js/xpconnect/tests/unit/test_bug813901.js + js/xpconnect/tests/unit/test_bug867486.js + js/xpconnect/tests/unit/test_bug976151.js + js/xpconnect/tests/unit/test_bug_442086.js + js/xpconnect/tests/unit/test_file.js + js/xpconnect/tests/unit/test_file2.js + js/xpconnect/tests/unit/test_import.js + js/xpconnect/tests/unit/test_js_weak_references.js + js/xpconnect/tests/unit/test_nuke_sandbox.js + js/xpconnect/tests/unit/test_params.js + js/xpconnect/tests/unit/test_recursive_import.js + js/xpconnect/tests/unit/test_reflect_parse.js + js/xpconnect/tests/unit/test_returncode.js + js/xpconnect/tests/unit/test_sandbox_metadata.js + js/xpconnect/tests/unit/test_tearoffs.js + js/xpconnect/tests/unit/test_unload.js + js/xpconnect/tests/unit/test_watchdog_default.js + js/xpconnect/tests/unit/test_watchdog_disable.js + js/xpconnect/tests/unit/test_watchdog_enable.js + js/xpconnect/tests/unit/test_watchdog_hibernate.js + js/xpconnect/tests/unit/test_watchdog_toggle.js + js/xpconnect/tests/unit/test_xpcomutils.js + layout/base/tests/marionette/* + layout/reftests/border-image/* + layout/reftests/svg/* + layout/reftests/table-dom/* + layout/reftests/w3c-css/* + media/libcubeb/include/* + media/libcubeb/src/cubeb_osx_run_loop.c +Copyright: no-info-found +License: MPL-2.0 + +Files: js/src/tests/test262/intl402/browser.js +Copyright: 2012, Mozilla Corporation +License: MPL-2.0 + +Files: js/src/vtune/* +Copyright: 2005-2013, Intel Corporation +License: BSD-3-clause or GPL-2 + +Files: layout/base/nsFrameManager.cpp + layout/base/nsFrameManager.h + layout/generic/nsLineLayout.h + layout/style/nsHTMLStyleSheet.cpp +Copyright: 2000, International Business Machines (IBM) +License: MPL-2.0 + +Files: layout/reftests/fonts/mark-generate.py + layout/reftests/fonts/math/* +Copyright: 2008, Mozilla Corporation +License: MPL-2.0 + +Files: media/gmp-clearkey/0.1/WMFH264Decoder.cpp + media/gmp-clearkey/0.1/WMFH264Decoder.h + media/gmp-clearkey/0.1/WMFUtils.cpp + media/gmp-clearkey/0.1/WMFUtils.h +Copyright: 2012-2014, Mozilla Foundation and contributors +License: Apache-2.0 + +Files: media/kiss_fft/_kiss_fft_guts.h + media/kiss_fft/kiss_fft.c + media/kiss_fft/kiss_fftr.c +Copyright: 2003-2010, Mark Borgerding +License: BSD-3-clause + +Files: media/libcubeb/src/android/* +Copyright: 2005-2013, The Android Open Source Project +License: Apache-2.0 + +Files: media/libnestegg/* +Copyright: 2010 Mozilla Foundation +License: ISC + +Files: media/libnestegg/src/* +Copyright: 2004-2010, Alex Pankratov +License: BSD-3-clause + +Files: media/libogg/* +Copyright: 2002-2007 Xiph.org Foundation +License: BSD-3-clause + +Files: media/libopus/celt/* +Copyright: 2007-2009, Xiph.Org Foundation + 2007-2008, CSIRO +License: BSD-2-clause + +Files: media/libopus/celt/_kiss_fft_guts.h +Copyright: 2003, 2004, Mark Borgerding +License: BSD-2-clause + +Files: media/libopus/celt/arch.h + media/libopus/celt/fixed_generic.h + media/libopus/celt/mathops.c + media/libopus/celt/mathops.h +Copyright: 2007-2009, Xiph.Org Foundation + 2007-2008, CSIRO + 2002-2008, Jean-Marc Valin +License: BSD-2-clause + +Files: media/libopus/celt/arm/* +Copyright: 2013, Parrot + 2010, Xiph.Org Foundation +License: BSD-2-clause + +Files: media/libopus/celt/arm/fixed_armv4.h + media/libopus/celt/arm/kiss_fft_armv4.h + media/libopus/celt/arm/kiss_fft_armv5e.h +Copyright: 2013, Xiph.Org Foundation and contributors +License: BSD-2-clause + +Files: media/libopus/celt/arm/fixed_armv5e.h +Copyright: 2013, Parrot + 2007-2009, Xiph.Org Foundation + 2007-2008, CSIRO + 2003-2008, Jean-Marc Valin +License: BSD-2-clause + +Files: media/libopus/celt/bands.c + media/libopus/celt/bands.h + media/libopus/celt/celt.c + media/libopus/celt/celt.h + media/libopus/celt/celt_decoder.c + media/libopus/celt/celt_encoder.c + media/libopus/celt/modes.c + media/libopus/celt/modes.h +Copyright: 2008-2012, Gregory Maxwell + 2007-2010, Xiph.Org Foundation + 2007-2008, CSIRO +License: BSD-2-clause + +Files: media/libopus/celt/celt_lpc.c + media/libopus/celt/celt_lpc.h +Copyright: 1994-2002, 2009-2012, Xiph.Org Foundation +License: BSD-2-clause + +Files: media/libopus/celt/cpu_support.h +Copyright: 2013, Parrot + 2010, Xiph.Org Foundation +License: BSD-2-clause + +Files: media/libopus/celt/cwrs.c + media/libopus/celt/cwrs.h +Copyright: 2007-2009, Xiph.Org Foundation + 2007-2009, Timothy B. Terriberry + 2007-2008, CSIRO +License: BSD-2-clause + +Files: media/libopus/celt/ecintrin.h + media/libopus/celt/entcode.h + media/libopus/celt/entdec.c + media/libopus/celt/entdec.h + media/libopus/celt/entenc.c + media/libopus/celt/entenc.h + media/libopus/celt/mfrngcod.h +Copyright: 2008-2009, Xiph.Org Foundation + 2001-2011, Timothy B. Terriberry +License: BSD-2-clause + +Files: media/libopus/celt/entcode.c +Copyright: 2001-2011, Timothy B. Terriberry +License: BSD-2-clause + +Files: media/libopus/celt/fixed_debug.h + media/libopus/celt/stack_alloc.h +Copyright: 2007-2012, Xiph.Org Foundation + 2002-2008, Jean-Marc Valin +License: BSD-2-clause + +Files: media/libopus/celt/float_cast.h +Copyright: 2001, Erik de Castro Lopo +License: BSD-2-clause + +Files: media/libopus/celt/kiss_fft.c + media/libopus/celt/kiss_fft.h +Copyright: 2008, Xiph.Org Foundation, CSIRO + 2005-2007, Xiph.Org Foundation + 2003-2004, Mark Borgerding +License: BSD-2-clause + +Files: media/libopus/celt/os_support.h +Copyright: 2007, Jean-Marc Valin +License: BSD-2-clause + +Files: media/libopus/celt/x86/* +Copyright: 2013, Jean-Marc Valin and John Ridges +License: BSD-2-clause + +Files: media/libopus/include/* +Copyright: 1994-2002, 2009-2012, Xiph.Org Foundation +License: BSD-2-clause + +Files: media/libopus/include/opus.h + media/libopus/include/opus_defines.h +Copyright: 2010, 2011, Xiph.Org Foundation, Skype Limited +License: BSD-2-clause + +Files: media/libopus/include/opus_custom.h +Copyright: 2008-2012, Gregory Maxwell + 2007-2010, Xiph.Org Foundation + 2007-2008, CSIRO +License: BSD-2-clause + +Files: media/libopus/silk/* +Copyright: 2006-2011, Skype Limited +License: BSD-2-clause + +Files: media/libopus/silk/MacroDebug.h +Copyright: 2012, Xiph.Org Foundation + 2006-2011, Skype Limited +License: BSD-2-clause + +Files: media/libopus/silk/arm/* +Copyright: 2013, Parrot + 2006-2011, Skype Limited +License: BSD-2-clause + +Files: media/libopus/silk/arm/SigProc_FIX_armv4.h +Copyright: 2013, Xiph.Org Foundation and contributors + 2013, Parrot +License: BSD-2-clause + +Files: media/libopus/silk/arm/macros_armv4.h +Copyright: 2013, Xiph.Org Foundation and contributors +License: BSD-2-clause + +Files: media/libopus/src/* +Copyright: 1994-2002, 2009-2012, Xiph.Org Foundation +License: BSD-2-clause + +Files: media/libopus/src/mlp.c + media/libopus/src/mlp.h +Copyright: 2008-2011, Octasic Inc. +License: BSD-2-clause + +Files: media/libopus/src/opus.c + media/libopus/src/opus_decoder.c + media/libopus/src/opus_encoder.c +Copyright: 2010, 2011, Xiph.Org Foundation, Skype Limited +License: BSD-2-clause + +Files: media/libpng/* +Copyright: 1998-2014, Glenn Randers-Pehrson + 1996-1997, Andreas Dilger + 1995-1996, Guy Eric Schalnat, Group 42, Inc. +License: libpng + +Files: media/libpng/arm/* +Copyright: 2014, Glenn Randers-Pehrson +License: libpng + +Files: media/libpng/pnglibconf.h +Copyright: no-info-found +License: MPL-2.0 + +Files: media/libsoundtouch/src/* +Copyright: Olli Parviainen +License: LGPL-2.1+ + +Files: media/libspeex_resampler/src/* +Copyright: 2002, 2003, 2007, Jean-Marc Valin +License: BSD-3-clause + +Files: media/libspeex_resampler/src/resample.c + media/libspeex_resampler/src/resample_sse.c +Copyright: 2008, Thorvald Natvig + 2007-2008, Jean-Marc Valin +License: BSD-3-clause + +Files: media/libspeex_resampler/src/resample_neon.c +Copyright: 2011, Texas Instruments + 2008, Thorvald Natvig + 2007-2008, Jean-Marc Valin +License: BSD-3-clause + +Files: media/libspeex_resampler/src/simd_detect.cpp + media/libspeex_resampler/src/simd_detect.h +Copyright: no-info-found +License: MPL-2.0 + +Files: media/libtheora/* +Copyright: 2002-2007 Xiph.org Foundation +License: BSD-3-clause + +Files: media/libvorbis/* +Copyright: 2002-2007 Xiph.org Foundation +License: BSD-3-clause + +Files: media/libvpx/* +Copyright: 2010 Google Inc. +License: BSD-3-clause + +Files: media/mtransport/nr_socket_prsock.cpp +Copyright: 2007, Adobe Systems, Incorporated + 2001-2003, 2006, Network Resonance, Inc. +License: MPL-2.0 or BSD-3-clause + +Files: media/mtransport/nr_socket_prsock.h + media/mtransport/nricectx.cpp + media/mtransport/nricectx.h + media/mtransport/nricemediastream.cpp + media/mtransport/nricemediastream.h + media/mtransport/nriceresolver.cpp + media/mtransport/nriceresolver.h + media/mtransport/nriceresolverfake.cpp + media/mtransport/nriceresolverfake.h + media/mtransport/transportlayerice.cpp +Copyright: 2007, Adobe Systems, Incorporated +License: MPL-2.0 or BSD-3-clause + +Files: media/mtransport/nr_timer.cpp +Copyright: 2004, 2006, Network Resonance, Inc. +License: MPL-2.0 or BSD-2-clause + +Files: media/mtransport/test/gtest_utils.h +Copyright: 2004-2008, Google Inc. +License: MPL-2.0 or BSD-3-clause + +Files: media/mtransport/test/stunserver.cpp +Copyright: 2007, Adobe Systems, Incorporated + 2001-2003, 2006, Network Resonance, Inc. +License: MPL-2.0 or BSD-3-clause + +Files: media/mtransport/test/turn_unittest.cpp +Copyright: 2007, Adobe Systems, Incorporated +License: MPL-2.0 or BSD-3-clause + +Files: media/mtransport/third_party/nICEr/* +Copyright: 2007, Adobe Systems, Incorporated +License: BSD-3-clause + +Files: media/mtransport/third_party/nICEr/src/net/* + media/mtransport/third_party/nICEr/src/stun/nr_socket_buffered_stun.c + media/mtransport/third_party/nICEr/src/stun/nr_socket_buffered_stun.h + media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.c + media/mtransport/third_party/nICEr/src/stun/turn_client_ctx.h +Copyright: 2013, Mozilla + 2007, Adobe Systems, Incorporated +License: BSD-3-clause + +Files: media/mtransport/third_party/nICEr/src/net/nr_socket.c + media/mtransport/third_party/nICEr/src/net/nr_socket.h + media/mtransport/third_party/nICEr/src/net/nr_socket_local.h + media/mtransport/third_party/nICEr/src/net/transport_addr.c + media/mtransport/third_party/nICEr/src/net/transport_addr.h + media/mtransport/third_party/nICEr/src/net/transport_addr_reg.c + media/mtransport/third_party/nICEr/src/net/transport_addr_reg.h +Copyright: 2007, Adobe Systems, Incorporated +License: BSD-3-clause + +Files: media/mtransport/third_party/nrappkit/* +Copyright: 2001-2007, Network Resonance, Inc. +License: BSD-2-clause + +Files: media/mtransport/third_party/nrappkit/src/log/* +Copyright: 2002-2003, 2006, Network Resonance, Inc. + 1999-2001, RTFM, Inc +License: BSD-2-clause + +Files: media/mtransport/third_party/nrappkit/src/port/generic/* +Copyright: 1991, 1993, University of California +License: BSD-3-clause + +Files: media/mtransport/third_party/nrappkit/src/util/libekr/* +Copyright: 2002, 2003, 2006, Network Resonance, Inc + 1999, 2000, RTFM, Inc. +License: BSD-4-clause + +Files: media/mtransport/third_party/nrappkit/src/util/libekr/r_assoc.c + media/mtransport/third_party/nrappkit/src/util/libekr/r_assoc.h + media/mtransport/third_party/nrappkit/src/util/libekr/r_thread.h +Copyright: 2002, 2003, 2006, Network Resonance, Inc. + 1999-2001, RTFM, Inc. +License: BSD-2-clause + +Files: media/mtransport/third_party/nrappkit/src/util/libekr/r_crc32.c +Copyright: 2003, RTFM, Inc. + 2002-2003, 2006, Network Resonance, Inc. +License: BSD-2-clause + +Files: media/mtransport/third_party/nrappkit/src/util/libekr/r_memory.c + media/mtransport/third_party/nrappkit/src/util/libekr/r_memory.h +Copyright: 2001-2007, Network Resonance, Inc. +License: BSD-2-clause + +Files: media/webrtc/signaling/src/media-conduit/VideoTypes.h + media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h +Copyright: 2012, The WebRTC project authors +License: MPL-2.0 + +Files: media/webrtc/trunk/webrtc/modules/audio_device/linux/alsasymboltable_linux.cc + media/webrtc/trunk/webrtc/modules/audio_device/linux/alsasymboltable_linux.h + media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc + media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.h +Copyright: 1999-2013, Google Inc. +License: BSD-3-clause + +Files: media/webrtc/trunk/webrtc/modules/audio_device/mac/portaudio/* +Copyright: 1999-2000, Ross Bencina and Phil Burk +License: Expat + +Files: media/webrtc/trunk/webrtc/modules/audio_device/opensl/* + media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_device_info.cc + media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_device_info.h + media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_device_info_null.cc + media/webrtc/trunk/webrtc/modules/desktop_capture/mac/desktop_device_info_mac.h + media/webrtc/trunk/webrtc/modules/desktop_capture/win/desktop_device_info_win.cc + media/webrtc/trunk/webrtc/modules/desktop_capture/win/desktop_device_info_win.h + media/webrtc/trunk/webrtc/modules/desktop_capture/win/win_shared.cc + media/webrtc/trunk/webrtc/modules/desktop_capture/win/win_shared.h +Copyright: no-info-found +License: MPL-2.0 + +Files: media/webrtc/trunk/webrtc/modules/audio_processing/test/android/* +Copyright: 2005-2013, The Android Open Source Project +License: Apache-2.0 + +Files: mfbt/double-conversion/* +Copyright: 2006-2014, the V8 project authors +License: BSD-3-clause + +Files: modules/brotli/* +Copyright: 2013, 2014, Google Inc. +License: Apache-2.0 + +Files: modules/freetype2/* +Copyright: various contributors +License: GPL-2+ + +Files: modules/freetype2/builds/unix/* +Copyright: 1996-2014, Free Software Foundation, Inc +License: GPL-2+ + +Files: modules/freetype2/src/bdf/bdf.h +Copyright: 2001-2004, 2011, Francesco Zappa Nardelli + 2000, Computing Research Labs, New Mexico State University +License: Expat + +Files: modules/freetype2/src/bdf/bdferror.h +Copyright: 2001-2002, 2012, Francesco Zappa Nardelli +License: Expat + +Files: modules/freetype2/src/bdf/bdflib.c +Copyright: 2001-2014, Francesco Zappa Nardelli + 2000, Computing Research Labs, New Mexico State University +License: Expat + +Files: modules/freetype2/src/gzip/* +Copyright: 1995-2013, Mark Adler +License: Zlib + +Files: modules/freetype2/src/gzip/inftrees.c +Copyright: 1995-2013, Mark Adler +License: Zlib + +Files: modules/freetype2/src/gzip/zutil.c + modules/freetype2/src/gzip/zutil.h +Copyright: 1995-2013, Jean-loup Gailly +License: Zlib + +Files: modules/freetype2/src/gzip/zlib.h +Copyright: 1995-2013, Jean-loup Gailly and Mark Adler +License: Zlib + +Files: modules/freetype2/src/pcf/* +Copyright: 2000-2014, by David Turner +License: Expat + +Files: modules/freetype2/src/tools/ftrandom/* +Copyright: 2005, 2007-2008, 2013, George Williams +License: BSD-3-clause + +Files: modules/libjar/test/unit/test_bug333423.js + modules/libjar/test/unit/test_bug597702.js + modules/libjar/test/unit/test_bug637286.js + modules/libjar/test/unit/test_corrupt_536911.js + modules/libjar/test/unit/test_corrupt_541828.js + modules/libjar/test/unit/test_dirjar_bug525755.js + modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js +Copyright: no-info-found +License: MPL-2.0 + +Files: modules/zlib/* +Copyright: 1995-2013, Mark Adler +License: Zlib + +Files: modules/zlib/src/compress.c + modules/zlib/src/deflate.h + modules/zlib/src/trees.c + modules/zlib/src/uncompr.c + modules/zlib/src/zutil.c + modules/zlib/src/zutil.h + modules/zlib/src/zconf.h +Copyright: 1995-2013, Jean-loup Gailly +License: Zlib + +Files: modules/zlib/src/deflate.c + modules/zlib/src/zlib.h +Copyright: 1995-2013, Jean-loup Gailly and Mark Adler +License: Zlib + +Files: modules/zlib/src/inftrees.c +Copyright: 1995-2013, Mark Adler +License: Zlib + +Files: mozglue/android/pbkdf2_sha256.c + mozglue/android/pbkdf2_sha256.h +Copyright: 2003-2005, 2007, 2009, Colin Percival +License: BSD-2-clause + +Files: netwerk/dns/nsIDNKitInterface.h +Copyright: 2000-2002, Japan Network Information Center +License: BSD-3-clause + +Files: netwerk/dns/prepare_tlds.py +Copyright: no-info-found +License: MPL-2.0 + +Files: netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +Copyright: International Business Machines (IBM) +License: MPL-2.0 + +Files: netwerk/sctp/src/* +Copyright: 2011-2012, Michael Tuexen + 2011-2012, Irene Ruengeler + 2009-2010, Humaira Kamal + 2009-2010, Brad Penoff +License: BSD-2-clause + +Files: netwerk/sctp/src/LocalArray.h + netwerk/sctp/src/ScopedFd.h + netwerk/sctp/src/ifaddrs-android-ext.h +Copyright: 2005-2013, The Android Open Source Project +License: Apache-2.0 + +Files: netwerk/sctp/src/netinet/* +Copyright: 2008-2012, Randall Stewart + 2008-2012, Michael Tuexen + 2001-2008, Cisco Systems, Inc. +License: BSD-3-clause + +Files: netwerk/sctp/src/netinet/sctp_lock_userspace.h + netwerk/sctp/src/netinet/sctp_os_userspace.h +Copyright: 2008-2012, Randall Stewart + 2008-2012, Michael Tuexen + 2008-2012, Brad Penoff + 2001-2007, Cisco Systems, Inc. +License: BSD-3-clause + +Files: netwerk/sctp/src/netinet/sctp_sha1.c +Copyright: 2013, Lally Singh + 2008-2013, Michael Tuexen + 2008-2012, Randall Stewart + 2001-2007, Cisco Systems, Inc. +License: BSD-3-clause + +Files: netwerk/sctp/src/netinet/sctp_ss_functions.c +Copyright: 2010-2012, Robin Seggelmann + 2010-2012, Randall Stewart + 2010-2012, Michael Tuexen +License: BSD-2-clause + +Files: netwerk/sctp/src/netinet/sctp_userspace.c +Copyright: 2011, 2012, Michael Tuexen + 2011, 2012, Irene Ruengeler +License: BSD-2-clause + +Files: netwerk/sctp/src/netinet6/* +Copyright: 2008-2012, Randall Stewart + 2008-2012, Michael Tuexen + 2001-2008, Cisco Systems, Inc. +License: BSD-3-clause + +Files: netwerk/sctp/src/user_inpcb.h + netwerk/sctp/src/user_socketvar.h +Copyright: 1982, 1986, 1990, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_ip6_var.h +Copyright: 1995-1997, and 1998, WIDE Project + 1982, 1986, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_ip_icmp.h +Copyright: 1982, 1986, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_malloc.h +Copyright: 2005, Robert N. M. Watson + 1987, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_mbuf.c + netwerk/sctp/src/user_mbuf.h +Copyright: 1982, 1986, 1988, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_queue.h +Copyright: 1991, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_recv_thread.h +Copyright: 2011-2012, Michael Tuexen + 2011-2012, Irene Ruengeler +License: BSD-2-clause + +Files: netwerk/sctp/src/user_route.h +Copyright: 1980, 1986, 1993, University of California +License: BSD-3-clause + +Files: netwerk/sctp/src/user_socket.c +Copyright: 2011, 2012, Michael Tuexen + 2011, 2012, Irene Ruengeler + 2009, 2010, Humaira Kamal + 2009, 2010, Brad Penoff + 2004-2008, Robert N. M. Watson + 2004, The FreeBSD Foundation + 1982, 1986, 1988, 1990, 1993, University of California +License: BSD-2-clause + +Files: netwerk/srtp/src/* +Copyright: 2001-2006, Cisco Systems, Inc. +License: BSD-3-clause + +Files: netwerk/srtp/src/include/config.h +Copyright: no-info-found +License: MPL-2.0 + +Files: netwerk/streamconv/nsStreamConverterService.cpp +Copyright: 2000, International Business Machines (IBM) +License: MPL-2.0 + +Files: netwerk/test/unit/test_NetUtil.js + netwerk/test/unit/test_about_networking.js + netwerk/test/unit/test_about_protocol.js + netwerk/test/unit/test_auth_proxy.js + netwerk/test/unit/test_bug248970_cache.js + netwerk/test/unit/test_bug248970_cookie.js + netwerk/test/unit/test_bug856978.js + netwerk/test/unit/test_cookiejars.js + netwerk/test/unit/test_cookiejars_safebrowsing.js + netwerk/test/unit/test_dns_proxy_bypass.js + netwerk/test/unit/test_extract_charset_from_content_type.js + netwerk/test/unit/test_httpResponseTimeout.js + netwerk/test/unit/test_httpauth.js + netwerk/test/unit/test_mozTXTToHTMLConv.js + netwerk/test/unit/test_offlinecache_custom-directory.js + netwerk/test/unit/test_parse_content_type.js + netwerk/test/unit/test_ping_aboutnetworking.js + netwerk/test/unit/test_protocolproxyservice.js + netwerk/test/unit/test_safeoutputstream.js + netwerk/test/unit/test_speculative_connect.js + netwerk/test/unit/test_udpsocket.js + netwerk/test/unit/test_websocket_offline.js +Copyright: no-info-found +License: MPL-2.0 + +Files: netwerk/wifi/osx_wifi.h +Copyright: 2008, Google Inc. + 2006, Alf Watt +License: BSD-3-clause + +Files: nsprpub/lib/ds/plvrsion.c + nsprpub/lib/libc/src/plvrsion.c + nsprpub/lib/prstreams/plvrsion.c + nsprpub/pr/src/prvrsion.c +Copyright: 1998, Netscape Communications Corporation +License: MPL-2.0 + +Files: nsprpub/pr/include/prvrsion.h + nsprpub/pr/src/malloc/prmalloc.c +Copyright: no-info-found +License: MPL-2.0 + +Files: nsprpub/pr/src/misc/praton.c +Copyright: 2004, Internet Systems Consortium, Inc. ("ISC") + 1993, Digital Equipment Corporation + 1983, 1990, 1993, University of California +License: BSD-3-clause or ISC + +Files: nsprpub/pr/src/misc/prerrortable.c +Copyright: 1987, 1988, the Student Information Processing Board +License: MPL-2.0 + +Files: other-licenses/atk-1.0/* +Copyright: 2001-2002, Sun Microsystems Inc. +License: LGPL-2+ + +Files: other-licenses/atk-1.0/atk/atkplug.h + other-licenses/atk-1.0/atk/atksocket.h +Copyright: 2009, Novell, Inc. +License: LGPL-2+ + +Files: other-licenses/nsis/Contrib/CityHash/cityhash/* +Copyright: 2010-2014, Google, Inc. +License: Expat + +Files: other-licenses/nsis/Contrib/liteFirewall/liteFirewall.cpp +Copyright: 2007-2009, Olivier Marcoux +License: Zlib + +Files: other-licenses/snappy/* +Copyright: 2005, 2006, 2008-2013, Google Inc. +License: BSD-3-clause + +Files: other-licenses/snappy/src/snappy-c.cc + other-licenses/snappy/src/snappy-c.h +Copyright: 2011, Martin Gieseking +License: BSD-3-clause + +Files: other-licenses/snappy/src/snappy.h + other-licenses/snappy/src/snappy_unittest.cc +Copyright: 2005, and onwards Google Inc +License: BSD-3-clause + +Files: parser/expat/* +Copyright: 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper + 2001, 2002 Expat maintainers +License: Expat + +Files: parser/expat/lib/moz_extensions.c +Copyright: no-info-found +License: MPL-2.0 + +Files: parser/html/jArray.h + parser/html/nsHtml5ArrayCopy.h + parser/html/nsHtml5AttributeName.cpp + parser/html/nsHtml5AttributeName.h + parser/html/nsHtml5ElementName.cpp + parser/html/nsHtml5ElementName.h + parser/html/nsHtml5Macros.h + parser/html/nsHtml5NamedCharacters.cpp + parser/html/nsHtml5NamedCharacters.h + parser/html/nsHtml5Portability.h + parser/html/nsHtml5StateSnapshot.cpp + parser/html/nsHtml5StateSnapshot.h + parser/html/nsHtml5UTF16Buffer.cpp + parser/html/nsHtml5UTF16Buffer.h + parser/html/javasrc/* +Copyright: 2008-2014, Mozilla Foundation +License: Expat + +Files: parser/html/javasrc/MetaScanner.java + parser/html/javasrc/StackNode.java +Copyright: 2007-2011, Mozilla Foundation + 2007, Henri Sivonen +License: Expat + +Files: parser/html/javasrc/Tokenizer.java + parser/html/javasrc/TreeBuilder.java +Copyright: 2007-2013, Mozilla Foundation + 2005-2007, Henri Sivonen + 2004-2010, Apple Computer, Inc. +License: Expat + +Files: parser/html/nsHtml5HtmlAttributes.cpp + parser/html/nsHtml5HtmlAttributes.h + parser/html/nsHtml5MetaScanner.cpp + parser/html/nsHtml5MetaScanner.h + parser/html/nsHtml5StackNode.cpp + parser/html/nsHtml5StackNode.h +Copyright: 2007-2011, Mozilla Foundation + 2007, Henri Sivonen +License: Expat + +Files: parser/html/nsHtml5Tokenizer.cpp + parser/html/nsHtml5Tokenizer.h + parser/html/nsHtml5TreeBuilder.cpp + parser/html/nsHtml5TreeBuilder.h +Copyright: 2007-2013, Mozilla Foundation + 2005-2007, Henri Sivonen + 2004-2010, Apple Computer, Inc. +License: Expat + +Files: parser/html/nsHtml5TokenizerCppSupplement.h + python/mach/* + python/mach_commands.py + python/mozboot/* + python/mozbuild/* + python/mozversioncontrol/* +Copyright: no-info-found +License: MPL-2.0 + +Files: security/certverifier/OCSPCache.cpp + security/certverifier/OCSPCache.h +Copyright: 2013-2015, Mozilla Contributors +License: Apache-2.0 or MPL-2.0 + +Files: security/nss/lib/dbm/* +Copyright: 1990, 1993-1994, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/include/ncompat.h + security/nss/lib/dbm/include/queue.h +Copyright: 1991, 1993, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/include/extern.h +Copyright: 1991, 1993, 1994, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/include/hsearch.h + security/nss/lib/dbm/include/search.h +Copyright: 1990, 1993, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/src/db.c +Copyright: 1991, 1993, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/src/h_func.c + security/nss/lib/dbm/src/memmove.c +Copyright: 1990, 1993, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/src/mktemp.c +Copyright: 1987, 1993, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/src/strerror.c +Copyright: 1988, 1993, University of California +License: BSD-3-clause + +Files: security/nss/lib/dbm/tests/* +Copyright: no-info-found +License: MPL-2.0 + +Files: security/nss/lib/freebl/intel-gcm-wrap.c + security/nss/lib/freebl/intel-gcm.h +Copyright: 2013, Intel Corp. +License: MPL-2.0 + +Files: security/nss/lib/jar/jzconf.h +Copyright: 1995-2013, Jean-loup Gailly +License: Zlib + +Files: security/nss/lib/jar/jzlib.h +Copyright: 1995-2013, Jean-loup Gailly and Mark Adler +License: Zlib + +Files: security/nss/lib/util/pkcs11.h + security/nss/lib/util/pkcs11f.h + security/nss/lib/util/pkcs11p.h + security/nss/lib/util/pkcs11u.h +Copyright: 1994-1999, RSA Security Inc. +License: MPL-2.0 + +Files: security/nss/lib/ssl/ssl3gthr.c + security/nss/lib/util/utilpars.c + services/common/tests/unit/head_helpers.js +Copyright: no-info-found +License: MPL-2.0 + +Files: security/nss/lib/zlib/* +Copyright: 1995-2013, Mark Adler +License: Zlib + +Files: security/nss/lib/zlib/compress.c + security/nss/lib/zlib/deflate.h + security/nss/lib/zlib/trees.c + security/nss/lib/zlib/uncompr.c + security/nss/lib/zlib/zutil.c + security/nss/lib/zlib/zutil.h +Copyright: 1995-2013, Jean-loup Gailly +License: Zlib + +Files: security/nss/lib/zlib/deflate.c + security/nss/lib/zlib/zlib.h +Copyright: 1995-2013, Jean-loup Gailly and Mark Adler +License: Zlib + +Files: security/nss/lib/zlib/inftrees.c +Copyright: 1995-2013, Mark Adler +License: Zlib + +Files: security/nss/lib/zlib/zconf.h +Copyright: 1995-2010, Jean-loup Gailly +License: Zlib + +Files: security/sandbox/chromium/base/third_party/dynamic_annotations/* +Copyright: 1999-2013, Google Inc. +License: BSD-3-clause + +Files: security/sandbox/chromium/base/third_party/superfasthash/* +Copyright: 2010, Paul Hsieh +License: BSD-2-clause + +Files: testing/gtest/gmock/* + testing/gtest/gtest/* +Copyright: 1999-2013, Google Inc. +License: BSD-3-clause + +Files: testing/mochitest/pywebsocket/* +Copyright: 1999-2013, Google Inc. +License: BSD-3-clause + +Files: testing/mochitest/pywebsocket/mod_pywebsocket/http_header_util.py +Copyright: 2011, Google Inc. +License: BSD-3-clause + +Files: testing/mochitest/tests/SimpleTest/LogController.js + testing/mochitest/tests/SimpleTest/MemoryStats.js + testing/mochitest/tests/SimpleTest/MockObjects.js + testing/mochitest/tests/SimpleTest/setup.js + testing/mozbase/manifestparser/tests/test_convert_directory.py + testing/mozbase/manifestparser/tests/test_convert_symlinks.py + testing/mozbase/manifestparser/tests/test_manifestparser.py + testing/mozbase/mozfile/tests/test_tempdir.py + testing/mozbase/mozfile/tests/test_tempfile.py + testing/web-platform/tests/resources/testharnessreport.js + toolkit/components/ctypes/tests/unit/test_jsctypes.js + toolkit/components/mediasniffer/mp3sniff.c + toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js + toolkit/components/osfile/tests/xpcshell/test_makeDir.js + toolkit/components/osfile/tests/xpcshell/test_path.js + toolkit/components/osfile/tests/xpcshell/test_path_constants.js + toolkit/components/osfile/tests/xpcshell/test_removeDir.js + toolkit/components/osfile/tests/xpcshell/test_removeEmptyDir.js + toolkit/components/passwordmgr/test/browser/* + toolkit/components/places/tests/favicons/head_favicons.js + toolkit/content/tests/browser/browser_save_resend_postdata.js + toolkit/content/tests/browser/common/* + toolkit/content/tests/unit/* +Copyright: no-info-found +License: MPL-2.0 + +Files: testing/tools/screenshot/* +Copyright: 2009, The Mozilla Foundation +License: BSD-3-clause + +Files: testing/web-platform/tests/resources/webidl2/test/widlproc/* +Copyright: 2009, Aplix Corporation +License: Apache-2.0 + +Files: third_party/python/coverage/* +Copyright: 2001, Gareth Rees + 2004-2020, Ned Batchelder +License: Apache-2.0 + +Files: toolkit/components/protobuf/* +Copyright: 2005-2006, 2008-2013, Google Inc. +License: BSD-3-clause + +Files: toolkit/components/reader/Readability.js +Copyright: 2010, Arc90 Inc. +License: Apache-2.0 + +Files: toolkit/components/url-classifier/HashStore.cpp +Copyright: 2006-2013, The Chromium Authors. +License: BSD-3-clause + + +Files: toolkit/crashreporter/google-breakpad/* +Copyright: 2006-2009, Google Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.cc + toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.h + toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.cc + toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.h +Copyright: 2011, Linaro Limited + 2010-2011, Google Inc. +License: BSD-3-clause or Expat + +Files: toolkit/crashreporter/google-breakpad/src/common/dwarf/* + toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.cc + toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.h +Copyright: 2005-2006, 2008-2013, Google Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader_unittest.cc + toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.cc + toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.h + toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc + toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc + toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_test_common.h +Copyright: 1999-2013, Google Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/common/dwarf/types.h +Copyright: 2008, Google, Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/common/mac/GTMDefines.h + toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.h + toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.m + toolkit/crashreporter/google-breakpad/src/common/mac/testing/* +Copyright: 2007-2008, 2010, 2012, Google Inc. +License: Apache-2.0 + +Files: toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.h +Copyright: 2007, 2008, Google Inc. + 1997-2005, Sen:te (Sente SA). +License: Apache-2.0 or BSD-2-clause + +Files: toolkit/crashreporter/google-breakpad/src/common/md5.cc +Copyright: no-info-found +License: public-domain + +Files: toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc + toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h +Copyright: 2005-2006, 2008-2013, Google Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.cc + toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.h + toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86_unittest.cc + toolkit/crashreporter/google-breakpad/src/processor/exploitability_unittest.cc +Copyright: no-info-found +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/processor/static_map-inl.h + toolkit/crashreporter/google-breakpad/src/processor/static_map.h + toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator-inl.h + toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator.h +Copyright: 2005-2006, 2008-2013, Google Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/google-breakpad/src/third_party/lss/* +Copyright: 1999-2013, Google Inc. +License: BSD-3-clause + +Files: toolkit/crashreporter/test/browser/browser_clearReports.js +Copyright: no-info-found +License: MPL-2.0 + +Files: toolkit/locales/compare-locales.pl + toolkit/modules/tests/xpcshell/test_propertyListsUtils.js + toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js + toolkit/mozapps/extensions/test/xpcshell/*.js + toolkit/mozapps/update/tests/TestAUSReadStrings.cpp + toolkit/mozapps/update/tests/unit_aus_update/* + toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js + toolkit/mozapps/update/tests/unit_base_updater/marStageFailurePartial.js + toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js + toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js + toolkit/mozapps/update/tests/unit_base_updater/marSuccessComplete.js + toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js + toolkit/mozapps/update/tests/unit_base_updater/marVersionDowngrade.js + toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js + toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js + toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js + toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js + toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js + toolkit/mozapps/update/tests/unit_service_updater/marSuccessCompleteSvc.js + toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js +Copyright: no-info-found +License: MPL-2.0 + +Files: tools/update-packaging/test/common.sh + tools/update-packaging/test/make_full_update.sh +Copyright: no-info-found +License: MPL-2.0 + +Files: widget/cocoa/ComplexTextInputPanel.h +Copyright: 2006-2009, 2012, Apple Inc. +License: BSD-2-clause + +Files: widget/x11/keysym2ucs.c +Copyright: Markus G. Kuhn +License: MPL-2.0 + +Files: xpcom/build/mach_override.h +Copyright: 2003-2009, Jonathan Wolf Rentzsch: +License: Expat + +Files: xpcom/components/nsComponentManager.cpp + xpcom/io/nsLocalFile.h +Copyright: 2000, International Business Machines (IBM) +License: MPL-2.0 + +Files: xpcom/io/SpecialSystemDirectory.cpp +Copyright: 1998 Netscape Communications Corporation, + 2007 Red Hat Inc. +License: MPL-2.0 + +Files: xpcom/tests/unit/data/* + xpcom/tests/unit/test_bug725015.js + xpcom/tests/unit/test_file_createUnique.js + xpcom/tests/unit/test_file_equality.js + xpcom/tests/unit/test_file_renameTo.js + xpcom/tests/unit/test_ioutil.js + xpcom/tests/unit/test_localfile.js + xpcom/tests/unit/test_notxpcom_scriptable.js + xpcom/tests/unit/test_nsIMutableArray.js + xpcom/tests/unit/test_nsIProcess.js + xpcom/tests/unit/test_pipe.js + xpcom/tests/unit/test_seek_multiplex.js + xpcom/tests/unit/test_storagestream.js + xpcom/tests/unit/test_stringstream.js + xpcom/tests/unit/test_systemInfo.js + xpcom/tests/unit/test_streams.js + comm/suite/browser/test/browser/browser_bug409624.js + comm/suite/browser/test/browser/browser_bug427559.js + comm/suite/browser/test/browser/browser_pluginCrashCommentAndURL.js + comm/suite/browser/test/browser/browser_pluginplaypreview.js + comm/suite/browser/test/browser/browser_popupNotification.js + comm/suite/browser/test/browser/browser_privatebrowsing_protocolhandler.js + comm/suite/browser/test/browser/browser_relatedTabs.js + comm/suite/browser/test/browser/head.js + comm/suite/locales/en-US/chrome/browser/pageInfo.dtd + comm/suite/locales/en-US/chrome/common/aboutPrivateBrowsing.dtd + comm/suite/locales/en-US/suite-l10n.js +Copyright: no-info-found +License: MPL-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS"BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache License, + Version 2.0 can be found in '/usr/share/common-licenses/Apache-2.0'. + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice(s), this list of conditions and the following disclaimer as + the first lines of this file unmodified other than the possible + addition of one or more copyright notices. + 2. Redistributions in binary form must reproduce the above copyright + notice(s), this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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. + +License: BSD-3-clause + Copyright © belongs to the uploader + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1.Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. 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. + 3. Neither the name of the owner 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 HOLDER 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. + +License: BSD-4-clause + Copyright (c) 1993 The Regents of the University of California. All + rights reserved. + . + This software was developed by the Computer Systems Engineering group + at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + contributed to Berkeley. + . + All advertising materials mentioning features or use of this software + must display the following acknowledgement: This product includes + software developed by the University of California, Lawrence Berkeley + Laboratory. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. 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. + . + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgement: This product + includes software developed by the University of California, + Berkeley and its contributors. + . + 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + +License: CC0-1.0 + The person who associated a work with this deed has dedicated the work to the + public domain by waiving all of his or her rights to the work worldwide under + copyright law, including all related and neighboring rights, to the extent + allowed by law. + . + You can copy, modify, distribute and perform the work, even for commercial + purposes, all without asking permission. See Other Information below. + . + * In no way are the patent or trademark rights of any person affected by CC0, + nor are the rights that other persons may have in the work or in how the + work is used, such as publicity or privacy rights. + * Unless expressly stated otherwise, the person who associated a work with + this deed makes no warranties about the work, and disclaims liability for + all uses of the work, to the fullest extent permitted by applicable law. + * When using or citing the work, you should not imply endorsement by the + author or the affirmer. + +License: Expat + The MIT License + . + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to + whom the Software is furnished to do so, subject to the + following conditions: + . + The above copyright notice and this permission notice shall + be included in all copies or substantial portions of the + Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT + WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +License: GPL-2 + On Debian systems, the complete text of the GNU General Public + License can be found in the file /usr/share/common-licenses/GPL-2'. + +License: GPL-2+ + On Debian systems, the complete text of the GNU General Public + License can be found in the file /usr/share/common-licenses/GPL-2'. + +License: GPL-3 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 3 dated June, 2007. + . + On Debian systems, the complete text of version 3 of the GNU General + Public License can be found in '/usr/share/common-licenses/GPL-3'. + +License: ISC + Copyright © 2004-2012 by Internet Systems Consortium, Inc. ("ISC") + Copyright © 1995-2003 by Internet Software Consortium + . + Permission to use, copy, modify, and/or distribute this software for + any purpose with or without fee is hereby granted, provided that the + above copyright notice and this permission notice appear in all + copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +License: LGPL-2+ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Library General Public License as published by the Free + Software Foundation; version 2 of the License, or (at your option) any later + version. + . + On Debian systems, the complete text of version 2 of the GNU Library + General Public License can be found in `/usr/share/common-licenses/LGPL-2'. + +License: LGPL-2.1 + On Debian systems, the complete text of the GNU Library General Public + License can be found in the file `/usr/share/common-licenses/LGPL-2.1'. + +License: LGPL-2.1+ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Library General Public License as published by the + Free Software Foundation; version 2.1 of the License, or (at your option) any + later version. + . + On Debian systems, the complete text of version 2.1 of the GNU General + Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. + +License: old-MIT + Permission is hereby granted, without written agreement and without + license or royalty fees, to use, copy, modify, and distribute this + software and its documentation for any purpose, provided that the + above copyright notice and the following two paragraphs appear in + all copies of this software. + . + IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + . + THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +License: MPL-1.0 + MOZILLA PUBLIC LICENSE + Version 1.0 + . + --------------- + . + 1. Definitions. + . + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + . + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the + Modifications made by that particular Contributor. + . + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each + case including portions thereof. + . + 1.4. "Electronic Distribution Mechanism" means a mechanism + generally accepted in the software development community for + the electronic transfer of data. + . + 1.5. "Executable" means Covered Code in any form other than Source + Code. + . + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by + Exhibit A. + . + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this + License. + . + 1.8. "License" means this document. + . + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any + previous Modifications. When Covered Code is released as a + series of files, a Modification is: + . + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + . + B. Any new file that contains any part of the Original Code + or previous Modifications. + . + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by + Exhibit A as Original Code, and which, at the time of its + release under this License is not already Covered Code + governed by this License. + . + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, + plus any associated interface definition files, scripts used + to control compilation and installation of an Executable, or a + list of source code differential comparisons against either + the Original Code or another well known, available Covered + Code of the Contributor's choice. The Source Code can be in a + compressed or archival form, provided the appropriate + decompression or de-archiving software is widely available for + no charge. + . + 1.12. "You" means an individual or a legal entity exercising rights + under, and complying with all of the terms of, this License + or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, + is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, + direct or indirect, to cause the direction or management of + such entity, whether by contract or otherwise, or (b) + ownership of fifty percent (50%) or more of the outstanding + shares or beneficial ownership of such entity. + . + 2. Source Code License. + . + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) to use, reproduce, modify, display, perform, sublicense and + distribute the Original Code (or portions thereof) with or + without Modifications, or as part of a Larger Work; and + (b) under patents now or hereafter owned or controlled by + Initial Developer, to make, have made, use and sell + ("Utilize") the Original Code (or portions thereof), but + solely to the extent that any such patent is reasonably + necessary to enable You to Utilize the Original Code (or + portions thereof) and not to any greater extent that may be + necessary to Utilize further Modifications or combinations. + . + 2.2. Contributor Grant. + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual + property claims: + (a) to use, reproduce, modify, display, perform, + sublicense and distribute the Modifications created by such + Contributor (or portions thereof) either on an unmodified + basis, with other Modifications, as Covered Code or as part of + a Larger Work; and + (b) under patents now or hereafter owned or controlled by + Contributor, to Utilize the Contributor Version (or portions + thereof), but solely to the extent that any such patent is + reasonably necessary to enable You to Utilize the Contributor + Version (or portions thereof), and not to any greater extent + that may be necessary to Utilize further Modifications or + combinations. + . + 3. Distribution Obligations. + . + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source + Code version that alters or restricts the applicable version of + this License or the recipients' rights hereunder. However, You may + include an additional document offering the additional rights + described in Section 3.5. + . + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve + (12) months after the date it initially became available, or at + least six (6) months after a subsequent version of that particular + Modification has been made available to such recipients. You are + responsible for ensuring that the Source Code version remains + available even if the Electronic Distribution Mechanism is + maintained by a third party. + . + 3.3. Description of Modifications. + You must cause all Covered Code to which you contribute to contain + a file documenting the changes You made to create that Covered Code + and the date of any change. You must include a prominent statement + that the Modification is derived, directly or indirectly, from + Original Code provided by the Initial Developer and including the + name of the Initial Developer in (a) the Source Code, and (b) in + any notice in an Executable version or related documentation in + which You describe the origin or ownership of the Covered Code. + . + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If You have knowledge that a party claims an intellectual + property right in particular functionality or code (or its + utilization under this License), you must include a text file + with the source code distribution titled "LEGAL" which + describes the claim and the party making the claim in + sufficient detail that a recipient will know whom to contact. + If you obtain such knowledge after You make Your Modification + available as described in Section 3.2, You shall promptly + modify the LEGAL file in all copies You make available + thereafter and shall take other steps (such as notifying + appropriate comm/mailing lists or newsgroups) reasonably calculated + to inform those who received the Covered Code that new + knowledge has been obtained. + (b) Contributor APIs. + If Your Modification is an application programming interface + and You own or control patents which are reasonably necessary + to implement that API, you must also include this information + in the LEGAL file. + . + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the + Source Code, and this License in any documentation for the Source + Code, where You describe recipients' rights relating to Covered + Code. If You created one or more Modification(s), You may add your + name as a Contributor to the notice described in Exhibit A. If it + is not possible to put such notice in a particular Source Code file + due to its structure, then you must include such notice in a + location (such as a relevant directory file) where a user would be + likely to look for such a notice. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + . + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously + included in any notice in an Executable version, related + documentation or collateral in which You describe recipients' + rights relating to the Covered Code. You may distribute the + Executable version of Covered Code under a license of Your choice, + which may contain terms different from this License, provided that + You are in compliance with the terms of this License and that the + license for the Executable version does not attempt to limit or + alter the recipient's rights in the Source Code version from the + rights set forth in this License. If You distribute the Executable + version under a different license You must make it absolutely clear + that any terms which differ from this License are offered by You + alone, not by the Initial Developer or any Contributor. You hereby + agree to indemnify the Initial Developer and every Contributor for + any liability incurred by the Initial Developer or such Contributor + as a result of any such terms You offer. + . + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other + code not governed by the terms of this License and distribute the + Larger Work as a single product. In such a case, You must make sure + the requirements of this License are fulfilled for the Covered + Code. + . + 4. Inability to Comply Due to Statute or Regulation. + . + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be + included in the LEGAL file described in Section 3.4 and must be + included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must + be sufficiently detailed for a recipient of ordinary skill to be + able to understand it. + . + 5. Application of this License. + . + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A, and to related Covered Code. + . + 6. Versions of the License. + . + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised + and/or new versions of the License from time to time. Each version + will be given a distinguishing version number. + . + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of + the License, You may always continue to use it under the terms of + that version. You may also choose to use such Covered Code under + the terms of any subsequent version of the License published by + Netscape. No one other than Netscape has the right to modify the + terms applicable to Covered Code created under this License. + . + 6.3. Derivative Works. + If you create or use a modified version of this License (which you + may only do in order to apply it to code which is not already + Covered Code governed by this License), you must (a) rename Your + license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", + "Netscape", "NPL" or any confusingly similar phrase do not appear + anywhere in your license and (b) otherwise make it clear that your + version of the license contains terms which differ from the Mozilla + Public License and Netscape Public License. (Filling in the name of + the Initial Developer, Original Code or Contributor in the notice + described in Exhibit A shall not of themselves be deemed to be + modifications of this License.) + . + 7. DISCLAIMER OF WARRANTY. + . + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS + FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR + NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF + THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE + DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY + OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, + REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN + ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS + AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + . + 8. TERMINATION. + . + This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + All sublicenses to the Covered Code which are properly granted + shall survive any termination of this License. Provisions which, by + their nature, must remain in effect beyond the termination of this + License shall survive. + . + 9. LIMITATION OF LIABILITY. + . + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED + CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR + ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER + FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR + LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE + POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT + APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH + PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH + LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR + LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION + AND LIMITATION MAY NOT APPLY TO YOU. + . + 10. U.S. GOVERNMENT END USERS. + . + The Covered Code is a "commercial item," as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June + 1995), all U.S. Government End Users acquire Covered Code with only + those rights set forth herein. + . + 11. MISCELLANEOUS. + . + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen + of, or an entity chartered or registered to do business in, the + United States of America: (a) unless otherwise agreed in writing, + all disputes relating to this License (excepting any dispute + relating to intellectual property rights) shall be subject to final + and binding arbitration, with the losing party paying all costs of + arbitration; (b) any arbitration relating to this Agreement shall be + held in Santa Clara County, California, under the auspices of + JAMS/EndDispute; and (c) any litigation relating to this Agreement + shall be subject to the jurisdiction of the Federal Courts of the + Northern District of California, with venue lying in Santa Clara + County, California, with the losing party responsible for costs, + including without limitation, court costs and reasonable attorneys + fees and expenses. The application of the United Nations Convention + on Contracts for the International Sale of Goods is expressly + excluded. Any law or regulation which provides that the language of + a contract shall be construed against the drafter shall not apply + to this License. + . + 12. RESPONSIBILITY FOR CLAIMS. + . + Except in cases where another Contributor has failed to comply with + Section 3.4, You are responsible for damages arising, directly or + indirectly, out of Your utilization of rights under this License, + based on the number of copies of Covered Code you made available, + the revenues you received from utilizing such rights, and other + relevant factors. You agree to work with affected parties to + distribute responsibility on an equitable basis. + . + EXHIBIT A. + . + "The contents of this file are subject to the Mozilla Public License + Version 1.0 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License + at http://www.mozilla.org/MPL/ + . + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and + limitations under the License. + . + The Original Code is ______________________________________. + . + The Initial Developer of the Original Code is ____________________. + Portions created by ______________________ + are Copyright (C) ______ _______________________. All Rights + Reserved. + . + Contributor(s): ______________________________________." + . + The original content can be found on https://www.mozilla.org/MPL/1.0/ + +License: MPL-1.1 + On Debian systems, the complete text of the GNU Library General Public + License can be found in the file `/usr/share/common-licenses/MPL-1.1'. + +License: MPL-2.0 + On Debian systems, the complete text of the GNU Library General Public + License can be found in the file `/usr/share/common-licenses/MPL-2.0'. + +License: Zlib + The zlib License + . + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + . + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + . + 3. This notice may not be removed or altered from any source + distribution. + +License: libpng + This copy of the libpng notices is provided for your convenience. In case of + any discrepancy between this copy and the notices in the file png.h that is + included in the libpng distribution, the latter shall prevail. + . + COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + . + If you modify libpng you may insert additional notices immediately following + this sentence. + . + This code is released under the libpng license. + . + libpng versions 1.2.6, August 15, 2004, through 1.6.17, March 26, 2015, are + Copyright (c) 2004, 2006-2015 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as libpng-1.2.5 + with the following individual added to the list of Contributing Authors + . + Cosmin Truta + . + libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are + Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as libpng-1.0.6 + with the following individuals added to the list of Contributing Authors + . + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + . + and with the following additions to the disclaimer: + . + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + . + libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as libpng-0.96, + with the following individuals added to the list of Contributing Authors: + . + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + . + libpng versions 0.89, June 1996, through 0.96, May 1997, are + Copyright (c) 1996, 1997 Andreas Dilger + Distributed according to the same disclaimer and license as libpng-0.88, + with the following individuals added to the list of Contributing Authors: + . + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + . + libpng versions 0.5, May 1995, through 0.88, January 1996, are + Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + . + For the purposes of this copyright and license, "Contributing Authors" + is defined as the following set of individuals: + . + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + . + The PNG Reference Library is supplied "AS IS". The Contributing Authors + and Group 42, Inc. disclaim all warranties, expressed or implied, + including, without limitation, the warranties of merchantability and of + fitness for any purpose. The Contributing Authors and Group 42, Inc. + assume no liability for direct, indirect, incidental, special, exemplary, + or consequential damages, which may result from the use of the PNG + Reference Library, even if advised of the possibility of such damage. + . + Permission is hereby granted to use, copy, modify, and distribute this + source code, or portions hereof, for any purpose, without fee, subject + to the following restrictions: + . + 1. The origin of this source code must not be misrepresented. + . + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + . + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + . + The Contributing Authors and Group 42, Inc. specifically permit, without + fee, and encourage the use of this source code as a component to + supporting the PNG file format in commercial products. If you use this + source code in a product, acknowledgment is not required but would be + appreciated. + . + A "png_get_copyright" function is available, for convenient use in "about" + boxes and the like: + . + printf("%s",png_get_copyright(NULL)); + . + Also, the PNG logo (in PNG format, of course) is supplied in the + files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + . + Libpng is OSI Certified Open Source Software. OSI Certified Open Source is + a certification mark of the Open Source Initiative. + . + Glenn Randers-Pehrson + glennrp at users.sourceforge.net + March 26, 2015 + . + The original content can be found on + http://www.libpng.org/pub/png/src/libpng-LICENSE.txt + +License: public-domain + They may be distributed freely and/or modified as long as the original + Author is mentioned! diff --git a/create-thunderbird-l10n-tarball.sh b/create-thunderbird-l10n-tarball.sh new file mode 100755 index 0000000000..16744c0bdc --- /dev/null +++ b/create-thunderbird-l10n-tarball.sh @@ -0,0 +1,328 @@ +#!/bin/sh +# +# create-thunderbird-l10n-tarball.sh +# Porpose: create an upstream tarball from the language pack xpi files +# Current stable and beta versions of the l10n files can be found on +# https://download-origin.cdn.mozilla.net/pub/thunderbird +# +# The script can handle both versions. The option for automatically import the +# *.orig.tar.xz may be broken and isn't tested! + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +# Initialize our own variables: +VERBOSE=0 +FILE="" +ARG_COUNT=0 +LANG_COUNT=0 +CURDIR_FULL=`pwd` +CURDIR=$(basename `pwd`) +MOZILLA_CDN_PROTO="https://" +MOZILLA_CDN_BASE="download-origin.cdn.mozilla.net/pub/thunderbird/" + +# default package name in case the have a local file +XPI=lightning.xpi +# base package name +BASE_PKG="thunderbird" + +# local functions +usage () { +cat << EOF + +Usage: ${0##*/} [-h|-vd] [-e BETA_VER] VERSION +The options have to be used in the correct order! + + -h display this help and exit + -v verbose mode, increase the output messages + -d download given [VERSION] + -e download [BETA_VER] from the beta versions + (Used in combination with '-d' to get beta marked upstream + versions.) + [VERSION] given version in Debian format for downloading and/or creating + the *.orig.tar.xz + +Examples: + ${0##*/} -d 45.0 + + Download version '45.0' of the locales for Thunderbird from Mozilla and + creates a file 'thunderbird_45.0.orig-thunderbird-l10n.tar.xz'. + + + ${0##*/} -de 45.0b1 45.0~b1 + + Download the beta version '45.0b1' of the locales for Thunderbird from + Mozilla and create a file 'thunderbird_45.0~b1.orig-thunderbird-l10n.tar.xz'. + + + ${0##*/} -vde 45.0b1 45.0~b1 + + Same as above, download the beta version '45.0b1' of the locales for + Thunderbird from Mozilla and create a file + 'thunderbird_45.0~b1.orig-thunderbird-l10n.tar.xz'. + But this is done with some verbose output messages to see what's going + on inside. Mostly useful for debugging the script. + +EOF +} + +debug () { +if [ "${VERBOSE}" = "1" ]; then + echo "DEBUG -> $1" +fi +} + +fail () { + echo $* + exit ${EXIT_FAILURE} +} + +######################## +# We are starting here # +######################## + +# check for wget and curl +test -f /usr/bin/wget || fail "wget is missing, please install first!" +test -f /usr/bin/curl || fail "curl is missing, please install first!" + +# check if we are inside icedove/ and have a git environment +if [ "${CURDIR}" != "thunderbird" ]; then + echo "Not in thunderbird/.." + exit ${EXIT_FAILURE} +else + if [ ! -d .git ]; then + echo "no directory .git/ found! You are in the correct directory?" + exit ${EXIT_FAILURE} + fi +fi + +# we have no options found? +if [ $(($#)) -lt 1 ]; then + echo "You need at least one option!" >&2 + echo + usage ${EXIT_FAILURE} +fi + +OPTIND=1 # Reset is necessary if getopts was used previously in the script. It is a good idea to make this local in a function. +while getopts "hvde:" opt; do + case "$opt" in + h) HELP=1 + usage + exit + ;; + v) echo "[[ ... using verbose mode ... ]]" + VERBOSE=1 + ;; + d) DOWNLOAD=yes + debug "found option '-d'" + ;; + e) BETA_VER=${OPTARG} + EXPERIMENTAL=1 + debug "found option '-e' with given BETA_VER: ${BETA_VER}" + ;; + :) "Option -${OPTARG} requires an argument." >&2 + exit 1 + ;; + '?') + usage >&2 + exit 1 + ;; + esac +done + +# shift found options +shift $(( OPTIND - 1 )) + +# looping the arguments, we should have at least only one without an option! +for ARG; do + ARG_COUNT=`expr ${ARG_COUNT} + 1` + debug "given argument: ${ARG}" + debug "ARG_COUNT = ${ARG_COUNT}" +done + +# there is no argument left that should be the Debian version, error out! +if [ "${ARG_COUNT}" = "0" ]; then + echo "missing argument for VERSION!" + exit ${EXIT_FAILURE} + +# we have to many arguments, error out +elif [ "${ARG_COUNT}" != "1" ]; then + echo "more than one argument for VERSION given!" + exit ${EXIT_FAILURE} +fi + +# o.k. the last argument should be the version +VERSION=${ARG} + +debug "Download xpi: ........ ${DOWNLOAD:-off}" +debug "Run git-import-orig: . ${GIT_IMPORT:-off}" +if [ -n ${BETA_VER} ]; then + debug "Upstream beta version: ${BETA_VER}" +fi +debug "Debian version: ...... ${VERSION}" + +# creating temporary directories inside /tmp +# TMPDIR -> the 'base' directory there we build all the stuff +# UPSTREAMDIR -> the directory there the original '*.xpi' will be extracted, +# it contains the complete content of the various *.xpi files, +# we also unpack here the *.xpi files +# ORIGDIR -> the directory for the plain needed content of the ${LANG}.jar, +# will be used for the debian.orig.tar.xz + +export TMPDIR=$(mktemp --tmpdir=/tmp -d)/ + UPSTREAMDIR=${TMPDIR}upstream/ + ORIGDIR="${TMPDIR}${BASE_PKG}-${VERSION}/" + +# download Lightning from the CDN of Mozilla +if [ -n "${DOWNLOAD}" ]; then + # remove a lightning.xpi if present + rm -f ${XPI} + if [ -n "${EXPERIMENTAL}" ]; then + + ######################################################################### + # The beta Lightning packages can have various builds for one version, # + # we want at least the last build of a beta version. Also there are # + # packages for every single language instead of one single file without # + # all languages. # + ######################################################################### + + # getting the latest build inside a release candidates + debug "try at ${MOZILLA_CDN_PROTO}${MOZILLA_CDN_BASE}candidates/${BETA_VER}-candidates/ " + RET=`curl ${MOZILLA_CDN_PROTO}${MOZILLA_CDN_BASE}candidates/${BETA_VER}-candidates/ \ + | grep ">build" | awk '{print $2}' | tr '<>/"' ' ' | awk '{print $6}' | tail -n 1` + + # going further if we found something useful + if [ "$?" = "0" -a "${RET}" != "" ]; then + # DIRECTORY is the 'build[x]' directory on the CDN, e.g. 'build1', 'build2', ... + DIRECTORY=`echo ${RET} | tr ' ' '\n' | head -1` + # DATE is the date of the DIRECTORY folder + DATE=`echo ${RET} | tr ' ' '\n' | tail -1` + debug "found directory '${BETA_VER}-candidates/${DIRECTORY}' from '${DATE}'" + debug "creating ${UPSTREAMDIR}" + mkdir ${UPSTREAMDIR} + cd /tmp + # checking if there is already some download + if [ ! -d ${MOZILLA_CDN_BASE}/candidates/${BETA_VER}-candidates/${DIRECTORY}/linux-x86_64/xpi ]; then + DO_DOWNLOAD="1" + fi + + if [ -d ${MOZILLA_CDN_BASE}/candidates/${BETA_VER}-candidates/${DIRECTORY}/linux-x86_64/xpi ]; then + if [ "$(`ls -l ${MOZILLA_CDN_BASE}/candidates/${BETA_VER}-candidates/${DIRECTORY}/linux-x86_64/xpi | wc -l`)" = "0" ]; then + debug "found old download folder, but it's empty" + DO_DOWNLOAD="1" + fi + fi + if [ "${DO_DOWNLOAD}" = "1" ]; then + debug "going downloading *.xpi files from ${MOZILLA_CDN_PROTO}${MOZILLA_CDN_BASE}/candidates/${BETA_VER}-candidates/${DIRECTORY}/linux-x86_64/" + wget -m -r -l 1 -A xpi ${MOZILLA_CDN_PROTO}${MOZILLA_CDN_BASE}/candidates/${BETA_VER}-candidates/${DIRECTORY}/linux-x86_64/xpi/ + debug "copy *xpi files from donwload folder to workspace" + fi + # finally copy the *.xpi files to ${UPSTREAMDIR} + cp ${MOZILLA_CDN_BASE}/candidates/${BETA_VER}-candidates/${DIRECTORY}/linux-x86_64/xpi/*.xpi ${UPSTREAMDIR} + cd ${TMPDIR} + # uhh, we couldn't find the given BETA_VER on the FTP server + else + fail "Couldn't find version ${BETA_VER}, correct version for option '-e' selected?" + fi + else + + ####################################################################### + # If we are here the user want to get a version for unstable/testing. # + # It's the same as for beta versions, the only difference is the # + # download URL. # + ####################################################################### + + debug "creating ${UPSTREAMDIR}" + mkdir ${UPSTREAMDIR} + cd /tmp + # checking if there is already some download + if [ ! -d ${MOZILLA_CDN_BASE}releases/${VERSION}/linux-x86_64/xpi ]; then + DO_DOWNLOAD="1" + fi + if [ -d ${MOZILLA_CDN_BASE}releases/${VERSION}/linux-x86_64/xpi ]; then + DL_COUNT=`ls -l ${MOZILLA_CDN_BASE}releases/${VERSION}/linux-x86_64/xpi/*.xpi | wc -l` + if [ "${DL_COUNT}" = "0" ]; then + debug "found old download folder, but it's empty" + DO_DOWNLOAD="1" + else + echo "nothing to download, all needed *.xpi are here" + debug "found ${DL_COUNT} files already downloaded" + fi + fi + if [ "${DO_DOWNLOAD}" = "1" ]; then + # getting files for the stable version + wget -m -r -l 1 -A xpi ${MOZILLA_CDN_PROTO}${MOZILLA_CDN_BASE}releases/${VERSION}/linux-x86_64/xpi/ + fi + # finally copy the *.xpi files to $(UPSTREAMDIR}) + cp ${MOZILLA_CDN_BASE}releases/${VERSION}/linux-x86_64/xpi/*.xpi ${UPSTREAMDIR} + fi +else + if [ "${FILE}" != "" ]; then + # DUMMY! option '-f' isn't currently implemented! + # we should have a local *.xpi file if option -f is given + XPI=${FILE} + fi +fi + +debug "removing language 'en_US'" +rm -f ${UPSTREAMDIR}/en-US.xpi +debug "creating workspace for extracted upstream sources in '${ORIGDIR}'" +mkdir ${ORIGDIR} + +# extract l10n files +debug "extracting \"\$LANG*.jar\" in \"${UPSTREAMDIR}chrome\" into \"${ORIGDIR}\$LANG\"" +#LANG_COUNT_LIG=`ls -l ${UPSTREAMDIR}chrome/lightning*.jar | wc -l` + +for XPI in `ls ${UPSTREAMDIR}`; do + LOCALE=`basename ${XPI} .xpi` + debug "creating ${UPSTREAMDIR}/${LOCALE}" + mkdir ${UPSTREAMDIR}/${LOCALE} + unzip -o -q -d $UPSTREAMDIR/$LOCALE $UPSTREAMDIR/$XPI + # use more verbose mode if we do some debugging, comment the line above if needed + #unzip -o -d $UPSTREAMDIR/$LOCALE $UPSTREAMDIR/$XPI + cd $UPSTREAMDIR/$LOCALE + if [ -f chrome/$LOCALE.jar ]; then + JAR=$LOCALE.jar + else + JAR=`echo $XPI | sed --posix 's|-.*||'`.jar + fi + if [ -f chrome/$JAR ]; then + unzip -o -q -d chrome chrome/$JAR + rm -f chrome/$JAR + fi + # removing the not needed any longer *.xpi files + rm $UPSTREAMDIR/$XPI +done + +cd ${TMPDIR} +mv upstream ${BASE_PKG}-${VERSION}/${BASE_PKG}-l10n +# counting languages +LANG_COUNT=`ls ${BASE_PKG}-${VERSION}/${BASE_PKG}-l10n/ | wc -l` + +# doing the *.orig.tar.xz archive stuff +TARBALL="${BASE_PKG}_${VERSION}.orig-${BASE_PKG}-l10n.tar.xz" +debug "creating archive: '${TARBALL}' in '${TMPDIR}'" +cd ${BASE_PKG}-${VERSION} +tar caf ${TARBALL} ${BASE_PKG}-l10n +TARBALL=$(readlink -f ${TARBALL}) + +# moving orig.tar.xz back to the users working dir +cd ${CURDIR_FULL} +debug "moving ${TARBALL} to ${CURDIR_FULL}/../" +mv ${TARBALL} ../ +TARBALL_FINAL=$(readlink -f ../${BASE_PKG}_${VERSION}.orig-${BASE_PKG}-l10n.tar.xz) +echo +echo "Tarball created in:" +echo " -> ${TARBALL_FINAL} <- (containing ${LANG_COUNT} languages)" + +# remove temporary things if no verbose mode +if [ ${VERBOSE} = "" ]; then + debug "cleanup ${TMPDIR} ..." + rm -rf ${TMPDIR} +else + debug "NOT cleaning up ${TMPDIR}" +fi + +echo "done." + +exit $EXIT_SUCCESS diff --git a/docs b/docs new file mode 100644 index 0000000000..5c24349bfa --- /dev/null +++ b/docs @@ -0,0 +1 @@ +mozilla/extensions/spellcheck/locales/en-US/hunspell/README_en_US.txt diff --git a/gbp.conf b/gbp.conf new file mode 100644 index 0000000000..72237ac5b4 --- /dev/null +++ b/gbp.conf @@ -0,0 +1,30 @@ +# Configuration file for git-buildpackage and friends + +[DEFAULT] +# use pristine-tar: +pristine-tar = True +# generate xz compressed orig file +compression = xz +debian-branch = debian/sid +# default branch for upstream sources: +upstream-branch = upstream-78.x +components = [ 'thunderbird-l10n', ] + +[pq] +patch-numbers = False + +[dch] +id-length = 7 + +[import-orig] +# filter out unwanted files/dirs from upstream +filter = [ '*.orig', '*.rej', + './configure', + './js/src/configure', + './js/src/old-configure', + './obj-x86_64-pc-linux-gnu', + './old-configure', + './third_party/python/psutil/tmp/*', + ] +# filter the files out of the tarball passed to pristine-tar +filter-pristine-tar = True diff --git a/logo/icedove/icedove.xpm b/logo/icedove/icedove.xpm new file mode 100644 index 0000000000..bf12bae8eb --- /dev/null +++ b/logo/icedove/icedove.xpm @@ -0,0 +1,204 @@ +/* XPM */ +static char *icedove[] = { +/* columns rows colors chars-per-pixel */ +"32 32 166 2 ", +" c #53575C", +". c #71787F", +"X c #55A30C", +"o c #58A60E", +"O c #5AA612", +"+ c #5CAA12", +"@ c #64AD1E", +"# c #61B115", +"$ c #66B21C", +"% c #69BB1A", +"& c #519A29", +"* c #66AF22", +"= c #69AF26", +"- c #67B021", +"; c #6AB324", +": c #6EBA24", +"> c #67B52B", +", c #6DB32A", +"< c #6FBA29", +"1 c #71B62E", +"2 c #70B82C", +"3 c #66B23A", +"4 c #6BB03A", +"5 c #73B632", +"6 c #75B934", +"7 c #75B639", +"8 c #77B838", +"9 c #7BBB3D", +"0 c #71C420", +"q c #75C924", +"w c #79CE27", +"e c #72C32E", +"r c #5A9D44", +"t c #5A985B", +"y c #69AD4A", +"u c #7EBC43", +"i c #77B548", +"p c #66A25B", +"a c #68A45C", +"s c #6CA95F", +"d c #74BB52", +"f c #5A9664", +"g c #619E6D", +"h c #6FA966", +"j c #74AA6B", +"k c #75B366", +"l c #77AB71", +"z c #79AD73", +"x c #7DB275", +"c c #7FB479", +"v c #81BD47", +"b c #84BE4E", +"n c #87BF51", +"m c #88BC74", +"M c #81B37D", +"N c #84BB7D", +"B c #81C046", +"V c #85C14B", +"C c #87C251", +"Z c #8BC355", +"A c #8EC55A", +"S c #95C766", +"D c #95CA63", +"F c #98CC67", +"G c #91C569", +"H c #9ACB6C", +"J c #9ECD70", +"K c #A2D076", +"L c #A6D37B", +"P c #727B82", +"I c #649A83", +"U c #6F9C9A", +"Y c #73A586", +"T c #73A19E", +"R c #7EAA9B", +"E c #719EA7", +"W c #759FB2", +"Q c #799FBB", +"! c #7EA8B5", +"~ c #7CA2BD", +"^ c #7B9FC1", +"/ c #7FA1C6", +"( c #83B583", +") c #8696A8", +"_ c #93B7A4", +"` c #80A6B8", +"' c #88AEBF", +"] c #9CBABB", +"[ c #98C681", +"{ c #9BC884", +"} c #ADD684", +"| c #AFD68C", +" . c #B0D989", +".. c #B7DB95", +"X. c #BCDE9B", +"o. c #A2C6A1", +"O. c #C0DEA4", +"+. c #C2E1A4", +"@. c #C7E4AB", +"#. c #C8E5AC", +"$. c #CBE5B3", +"%. c #C7E0BD", +"&. c #81A4C0", +"*. c #85A8C3", +"=. c #8CACC4", +"-. c #86A7C8", +";. c #86A8CF", +":. c #8EADCC", +">. c #92AFCB", +",. c #94B3D3", +"<. c #99B5D4", +"1. c #9DBAD2", +"2. c #A9B4C0", +"3. c #A3BBD7", +"4. c #A1BDDA", +"5. c #ABBFDB", +"6. c #ABC6C5", +"7. c #A8C1CA", +"8. c #B5CDC8", +"9. c #A7C0DA", +"0. c #B3C7DE", +"q. c #B3C9DC", +"w. c #AFC6E0", +"e. c #B3C7E1", +"r. c #B5CBE2", +"t. c #B9CCE2", +"y. c #BFD1E6", +"u. c #CCCDC9", +"i. c #CED0CB", +"p. c #D1D3CE", +"a. c #D2D4D0", +"s. c #D7D8D5", +"d. c #D8DAD6", +"f. c #DBDDD9", +"g. c #D4E9C0", +"h. c #D8ECC6", +"j. c #DEE0DD", +"k. c #E0E1DE", +"l. c #E0F1D0", +"z. c #C3D3E6", +"x. c #CDD8E6", +"c. c #C1D4E8", +"v. c #CEDDEC", +"b. c #D4DCE5", +"n. c #D2DDEB", +"m. c #D5E0ED", +"M. c #D9E2EE", +"N. c #D4E2F0", +"B. c #DBE6F1", +"V. c #DEE9F4", +"C. c #E4E5E2", +"Z. c #E7E8E6", +"A. c #E8E9E7", +"S. c #EBECEA", +"D. c #EFF1ED", +"F. c #F0F8EA", +"G. c #E4ECF5", +"H. c #E9EEF4", +"J. c #ECF1F6", +"K. c #ECF3F9", +"L. c #F3F4F3", +"P. c #F5FAF0", +"I. c #F2F5F9", +"U. c #F6F9FC", +"Y. c #FEFEFE", +"T. c None", +/* pixels */ +"T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.", +"T.T.d.U.d.Y.d.U.d.P.k.L.Z.S.S.Z.L.f.L.f.U.d.Y.d.U.f.L.k.L.Z.T.T.", +"T.T.S.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.U.T.T.", +"T.T.a.Y.3.q._ N N M M z z z z z z z z z >.q.=.Y N M 7.3.U.C.T.T.", +"T.T.L.Y.] : w 0 $ # # @ X X X X X X X X f G.Y.1.> e q j L.U.T.T.", +"T.T.p.Y.k q % # O o O X X X X X X X X X X r.Y.U.,.t.3 d I.j.T.T.", +"T.T.L.Y.k % # o X O @ X X X X X X X X X X U U.Y.y.U.<.y U.Y.T.T.", +"T.T.p.Y.a + o o O.@ X X X X O O X o o O X & v.Y.Y.K.m.t I.k.T.T.", +"T.T.L.Y.a o o + O.+ O O @ , 7 u u u 7 = + + 3.Y.Y.Y.U.;.U.Y.T.T.", +"T.T.a.Y.a + o 1 = O.$.H A Z n n n n A S J S ' Y.Y.Y.Y.4.I.k.T.T.", +"T.T.S.Y.a * v 8 H F.P.| , @ @ * = * * @ = , T Y.Y.Y.Y.t.L.U.T.T.", +"T.T.s.Y.a g.F.A 9 O.g.A = = , , , , , ; ; * f K.Y.Y.Y.n.I.Z.T.T.", +"T.T.A.Y.j $.h., @ ; 9 Z 1 5 6 6 5 5 5 1 1 , r G.Y.Y.Y.n.I.L.T.T.", +"T.T.f.Y.j V $ $ ; , 2 D Z 9 9 9 u 7 9 8 6 2 f H.Y.Y.Y.n.I.S.T.T.", +"T.T.C.Y.z 9 $ ; , 2 6 C K Z b V V V v u 9 8 ! Y.Y.Y.Y.n.U.S.T.T.", +"T.T.k.Y.( 2 ; < 2 6 9 v L } A A A A Z V B i r.Y.Y.Y.Y.n.I.D.T.T.", +"T.T.f.Y.( ; ; 2 6 9 B V J ..} F F D D A C *.U.Y.Y.Y.Y.n.I.A.T.T.", +"T.T.S.Y.( : 2 5 p I h Z F X.+.} L K H S -.J.Y.Y.Y.Y.Y.n.I.P.T.T.", +"T.T.a.Y.M : 4 Q v.U.v.:.G | $.#. .} [ 1.U.Y.Y.Y.Y.Y.Y.n.I.Z.T.T.", +"T.T.D.Y.x < ~ H.Y.Y.Y.Y.,.{ $.h.@.o.w.Y.Y.Y.Y.Y.Y.Y.Y.n.I.U.T.T.", +"T.T.i.Y.x g V. x.Y.U.) G.R X.l.8.r.Y.Y.Y.Y.Y.Y.Y.Y.Y.z.I.j.T.T.", +"T.T.L.Y.x E Y.H.K.Y.V.P H.W @.6.r.Y.Y.Y.K.Y.Y.Y.Y.v.v.e.I.U.T.T.", +"T.T.u.Y.Y ` Y.Y.2.P S.U.K./ %.e.Y.Y.Y.J.Y.Y.Y.Y.Y.K.n.z.U.f.T.T.", +"T.T.L.Y.<.9.Y.Y.Y.I.Y.U.J./ ` U.Y.Y.G.Y.Y.Y.Y.Y.Y.Y.U.z.I.Y.T.T.", +"T.T.i.Y.t.B.Y.Y.Y.Y.Y.U.K.-.1.Y.Y.U.B.Y.Y.Y.Y.Y.Y.Y.V.n.I.j.T.T.", +"T.T.L.Y.t.m.Y.Y.Y.Y.Y.Y.U.y.3.Y.Y.I.K.Y.Y.Y.Y.Y.J.V.Y.n.I.U.T.T.", +"T.T.p.Y.5.y.J.J.J.J.J.J.J.J.c.J.J.J.J.J.H.n.v.v.G.J.J.r.U.k.T.T.", +"T.T.S.Y.b.b.M.b.b.b.M.b.b.b.m.m.b.b.M.b.M.b.b.b.b.m.b.b.Y.U.T.T.", +"T.T.d.Y.f.f.Y.j.f.k.Y.Z.C.Z.L.L.Z.A.Y.j.Y.j.j.j.j.Y.k.k.Y.Z.T.T.", +"T.T.A.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.L.T.T.", +"T.T.j.Y.j.Y.k.Y.C.U.Z.L.A.S.L.Z.P.Z.U.k.Y.f.Y.j.Y.k.U.Z.L.S.T.T.", +"T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T.T." +}; diff --git a/logo/icedove/icedove_icon.svg b/logo/icedove/icedove_icon.svg new file mode 100644 index 0000000000..dab3a99da8 --- /dev/null +++ b/logo/icedove/icedove_icon.svg @@ -0,0 +1,1756 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Icedove Icon + + + Ricardo Fernández Fuentes + + + + + Ricardo Fernández Fuentes + + + icedove icon + + + + icedove + ico + icon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/icedove_icon_plain.svg b/logo/icedove/icedove_icon_plain.svg new file mode 100644 index 0000000000..7733517d35 --- /dev/null +++ b/logo/icedove/icedove_icon_plain.svg @@ -0,0 +1,1438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/icedove_icon_profile.svg b/logo/icedove/icedove_icon_profile.svg new file mode 100644 index 0000000000..f4d9829eae --- /dev/null +++ b/logo/icedove/icedove_icon_profile.svg @@ -0,0 +1,1959 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Icedove Icon + + + Ricardo Fernández Fuentes + + + + + Ricardo Fernández Fuentes + + + icedove icon + + + + icedove + ico + icon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/icedove_icon_profile_plain.svg b/logo/icedove/icedove_icon_profile_plain.svg new file mode 100644 index 0000000000..586ce11255 --- /dev/null +++ b/logo/icedove/icedove_icon_profile_plain.svg @@ -0,0 +1,1606 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/icedove_lettering.svg b/logo/icedove/icedove_lettering.svg new file mode 100644 index 0000000000..a2f9216210 --- /dev/null +++ b/logo/icedove/icedove_lettering.svg @@ -0,0 +1,994 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/icedove_logo.svg b/logo/icedove/icedove_logo.svg new file mode 100644 index 0000000000..885bb14685 --- /dev/null +++ b/logo/icedove/icedove_logo.svg @@ -0,0 +1,2407 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Icedove Logo + + + Ricardo Fernández Fuentes + + + + + Ricardo Fernández Fuentes + + + icedove logo + + + + icedove + logo + logotipo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/icedove_logo_plain.svg b/logo/icedove/icedove_logo_plain.svg new file mode 100644 index 0000000000..7804a86f36 --- /dev/null +++ b/logo/icedove/icedove_logo_plain.svg @@ -0,0 +1,1939 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/icedove/license.txt b/logo/icedove/license.txt new file mode 100644 index 0000000000..55c6d2df09 --- /dev/null +++ b/logo/icedove/license.txt @@ -0,0 +1,23 @@ +License for iceweasel_icon/logo - icedove_icon/logo - iceape_icon/logo artworks. + +Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version +1.1 (the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Alternatively, the contents of this file may be used under the terms of +either the GNU General Public License Version 2 or later (the "GPL"), or +the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +in which case the provisions of the GPL or the LGPL are applicable instead +of those above. If you wish to allow use of your version of this file only +under the terms of either the GPL or the LGPL, and not to allow others to +use your version of this file under the terms of the MPL, indicate your +decision by deleting the provisions above and replace them with the notice +and other provisions required by the GPL or the LGPL. If you do not delete +the provisions above, a recipient may use your version of this file under +the terms of any one of the MPL, the GPL or the LGPL. + +Ricardo Fernández Fuentes. +ricardoffmadrid@gmail.com diff --git a/logo/thunderbird/create-pngs.sh b/logo/thunderbird/create-pngs.sh new file mode 100755 index 0000000000..507dacc521 --- /dev/null +++ b/logo/thunderbird/create-pngs.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +src=thunderbird.svg + +for d in 16 22 24 32 48 64 128 256 512; +do + # using ImageMagick + #convert -background none $src -resize ${d}x${d} mailicon${d}.png + + # using Inkscape + inkscape --export-png=mailicon${d}.png --export-width=$d --export-height=$d --export-background-opacity=0 --without-gui $src +done + diff --git a/logo/thunderbird/mailicon128.png b/logo/thunderbird/mailicon128.png new file mode 100644 index 0000000000..53e268fbb0 Binary files /dev/null and b/logo/thunderbird/mailicon128.png differ diff --git a/logo/thunderbird/mailicon16.png b/logo/thunderbird/mailicon16.png new file mode 100644 index 0000000000..6bdd01af92 Binary files /dev/null and b/logo/thunderbird/mailicon16.png differ diff --git a/logo/thunderbird/mailicon22.png b/logo/thunderbird/mailicon22.png new file mode 100644 index 0000000000..9e08ee06a9 Binary files /dev/null and b/logo/thunderbird/mailicon22.png differ diff --git a/logo/thunderbird/mailicon24.png b/logo/thunderbird/mailicon24.png new file mode 100644 index 0000000000..5afa52eb4e Binary files /dev/null and b/logo/thunderbird/mailicon24.png differ diff --git a/logo/thunderbird/mailicon256.png b/logo/thunderbird/mailicon256.png new file mode 100644 index 0000000000..9a6acca21e Binary files /dev/null and b/logo/thunderbird/mailicon256.png differ diff --git a/logo/thunderbird/mailicon32.png b/logo/thunderbird/mailicon32.png new file mode 100644 index 0000000000..e1a2837376 Binary files /dev/null and b/logo/thunderbird/mailicon32.png differ diff --git a/logo/thunderbird/mailicon48.png b/logo/thunderbird/mailicon48.png new file mode 100644 index 0000000000..f3fe3ee834 Binary files /dev/null and b/logo/thunderbird/mailicon48.png differ diff --git a/logo/thunderbird/mailicon512.png b/logo/thunderbird/mailicon512.png new file mode 100644 index 0000000000..cff71b60fe Binary files /dev/null and b/logo/thunderbird/mailicon512.png differ diff --git a/logo/thunderbird/mailicon64.png b/logo/thunderbird/mailicon64.png new file mode 100644 index 0000000000..01d41ada29 Binary files /dev/null and b/logo/thunderbird/mailicon64.png differ diff --git a/logo/thunderbird/pre60/mailicon128.png b/logo/thunderbird/pre60/mailicon128.png new file mode 100644 index 0000000000..8b7e74b07b Binary files /dev/null and b/logo/thunderbird/pre60/mailicon128.png differ diff --git a/logo/thunderbird/pre60/mailicon16.png b/logo/thunderbird/pre60/mailicon16.png new file mode 100644 index 0000000000..16ff89ccdf Binary files /dev/null and b/logo/thunderbird/pre60/mailicon16.png differ diff --git a/logo/thunderbird/pre60/mailicon22.png b/logo/thunderbird/pre60/mailicon22.png new file mode 100644 index 0000000000..9cf772af21 Binary files /dev/null and b/logo/thunderbird/pre60/mailicon22.png differ diff --git a/logo/thunderbird/pre60/mailicon24.png b/logo/thunderbird/pre60/mailicon24.png new file mode 100644 index 0000000000..e208cdd902 Binary files /dev/null and b/logo/thunderbird/pre60/mailicon24.png differ diff --git a/logo/thunderbird/pre60/mailicon256.png b/logo/thunderbird/pre60/mailicon256.png new file mode 100644 index 0000000000..c50868355e Binary files /dev/null and b/logo/thunderbird/pre60/mailicon256.png differ diff --git a/logo/thunderbird/pre60/mailicon32.png b/logo/thunderbird/pre60/mailicon32.png new file mode 100644 index 0000000000..9345f88cad Binary files /dev/null and b/logo/thunderbird/pre60/mailicon32.png differ diff --git a/logo/thunderbird/pre60/mailicon48.png b/logo/thunderbird/pre60/mailicon48.png new file mode 100644 index 0000000000..1b0c2ebca2 Binary files /dev/null and b/logo/thunderbird/pre60/mailicon48.png differ diff --git a/logo/thunderbird/pre60/mailicon512.png b/logo/thunderbird/pre60/mailicon512.png new file mode 100644 index 0000000000..907bb1b8a2 Binary files /dev/null and b/logo/thunderbird/pre60/mailicon512.png differ diff --git a/logo/thunderbird/pre60/mailicon64.png b/logo/thunderbird/pre60/mailicon64.png new file mode 100644 index 0000000000..94f090f6a3 Binary files /dev/null and b/logo/thunderbird/pre60/mailicon64.png differ diff --git a/logo/thunderbird/pre60/thunderbird.svg b/logo/thunderbird/pre60/thunderbird.svg new file mode 100644 index 0000000000..0bdd76ea2a --- /dev/null +++ b/logo/thunderbird/pre60/thunderbird.svg @@ -0,0 +1,768 @@ + + + + + Mozilla Thunderbird Logo + + + + image/svg+xml + + Mozilla Thunderbird Logo + + + + + + https://de.wikipedia.org/wiki/Datei:Mozilla_Thunderbird_Logo.svg + + + Mozilla Foundation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/logo/thunderbird/thunderbird.svg b/logo/thunderbird/thunderbird.svg new file mode 100644 index 0000000000..1cf2ac91c0 --- /dev/null +++ b/logo/thunderbird/thunderbird.svg @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozconfig.default b/mozconfig.default new file mode 100644 index 0000000000..d41387e07c --- /dev/null +++ b/mozconfig.default @@ -0,0 +1,136 @@ +# -*- mode: makefile; coding: utf-8 -*- + +# mozconfig.default +# default settings for the various builds of Mozilla applications +# +# This file is needed to build multiple applications from the source. +# It set up some variables that are used in all builds, or they will be +# overridden later by some builds. The Mozilla build system supports various +# builds from the same source by separate obj-$directorys. +# Further information around the multiple applications build can be found +# on +# +# https://developer.mozilla.org/en-US/docs/Configuring_Build_Options#Building_with_an_Objdir +# +# The application specific obj-dir is set up within the separate +# mozconfig.$APPLICATION file! + +# use/use not packaged software instead of preshipped +ac_add_options --without-system-jpeg # Debian version causes issues on mips* +ac_add_options --with-system-bz2 +ac_add_options --with-system-icu +ac_add_options --with-system-nspr +ac_add_options --without-system-nss +ac_add_options --with-system-zlib + +# other packaged software +ac_add_options --with-system-botan +ac_add_options --with-system-jsonc +ac_add_options --with-system-libevent +ac_add_options --with-system-libvpx + +# disabled features +ac_add_options --disable-av1 +ac_add_options --disable-install-strip +ac_add_options --disable-strip +ac_add_options --disable-tests +ac_add_options --disable-updater +ac_add_options --disable-webrtc + +# enabled features +ac_add_options --allow-addon-sideload +ac_add_options --enable-default-toolkit=cairo-gtk3 +ac_add_options --enable-extensions=default +ac_add_options --enable-official-branding # use the official artwork +ac_add_options --enable-openpgp +ac_add_options --enable-optimize +ac_add_options --enable-system-ffi +ac_add_options --with-unsigned-addon-scopes=app,system + +# Debian specific things +PARALLEL_BUILD=$(echo $DEB_BUILD_OPTIONS | sed -e '/parallel=/!s/.*/1/;s/.*parallel=\([0-9]\+\).*/\1/g') +mk_add_options MOZ_MAKE_FLAGS="-j$PARALLEL_BUILD" +ac_add_options --disable-debug +ac_add_options --host=$DEB_HOST_GNU_TYPE + +# some platform depended things +case `dpkg --print-architecture` in + alpha) + ac_add_options --enable-optimize=-O1 + ;; +# amd64) +# ac_add_options --enable-crashreporter +# ;; + arm64) + ac_add_options --enable-optimize=-O1 + ;; + armel) + ac_add_options --enable-optimize=-O1 +# ac_add_options --enable-crashreporter + ;; + armhf) + ac_add_options --enable-optimize=-O1 +# ac_add_options --enable-crashreporter + ;; + hurd-i386) + ac_add_options --disable-necko-wifi + ;; + hppa) + ac_add_options --disable-optimize + ac_add_options --with-intl-api + ;; + i386) +# ac_add_options --enable-crashreporter + ;; + ia64) + ac_add_options --enable-optimize=-O2 + ;; + kfreebsd-i386) + ac_add_options --disable-necko-wifi + ;; + kfreebsd-amd64) + ac_add_options --disable-necko-wifi + ;; + m68k) + ac_add_options --with-intl-api + ;; + mips) + ac_add_options --with-intl-api + ac_add_options --disable-ion + ;; + mips64el) + ac_add_options --with-intl-api + ac_add_options --disable-jit + ;; + mipsel) + ac_add_options --with-intl-api + ac_add_options --disable-jit + ;; + powerpc) + ac_add_options --with-intl-api + ;; + powerpcspe) + ac_add_options --with-intl-api + ;; + ppc64) + ac_add_options --disable-optimize + ac_add_options --with-intl-api + ;; + ppc64el) + ac_add_options --with-intl-api + ;; + sh4) + ac_add_options --disable-pie + ;; + sparc) + ac_add_options --enable-optimize=-O1 + ac_add_options --with-intl-api + ;; + sparc64) + ac_add_options --with-intl-api + ;; + s390x) + ac_add_options --enable-optimize=-O1 + ac_add_options --with-intl-api + ;; +esac diff --git a/mozconfig.thunderbird b/mozconfig.thunderbird new file mode 100644 index 0000000000..e353666c9b --- /dev/null +++ b/mozconfig.thunderbird @@ -0,0 +1,16 @@ +# -*- mode: makefile; coding: utf-8 -*- + +# mozconfig.thunderbird +# settings for the build of Icedove +# +# This file set up extra config options for the build of the Thunderbird +# application. +# Remember, options here will be overriden by sourcing any file later! + +# sourcing the default common settings +. $topsrcdir/mozconfig.default + +# Debian specific things +ac_add_options --enable-application=comm/mail # enable Thunderbird + +# setting the obj-dir (build directory, filled in by debian/rules) diff --git a/patches/debian-hacks/Add-another-preferences-directory-for-applications-p.patch b/patches/debian-hacks/Add-another-preferences-directory-for-applications-p.patch new file mode 100644 index 0000000000..731b054417 --- /dev/null +++ b/patches/debian-hacks/Add-another-preferences-directory-for-applications-p.patch @@ -0,0 +1,30 @@ +From: Mike Hommey +Date: Sat, 21 Jun 2008 03:09:21 +0200 +Subject: Add another preferences directory for applications: + preferences/syspref + +This can be used to symlink to /etc/thunderbird/pref. +--- + toolkit/xre/nsXREDirProvider.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp +index 62b5694..73b337d 100644 +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -834,6 +834,7 @@ static nsresult DeleteDirIfExists(nsIFile* dir) { + + static const char* const kAppendPrefDir[] = {"defaults", "preferences", + nullptr}; ++static const char *const kAppendSysPrefDir[] = { "defaults", "syspref", nullptr }; + + nsresult nsXREDirProvider::GetFilesInternal(const char* aProperty, + nsISimpleEnumerator** aResult) { +@@ -844,6 +845,7 @@ nsresult nsXREDirProvider::GetFilesInternal(const char* aProperty, + nsCOMArray directories; + + LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories); ++ LoadDirIntoArray(mXULAppDir, kAppendSysPrefDir, directories); + + rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile)); + } else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) { diff --git a/patches/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch b/patches/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch new file mode 100644 index 0000000000..0b2ba29a57 --- /dev/null +++ b/patches/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch @@ -0,0 +1,48 @@ +From: Mike Hommey +Date: Mon, 5 Apr 2010 17:58:23 +0200 +Subject: Don't error-out when run-time libsqlite is older than build-time + libsqlite + +In Debian, we have shlibs to handle this. +--- + storage/mozStorageService.cpp | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp +index 92397c7..1057549 100644 +--- a/storage/mozStorageService.cpp ++++ b/storage/mozStorageService.cpp +@@ -181,6 +181,33 @@ already_AddRefed Service::getSingleton() { + return do_AddRef(gService); + } + ++#if 0 ++ // Ensure that we are using the same version of SQLite that we compiled with ++ // or newer. Our configure check ensures we are using a new enough version ++ // at compile time. ++ if (SQLITE_VERSION_NUMBER > ::sqlite3_libversion_number() || ++ !::sqlite3_compileoption_used("SQLITE_SECURE_DELETE") || ++ !::sqlite3_compileoption_used("SQLITE_THREADSAFE=1") || ++ !::sqlite3_compileoption_used("SQLITE_ENABLE_FTS3") || ++ !::sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY") || ++ !::sqlite3_compileoption_used("SQLITE_ENABLE_DBSTAT_VTAB")) { ++ nsCOMPtr ps(do_GetService(NS_PROMPTSERVICE_CONTRACTID)); ++ if (ps) { ++ nsAutoString title, message; ++ title.AppendLiteral("SQLite Version Error"); ++ message.AppendLiteral( ++ "The application has been updated, but the SQLite " ++ "library wasn't updated properly and the application " ++ "cannot run. Please try to launch the application again. " ++ "If that should still fail, please try reinstalling " ++ "it, or contact the support of where you got the " ++ "application from."); ++ (void)ps->Alert(nullptr, title.get(), message.get()); ++ } ++ MOZ_CRASH("SQLite Version Error"); ++ } ++#endif ++ + // The first reference to the storage service must be obtained on the + // main thread. + NS_ENSURE_TRUE(NS_IsMainThread(), nullptr); diff --git a/patches/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch b/patches/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch new file mode 100644 index 0000000000..edcc2386bd --- /dev/null +++ b/patches/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch @@ -0,0 +1,24 @@ +From: Mike Hommey +Date: Sat, 27 Sep 2008 17:17:39 +0200 +Subject: Don't register plugins if the MOZILLA_DISABLE_PLUGINS environment + variable is set + +--- + dom/plugins/base/nsPluginHost.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp +index ad37e00..e5833d7 100644 +--- a/dom/plugins/base/nsPluginHost.cpp ++++ b/dom/plugins/base/nsPluginHost.cpp +@@ -290,6 +290,10 @@ nsPluginHost::nsPluginHost() + Preferences::AddStrongObserver(this, "plugin.disable"); + } + ++ const char *env = PR_GetEnv("MOZILLA_DISABLE_PLUGINS"); ++ if (env && env[0]) ++ mPluginsDisabled = PR_TRUE; ++ + nsCOMPtr obsService = + mozilla::services::GetObserverService(); + if (obsService) { diff --git a/patches/debian-hacks/Make-Thunderbird-build-reproducible.patch b/patches/debian-hacks/Make-Thunderbird-build-reproducible.patch new file mode 100644 index 0000000000..680867c48a --- /dev/null +++ b/patches/debian-hacks/Make-Thunderbird-build-reproducible.patch @@ -0,0 +1,31 @@ +From: Carsten Schoenert +Date: Sun, 6 Oct 2019 10:03:15 +0200 +Subject: Make Thunderbird build reproducible + +Cherry picked from OpenSuse +https://build.opensuse.org/request/show/732106 +--- + python/mozbuild/mozbuild/action/langpack_manifest.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/python/mozbuild/mozbuild/action/langpack_manifest.py b/python/mozbuild/mozbuild/action/langpack_manifest.py +index 4395235..1455b90 100644 +--- a/python/mozbuild/mozbuild/action/langpack_manifest.py ++++ b/python/mozbuild/mozbuild/action/langpack_manifest.py +@@ -16,6 +16,7 @@ import os + import json + import io + import datetime ++import time + import requests + import mozversioncontrol + import mozpack.path as mozpath +@@ -99,7 +100,7 @@ def get_timestamp_for_locale(path): + dt = get_dt_from_hg(path) + + if dt is None: +- dt = datetime.datetime.utcnow() ++ dt = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) + + dt = dt.replace(microsecond=0) + return dt.strftime("%Y%m%d%H%M%S") diff --git a/patches/debian-hacks/Set-program-name-from-the-remoting-name.patch b/patches/debian-hacks/Set-program-name-from-the-remoting-name.patch new file mode 100644 index 0000000000..01d3608488 --- /dev/null +++ b/patches/debian-hacks/Set-program-name-from-the-remoting-name.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Sun, 5 Feb 2017 08:41:22 +0900 +Subject: Set program name from the remoting name + +--- + toolkit/xre/nsAppRunner.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp +index ef72d1b..4affb82 100644 +--- a/toolkit/xre/nsAppRunner.cpp ++++ b/toolkit/xre/nsAppRunner.cpp +@@ -3750,7 +3750,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { + + // Set program name to the one defined in application.ini. + { +- nsAutoCString program(gAppData->name); ++ nsAutoCString program(gAppData->remotingName); + ToLowerCase(program); + g_set_prgname(program.get()); + } diff --git a/patches/debian-hacks/Strip-version-number-from-application-before-installation.patch b/patches/debian-hacks/Strip-version-number-from-application-before-installation.patch new file mode 100644 index 0000000000..55f52c4d1c --- /dev/null +++ b/patches/debian-hacks/Strip-version-number-from-application-before-installation.patch @@ -0,0 +1,24 @@ +From: =?utf-8?q?Guido_G=C3=BCnther?= +Date: Sat, 24 Nov 2012 11:39:58 +0100 +Subject: Strip version number from application before installation + +Strip thunderbird's version number from the installation directories so +we have a fixed location for extensions that build against it. +--- + config/baseconfig.mk | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/config/baseconfig.mk b/config/baseconfig.mk +index f5bf42d5..9839ee8 100644 +--- a/config/baseconfig.mk ++++ b/config/baseconfig.mk +@@ -3,6 +3,9 @@ + # We thus use INCLUDED_AUTOCONF_MK to enable/disable some parts depending + # whether a normal build is happening or whether the check is running. + installdir = $(libdir)/$(MOZ_APP_NAME) ++includedir := $(includedir)/$(MOZ_APP_NAME) ++idldir = $(datadir)/idl/$(MOZ_APP_NAME) ++sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel + ifeq (.,$(DEPTH)) + DIST = dist + else diff --git a/patches/debian-hacks/Use-remoting-name-for-call-to-gdk_set_program_class.patch b/patches/debian-hacks/Use-remoting-name-for-call-to-gdk_set_program_class.patch new file mode 100644 index 0000000000..b558784ae1 --- /dev/null +++ b/patches/debian-hacks/Use-remoting-name-for-call-to-gdk_set_program_class.patch @@ -0,0 +1,34 @@ +From: Mike Hommey +Date: Mon, 3 Sep 2018 07:37:40 +0900 +Subject: Use remoting name for call to gdk_set_program_class + +Closes: #907574 +--- + widget/gtk/nsAppShell.cpp | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp +index a424664..1126bf9 100644 +--- a/widget/gtk/nsAppShell.cpp ++++ b/widget/gtk/nsAppShell.cpp +@@ -24,6 +24,7 @@ + # include "WakeLockListener.h" + #endif + #include "gfxPlatform.h" ++#include "nsAppRunner.h" + #include "ScreenHelperGTK.h" + #include "HeadlessScreenHelper.h" + #include "mozilla/widget/ScreenManager.h" +@@ -178,10 +179,8 @@ nsresult nsAppShell::Init() { + // creating top-level windows. (At this point, a child process hasn't + // received the list of registered chrome packages, so the + // GetBrandShortName call would fail anyway.) +- nsAutoString brandName; +- mozilla::widget::WidgetUtils::GetBrandShortName(brandName); +- if (!brandName.IsEmpty()) { +- gdk_set_program_class(NS_ConvertUTF16toUTF8(brandName).get()); ++ if (gAppData) { ++ gdk_set_program_class(gAppData->remotingName); + } + } + } diff --git a/patches/debian-hacks/Work-around-Debian-bug-844357.patch b/patches/debian-hacks/Work-around-Debian-bug-844357.patch new file mode 100644 index 0000000000..e8670357bb --- /dev/null +++ b/patches/debian-hacks/Work-around-Debian-bug-844357.patch @@ -0,0 +1,20 @@ +From: Mike Hommey +Date: Mon, 21 Nov 2016 08:15:38 +0900 +Subject: Work around Debian bug #844357 + +--- + widget/gtk/mozgtk/gtk3/moz.build | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/widget/gtk/mozgtk/gtk3/moz.build b/widget/gtk/mozgtk/gtk3/moz.build +index 4e93795..538ef1a 100644 +--- a/widget/gtk/mozgtk/gtk3/moz.build ++++ b/widget/gtk/mozgtk/gtk3/moz.build +@@ -36,3 +36,7 @@ OS_LIBS += [ + 'gdk-3', + ] + OS_LIBS += as_needed ++ ++# Work around Debian bug #844357 ++if CONFIG['CPU_ARCH'].startswith('mips'): ++ OS_LIBS += ['-Wl,--no-gc-sections'] diff --git a/patches/fixes/Add-missing-bindings-for-mips-in-the-authenticator-crate.patch b/patches/fixes/Add-missing-bindings-for-mips-in-the-authenticator-crate.patch new file mode 100644 index 0000000000..86a5b01697 --- /dev/null +++ b/patches/fixes/Add-missing-bindings-for-mips-in-the-authenticator-crate.patch @@ -0,0 +1,60 @@ +From: Mike Hommey +Date: Wed, 23 Sep 2020 12:52:35 +0900 +Subject: Add missing bindings for mips* in the authenticator crate + +--- + Cargo.lock | 2 -- + Cargo.toml | 1 + + third_party/rust/authenticator/src/linux/ioctl_mipsbe.rs | 5 +++++ + third_party/rust/authenticator/src/linux/ioctl_mipsle.rs | 5 +++++ + 4 files changed, 11 insertions(+), 2 deletions(-) + create mode 100644 third_party/rust/authenticator/src/linux/ioctl_mipsbe.rs + create mode 100644 third_party/rust/authenticator/src/linux/ioctl_mipsle.rs + +diff --git a/Cargo.lock b/Cargo.lock +index c41d9fc..2d46a3d 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -183,8 +183,6 @@ dependencies = [ + [[package]] + name = "authenticator" + version = "0.2.12" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "ff593fb4dd388fe452c5e63d4d668699466bd46b571c4b852dfbca4bac8f0706" + dependencies = [ + "bitflags", + "boxfnonce", +diff --git a/Cargo.toml b/Cargo.toml +index b723c1da..b250d3b 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -73,6 +73,7 @@ spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3" } + # failure's backtrace feature might break our builds, see bug 1608157. + failure = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" } + failure_derive = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" } ++authenticator = { path = "third_party/rust/authenticator" } + + [patch.crates-io.cranelift-codegen] + git = "https://github.com/bytecodealliance/wasmtime" +diff --git a/third_party/rust/authenticator/src/linux/ioctl_mipsbe.rs b/third_party/rust/authenticator/src/linux/ioctl_mipsbe.rs +new file mode 100644 +index 0000000..1ca187f +--- /dev/null ++++ b/third_party/rust/authenticator/src/linux/ioctl_mipsbe.rs +@@ -0,0 +1,5 @@ ++/* automatically generated by rust-bindgen */ ++ ++pub type __u32 = ::std::os::raw::c_uint; ++pub const _HIDIOCGRDESCSIZE: __u32 = 1074022401; ++pub const _HIDIOCGRDESC: __u32 = 1342457858; +diff --git a/third_party/rust/authenticator/src/linux/ioctl_mipsle.rs b/third_party/rust/authenticator/src/linux/ioctl_mipsle.rs +new file mode 100644 +index 0000000..1ca187f +--- /dev/null ++++ b/third_party/rust/authenticator/src/linux/ioctl_mipsle.rs +@@ -0,0 +1,5 @@ ++/* automatically generated by rust-bindgen */ ++ ++pub type __u32 = ::std::os::raw::c_uint; ++pub const _HIDIOCGRDESCSIZE: __u32 = 1074022401; ++pub const _HIDIOCGRDESC: __u32 = 1342457858; diff --git a/patches/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-lockP.patch b/patches/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-lockP.patch new file mode 100644 index 0000000000..3c578361f4 --- /dev/null +++ b/patches/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-lockP.patch @@ -0,0 +1,77 @@ +From: Mike Hommey +Date: Sat, 21 Jun 2008 02:48:46 +0200 +Subject: Allow .js preference files to set locked prefs with lockPref() + +--- + modules/libpref/parser/src/lib.rs | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/modules/libpref/parser/src/lib.rs b/modules/libpref/parser/src/lib.rs +index a8c5b6b..aceacf3 100644 +--- a/modules/libpref/parser/src/lib.rs ++++ b/modules/libpref/parser/src/lib.rs +@@ -10,7 +10,7 @@ + //! + //! = * + //! = "(" "," ")" ";" +-//! = "user_pref" | "pref" | "sticky_pref" // in default pref files ++//! = "user_pref" | "pref" | "sticky_pref | lockPref" // in default pref files + //! = "user_pref" // in user pref files + //! = + //! = | "true" | "false" | +@@ -169,6 +169,7 @@ enum Token { + // Keywords + Pref, // pref + StickyPref, // sticky_pref ++ LockPref, // lockPref + UserPref, // user_pref + True, // true + False, // false +@@ -291,7 +292,7 @@ struct KeywordInfo { + token: Token, + } + +-const KEYWORD_INFOS: [KeywordInfo; 7] = [ ++const KEYWORD_INFOS: [KeywordInfo; 8] = [ + // These are ordered by frequency. + KeywordInfo { + string: b"pref", +@@ -321,6 +322,10 @@ const KEYWORD_INFOS: [KeywordInfo; 7] = [ + string: b"sticky_pref", + token: Token::StickyPref, + }, ++ KeywordInfo { ++ string: b"lock_pref", ++ token: Token::LockPref, ++ }, + ]; + + struct Parser<'t> { +@@ -373,14 +378,11 @@ impl<'t> Parser<'t> { + // this will be either the first token of a new pref, or EOF. + loop { + // +- let (pref_value_kind, mut is_sticky) = match token { +- Token::Pref if self.kind == PrefValueKind::Default => { +- (PrefValueKind::Default, false) +- } +- Token::StickyPref if self.kind == PrefValueKind::Default => { +- (PrefValueKind::Default, true) +- } +- Token::UserPref => (PrefValueKind::User, false), ++ let (pref_value_kind, mut is_sticky, mut is_locked) = match token { ++ Token::Pref => (PrefValueKind::Default, false, false), ++ Token::StickyPref => (PrefValueKind::Default, true, false), ++ Token::LockPref => (PrefValueKind::Default, false, true), ++ Token::UserPref => (PrefValueKind::User, false, false), + Token::SingleChar(EOF) => return !self.has_errors, + _ => { + token = self.error_and_recover( +@@ -490,7 +492,6 @@ impl<'t> Parser<'t> { + }; + + // ("," )* // default pref files only +- let mut is_locked = false; + let mut has_attrs = false; + if self.kind == PrefValueKind::Default { + let ok = loop { diff --git a/patches/fixes/Appdata-Adding-some-German-translations.patch b/patches/fixes/Appdata-Adding-some-German-translations.patch new file mode 100644 index 0000000000..b67d7430a4 --- /dev/null +++ b/patches/fixes/Appdata-Adding-some-German-translations.patch @@ -0,0 +1,48 @@ +From: Carsten Schoenert +Date: Sun, 18 Oct 2020 08:38:29 +0200 +Subject: Appdata: Adding some German translations + +--- + .../thunderbird/net.thunderbird.Thunderbird.appdata.xml | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml b/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml +index ba19c75..e34eba5 100644 +--- a/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml ++++ b/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml +@@ -3,7 +3,9 @@ + net.thunderbird.Thunderbird + CC0-1.0 + Thunderbird ++ Thunderbird + Thunderbird is a free and open source email, newsfeed, chat, and calendaring client ++ Thunderbird ist ein freier und Quelloffener Klient für E-Mail-, Newsfeed-, Chat- und Kalender + + +

+@@ -14,10 +16,25 @@ + that can’t communicate with each other. We want our users to have freedom + and choice in how they communicate. +

++ ++

++ Thunderbird ist ein kostenloses E-Mail-, Newsfeed-, Chat- und ++ Kalender-Programm, das einfach einzurichten und anzupassen ist. Eines ++ der Kernprinzipien von Thunderbird ist die Verwendung und Förderung ++ offener Standards – durch diesen Fokus lehnen wir die geschlossenen ++ Plattformen und Dienste unserer Welt ab, die nicht miteinander ++ kommunizieren können. Wir möchten, dass unsere Benutzer die Freiheit ++ und Wahl haben, wie sie kommunizieren. ++

++ +

+ Thunderbird is an open source project, which means anyone can contribute + ideas, designs, code, and time helping fellow users. +

++

++ Thunderbird ist ein Freies Softwareprojekt, jede Person kann Ideen, ++ Designs, Code und Zeit einbringen um anderen Benutzern zu helfen. ++

+
+ + Calendar diff --git a/patches/fixes/Appdata-Fix-up-AppStream-error-by-adding-missing-field.patch b/patches/fixes/Appdata-Fix-up-AppStream-error-by-adding-missing-field.patch new file mode 100644 index 0000000000..8f41a40af0 --- /dev/null +++ b/patches/fixes/Appdata-Fix-up-AppStream-error-by-adding-missing-field.patch @@ -0,0 +1,21 @@ +From: Carsten Schoenert +Date: Sun, 18 Oct 2020 08:39:44 +0200 +Subject: Appdata: Fix up AppStream error by adding missing field + +The AppStream data is missing the lauchable element. +--- + comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml b/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml +index e34eba5..822a5af 100644 +--- a/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml ++++ b/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml +@@ -2,6 +2,7 @@ + + net.thunderbird.Thunderbird + CC0-1.0 ++ thunderbird.desktop + Thunderbird + Thunderbird + Thunderbird is a free and open source email, newsfeed, chat, and calendaring client diff --git a/patches/fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch b/patches/fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch new file mode 100644 index 0000000000..abbcf86ebe --- /dev/null +++ b/patches/fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch @@ -0,0 +1,41 @@ +From: qiaopengcheng +Date: Sun, 2 Jun 2019 07:28:24 +0900 +Subject: Bug 1556197 - amend Bug-1544631 for fixing mips32. + +--- + js/src/jit/mips32/MacroAssembler-mips32-inl.h | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/js/src/jit/mips32/MacroAssembler-mips32-inl.h b/js/src/jit/mips32/MacroAssembler-mips32-inl.h +index a420911..408b60b 100644 +--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h ++++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h +@@ -842,16 +842,25 @@ void MacroAssembler::branchTestSymbol(Condition cond, const ValueOperand& value, + branchTestSymbol(cond, value.typeReg(), label); + } + ++void MacroAssembler::branchTestBigInt(Condition cond, Register tag, ++ Label* label) { ++ MOZ_ASSERT(cond == Equal || cond == NotEqual); ++ ma_b(tag, ImmTag(JSVAL_TAG_BIGINT), label, cond); ++} ++ + void MacroAssembler::branchTestBigInt(Condition cond, const BaseIndex& address, + Label* label) { + SecondScratchRegisterScope scratch2(*this); +- Register tag = extractTag(address, scratch2); +- branchTestBigInt(cond, tag, label); ++ computeEffectiveAddress(address, scratch2); ++ splitTag(scratch2, scratch2); ++ branchTestBigInt(cond, scratch2, label); + } + + void MacroAssembler::branchTestBigInt(Condition cond, const ValueOperand& value, + Label* label) { +- branchTestBigInt(cond, value.typeReg(), label); ++ SecondScratchRegisterScope scratch2(*this); ++ splitTag(value, scratch2); ++ branchTestBigInt(cond, scratch2, label); + } + + void MacroAssembler::branchTestBigIntTruthy(bool b, const ValueOperand& value, diff --git a/patches/fixes/Bug-1650299-Unify-the-inclusion-of-the-ICU-data-file.-r-f.patch b/patches/fixes/Bug-1650299-Unify-the-inclusion-of-the-ICU-data-file.-r-f.patch new file mode 100644 index 0000000000..1a70491d23 --- /dev/null +++ b/patches/fixes/Bug-1650299-Unify-the-inclusion-of-the-ICU-data-file.-r-f.patch @@ -0,0 +1,201 @@ +From: Mike Hommey +Date: Fri, 3 Jul 2020 13:28:39 +0900 +Subject: Bug 1650299 - Unify the inclusion of the ICU data file. r?froydnj + +All the supported compilers support a GNU AS-like syntax, with only a +few details varying. It means we can use a single, simpler, way to +include the ICU data file, instead of 3 different ways, including one +that uses armasm64.exe, possibly wrapped with Wine. + +Differential Revision: https://phabricator.services.mozilla.com/D82144 +--- + config/external/icu/data/genicudata.py | 21 --------------------- + config/external/icu/data/icudata.c | 28 ++++++++++++++++++++++++++++ + config/external/icu/data/icudata.s | 31 ------------------------------- + config/external/icu/data/icudata_gas.S | 17 ----------------- + config/external/icu/data/moz.build | 29 +++++------------------------ + js/moz.configure | 7 ------- + 6 files changed, 33 insertions(+), 100 deletions(-) + delete mode 100644 config/external/icu/data/genicudata.py + create mode 100644 config/external/icu/data/icudata.c + delete mode 100644 config/external/icu/data/icudata.s + delete mode 100644 config/external/icu/data/icudata_gas.S + +diff --git a/config/external/icu/data/genicudata.py b/config/external/icu/data/genicudata.py +deleted file mode 100644 +index 50bc939..0000000 +--- a/config/external/icu/data/genicudata.py ++++ /dev/null +@@ -1,21 +0,0 @@ +-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +-# vim: set filetype=python: +-# This Source Code Form is subject to the terms of the Mozilla Public +-# License, v. 2.0. If a copy of the MPL was not distributed with this +-# file, You can obtain one at http://mozilla.org/MPL/2.0/. +- +-from __future__ import absolute_import +-import buildconfig +- +- +-def main(output, data_file, data_symbol): +- if buildconfig.substs.get('WINE'): +- drive = 'z:' +- else: +- drive = '' +- output.write(''' AREA |.rdata|,ALIGN=4,DATA,READONLY +- EXPORT |{data_symbol}|[DATA] +-|{data_symbol}| +- INCBIN {drive}{data_file} +- END +-'''.format(data_file=data_file, data_symbol=data_symbol, drive=drive)) +diff --git a/config/external/icu/data/icudata.c b/config/external/icu/data/icudata.c +new file mode 100644 +index 0000000..7299ac9 +--- /dev/null ++++ b/config/external/icu/data/icudata.c +@@ -0,0 +1,28 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifdef __APPLE__ ++# define RODATA ".data\n.const" ++#else ++# define RODATA ".section .rodata" ++#endif ++ ++#if defined(__APPLE__) || (defined(_WIN32) && defined(__i386__)) ++# define _PREFIXED(x) _##x ++#else ++# define _PREFIXED(x) x ++#endif ++#define PREFIXED(x) _PREFIXED(x) ++ ++#define DATA(sym, file) DATA2(sym, file) ++// clang-format off ++#define DATA2(sym, file) \ ++ __asm__(".global " #sym "\n" \ ++ RODATA "\n" \ ++ ".balign 16\n" \ ++ #sym ":\n" \ ++ " .incbin " #file "\n") ++// clang-format on ++ ++DATA(PREFIXED(ICU_DATA_SYMBOL), ICU_DATA_FILE); +diff --git a/config/external/icu/data/icudata.s b/config/external/icu/data/icudata.s +deleted file mode 100644 +index a740f32..0000000 +--- a/config/external/icu/data/icudata.s ++++ /dev/null +@@ -1,31 +0,0 @@ +-;; This Source Code Form is subject to the terms of the Mozilla Public +-;; License, v. 2.0. If a copy of the MPL was not distributed with this +-;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +- +-%ifdef PREFIX +- %define DATA_SYMBOL _ %+ ICU_DATA_SYMBOL +-%else +- %define DATA_SYMBOL ICU_DATA_SYMBOL +-%endif +- +-%ifidn __OUTPUT_FORMAT__,elf +- %define FORMAT_ELF 1 +-%elifidn __OUTPUT_FORMAT__,elf32 +- %define FORMAT_ELF 1 +-%elifidn __OUTPUT_FORMAT__,elf64 +- %define FORMAT_ELF 1 +-%else +- %define FORMAT_ELF 0 +-%endif +- +-%if FORMAT_ELF +- global DATA_SYMBOL:data hidden +- ; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default. +- [SECTION .note.GNU-stack noalloc noexec nowrite progbits] +-%else +- global DATA_SYMBOL +-%endif +- +-SECTION .rodata align=16 +-DATA_SYMBOL: +- incbin ICU_DATA_FILE +diff --git a/config/external/icu/data/icudata_gas.S b/config/external/icu/data/icudata_gas.S +deleted file mode 100644 +index 6c9abc8..0000000 +--- a/config/external/icu/data/icudata_gas.S ++++ /dev/null +@@ -1,17 +0,0 @@ +-# This Source Code Form is subject to the terms of the Mozilla Public +-# License, v. 2.0. If a copy of the MPL was not distributed with this +-# file, You can obtain one at http://mozilla.org/MPL/2.0/. +- +-#if defined(__linux__) && defined(__ELF__) +-.section .note.GNU-stack,"",%progbits +-#endif +-#ifdef PREFIX +-# define DATA_SYMBOL _##ICU_DATA_SYMBOL +-#else +-# define DATA_SYMBOL ICU_DATA_SYMBOL +-#endif +-.global DATA_SYMBOL +-.data +-.balign 16 +-DATA_SYMBOL: +- .incbin ICU_DATA_FILE +diff --git a/config/external/icu/data/moz.build b/config/external/icu/data/moz.build +index d4741a0..023b4e9 100644 +--- a/config/external/icu/data/moz.build ++++ b/config/external/icu/data/moz.build +@@ -8,29 +8,10 @@ + # JSAPI consumers don't have to deal with setting ICU's data path. + Library('icudata') + +-if CONFIG['OS_ARCH'] == 'WINNT': +- if CONFIG['CPU_ARCH'] == 'x86': +- ASFLAGS += ['-DPREFIX'] +-elif CONFIG['OS_ARCH'] == 'Darwin': +- ASFLAGS += ['-DPREFIX'] +- +-data_symbol = 'icudt%s_dat' % CONFIG['MOZ_ICU_VERSION'] +-asflags = [ +- '-I%s/config/external/icu/data/' % TOPSRCDIR, +- '-DICU_DATA_FILE="%s"' % CONFIG['ICU_DATA_FILE'], +- '-DICU_DATA_SYMBOL=%s' % data_symbol, +-] + LOCAL_INCLUDES += ['.'] + +-if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64': +- icudata = 'icudata.asm' +- GeneratedFile(icudata, script='genicudata.py', +- inputs=[CONFIG['ICU_DATA_FILE']], flags=[data_symbol]) +- SOURCES += ['!%s' % icudata] +-elif CONFIG['HAVE_YASM']: +- USE_YASM = True +- SOURCES += ['icudata.s'] +- ASFLAGS += asflags +-elif CONFIG['GNU_AS']: +- SOURCES += ['icudata_gas.S'] +- ASFLAGS += asflags ++DEFINES['ICU_DATA_FILE'] = '"icudt%sl.dat"' % CONFIG['MOZ_ICU_VERSION'] ++DEFINES['ICU_DATA_SYMBOL'] = 'icudt%s_dat' % CONFIG['MOZ_ICU_VERSION'] ++SOURCES += [ ++ 'icudata.c', ++] +diff --git a/js/moz.configure b/js/moz.configure +index b1c9685..4ac0bd8 100644 +--- a/js/moz.configure ++++ b/js/moz.configure +@@ -760,13 +760,6 @@ def icu_version(build_env): + + set_config('MOZ_ICU_VERSION', icu_version) + +-@depends(icu_version, target, when='--with-intl-api') +-def icu_data_file(version, target): +- # target.endianness is always 'big' or 'little' +- return 'icudt%s%s.dat' % (version, target.endianness[0]) +- +-set_config('ICU_DATA_FILE', icu_data_file) +- + # Source files that use ICU should have control over which parts of the ICU + # namespace they want to use. + set_define('U_USING_ICU_NAMESPACE', '0', when='--with-intl-api') diff --git a/patches/fixes/Bug-628252-os2.cc-fails-to-compile-against-GCC-4.6-m.patch b/patches/fixes/Bug-628252-os2.cc-fails-to-compile-against-GCC-4.6-m.patch new file mode 100644 index 0000000000..96dd7326be --- /dev/null +++ b/patches/fixes/Bug-628252-os2.cc-fails-to-compile-against-GCC-4.6-m.patch @@ -0,0 +1,21 @@ +From: Christopher Aillon +Date: Tue, 8 Feb 2011 14:16:37 -0500 +Subject: Bug 628252 - os2.cc fails to compile against GCC 4.6, + missing #include ; r,a=roc + +--- + gfx/ots/src/os2.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gfx/ots/src/os2.cc b/gfx/ots/src/os2.cc +index 5376a1d..c271d88 100644 +--- a/gfx/ots/src/os2.cc ++++ b/gfx/ots/src/os2.cc +@@ -3,6 +3,7 @@ + // found in the LICENSE file. + + #include ++#include + + #include "os2.h" + #include "head.h" diff --git a/patches/fixes/Don-t-build-ICU-in-parallel.patch b/patches/fixes/Don-t-build-ICU-in-parallel.patch new file mode 100644 index 0000000000..b199b79d98 --- /dev/null +++ b/patches/fixes/Don-t-build-ICU-in-parallel.patch @@ -0,0 +1,23 @@ +From: Emilio Pozuelo Monfort +Date: Sat, 7 Dec 2019 08:55:17 +0900 +Subject: Don't build ICU in parallel + +--- + intl/icu_sources_data.py | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py +index 1037861..09a691a 100644 +--- a/intl/icu_sources_data.py ++++ b/intl/icu_sources_data.py +@@ -247,9 +247,7 @@ def update_data_file(topsrcdir): + print('Running ICU make...') + if not try_run( + 'icu-make', +- ['make', +- '--jobs=%d' % multiprocessing.cpu_count(), +- '--output-sync'], ++ ['make'], + cwd=objdir): + return False + print('Copying ICU data file...') diff --git a/patches/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch b/patches/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch new file mode 100644 index 0000000000..e26d337344 --- /dev/null +++ b/patches/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch @@ -0,0 +1,22 @@ +From: Christoph Goehre +Date: Mon, 16 Sep 2013 20:40:57 +0200 +Subject: Load-dependent-libraries-with-their-real-path-to-avo + +--- + xpcom/glue/standalone/nsXPCOMGlue.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xpcom/glue/standalone/nsXPCOMGlue.cpp b/xpcom/glue/standalone/nsXPCOMGlue.cpp +index cf8e265..d1c5a85 100644 +--- a/xpcom/glue/standalone/nsXPCOMGlue.cpp ++++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp +@@ -132,6 +132,9 @@ static bool ReadDependentCB(pathstr_t aDependentLib, + ReadAheadLib(aDependentLib); + } + #endif ++ char lib[MAXPATHLEN]; ++ if (realpath(aDependentLib, lib)) ++ aDependentLib = lib; + LibHandleType libHandle = GetLibHandle(aDependentLib); + if (libHandle) { + AppendDependentLib(libHandle); diff --git a/patches/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch b/patches/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch new file mode 100644 index 0000000000..60a362eb8b --- /dev/null +++ b/patches/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch @@ -0,0 +1,24 @@ +From: Mike Hommey +Date: Sat, 22 Nov 2008 09:35:23 +0100 +Subject: Properly launch applications set in $HOME/.mailcap + +https://bugzilla.mozilla.org/show_bug.cgi?id=444440 +--- + uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +index 7cbefcc..c4bafef 100644 +--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp ++++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +@@ -53,6 +53,10 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile* aFile) { + if (mDefaultApplication) return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); + + nsAutoCString nativePath; ++/* the name of the function has changed ++ * the old was the following: ++ nsCAutoString nativePath; ++ */ + aFile->GetNativePath(nativePath); + + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); diff --git a/patches/fixes/reduce-the-rust-debuginfo-level-on-selected-architectures.patch b/patches/fixes/reduce-the-rust-debuginfo-level-on-selected-architectures.patch new file mode 100644 index 0000000000..0744d10794 --- /dev/null +++ b/patches/fixes/reduce-the-rust-debuginfo-level-on-selected-architectures.patch @@ -0,0 +1,38 @@ +From: Carsten Schoenert +Date: Wed, 30 Sep 2020 17:21:27 +0200 +Subject: reduce the rust debuginfo level on selected architectures + +Compiling with debuginfo=2 causes the OOM killer to interrupt the build on +launchpad builders. Initially this was only on 32 bit architectures, but with +firefox 63 it started happening frequently on arm64 and ppc64el too, and with +newer versions it started happening very frequently on s390x too. + +Patch cherry-picked from Ubuntu. +--- + build/moz.configure/toolchain.configure | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure +index d6cadde..8b46285 100755 +--- a/build/moz.configure/toolchain.configure ++++ b/build/moz.configure/toolchain.configure +@@ -1875,8 +1875,8 @@ def rustc_opt_level(opt_level_option, moz_optimize): + return '1' if moz_optimize.optimize else '0' + + +-@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers') +-def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers): ++@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers', host) ++def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers, host): + # Cargo currently supports only two interesting profiles for building: + # development and release. Those map (roughly) to --enable-debug and + # --disable-debug in Gecko, respectively. +@@ -1899,6 +1899,8 @@ def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers): + + if debug_symbols: + debug_info = '2' ++ if host.bitness == 32 or host.cpu in ('aarch64', 'ppc64', 's390x', 'x86'): ++ debug_info = '1' + + opts = [] + diff --git a/patches/porting-arm/Reduce-memory-usage-while-linking-on-arm-el-hf-platforms.patch b/patches/porting-arm/Reduce-memory-usage-while-linking-on-arm-el-hf-platforms.patch new file mode 100644 index 0000000000..7d59a29afc --- /dev/null +++ b/patches/porting-arm/Reduce-memory-usage-while-linking-on-arm-el-hf-platforms.patch @@ -0,0 +1,37 @@ +From: Carsten Schoenert +Date: Sun, 6 Oct 2019 08:28:58 +0200 +Subject: Reduce memory usage while linking on arm{el,hf} platforms + +The build even on armhf is failing while linking mostly due exhausted +memory usage. Reduce the memory usage on arm{el,hf} platform by telling +the linker to not hold used memory. + +Author: Olivier Tilloy +--- + build/moz.configure/toolchain.configure | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure +index 5ef6e31..d6cadde 100755 +--- a/build/moz.configure/toolchain.configure ++++ b/build/moz.configure/toolchain.configure +@@ -2127,15 +2127,16 @@ def select_linker(linker, c_compiler, developer_options, enable_gold, + set_config('LINKER_KIND', select_linker.KIND) + + +-@depends_if(select_linker, macos_sdk) +-def linker_ldflags(linker, macos_sdk): ++@depends_if(select_linker, macos_sdk, host) ++def linker_ldflags(linker, macos_sdk, host): + flags = list(linker.LINKER_FLAG or []) + if macos_sdk: + if linker.KIND == 'ld64': + flags.append('-Wl,-syslibroot,%s' % macos_sdk) + else: + flags.append('-Wl,--sysroot=%s' % macos_sdk) +- ++ elif host.cpu == 'arm': ++ flags.append('-Wl,--no-keep-memory') + return flags + + diff --git a/patches/porting-armel/Avoid-using-vmrs-vmsr-on-armel.patch b/patches/porting-armel/Avoid-using-vmrs-vmsr-on-armel.patch new file mode 100644 index 0000000000..55cde74313 --- /dev/null +++ b/patches/porting-armel/Avoid-using-vmrs-vmsr-on-armel.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Tue, 22 May 2018 07:51:56 +0900 +Subject: Avoid using vmrs/vmsr on armel + +--- + dom/media/webaudio/blink/DenormalDisabler.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dom/media/webaudio/blink/DenormalDisabler.h b/dom/media/webaudio/blink/DenormalDisabler.h +index b7a3ca3..4f92d77 100644 +--- a/dom/media/webaudio/blink/DenormalDisabler.h ++++ b/dom/media/webaudio/blink/DenormalDisabler.h +@@ -44,7 +44,7 @@ namespace WebCore { + # define HAVE_DENORMAL 1 + #endif + +-#if defined(__arm__) || defined(__aarch64__) ++#if (defined(__arm__) && !defined(__SOFTFP__)) || defined(__aarch64__) + # define HAVE_DENORMAL 1 + #endif + diff --git a/patches/porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch b/patches/porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch new file mode 100644 index 0000000000..41f9ec44e0 --- /dev/null +++ b/patches/porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch @@ -0,0 +1,118 @@ +From: Mike Hommey +Date: Mon, 21 May 2018 12:04:22 +0900 +Subject: Bug 1463035 - Remove MOZ_SIGNAL_TRAMPOLINE. r?darchons + +For some reason, GNU as is not happy with the assembly generated after +bug 1238661 anymore on Debian armel. + +OTOH, as mentioned in bug 1238661 comment 4, we actually don't need this +workaround anymore, so let's just kill it. +--- + mfbt/LinuxSignal.h | 38 ---------------------- + mfbt/moz.build | 4 --- + .../baseprofiler/core/platform-linux-android.cpp | 3 +- + tools/profiler/core/platform-linux-android.cpp | 3 +- + 4 files changed, 2 insertions(+), 46 deletions(-) + delete mode 100644 mfbt/LinuxSignal.h + +diff --git a/mfbt/LinuxSignal.h b/mfbt/LinuxSignal.h +deleted file mode 100644 +index cdebb77..0000000 +--- a/mfbt/LinuxSignal.h ++++ /dev/null +@@ -1,38 +0,0 @@ +-/* This Source Code Form is subject to the terms of the Mozilla Public +- * License, v. 2.0. If a copy of the MPL was not distributed with this +- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +- +-#ifndef mozilla_LinuxSignal_h +-#define mozilla_LinuxSignal_h +- +-namespace mozilla { +- +-#if defined(__arm__) && defined(__ANDROID__) +- +-// Some (old) Linux kernels on ARM have a bug where a signal handler +-// can be called without clearing the IT bits in CPSR first. The result +-// is that the first few instructions of the handler could be skipped, +-// ultimately resulting in crashes. To workaround this bug, the handler +-// on ARM is a trampoline that starts with enough NOP instructions, so +-// that even if the IT bits are not cleared, only the NOP instructions +-// will be skipped over. +- +-template +-__attribute__((naked)) void SignalTrampoline(int aSignal, siginfo_t* aInfo, +- void* aContext) { +- asm volatile("nop; nop; nop; nop" : : : "memory"); +- +- asm volatile("b %0" : : "X"(H) : "memory"); +-} +- +-# define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline) +- +-#else // __arm__ +- +-# define MOZ_SIGNAL_TRAMPOLINE(h) (h) +- +-#endif // __arm__ +- +-} // namespace mozilla +- +-#endif // mozilla_LinuxSignal_h +diff --git a/mfbt/moz.build b/mfbt/moz.build +index bd0885a..78a5268 100644 +--- a/mfbt/moz.build ++++ b/mfbt/moz.build +@@ -137,10 +137,6 @@ if CONFIG['OS_ARCH'] == 'WINNT': + EXPORTS.mozilla += [ + 'WindowsVersion.h', + ] +-elif CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'FreeBSD': +- EXPORTS.mozilla += [ +- 'LinuxSignal.h', +- ] + + if CONFIG['MOZ_TSAN']: + EXPORTS.mozilla += [ +diff --git a/mozglue/baseprofiler/core/platform-linux-android.cpp b/mozglue/baseprofiler/core/platform-linux-android.cpp +index 8e69569..1dfd64b 100644 +--- a/mozglue/baseprofiler/core/platform-linux-android.cpp ++++ b/mozglue/baseprofiler/core/platform-linux-android.cpp +@@ -63,7 +63,6 @@ + #include + + #include "prenv.h" +-#include "mozilla/LinuxSignal.h" + #include "mozilla/PodOperations.h" + #include "mozilla/DebugOnly.h" + +@@ -294,7 +293,7 @@ Sampler::Sampler(PSLockRef aLock) + + // Request profiling signals. + struct sigaction sa; +- sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler); ++ sa.sa_sigaction = SigprofHandler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART | SA_SIGINFO; + if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) { +diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/core/platform-linux-android.cpp +index 296d3ed..ea401b7 100644 +--- a/tools/profiler/core/platform-linux-android.cpp ++++ b/tools/profiler/core/platform-linux-android.cpp +@@ -63,7 +63,6 @@ + #include + + #include "prenv.h" +-#include "mozilla/LinuxSignal.h" + #include "mozilla/PodOperations.h" + #include "mozilla/DebugOnly.h" + #if defined(GP_OS_linux) || defined(GP_OS_android) +@@ -288,7 +287,7 @@ Sampler::Sampler(PSLockRef aLock) + + // Request profiling signals. + struct sigaction sa; +- sa.sa_sigaction = MOZ_SIGNAL_TRAMPOLINE(SigprofHandler); ++ sa.sa_sigaction = SigprofHandler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART | SA_SIGINFO; + if (sigaction(SIGPROF, &sa, &mOldSigprofHandler) != 0) { diff --git a/patches/porting-armhf/Bug-1526653-Include-struct-definitions-for-user_vfp-and-u.patch b/patches/porting-armhf/Bug-1526653-Include-struct-definitions-for-user_vfp-and-u.patch new file mode 100644 index 0000000000..3079cdd21f --- /dev/null +++ b/patches/porting-armhf/Bug-1526653-Include-struct-definitions-for-user_vfp-and-u.patch @@ -0,0 +1,31 @@ +From: Mike Hommey +Date: Sat, 1 Jun 2019 09:06:01 +0900 +Subject: Bug 1526653 - Include struct definitions for user_vfp and + user_vfp_exc. + +--- + js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp +index a6610f3..7862898 100644 +--- a/js/src/wasm/WasmSignalHandlers.cpp ++++ b/js/src/wasm/WasmSignalHandlers.cpp +@@ -249,7 +249,16 @@ using mozilla::DebugOnly; + #endif + + #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS +-# include ++struct user_vfp { ++ unsigned long long fpregs[32]; ++ unsigned long fpscr; ++}; ++ ++struct user_vfp_exc { ++ unsigned long fpexc; ++ unsigned long fpinst; ++ unsigned long fpinst2; ++}; + #endif + + #if defined(ANDROID) diff --git a/patches/porting-armhf/Don-t-use-LLVM-internal-assembler-on-armhf.patch b/patches/porting-armhf/Don-t-use-LLVM-internal-assembler-on-armhf.patch new file mode 100644 index 0000000000..f1b8e03349 --- /dev/null +++ b/patches/porting-armhf/Don-t-use-LLVM-internal-assembler-on-armhf.patch @@ -0,0 +1,43 @@ +From: Carsten Schoenert +Date: Sat, 5 Oct 2019 19:23:45 +0200 +Subject: Don't use LLVM internal assembler on armhf + +Avoid the usage of LLVM own assembler implementation on specific parts +as the assembler isn't build with NEON support. + +Author: Olivier Tilloy +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561819 +--- + gfx/ycbcr/moz.build | 3 +++ + media/libjpeg/moz.build | 4 ++++ + 2 files changed, 7 insertions(+) + +diff --git a/gfx/ycbcr/moz.build b/gfx/ycbcr/moz.build +index c643fba..59a7eab 100644 +--- a/gfx/ycbcr/moz.build ++++ b/gfx/ycbcr/moz.build +@@ -60,6 +60,9 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['HAVE_ARM_NEON']: + SOURCES += [ + 'yuv_convert_arm.cpp', + ] ++ # The integrated assembler fails to build yuv_convert_arm.cpp because it doesn't have NEON ++ if CONFIG['CC_TYPE'] == 'clang': ++ CXXFLAGS += ['-fno-integrated-as'] + + LOCAL_INCLUDES += ['/media/libyuv/libyuv/include'] + +diff --git a/media/libjpeg/moz.build b/media/libjpeg/moz.build +index c214868..dba24f2 100644 +--- a/media/libjpeg/moz.build ++++ b/media/libjpeg/moz.build +@@ -219,6 +219,10 @@ if CONFIG['CPU_ARCH'] == 'x86_64': + ASFLAGS += ['-I%s/media/libjpeg/simd/nasm/' % TOPSRCDIR] + ASFLAGS += ['-I%s/media/libjpeg/simd/x86_64/' % TOPSRCDIR] + ++# The integrated assembler fails to build simd/arm/jsimd_neon.S because it doesn't have NEON ++if CONFIG['CC_TYPE'] == 'clang' and CONFIG['CPU_ARCH'] == 'arm': ++ ASFLAGS += ['-fno-integrated-as'] ++ + # We allow warnings for third-party code that can be updated from upstream. + AllowCompilerWarnings() + diff --git a/patches/porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-hurd.patch b/patches/porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-hurd.patch new file mode 100644 index 0000000000..d8330f9736 --- /dev/null +++ b/patches/porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-hurd.patch @@ -0,0 +1,22 @@ +From: Christoph Goehre +Date: Sat, 6 Aug 2011 17:55:14 +0200 +Subject: Allow ipc code to build on GNU/hurd + +Thanks: Pino Toscano +--- + ipc/chromium/src/build/build_config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index caa2742..4e0711d 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -22,7 +22,7 @@ + # define OS_LINUX 1 + #elif defined(__APPLE__) + # define OS_MACOSX 1 +-#elif defined(__linux__) || defined(__GLIBC__) ++#elif defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) + # define OS_LINUX 1 + #elif defined(__DragonFly__) + # define OS_DRAGONFLY 1 diff --git a/patches/porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch b/patches/porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch new file mode 100644 index 0000000000..99fa5e6cc6 --- /dev/null +++ b/patches/porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch @@ -0,0 +1,38 @@ +From: Mike Hommey +Date: Thu, 30 Jun 2011 18:29:22 +0200 +Subject: Allow ipc code to build on GNU/kfreebsd + +--- + ipc/chromium/src/base/platform_thread_posix.cc | 5 +++++ + ipc/chromium/src/build/build_config.h | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc +index 7c866b8..e0d6726 100644 +--- a/ipc/chromium/src/base/platform_thread_posix.cc ++++ b/ipc/chromium/src/base/platform_thread_posix.cc +@@ -51,6 +51,11 @@ PlatformThreadId PlatformThread::CurrentId() { + return port; + #elif defined(OS_LINUX) + return syscall(__NR_gettid); ++#ifdef __NR_gettid ++ return syscall(__NR_gettid); ++#else ++ return getpid(); ++#endif + #elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) + return (intptr_t)(pthread_self()); + #elif defined(OS_NETBSD) +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index f573190..caa2742 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -22,7 +22,7 @@ + # define OS_LINUX 1 + #elif defined(__APPLE__) + # define OS_MACOSX 1 +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__GLIBC__) + # define OS_LINUX 1 + #elif defined(__DragonFly__) + # define OS_DRAGONFLY 1 diff --git a/patches/porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch b/patches/porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch new file mode 100644 index 0000000000..10953b504b --- /dev/null +++ b/patches/porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch @@ -0,0 +1,247 @@ +From: Carsten Schoenert +Date: Sat, 29 Mar 2014 20:58:55 +0100 +Subject: FTBFS hurd: fixing unsupported platform Hurd + +On the Hurd platform the build failed in +js/src/jit/AsmJSSignalHandlers.cpp:131 because of unsupported +mode for reading / writing thead state with following message. + + # error "Don't know how to read/write to the thread state via the mcontext_t." + +The original patch comes from Richard Brown +https://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/2014-March/015565.html + +After release of Thunderbird 44 there are additional changes made as the +various configuration files where split into more files. +--- + dom/plugins/ipc/PluginModuleChild.cpp | 6 +++--- + dom/plugins/ipc/PluginModuleChild.h | 2 +- + ipc/chromium/chromium-config.mozbuild | 5 +++++ + ipc/chromium/moz.build | 2 +- + ipc/chromium/src/base/message_loop.cc | 4 ++-- + ipc/chromium/src/base/process_util_posix.cc | 2 +- + ipc/chromium/src/build/build_config.h | 3 ++- + .../src/third_party/libeventcommon.mozbuild | 5 +++++ + ipc/glue/GeckoChildProcessHost.cpp | 25 +++++++++++++++++++--- + js/src/wasm/WasmSignalHandlers.cpp | 2 +- + 10 files changed, 43 insertions(+), 13 deletions(-) + +diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp +index 5811141..75f9b76 100644 +--- a/dom/plugins/ipc/PluginModuleChild.cpp ++++ b/dom/plugins/ipc/PluginModuleChild.cpp +@@ -284,7 +284,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename, + + GetIPCChannel()->SetAbortOnError(true); + +-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) ++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD) + mShutdownFunc = + (NP_PLUGINSHUTDOWN)PR_FindFunctionSymbol(mLibrary, "NP_Shutdown"); + +@@ -1529,7 +1529,7 @@ mozilla::ipc::IPCResult PluginModuleChild::AnswerNP_GetEntryPoints( + AssertPluginThread(); + MOZ_ASSERT(mIsChrome); + +-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) ++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD) + return IPC_OK(); + #elif defined(OS_WIN) || defined(OS_MACOSX) + *_retval = mGetEntryPointsFunc(&mFunctions); +@@ -1570,7 +1570,7 @@ NPError PluginModuleChild::DoNP_Initialize(const PluginSettings& aSettings) { + #endif + + NPError result; +-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) ++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD) + result = mInitializeFunc(&sBrowserFuncs, &mFunctions); + #elif defined(OS_WIN) || defined(OS_MACOSX) + result = mInitializeFunc(&sBrowserFuncs); +diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h +index 84df35e..a3cbb78 100644 +--- a/dom/plugins/ipc/PluginModuleChild.h ++++ b/dom/plugins/ipc/PluginModuleChild.h +@@ -227,7 +227,7 @@ class PluginModuleChild : public PPluginModuleChild { + + // we get this from the plugin + NP_PLUGINSHUTDOWN mShutdownFunc; +-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) ++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD) + NP_PLUGINUNIXINIT mInitializeFunc; + #elif defined(OS_WIN) || defined(OS_MACOSX) + NP_PLUGININIT mInitializeFunc; +diff --git a/ipc/chromium/chromium-config.mozbuild b/ipc/chromium/chromium-config.mozbuild +index a8271cb..e128ad7 100644 +--- a/ipc/chromium/chromium-config.mozbuild ++++ b/ipc/chromium/chromium-config.mozbuild +@@ -57,5 +57,10 @@ else: + DEFINES['OS_OPENBSD'] = 1 + DEFINES['OS_BSD'] = 1 + ++ elif CONFIG['OS_ARCH'] == 'GNU': ++ DEFINES.update({ ++ 'OS_HURD': 1, ++ }) ++ + else: + DEFINES['OS_LINUX'] = 1 +diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build +index d29817b..930c2f3 100644 +--- a/ipc/chromium/moz.build ++++ b/ipc/chromium/moz.build +@@ -110,7 +110,7 @@ if os_bsd or os_linux: + 'src/base/message_pump_glib.cc', + ] + +-if os_solaris: ++if os_solaris or os_hurd: + SOURCES += [ + 'src/base/process_util_linux.cc', + 'src/base/time_posix.cc', +diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc +index 07785b6..394ffe0 100644 +--- a/ipc/chromium/src/base/message_loop.cc ++++ b/ipc/chromium/src/base/message_loop.cc +@@ -21,7 +21,7 @@ + #if defined(OS_POSIX) + # include "base/message_pump_libevent.h" + #endif +-#if defined(OS_LINUX) || defined(OS_BSD) ++#if defined(OS_LINUX) || defined(OS_BSD)|| defined(OS_HURD) + # if defined(MOZ_WIDGET_GTK) + # include "base/message_pump_glib.h" + # endif +@@ -235,7 +235,7 @@ MessageLoop::MessageLoop(Type type, nsIEventTarget* aEventTarget) + if (type_ == TYPE_UI) { + # if defined(OS_MACOSX) + pump_ = base::MessagePumpMac::Create(); +-# elif defined(OS_LINUX) || defined(OS_BSD) ++# elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) + pump_ = new base::MessagePumpForUI(); + # endif // OS_LINUX + } else if (type_ == TYPE_IO) { +diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc +index 513396d..745e099 100644 +--- a/ipc/chromium/src/base/process_util_posix.cc ++++ b/ipc/chromium/src/base/process_util_posix.cc +@@ -132,7 +132,7 @@ void CloseSuperfluousFds(void* aCtx, bool (*aShouldPreserve)(void*, int)) { + #if defined(ANDROID) + static const rlim_t kSystemDefaultMaxFds = 1024; + static const char kFDDir[] = "/proc/self/fd"; +-#elif defined(OS_LINUX) || defined(OS_SOLARIS) ++#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_HURD) + static const rlim_t kSystemDefaultMaxFds = 8192; + static const char kFDDir[] = "/proc/self/fd"; + #elif defined(OS_MACOSX) +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index 4e0711d..72105fc 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -24,6 +24,7 @@ + # define OS_MACOSX 1 + #elif defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) + # define OS_LINUX 1 ++# define OS_HURD 1 + #elif defined(__DragonFly__) + # define OS_DRAGONFLY 1 + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +@@ -50,7 +51,7 @@ + // For access to standard POSIX features, use OS_POSIX instead of a more + // specific macro. + #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ +- defined(OS_SOLARIS) ++ defined(OS_SOLARIS) || defined(OS_HURD) + # define OS_POSIX 1 + #endif + +diff --git a/ipc/chromium/src/third_party/libeventcommon.mozbuild b/ipc/chromium/src/third_party/libeventcommon.mozbuild +index 5037ec7..c858d9c 100644 +--- a/ipc/chromium/src/third_party/libeventcommon.mozbuild ++++ b/ipc/chromium/src/third_party/libeventcommon.mozbuild +@@ -8,6 +8,7 @@ os_win = 0 + os_posix = 0 + os_macosx = 0 + os_bsd = 0 ++os_hurd = 0 + os_linux = 0 + os_solaris = 0 + +@@ -25,6 +26,10 @@ else: + elif CONFIG['OS_ARCH'] == 'SunOS': + os_solaris = 1 + libevent_include_suffix = 'solaris' ++ # attempt to get GNU hurd into the build again, further modification probably needed ++ elif CONFIG['OS_ARCH'] == 'GNU': ++ os_hurd = 1 ++ libevent_include_suffix = 'gnu' + else: + os_linux = 1 + if CONFIG['OS_TARGET'] == 'Android': +diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp +index 0624e5f..aa4ced9 100644 +--- a/ipc/glue/GeckoChildProcessHost.cpp ++++ b/ipc/glue/GeckoChildProcessHost.cpp +@@ -1108,12 +1108,31 @@ bool LinuxProcessLauncher::DoSetup() { + } + #endif // MOZ_WIDGET_GTK + +-#ifdef OS_POSIX ++#if defined(OS_POSIX) || defined(OS_HURD) + bool PosixProcessLauncher::DoSetup() { + if (!BaseProcessLauncher::DoSetup()) { + return false; + } + ++//-------------------------------------------------- ++ // For POSIX, we have to be extremely anal about *not* using ++ // std::wstring in code compiled with Mozilla's -fshort-wchar ++ // configuration, because chromium is compiled with -fno-short-wchar ++ // and passing wstrings from one config to the other is unsafe. So ++ // we split the logic here. ++ ++# if defined(MOZ_WIDGET_GTK) ++ if (mProcessType == GeckoProcessType_Content) { ++ // disable IM module to avoid sandbox violation ++ mLaunchOptions->env_map["GTK_IM_MODULE"] = "gtk-im-context-simple"; ++ ++ // Disable ATK accessibility code in content processes because it conflicts ++ // with the sandbox, and we proxy that information through the main process ++ // anyway. ++ mLaunchOptions->env_map["NO_AT_BRIDGE"] = "1"; ++ } ++# endif // defined(MOZ_WIDGET_GTK) ++ + // XPCOM may not be initialized in some subprocesses. We don't want + // to initialize XPCOM just for the directory service, especially + // since LD_LIBRARY_PATH is already set correctly in subprocesses +@@ -1122,7 +1141,7 @@ bool PosixProcessLauncher::DoSetup() { + MOZ_ASSERT(gGREBinPath); + nsCString path; + NS_CopyUnicodeToNative(nsDependentString(gGREBinPath), path); +-# if defined(OS_LINUX) || defined(OS_BSD) ++# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) + const char* ld_library_path = PR_GetEnv("LD_LIBRARY_PATH"); + nsCString new_ld_lib_path(path.get()); + +@@ -1221,7 +1240,7 @@ bool PosixProcessLauncher::DoSetup() { + mChildArgv.push_back(mPidString); + + if (!CrashReporter::IsDummy()) { +-# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) ++# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD) + int childCrashFd, childCrashRemapFd; + if (!CrashReporter::CreateNotificationPipeForChild(&childCrashFd, + &childCrashRemapFd)) { +diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp +index 78d1544..a6610f3 100644 +--- a/js/src/wasm/WasmSignalHandlers.cpp ++++ b/js/src/wasm/WasmSignalHandlers.cpp +@@ -109,7 +109,7 @@ using mozilla::DebugOnly; + # define R01_sig(p) ((p)->sc_frame.fixreg[1]) + # define R32_sig(p) ((p)->sc_frame.srr0) + # endif +-#elif defined(__linux__) || defined(__sun) ++#elif defined(__linux__) || defined(__sun) || defined(__GNU__) + # if defined(__linux__) + # define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP]) + # define EBP_sig(p) ((p)->uc_mcontext.gregs[REG_EBP]) diff --git a/patches/porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch b/patches/porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch new file mode 100644 index 0000000000..50e72f0c69 --- /dev/null +++ b/patches/porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch @@ -0,0 +1,167 @@ +From: Mike Hommey +Date: Tue, 11 Mar 2008 08:29:25 +0100 +Subject: LDAP: support building on GNU/kFreeBSD and GNU/Hurd + +https://bugzilla.mozilla.org/show_bug.cgi?id=356011 + +Squashed kFreeBSD/Hurd related fixes: +- Fix FTBFS on Hurd-i386 +- Build fixes for GNU/kFreeBSD in directory/ +- Missing bits for Hurd support +--- + comm/ldap/c-sdk/include/portable.h | 25 ++++++++++++++++------ + comm/ldap/c-sdk/libraries/libldap/compat.c | 2 +- + comm/ldap/c-sdk/libraries/libprldap/ldappr-error.c | 2 +- + nsprpub/config/nsinstall.c | 25 ++++++++++++++++++++++ + 4 files changed, 45 insertions(+), 9 deletions(-) + +diff --git a/comm/ldap/c-sdk/include/portable.h b/comm/ldap/c-sdk/include/portable.h +index 9c03cfc..f609b4e 100644 +--- a/comm/ldap/c-sdk/include/portable.h ++++ b/comm/ldap/c-sdk/include/portable.h +@@ -124,7 +124,8 @@ + */ + #ifndef NEED_BSDREGEX + # if (defined(SYSV) || defined(NETBSD) || defined(FREEBSD) || \ +- defined(__OpenBSD__) || defined(linux) || defined(DARWIN)) && \ ++ defined(__OpenBSD__) || defined(linux) || defined(DARWIN) || \ ++ defined(__GNU__) || defined(__GLIBC__)) && \ + !defined(sgi) + # define NEED_BSDREGEX + # endif +@@ -152,9 +153,14 @@ + /* + * Is snprintf() part of the standard C runtime library? + */ ++#if !defined(HAVE_SNPRINTF) ++#if defined(SOLARIS) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(HPUX) || defined(AIX) ++#define HAVE_SNPRINTF ++#endif + #if defined(_WINDOWS) + # define snprintf _snprintf + #endif ++#endif + + /* + * Async IO. Use a non blocking implementation of connect() and +@@ -169,7 +175,7 @@ + */ + #if !defined(WINSOCK) && !defined(_WINDOWS) && !defined(macintosh) && \ + !defined(XP_OS2) +-# if defined(hpux) || defined(LINUX) || defined(SUNOS4) || defined(XP_BEOS) ++# if defined(hpux) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(SUNOS4) || defined(XP_BEOS) + # include + # else + # include +@@ -243,7 +249,7 @@ + # define HAVE_TIME_R + #endif + +-#if defined(SNI) || defined(LINUX1_2) ++#if defined(SNI) || defined(LINUX1_2) || defined(__GNU__) || defined(__GLIBC__) + int strcasecmp(const char*, const char*); + # ifdef SNI + int strncasecmp(const char*, const char*, int); +@@ -270,7 +276,12 @@ int strncasecmp(const char*, const char*, size_t); + # define NSLDAPI_NETDB_BUF_SIZE 1024 + # endif + +-# if defined(sgi) || defined(HPUX9) || defined(SCOOS) || defined(UNIXWARE) || \ ++#if defined(__GLIBC__) && __GLIBC__ >= 2 ++typedef char GETHOSTBYNAME_buf_t [NSLDAPI_NETDB_BUF_SIZE]; ++# define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t ++# define GETHOSTBYNAME( n, r, b, l, rp, e ) gethostbyname_r( n, r, b, l, rp, e ) ++# define GETHOSTBYNAME_R_RETURNS_INT ++#elif defined(sgi) || defined(HPUX9) || defined(SCOOS) || defined(UNIXWARE) || \ + defined(SUNOS4) || defined(SNI) || defined(BSDI) || defined(NCR) || \ + defined(OSF1) || defined(NEC) || defined(VMS) || \ + (defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \ +@@ -292,7 +303,7 @@ typedef char GETHOSTBYNAME_buf_t[NSLDAPI_NETDB_BUF_SIZE]; + # define GETHOSTBYNAME_BUF_T struct hostent_data + # define GETHOSTBYNAME(n, r, b, l, e) \ + nsldapi_compat_gethostbyname_r(n, r, (char*)&b, l, e) +-# elif defined(LINUX) || defined(DRAGONFLY) ++# elif defined(LINUX) || defined(DRAGONFLY) || defined(__GNU__) || defined(__GLIBC__) + typedef char GETHOSTBYNAME_buf_t[NSLDAPI_NETDB_BUF_SIZE]; + # define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t + # define GETHOSTBYNAME(n, r, b, l, rp, e) gethostbyname_r(n, r, b, l, rp, e) +@@ -314,7 +325,7 @@ typedef char GETHOSTBYNAME_buf_t[NSLDAPI_NETDB_BUF_SIZE]; + defined(OSF1V4) || defined(AIX) || defined(UnixWare) || defined(hpux) || \ + defined(HPUX11) || defined(NETBSD) || defined(IRIX6) || \ + defined(FREEBSD) || defined(VMS) || defined(NTO) || defined(OPENBSD) || \ +- defined(DRAGONFLY) ++ defined(DRAGONFLY || defined(__GLIBC__)) + # define NSLDAPI_CTIME(c, b, l) ctime_r(c, b) + # elif defined(OSF1V3) + # define NSLDAPI_CTIME(c, b, l) (ctime_r(c, b, l) ? NULL : b) +@@ -450,7 +461,7 @@ int select(int, fd_set*, fd_set*, fd_set*, struct timeval*); + # define NSLDAPI_FOPEN(filename, mode) fopen(filename, mode) + #endif + +-#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(_WINDOWS) ++#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(AIX) || defined(HPUX) || defined(_WINDOWS) + size_t nsldapi_compat_strlcpy(char* dst, const char* src, size_t len); + # define STRLCPY nsldapi_compat_strlcpy + #else +diff --git a/comm/ldap/c-sdk/libraries/libldap/compat.c b/comm/ldap/c-sdk/libraries/libldap/compat.c +index 2b919de..3f7c0da 100644 +--- a/comm/ldap/c-sdk/libraries/libldap/compat.c ++++ b/comm/ldap/c-sdk/libraries/libldap/compat.c +@@ -81,7 +81,7 @@ char* nsldapi_compat_ctime_r(const time_t* clock, char* buf, int buflen) { + } + #endif /* HPUX10 && _REENTRANT && !HPUX11 */ + +-#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(_WINDOWS) ++#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(_WINDOWS) || defined(__GNU__) || defined(__GLIBC__) + /* + * Copies src to the dstsize buffer at dst. The copy will never + * overflow the destination buffer and the buffer will always be null +diff --git a/comm/ldap/c-sdk/libraries/libprldap/ldappr-error.c b/comm/ldap/c-sdk/libraries/libprldap/ldappr-error.c +index 4554548..52ad562 100644 +--- a/comm/ldap/c-sdk/libraries/libprldap/ldappr-error.c ++++ b/comm/ldap/c-sdk/libraries/libprldap/ldappr-error.c +@@ -218,7 +218,7 @@ struct prldap_errormap_entry { + + #if defined(__hpux) || defined(_AIX) || defined(OSF1) || defined(DARWIN) || \ + defined(BEOS) || defined(FREEBSD) || defined(BSDI) || defined(VMS) || \ +- defined(OPENBSD) || defined(NETBSD) ++ defined(OPENBSD) || defined(NETBSD) || defined(__FreeBSD_kernel__) + # define EDEADLOCK -1 + #endif + +diff --git a/nsprpub/config/nsinstall.c b/nsprpub/config/nsinstall.c +index ee6a111..87a90f5 100644 +--- a/nsprpub/config/nsinstall.c ++++ b/nsprpub/config/nsinstall.c +@@ -40,6 +40,31 @@ + #endif + + #if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) ++#ifdef NEXTSTEP ++#include ++ ++/* ++** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0), ++** when called on a mounted fs. Did anyone notice this? Here's an ugly ++** workaround ... ++*/ ++#define getcwd(b,s) my_getcwd(b,s) ++ ++static char * ++my_getcwd (char *buf, size_t size) ++{ ++ FILE *pwd = popen("pwd", "r"); ++ char *result = fgets(buf, size, pwd); ++ ++ if (result) { ++ buf[strlen(buf)-1] = '\0'; ++ } ++ pclose (pwd); ++ return buf; ++} ++#endif /* NEXTSTEP */ ++ ++#if defined(LINUX) || defined(__GLIBC__) || defined(__GNU__) + #include + #endif + diff --git a/patches/porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch b/patches/porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch new file mode 100644 index 0000000000..3532714a1f --- /dev/null +++ b/patches/porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch @@ -0,0 +1,281 @@ +From: Carsten Schoenert +Date: Sun, 24 Apr 2016 20:49:46 +0200 +Subject: adding missed HURD adoptions + +Based on https://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/2016-April/027634.html +--- + ipc/chromium/src/base/platform_thread.h | 2 +- + ipc/chromium/src/base/platform_thread_posix.cc | 2 +- + ipc/chromium/src/base/port.h | 2 +- + ipc/chromium/src/base/process_util.h | 2 +- + ipc/chromium/src/base/process_util_posix.cc | 38 ++++++++++++ + media/webrtc/signaling/src/sdp/sipcc/cpr_types.h | 2 +- + media/webrtc/trunk/webrtc/build/build_config.h | 6 +- + .../gtest/include/gtest/internal/gtest-port.h | 67 ++++++++++++++++++++++ + security/sandbox/chromium/build/build_config.h | 4 +- + 9 files changed, 118 insertions(+), 7 deletions(-) + +diff --git a/ipc/chromium/src/base/platform_thread.h b/ipc/chromium/src/base/platform_thread.h +index 42f4865..41e84dc 100644 +--- a/ipc/chromium/src/base/platform_thread.h ++++ b/ipc/chromium/src/base/platform_thread.h +@@ -25,7 +25,7 @@ typedef void* PlatformThreadHandle; // HANDLE + # include + typedef pthread_t PlatformThreadHandle; + # if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || \ +- defined(__GLIBC__) ++ defined(__GLIBC__) || defined(OS_HURD) + # include + typedef pid_t PlatformThreadId; + # elif defined(OS_BSD) +diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc +index 31b1592..609260e 100644 +--- a/ipc/chromium/src/base/platform_thread_posix.cc ++++ b/ipc/chromium/src/base/platform_thread_posix.cc +@@ -56,7 +56,7 @@ PlatformThreadId PlatformThread::CurrentId() { + #else + return getpid(); + #endif +-#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) ++#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) || defined(OS_HURD) + return (intptr_t)(pthread_self()); + #elif defined(OS_NETBSD) + return _lwp_self(); +diff --git a/ipc/chromium/src/base/port.h b/ipc/chromium/src/base/port.h +index 9d78f52..d6176c8 100644 +--- a/ipc/chromium/src/base/port.h ++++ b/ipc/chromium/src/base/port.h +@@ -58,7 +58,7 @@ namespace base { + // Define an OS-neutral wrapper for shared library entry points + #if defined(OS_WIN) + # define API_CALL __stdcall +-#elif defined(OS_LINUX) || defined(OS_MACOSX) ++#elif defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_HURD) + # define API_CALL + #endif + +diff --git a/ipc/chromium/src/base/process_util.h b/ipc/chromium/src/base/process_util.h +index 20e1174..7361b4c 100644 +--- a/ipc/chromium/src/base/process_util.h ++++ b/ipc/chromium/src/base/process_util.h +@@ -15,7 +15,7 @@ + #if defined(OS_WIN) + # include + # include +-#elif defined(OS_LINUX) || defined(__GLIBC__) ++#elif defined(OS_LINUX) || defined(__GLIBC__) || defined(OS_HURD) + # include + # include + # include +diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc +index 745e099..d4eaf28 100644 +--- a/ipc/chromium/src/base/process_util_posix.cc ++++ b/ipc/chromium/src/base/process_util_posix.cc +@@ -143,6 +143,10 @@ void CloseSuperfluousFds(void* aCtx, bool (*aShouldPreserve)(void*, int)) { + static const rlim_t kSystemDefaultMaxFds = 1024; + // at least /dev/fd will exist + static const char kFDDir[] = "/dev/fd"; ++#elif defined(OS_HURD) ++ static const rlim_t kSystemDefaultMaxFds = 1024; ++ // Currently always empty, but it exists ++ static const char kFDDir[] = "/dev/fd"; + #endif + + // Get the maximum number of FDs possible. +@@ -205,6 +209,40 @@ void CloseSuperfluousFds(void* aCtx, bool (*aShouldPreserve)(void*, int)) { + } + } + ++// Sets all file descriptors to close on exec except for stdin, stdout ++// and stderr. ++// TODO(agl): Remove this function. It's fundamentally broken for multithreaded ++// apps. ++void SetAllFDsToCloseOnExec() { ++#if defined(OS_LINUX) || defined(OS_SOLARIS) ++ const char fd_dir[] = "/proc/self/fd"; ++#elif defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD) ++ const char fd_dir[] = "/dev/fd"; ++#endif ++ ScopedDIR dir_closer(opendir(fd_dir)); ++ DIR *dir = dir_closer.get(); ++ if (NULL == dir) { ++ DLOG(ERROR) << "Unable to open " << fd_dir; ++ return; ++ } ++ ++ struct dirent *ent; ++ while ((ent = readdir(dir))) { ++ // Skip . and .. entries. ++ if (ent->d_name[0] == '.') ++ continue; ++ int i = atoi(ent->d_name); ++ // We don't close stdin, stdout or stderr. ++ if (i <= STDERR_FILENO) ++ continue; ++ ++ int flags = fcntl(i, F_GETFD); ++ if ((flags == -1) || (fcntl(i, F_SETFD, flags | FD_CLOEXEC) == -1)) { ++ DLOG(ERROR) << "fcntl failure."; ++ } ++ } ++} ++ + bool DidProcessCrash(bool* child_exited, ProcessHandle handle) { + #ifdef MOZ_ENABLE_FORKSERVER + // We only know if a process exists, but not if it has crashed. +diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h +index f048e72..8bb0b59 100644 +--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h ++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h +@@ -7,7 +7,7 @@ + + #include + +-#if defined SIP_OS_LINUX ++#if defined SIP_OS_LINUX || defined(SIP_OS_HURD) + #include "cpr_linux_types.h" + #elif defined SIP_OS_WINDOWS + #include "cpr_win_types.h" +diff --git a/media/webrtc/trunk/webrtc/build/build_config.h b/media/webrtc/trunk/webrtc/build/build_config.h +index 229d1f4..9654654 100644 +--- a/media/webrtc/trunk/webrtc/build/build_config.h ++++ b/media/webrtc/trunk/webrtc/build/build_config.h +@@ -37,6 +37,9 @@ + #elif defined(_WIN32) + #define OS_WIN 1 + #define TOOLKIT_VIEWS 1 ++#elif defined(__GNU__) ++#define OS_HURD 1 ++#define TOOLKIT_GTK + #elif defined(__DragonFly__) + #define OS_DRAGONFLY 1 + #define TOOLKIT_GTK +@@ -70,7 +73,8 @@ + // For access to standard POSIXish features, use OS_POSIX instead of a + // more specific macro. + #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ +- defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL) ++ defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL) || \ ++ defined(OS_HURD) + #define OS_POSIX 1 + #endif + +diff --git a/security/nss/gtests/google_test/gtest/include/gtest/internal/gtest-port.h b/security/nss/gtests/google_test/gtest/include/gtest/internal/gtest-port.h +index 786497d..2f2cbb6 100644 +--- a/security/nss/gtests/google_test/gtest/include/gtest/internal/gtest-port.h ++++ b/security/nss/gtests/google_test/gtest/include/gtest/internal/gtest-port.h +@@ -310,6 +310,64 @@ + (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) + #endif // __GNUC__ + ++// Determines the platform on which Google Test is compiled. ++#ifdef __CYGWIN__ ++# define GTEST_OS_CYGWIN 1 ++#elif defined __SYMBIAN32__ ++# define GTEST_OS_SYMBIAN 1 ++#elif defined _WIN32 ++# define GTEST_OS_WINDOWS 1 ++# ifdef _WIN32_WCE ++# define GTEST_OS_WINDOWS_MOBILE 1 ++# elif defined(__MINGW__) || defined(__MINGW32__) ++# define GTEST_OS_WINDOWS_MINGW 1 ++# elif defined(WINAPI_FAMILY) ++# include ++# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) ++# define GTEST_OS_WINDOWS_DESKTOP 1 ++# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) ++# define GTEST_OS_WINDOWS_PHONE 1 ++# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) ++# define GTEST_OS_WINDOWS_RT 1 ++# else ++ // WINAPI_FAMILY defined but no known partition matched. ++ // Default to desktop. ++# define GTEST_OS_WINDOWS_DESKTOP 1 ++# endif ++# else ++# define GTEST_OS_WINDOWS_DESKTOP 1 ++# endif // _WIN32_WCE ++#elif defined __APPLE__ ++# define GTEST_OS_MAC 1 ++# if TARGET_OS_IPHONE ++# define GTEST_OS_IOS 1 ++# if TARGET_IPHONE_SIMULATOR ++# define GTEST_OS_IOS_SIMULATOR 1 ++# endif ++# endif ++#elif defined __linux__ ++# define GTEST_OS_LINUX 1 ++# if defined __ANDROID__ ++# define GTEST_OS_LINUX_ANDROID 1 ++# endif ++#elif defined __MVS__ ++# define GTEST_OS_ZOS 1 ++#elif defined(__sun) && defined(__SVR4) ++# define GTEST_OS_SOLARIS 1 ++#elif defined(_AIX) ++# define GTEST_OS_AIX 1 ++#elif defined(__hpux) ++# define GTEST_OS_HPUX 1 ++#elif defined __native_client__ ++# define GTEST_OS_NACL 1 ++#elif defined __OpenBSD__ ++# define GTEST_OS_OPENBSD 1 ++#elif defined __QNX__ ++# define GTEST_OS_QNX 1 ++#elif defined(__GNU__) ++# define GTEST_OS_HURD 1 ++#endif // __CYGWIN__ ++ + // Macros for disabling Microsoft Visual C++ warnings. + // + // GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385) +@@ -635,9 +693,14 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; + // + // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 + // to your compiler flags. ++<<<<<<< HEAD + #define GTEST_HAS_PTHREAD \ + (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \ + GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA) ++======= ++# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ ++ || GTEST_OS_QNX || GTEST_OS_HURD) ++>>>>>>> 8e31d5a9318... adding missed HURD adoptions + #endif // GTEST_HAS_PTHREAD + + #if GTEST_HAS_PTHREAD +@@ -828,8 +891,12 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; + (GTEST_OS_MAC && !GTEST_OS_IOS) || \ + (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ + GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ ++<<<<<<< HEAD + GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || \ + GTEST_OS_NETBSD || GTEST_OS_FUCHSIA) ++======= ++ GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_HURD) ++>>>>>>> 8e31d5a9318... adding missed HURD adoptions + # define GTEST_HAS_DEATH_TEST 1 + #endif + +diff --git a/security/sandbox/chromium/build/build_config.h b/security/sandbox/chromium/build/build_config.h +index 4d1ba77..e34024e 100644 +--- a/security/sandbox/chromium/build/build_config.h ++++ b/security/sandbox/chromium/build/build_config.h +@@ -47,6 +47,8 @@ + // we really are using glibc, not uClibc pretending to be glibc + #define LIBC_GLIBC 1 + #endif ++#elif defined(__GNU__) ++#define OS_HURD 1 + #elif defined(_WIN32) + #define OS_WIN 1 + #elif defined(__Fuchsia__) +@@ -82,7 +84,7 @@ + #if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_ASMJS) || \ + defined(OS_FREEBSD) || defined(OS_LINUX) || defined(OS_MACOSX) || \ + defined(OS_NACL) || defined(OS_NETBSD) || defined(OS_OPENBSD) || \ +- defined(OS_QNX) || defined(OS_SOLARIS) ++ defined(OS_QNX) || defined(OS_SOLARIS) || defined(OS_HURD) + #define OS_POSIX 1 + #endif + diff --git a/patches/porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch b/patches/porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch new file mode 100644 index 0000000000..79284cad0d --- /dev/null +++ b/patches/porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch @@ -0,0 +1,60 @@ +From: Christoph Goehre +Date: Wed, 31 Oct 2012 13:27:07 -0400 +Subject: ipc/chromium: fix #if define() for kFreeBSD and Hurd + +The kFreeBSD and Hurd platforms need some other macros to include +the correct needed headers. +Depended on this some minor changes to call the correct functions +also needed. Also the list of the cpp source file for the chromium +things needs to expanded. +The changes is an adoption of the previous dropped patch 'Fix +ipc/chromium on kFreeBSD and Hurd' from the version 17. +--- + ipc/chromium/src/base/platform_thread_posix.cc | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc +index e0d6726..31b1592 100644 +--- a/ipc/chromium/src/base/platform_thread_posix.cc ++++ b/ipc/chromium/src/base/platform_thread_posix.cc +@@ -13,7 +13,7 @@ + # include + #elif defined(OS_NETBSD) + # include +-#elif defined(OS_LINUX) ++#elif defined(OS_LINUX) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) + # include + # include + #endif +@@ -22,7 +22,7 @@ + # include + #endif + +-#if defined(OS_BSD) && !defined(OS_NETBSD) && !defined(__GLIBC__) ++#if defined(OS_BSD) && !defined(OS_NETBSD) && !defined(__GLIBC__) && !defined(__FreeBSD_kernel__) + # include + #endif + +@@ -100,6 +100,22 @@ void PlatformThread::SetName(const char* name) { + // also sets the thread name on the PRThread wrapper, and allows us to + // retrieve it using PR_GetThreadName. + NS_SetCurrentThreadName(name); ++ ++ // http://0pointer.de/blog/projects/name-your-threads.html ++ // Set the name for the LWP (which gets truncated to 15 characters). ++ // Note that glibc also has a 'pthread_setname_np' api, but it may not be ++ // available everywhere and it's only benefit over using prctl directly is ++ // that it can set the name of threads other than the current thread. ++#if defined(OS_LINUX) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) ++ prctl(PR_SET_NAME, reinterpret_cast(name), 0, 0, 0); ++#elif defined(OS_NETBSD) ++ pthread_setname_np(pthread_self(), "%s", (void *)name); ++#elif defined(OS_BSD) && !defined(__GLIBC__) ++ pthread_set_name_np(pthread_self(), name); ++#elif defined(OS_SOLARIS) ++ pthread_setname_np(pthread_self(), name); ++#else ++#endif + } + #endif // !OS_MACOSX + diff --git a/patches/porting-m68k/Add-m68k-support-to-Thunderbird.patch b/patches/porting-m68k/Add-m68k-support-to-Thunderbird.patch new file mode 100644 index 0000000000..7cdf688500 --- /dev/null +++ b/patches/porting-m68k/Add-m68k-support-to-Thunderbird.patch @@ -0,0 +1,422 @@ +From: John Paul Adrian Glaubitz +Date: Sun, 2 Apr 2017 09:14:39 +0200 +Subject: Add m68k support to Thunderbird + +Origin: not yet exist +Bug-Debian: https://bugs.debian.org/859271 +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1325771 +Applied-Upstream: TBD + +All patches have been reviewed by positively by upstream with the +exception of the alignment fixes where upstream wants to use a +C++11 solution instead of the other suggestions I made. This patch +currently uses __attribute__((aligned(4))) to ensure the alignment +is at least 4 bytes. This method is safe and works on gcc and clang +and unlike the suggested alignas() from C++11 does not break on +architectures which require stricter alignment (e.g. alignas(4) +would break on x86_64 while __attribute__((aligned(4))) does not +as it still allows for 8 bytes alignment. + +Cherry-picked and adapted patches from Firefox upstream: +- a31a2d92cf9a2f4e9ad2d12cb74f96579f54fa5e + Bug 1325771 - layout:style: Make sure nsCSSValue has at least 4 bytes alignment +- b65c6cf80f7038f47c7f5d223a6528d4aa4538cf + Bug 1325771 - js:src: Make sure shadow::Shape has at least 4 bytes alignment +- cbbe025c5034cfa28aa2a8a4e557f9a066ddd013 + Bug 1325771 - js:src: Make sure Cell has at least 4 bytes alignment +- 6441fad686d30230a6842a6432bc134ca20c4125 + Bug 1325771 - js:jit: Use 'Feeling Lucky' atomic operations on m68k +- ec66da836071ec0f05a3517947c8e1a68620c399 + Bug 1325771 - mfbt:tests: Handle targets with less strict alignment in TestPair +- 48f3a6331cad497b933dc6e197f7a006b9189290 + Bug 1325771 - ipc:chromium: Add platform defines for m68k +- 26cd64f37741d85bc13c19bc55e3c6e26da59052 + Bug 1325771 - media:webrtc: Add platform defines for m68k +- bd19fe85678f948f60caa864a2af28c3c39059c7 + Bug 1325771 - mfbt:tests: Define RETURN_INSTR for m68k in TestPoisonArea +- a3e704b48760e3d45d20fc6bb13282d3285ba6bb + Bug 1325771 - xpcom: Fix type of result in NS_InvokeByIndex on Linux/m68k +- 174cfc890291778d12241c9a4cfc25ea85fdd3a0 + Bug 1325771 - xpcom: Fix syntax error in PrepareAndDispatch on Linux/m68k +Additional changes: +- Add defines for m68k to double-conversion library +- Make sure both "struct Class" and "struct JSClass" have at + least 4 bytes alignment +--- + build/moz.configure/init.configure | 3 + + ipc/chromium/src/build/build_config.h | 3 + + js/src/jsfriendapi.h | 2 +- + layout/style/nsCSSValue.h | 2 +- + media/webrtc/trunk/webrtc/build/build_config.h | 10 ++ + mfbt/tests/TestPoisonArea.cpp | 3 + + python/mozbuild/mozbuild/configure/constants.py | 2 + + .../test/configure/test_toolchain_configure.py | 3 + + .../xptcall/md/unix/xptcinvoke_linux_m68k.cpp | 131 +++++++++++++++++++++ + .../xptcall/md/unix/xptcstubs_linux_m68k.cpp | 98 +++++++++++++++ + 10 files changed, 255 insertions(+), 2 deletions(-) + create mode 100644 xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_m68k.cpp + create mode 100644 xpcom/reflect/xptcall/md/unix/xptcstubs_linux_m68k.cpp + +diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure +index b887153..3b94ee8 100644 +--- a/build/moz.configure/init.configure ++++ b/build/moz.configure/init.configure +@@ -758,6 +758,9 @@ def split_triplet(triplet, allow_msvc=False): + elif cpu == 'sh4': + canonical_cpu = 'sh4' + endianness = 'little' ++ elif cpu in ('m68k'): ++ canonical_cpu = 'm68k' ++ endianness = 'big' + else: + raise ValueError('Unknown CPU type: %s' % cpu) + +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index 72105fc..1fa8db1 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -81,6 +81,9 @@ + # define ARCH_CPU_ARMEL 1 + # define ARCH_CPU_32_BITS 1 + # define WCHAR_T_IS_UNSIGNED 1 ++#elif defined(__m68k__) ++# define ARCH_CPU_M68K 1 ++# define ARCH_CPU_32_BITS 1 + #elif defined(__powerpc64__) + # define ARCH_CPU_PPC64 1 + # define ARCH_CPU_64_BITS 1 +diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h +index 7f7ef17..36f2ca0 100644 +--- a/js/src/jsfriendapi.h ++++ b/js/src/jsfriendapi.h +@@ -548,7 +548,7 @@ class Shape { + + static const uint32_t FIXED_SLOTS_SHIFT = 24; + static const uint32_t FIXED_SLOTS_MASK = 0x1f << FIXED_SLOTS_SHIFT; +-}; ++} __attribute__ ((aligned(4))); + + /** + * This layout is shared by all native objects. For non-native objects, the +diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h +index e6af1d2..a5fc2f7 100644 +--- a/layout/style/nsCSSValue.h ++++ b/layout/style/nsCSSValue.h +@@ -209,6 +209,6 @@ class nsCSSValue { + int32_t mInt; + float mFloat; + } mValue; +-}; ++} __attribute__ ((aligned(4))); + + #endif /* nsCSSValue_h___ */ +diff --git a/media/webrtc/trunk/webrtc/build/build_config.h b/media/webrtc/trunk/webrtc/build/build_config.h +index 9654654..39b33b5 100644 +--- a/media/webrtc/trunk/webrtc/build/build_config.h ++++ b/media/webrtc/trunk/webrtc/build/build_config.h +@@ -118,6 +118,16 @@ + #define ARCH_CPU_LITTLE_ENDIAN 1 + #elif defined(__pnacl__) + #define ARCH_CPU_32_BITS 1 ++#elif defined(__MIPSEL__) ++#define ARCH_CPU_MIPS_FAMILY 1 ++#define ARCH_CPU_MIPSEL 1 ++#define ARCH_CPU_32_BITS 1 ++#define ARCH_CPU_LITTLE_ENDIAN 1 ++#elif defined(__m68k__) ++#define ARCH_CPU_M68K_FAMILY 1 ++#define ARCH_CPU_M68K 1 ++#define ARCH_CPU_32_BITS 1 ++#define ARCH_CPU_BIG_ENDIAN 1 + #elif defined(__powerpc64__) + #define ARCH_CPU_PPC_FAMILY 1 + #define ARCH_CPU_PPC64 1 +diff --git a/mfbt/tests/TestPoisonArea.cpp b/mfbt/tests/TestPoisonArea.cpp +index fbd3364..4f7ffe8 100644 +--- a/mfbt/tests/TestPoisonArea.cpp ++++ b/mfbt/tests/TestPoisonArea.cpp +@@ -132,6 +132,9 @@ + #elif defined _ARCH_PPC || defined _ARCH_PWR || defined _ARCH_PWR2 + # define RETURN_INSTR 0x4E800020 /* blr */ + ++#elif defined __m68k__ ++#define RETURN_INSTR 0x4E754E75 /* rts; rts */ ++ + #elif defined __sparc || defined __sparcv9 + # define RETURN_INSTR 0x81c3e008 /* retl */ + +diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py +index 7542dcd..e8401fc 100644 +--- a/python/mozbuild/mozbuild/configure/constants.py ++++ b/python/mozbuild/mozbuild/configure/constants.py +@@ -45,6 +45,7 @@ CPU_bitness = { + 'arm': 32, + 'hppa': 32, + 'ia64': 64, ++ 'm68k': 32, + 'mips32': 32, + 'mips64': 64, + 'ppc': 32, +@@ -88,6 +89,7 @@ CPU_preprocessor_checks = OrderedDict(( + ('mips64', '__mips64'), + ('mips32', '__mips__'), + ('sh4', '__sh__'), ++ ('m68k', '__m68k__'), + )) + + assert sorted(CPU_preprocessor_checks.keys()) == sorted(CPU.POSSIBLE_VALUES) +diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +index 37c4e26..6783e89 100755 +--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py ++++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +@@ -1211,6 +1211,9 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest): + 'sh4-unknown-linux-gnu': little_endian + { + '__sh__': 1, + }, ++ 'm68k-unknown-linux-gnu': big_endian + { ++ '__m68k__': 1, ++ }, + } + + PLATFORMS['powerpc64le-unknown-linux-gnu'] = \ +diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_m68k.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_m68k.cpp +new file mode 100644 +index 0000000..6989340 +--- /dev/null ++++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_m68k.cpp +@@ -0,0 +1,131 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++/* Platform specific code to invoke XPCOM methods on native objects */ ++ ++#include "xptcprivate.h" ++ ++// Remember that these 'words' are 32bit DWORDS ++ ++extern "C" { ++ static uint32_t ++ invoke_count_words(uint32_t paramCount, nsXPTCVariant* s) ++ { ++ uint32_t result = 0; ++ for(uint32_t i = 0; i < paramCount; i++, s++) ++ { ++ if(s->IsPtrData()) ++ { ++ result++; ++ continue; ++ } ++ switch(s->type) ++ { ++ case nsXPTType::T_I8 : ++ case nsXPTType::T_I16 : ++ case nsXPTType::T_I32 : ++ result++; ++ break; ++ case nsXPTType::T_I64 : ++ result+=2; ++ break; ++ case nsXPTType::T_U8 : ++ case nsXPTType::T_U16 : ++ case nsXPTType::T_U32 : ++ result++; ++ break; ++ case nsXPTType::T_U64 : ++ result+=2; ++ break; ++ case nsXPTType::T_FLOAT : ++ result++; ++ break; ++ case nsXPTType::T_DOUBLE : ++ result+=2; ++ break; ++ case nsXPTType::T_BOOL : ++ case nsXPTType::T_CHAR : ++ case nsXPTType::T_WCHAR : ++ result++; ++ break; ++ default: ++ // all the others are plain pointer types ++ result++; ++ break; ++ } ++ } ++ return result; ++ } ++ ++ void ++ invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s) ++ { ++ for(uint32_t i = 0; i < paramCount; i++, d++, s++) ++ { ++ if(s->IsPtrData()) ++ { ++ *((void**)d) = s->ptr; ++ continue; ++ } ++ switch(s->type) ++ { ++ // 8 and 16 bit types should be promoted to 32 bits when copying ++ // onto the stack. ++ case nsXPTType::T_I8 : *((uint32_t*)d) = s->val.i8; break; ++ case nsXPTType::T_I16 : *((uint32_t*)d) = s->val.i16; break; ++ case nsXPTType::T_I32 : *((int32_t*) d) = s->val.i32; break; ++ case nsXPTType::T_I64 : *((int64_t*) d) = s->val.i64; d++; break; ++ case nsXPTType::T_U8 : *((uint32_t*)d) = s->val.u8; break; ++ case nsXPTType::T_U16 : *((uint32_t*)d) = s->val.u16; break; ++ case nsXPTType::T_U32 : *((uint32_t*)d) = s->val.u32; break; ++ case nsXPTType::T_U64 : *((uint64_t*)d) = s->val.u64; d++; break; ++ case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break; ++ case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break; ++ case nsXPTType::T_BOOL : *((uint32_t*)d) = s->val.b; break; ++ case nsXPTType::T_CHAR : *((uint32_t*)d) = s->val.c; break; ++ case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break; ++ ++ default: ++ // all the others are plain pointer types ++ *((void**)d) = s->val.p; ++ break; ++ } ++ } ++ } ++} ++ ++EXPORT_XPCOM_API(nsresult) ++NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, ++ uint32_t paramCount, nsXPTCVariant* params) ++{ ++ nsresult result; ++ uint32_t n; ++ ++ n = invoke_count_words(paramCount, params) * 4; ++ ++ __asm__ __volatile__( ++ "subl %5, %%sp\n\t" /* make room for params */ ++ "movel %4, %%sp@-\n\t" ++ "movel %3, %%sp@-\n\t" ++ "pea %%sp@(8)\n\t" ++ "jbsr invoke_copy_to_stack\n\t" /* copy params */ ++ "addw #12, %%sp\n\t" ++ "movel %1, %%sp@-\n\t" ++ "movel %1@, %%a0\n\t" ++ "movel %%a0@(%2:l:4), %%a0\n\t" ++ "jbsr %%a0@\n\t" /* safe to not cleanup sp */ ++ "lea %%sp@(4,%5:l), %%sp\n\t" ++ "movel %%d0, %0" ++ : "=d" (result) /* %0 */ ++ : "a" (that), /* %1 */ ++ "d" (methodIndex), /* %2 */ ++ "g" (paramCount), /* %3 */ ++ "g" (params), /* %4 */ ++ "d" (n) /* %5 */ ++ : "a0", "a1", "d0", "d1", "memory" ++ ); ++ ++ return result; ++} +diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_m68k.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_m68k.cpp +new file mode 100644 +index 0000000..fc33ba0 +--- /dev/null ++++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_m68k.cpp +@@ -0,0 +1,98 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++/* Implement shared vtbl methods. */ ++ ++#include "xptcprivate.h" ++#include "xptiprivate.h" ++ ++extern "C" { ++ nsresult ATTRIBUTE_USED ++ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) ++ { ++#define PARAM_BUFFER_COUNT 16 ++ ++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; ++ nsXPTCMiniVariant* dispatchParams = nullptr; ++ const nsXPTMethodInfo* info; ++ uint8_t paramCount; ++ uint8_t i; ++ nsresult result = NS_ERROR_FAILURE; ++ ++ NS_ASSERTION(self,"no self"); ++ ++ self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info); ++ NS_ASSERTION(info,"no method info"); ++ ++ paramCount = info->GetParamCount(); ++ ++ // setup variant array pointer ++ if(paramCount > PARAM_BUFFER_COUNT) ++ dispatchParams = new nsXPTCMiniVariant[paramCount]; ++ else ++ dispatchParams = paramBuffer; ++ NS_ASSERTION(dispatchParams,"no place for params"); ++ ++ uint32_t* ap = args; ++ for(i = 0; i < paramCount; i++, ap++) ++ { ++ const nsXPTParamInfo& param = info->GetParam(i); ++ const nsXPTType& type = param.GetType(); ++ nsXPTCMiniVariant* dp = &dispatchParams[i]; ++ ++ if(param.IsOut() || !type.IsArithmetic()) ++ { ++ dp->val.p = (void*) *ap; ++ continue; ++ } ++ ++ switch(type) ++ { ++ // the 8 and 16 bit types will have been promoted to 32 bits before ++ // being pushed onto the stack. Since the 68k is big endian, we ++ // need to skip over the leading high order bytes. ++ case nsXPTType::T_I8 : dp->val.i8 = *(((int8_t*) ap) + 3); break; ++ case nsXPTType::T_I16 : dp->val.i16 = *(((int16_t*) ap) + 1); break; ++ case nsXPTType::T_I32 : dp->val.i32 = *((int32_t*) ap); break; ++ case nsXPTType::T_I64 : dp->val.i64 = *((int64_t*) ap); ap++; break; ++ case nsXPTType::T_U8 : dp->val.u8 = *(((uint8_t*) ap) + 3); break; ++ case nsXPTType::T_U16 : dp->val.u16 = *(((uint16_t*)ap) + 1); break; ++ case nsXPTType::T_U32 : dp->val.u32 = *((uint32_t*)ap); break; ++ case nsXPTType::T_U64 : dp->val.u64 = *((uint64_t*)ap); ap++; break; ++ case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; ++ case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break; ++ case nsXPTType::T_BOOL : dp->val.b = *((uint32_t*)ap); break; ++ case nsXPTType::T_CHAR : dp->val.c = *(((char*) ap) + 3); break; ++ case nsXPTType::T_WCHAR : dp->val.wc = *((wchar_t*) ap); break; ++ default: ++ NS_ERROR("bad type"); ++ break; ++ } ++ } ++ ++ result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams); ++ ++ if(dispatchParams != paramBuffer) ++ delete [] dispatchParams; ++ ++ return result; ++ } ++} ++ ++#define STUB_ENTRY(n) \ ++nsresult nsXPTCStubBase::Stub##n() \ ++{ \ ++ void *frame = __builtin_frame_address(0); \ ++ return PrepareAndDispatch(this, n, (uint32_t*)frame + 3); \ ++} ++ ++#define SENTINEL_ENTRY(n) \ ++nsresult nsXPTCStubBase::Sentinel##n() \ ++{ \ ++ NS_ERROR("nsXPTCStubBase::Sentinel called"); \ ++ return NS_ERROR_NOT_IMPLEMENTED; \ ++} ++ ++#include "xptcstubsdef.inc" diff --git a/patches/porting-ppc64el/work-around-a-build-failure-with-clang-on-ppc64el.patch b/patches/porting-ppc64el/work-around-a-build-failure-with-clang-on-ppc64el.patch new file mode 100644 index 0000000000..bdb22c5bfc --- /dev/null +++ b/patches/porting-ppc64el/work-around-a-build-failure-with-clang-on-ppc64el.patch @@ -0,0 +1,23 @@ +From: Carsten Schoenert +Date: Sat, 5 Oct 2019 15:34:16 +0200 +Subject: work around a build failure with clang on ppc64el + +Author: Olivier Tilloy +Bug: https://bugzilla.mozilla.org/1555531 +--- + security/nss/lib/freebl/mpi/mpcpucache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/security/nss/lib/freebl/mpi/mpcpucache.c b/security/nss/lib/freebl/mpi/mpcpucache.c +index f09ff34..225edf2 100644 +--- a/security/nss/lib/freebl/mpi/mpcpucache.c ++++ b/security/nss/lib/freebl/mpi/mpcpucache.c +@@ -705,7 +705,7 @@ s_mpi_getProcessorLineSize() + #define MPI_GET_PROCESSOR_LINE_SIZE_DEFINED 1 + #endif + +-#if defined(__ppc64__) ++#if 0 + /* + * Sigh, The PPC has some really nice features to help us determine cache + * size, since it had lots of direct control functions to do so. The POWER diff --git a/patches/porting-s390x/Use-more-recent-embedded-version-of-sqlite3.patch b/patches/porting-s390x/Use-more-recent-embedded-version-of-sqlite3.patch new file mode 100644 index 0000000000..ec0c2849e7 --- /dev/null +++ b/patches/porting-s390x/Use-more-recent-embedded-version-of-sqlite3.patch @@ -0,0 +1,17914 @@ +From: Carsten Schoenert +Date: Sat, 12 Sep 2020 09:36:32 +0200 +Subject: Use more recent embedded version of sqlite3 + +Version 3.31.1 of SQlite isn know to provoke some regressions on +architectures s390x and ppc64el. See #950974 for reported issues against the +Debian sqlite source package + +Updating the content of third_party/sqlite3/src/ to version 3.32.3 which +was taken from the most recent Beta version (81.0b3) while preparing +this patch. +--- + third_party/sqlite3/src/moz.build | 9 +- + third_party/sqlite3/src/sqlite3.c | 5022 +++++++++++++++++++++++-------------- + third_party/sqlite3/src/sqlite3.h | 4052 ++++++++++++++++-------------- + 3 files changed, 5306 insertions(+), 3777 deletions(-) + +diff --git a/third_party/sqlite3/src/moz.build b/third_party/sqlite3/src/moz.build +index b152b0e..54572d2 100644 +--- a/third_party/sqlite3/src/moz.build ++++ b/third_party/sqlite3/src/moz.build +@@ -67,11 +67,10 @@ if CONFIG['OS_TARGET'] == 'Android': + # default to user readable only to fit Android security model + DEFINES['SQLITE_DEFAULT_FILE_PERMISSIONS'] = '0600' + +-# Force using malloc_usable_size when building with jemalloc because _msize +-# causes assertions on Win64. See bug 719579. +-if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']: +- DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True +- DEFINES['SQLITE_WITHOUT_MSIZE'] = True ++# Force using _msize on mingw, as sqlite3 only enables it with MSVC. ++if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CC_TYPE'] != 'clang-cl': ++ DEFINES['SQLITE_USE_MALLOC_H'] = True ++ DEFINES['SQLITE_USE_MSIZE'] = True + + # Omit unused functions to save some library footprint. + DEFINES['SQLITE_OMIT_DEPRECATED'] = True +diff --git a/third_party/sqlite3/src/sqlite3.c b/third_party/sqlite3/src/sqlite3.c +index 0fb0b55..50e2564 100644 +--- a/third_party/sqlite3/src/sqlite3.c ++++ b/third_party/sqlite3/src/sqlite3.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + ** This file is an amalgamation of many separate C source files from SQLite +-** version 3.31.1. By combining all the individual C code files into this ++** version 3.32.3. 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 +@@ -218,6 +218,9 @@ static const char * const sqlite3azCompileOpt[] = { + #if SQLITE_ENABLE_BATCH_ATOMIC_WRITE + "ENABLE_BATCH_ATOMIC_WRITE", + #endif ++#if SQLITE_ENABLE_BYTECODE_VTAB ++ "ENABLE_BYTECODE_VTAB", ++#endif + #if SQLITE_ENABLE_CEROD + "ENABLE_CEROD=" CTIMEOPT_VAL(SQLITE_ENABLE_CEROD), + #endif +@@ -380,9 +383,6 @@ static const char * const sqlite3azCompileOpt[] = { + #if SQLITE_FTS5_NO_WITHOUT_ROWID + "FTS5_NO_WITHOUT_ROWID", + #endif +-#if SQLITE_HAS_CODEC +- "HAS_CODEC", +-#endif + #if HAVE_ISNAN || SQLITE_HAVE_ISNAN + "HAVE_ISNAN", + #endif +@@ -539,9 +539,6 @@ static const char * const sqlite3azCompileOpt[] = { + #if SQLITE_OMIT_BLOB_LITERAL + "OMIT_BLOB_LITERAL", + #endif +-#if SQLITE_OMIT_BTREECOUNT +- "OMIT_BTREECOUNT", +-#endif + #if SQLITE_OMIT_CAST + "OMIT_CAST", + #endif +@@ -1165,9 +1162,9 @@ extern "C" { + ** [sqlite3_libversion_number()], [sqlite3_sourceid()], + ** [sqlite_version()] and [sqlite_source_id()]. + */ +-#define SQLITE_VERSION "3.31.1" +-#define SQLITE_VERSION_NUMBER 3031001 +-#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6" ++#define SQLITE_VERSION "3.32.3" ++#define SQLITE_VERSION_NUMBER 3032003 ++#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" + + /* + ** CAPI3REF: Run-Time Library Version Numbers +@@ -1341,26 +1338,22 @@ typedef sqlite_uint64 sqlite3_uint64; + ** the [sqlite3] object is successfully destroyed and all associated + ** resources are deallocated. + ** +-** ^If the database connection is associated with unfinalized prepared +-** statements or unfinished sqlite3_backup objects then sqlite3_close() +-** will leave the database connection open and return [SQLITE_BUSY]. +-** ^If sqlite3_close_v2() is called with unfinalized prepared statements +-** and/or unfinished sqlite3_backups, then the database connection becomes +-** an unusable "zombie" which will automatically be deallocated when the +-** last prepared statement is finalized or the last sqlite3_backup is +-** finished. The sqlite3_close_v2() interface is intended for use with +-** host languages that are garbage collected, and where the order in which +-** destructors are called is arbitrary. +-** +-** Applications should [sqlite3_finalize | finalize] all [prepared statements], +-** [sqlite3_blob_close | close] all [BLOB handles], and ++** Ideally, applications should [sqlite3_finalize | finalize] all ++** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and + ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated +-** with the [sqlite3] object prior to attempting to close the object. ^If +-** sqlite3_close_v2() is called on a [database connection] that still has +-** outstanding [prepared statements], [BLOB handles], and/or +-** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation +-** of resources is deferred until all [prepared statements], [BLOB handles], +-** and [sqlite3_backup] objects are also destroyed. ++** with the [sqlite3] object prior to attempting to close the object. ++** ^If the database connection is associated with unfinalized prepared ++** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then ++** sqlite3_close() will leave the database connection open and return ++** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared ++** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups, ++** it returns [SQLITE_OK] regardless, but instead of deallocating the database ++** connection immediately, it marks the database connection as an unusable ++** "zombie" and makes arrangements to automatically deallocate the database ++** connection after all prepared statements are finalized, all BLOB handles ++** are closed, and all backups have finished. The sqlite3_close_v2() interface ++** is intended for use with host languages that are garbage collected, and ++** where the order in which destructors are called is arbitrary. + ** + ** ^If an [sqlite3] object is destroyed while a transaction is open, + ** the transaction is automatically rolled back. +@@ -1549,10 +1542,12 @@ SQLITE_API int sqlite3_exec( + #define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8)) + #define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8)) + #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8)) ++#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8)) + #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) + #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8)) + #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) + #define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8)) ++#define SQLITE_BUSY_TIMEOUT (SQLITE_BUSY | (3<<8)) + #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) + #define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) + #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) +@@ -1561,6 +1556,7 @@ SQLITE_API int sqlite3_exec( + #define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) + #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) + #define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) ++#define SQLITE_CORRUPT_INDEX (SQLITE_CORRUPT | (3<<8)) + #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) + #define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) + #define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8)) +@@ -2129,10 +2125,12 @@ struct sqlite3_io_methods { + ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. + ** + **
  • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +-** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain +-** a file lock using the xLock or xShmLock methods of the VFS to wait +-** for up to M milliseconds before failing, where M is the single +-** unsigned integer parameter. ++** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS ++** to block for up to M milliseconds before failing when attempting to ++** obtain a file lock using the xLock or xShmLock methods of the VFS. ++** The parameter is a pointer to a 32-bit signed integer that contains ++** the value that M is to be set to. Before returning, the 32-bit signed ++** integer is overwritten with the previous value of M. + ** + **
  • [[SQLITE_FCNTL_DATA_VERSION]] + ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +@@ -2154,6 +2152,11 @@ struct sqlite3_io_methods { + ** happen either internally or externally and that are associated with + ** a particular attached database. + ** ++**
  • [[SQLITE_FCNTL_CKPT_START]] ++** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint ++** in wal mode before the client starts to copy pages from the wal ++** file to the database file. ++** + **
  • [[SQLITE_FCNTL_CKPT_DONE]] + ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint + ** in wal mode after the client has finished copying pages from the wal +@@ -2197,6 +2200,8 @@ struct sqlite3_io_methods { + #define SQLITE_FCNTL_DATA_VERSION 35 + #define SQLITE_FCNTL_SIZE_LIMIT 36 + #define SQLITE_FCNTL_CKPT_DONE 37 ++#define SQLITE_FCNTL_RESERVE_BYTES 38 ++#define SQLITE_FCNTL_CKPT_START 39 + + /* deprecated names */ + #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE +@@ -4575,8 +4580,19 @@ SQLITE_API int sqlite3_open_v2( + ** that check if a database file was a URI that contained a specific query + ** parameter, and if so obtains the value of that query parameter. + ** +-** If F is the database filename pointer passed into the xOpen() method of +-** a VFS implementation or it is the return value of [sqlite3_db_filename()] ++** The first parameter to these interfaces (hereafter referred to ++** as F) must be one of: ++**
      ++**
    • A database filename pointer created by the SQLite core and ++** passed into the xOpen() method of a VFS implemention, or ++**
    • A filename obtained from [sqlite3_db_filename()], or ++**
    • A new filename constructed using [sqlite3_create_filename()]. ++**
    ++** If the F parameter is not one of the above, then the behavior is ++** undefined and probably undesirable. Older versions of SQLite were ++** more tolerant of invalid F parameters than newer versions. ++** ++** If F is a suitable filename (as described in the previous paragraph) + ** and if P is the name of the query parameter, then + ** sqlite3_uri_parameter(F,P) returns the value of the P + ** parameter if it exists or a NULL pointer if P does not appear as a +@@ -4659,6 +4675,78 @@ SQLITE_API const char *sqlite3_filename_database(const char*); + SQLITE_API const char *sqlite3_filename_journal(const char*); + SQLITE_API const char *sqlite3_filename_wal(const char*); + ++/* ++** CAPI3REF: Database File Corresponding To A Journal ++** ++** ^If X is the name of a rollback or WAL-mode journal file that is ++** passed into the xOpen method of [sqlite3_vfs], then ++** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file] ++** object that represents the main database file. ++** ++** This routine is intended for use in custom [VFS] implementations ++** only. It is not a general-purpose interface. ++** The argument sqlite3_file_object(X) must be a filename pointer that ++** has been passed into [sqlite3_vfs].xOpen method where the ++** flags parameter to xOpen contains one of the bits ++** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use ++** of this routine results in undefined and probably undesirable ++** behavior. ++*/ ++SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); ++ ++/* ++** CAPI3REF: Create and Destroy VFS Filenames ++** ++** These interfces are provided for use by [VFS shim] implementations and ++** are not useful outside of that context. ++** ++** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of ++** database filename D with corresponding journal file J and WAL file W and ++** with N URI parameters key/values pairs in the array P. The result from ++** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that ++** is safe to pass to routines like: ++**
      ++**
    • [sqlite3_uri_parameter()], ++**
    • [sqlite3_uri_boolean()], ++**
    • [sqlite3_uri_int64()], ++**
    • [sqlite3_uri_key()], ++**
    • [sqlite3_filename_database()], ++**
    • [sqlite3_filename_journal()], or ++**
    • [sqlite3_filename_wal()]. ++**
    ++** If a memory allocation error occurs, sqlite3_create_filename() might ++** return a NULL pointer. The memory obtained from sqlite3_create_filename(X) ++** must be released by a corresponding call to sqlite3_free_filename(Y). ++** ++** The P parameter in sqlite3_create_filename(D,J,W,N,P) should be an array ++** of 2*N pointers to strings. Each pair of pointers in this array corresponds ++** to a key and value for a query parameter. The P parameter may be a NULL ++** pointer if N is zero. None of the 2*N pointers in the P array may be ++** NULL pointers and key pointers should not be empty strings. ++** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may ++** be NULL pointers, though they can be empty strings. ++** ++** The sqlite3_free_filename(Y) routine releases a memory allocation ++** previously obtained from sqlite3_create_filename(). Invoking ++** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op. ++** ++** If the Y parameter to sqlite3_free_filename(Y) is anything other ++** than a NULL pointer or a pointer previously acquired from ++** sqlite3_create_filename(), then bad things such as heap ++** corruption or segfaults may occur. The value Y should be ++** used again after sqlite3_free_filename(Y) has been called. This means ++** that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y, ++** then the corresponding [sqlite3_module.xClose() method should also be ++** invoked prior to calling sqlite3_free_filename(Y). ++*/ ++SQLITE_API char *sqlite3_create_filename( ++ const char *zDatabase, ++ const char *zJournal, ++ const char *zWal, ++ int nParam, ++ const char **azParam ++); ++SQLITE_API void sqlite3_free_filename(char*); + + /* + ** CAPI3REF: Error Codes And Messages +@@ -5241,12 +5329,30 @@ typedef struct sqlite3_context sqlite3_context; + ** [sqlite3_bind_parameter_index()] API if desired. ^The index + ** for "?NNN" parameters is the value of NNN. + ** ^The NNN value must be between 1 and the [sqlite3_limit()] +-** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). ++** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 32766). + ** + ** ^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(). ++** ^If the third parameter to sqlite3_bind_text() is not NULL, then ++** it should be a pointer to well-formed UTF8 text. ++** ^If the third parameter to sqlite3_bind_text16() is not NULL, then ++** it should be a pointer to well-formed UTF16 text. ++** ^If the third parameter to sqlite3_bind_text64() is not NULL, then ++** it should be a pointer to a well-formed unicode string that is ++** either UTF8 if the sixth parameter is SQLITE_UTF8, or UTF16 ++** otherwise. ++** ++** [[byte-order determination rules]] ^The byte-order of ++** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF) ++** found in first character, which is removed, or in the absence of a BOM ++** the byte order is the native byte order of the host ++** machine for sqlite3_bind_text16() or the byte order specified in ++** the 6th parameter for sqlite3_bind_text64().)^ ++** ^If UTF16 input text contains invalid unicode ++** characters, then SQLite might change those invalid characters ++** into the unicode replacement character: U+FFFD. + ** + ** ^(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 +@@ -5260,7 +5366,7 @@ typedef struct sqlite3_context sqlite3_context; + ** or sqlite3_bind_text16() or sqlite3_bind_text64() then + ** that parameter must be the byte offset + ** where the NUL terminator would occur assuming the string were NUL +-** terminated. If any NUL characters occur at byte offsets less than ++** terminated. If any NUL characters occurs at byte offsets less than + ** the value of the fourth parameter then the resulting string value will + ** contain embedded NULs. The result of expressions involving strings + ** with embedded NULs is undefined. +@@ -6428,7 +6534,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); + ** + ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is + ** determined by the N parameter on first successful call. Changing the +-** value of N in any subsequents call to sqlite3_aggregate_context() within ++** value of N in any subsequent call to sqlite3_aggregate_context() within + ** the same aggregate function instance will not resize the memory + ** allocation.)^ Within the xFinal callback, it is customary to set + ** N=0 in calls to sqlite3_aggregate_context(C,N) so that no +@@ -6585,8 +6691,9 @@ typedef void (*sqlite3_destructor_type)(void*); + ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() + ** as the text of an error message. ^SQLite interprets the error + ** message string from sqlite3_result_error() as UTF-8. ^SQLite +-** interprets the string from sqlite3_result_error16() as UTF-16 in native +-** byte order. ^If the third parameter to sqlite3_result_error() ++** interprets the string from sqlite3_result_error16() as UTF-16 using ++** the same [byte-order determination rules] as [sqlite3_bind_text16()]. ++** ^If the third parameter to sqlite3_result_error() + ** or sqlite3_result_error16() is negative then SQLite takes as the error + ** message all text up through the first zero character. + ** ^If the third parameter to sqlite3_result_error() or +@@ -6654,6 +6761,25 @@ typedef void (*sqlite3_destructor_type)(void*); + ** then SQLite makes a copy of the result into space obtained + ** from [sqlite3_malloc()] before it returns. + ** ++** ^For the sqlite3_result_text16(), sqlite3_result_text16le(), and ++** sqlite3_result_text16be() routines, and for sqlite3_result_text64() ++** when the encoding is not UTF8, if the input UTF16 begins with a ++** byte-order mark (BOM, U+FEFF) then the BOM is removed from the ++** string and the rest of the string is interpreted according to the ++** byte-order specified by the BOM. ^The byte-order specified by ++** the BOM at the beginning of the text overrides the byte-order ++** specified by the interface procedure. ^So, for example, if ++** sqlite3_result_text16le() is invoked with text that begins ++** with bytes 0xfe, 0xff (a big-endian byte-order mark) then the ++** first two bytes of input are skipped and the remaining input ++** is interpreted as UTF16BE text. ++** ++** ^For UTF16 input text to the sqlite3_result_text16(), ++** sqlite3_result_text16be(), sqlite3_result_text16le(), and ++** sqlite3_result_text64() routines, if the text contains invalid ++** UTF16 characters, the invalid characters might be converted ++** into the unicode replacement character, U+FFFD. ++** + ** ^The sqlite3_result_value() interface sets the result of + ** the application-defined function to be a copy of the + ** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The +@@ -6859,51 +6985,6 @@ SQLITE_API int sqlite3_collation_needed16( + void(*)(void*,sqlite3*,int eTextRep,const void*) + ); + +-#ifdef SQLITE_HAS_CODEC +-/* +-** Specify the key for an encrypted database. This routine should be +-** called right after sqlite3_open(). +-** +-** The code to implement this API is not available in the public release +-** of SQLite. +-*/ +-SQLITE_API int sqlite3_key( +- sqlite3 *db, /* Database to be rekeyed */ +- const void *pKey, int nKey /* The key */ +-); +-SQLITE_API int sqlite3_key_v2( +- sqlite3 *db, /* Database to be rekeyed */ +- const char *zDbName, /* Name of the database */ +- const void *pKey, int nKey /* The key */ +-); +- +-/* +-** Change the key on an open database. If the current database is not +-** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the +-** database is decrypted. +-** +-** The code to implement this API is not available in the public release +-** of SQLite. +-*/ +-SQLITE_API int sqlite3_rekey( +- sqlite3 *db, /* Database to be rekeyed */ +- const void *pKey, int nKey /* The new key */ +-); +-SQLITE_API int sqlite3_rekey_v2( +- sqlite3 *db, /* Database to be rekeyed */ +- const char *zDbName, /* Name of the database */ +- const void *pKey, int nKey /* The new key */ +-); +- +-/* +-** Specify the activation key for a SEE database. Unless +-** activated, none of the SEE routines will work. +-*/ +-SQLITE_API void sqlite3_activate_see( +- const char *zPassPhrase /* Activation phrase */ +-); +-#endif +- + #ifdef SQLITE_ENABLE_CEROD + /* + ** Specify the activation key for a CEROD database. Unless +@@ -8646,7 +8727,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); + #define SQLITE_TESTCTRL_PENDING_BYTE 11 + #define SQLITE_TESTCTRL_ASSERT 12 + #define SQLITE_TESTCTRL_ALWAYS 13 +-#define SQLITE_TESTCTRL_RESERVE 14 ++#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */ + #define SQLITE_TESTCTRL_OPTIMIZATIONS 15 + #define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ + #define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ +@@ -13272,9 +13353,12 @@ struct fts5_api { + + /* + ** The maximum value of a ?nnn wildcard that the parser will accept. ++** If the value exceeds 32767 then extra space is required for the Expr ++** structure. But otherwise, we believe that the number can be as large ++** as a signed 32-bit integer can hold. + */ + #ifndef SQLITE_MAX_VARIABLE_NUMBER +-# define SQLITE_MAX_VARIABLE_NUMBER 999 ++# define SQLITE_MAX_VARIABLE_NUMBER 32766 + #endif + + /* Maximum page size. The upper bound on this value is 65536. This a limit +@@ -13363,6 +13447,21 @@ struct fts5_api { + #pragma warn -spa /* Suspicious pointer arithmetic */ + #endif + ++/* ++** WAL mode depends on atomic aligned 32-bit loads and stores in a few ++** places. The following macros try to make this explicit. ++*/ ++#ifndef __has_feature ++# define __has_feature(x) 0 /* compatibility with non-clang compilers */ ++#endif ++#if GCC_VERSION>=4007000 || __has_feature(c_atomic) ++# define AtomicLoad(PTR) __atomic_load_n((PTR),__ATOMIC_RELAXED) ++# define AtomicStore(PTR,VAL) __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED) ++#else ++# define AtomicLoad(PTR) (*(PTR)) ++# define AtomicStore(PTR,VAL) (*(PTR) = (VAL)) ++#endif ++ + /* + ** Include standard header files as necessary + */ +@@ -14440,7 +14539,6 @@ struct BusyHandler { + int (*xBusyHandler)(void *,int); /* The busy callback */ + void *pBusyArg; /* First arg to busy callback */ + int nBusy; /* Incremented with each busy call */ +- u8 bExtraFileArg; /* Include sqlite3_file as callback arg */ + }; + + /* +@@ -14698,7 +14796,7 @@ SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*); + SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int); + SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*); + SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int); +-SQLITE_PRIVATE int sqlite3BtreeGetOptimalReserve(Btree*); ++SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree*); + SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p); + SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int); + SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *); +@@ -14960,9 +15058,7 @@ SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor*); + #endif + SQLITE_PRIVATE int sqlite3BtreeCursorIsValidNN(BtCursor*); + +-#ifndef SQLITE_OMIT_BTREECOUNT + SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*); +-#endif + + #ifdef SQLITE_TEST + SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int); +@@ -15255,8 +15351,8 @@ typedef struct VdbeOpList VdbeOpList; + #define OP_IncrVacuum 60 /* jump */ + #define OP_VNext 61 /* jump */ + #define OP_Init 62 /* jump, synopsis: Start at P2 */ +-#define OP_PureFunc 63 /* synopsis: r[P3]=func(r[P2@P5]) */ +-#define OP_Function 64 /* synopsis: r[P3]=func(r[P2@P5]) */ ++#define OP_PureFunc 63 /* synopsis: r[P3]=func(r[P2@NP]) */ ++#define OP_Function 64 /* synopsis: r[P3]=func(r[P2@NP]) */ + #define OP_Return 65 + #define OP_EndCoroutine 66 + #define OP_HaltIfNull 67 /* synopsis: if r[P3]=null halt */ +@@ -15322,8 +15418,8 @@ typedef struct VdbeOpList VdbeOpList; + #define OP_Rowid 127 /* synopsis: r[P2]=rowid */ + #define OP_NullRow 128 + #define OP_SeekEnd 129 +-#define OP_SorterInsert 130 /* synopsis: key=r[P2] */ +-#define OP_IdxInsert 131 /* synopsis: key=r[P2] */ ++#define OP_IdxInsert 130 /* synopsis: key=r[P2] */ ++#define OP_SorterInsert 131 /* synopsis: key=r[P2] */ + #define OP_IdxDelete 132 /* synopsis: key=r[P2@P3] */ + #define OP_DeferredSeek 133 /* synopsis: Move P3 to P1.rowid if needed */ + #define OP_IdxRowid 134 /* synopsis: r[P2]=rowid */ +@@ -15477,6 +15573,7 @@ SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2); + SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, int addr, int P3); + SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u16 P5); + SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr); ++SQLITE_PRIVATE void sqlite3VdbeJumpHereOrPopInst(Vdbe*, int addr); + SQLITE_PRIVATE int sqlite3VdbeChangeToNoop(Vdbe*, int addr); + SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op); + #ifdef SQLITE_DEBUG +@@ -15536,6 +15633,9 @@ SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); + SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*); + + SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*); ++#ifdef SQLITE_ENABLE_BYTECODE_VTAB ++SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*); ++#endif + + /* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on + ** each VDBE opcode. +@@ -15772,9 +15872,6 @@ SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*); + /* Functions used to configure a Pager object. */ + SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(Pager*, int(*)(void *), void *); + SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int); +-#ifdef SQLITE_HAS_CODEC +-SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager*,Pager*); +-#endif + SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int); + SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager*, int); + SQLITE_PRIVATE int sqlite3PagerSetSpillsize(Pager*, int); +@@ -15824,14 +15921,22 @@ SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); + SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); + SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager, sqlite3*); + # ifdef SQLITE_ENABLE_SNAPSHOT +-SQLITE_PRIVATE int sqlite3PagerSnapshotGet(Pager *pPager, sqlite3_snapshot **ppSnapshot); +-SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot); ++SQLITE_PRIVATE int sqlite3PagerSnapshotGet(Pager*, sqlite3_snapshot **ppSnapshot); ++SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager*, sqlite3_snapshot *pSnapshot); + SQLITE_PRIVATE int sqlite3PagerSnapshotRecover(Pager *pPager); + SQLITE_PRIVATE int sqlite3PagerSnapshotCheck(Pager *pPager, sqlite3_snapshot *pSnapshot); + SQLITE_PRIVATE void sqlite3PagerSnapshotUnlock(Pager *pPager); + # endif + #endif + ++#if !defined(SQLITE_OMIT_WAL) && defined(SQLITE_ENABLE_SETLK_TIMEOUT) ++SQLITE_PRIVATE int sqlite3PagerWalWriteLock(Pager*, int); ++SQLITE_PRIVATE void sqlite3PagerWalDb(Pager*, sqlite3*); ++#else ++# define sqlite3PagerWalWriteLock(y,z) SQLITE_OK ++# define sqlite3PagerWalDb(x,y) ++#endif ++ + #ifdef SQLITE_DIRECT_OVERFLOW_READ + SQLITE_PRIVATE int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno); + #endif +@@ -15857,21 +15962,12 @@ SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*); + SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *); + SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*); + SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *); +-#ifdef SQLITE_ENABLE_SETLK_TIMEOUT +-SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager); +-#else +-# define sqlite3PagerResetLockTimeout(X) +-#endif + + /* Functions used to truncate the database file. */ + SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno); + + SQLITE_PRIVATE void sqlite3PagerRekey(DbPage*, Pgno, u16); + +-#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL) +-SQLITE_PRIVATE void *sqlite3PagerCodec(DbPage *); +-#endif +- + /* Functions to support testing and debugging. */ + #if !defined(NDEBUG) || defined(SQLITE_TEST) + SQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage*); +@@ -16539,7 +16635,6 @@ struct Schema { + */ + #define DB_SchemaLoaded 0x0001 /* The schema has been loaded */ + #define DB_UnresetViews 0x0002 /* Some views have defined column names */ +-#define DB_Empty 0x0004 /* The file is empty (length 0 bytes) */ + #define DB_ResetWanted 0x0008 /* Reset the schema when nSchemaLock==0 */ + + /* +@@ -16697,7 +16792,7 @@ SQLITE_PRIVATE void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**); + struct sqlite3 { + sqlite3_vfs *pVfs; /* OS Interface */ + struct Vdbe *pVdbe; /* List of active virtual machines */ +- CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ ++ CollSeq *pDfltColl; /* BINARY collseq for the database encoding */ + sqlite3_mutex *mutex; /* Connection mutex */ + Db *aDb; /* All backends */ + int nDb; /* Number of backends currently in use */ +@@ -16800,6 +16895,7 @@ struct sqlite3 { + BusyHandler busyHandler; /* Busy callback */ + Db aDbStatic[2]; /* Static space for the 2 default backends */ + Savepoint *pSavepoint; /* List of active savepoints */ ++ int nAnalysisLimit; /* Number of index rows to ANALYZE */ + int busyTimeout; /* Busy handler timeout, in msec */ + int nSavepoint; /* Number of non-transaction savepoints */ + int nStatement; /* Number of nested statement-transactions */ +@@ -16906,6 +17002,7 @@ struct sqlite3 { + #define DBFLAG_VacuumInto 0x0008 /* Currently running VACUUM INTO */ + #define DBFLAG_SchemaKnownOk 0x0010 /* Schema is known to be valid */ + #define DBFLAG_InternalFunc 0x0020 /* Allow use of internal functions */ ++#define DBFLAG_EncodingFixed 0x0040 /* No longer possible to change enc. */ + + /* + ** Bits of the sqlite3.dbOptFlags field that are used by the +@@ -17024,7 +17121,7 @@ struct FuncDestructor { + #define SQLITE_FUNC_LENGTH 0x0040 /* Built-in length() function */ + #define SQLITE_FUNC_TYPEOF 0x0080 /* Built-in typeof() function */ + #define SQLITE_FUNC_COUNT 0x0100 /* Built-in count(*) aggregate */ +-#define SQLITE_FUNC_COALESCE 0x0200 /* Built-in coalesce() or ifnull() */ ++/* 0x0200 -- available for reuse */ + #define SQLITE_FUNC_UNLIKELY 0x0400 /* Built-in unlikely() function */ + #define SQLITE_FUNC_CONSTANT 0x0800 /* Constant inputs give a constant output */ + #define SQLITE_FUNC_MINMAX 0x1000 /* True for min() and max() aggregates */ +@@ -17045,6 +17142,7 @@ struct FuncDestructor { + #define INLINEFUNC_expr_implies_expr 2 + #define INLINEFUNC_expr_compare 3 + #define INLINEFUNC_affinity 4 ++#define INLINEFUNC_iif 5 + #define INLINEFUNC_unlikely 99 /* Default case */ + + /* +@@ -17209,6 +17307,7 @@ struct Column { + u8 notNull; /* An OE_ code for handling a NOT NULL constraint */ + char affinity; /* One of the SQLITE_AFF_... values */ + u8 szEst; /* Estimated size of value in this column. sizeof(INT)==1 */ ++ u8 hName; /* Column name hash for faster lookup */ + u16 colFlags; /* Boolean properties. See COLFLAG_ defines below */ + }; + +@@ -17428,8 +17527,11 @@ struct Table { + */ + #ifndef SQLITE_OMIT_VIRTUALTABLE + # define IsVirtual(X) ((X)->nModuleArg) ++# define ExprIsVtab(X) \ ++ ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg) + #else + # define IsVirtual(X) 0 ++# define ExprIsVtab(X) 0 + #endif + + /* +@@ -17741,7 +17843,7 @@ struct Token { + ** code for a SELECT that contains aggregate functions. + ** + ** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a +-** pointer to this structure. The Expr.iColumn field is the index in ++** pointer to this structure. The Expr.iAgg field is the index in + ** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate + ** code for that node. + ** +@@ -17761,11 +17863,11 @@ struct AggInfo { + ExprList *pGroupBy; /* The group by clause */ + struct AggInfo_col { /* For each column used in source tables */ + Table *pTab; /* Source table */ ++ Expr *pExpr; /* The original expression */ + int iTable; /* Cursor number of the source table */ +- int iColumn; /* Column number within the source table */ +- int iSorterColumn; /* Column number in the sorting index */ + int iMem; /* Memory location that acts as accumulator */ +- Expr *pExpr; /* The original expression */ ++ i16 iColumn; /* Column number within the source table */ ++ i16 iSorterColumn; /* Column number in the sorting index */ + } *aCol; + int nColumn; /* Number of used entries in aCol[] */ + int nAccumulator; /* Number of columns that show through to the output. +@@ -17778,8 +17880,17 @@ struct AggInfo { + int iDistinct; /* Ephemeral table used to enforce DISTINCT */ + } *aFunc; + int nFunc; /* Number of entries in aFunc[] */ ++#ifdef SQLITE_DEBUG ++ int iAggMagic; /* Magic number when valid */ ++#endif ++ AggInfo *pNext; /* Next in list of them all */ + }; + ++/* ++** Value for AggInfo.iAggMagic when the structure is valid ++*/ ++#define AggInfoMagic 0x2059e99e ++ + /* + ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. + ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater +@@ -17787,10 +17898,10 @@ struct AggInfo { + ** it uses less memory in the Expr object, which is a big memory user + ** in systems with lots of prepared statements. And few applications + ** need more than about 10 or 20 variables. But some extreme users want +-** to have prepared statements with over 32767 variables, and for them ++** to have prepared statements with over 32766 variables, and for them + ** the option is available (at compile-time). + */ +-#if SQLITE_MAX_VARIABLE_NUMBER<=32767 ++#if SQLITE_MAX_VARIABLE_NUMBER<32767 + typedef i16 ynVar; + #else + typedef int ynVar; +@@ -17866,6 +17977,9 @@ struct Expr { + ** TK_COLUMN: the value of p5 for OP_Column + ** TK_AGG_FUNCTION: nesting depth + ** TK_FUNCTION: NC_SelfRef flag if needs OP_PureFunc */ ++#ifdef SQLITE_DEBUG ++ u8 vvaFlags; /* Verification flags. */ ++#endif + u32 flags; /* Various flags. EP_* See below */ + union { + char *zToken; /* Token value. Zero terminated and dequoted */ +@@ -17940,7 +18054,7 @@ struct Expr { + #define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */ + #define EP_Win 0x008000 /* Contains window functions */ + #define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */ +-#define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */ ++ /* 0x020000 // available for reuse */ + #define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */ + #define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */ + #define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */ +@@ -17954,6 +18068,7 @@ struct Expr { + #define EP_IsTrue 0x10000000 /* Always has boolean value of TRUE */ + #define EP_IsFalse 0x20000000 /* Always has boolean value of FALSE */ + #define EP_FromDDL 0x40000000 /* Originates from sqlite_master */ ++ /* 0x80000000 // Available */ + + /* + ** The EP_Propagate mask is a set of properties that automatically propagate +@@ -17972,14 +18087,24 @@ struct Expr { + #define ExprAlwaysTrue(E) (((E)->flags&(EP_FromJoin|EP_IsTrue))==EP_IsTrue) + #define ExprAlwaysFalse(E) (((E)->flags&(EP_FromJoin|EP_IsFalse))==EP_IsFalse) + ++ ++/* Flags for use with Expr.vvaFlags ++*/ ++#define EP_NoReduce 0x01 /* Cannot EXPRDUP_REDUCE this Expr */ ++#define EP_Immutable 0x02 /* Do not change this Expr node */ ++ + /* The ExprSetVVAProperty() macro is used for Verification, Validation, + ** and Accreditation only. It works like ExprSetProperty() during VVA + ** processes but is a no-op for delivery. + */ + #ifdef SQLITE_DEBUG +-# define ExprSetVVAProperty(E,P) (E)->flags|=(P) ++# define ExprSetVVAProperty(E,P) (E)->vvaFlags|=(P) ++# define ExprHasVVAProperty(E,P) (((E)->vvaFlags&(P))!=0) ++# define ExprClearVVAProperties(E) (E)->vvaFlags = 0 + #else + # define ExprSetVVAProperty(E,P) ++# define ExprHasVVAProperty(E,P) 0 ++# define ExprClearVVAProperties(E) + #endif + + /* +@@ -18346,6 +18471,7 @@ struct Select { + #define SF_WhereBegin 0x0080000 /* Really a WhereBegin() call. Debug Only */ + #define SF_WinRewrite 0x0100000 /* Window function rewrite accomplished */ + #define SF_View 0x0200000 /* SELECT statement is a view */ ++#define SF_NoopOrderBy 0x0400000 /* ORDER BY is ignored for this query */ + + /* + ** The results of a SELECT can be distributed in several ways, as defined +@@ -18562,6 +18688,7 @@ struct Parse { + Parse *pToplevel; /* Parse structure for main program (or NULL) */ + Table *pTriggerTab; /* Table triggers are being coded for */ + Parse *pParentParse; /* Parent parser if this parser is nested */ ++ AggInfo *pAggList; /* List of all AggInfo objects */ + int addrCrTab; /* Address of OP_CreateBtree opcode on CREATE TABLE */ + u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */ + u32 oldmask; /* Mask of old.* columns referenced */ +@@ -18953,6 +19080,7 @@ struct Walker { + struct WhereConst *pConst; /* WHERE clause constants */ + struct RenameCtx *pRename; /* RENAME COLUMN context */ + struct Table *pTab; /* Table of generated column */ ++ struct SrcList_item *pSrcItem; /* A single FROM clause item */ + } u; + }; + +@@ -18965,6 +19093,9 @@ SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker*, Select*); + SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker*, Expr*); + SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker*, Select*); + SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker*, Select*); ++SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker*,Select*); ++SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker*,Select*); ++ + #ifdef SQLITE_DEBUG + SQLITE_PRIVATE void sqlite3SelectWalkAssert2(Walker*, Select*); + #endif +@@ -19109,13 +19240,16 @@ SQLITE_PRIVATE int sqlite3CantopenError(int); + #ifdef SQLITE_DEBUG + SQLITE_PRIVATE int sqlite3NomemError(int); + SQLITE_PRIVATE int sqlite3IoerrnomemError(int); +-SQLITE_PRIVATE int sqlite3CorruptPgnoError(int,Pgno); + # define SQLITE_NOMEM_BKPT sqlite3NomemError(__LINE__) + # define SQLITE_IOERR_NOMEM_BKPT sqlite3IoerrnomemError(__LINE__) +-# define SQLITE_CORRUPT_PGNO(P) sqlite3CorruptPgnoError(__LINE__,(P)) + #else + # define SQLITE_NOMEM_BKPT SQLITE_NOMEM + # define SQLITE_IOERR_NOMEM_BKPT SQLITE_IOERR_NOMEM ++#endif ++#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_CORRUPT_PGNO) ++SQLITE_PRIVATE int sqlite3CorruptPgnoError(int,Pgno); ++# define SQLITE_CORRUPT_PGNO(P) sqlite3CorruptPgnoError(__LINE__,(P)) ++#else + # define SQLITE_CORRUPT_PGNO(P) sqlite3CorruptError(__LINE__) + #endif + +@@ -19385,11 +19519,7 @@ SQLITE_PRIVATE void sqlite3AddGenerated(Parse*,Expr*,Token*); + SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,u8,Select*); + SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*, + sqlite3_vfs**,char**,char **); +-#ifdef SQLITE_HAS_CODEC +-SQLITE_PRIVATE int sqlite3CodecQueryParameters(sqlite3*,const char*,const char*); +-#else +-# define sqlite3CodecQueryParameters(A,B,C) 0 +-#endif ++#define sqlite3CodecQueryParameters(A,B,C) 0 + SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*); + + #ifdef SQLITE_UNTESTABLE +@@ -19498,7 +19628,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Column*, int); + #endif + SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int); + SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int); +-SQLITE_PRIVATE int sqlite3ExprCodeAtInit(Parse*, Expr*, int); ++SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int); + SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*); + SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int); + SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8); +@@ -19525,6 +19655,7 @@ SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr*, Expr*, int); + SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*, int); + SQLITE_PRIVATE int sqlite3ExprImpliesExpr(Parse*,Expr*, Expr*, int); + SQLITE_PRIVATE int sqlite3ExprImpliesNonNullRow(Expr*,int); ++SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker*,Parse*); + SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); + SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); + SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(Expr*, int iCur, Index *pIdx); +@@ -19653,6 +19784,7 @@ SQLITE_PRIVATE int sqlite3AuthReadCol(Parse*, const char *, const char *, int) + # define sqlite3AuthContextPush(a,b,c) + # define sqlite3AuthContextPop(a) ((void)(a)) + #endif ++SQLITE_PRIVATE int sqlite3DbIsNamed(sqlite3 *db, int iDb, const char *zName); + SQLITE_PRIVATE void sqlite3Attach(Parse*, Expr*, Expr*, Expr*); + SQLITE_PRIVATE void sqlite3Detach(Parse*, Expr*); + SQLITE_PRIVATE void sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*); +@@ -19701,6 +19833,8 @@ SQLITE_PRIVATE int sqlite3VarintLen(u64 v); + */ + #define getVarint32(A,B) \ + (u8)((*(A)<(u8)0x80)?((B)=(u32)*(A)),1:sqlite3GetVarint32((A),(u32 *)&(B))) ++#define getVarint32NR(A,B) \ ++ B=(u32)*(A);if(B>=0x80)sqlite3GetVarint32((A),(u32*)&(B)) + #define putVarint32(A,B) \ + (u8)(((u32)(B)<(u32)0x80)?(*(A)=(unsigned char)(B)),1:\ + sqlite3PutVarint((A),(B))) +@@ -19710,10 +19844,10 @@ SQLITE_PRIVATE int sqlite3VarintLen(u64 v); + + SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3*, Index*); + SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe*, Table*, int); +-SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2); +-SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity); ++SQLITE_PRIVATE char sqlite3CompareAffinity(const Expr *pExpr, char aff2); ++SQLITE_PRIVATE int sqlite3IndexAffinityOk(const Expr *pExpr, char idx_affinity); + SQLITE_PRIVATE char sqlite3TableColumnAffinity(Table*,int); +-SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr); ++SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr); + SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8); + SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char*, i64*); + SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3*, int, const char*,...); +@@ -19736,9 +19870,10 @@ SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse); + SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int); + SQLITE_PRIVATE int sqlite3IsBinary(const CollSeq*); + SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName); +-SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr); +-SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, Expr *pExpr); +-SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse*,Expr*,Expr*); ++SQLITE_PRIVATE void sqlite3SetTextEncoding(sqlite3 *db, u8); ++SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr); ++SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, const Expr *pExpr); ++SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse*,const Expr*,const Expr*); + SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(Parse *pParse, Expr*, const Token*, int); + SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(Parse*,Expr*,const char*); + SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr*); +@@ -19805,6 +19940,8 @@ SQLITE_PRIVATE int sqlite3MatchEName( + const char*, + const char* + ); ++SQLITE_PRIVATE Bitmask sqlite3ExprColUsed(Expr*); ++SQLITE_PRIVATE u8 sqlite3StrIHash(const char*); + SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*); + SQLITE_PRIVATE int sqlite3ResolveExprListNames(NameContext*, ExprList*); + SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*); +@@ -19820,7 +19957,7 @@ SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse*, ExprList*); + SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*); + SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*); + SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*); +-SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*); ++SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*); + SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*); + SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *); + SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB); +@@ -19945,8 +20082,10 @@ SQLITE_PRIVATE Module *sqlite3VtabCreateModule( + SQLITE_PRIVATE int sqlite3ReadOnlyShadowTables(sqlite3 *db); + #ifndef SQLITE_OMIT_VIRTUALTABLE + SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName); ++SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3*,Table*,const char*); + #else + # define sqlite3ShadowTableName(A,B) 0 ++# define sqlite3IsShadowTableOf(A,B,C) 0 + #endif + SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse*,Module*); + SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3*,Module*); +@@ -19969,8 +20108,8 @@ SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*); + #endif + SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*); + SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*); +-SQLITE_PRIVATE CollSeq *sqlite3ExprCompareCollSeq(Parse*,Expr*); +-SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *); ++SQLITE_PRIVATE CollSeq *sqlite3ExprCompareCollSeq(Parse*,const Expr*); ++SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(Parse *, const Expr*, const Expr*); + SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3*); + SQLITE_PRIVATE const char *sqlite3JournalModename(int); + #ifndef SQLITE_OMIT_WAL +@@ -20324,16 +20463,9 @@ SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = { + ** EVIDENCE-OF: R-43642-56306 By default, URI handling is globally + ** disabled. The default value may be changed by compiling with the + ** SQLITE_USE_URI symbol defined. +-** +-** URI filenames are enabled by default if SQLITE_HAS_CODEC is +-** enabled. + */ + #ifndef SQLITE_USE_URI +-# ifdef SQLITE_HAS_CODEC +-# define SQLITE_USE_URI 1 +-# else +-# define SQLITE_USE_URI 0 +-# endif ++# define SQLITE_USE_URI 0 + #endif + + /* EVIDENCE-OF: R-38720-18127 The default setting is determined by the +@@ -20563,7 +20695,8 @@ SQLITE_PRIVATE const char sqlite3StrBINARY[] = "BINARY"; + ** "explain" P4 display logic is enabled. + */ + #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \ +- || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) ++ || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) \ ++ || defined(SQLITE_ENABLE_BYTECODE_VTAB) + # define VDBE_DISPLAY_P4 1 + #else + # define VDBE_DISPLAY_P4 0 +@@ -20950,9 +21083,9 @@ struct Vdbe { + u8 errorAction; /* Recovery action to do in case of an error */ + u8 minWriteFileFormat; /* Minimum file format for writable database files */ + u8 prepFlags; /* SQLITE_PREPARE_* flags */ ++ u8 doingRerun; /* True if rerunning after an auto-reprepare */ + bft expired:2; /* 1: recompile VM immediately 2: when convenient */ + bft explain:2; /* True if EXPLAIN present on SQL command */ +- bft doingRerun:1; /* True if rerunning after an auto-reprepare */ + bft changeCntOn:1; /* True to update the change-counter */ + bft runOnlyOnce:1; /* Automatically expire on reset */ + bft usesStmtJournal:1; /* True if uses a statement journal */ +@@ -21028,7 +21161,14 @@ int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); + SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(sqlite3*,VdbeCursor*,UnpackedRecord*,int*); + SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*); + SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*); +-#ifndef SQLITE_OMIT_EXPLAIN ++#if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB) ++SQLITE_PRIVATE int sqlite3VdbeNextOpcode(Vdbe*,Mem*,int,int*,int*,Op**); ++SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3*,Op*); ++#endif ++#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) ++SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(sqlite3*,const Op*,const char*); ++#endif ++#if !defined(SQLITE_OMIT_EXPLAIN) + SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*); + #endif + SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*); +@@ -21064,12 +21204,13 @@ SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*); + SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*); + SQLITE_PRIVATE int sqlite3VdbeMemCast(Mem*,u8,u8); + SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,u32,u32,Mem*); ++SQLITE_PRIVATE int sqlite3VdbeMemFromBtreeZeroOffset(BtCursor*,u32,Mem*); + SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p); + SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*); + #ifndef SQLITE_OMIT_WINDOWFUNC + SQLITE_PRIVATE int sqlite3VdbeMemAggValue(Mem*, Mem*, FuncDef*); + #endif +-#ifndef SQLITE_OMIT_EXPLAIN ++#if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB) + SQLITE_PRIVATE const char *sqlite3OpcodeName(int); + #endif + SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve); +@@ -22149,12 +22290,12 @@ static const struct { + double rLimit; /* Maximum NNN value for this transform */ + double rXform; /* Constant used for this transform */ + } aXformType[] = { +- { 0, 6, "second", 464269060800.0, 86400000.0/(24.0*60.0*60.0) }, +- { 0, 6, "minute", 7737817680.0, 86400000.0/(24.0*60.0) }, +- { 0, 4, "hour", 128963628.0, 86400000.0/24.0 }, +- { 0, 3, "day", 5373485.0, 86400000.0 }, +- { 1, 5, "month", 176546.0, 30.0*86400000.0 }, +- { 2, 4, "year", 14713.0, 365.0*86400000.0 }, ++ { 0, 6, "second", 464269060800.0, 1000.0 }, ++ { 0, 6, "minute", 7737817680.0, 60000.0 }, ++ { 0, 4, "hour", 128963628.0, 3600000.0 }, ++ { 0, 3, "day", 5373485.0, 86400000.0 }, ++ { 1, 5, "month", 176546.0, 2592000000.0 }, ++ { 2, 4, "year", 14713.0, 31536000000.0 }, + }; + + /* +@@ -25714,6 +25855,7 @@ SQLITE_PRIVATE int sqlite3MutexInit(void){ + GLOBAL(int, mutexIsInit) = 1; + #endif + ++ sqlite3MemoryBarrier(); + return rc; + } + +@@ -27241,7 +27383,7 @@ SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){ + } + mem0.alarmThreshold = n; + nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED); +- mem0.nearlyFull = (n>0 && n<=nUsed); ++ AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed); + sqlite3_mutex_leave(mem0.mutex); + excess = sqlite3_memory_used() - n; + if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); +@@ -27309,7 +27451,7 @@ SQLITE_PRIVATE int sqlite3MallocInit(void){ + ** sqlite3_soft_heap_limit(). + */ + SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){ +- return mem0.nearlyFull; ++ return AtomicLoad(&mem0.nearlyFull); + } + + /* +@@ -27373,7 +27515,7 @@ static void mallocWithAlarm(int n, void **pp){ + if( mem0.alarmThreshold>0 ){ + sqlite3_int64 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED); + if( nUsed >= mem0.alarmThreshold - nFull ){ +- mem0.nearlyFull = 1; ++ AtomicStore(&mem0.nearlyFull, 1); + sqlite3MallocAlarm(nFull); + if( mem0.hardLimit ){ + nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED); +@@ -27383,7 +27525,7 @@ static void mallocWithAlarm(int n, void **pp){ + } + } + }else{ +- mem0.nearlyFull = 0; ++ AtomicStore(&mem0.nearlyFull, 0); + } + } + p = sqlite3GlobalConfig.m.xMalloc(nFull); +@@ -27612,10 +27754,12 @@ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, u64 nBytes){ + sqlite3MallocAlarm(nDiff); + } + pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); ++#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT + if( pNew==0 && mem0.alarmThreshold>0 ){ + sqlite3MallocAlarm((int)nBytes); + pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); + } ++#endif + if( pNew ){ + nNew = sqlite3MallocSize(pNew); + sqlite3StatusUp(SQLITE_STATUS_MEMORY_USED, nNew-nOld); +@@ -27800,7 +27944,7 @@ static SQLITE_NOINLINE void *dbReallocFinish(sqlite3 *db, void *p, u64 n){ + assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) ); + assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) ); + sqlite3MemdebugSetType(p, MEMTYPE_HEAP); +- pNew = sqlite3_realloc64(p, n); ++ pNew = sqlite3Realloc(p, n); + if( !pNew ){ + sqlite3OomFault(db); + } +@@ -27890,7 +28034,7 @@ SQLITE_PRIVATE void sqlite3OomFault(sqlite3 *db){ + if( db->mallocFailed==0 && db->bBenignMalloc==0 ){ + db->mallocFailed = 1; + if( db->nVdbeExec>0 ){ +- db->u1.isInterrupted = 1; ++ AtomicStore(&db->u1.isInterrupted, 1); + } + DisableLookaside; + if( db->pParse ){ +@@ -27909,7 +28053,7 @@ SQLITE_PRIVATE void sqlite3OomFault(sqlite3 *db){ + SQLITE_PRIVATE void sqlite3OomClear(sqlite3 *db){ + if( db->mallocFailed && db->nVdbeExec==0 ){ + db->mallocFailed = 0; +- db->u1.isInterrupted = 0; ++ AtomicStore(&db->u1.isInterrupted, 0); + assert( db->lookaside.bDisable>0 ); + EnableLookaside; + } +@@ -28147,6 +28291,13 @@ static char *printfTempBuf(sqlite3_str *pAccum, sqlite3_int64 n){ + #endif + #define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */ + ++/* ++** Hard limit on the precision of floating-point conversions. ++*/ ++#ifndef SQLITE_PRINTF_PRECISION_LIMIT ++# define SQLITE_FP_PRECISION_LIMIT 100000000 ++#endif ++ + /* + ** Render a string given by "fmt" into the StrAccum object. + */ +@@ -28347,6 +28498,8 @@ SQLITE_API void sqlite3_str_vappendf( + ** xtype The class of the conversion. + ** infop Pointer to the appropriate info struct. + */ ++ assert( width>=0 ); ++ assert( precision>=(-1) ); + switch( xtype ){ + case etPOINTER: + flag_long = sizeof(char*)==sizeof(i64) ? 2 : +@@ -28468,6 +28621,11 @@ SQLITE_API void sqlite3_str_vappendf( + length = 0; + #else + if( precision<0 ) precision = 6; /* Set default precision */ ++#ifdef SQLITE_FP_PRECISION_LIMIT ++ if( precision>SQLITE_FP_PRECISION_LIMIT ){ ++ precision = SQLITE_FP_PRECISION_LIMIT; ++ } ++#endif + if( realvalue<0.0 ){ + realvalue = -realvalue; + prefix = '-'; +@@ -28750,7 +28908,7 @@ SQLITE_API void sqlite3_str_vappendf( + } + isnull = escarg==0; + if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); +- /* For %q, %Q, and %w, the precision is the number of byte (or ++ /* For %q, %Q, and %w, the precision is the number of bytes (or + ** characters if the ! flags is present) to use from the input. + ** Because of the extra quoting characters inserted, the number + ** of output characters may be larger than the precision. +@@ -28877,7 +29035,7 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){ + if( p->db ){ + zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc); + }else{ +- zNew = sqlite3_realloc64(zOld, p->nAlloc); ++ zNew = sqlite3Realloc(zOld, p->nAlloc); + } + if( zNew ){ + assert( p->zText!=0 || p->nChar==0 ); +@@ -29219,7 +29377,7 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){ + SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){ + va_list ap; + StrAccum acc; +- char zBuf[500]; ++ char zBuf[SQLITE_PRINT_BUF_SIZE*10]; + sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0); + va_start(ap,zFormat); + sqlite3_str_vappendf(&acc, zFormat, ap); +@@ -29391,8 +29549,8 @@ SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc) + sqlite3_str_appendf(&x, " %s", pItem->zName); + } + if( pItem->pTab ){ +- sqlite3_str_appendf(&x, " tab=%Q nCol=%d ptr=%p", +- pItem->pTab->zName, pItem->pTab->nCol, pItem->pTab); ++ sqlite3_str_appendf(&x, " tab=%Q nCol=%d ptr=%p used=%llx", ++ pItem->pTab->zName, pItem->pTab->nCol, pItem->pTab, pItem->colUsed); + } + if( pItem->zAlias ){ + sqlite3_str_appendf(&x, " (AS %s)", pItem->zAlias); +@@ -29651,14 +29809,14 @@ SQLITE_PRIVATE void sqlite3TreeViewWinFunc(TreeView *pView, const Window *pWin, + SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 moreToFollow){ + const char *zBinOp = 0; /* Binary operator */ + const char *zUniOp = 0; /* Unary operator */ +- char zFlgs[60]; ++ char zFlgs[200]; + pView = sqlite3TreeViewPush(pView, moreToFollow); + if( pExpr==0 ){ + sqlite3TreeViewLine(pView, "nil"); + sqlite3TreeViewPop(pView); + return; + } +- if( pExpr->flags || pExpr->affExpr ){ ++ if( pExpr->flags || pExpr->affExpr || pExpr->vvaFlags ){ + StrAccum x; + sqlite3StrAccumInit(&x, 0, zFlgs, sizeof(zFlgs), 0); + sqlite3_str_appendf(&x, " fg.af=%x.%c", +@@ -29669,6 +29827,9 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m + if( ExprHasProperty(pExpr, EP_FromDDL) ){ + sqlite3_str_appendf(&x, " DDL"); + } ++ if( ExprHasVVAProperty(pExpr, EP_Immutable) ){ ++ sqlite3_str_appendf(&x, " IMMUTABLE"); ++ } + sqlite3StrAccumFinish(&x); + }else{ + zFlgs[0] = 0; +@@ -29775,6 +29936,7 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m + case TK_RSHIFT: zBinOp = "RSHIFT"; break; + case TK_CONCAT: zBinOp = "CONCAT"; break; + case TK_DOT: zBinOp = "DOT"; break; ++ case TK_LIMIT: zBinOp = "LIMIT"; break; + + case TK_UMINUS: zUniOp = "UMINUS"; break; + case TK_UPLUS: zUniOp = "UPLUS"; break; +@@ -29831,8 +29993,9 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m + #endif + } + if( pExpr->op==TK_AGG_FUNCTION ){ +- sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s", +- pExpr->op2, pExpr->u.zToken, zFlgs); ++ sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s iAgg=%d agg=%p", ++ pExpr->op2, pExpr->u.zToken, zFlgs, ++ pExpr->iAgg, pExpr->pAggInfo); + }else if( pExpr->op2!=0 ){ + const char *zOp2; + char zBuf[8]; +@@ -30546,26 +30709,6 @@ static const unsigned char sqlite3Utf8Trans1[] = { + } \ + } + +-#define READ_UTF16LE(zIn, TERM, c){ \ +- c = (*zIn++); \ +- c += ((*zIn++)<<8); \ +- if( c>=0xD800 && c<0xE000 && TERM ){ \ +- int c2 = (*zIn++); \ +- c2 += ((*zIn++)<<8); \ +- c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ +- } \ +-} +- +-#define READ_UTF16BE(zIn, TERM, c){ \ +- c = ((*zIn++)<<8); \ +- c += (*zIn++); \ +- if( c>=0xD800 && c<0xE000 && TERM ){ \ +- int c2 = ((*zIn++)<<8); \ +- c2 += (*zIn++); \ +- c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ +- } \ +-} +- + /* + ** Translate a single UTF-8 character. Return the unicode value. + ** +@@ -30742,13 +30885,59 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desired + if( pMem->enc==SQLITE_UTF16LE ){ + /* UTF-16 Little-endian -> UTF-8 */ + while( zIn=0xd800 && c<0xe000 ){ ++#ifdef SQLITE_REPLACE_INVALID_UTF ++ if( c>=0xdc00 || zIn>=zTerm ){ ++ c = 0xfffd; ++ }else{ ++ int c2 = *(zIn++); ++ c2 += (*(zIn++))<<8; ++ if( c2<0xdc00 || c2>=0xe000 ){ ++ zIn -= 2; ++ c = 0xfffd; ++ }else{ ++ c = ((c&0x3ff)<<10) + (c2&0x3ff) + 0x10000; ++ } ++ } ++#else ++ if( zIn UTF-8 */ + while( zIn=0xd800 && c<0xe000 ){ ++#ifdef SQLITE_REPLACE_INVALID_UTF ++ if( c>=0xdc00 || zIn>=zTerm ){ ++ c = 0xfffd; ++ }else{ ++ int c2 = (*(zIn++))<<8; ++ c2 += *(zIn++); ++ if( c2<0xdc00 || c2>=0xe000 ){ ++ zIn -= 2; ++ c = 0xfffd; ++ }else{ ++ c = ((c&0x3ff)<<10) + (c2&0x3ff) + 0x10000; ++ } ++ } ++#else ++ if( zIn=0xd8 && c<0xdc && z[0]>=0xdc && z[0]<0xe0 ) z += 2; ++ n++; + } +- return (int)(z-(unsigned char const *)zIn); ++ return (int)(z-(unsigned char const *)zIn) ++ - (SQLITE_UTF16NATIVE==SQLITE_UTF16LE); + } + + #if defined(SQLITE_TEST) +@@ -30948,30 +31134,6 @@ SQLITE_PRIVATE void sqlite3UtfSelfTest(void){ + assert( c==t ); + assert( (z-zBuf)==n ); + } +- for(i=0; i<0x00110000; i++){ +- if( i>=0xD800 && i<0xE000 ) continue; +- z = zBuf; +- WRITE_UTF16LE(z, i); +- n = (int)(z-zBuf); +- assert( n>0 && n<=4 ); +- z[0] = 0; +- z = zBuf; +- READ_UTF16LE(z, 1, c); +- assert( c==i ); +- assert( (z-zBuf)==n ); +- } +- for(i=0; i<0x00110000; i++){ +- if( i>=0xD800 && i<0xE000 ) continue; +- z = zBuf; +- WRITE_UTF16BE(z, i); +- n = (int)(z-zBuf); +- assert( n>0 && n<=4 ); +- z[0] = 0; +- z = zBuf; +- READ_UTF16BE(z, 1, c); +- assert( c==i ); +- assert( (z-zBuf)==n ); +- } + } + #endif /* SQLITE_TEST */ + #endif /* SQLITE_OMIT_UTF16 */ +@@ -31297,6 +31459,19 @@ SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ + return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b]; + } + ++/* ++** Compute an 8-bit hash on a string that is insensitive to case differences ++*/ ++SQLITE_PRIVATE u8 sqlite3StrIHash(const char *z){ ++ u8 h = 0; ++ if( z==0 ) return 0; ++ while( z[0] ){ ++ h += UpperToLower[(unsigned char)z[0]]; ++ z++; ++ } ++ return h; ++} ++ + /* + ** Compute 10 to the E-th power. Examples: E==1 results in 10. + ** E==2 results in 100. E==50 results in 1.0e50. +@@ -32236,7 +32411,7 @@ SQLITE_PRIVATE u8 sqlite3HexToInt(int h){ + return (u8)(h & 0xf); + } + +-#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) ++#if !defined(SQLITE_OMIT_BLOB_LITERAL) + /* + ** Convert a BLOB literal of the form "x'hhhhhh'" into its binary + ** value. Return a pointer to its binary value. Space to hold the +@@ -32257,7 +32432,7 @@ SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){ + } + return zBlob; + } +-#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */ ++#endif /* !SQLITE_OMIT_BLOB_LITERAL */ + + /* + ** Log an error that is an API call on a connection pointer that should +@@ -32968,8 +33143,8 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ + /* 60 */ "IncrVacuum" OpHelp(""), + /* 61 */ "VNext" OpHelp(""), + /* 62 */ "Init" OpHelp("Start at P2"), +- /* 63 */ "PureFunc" OpHelp("r[P3]=func(r[P2@P5])"), +- /* 64 */ "Function" OpHelp("r[P3]=func(r[P2@P5])"), ++ /* 63 */ "PureFunc" OpHelp("r[P3]=func(r[P2@NP])"), ++ /* 64 */ "Function" OpHelp("r[P3]=func(r[P2@NP])"), + /* 65 */ "Return" OpHelp(""), + /* 66 */ "EndCoroutine" OpHelp(""), + /* 67 */ "HaltIfNull" OpHelp("if r[P3]=null halt"), +@@ -33035,8 +33210,8 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ + /* 127 */ "Rowid" OpHelp("r[P2]=rowid"), + /* 128 */ "NullRow" OpHelp(""), + /* 129 */ "SeekEnd" OpHelp(""), +- /* 130 */ "SorterInsert" OpHelp("key=r[P2]"), +- /* 131 */ "IdxInsert" OpHelp("key=r[P2]"), ++ /* 130 */ "IdxInsert" OpHelp("key=r[P2]"), ++ /* 131 */ "SorterInsert" OpHelp("key=r[P2]"), + /* 132 */ "IdxDelete" OpHelp("key=r[P2@P3]"), + /* 133 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), + /* 134 */ "IdxRowid" OpHelp("r[P2]=rowid"), +@@ -33977,7 +34152,7 @@ static int robust_open(const char *z, int f, mode_t m){ + sqlite3_log(SQLITE_WARNING, + "attempt to open \"%s\" as file descriptor %d", z, fd); + fd = -1; +- if( osOpen("/dev/null", f, m)<0 ) break; ++ if( osOpen("/dev/null", O_RDONLY, m)<0 ) break; + } + if( fd>=0 ){ + if( m!=0 ){ +@@ -34853,8 +35028,9 @@ static int osSetPosixAdvisoryLock( + struct flock *pLock, /* The description of the lock */ + unixFile *pFile /* Structure holding timeout value */ + ){ ++ int tm = pFile->iBusyTimeout; + int rc = osFcntl(h,F_SETLK,pLock); +- while( rc<0 && pFile->iBusyTimeout>0 ){ ++ while( rc<0 && tm>0 ){ + /* On systems that support some kind of blocking file lock with a timeout, + ** make appropriate changes here to invoke that blocking file lock. On + ** generic posix, however, there is no such API. So we simply try the +@@ -34862,7 +35038,7 @@ static int osSetPosixAdvisoryLock( + ** the lock is obtained. */ + usleep(1000); + rc = osFcntl(h,F_SETLK,pLock); +- pFile->iBusyTimeout--; ++ tm--; + } + return rc; + } +@@ -36973,7 +37149,7 @@ static int openDirectory(const char *zFilename, int *pFd){ + if( zDirname[0]!='/' ) zDirname[0] = '.'; + zDirname[1] = 0; + } +- fd = robust_open(zDirname, O_RDONLY|O_BINARY|O_NOFOLLOW, 0); ++ fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0); + if( fd>=0 ){ + OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname)); + } +@@ -37283,7 +37459,9 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ + } + #ifdef SQLITE_ENABLE_SETLK_TIMEOUT + case SQLITE_FCNTL_LOCK_TIMEOUT: { ++ int iOld = pFile->iBusyTimeout; + pFile->iBusyTimeout = *(int*)pArg; ++ *(int*)pArg = iOld; + return SQLITE_OK; + } + #endif +@@ -37602,13 +37780,20 @@ static int unixShmSystemLock( + assert( n>=1 && n<=SQLITE_SHM_NLOCK ); + + if( pShmNode->hShm>=0 ){ ++ int res; + /* Initialize the locking parameters */ + f.l_type = lockType; + f.l_whence = SEEK_SET; + f.l_start = ofst; + f.l_len = n; +- rc = osSetPosixAdvisoryLock(pShmNode->hShm, &f, pFile); +- rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY; ++ res = osSetPosixAdvisoryLock(pShmNode->hShm, &f, pFile); ++ if( res==-1 ){ ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ rc = (pFile->iBusyTimeout ? SQLITE_BUSY_TIMEOUT : SQLITE_BUSY); ++#else ++ rc = SQLITE_BUSY; ++#endif ++ } + } + + /* Update the global lock state and do debug tracing */ +@@ -38105,6 +38290,25 @@ static int unixShmLock( + assert( pShmNode->hShm>=0 || pDbFd->pInode->bProcessLock==1 ); + assert( pShmNode->hShm<0 || pDbFd->pInode->bProcessLock==0 ); + ++ /* Check that, if this to be a blocking lock, no locks that occur later ++ ** in the following list than the lock being obtained are already held: ++ ** ++ ** 1. Checkpointer lock (ofst==1). ++ ** 2. Write lock (ofst==0). ++ ** 3. Read locks (ofst>=3 && ofstiBusyTimeout==0 || ( ++ (ofst!=2) /* not RECOVER */ ++ && (ofst!=1 || (p->exclMask|p->sharedMask)==0) ++ && (ofst!=0 || (p->exclMask|p->sharedMask)<3) ++ && (ofst<3 || (p->exclMask|p->sharedMask)<(1<1 || mask==(1<pShmMutex); +@@ -44895,6 +45099,7 @@ static void winModeBit(winFile *pFile, unsigned char mask, int *pArg){ + /* Forward references to VFS helper methods used for temporary files */ + static int winGetTempname(sqlite3_vfs *, char **); + static int winIsDir(const void *); ++static BOOL winIsLongPathPrefix(const char *); + static BOOL winIsDriveLetterAndColon(const char *); + + /* +@@ -46664,7 +46869,9 @@ static int winOpen( + if( isReadonly ){ + pFile->ctrlFlags |= WINFILE_RDONLY; + } +- if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){ ++ if( (flags & SQLITE_OPEN_MAIN_DB) ++ && sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ++ ){ + pFile->ctrlFlags |= WINFILE_PSOW; + } + pFile->lastErrno = NO_ERROR; +@@ -46874,6 +47081,17 @@ static int winAccess( + return SQLITE_OK; + } + ++/* ++** Returns non-zero if the specified path name starts with the "long path" ++** prefix. ++*/ ++static BOOL winIsLongPathPrefix( ++ const char *zPathname ++){ ++ return ( zPathname[0]=='\\' && zPathname[1]=='\\' ++ && zPathname[2]=='?' && zPathname[3]=='\\' ); ++} ++ + /* + ** Returns non-zero if the specified path name starts with a drive letter + ** followed by a colon character. +@@ -46938,10 +47156,11 @@ static int winFullPathname( + char *zOut; + #endif + +- /* If this path name begins with "/X:", where "X" is any alphabetic +- ** character, discard the initial "/" from the pathname. ++ /* If this path name begins with "/X:" or "\\?\", where "X" is any ++ ** alphabetic character, discard the initial "/" from the pathname. + */ +- if( zRelative[0]=='/' && winIsDriveLetterAndColon(zRelative+1) ){ ++ if( zRelative[0]=='/' && (winIsDriveLetterAndColon(zRelative+1) ++ || winIsLongPathPrefix(zRelative+1)) ){ + zRelative++; + } + +@@ -47697,7 +47916,7 @@ static int memdbEnlarge(MemFile *p, sqlite3_int64 newSz){ + } + newSz *= 2; + if( newSz>p->szMax ) newSz = p->szMax; +- pNew = sqlite3_realloc64(p->aData, newSz); ++ pNew = sqlite3Realloc(p->aData, newSz); + if( pNew==0 ) return SQLITE_NOMEM; + p->aData = pNew; + p->szAlloc = newSz; +@@ -48144,10 +48363,11 @@ SQLITE_PRIVATE int sqlite3MemdbInit(void){ + sqlite3_vfs *pLower = sqlite3_vfs_find(0); + int sz = pLower->szOsFile; + memdb_vfs.pAppData = pLower; +- /* In all known configurations of SQLite, the size of a default +- ** sqlite3_file is greater than the size of a memdb sqlite3_file. +- ** Should that ever change, remove the following NEVER() */ +- if( NEVER(szmallocFailed flag is set and this + ** routine returns NULL. +@@ -51189,7 +51409,7 @@ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, int iBatch, sqlite3_int64 + if( p ){ + struct RowSetEntry **ppPrevTree = &pRowSet->pForest; + if( (pRowSet->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/ +- /* Only sort the current set of entiries if they need it */ ++ /* Only sort the current set of entries if they need it */ + p = rowSetEntrySort(p); + } + for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ +@@ -51411,6 +51631,11 @@ SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal); + /* Return the sqlite3_file object for the WAL file */ + SQLITE_PRIVATE sqlite3_file *sqlite3WalFile(Wal *pWal); + ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++SQLITE_PRIVATE int sqlite3WalWriteLock(Wal *pWal, int bLock); ++SQLITE_PRIVATE void sqlite3WalDb(Wal *pWal, sqlite3 *db); ++#endif ++ + #endif /* ifndef SQLITE_OMIT_WAL */ + #endif /* SQLITE_WAL_H */ + +@@ -51801,20 +52026,6 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ + */ + #define UNKNOWN_LOCK (EXCLUSIVE_LOCK+1) + +-/* +-** A macro used for invoking the codec if there is one +-*/ +-#ifdef SQLITE_HAS_CODEC +-# define CODEC1(P,D,N,X,E) \ +- if( P->xCodec && P->xCodec(P->pCodec,D,N,X)==0 ){ E; } +-# define CODEC2(P,D,N,X,E,O) \ +- if( P->xCodec==0 ){ O=(char*)D; }else \ +- if( (O=(char*)(P->xCodec(P->pCodec,D,N,X)))==0 ){ E; } +-#else +-# define CODEC1(P,D,N,X,E) /* NO-OP */ +-# define CODEC2(P,D,N,X,E,O) O=(char*)D +-#endif +- + /* + ** The maximum allowed sector size. 64KiB. If the xSectorsize() method + ** returns a value larger than this, then MAX_SECTOR_SIZE is used instead. +@@ -52100,12 +52311,6 @@ struct Pager { + #endif + void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */ + int (*xGet)(Pager*,Pgno,DbPage**,int); /* Routine to fetch a patch */ +-#ifdef SQLITE_HAS_CODEC +- void *(*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ +- void (*xCodecSizeChng)(void*,int,int); /* Notify of page size changes */ +- void (*xCodecFree)(void*); /* Destructor for the codec */ +- void *pCodec; /* First argument to xCodec... methods */ +-#endif + char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */ + PCache *pPCache; /* Pointer to page cache object */ + #ifndef SQLITE_OMIT_WAL +@@ -52232,9 +52437,6 @@ static const unsigned char aJournalMagic[] = { + SQLITE_PRIVATE int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){ + if( pPager->fd->pMethods==0 ) return 0; + if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0; +-#ifdef SQLITE_HAS_CODEC +- if( pPager->xCodec!=0 ) return 0; +-#endif + #ifndef SQLITE_OMIT_WAL + if( pPager->pWal ){ + u32 iRead = 0; +@@ -52468,11 +52670,7 @@ static void setGetterMethod(Pager *pPager){ + if( pPager->errCode ){ + pPager->xGet = getPageError; + #if SQLITE_MAX_MMAP_SIZE>0 +- }else if( USEFETCH(pPager) +-#ifdef SQLITE_HAS_CODEC +- && pPager->xCodec==0 +-#endif +- ){ ++ }else if( USEFETCH(pPager) ){ + pPager->xGet = getPageMMap; + #endif /* SQLITE_MAX_MMAP_SIZE>0 */ + }else{ +@@ -53620,35 +53818,6 @@ static u32 pager_cksum(Pager *pPager, const u8 *aData){ + return cksum; + } + +-/* +-** Report the current page size and number of reserved bytes back +-** to the codec. +-*/ +-#ifdef SQLITE_HAS_CODEC +-static void pagerReportSize(Pager *pPager){ +- if( pPager->xCodecSizeChng ){ +- pPager->xCodecSizeChng(pPager->pCodec, pPager->pageSize, +- (int)pPager->nReserve); +- } +-} +-#else +-# define pagerReportSize(X) /* No-op if we do not support a codec */ +-#endif +- +-#ifdef SQLITE_HAS_CODEC +-/* +-** Make sure the number of reserved bits is the same in the destination +-** pager as it is in the source. This comes up when a VACUUM changes the +-** number of reserved bits to the "optimal" amount. +-*/ +-SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){ +- if( pDest->nReserve!=pSrc->nReserve ){ +- pDest->nReserve = pSrc->nReserve; +- pagerReportSize(pDest); +- } +-} +-#endif +- + /* + ** Read a single page from either the journal file (if isMainJrnl==1) or + ** from the sub-journal (if isMainJrnl==0) and playback that page. +@@ -53700,11 +53869,6 @@ static int pager_playback_one_page( + char *aData; /* Temporary storage for the page */ + sqlite3_file *jfd; /* The file descriptor for the journal file */ + int isSynced; /* True if journal page is synced */ +-#ifdef SQLITE_HAS_CODEC +- /* The jrnlEnc flag is true if Journal pages should be passed through +- ** the codec. It is false for pure in-memory journals. */ +- const int jrnlEnc = (isMainJrnl || pPager->subjInMemory==0); +-#endif + + assert( (isMainJrnl&~1)==0 ); /* isMainJrnl is 0 or 1 */ + assert( (isSavepnt&~1)==0 ); /* isSavepnt is 0 or 1 */ +@@ -53767,7 +53931,6 @@ static int pager_playback_one_page( + */ + if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){ + pPager->nReserve = ((u8*)aData)[20]; +- pagerReportSize(pPager); + } + + /* If the pager is in CACHEMOD state, then there must be a copy of this +@@ -53835,26 +53998,12 @@ static int pager_playback_one_page( + ** is if the data was just read from an in-memory sub-journal. In that + ** case it must be encrypted here before it is copied into the database + ** file. */ +-#ifdef SQLITE_HAS_CODEC +- if( !jrnlEnc ){ +- CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT, aData); +- rc = sqlite3OsWrite(pPager->fd, (u8 *)aData, pPager->pageSize, ofst); +- CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM_BKPT); +- }else +-#endif + rc = sqlite3OsWrite(pPager->fd, (u8 *)aData, pPager->pageSize, ofst); + + if( pgno>pPager->dbFileSize ){ + pPager->dbFileSize = pgno; + } + if( pPager->pBackup ){ +-#ifdef SQLITE_HAS_CODEC +- if( jrnlEnc ){ +- CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM_BKPT); +- sqlite3BackupUpdate(pPager->pBackup, pgno, (u8*)aData); +- CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT,aData); +- }else +-#endif + sqlite3BackupUpdate(pPager->pBackup, pgno, (u8*)aData); + } + }else if( !isMainJrnl && pPg==0 ){ +@@ -53905,11 +54054,6 @@ static int pager_playback_one_page( + if( pgno==1 ){ + memcpy(&pPager->dbFileVers, &((u8*)pData)[24],sizeof(pPager->dbFileVers)); + } +- +- /* Decode the page just read from disk */ +-#if SQLITE_HAS_CODEC +- if( jrnlEnc ){ CODEC1(pPager, pData, pPg->pgno, 3, rc=SQLITE_NOMEM_BKPT); } +-#endif + sqlite3PcacheRelease(pPg); + } + return rc; +@@ -54012,9 +54156,12 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){ + /* One of the journals pointed to by the master journal exists. + ** Open it and check if it points at the master journal. If + ** so, return without deleting the master journal file. ++ ** NB: zJournal is really a MAIN_JOURNAL. But call it a ++ ** MASTER_JOURNAL here so that the VFS will not send the zJournal ++ ** name into sqlite3_database_file_object(). + */ + int c; +- int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL); ++ int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL); + rc = sqlite3OsOpen(pVfs, zJournal, pJournal, flags, 0); + if( rc!=SQLITE_OK ){ + goto delmaster_out; +@@ -54469,8 +54616,6 @@ static int readDbPage(PgHdr *pPg){ + memcpy(&pPager->dbFileVers, dbFileVers, sizeof(pPager->dbFileVers)); + } + } +- CODEC1(pPager, pPg->pData, pPg->pgno, 3, rc = SQLITE_NOMEM_BKPT); +- + PAGER_INCR(sqlite3_pager_readdb_count); + PAGER_INCR(pPager->nRead); + IOTRACE(("PGIN %p %d\n", pPager, pPg->pgno)); +@@ -55214,7 +55359,6 @@ SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nR + if( nReserve<0 ) nReserve = pPager->nReserve; + assert( nReserve>=0 && nReserve<1000 ); + pPager->nReserve = (i16)nReserve; +- pagerReportSize(pPager); + pagerFixMaplimit(pPager); + } + return rc; +@@ -55610,11 +55754,6 @@ SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3 *db){ + sqlite3OsClose(pPager->fd); + sqlite3PageFree(pTmp); + sqlite3PcacheClose(pPager->pPCache); +- +-#ifdef SQLITE_HAS_CODEC +- if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec); +-#endif +- + assert( !pPager->aSavepoint && !pPager->pInJournal ); + assert( !isOpen(pPager->jfd) && !isOpen(pPager->sjfd) ); + +@@ -55865,8 +56004,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ + assert( (pList->flags&PGHDR_NEED_SYNC)==0 ); + if( pList->pgno==1 ) pager_write_changecounter(pList); + +- /* Encode the database */ +- CODEC2(pPager, pList->pData, pgno, 6, return SQLITE_NOMEM_BKPT, pData); ++ pData = pList->pData; + + /* Write out the page data. */ + rc = sqlite3OsWrite(pPager->fd, pData, pPager->pageSize, offset); +@@ -55955,12 +56093,6 @@ static int subjournalPage(PgHdr *pPg){ + void *pData = pPg->pData; + i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize); + char *pData2; +- +-#if SQLITE_HAS_CODEC +- if( !pPager->subjInMemory ){ +- CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); +- }else +-#endif + pData2 = pData; + PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno)); + rc = write32bits(pPager->sjfd, offset, pPg->pgno); +@@ -56233,6 +56365,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( + ** Database file handle (pVfs->szOsFile bytes) + ** Sub-journal file handle (journalFileSize bytes) + ** Main journal file handle (journalFileSize bytes) ++ ** Ptr back to the Pager (sizeof(Pager*) bytes) + ** \0\0\0\0 database prefix (4 bytes) + ** Database file name (nPathname+1 bytes) + ** URI query parameters (nUriByte bytes) +@@ -56261,12 +56394,18 @@ SQLITE_PRIVATE int sqlite3PagerOpen( + ** - \0 + ** - WAL Path (zWALName) + ** - \0 ++ ** ++ ** The sqlite3_create_filename() interface and the databaseFilename() utility ++ ** that is used by sqlite3_filename_database() and kin also depend on the ++ ** specific formatting and order of the various filenames, so if the format ++ ** changes here, be sure to change it there as well. + */ + pPtr = (u8 *)sqlite3MallocZero( + ROUND8(sizeof(*pPager)) + /* Pager structure */ + ROUND8(pcacheSize) + /* PCache object */ + ROUND8(pVfs->szOsFile) + /* The main db file */ + journalFileSize * 2 + /* The two journal files */ ++ sizeof(pPager) + /* Space to hold a pointer */ + 4 + /* Database prefix */ + nPathname + 1 + /* database filename */ + nUriByte + /* query parameters */ +@@ -56287,6 +56426,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( + pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; + pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; + assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) ); ++ memcpy(pPtr, &pPager, sizeof(pPager)); pPtr += sizeof(pPager); + + /* Fill in the Pager.zFilename and pPager.zQueryParam fields */ + pPtr += 4; /* Skip zero prefix */ +@@ -56487,6 +56627,19 @@ act_like_temp_file: + return SQLITE_OK; + } + ++/* ++** Return the sqlite3_file for the main database given the name ++** of the corresonding WAL or Journal name as passed into ++** xOpen. ++*/ ++SQLITE_API sqlite3_file *sqlite3_database_file_object(const char *zName){ ++ Pager *pPager; ++ while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ ++ zName--; ++ } ++ pPager = *(Pager**)(zName - 4 - sizeof(Pager*)); ++ return pPager->fd; ++} + + + /* +@@ -57042,9 +57195,6 @@ static int getPageMMap( + ); + + assert( USEFETCH(pPager) ); +-#ifdef SQLITE_HAS_CODEC +- assert( pPager->xCodec==0 ); +-#endif + + /* Optimization note: Adding the "pgno<=1" term before "pgno==0" here + ** allows the compiler optimizer to reuse the results of the "pgno>1" +@@ -57175,7 +57325,6 @@ SQLITE_PRIVATE void sqlite3PagerUnrefPageOne(DbPage *pPg){ + assert( pPg->pgno==1 ); + assert( (pPg->flags & PGHDR_MMAP)==0 ); /* Page1 is never memory mapped */ + pPager = pPg->pPager; +- sqlite3PagerResetLockTimeout(pPager); + sqlite3PcacheRelease(pPg); + pagerUnlockIfUnused(pPager); + } +@@ -57373,7 +57522,7 @@ static SQLITE_NOINLINE int pagerAddPageToRollbackJournal(PgHdr *pPg){ + assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) ); + + assert( pPager->journalHdr<=pPager->journalOff ); +- CODEC2(pPager, pPg->pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); ++ pData2 = pPg->pData; + cksum = pager_cksum(pPager, (u8*)pData2); + + /* Even if an IO or diskfull error occurs while journalling the +@@ -57738,7 +57887,7 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ + if( DIRECT_MODE ){ + const void *zBuf; + assert( pPager->dbFileSize>0 ); +- CODEC2(pPager, pPgHdr->pData, 1, 6, rc=SQLITE_NOMEM_BKPT, zBuf); ++ zBuf = pPgHdr->pData; + if( rc==SQLITE_OK ){ + rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); + pPager->aStat[PAGER_STAT_WRITE]++; +@@ -58448,7 +58597,7 @@ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ + ** sqlite3_uri_parameter() and sqlite3_filename_database() and friends. + */ + SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager *pPager, int nullIfMemDb){ +- static const char zFake[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; ++ static const char zFake[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + return (nullIfMemDb && pPager->memDb) ? &zFake[4] : pPager->zFilename; + } + +@@ -58468,16 +58617,6 @@ SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){ + return pPager->fd; + } + +-#ifdef SQLITE_ENABLE_SETLK_TIMEOUT +-/* +-** Reset the lock timeout for pager. +-*/ +-SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager){ +- int x = 0; +- sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_LOCK_TIMEOUT, &x); +-} +-#endif +- + /* + ** Return the file handle for the journal file (if it exists). + ** This will be either the rollback journal or the WAL file. +@@ -58497,54 +58636,6 @@ SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager *pPager){ + return pPager->zJournal; + } + +-#ifdef SQLITE_HAS_CODEC +-/* +-** Set or retrieve the codec for this pager +-*/ +-SQLITE_PRIVATE void sqlite3PagerSetCodec( +- Pager *pPager, +- void *(*xCodec)(void*,void*,Pgno,int), +- void (*xCodecSizeChng)(void*,int,int), +- void (*xCodecFree)(void*), +- void *pCodec +-){ +- if( pPager->xCodecFree ){ +- pPager->xCodecFree(pPager->pCodec); +- }else{ +- pager_reset(pPager); +- } +- pPager->xCodec = pPager->memDb ? 0 : xCodec; +- pPager->xCodecSizeChng = xCodecSizeChng; +- pPager->xCodecFree = xCodecFree; +- pPager->pCodec = pCodec; +- setGetterMethod(pPager); +- pagerReportSize(pPager); +-} +-SQLITE_PRIVATE void *sqlite3PagerGetCodec(Pager *pPager){ +- return pPager->pCodec; +-} +- +-/* +-** This function is called by the wal module when writing page content +-** into the log file. +-** +-** This function returns a pointer to a buffer containing the encrypted +-** page content. If a malloc fails, this function may return NULL. +-*/ +-SQLITE_PRIVATE void *sqlite3PagerCodec(PgHdr *pPg){ +- void *aData = 0; +- CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData); +- return aData; +-} +- +-/* +-** Return the current pager state +-*/ +-SQLITE_PRIVATE int sqlite3PagerState(Pager *pPager){ +- return pPager->eState; +-} +-#endif /* SQLITE_HAS_CODEC */ +- + #ifndef SQLITE_OMIT_AUTOVACUUM + /* + ** Move the page pPg to location pgno in the file. +@@ -58939,7 +59030,6 @@ SQLITE_PRIVATE int sqlite3PagerCheckpoint( + pPager->walSyncFlags, pPager->pageSize, (u8 *)pPager->pTmpSpace, + pnLog, pnCkpt + ); +- sqlite3PagerResetLockTimeout(pPager); + } + return rc; + } +@@ -59104,7 +59194,31 @@ SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager, sqlite3 *db){ + return rc; + } + ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++/* ++** If pager pPager is a wal-mode database not in exclusive locking mode, ++** invoke the sqlite3WalWriteLock() function on the associated Wal object ++** with the same db and bLock parameters as were passed to this function. ++** Return an SQLite error code if an error occurs, or SQLITE_OK otherwise. ++*/ ++SQLITE_PRIVATE int sqlite3PagerWalWriteLock(Pager *pPager, int bLock){ ++ int rc = SQLITE_OK; ++ if( pagerUseWal(pPager) && pPager->exclusiveMode==0 ){ ++ rc = sqlite3WalWriteLock(pPager->pWal, bLock); ++ } ++ return rc; ++} + ++/* ++** Set the database handle used by the wal layer to determine if ++** blocking locks are required. ++*/ ++SQLITE_PRIVATE void sqlite3PagerWalDb(Pager *pPager, sqlite3 *db){ ++ if( pagerUseWal(pPager) ){ ++ sqlite3WalDb(pPager->pWal, db); ++ } ++} ++#endif + + #ifdef SQLITE_ENABLE_SNAPSHOT + /* +@@ -59124,7 +59238,10 @@ SQLITE_PRIVATE int sqlite3PagerSnapshotGet(Pager *pPager, sqlite3_snapshot **ppS + ** read transaction is opened, attempt to read from the snapshot it + ** identifies. If this is not a WAL database, return an error. + */ +-SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot){ ++SQLITE_PRIVATE int sqlite3PagerSnapshotOpen( ++ Pager *pPager, ++ sqlite3_snapshot *pSnapshot ++){ + int rc = SQLITE_OK; + if( pPager->pWal ){ + sqlite3WalSnapshotOpen(pPager->pWal, pSnapshot); +@@ -59460,18 +59577,6 @@ SQLITE_PRIVATE int sqlite3WalTrace = 0; + # define WALTRACE(X) + #endif + +-/* +-** WAL mode depends on atomic aligned 32-bit loads and stores in a few +-** places. The following macros try to make this explicit. +-*/ +-#if GCC_VESRION>=5004000 +-# define AtomicLoad(PTR) __atomic_load_n((PTR),__ATOMIC_RELAXED) +-# define AtomicStore(PTR,VAL) __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED) +-#else +-# define AtomicLoad(PTR) (*(PTR)) +-# define AtomicStore(PTR,VAL) (*(PTR) = (VAL)) +-#endif +- + /* + ** The maximum (and only) versions of the wal and wal-index formats + ** that may be interpreted by this version of SQLite. +@@ -59681,6 +59786,9 @@ struct Wal { + #ifdef SQLITE_ENABLE_SNAPSHOT + WalIndexHdr *pSnapshot; /* Start transaction here if not NULL */ + #endif ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ sqlite3 *db; ++#endif + }; + + /* +@@ -59779,7 +59887,7 @@ static SQLITE_NOINLINE int walIndexPageRealloc( + if( pWal->nWiData<=iPage ){ + sqlite3_int64 nByte = sizeof(u32*)*(iPage+1); + volatile u32 **apNew; +- apNew = (volatile u32 **)sqlite3_realloc64((void *)pWal->apWiData, nByte); ++ apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte); + if( !apNew ){ + *ppPage = 0; + return SQLITE_NOMEM_BKPT; +@@ -59900,18 +60008,35 @@ static void walChecksumBytes( + aOut[1] = s2; + } + ++/* ++** If there is the possibility of concurrent access to the SHM file ++** from multiple threads and/or processes, then do a memory barrier. ++*/ + static void walShmBarrier(Wal *pWal){ + if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){ + sqlite3OsShmBarrier(pWal->pDbFd); + } + } + ++/* ++** Add the SQLITE_NO_TSAN as part of the return-type of a function ++** definition as a hint that the function contains constructs that ++** might give false-positive TSAN warnings. ++** ++** See tag-20200519-1. ++*/ ++#if defined(__clang__) && !defined(SQLITE_NO_TSAN) ++# define SQLITE_NO_TSAN __attribute__((no_sanitize_thread)) ++#else ++# define SQLITE_NO_TSAN ++#endif ++ + /* + ** Write the header information in pWal->hdr into the wal-index. + ** + ** The checksum on pWal->hdr is updated before it is written. + */ +-static void walIndexWriteHdr(Wal *pWal){ ++static SQLITE_NO_TSAN void walIndexWriteHdr(Wal *pWal){ + volatile WalIndexHdr *aHdr = walIndexHdr(pWal); + const int nCksum = offsetof(WalIndexHdr, aCksum); + +@@ -59919,6 +60044,7 @@ static void walIndexWriteHdr(Wal *pWal){ + pWal->hdr.isInit = 1; + pWal->hdr.iVersion = WALINDEX_MAX_VERSION; + walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum); ++ /* Possible TSAN false-positive. See tag-20200519-1 */ + memcpy((void*)&aHdr[1], (const void*)&pWal->hdr, sizeof(WalIndexHdr)); + walShmBarrier(pWal); + memcpy((void*)&aHdr[0], (const void*)&pWal->hdr, sizeof(WalIndexHdr)); +@@ -60054,7 +60180,7 @@ static int walLockShared(Wal *pWal, int lockIdx){ + SQLITE_SHM_LOCK | SQLITE_SHM_SHARED); + WALTRACE(("WAL%p: acquire SHARED-%s %s\n", pWal, + walLockName(lockIdx), rc ? "failed" : "ok")); +- VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && rc!=SQLITE_BUSY); ) ++ VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && (rc&0xFF)!=SQLITE_BUSY); ) + return rc; + } + static void walUnlockShared(Wal *pWal, int lockIdx){ +@@ -60070,7 +60196,7 @@ static int walLockExclusive(Wal *pWal, int lockIdx, int n){ + SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE); + WALTRACE(("WAL%p: acquire EXCLUSIVE-%s cnt=%d %s\n", pWal, + walLockName(lockIdx), n, rc ? "failed" : "ok")); +- VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && rc!=SQLITE_BUSY); ) ++ VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && (rc&0xFF)!=SQLITE_BUSY); ) + return rc; + } + static void walUnlockExclusive(Wal *pWal, int lockIdx, int n){ +@@ -60890,6 +61016,89 @@ static int walIteratorInit(Wal *pWal, u32 nBackfill, WalIterator **pp){ + return rc; + } + ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++/* ++** Attempt to enable blocking locks. Blocking locks are enabled only if (a) ++** they are supported by the VFS, and (b) the database handle is configured ++** with a busy-timeout. Return 1 if blocking locks are successfully enabled, ++** or 0 otherwise. ++*/ ++static int walEnableBlocking(Wal *pWal){ ++ int res = 0; ++ if( pWal->db ){ ++ int tmout = pWal->db->busyTimeout; ++ if( tmout ){ ++ int rc; ++ rc = sqlite3OsFileControl( ++ pWal->pDbFd, SQLITE_FCNTL_LOCK_TIMEOUT, (void*)&tmout ++ ); ++ res = (rc==SQLITE_OK); ++ } ++ } ++ return res; ++} ++ ++/* ++** Disable blocking locks. ++*/ ++static void walDisableBlocking(Wal *pWal){ ++ int tmout = 0; ++ sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_LOCK_TIMEOUT, (void*)&tmout); ++} ++ ++/* ++** If parameter bLock is true, attempt to enable blocking locks, take ++** the WRITER lock, and then disable blocking locks. If blocking locks ++** cannot be enabled, no attempt to obtain the WRITER lock is made. Return ++** an SQLite error code if an error occurs, or SQLITE_OK otherwise. It is not ++** an error if blocking locks can not be enabled. ++** ++** If the bLock parameter is false and the WRITER lock is held, release it. ++*/ ++SQLITE_PRIVATE int sqlite3WalWriteLock(Wal *pWal, int bLock){ ++ int rc = SQLITE_OK; ++ assert( pWal->readLock<0 || bLock==0 ); ++ if( bLock ){ ++ assert( pWal->db ); ++ if( walEnableBlocking(pWal) ){ ++ rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1); ++ if( rc==SQLITE_OK ){ ++ pWal->writeLock = 1; ++ } ++ walDisableBlocking(pWal); ++ } ++ }else if( pWal->writeLock ){ ++ walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); ++ pWal->writeLock = 0; ++ } ++ return rc; ++} ++ ++/* ++** Set the database handle used to determine if blocking locks are required. ++*/ ++SQLITE_PRIVATE void sqlite3WalDb(Wal *pWal, sqlite3 *db){ ++ pWal->db = db; ++} ++ ++/* ++** Take an exclusive WRITE lock. Blocking if so configured. ++*/ ++static int walLockWriter(Wal *pWal){ ++ int rc; ++ walEnableBlocking(pWal); ++ rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1); ++ walDisableBlocking(pWal); ++ return rc; ++} ++#else ++# define walEnableBlocking(x) 0 ++# define walDisableBlocking(x) ++# define walLockWriter(pWal) walLockExclusive((pWal), WAL_WRITE_LOCK, 1) ++# define sqlite3WalDb(pWal, db) ++#endif /* ifdef SQLITE_ENABLE_SETLK_TIMEOUT */ ++ ++ + /* + ** Attempt to obtain the exclusive WAL lock defined by parameters lockIdx and + ** n. If the attempt fails and parameter xBusy is not NULL, then it is a +@@ -60907,6 +61116,12 @@ static int walBusyLock( + do { + rc = walLockExclusive(pWal, lockIdx, n); + }while( xBusy && rc==SQLITE_BUSY && xBusy(pBusyArg) ); ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ if( rc==SQLITE_BUSY_TIMEOUT ){ ++ walDisableBlocking(pWal); ++ rc = SQLITE_BUSY; ++ } ++#endif + return rc; + } + +@@ -60944,7 +61159,7 @@ static void walRestartHdr(Wal *pWal, u32 salt1){ + sqlite3Put4byte((u8*)&aSalt[0], 1 + sqlite3Get4byte((u8*)&aSalt[0])); + memcpy(&pWal->hdr.aSalt[1], &salt1, 4); + walIndexWriteHdr(pWal); +- pInfo->nBackfill = 0; ++ AtomicStore(&pInfo->nBackfill, 0); + pInfo->nBackfillAttempted = 0; + pInfo->aReadMark[1] = 0; + for(i=2; iaReadMark[i] = READMARK_NOT_USED; +@@ -61019,32 +61234,13 @@ static int walCheckpoint( + mxSafeFrame = pWal->hdr.mxFrame; + mxPage = pWal->hdr.nPage; + for(i=1; iaReadMark[i]; ++ u32 y = AtomicLoad(pInfo->aReadMark+i); + if( mxSafeFrame>y ){ + assert( y<=pWal->hdr.mxFrame ); + rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_READ_LOCK(i), 1); + if( rc==SQLITE_OK ){ +- pInfo->aReadMark[i] = (i==1 ? mxSafeFrame : READMARK_NOT_USED); ++ u32 iMark = (i==1 ? mxSafeFrame : READMARK_NOT_USED); ++ AtomicStore(pInfo->aReadMark+i, iMark); + walUnlockExclusive(pWal, WAL_READ_LOCK(i), 1); + }else if( rc==SQLITE_BUSY ){ + mxSafeFrame = y; +@@ -61062,7 +61258,7 @@ static int walCheckpoint( + } + + if( pIter +- && (rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_READ_LOCK(0),1))==SQLITE_OK ++ && (rc = walBusyLock(pWal,xBusy,pBusyArg,WAL_READ_LOCK(0),1))==SQLITE_OK + ){ + u32 nBackfill = pInfo->nBackfill; + +@@ -61077,6 +61273,7 @@ static int walCheckpoint( + if( rc==SQLITE_OK ){ + i64 nReq = ((i64)mxPage * szPage); + i64 nSize; /* Current size of database file */ ++ sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0); + rc = sqlite3OsFileSize(pWal->pDbFd, &nSize); + if( rc==SQLITE_OK && nSizepDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq); +@@ -61088,7 +61285,7 @@ static int walCheckpoint( + while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ + i64 iOffset; + assert( walFramePgno(pWal, iFrame)==iDbpage ); +- if( db->u1.isInterrupted ){ ++ if( AtomicLoad(&db->u1.isInterrupted) ){ + rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT; + break; + } +@@ -61104,6 +61301,7 @@ static int walCheckpoint( + rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset); + if( rc!=SQLITE_OK ) break; + } ++ sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0); + + /* If work was actually accomplished... */ + if( rc==SQLITE_OK ){ +@@ -61116,11 +61314,7 @@ static int walCheckpoint( + } + } + if( rc==SQLITE_OK ){ +- rc = sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_DONE, 0); +- if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; +- } +- if( rc==SQLITE_OK ){ +- pInfo->nBackfill = mxSafeFrame; ++ AtomicStore(&pInfo->nBackfill, mxSafeFrame); + } + } + +@@ -61279,7 +61473,7 @@ SQLITE_PRIVATE int sqlite3WalClose( + ** If the checksum cannot be verified return non-zero. If the header + ** is read successfully and the checksum verified, return zero. + */ +-static int walIndexTryHdr(Wal *pWal, int *pChanged){ ++static SQLITE_NO_TSAN int walIndexTryHdr(Wal *pWal, int *pChanged){ + u32 aCksum[2]; /* Checksum on the header content */ + WalIndexHdr h1, h2; /* Two copies of the header content */ + WalIndexHdr volatile *aHdr; /* Header in shared memory */ +@@ -61292,13 +61486,19 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){ + ** meaning it is possible that an inconsistent snapshot is read + ** from the file. If this happens, return non-zero. + ** ++ ** tag-20200519-1: + ** There are two copies of the header at the beginning of the wal-index. + ** When reading, read [0] first then [1]. Writes are in the reverse order. + ** Memory barriers are used to prevent the compiler or the hardware from +- ** reordering the reads and writes. ++ ** reordering the reads and writes. TSAN and similar tools can sometimes ++ ** give false-positive warnings about these accesses because the tools do not ++ ** account for the double-read and the memory barrier. The use of mutexes ++ ** here would be problematic as the memory being accessed is potentially ++ ** shared among multiple processes and not all mutex implementions work ++ ** reliably in that environment. + */ + aHdr = walIndexHdr(pWal); +- memcpy(&h1, (void *)&aHdr[0], sizeof(h1)); ++ memcpy(&h1, (void *)&aHdr[0], sizeof(h1)); /* Possible TSAN false-positive */ + walShmBarrier(pWal); + memcpy(&h2, (void *)&aHdr[1], sizeof(h2)); + +@@ -61388,28 +61588,32 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ + /* If the first attempt failed, it might have been due to a race + ** with a writer. So get a WRITE lock and try again. + */ +- assert( badHdr==0 || pWal->writeLock==0 ); + if( badHdr ){ + if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){ + if( SQLITE_OK==(rc = walLockShared(pWal, WAL_WRITE_LOCK)) ){ + walUnlockShared(pWal, WAL_WRITE_LOCK); + rc = SQLITE_READONLY_RECOVERY; + } +- }else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){ +- pWal->writeLock = 1; +- if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){ +- badHdr = walIndexTryHdr(pWal, pChanged); +- if( badHdr ){ +- /* If the wal-index header is still malformed even while holding +- ** a WRITE lock, it can only mean that the header is corrupted and +- ** needs to be reconstructed. So run recovery to do exactly that. +- */ +- rc = walIndexRecover(pWal); +- *pChanged = 1; ++ }else{ ++ int bWriteLock = pWal->writeLock; ++ if( bWriteLock || SQLITE_OK==(rc = walLockWriter(pWal)) ){ ++ pWal->writeLock = 1; ++ if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){ ++ badHdr = walIndexTryHdr(pWal, pChanged); ++ if( badHdr ){ ++ /* If the wal-index header is still malformed even while holding ++ ** a WRITE lock, it can only mean that the header is corrupted and ++ ** needs to be reconstructed. So run recovery to do exactly that. ++ */ ++ rc = walIndexRecover(pWal); ++ *pChanged = 1; ++ } ++ } ++ if( bWriteLock==0 ){ ++ pWal->writeLock = 0; ++ walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); + } + } +- pWal->writeLock = 0; +- walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); + } + } + +@@ -61739,7 +61943,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ + assert( pWal->nWiData>0 ); + assert( pWal->apWiData[0]!=0 ); + pInfo = walCkptInfo(pWal); +- if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame ++ if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame + #ifdef SQLITE_ENABLE_SNAPSHOT + && (pWal->pSnapshot==0 || pWal->hdr.mxFrame==0) + #endif +@@ -61801,7 +62005,8 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ + for(i=1; iaReadMark+i,mxFrame); ++ AtomicStore(pInfo->aReadMark+i,mxFrame); ++ mxReadMark = mxFrame; + mxI = i; + walUnlockExclusive(pWal, WAL_READ_LOCK(i), 1); + break; +@@ -61905,7 +62110,7 @@ SQLITE_PRIVATE int sqlite3WalSnapshotRecover(Wal *pWal){ + rc = SQLITE_NOMEM; + }else{ + u32 i = pInfo->nBackfillAttempted; +- for(i=pInfo->nBackfillAttempted; i>pInfo->nBackfill; i--){ ++ for(i=pInfo->nBackfillAttempted; i>AtomicLoad(&pInfo->nBackfill); i--){ + WalHashLoc sLoc; /* Hash table location */ + u32 pgno; /* Page number in db file */ + i64 iDbOff; /* Offset of db file entry */ +@@ -61960,12 +62165,35 @@ SQLITE_PRIVATE int sqlite3WalSnapshotRecover(Wal *pWal){ + SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ + int rc; /* Return code */ + int cnt = 0; /* Number of TryBeginRead attempts */ +- + #ifdef SQLITE_ENABLE_SNAPSHOT + int bChanged = 0; + WalIndexHdr *pSnapshot = pWal->pSnapshot; +- if( pSnapshot && memcmp(pSnapshot, &pWal->hdr, sizeof(WalIndexHdr))!=0 ){ +- bChanged = 1; ++#endif ++ ++ assert( pWal->ckptLock==0 ); ++ ++#ifdef SQLITE_ENABLE_SNAPSHOT ++ if( pSnapshot ){ ++ if( memcmp(pSnapshot, &pWal->hdr, sizeof(WalIndexHdr))!=0 ){ ++ bChanged = 1; ++ } ++ ++ /* It is possible that there is a checkpointer thread running ++ ** concurrent with this code. If this is the case, it may be that the ++ ** checkpointer has already determined that it will checkpoint ++ ** snapshot X, where X is later in the wal file than pSnapshot, but ++ ** has not yet set the pInfo->nBackfillAttempted variable to indicate ++ ** its intent. To avoid the race condition this leads to, ensure that ++ ** there is no checkpointer process by taking a shared CKPT lock ++ ** before checking pInfo->nBackfillAttempted. */ ++ (void)walEnableBlocking(pWal); ++ rc = walLockShared(pWal, WAL_CKPT_LOCK); ++ walDisableBlocking(pWal); ++ ++ if( rc!=SQLITE_OK ){ ++ return rc; ++ } ++ pWal->ckptLock = 1; + } + #endif + +@@ -61998,48 +62226,42 @@ SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ + assert( pWal->readLock>0 || pWal->hdr.mxFrame==0 ); + assert( pInfo->aReadMark[pWal->readLock]<=pSnapshot->mxFrame ); + +- /* It is possible that there is a checkpointer thread running +- ** concurrent with this code. If this is the case, it may be that the +- ** checkpointer has already determined that it will checkpoint +- ** snapshot X, where X is later in the wal file than pSnapshot, but +- ** has not yet set the pInfo->nBackfillAttempted variable to indicate +- ** its intent. To avoid the race condition this leads to, ensure that +- ** there is no checkpointer process by taking a shared CKPT lock +- ** before checking pInfo->nBackfillAttempted. +- ** +- ** TODO: Does the aReadMark[] lock prevent a checkpointer from doing +- ** this already? +- */ +- rc = walLockShared(pWal, WAL_CKPT_LOCK); +- +- if( rc==SQLITE_OK ){ +- /* Check that the wal file has not been wrapped. Assuming that it has +- ** not, also check that no checkpointer has attempted to checkpoint any +- ** frames beyond pSnapshot->mxFrame. If either of these conditions are +- ** true, return SQLITE_ERROR_SNAPSHOT. Otherwise, overwrite pWal->hdr +- ** with *pSnapshot and set *pChanged as appropriate for opening the +- ** snapshot. */ +- if( !memcmp(pSnapshot->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt)) +- && pSnapshot->mxFrame>=pInfo->nBackfillAttempted +- ){ +- assert( pWal->readLock>0 ); +- memcpy(&pWal->hdr, pSnapshot, sizeof(WalIndexHdr)); +- *pChanged = bChanged; +- }else{ +- rc = SQLITE_ERROR_SNAPSHOT; +- } +- +- /* Release the shared CKPT lock obtained above. */ +- walUnlockShared(pWal, WAL_CKPT_LOCK); +- pWal->minFrame = 1; ++ /* Check that the wal file has not been wrapped. Assuming that it has ++ ** not, also check that no checkpointer has attempted to checkpoint any ++ ** frames beyond pSnapshot->mxFrame. If either of these conditions are ++ ** true, return SQLITE_ERROR_SNAPSHOT. Otherwise, overwrite pWal->hdr ++ ** with *pSnapshot and set *pChanged as appropriate for opening the ++ ** snapshot. */ ++ if( !memcmp(pSnapshot->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt)) ++ && pSnapshot->mxFrame>=pInfo->nBackfillAttempted ++ ){ ++ assert( pWal->readLock>0 ); ++ memcpy(&pWal->hdr, pSnapshot, sizeof(WalIndexHdr)); ++ *pChanged = bChanged; ++ }else{ ++ rc = SQLITE_ERROR_SNAPSHOT; + } + ++ /* A client using a non-current snapshot may not ignore any frames ++ ** from the start of the wal file. This is because, for a system ++ ** where (minFrame < iSnapshot < maxFrame), a checkpointer may ++ ** have omitted to checkpoint a frame earlier than minFrame in ++ ** the file because there exists a frame after iSnapshot that ++ ** is the same database page. */ ++ pWal->minFrame = 1; + + if( rc!=SQLITE_OK ){ + sqlite3WalEndReadTransaction(pWal); + } + } + } ++ ++ /* Release the shared CKPT lock obtained above. */ ++ if( pWal->ckptLock ){ ++ assert( pSnapshot ); ++ walUnlockShared(pWal, WAL_CKPT_LOCK); ++ pWal->ckptLock = 0; ++ } + #endif + return rc; + } +@@ -62119,14 +62341,15 @@ SQLITE_PRIVATE int sqlite3WalFindFrame( + int iKey; /* Hash slot index */ + int nCollide; /* Number of hash collisions remaining */ + int rc; /* Error code */ ++ u32 iH; + + rc = walHashGet(pWal, iHash, &sLoc); + if( rc!=SQLITE_OK ){ + return rc; + } + nCollide = HASHTABLE_NSLOT; +- for(iKey=walHash(pgno); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){ +- u32 iH = sLoc.aHash[iKey]; ++ iKey = walHash(pgno); ++ while( (iH = AtomicLoad(&sLoc.aHash[iKey]))!=0 ){ + u32 iFrame = iH + sLoc.iZero; + if( iFrame<=iLast && iFrame>=pWal->minFrame && sLoc.aPgno[iH]==pgno ){ + assert( iFrame>iRead || CORRUPT_DB ); +@@ -62135,6 +62358,7 @@ SQLITE_PRIVATE int sqlite3WalFindFrame( + if( (nCollide--)==0 ){ + return SQLITE_CORRUPT_BKPT; + } ++ iKey = walNextHash(iKey); + } + if( iRead ) break; + } +@@ -62210,6 +62434,16 @@ SQLITE_PRIVATE Pgno sqlite3WalDbsize(Wal *pWal){ + SQLITE_PRIVATE int sqlite3WalBeginWriteTransaction(Wal *pWal){ + int rc; + ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ /* If the write-lock is already held, then it was obtained before the ++ ** read-transaction was even opened, making this call a no-op. ++ ** Return early. */ ++ if( pWal->writeLock ){ ++ assert( !memcmp(&pWal->hdr,(void *)walIndexHdr(pWal),sizeof(WalIndexHdr)) ); ++ return SQLITE_OK; ++ } ++#endif ++ + /* Cannot start a write transaction without first holding a read + ** transaction. */ + assert( pWal->readLock>=0 ); +@@ -62455,11 +62689,7 @@ static int walWriteOneFrame( + int rc; /* Result code from subfunctions */ + void *pData; /* Data actually written */ + u8 aFrame[WAL_FRAME_HDRSIZE]; /* Buffer to assemble frame-header in */ +-#if defined(SQLITE_HAS_CODEC) +- if( (pData = sqlite3PagerCodec(pPage))==0 ) return SQLITE_NOMEM_BKPT; +-#else + pData = pPage->pData; +-#endif + walEncodeFrame(p->pWal, pPage->pgno, nTruncate, pData, aFrame); + rc = walWriteToLog(p, aFrame, sizeof(aFrame), iOffset); + if( rc ) return rc; +@@ -62642,11 +62872,7 @@ SQLITE_PRIVATE int sqlite3WalFrames( + if( pWal->iReCksum==0 || iWriteiReCksum ){ + pWal->iReCksum = iWrite; + } +-#if defined(SQLITE_HAS_CODEC) +- if( (pData = sqlite3PagerCodec(p))==0 ) return SQLITE_NOMEM; +-#else + pData = p->pData; +-#endif + rc = sqlite3OsWrite(pWal->pWalFd, pData, szPage, iOff); + if( rc ) return rc; + p->flags &= ~PGHDR_WAL_APPEND; +@@ -62794,45 +63020,52 @@ SQLITE_PRIVATE int sqlite3WalCheckpoint( + if( pWal->readOnly ) return SQLITE_READONLY; + WALTRACE(("WAL%p: checkpoint begins\n", pWal)); + ++ /* Enable blocking locks, if possible. If blocking locks are successfully ++ ** enabled, set xBusy2=0 so that the busy-handler is never invoked. */ ++ sqlite3WalDb(pWal, db); ++ (void)walEnableBlocking(pWal); ++ + /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive +- ** "checkpoint" lock on the database file. */ ++ ** "checkpoint" lock on the database file. ++ ** EVIDENCE-OF: R-10421-19736 If any other process is running a ++ ** checkpoint operation at the same time, the lock cannot be obtained and ++ ** SQLITE_BUSY is returned. ++ ** EVIDENCE-OF: R-53820-33897 Even if there is a busy-handler configured, ++ ** it will not be invoked in this case. ++ */ + rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1); +- if( rc ){ +- /* EVIDENCE-OF: R-10421-19736 If any other process is running a +- ** checkpoint operation at the same time, the lock cannot be obtained and +- ** SQLITE_BUSY is returned. +- ** EVIDENCE-OF: R-53820-33897 Even if there is a busy-handler configured, +- ** it will not be invoked in this case. +- */ +- testcase( rc==SQLITE_BUSY ); +- testcase( xBusy!=0 ); +- return rc; +- } +- pWal->ckptLock = 1; ++ testcase( rc==SQLITE_BUSY ); ++ testcase( rc!=SQLITE_OK && xBusy2!=0 ); ++ if( rc==SQLITE_OK ){ ++ pWal->ckptLock = 1; + +- /* IMPLEMENTATION-OF: R-59782-36818 The SQLITE_CHECKPOINT_FULL, RESTART and +- ** TRUNCATE modes also obtain the exclusive "writer" lock on the database +- ** file. +- ** +- ** EVIDENCE-OF: R-60642-04082 If the writer lock cannot be obtained +- ** immediately, and a busy-handler is configured, it is invoked and the +- ** writer lock retried until either the busy-handler returns 0 or the +- ** lock is successfully obtained. +- */ +- if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){ +- rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_WRITE_LOCK, 1); +- if( rc==SQLITE_OK ){ +- pWal->writeLock = 1; +- }else if( rc==SQLITE_BUSY ){ +- eMode2 = SQLITE_CHECKPOINT_PASSIVE; +- xBusy2 = 0; +- rc = SQLITE_OK; ++ /* IMPLEMENTATION-OF: R-59782-36818 The SQLITE_CHECKPOINT_FULL, RESTART and ++ ** TRUNCATE modes also obtain the exclusive "writer" lock on the database ++ ** file. ++ ** ++ ** EVIDENCE-OF: R-60642-04082 If the writer lock cannot be obtained ++ ** immediately, and a busy-handler is configured, it is invoked and the ++ ** writer lock retried until either the busy-handler returns 0 or the ++ ** lock is successfully obtained. ++ */ ++ if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){ ++ rc = walBusyLock(pWal, xBusy2, pBusyArg, WAL_WRITE_LOCK, 1); ++ if( rc==SQLITE_OK ){ ++ pWal->writeLock = 1; ++ }else if( rc==SQLITE_BUSY ){ ++ eMode2 = SQLITE_CHECKPOINT_PASSIVE; ++ xBusy2 = 0; ++ rc = SQLITE_OK; ++ } + } + } + ++ + /* Read the wal-index header. */ + if( rc==SQLITE_OK ){ ++ walDisableBlocking(pWal); + rc = walIndexReadHdr(pWal, &isChanged); ++ (void)walEnableBlocking(pWal); + if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){ + sqlite3OsUnfetch(pWal->pDbFd, 0, 0); + } +@@ -62864,11 +63097,19 @@ SQLITE_PRIVATE int sqlite3WalCheckpoint( + memset(&pWal->hdr, 0, sizeof(WalIndexHdr)); + } + ++ walDisableBlocking(pWal); ++ sqlite3WalDb(pWal, 0); ++ + /* Release the locks. */ + sqlite3WalEndWriteTransaction(pWal); +- walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1); +- pWal->ckptLock = 0; ++ if( pWal->ckptLock ){ ++ walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1); ++ pWal->ckptLock = 0; ++ } + WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok")); ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ if( rc==SQLITE_BUSY_TIMEOUT ) rc = SQLITE_BUSY; ++#endif + return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc); + } + +@@ -62985,7 +63226,10 @@ SQLITE_PRIVATE int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **ppSnapsho + + /* Try to open on pSnapshot when the next read-transaction starts + */ +-SQLITE_PRIVATE void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot){ ++SQLITE_PRIVATE void sqlite3WalSnapshotOpen( ++ Wal *pWal, ++ sqlite3_snapshot *pSnapshot ++){ + pWal->pSnapshot = (WalIndexHdr*)pSnapshot; + } + +@@ -63504,9 +63748,7 @@ struct BtShared { + #endif + u8 inTransaction; /* Transaction state */ + u8 max1bytePayload; /* Maximum first byte of cell for a 1-byte payload */ +-#ifdef SQLITE_HAS_CODEC +- u8 optimalReserve; /* Desired amount of reserved space per page */ +-#endif ++ u8 nReserveWanted; /* Desired number of extra bytes per page */ + u16 btsFlags; /* Boolean parameters. See BTS_* macros below */ + u16 maxLocal; /* Maximum local payload in non-LEAFDATA tables */ + u16 minLocal; /* Minimum local payload in non-LEAFDATA tables */ +@@ -64296,16 +64538,18 @@ static int hasSharedCacheTableLock( + ** table. */ + if( isIndex ){ + HashElem *p; ++ int bSeen = 0; + for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){ + Index *pIdx = (Index *)sqliteHashData(p); + if( pIdx->tnum==(int)iRoot ){ +- if( iTab ){ ++ if( bSeen ){ + /* Two or more indexes share the same root page. There must + ** be imposter tables. So just return true. The assert is not + ** useful in that case. */ + return 1; + } + iTab = pIdx->pTable->tnum; ++ bSeen = 1; + } + } + }else{ +@@ -64707,7 +64951,7 @@ static int btreeSetHasContent(BtShared *pBt, Pgno pgno){ + */ + static int btreeGetHasContent(BtShared *pBt, Pgno pgno){ + Bitvec *p = pBt->pHasContent; +- return (p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTest(p, pgno))); ++ return p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTestNotNull(p, pgno)); + } + + /* +@@ -65545,7 +65789,7 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){ + int sz2 = 0; + int sz = get2byte(&data[iFree+2]); + int top = get2byte(&data[hdr+5]); +- if( NEVER(top>=iFree) ){ ++ if( top>=iFree ){ + return SQLITE_CORRUPT_PAGE(pPage); + } + if( iFree2 ){ +@@ -65847,7 +66091,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ + nFrag = iFreeBlk - iEnd; + if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage); + iEnd = iFreeBlk + get2byte(&data[iFreeBlk+2]); +- if( NEVER(iEnd > pPage->pBt->usableSize) ){ ++ if( iEnd > pPage->pBt->usableSize ){ + return SQLITE_CORRUPT_PAGE(pPage); + } + iSize = iEnd - iStart; +@@ -65876,7 +66120,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ + ** so just extend the cell content area rather than create another + ** freelist entry */ + if( iStartdb ); + assert( sqlite3_mutex_held(pBt->db->mutex) ); +- return sqlite3InvokeBusyHandler(&pBt->db->busyHandler, +- sqlite3PagerFile(pBt->pPager)); ++ return sqlite3InvokeBusyHandler(&pBt->db->busyHandler); + } + + /* +@@ -66952,19 +67195,17 @@ SQLITE_PRIVATE int sqlite3BtreeSetPagerFlags( + */ + SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, int iFix){ + int rc = SQLITE_OK; ++ int x; + BtShared *pBt = p->pBt; +- assert( nReserve>=-1 && nReserve<=255 ); ++ assert( nReserve>=0 && nReserve<=255 ); + sqlite3BtreeEnter(p); +-#if SQLITE_HAS_CODEC +- if( nReserve>pBt->optimalReserve ) pBt->optimalReserve = (u8)nReserve; +-#endif ++ pBt->nReserveWanted = nReserve; ++ x = pBt->pageSize - pBt->usableSize; ++ if( nReservebtsFlags & BTS_PAGESIZE_FIXED ){ + sqlite3BtreeLeave(p); + return SQLITE_READONLY; + } +- if( nReserve<0 ){ +- nReserve = pBt->pageSize - pBt->usableSize; +- } + assert( nReserve>=0 && nReserve<=255 ); + if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && + ((pageSize-1)&pageSize)==0 ){ +@@ -67010,19 +67251,17 @@ SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p){ + ** are intentually left unused. This is the "reserved" space that is + ** sometimes used by extensions. + ** +-** If SQLITE_HAS_MUTEX is defined then the number returned is the +-** greater of the current reserved space and the maximum requested +-** reserve space. ++** The value returned is the larger of the current reserve size and ++** the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES. ++** The amount of reserve can only grow - never shrink. + */ +-SQLITE_PRIVATE int sqlite3BtreeGetOptimalReserve(Btree *p){ +- int n; ++SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){ ++ int n1, n2; + sqlite3BtreeEnter(p); +- n = sqlite3BtreeGetReserveNoMutex(p); +-#ifdef SQLITE_HAS_CODEC +- if( npBt->optimalReserve ) n = p->pBt->optimalReserve; +-#endif ++ n1 = (int)p->pBt->nReserveWanted; ++ n2 = sqlite3BtreeGetReserveNoMutex(p); + sqlite3BtreeLeave(p); +- return n; ++ return n1>n2 ? n1 : n2; + } + + +@@ -67472,6 +67711,7 @@ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p){ + */ + SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSchemaVersion){ + BtShared *pBt = p->pBt; ++ Pager *pPager = pBt->pPager; + int rc = SQLITE_OK; + + sqlite3BtreeEnter(p); +@@ -67487,7 +67727,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSchemaVers + assert( pBt->inTransaction==TRANS_WRITE || IfNotOmitAV(pBt->bDoTruncate)==0 ); + + if( (p->db->flags & SQLITE_ResetDatabase) +- && sqlite3PagerIsreadonly(pBt->pPager)==0 ++ && sqlite3PagerIsreadonly(pPager)==0 + ){ + pBt->btsFlags &= ~BTS_READ_ONLY; + } +@@ -67535,6 +67775,18 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSchemaVers + pBt->btsFlags &= ~BTS_INITIALLY_EMPTY; + if( pBt->nPage==0 ) pBt->btsFlags |= BTS_INITIALLY_EMPTY; + do { ++ sqlite3PagerWalDb(pPager, p->db); ++ ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ /* If transitioning from no transaction directly to a write transaction, ++ ** block for the WRITER lock first if possible. */ ++ if( pBt->pPage1==0 && wrflag ){ ++ assert( pBt->inTransaction==TRANS_NONE ); ++ rc = sqlite3PagerWalWriteLock(pPager, 1); ++ if( rc!=SQLITE_BUSY && rc!=SQLITE_OK ) break; ++ } ++#endif ++ + /* Call lockBtree() until either pBt->pPage1 is populated or + ** lockBtree() returns something other than SQLITE_OK. lockBtree() + ** may return SQLITE_OK but leave pBt->pPage1 set to 0 if after +@@ -67548,7 +67800,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSchemaVers + if( (pBt->btsFlags & BTS_READ_ONLY)!=0 ){ + rc = SQLITE_READONLY; + }else{ +- rc = sqlite3PagerBegin(pBt->pPager,wrflag>1,sqlite3TempInMemory(p->db)); ++ rc = sqlite3PagerBegin(pPager, wrflag>1, sqlite3TempInMemory(p->db)); + if( rc==SQLITE_OK ){ + rc = newDatabase(pBt); + }else if( rc==SQLITE_BUSY_SNAPSHOT && pBt->inTransaction==TRANS_NONE ){ +@@ -67561,11 +67813,15 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSchemaVers + } + + if( rc!=SQLITE_OK ){ ++ (void)sqlite3PagerWalWriteLock(pPager, 0); + unlockBtreeIfUnused(pBt); + } + }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && + btreeInvokeBusyHandler(pBt) ); +- sqlite3PagerResetLockTimeout(pBt->pPager); ++ sqlite3PagerWalDb(pPager, 0); ++#ifdef SQLITE_ENABLE_SETLK_TIMEOUT ++ if( rc==SQLITE_BUSY_TIMEOUT ) rc = SQLITE_BUSY; ++#endif + + if( rc==SQLITE_OK ){ + if( p->inTrans==TRANS_NONE ){ +@@ -67617,7 +67873,7 @@ trans_begun: + ** open savepoints. If the second parameter is greater than 0 and + ** the sub-journal is not already open, then it will be opened here. + */ +- rc = sqlite3PagerOpenSavepoint(pBt->pPager, p->db->nSavepoint); ++ rc = sqlite3PagerOpenSavepoint(pPager, p->db->nSavepoint); + } + } + +@@ -71253,7 +71509,7 @@ static int editPage( + assert( nCell>=0 ); + if( iOldnCell ) return SQLITE_CORRUPT_BKPT; ++ if( NEVER(nShift>nCell) ) return SQLITE_CORRUPT_BKPT; + memmove(pPg->aCellIdx, &pPg->aCellIdx[nShift*2], nCell*2); + nCell -= nShift; + } +@@ -73610,7 +73866,6 @@ SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){ + return rc; + } + +-#ifndef SQLITE_OMIT_BTREECOUNT + /* + ** The first argument, pCur, is a cursor opened on some b-tree. Count the + ** number of entries in the b-tree and write the result to *pnEntry. +@@ -73632,7 +73887,7 @@ SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3 *db, BtCursor *pCur, i64 *pnEntry){ + /* Unless an error occurs, the following loop runs one iteration for each + ** page in the B-Tree structure (not including overflow pages). + */ +- while( rc==SQLITE_OK && !db->u1.isInterrupted ){ ++ while( rc==SQLITE_OK && !AtomicLoad(&db->u1.isInterrupted) ){ + int iIdx; /* Index of child node in parent */ + MemPage *pPage; /* Current page of the b-tree */ + +@@ -73683,7 +73938,6 @@ SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3 *db, BtCursor *pCur, i64 *pnEntry){ + /* An error has occurred. Return an error code. */ + return rc; + } +-#endif + + /* + ** Return the pager associated with a BTree. This routine is used for +@@ -73758,7 +74012,7 @@ static int checkRef(IntegrityCk *pCheck, Pgno iPage){ + checkAppendMsg(pCheck, "2nd reference to page %d", iPage); + return 1; + } +- if( pCheck->db->u1.isInterrupted ) return 1; ++ if( AtomicLoad(&pCheck->db->u1.isInterrupted) ) return 1; + setPageReferenced(pCheck, iPage); + return 0; + } +@@ -74734,7 +74988,7 @@ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){ + */ + static int setDestPgsz(sqlite3_backup *p){ + int rc; +- rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),-1,0); ++ rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),0,0); + return rc; + } + +@@ -74857,13 +75111,6 @@ static int backupOnePage( + int nDestPgsz = sqlite3BtreeGetPageSize(p->pDest); + const int nCopy = MIN(nSrcPgsz, nDestPgsz); + const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz; +-#ifdef SQLITE_HAS_CODEC +- /* Use BtreeGetReserveNoMutex() for the source b-tree, as although it is +- ** guaranteed that the shared-mutex is held by this thread, handle +- ** p->pSrc may not actually be the owner. */ +- int nSrcReserve = sqlite3BtreeGetReserveNoMutex(p->pSrc); +- int nDestReserve = sqlite3BtreeGetOptimalReserve(p->pDest); +-#endif + int rc = SQLITE_OK; + i64 iOff; + +@@ -74880,26 +75127,6 @@ static int backupOnePage( + rc = SQLITE_READONLY; + } + +-#ifdef SQLITE_HAS_CODEC +- /* Backup is not possible if the page size of the destination is changing +- ** and a codec is in use. +- */ +- if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){ +- rc = SQLITE_READONLY; +- } +- +- /* Backup is not possible if the number of bytes of reserve space differ +- ** between source and destination. If there is a difference, try to +- ** fix the destination to agree with the source. If that is not possible, +- ** then the backup cannot proceed. +- */ +- if( nSrcReserve!=nDestReserve ){ +- u32 newPgsz = nSrcPgsz; +- rc = sqlite3PagerSetPagesize(pDestPager, &newPgsz, nSrcReserve); +- if( rc==SQLITE_OK && newPgsz!=(u32)nSrcPgsz ) rc = SQLITE_READONLY; +- } +-#endif +- + /* This loop runs once for each destination page spanned by the source + ** page. For each iteration, variable iOff is set to the byte offset + ** of the destination page. +@@ -75395,10 +75622,6 @@ SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ + b.pDest = pTo; + b.iNext = 1; + +-#ifdef SQLITE_HAS_CODEC +- sqlite3PagerAlignReserve(sqlite3BtreePager(pTo), sqlite3BtreePager(pFrom)); +-#endif +- + /* 0x7FFFFFFF is the hard limit for the number of pages in a database + ** file. By passing this as the number of pages to copy to + ** sqlite3_backup_step(), we can guarantee that the copy finishes +@@ -76388,7 +76611,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){ + sqlite3DebugPrintf("Invalidate R[%d] due to change in R[%d]\n", + (int)(pX - pVdbe->aMem), (int)(pMem - pVdbe->aMem)); + } +- /* If pX is marked as a shallow copy of pMem, then verify that ++ /* If pX is marked as a shallow copy of pMem, then try to verify that + ** no significant changes have been made to pX since the OP_SCopy. + ** A significant change would indicated a missed call to this + ** function for pX. Minor changes, such as adding or removing a +@@ -76396,11 +76619,6 @@ SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){ + ** same. */ + mFlags = pMem->flags & pX->flags & pX->mScopyFlags; + assert( (mFlags&(MEM_Int|MEM_IntReal))==0 || pMem->u.i==pX->u.i ); +- /* assert( (mFlags&MEM_Real)==0 || pMem->u.r==pX->u.r ); */ +- /* ^^ */ +- /* Cannot reliably compare doubles for equality */ +- assert( (mFlags&MEM_Str)==0 || (pMem->n==pX->n && pMem->z==pX->z) ); +- assert( (mFlags&MEM_Blob)==0 || sqlite3BlobCompare(pMem,pX)==0 ); + + /* pMem is the register that is changing. But also mark pX as + ** undefined so that we can quickly detect the shallow-copy error */ +@@ -76596,7 +76814,7 @@ SQLITE_PRIVATE int sqlite3VdbeMemSetStr( + ** If this routine fails for any reason (malloc returns NULL or unable + ** to read from the disk) then the pMem is left in an inconsistent state. + */ +-static SQLITE_NOINLINE int vdbeMemFromBtreeResize( ++SQLITE_PRIVATE int sqlite3VdbeMemFromBtree( + BtCursor *pCur, /* Cursor pointing at record to retrieve. */ + u32 offset, /* Offset from the start of data to return bytes from. */ + u32 amt, /* Number of bytes to return. */ +@@ -76619,13 +76837,11 @@ static SQLITE_NOINLINE int vdbeMemFromBtreeResize( + } + return rc; + } +-SQLITE_PRIVATE int sqlite3VdbeMemFromBtree( ++SQLITE_PRIVATE int sqlite3VdbeMemFromBtreeZeroOffset( + BtCursor *pCur, /* Cursor pointing at record to retrieve. */ +- u32 offset, /* Offset from the start of data to return bytes from. */ + u32 amt, /* Number of bytes to return. */ + Mem *pMem /* OUT: Return data in this Mem structure. */ + ){ +- char *zData; /* Data from the btree layer */ + u32 available = 0; /* Number of bytes available on the local btree page */ + int rc = SQLITE_OK; /* Return code */ + +@@ -76635,15 +76851,14 @@ SQLITE_PRIVATE int sqlite3VdbeMemFromBtree( + /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() + ** that both the BtShared and database handle mutexes are held. */ + assert( !sqlite3VdbeMemIsRowSet(pMem) ); +- zData = (char *)sqlite3BtreePayloadFetch(pCur, &available); +- assert( zData!=0 ); ++ pMem->z = (char *)sqlite3BtreePayloadFetch(pCur, &available); ++ assert( pMem->z!=0 ); + +- if( offset+amt<=available ){ +- pMem->z = &zData[offset]; ++ if( amt<=available ){ + pMem->flags = MEM_Blob|MEM_Ephem; + pMem->n = (int)amt; + }else{ +- rc = vdbeMemFromBtreeResize(pCur, offset, amt, pMem); ++ rc = sqlite3VdbeMemFromBtree(pCur, 0, amt, pMem); + } + + return rc; +@@ -77758,7 +77973,7 @@ SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char *z1, const char *z2){ + #endif + + /* +-** Add a new OP_ opcode. ++** Add a new OP_Explain opcode. + ** + ** If the bPush flag is true, then make this opcode the parent for + ** subsequent Explains until sqlite3VdbeExplainPop() is called. +@@ -78399,6 +78614,34 @@ SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){ + sqlite3VdbeChangeP2(p, addr, p->nOp); + } + ++/* ++** Change the P2 operand of the jump instruction at addr so that ++** the jump lands on the next opcode. Or if the jump instruction was ++** the previous opcode (and is thus a no-op) then simply back up ++** the next instruction counter by one slot so that the jump is ++** overwritten by the next inserted opcode. ++** ++** This routine is an optimization of sqlite3VdbeJumpHere() that ++** strives to omit useless byte-code like this: ++** ++** 7 Once 0 8 0 ++** 8 ... ++*/ ++SQLITE_PRIVATE void sqlite3VdbeJumpHereOrPopInst(Vdbe *p, int addr){ ++ if( addr==p->nOp-1 ){ ++ assert( p->aOp[addr].opcode==OP_Once ++ || p->aOp[addr].opcode==OP_If ++ || p->aOp[addr].opcode==OP_FkIfZero ); ++ assert( p->aOp[addr].p4type==0 ); ++#ifdef SQLITE_VDBE_COVERAGE ++ sqlite3VdbeGetOp(p,-1)->iSrcLine = 0; /* Erase VdbeCoverage() macros */ ++#endif ++ p->nOp--; ++ }else{ ++ sqlite3VdbeChangeP2(p, addr, p->nOp); ++ } ++} ++ + + /* + ** If the input FuncDef structure is ephemeral, then free it. If +@@ -78770,17 +79013,19 @@ static int translateP(char c, const Op *pOp){ + ** "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0 + ** "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x + */ +-static int displayComment( ++SQLITE_PRIVATE char *sqlite3VdbeDisplayComment( ++ sqlite3 *db, /* Optional - Oom error reporting only */ + const Op *pOp, /* The opcode to be commented */ +- const char *zP4, /* Previously obtained value for P4 */ +- char *zTemp, /* Write result here */ +- int nTemp /* Space available in zTemp[] */ ++ const char *zP4 /* Previously obtained value for P4 */ + ){ + const char *zOpName; + const char *zSynopsis; + int nOpName; +- int ii, jj; ++ int ii; + char zAlt[50]; ++ StrAccum x; ++ ++ sqlite3StrAccumInit(&x, 0, 0, 0, SQLITE_MAX_LENGTH); + zOpName = sqlite3OpcodeName(pOp->opcode); + nOpName = sqlite3Strlen30(zOpName); + if( zOpName[nOpName+1] ){ +@@ -78795,53 +79040,64 @@ static int displayComment( + } + zSynopsis = zAlt; + } +- for(ii=jj=0; jjzComment); ++ sqlite3_str_appendall(&x, pOp->zComment); + seenCom = 1; + }else{ + int v1 = translateP(c, pOp); + int v2; +- sqlite3_snprintf(nTemp-jj, zTemp+jj, "%d", v1); + if( strncmp(zSynopsis+ii+1, "@P", 2)==0 ){ + ii += 3; +- jj += sqlite3Strlen30(zTemp+jj); + v2 = translateP(zSynopsis[ii], pOp); + if( strncmp(zSynopsis+ii+1,"+1",2)==0 ){ + ii += 2; + v2++; + } +- if( v2>1 ){ +- sqlite3_snprintf(nTemp-jj, zTemp+jj, "..%d", v1+v2-1); ++ if( v2<2 ){ ++ sqlite3_str_appendf(&x, "%d", v1); ++ }else{ ++ sqlite3_str_appendf(&x, "%d..%d", v1, v1+v2-1); ++ } ++ }else if( strncmp(zSynopsis+ii+1, "@NP", 3)==0 ){ ++ sqlite3_context *pCtx = pOp->p4.pCtx; ++ if( pOp->p4type!=P4_FUNCCTX || pCtx->argc==1 ){ ++ sqlite3_str_appendf(&x, "%d", v1); ++ }else if( pCtx->argc>1 ){ ++ sqlite3_str_appendf(&x, "%d..%d", v1, v1+pCtx->argc-1); ++ }else{ ++ assert( x.nChar>2 ); ++ x.nChar -= 2; ++ ii++; ++ } ++ ii += 3; ++ }else{ ++ sqlite3_str_appendf(&x, "%d", v1); ++ if( strncmp(zSynopsis+ii+1, "..P3", 4)==0 && pOp->p3==0 ){ ++ ii += 4; + } +- }else if( strncmp(zSynopsis+ii+1, "..P3", 4)==0 && pOp->p3==0 ){ +- ii += 4; + } + } +- jj += sqlite3Strlen30(zTemp+jj); + }else{ +- zTemp[jj++] = c; ++ sqlite3_str_appendchar(&x, 1, c); + } + } +- if( !seenCom && jjzComment ){ +- sqlite3_snprintf(nTemp-jj, zTemp+jj, "; %s", pOp->zComment); +- jj += sqlite3Strlen30(zTemp+jj); ++ if( !seenCom && pOp->zComment ){ ++ sqlite3_str_appendf(&x, "; %s", pOp->zComment); + } +- if( jjzComment ){ +- sqlite3_snprintf(nTemp, zTemp, "%s", pOp->zComment); +- jj = sqlite3Strlen30(zTemp); +- }else{ +- zTemp[0] = 0; +- jj = 0; ++ sqlite3_str_appendall(&x, pOp->zComment); ++ } ++ if( (x.accError & SQLITE_NOMEM)!=0 && db!=0 ){ ++ sqlite3OomFault(db); + } +- return jj; ++ return sqlite3StrAccumFinish(&x); + } +-#endif /* SQLITE_DEBUG */ ++#endif /* SQLITE_ENABLE_EXPLAIN_COMMENTS */ + + #if VDBE_DISPLAY_P4 && defined(SQLITE_ENABLE_CURSOR_HINTS) + /* +@@ -78922,11 +79178,11 @@ static void displayP4Expr(StrAccum *p, Expr *pExpr){ + ** Compute a string that describes the P4 parameter for an opcode. + ** Use zTemp for any required temporary buffer space. + */ +-static char *displayP4(Op *pOp, char *zTemp, int nTemp){ +- char *zP4 = zTemp; ++SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3 *db, Op *pOp){ ++ char *zP4 = 0; + StrAccum x; +- assert( nTemp>=20 ); +- sqlite3StrAccumInit(&x, 0, zTemp, nTemp, 0); ++ ++ sqlite3StrAccumInit(&x, 0, 0, 0, SQLITE_MAX_LENGTH); + switch( pOp->p4type ){ + case P4_KEYINFO: { + int j; +@@ -78952,8 +79208,11 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){ + } + #endif + case P4_COLLSEQ: { ++ static const char *const encnames[] = {"?", "8", "16LE", "16BE"}; + CollSeq *pColl = pOp->p4.pColl; +- sqlite3_str_appendf(&x, "(%.20s)", pColl->zName); ++ assert( pColl->enc>=0 && pColl->enc<4 ); ++ sqlite3_str_appendf(&x, "%.18s-%s", pColl->zName, ++ encnames[pColl->enc]); + break; + } + case P4_FUNCDEF: { +@@ -79007,36 +79266,32 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){ + int n = ai[0]; /* The first element of an INTARRAY is always the + ** count of the number of elements to follow */ + for(i=1; i<=n; i++){ +- sqlite3_str_appendf(&x, ",%d", ai[i]); ++ sqlite3_str_appendf(&x, "%c%d", (i==1 ? '[' : ','), ai[i]); + } +- zTemp[0] = '['; + sqlite3_str_append(&x, "]", 1); + break; + } + case P4_SUBPROGRAM: { +- sqlite3_str_appendf(&x, "program"); ++ zP4 = "program"; + break; + } + case P4_DYNBLOB: + case P4_ADVANCE: { +- zTemp[0] = 0; + break; + } + case P4_TABLE: { +- sqlite3_str_appendf(&x, "%s", pOp->p4.pTab->zName); ++ zP4 = pOp->p4.pTab->zName; + break; + } + default: { + zP4 = pOp->p4.z; +- if( zP4==0 ){ +- zP4 = zTemp; +- zTemp[0] = 0; +- } + } + } +- sqlite3StrAccumFinish(&x); +- assert( zP4!=0 ); +- return zP4; ++ if( zP4 ) sqlite3_str_appendall(&x, zP4); ++ if( (x.accError & SQLITE_NOMEM)!=0 ){ ++ sqlite3OomFault(db); ++ } ++ return sqlite3StrAccumFinish(&x); + } + #endif /* VDBE_DISPLAY_P4 */ + +@@ -79126,24 +79381,30 @@ SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){ + */ + SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, VdbeOp *pOp){ + char *zP4; +- char zPtr[50]; +- char zCom[100]; ++ char *zCom; ++ sqlite3 dummyDb; + static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-13s %.2X %s\n"; + if( pOut==0 ) pOut = stdout; +- zP4 = displayP4(pOp, zPtr, sizeof(zPtr)); ++ sqlite3BeginBenignMalloc(); ++ dummyDb.mallocFailed = 1; ++ zP4 = sqlite3VdbeDisplayP4(&dummyDb, pOp); + #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS +- displayComment(pOp, zP4, zCom, sizeof(zCom)); ++ zCom = sqlite3VdbeDisplayComment(0, pOp, zP4); + #else +- zCom[0] = 0; ++ zCom = 0; + #endif + /* NB: The sqlite3OpcodeName() function is implemented by code created + ** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the + ** information from the vdbe.c source text */ + fprintf(pOut, zFormat1, pc, +- sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5, +- zCom ++ sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, ++ zP4 ? zP4 : "", pOp->p5, ++ zCom ? zCom : "" + ); + fflush(pOut); ++ sqlite3_free(zP4); ++ sqlite3_free(zCom); ++ sqlite3EndBenignMalloc(); + } + #endif + +@@ -79234,74 +79495,29 @@ SQLITE_PRIVATE void sqlite3VdbeFrameMemDel(void *pArg){ + pFrame->v->pDelFrame = pFrame; + } + +- +-/* +-** Delete a VdbeFrame object and its contents. VdbeFrame objects are +-** allocated by the OP_Program opcode in sqlite3VdbeExec(). +-*/ +-SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame *p){ +- int i; +- Mem *aMem = VdbeFrameMem(p); +- VdbeCursor **apCsr = (VdbeCursor **)&aMem[p->nChildMem]; +- assert( sqlite3VdbeFrameIsValid(p) ); +- for(i=0; inChildCsr; i++){ +- sqlite3VdbeFreeCursor(p->v, apCsr[i]); +- } +- releaseMemArray(aMem, p->nChildMem); +- sqlite3VdbeDeleteAuxData(p->v->db, &p->pAuxData, -1, 0); +- sqlite3DbFree(p->v->db, p); +-} +- +-#ifndef SQLITE_OMIT_EXPLAIN ++#if defined(SQLITE_ENABLE_BYTECODE_VTAB) || !defined(SQLITE_OMIT_EXPLAIN) + /* +-** Give a listing of the program in the virtual machine. +-** +-** The interface is the same as sqlite3VdbeExec(). But instead of +-** running the code, it invokes the callback once for each instruction. +-** This feature is used to implement "EXPLAIN". +-** +-** When p->explain==1, each instruction is listed. When +-** p->explain==2, only OP_Explain instructions are listed and these +-** are shown in a different format. p->explain==2 is used to implement +-** EXPLAIN QUERY PLAN. +-** 2018-04-24: In p->explain==2 mode, the OP_Init opcodes of triggers +-** are also shown, so that the boundaries between the main program and +-** each trigger are clear. ++** Locate the next opcode to be displayed in EXPLAIN or EXPLAIN ++** QUERY PLAN output. + ** +-** When p->explain==1, first the main program is listed, then each of +-** the trigger subprograms are listed one by one. ++** Return SQLITE_ROW on success. Return SQLITE_DONE if there are no ++** more opcodes to be displayed. + */ +-SQLITE_PRIVATE int sqlite3VdbeList( +- Vdbe *p /* The VDBE */ ++SQLITE_PRIVATE int sqlite3VdbeNextOpcode( ++ Vdbe *p, /* The statement being explained */ ++ Mem *pSub, /* Storage for keeping track of subprogram nesting */ ++ int eMode, /* 0: normal. 1: EQP. 2: TablesUsed */ ++ int *piPc, /* IN/OUT: Current rowid. Overwritten with next rowid */ ++ int *piAddr, /* OUT: Write index into (*paOp)[] here */ ++ Op **paOp /* OUT: Write the opcode array here */ + ){ + int nRow; /* Stop when row count reaches this */ + int nSub = 0; /* Number of sub-vdbes seen so far */ + SubProgram **apSub = 0; /* Array of sub-vdbes */ +- Mem *pSub = 0; /* Memory cell hold array of subprogs */ +- sqlite3 *db = p->db; /* The database connection */ +- int i; /* Loop counter */ +- int rc = SQLITE_OK; /* Return code */ +- Mem *pMem = &p->aMem[1]; /* First Mem of result set */ +- int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0); +- Op *pOp = 0; +- +- assert( p->explain ); +- assert( p->magic==VDBE_MAGIC_RUN ); +- assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); +- +- /* Even though this opcode does not use dynamic strings for +- ** the result, result columns may become dynamic if the user calls +- ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. +- */ +- releaseMemArray(pMem, 8); +- p->pResultSet = 0; +- +- if( p->rc==SQLITE_NOMEM ){ +- /* This happens if a malloc() inside a call to sqlite3_column_text() or +- ** sqlite3_column_text16() failed. */ +- sqlite3OomFault(db); +- return SQLITE_ERROR; +- } ++ int i; /* Next instruction address */ ++ int rc = SQLITE_OK; /* Result code */ ++ Op *aOp = 0; /* Opcode array */ ++ int iPc; /* Rowid. Copy of value in *piPc */ + + /* When the number of output rows reaches nRow, that means the + ** listing has finished and sqlite3_step() should return SQLITE_DONE. +@@ -79311,16 +79527,10 @@ SQLITE_PRIVATE int sqlite3VdbeList( + ** encountered, but p->pc will eventually catch up to nRow. + */ + nRow = p->nOp; +- if( bListSubprogs ){ +- /* The first 8 memory cells are used for the result set. So we will +- ** commandeer the 9th cell to use as storage for an array of pointers +- ** to trigger subprograms. The VDBE is guaranteed to have at least 9 +- ** cells. */ +- assert( p->nMem>9 ); +- pSub = &p->aMem[9]; ++ if( pSub!=0 ){ + if( pSub->flags&MEM_Blob ){ +- /* On the first call to sqlite3_step(), pSub will hold a NULL. It is +- ** initialized to a BLOB by the P4_SUBPROGRAM processing logic below */ ++ /* pSub is initiallly NULL. It is initialized to a BLOB by ++ ** the P4_SUBPROGRAM processing logic below */ + nSub = pSub->n/sizeof(Vdbe*); + apSub = (SubProgram **)pSub->z; + } +@@ -79328,18 +79538,18 @@ SQLITE_PRIVATE int sqlite3VdbeList( + nRow += apSub[i]->nOp; + } + } +- ++ iPc = *piPc; + while(1){ /* Loop exits via break */ +- i = p->pc++; ++ i = iPc++; + if( i>=nRow ){ + p->rc = SQLITE_OK; + rc = SQLITE_DONE; + break; + } + if( inOp ){ +- /* The output line number is small enough that we are still in the ++ /* The rowid is small enough that we are still in the + ** main program. */ +- pOp = &p->aOp[i]; ++ aOp = p->aOp; + }else{ + /* We are currently listing subprograms. Figure out which one and + ** pick up the appropriate opcode. */ +@@ -79351,7 +79561,7 @@ SQLITE_PRIVATE int sqlite3VdbeList( + i -= apSub[j]->nOp; + assert( inOp || j+1aOp[i]; ++ aOp = apSub[j]->aOp; + } + + /* When an OP_Program opcode is encounter (the only opcode that has +@@ -79359,11 +79569,11 @@ SQLITE_PRIVATE int sqlite3VdbeList( + ** kept in p->aMem[9].z to hold the new program - assuming this subprogram + ** has not already been seen. + */ +- if( bListSubprogs && pOp->p4type==P4_SUBPROGRAM ){ ++ if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){ + int nByte = (nSub+1)*sizeof(SubProgram*); + int j; + for(j=0; jp4.pProgram ) break; ++ if( apSub[j]==aOp[i].p4.pProgram ) break; + } + if( j==nSub ){ + p->rc = sqlite3VdbeMemGrow(pSub, nByte, nSub!=0); +@@ -79372,93 +79582,157 @@ SQLITE_PRIVATE int sqlite3VdbeList( + break; + } + apSub = (SubProgram **)pSub->z; +- apSub[nSub++] = pOp->p4.pProgram; +- pSub->flags |= MEM_Blob; ++ apSub[nSub++] = aOp[i].p4.pProgram; ++ MemSetTypeFlag(pSub, MEM_Blob); + pSub->n = nSub*sizeof(SubProgram*); +- nRow += pOp->p4.pProgram->nOp; ++ nRow += aOp[i].p4.pProgram->nOp; + } + } +- if( p->explain<2 ) break; +- if( pOp->opcode==OP_Explain ) break; +- if( pOp->opcode==OP_Init && p->pc>1 ) break; ++ if( eMode==0 ) break; ++#ifdef SQLITE_ENABLE_BYTECODE_VTAB ++ if( eMode==2 ){ ++ Op *pOp = aOp + i; ++ if( pOp->opcode==OP_OpenRead ) break; ++ if( pOp->opcode==OP_OpenWrite && (pOp->p5 & OPFLAG_P2ISREG)==0 ) break; ++ if( pOp->opcode==OP_ReopenIdx ) break; ++ }else ++#endif ++ { ++ assert( eMode==1 ); ++ if( aOp[i].opcode==OP_Explain ) break; ++ if( aOp[i].opcode==OP_Init && iPc>1 ) break; ++ } ++ } ++ *piPc = iPc; ++ *piAddr = i; ++ *paOp = aOp; ++ return rc; ++} ++#endif /* SQLITE_ENABLE_BYTECODE_VTAB || !SQLITE_OMIT_EXPLAIN */ ++ ++ ++/* ++** Delete a VdbeFrame object and its contents. VdbeFrame objects are ++** allocated by the OP_Program opcode in sqlite3VdbeExec(). ++*/ ++SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame *p){ ++ int i; ++ Mem *aMem = VdbeFrameMem(p); ++ VdbeCursor **apCsr = (VdbeCursor **)&aMem[p->nChildMem]; ++ assert( sqlite3VdbeFrameIsValid(p) ); ++ for(i=0; inChildCsr; i++){ ++ sqlite3VdbeFreeCursor(p->v, apCsr[i]); ++ } ++ releaseMemArray(aMem, p->nChildMem); ++ sqlite3VdbeDeleteAuxData(p->v->db, &p->pAuxData, -1, 0); ++ sqlite3DbFree(p->v->db, p); ++} ++ ++#ifndef SQLITE_OMIT_EXPLAIN ++/* ++** Give a listing of the program in the virtual machine. ++** ++** The interface is the same as sqlite3VdbeExec(). But instead of ++** running the code, it invokes the callback once for each instruction. ++** This feature is used to implement "EXPLAIN". ++** ++** When p->explain==1, each instruction is listed. When ++** p->explain==2, only OP_Explain instructions are listed and these ++** are shown in a different format. p->explain==2 is used to implement ++** EXPLAIN QUERY PLAN. ++** 2018-04-24: In p->explain==2 mode, the OP_Init opcodes of triggers ++** are also shown, so that the boundaries between the main program and ++** each trigger are clear. ++** ++** When p->explain==1, first the main program is listed, then each of ++** the trigger subprograms are listed one by one. ++*/ ++SQLITE_PRIVATE int sqlite3VdbeList( ++ Vdbe *p /* The VDBE */ ++){ ++ Mem *pSub = 0; /* Memory cell hold array of subprogs */ ++ sqlite3 *db = p->db; /* The database connection */ ++ int i; /* Loop counter */ ++ int rc = SQLITE_OK; /* Return code */ ++ Mem *pMem = &p->aMem[1]; /* First Mem of result set */ ++ int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0); ++ Op *aOp; /* Array of opcodes */ ++ Op *pOp; /* Current opcode */ ++ ++ assert( p->explain ); ++ assert( p->magic==VDBE_MAGIC_RUN ); ++ assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); ++ ++ /* Even though this opcode does not use dynamic strings for ++ ** the result, result columns may become dynamic if the user calls ++ ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. ++ */ ++ releaseMemArray(pMem, 8); ++ p->pResultSet = 0; ++ ++ if( p->rc==SQLITE_NOMEM ){ ++ /* This happens if a malloc() inside a call to sqlite3_column_text() or ++ ** sqlite3_column_text16() failed. */ ++ sqlite3OomFault(db); ++ return SQLITE_ERROR; ++ } ++ ++ if( bListSubprogs ){ ++ /* The first 8 memory cells are used for the result set. So we will ++ ** commandeer the 9th cell to use as storage for an array of pointers ++ ** to trigger subprograms. The VDBE is guaranteed to have at least 9 ++ ** cells. */ ++ assert( p->nMem>9 ); ++ pSub = &p->aMem[9]; ++ }else{ ++ pSub = 0; + } + ++ /* Figure out which opcode is next to display */ ++ rc = sqlite3VdbeNextOpcode(p, pSub, p->explain==2, &p->pc, &i, &aOp); ++ + if( rc==SQLITE_OK ){ +- if( db->u1.isInterrupted ){ ++ pOp = aOp + i; ++ if( AtomicLoad(&db->u1.isInterrupted) ){ + p->rc = SQLITE_INTERRUPT; + rc = SQLITE_ERROR; + sqlite3VdbeError(p, sqlite3ErrStr(p->rc)); + }else{ +- char *zP4; +- if( p->explain==1 ){ +- pMem->flags = MEM_Int; +- pMem->u.i = i; /* Program counter */ +- pMem++; +- +- pMem->flags = MEM_Static|MEM_Str|MEM_Term; +- pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */ +- assert( pMem->z!=0 ); +- pMem->n = sqlite3Strlen30(pMem->z); +- pMem->enc = SQLITE_UTF8; +- pMem++; +- } +- +- pMem->flags = MEM_Int; +- pMem->u.i = pOp->p1; /* P1 */ +- pMem++; +- +- pMem->flags = MEM_Int; +- pMem->u.i = pOp->p2; /* P2 */ +- pMem++; +- +- pMem->flags = MEM_Int; +- pMem->u.i = pOp->p3; /* P3 */ +- pMem++; +- +- if( sqlite3VdbeMemClearAndResize(pMem, 100) ){ /* P4 */ +- assert( p->db->mallocFailed ); +- return SQLITE_ERROR; +- } +- pMem->flags = MEM_Str|MEM_Term; +- zP4 = displayP4(pOp, pMem->z, pMem->szMalloc); +- if( zP4!=pMem->z ){ +- pMem->n = 0; +- sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0); ++ char *zP4 = sqlite3VdbeDisplayP4(db, pOp); ++ if( p->explain==2 ){ ++ sqlite3VdbeMemSetInt64(pMem, pOp->p1); ++ sqlite3VdbeMemSetInt64(pMem+1, pOp->p2); ++ sqlite3VdbeMemSetInt64(pMem+2, pOp->p3); ++ sqlite3VdbeMemSetStr(pMem+3, zP4, -1, SQLITE_UTF8, sqlite3_free); ++ p->nResColumn = 4; + }else{ +- assert( pMem->z!=0 ); +- pMem->n = sqlite3Strlen30(pMem->z); +- pMem->enc = SQLITE_UTF8; +- } +- pMem++; +- +- if( p->explain==1 ){ +- if( sqlite3VdbeMemClearAndResize(pMem, 4) ){ +- assert( p->db->mallocFailed ); +- return SQLITE_ERROR; +- } +- pMem->flags = MEM_Str|MEM_Term; +- pMem->n = 2; +- sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */ +- pMem->enc = SQLITE_UTF8; +- pMem++; +- ++ sqlite3VdbeMemSetInt64(pMem+0, i); ++ sqlite3VdbeMemSetStr(pMem+1, (char*)sqlite3OpcodeName(pOp->opcode), ++ -1, SQLITE_UTF8, SQLITE_STATIC); ++ sqlite3VdbeMemSetInt64(pMem+2, pOp->p1); ++ sqlite3VdbeMemSetInt64(pMem+3, pOp->p2); ++ sqlite3VdbeMemSetInt64(pMem+4, pOp->p3); ++ /* pMem+5 for p4 is done last */ ++ sqlite3VdbeMemSetInt64(pMem+6, pOp->p5); + #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS +- if( sqlite3VdbeMemClearAndResize(pMem, 500) ){ +- assert( p->db->mallocFailed ); +- return SQLITE_ERROR; ++ { ++ char *zCom = sqlite3VdbeDisplayComment(db, pOp, zP4); ++ sqlite3VdbeMemSetStr(pMem+7, zCom, -1, SQLITE_UTF8, sqlite3_free); + } +- pMem->flags = MEM_Str|MEM_Term; +- pMem->n = displayComment(pOp, zP4, pMem->z, 500); +- pMem->enc = SQLITE_UTF8; + #else +- pMem->flags = MEM_Null; /* Comment */ ++ sqlite3VdbeMemSetNull(pMem+7); + #endif ++ sqlite3VdbeMemSetStr(pMem+5, zP4, -1, SQLITE_UTF8, sqlite3_free); ++ p->nResColumn = 8; ++ } ++ p->pResultSet = pMem; ++ if( db->mallocFailed ){ ++ p->rc = SQLITE_NOMEM; ++ rc = SQLITE_ERROR; ++ }else{ ++ p->rc = SQLITE_OK; ++ rc = SQLITE_ROW; + } +- +- p->nResColumn = 8 - 4*(p->explain-1); +- p->pResultSet = &p->aMem[1]; +- p->rc = SQLITE_OK; +- rc = SQLITE_ROW; + } + } + return rc; +@@ -79666,6 +79940,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( + }; + int iFirst, mx, i; + if( nMem<10 ) nMem = 10; ++ p->explain = pParse->explain; + if( pParse->explain==2 ){ + sqlite3VdbeSetNumCols(p, 4); + iFirst = 8; +@@ -79716,7 +79991,6 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( + + p->pVList = pParse->pVList; + pParse->pVList = 0; +- p->explain = pParse->explain; + if( db->mallocFailed ){ + p->nVar = 0; + p->nCursor = 0; +@@ -80028,8 +80302,9 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ + + /* Select a master journal file name */ + nMainFile = sqlite3Strlen30(zMainFile); +- zMaster = sqlite3MPrintf(db, "%s-mjXXXXXX9XXz%c%c", zMainFile, 0, 0); ++ zMaster = sqlite3MPrintf(db, "%.4c%s%.16c", 0,zMainFile,0); + if( zMaster==0 ) return SQLITE_NOMEM_BKPT; ++ zMaster += 4; + do { + u32 iRandom; + if( retryCount ){ +@@ -80059,7 +80334,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ + ); + } + if( rc!=SQLITE_OK ){ +- sqlite3DbFree(db, zMaster); ++ sqlite3DbFree(db, zMaster-4); + return rc; + } + +@@ -80082,7 +80357,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ + if( rc!=SQLITE_OK ){ + sqlite3OsCloseFree(pMaster); + sqlite3OsDelete(pVfs, zMaster, 0); +- sqlite3DbFree(db, zMaster); ++ sqlite3DbFree(db, zMaster-4); + return rc; + } + } +@@ -80096,7 +80371,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ + ){ + sqlite3OsCloseFree(pMaster); + sqlite3OsDelete(pVfs, zMaster, 0); +- sqlite3DbFree(db, zMaster); ++ sqlite3DbFree(db, zMaster-4); + return rc; + } + +@@ -80119,7 +80394,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ + sqlite3OsCloseFree(pMaster); + assert( rc!=SQLITE_BUSY ); + if( rc!=SQLITE_OK ){ +- sqlite3DbFree(db, zMaster); ++ sqlite3DbFree(db, zMaster-4); + return rc; + } + +@@ -80128,7 +80403,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ + ** transaction files are deleted. + */ + rc = sqlite3OsDelete(pVfs, zMaster, 1); +- sqlite3DbFree(db, zMaster); ++ sqlite3DbFree(db, zMaster-4); + zMaster = 0; + if( rc ){ + return rc; +@@ -80834,7 +81109,7 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor **pp, int *piCol){ + assert( p->eCurType==CURTYPE_BTREE || p->eCurType==CURTYPE_PSEUDO ); + if( p->deferredMoveto ){ + int iMap; +- if( p->aAltMap && (iMap = p->aAltMap[1+*piCol])>0 ){ ++ if( p->aAltMap && (iMap = p->aAltMap[1+*piCol])>0 && !p->nullRow ){ + *pp = p->pAltCursor; + *piCol = iMap - 1; + return SQLITE_OK; +@@ -81837,7 +82112,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( + + /* RHS is a string */ + else if( pRhs->flags & MEM_Str ){ +- getVarint32(&aKey1[idx1], serial_type); ++ getVarint32NR(&aKey1[idx1], serial_type); + testcase( serial_type==12 ); + if( serial_type<12 ){ + rc = -1; +@@ -81871,7 +82146,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( + /* RHS is a blob */ + else if( pRhs->flags & MEM_Blob ){ + assert( (pRhs->flags & MEM_Zero)==0 || pRhs->n==0 ); +- getVarint32(&aKey1[idx1], serial_type); ++ getVarint32NR(&aKey1[idx1], serial_type); + testcase( serial_type==12 ); + if( serial_type<12 || (serial_type & 0x01) ){ + rc = -1; +@@ -82060,7 +82335,10 @@ static int vdbeRecordCompareString( + + assert( pPKey2->aMem[0].flags & MEM_Str ); + vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo); +- getVarint32(&aKey1[1], serial_type); ++ serial_type = (u8)(aKey1[1]); ++ if( serial_type >= 0x80 ){ ++ sqlite3GetVarint32(&aKey1[1], (u32*)&serial_type); ++ } + if( serial_type<12 ){ + res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ + }else if( !(serial_type & 0x01) ){ +@@ -82181,13 +82459,13 @@ SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){ + + /* Read in the complete content of the index entry */ + sqlite3VdbeMemInit(&m, db, 0); +- rc = sqlite3VdbeMemFromBtree(pCur, 0, (u32)nCellKey, &m); ++ rc = sqlite3VdbeMemFromBtreeZeroOffset(pCur, (u32)nCellKey, &m); + if( rc ){ + return rc; + } + + /* The index entry must begin with a header size */ +- (void)getVarint32((u8*)m.z, szHdr); ++ getVarint32NR((u8*)m.z, szHdr); + testcase( szHdr==3 ); + testcase( szHdr==m.n ); + testcase( szHdr>0x7fffffff ); +@@ -82198,7 +82476,7 @@ SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){ + + /* The last field of the index should be an integer - the ROWID. + ** Verify that the last entry really is an integer. */ +- (void)getVarint32((u8*)&m.z[szHdr-1], typeRowid); ++ getVarint32NR((u8*)&m.z[szHdr-1], typeRowid); + testcase( typeRowid==1 ); + testcase( typeRowid==2 ); + testcase( typeRowid==3 ); +@@ -82263,7 +82541,7 @@ SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare( + return SQLITE_CORRUPT_BKPT; + } + sqlite3VdbeMemInit(&m, db, 0); +- rc = sqlite3VdbeMemFromBtree(pCur, 0, (u32)nCellKey, &m); ++ rc = sqlite3VdbeMemFromBtreeZeroOffset(pCur, (u32)nCellKey, &m); + if( rc ){ + return rc; + } +@@ -83176,7 +83454,7 @@ static int sqlite3Step(Vdbe *p){ + ** from interrupting a statement that has not yet started. + */ + if( db->nVdbeActive==0 ){ +- db->u1.isInterrupted = 0; ++ AtomicStore(&db->u1.isInterrupted, 0); + } + + assert( db->nVdbeWrite>0 || db->autoCommit==0 +@@ -83868,7 +84146,7 @@ static int vdbeUnbind(Vdbe *p, int i){ + /* If the bit corresponding to this variable in Vdbe.expmask is set, then + ** binding a new value to this variable invalidates the current query plan. + ** +- ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host ++ ** IMPLEMENTATION-OF: R-57496-20354 If the specific value bound to a host + ** parameter in the WHERE clause might influence the choice of query plan + ** for a statement, then the statement will be automatically recompiled, + ** as if there had been a schema change, on the first sqlite3_step() call +@@ -85556,12 +85834,14 @@ SQLITE_PRIVATE int sqlite3VdbeExec( + goto no_mem; + } + assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY ); ++ testcase( p->rc!=SQLITE_OK ); ++ p->rc = SQLITE_OK; + assert( p->bIsReader || p->readOnly!=0 ); + p->iCurrentTime = 0; + assert( p->explain==0 ); + p->pResultSet = 0; + db->busyHandler.nBusy = 0; +- if( db->u1.isInterrupted ) goto abort_due_to_interrupt; ++ if( AtomicLoad(&db->u1.isInterrupted) ) goto abort_due_to_interrupt; + sqlite3VdbeIOTraceSql(p); + #ifdef SQLITE_DEBUG + sqlite3BeginBenignMalloc(); +@@ -85745,7 +86025,7 @@ jump_to_p2_and_check_for_interrupt: + ** checks on every opcode. This helps sqlite3_step() to run about 1.5% + ** faster according to "valgrind --tool=cachegrind" */ + check_for_interrupt: +- if( db->u1.isInterrupted ) goto abort_due_to_interrupt; ++ if( AtomicLoad(&db->u1.isInterrupted) ) goto abort_due_to_interrupt; + #ifndef SQLITE_OMIT_PROGRESS_CALLBACK + /* Call the progress callback if it is configured and the required number + ** of VDBE ops have been executed (either since this invocation of +@@ -86398,7 +86678,6 @@ case OP_Concat: { /* same as TK_CONCAT, in1, in2, out3 */ + pIn1 = &aMem[pOp->p1]; + pIn2 = &aMem[pOp->p2]; + pOut = &aMem[pOp->p3]; +- testcase( pIn1==pIn2 ); + testcase( pOut==pIn2 ); + assert( pIn1!=pOut ); + flags1 = pIn1->flags; +@@ -86929,7 +87208,7 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */ + if( (flags1 | flags3)&MEM_Str ){ + if( (flags1 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ + applyNumericAffinity(pIn1,0); +- testcase( flags3!=pIn3->flags ); ++ testcase( flags3==pIn3->flags ); + flags3 = pIn3->flags; + } + if( (flags3 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ +@@ -86952,7 +87231,7 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */ + sqlite3VdbeMemStringify(pIn1, encoding, 1); + testcase( (flags1&MEM_Dyn) != (pIn1->flags&MEM_Dyn) ); + flags1 = (pIn1->flags & ~MEM_TypeMask) | (flags1 & MEM_TypeMask); +- if( pIn1==pIn3 ) flags3 = flags1 | MEM_Str; ++ if( NEVER(pIn1==pIn3) ) flags3 = flags1 | MEM_Str; + } + if( (flags3 & MEM_Str)==0 && (flags3&(MEM_Int|MEM_Real|MEM_IntReal))!=0 ){ + testcase( pIn3->flags & MEM_Int ); +@@ -87567,7 +87846,7 @@ case OP_Column: { + /* Make sure zData points to enough of the record to cover the header. */ + if( pC->aRow==0 ){ + memset(&sMem, 0, sizeof(sMem)); +- rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, 0, aOffset[0], &sMem); ++ rc = sqlite3VdbeMemFromBtreeZeroOffset(pC->uc.pCursor,aOffset[0],&sMem); + if( rc!=SQLITE_OK ) goto abort_due_to_error; + zData = (u8*)sMem.z; + }else{ +@@ -88042,13 +88321,16 @@ case OP_MakeRecord: { + break; + } + +-/* Opcode: Count P1 P2 * * * ++/* Opcode: Count P1 P2 p3 * * + ** Synopsis: r[P2]=count() + ** + ** Store the number of entries (an integer value) in the table or index +-** opened by cursor P1 in register P2 ++** opened by cursor P1 in register P2. ++** ++** If P3==0, then an exact count is obtained, which involves visiting ++** every btree page of the table. But if P3 is non-zero, an estimate ++** is returned based on the current cursor position. + */ +-#ifndef SQLITE_OMIT_BTREECOUNT + case OP_Count: { /* out2 */ + i64 nEntry; + BtCursor *pCrsr; +@@ -88056,14 +88338,17 @@ case OP_Count: { /* out2 */ + assert( p->apCsr[pOp->p1]->eCurType==CURTYPE_BTREE ); + pCrsr = p->apCsr[pOp->p1]->uc.pCursor; + assert( pCrsr ); +- nEntry = 0; /* Not needed. Only used to silence a warning. */ +- rc = sqlite3BtreeCount(db, pCrsr, &nEntry); +- if( rc ) goto abort_due_to_error; ++ if( pOp->p3 ){ ++ nEntry = sqlite3BtreeRowCountEst(pCrsr); ++ }else{ ++ nEntry = 0; /* Not needed. Only used to silence a warning. */ ++ rc = sqlite3BtreeCount(db, pCrsr, &nEntry); ++ if( rc ) goto abort_due_to_error; ++ } + pOut = out2Prerelease(p, pOp); + pOut->u.i = nEntry; + goto check_for_interrupt; + } +-#endif + + /* Opcode: Savepoint P1 * * P4 * + ** +@@ -88519,7 +88804,7 @@ case OP_SetCookie: { + **
      + **
    • 0x02 OPFLAG_SEEKEQ: This cursor will only be used for + ** equality lookups (implemented as a pair of opcodes OP_SeekGE/OP_IdxGT +-** of OP_SeekLE/OP_IdxGT) ++** of OP_SeekLE/OP_IdxLT) + **
    + ** + ** The P4 value may be either an integer (P4_INT32) or a pointer to +@@ -88549,7 +88834,7 @@ case OP_SetCookie: { + **
      + **
    • 0x02 OPFLAG_SEEKEQ: This cursor will only be used for + ** equality lookups (implemented as a pair of opcodes OP_SeekGE/OP_IdxGT +-** of OP_SeekLE/OP_IdxGT) ++** of OP_SeekLE/OP_IdxLT) + **
    + ** + ** See also: OP_OpenRead, OP_OpenWrite +@@ -88573,7 +88858,7 @@ case OP_SetCookie: { + **
      + **
    • 0x02 OPFLAG_SEEKEQ: This cursor will only be used for + ** equality lookups (implemented as a pair of opcodes OP_SeekGE/OP_IdxGT +-** of OP_SeekLE/OP_IdxGT) ++** of OP_SeekLE/OP_IdxLT) + **
    • 0x08 OPFLAG_FORDELETE: This cursor is used only to seek + ** and subsequently delete entries in an index btree. This is a + ** hint to the storage engine that the storage engine is allowed to +@@ -88685,9 +88970,7 @@ open_cursor_set_hints: + assert( OPFLAG_BULKCSR==BTREE_BULKLOAD ); + assert( OPFLAG_SEEKEQ==BTREE_SEEK_EQ ); + testcase( pOp->p5 & OPFLAG_BULKCSR ); +-#ifdef SQLITE_ENABLE_CURSOR_HINTS + testcase( pOp->p2 & OPFLAG_SEEKEQ ); +-#endif + sqlite3BtreeCursorHintFlags(pCur->uc.pCursor, + (pOp->p5 & (OPFLAG_BULKCSR|OPFLAG_SEEKEQ))); + if( rc ) goto abort_due_to_error; +@@ -88943,11 +89226,13 @@ case OP_ColumnsUsed: { + ** greater than or equal to the key and P2 is not zero, then jump to P2. + ** + ** If the cursor P1 was opened using the OPFLAG_SEEKEQ flag, then this +-** opcode will always land on a record that equally equals the key, or +-** else jump immediately to P2. When the cursor is OPFLAG_SEEKEQ, this +-** opcode must be followed by an IdxLE opcode with the same arguments. +-** The IdxLE opcode will be skipped if this opcode succeeds, but the +-** IdxLE opcode will be used on subsequent loop iterations. ++** opcode will either land on a record that exactly matches the key, or ++** else it will cause a jump to P2. When the cursor is OPFLAG_SEEKEQ, ++** this opcode must be followed by an IdxLE opcode with the same arguments. ++** The IdxGT opcode will be skipped if this opcode succeeds, but the ++** IdxGT opcode will be used on subsequent loop iterations. The ++** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this ++** is an equality search. + ** + ** This opcode leaves the cursor configured to move in forward order, + ** from the beginning toward the end. In other words, the cursor is +@@ -88963,7 +89248,7 @@ case OP_ColumnsUsed: { + ** to an SQL index, then P3 is the first in an array of P4 registers + ** that are used as an unpacked index key. + ** +-** Reposition cursor P1 so that it points to the smallest entry that ++** Reposition cursor P1 so that it points to the smallest entry that + ** is greater than the key value. If there are no records greater than + ** the key and P2 is not zero, then jump to P2. + ** +@@ -89008,11 +89293,13 @@ case OP_ColumnsUsed: { + ** configured to use Prev, not Next. + ** + ** If the cursor P1 was opened using the OPFLAG_SEEKEQ flag, then this +-** opcode will always land on a record that equally equals the key, or +-** else jump immediately to P2. When the cursor is OPFLAG_SEEKEQ, this +-** opcode must be followed by an IdxGE opcode with the same arguments. ++** opcode will either land on a record that exactly matches the key, or ++** else it will cause a jump to P2. When the cursor is OPFLAG_SEEKEQ, ++** this opcode must be followed by an IdxLE opcode with the same arguments. + ** The IdxGE opcode will be skipped if this opcode succeeds, but the +-** IdxGE opcode will be used on subsequent loop iterations. ++** IdxGE opcode will be used on subsequent loop iterations. The ++** OPFLAG_SEEKEQ flags is a hint to the btree layer to say that this ++** is an equality search. + ** + ** See also: Found, NotFound, SeekGt, SeekGe, SeekLt + */ +@@ -89049,7 +89336,7 @@ case OP_SeekGT: { /* jump, in3, group */ + pC->cacheStatus = CACHE_STALE; + if( pC->isTable ){ + u16 flags3, newType; +- /* The BTREE_SEEK_EQ flag is only set on index cursors */ ++ /* The OPFLAG_SEEKEQ/BTREE_SEEK_EQ flag is only set on index cursors */ + assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 + || CORRUPT_DB ); + +@@ -89108,14 +89395,17 @@ case OP_SeekGT: { /* jump, in3, group */ + goto abort_due_to_error; + } + }else{ +- /* For a cursor with the BTREE_SEEK_EQ hint, only the OP_SeekGE and +- ** OP_SeekLE opcodes are allowed, and these must be immediately followed +- ** by an OP_IdxGT or OP_IdxLT opcode, respectively, with the same key. ++ /* For a cursor with the OPFLAG_SEEKEQ/BTREE_SEEK_EQ hint, only the ++ ** OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be ++ ** immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively, ++ ** with the same key. + */ + if( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ) ){ + eqOnly = 1; + assert( pOp->opcode==OP_SeekGE || pOp->opcode==OP_SeekLE ); + assert( pOp[1].opcode==OP_IdxLT || pOp[1].opcode==OP_IdxGT ); ++ assert( pOp->opcode==OP_SeekGE || pOp[1].opcode==OP_IdxLT ); ++ assert( pOp->opcode==OP_SeekLE || pOp[1].opcode==OP_IdxGT ); + assert( pOp[1].p1==pOp[0].p1 ); + assert( pOp[1].p2==pOp[0].p2 ); + assert( pOp[1].p3==pOp[0].p3 ); +@@ -90063,7 +90353,7 @@ case OP_RowData: { + goto too_big; + } + testcase( n==0 ); +- rc = sqlite3VdbeMemFromBtree(pCrsr, 0, n, pOut); ++ rc = sqlite3VdbeMemFromBtreeZeroOffset(pCrsr, n, pOut); + if( rc ) goto abort_due_to_error; + if( !pOp->p3 ) Deephemeralize(pOut); + UPDATE_MAX_BLOBSIZE(pOut); +@@ -90441,6 +90731,36 @@ next_tail: + ** This instruction only works for indices. The equivalent instruction + ** for tables is OP_Insert. + */ ++case OP_IdxInsert: { /* in2 */ ++ VdbeCursor *pC; ++ BtreePayload x; ++ ++ assert( pOp->p1>=0 && pOp->p1nCursor ); ++ pC = p->apCsr[pOp->p1]; ++ sqlite3VdbeIncrWriteCounter(p, pC); ++ assert( pC!=0 ); ++ assert( !isSorter(pC) ); ++ pIn2 = &aMem[pOp->p2]; ++ assert( pIn2->flags & MEM_Blob ); ++ if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; ++ assert( pC->eCurType==CURTYPE_BTREE ); ++ assert( pC->isTable==0 ); ++ rc = ExpandBlob(pIn2); ++ if( rc ) goto abort_due_to_error; ++ x.nKey = pIn2->n; ++ x.pKey = pIn2->z; ++ x.aMem = aMem + pOp->p3; ++ x.nMem = (u16)pOp->p4.i; ++ rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, ++ (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), ++ ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0) ++ ); ++ assert( pC->deferredMoveto==0 ); ++ pC->cacheStatus = CACHE_STALE; ++ if( rc) goto abort_due_to_error; ++ break; ++} ++ + /* Opcode: SorterInsert P1 P2 * * * + ** Synopsis: key=r[P2] + ** +@@ -90448,47 +90768,37 @@ next_tail: + ** MakeRecord instructions. This opcode writes that key + ** into the sorter P1. Data for the entry is nil. + */ +-case OP_SorterInsert: /* in2 */ +-case OP_IdxInsert: { /* in2 */ ++case OP_SorterInsert: { /* in2 */ + VdbeCursor *pC; +- BtreePayload x; + + assert( pOp->p1>=0 && pOp->p1nCursor ); + pC = p->apCsr[pOp->p1]; + sqlite3VdbeIncrWriteCounter(p, pC); + assert( pC!=0 ); +- assert( isSorter(pC)==(pOp->opcode==OP_SorterInsert) ); ++ assert( isSorter(pC) ); + pIn2 = &aMem[pOp->p2]; + assert( pIn2->flags & MEM_Blob ); +- if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; +- assert( pC->eCurType==CURTYPE_BTREE || pOp->opcode==OP_SorterInsert ); + assert( pC->isTable==0 ); + rc = ExpandBlob(pIn2); + if( rc ) goto abort_due_to_error; +- if( pOp->opcode==OP_SorterInsert ){ +- rc = sqlite3VdbeSorterWrite(pC, pIn2); +- }else{ +- x.nKey = pIn2->n; +- x.pKey = pIn2->z; +- x.aMem = aMem + pOp->p3; +- x.nMem = (u16)pOp->p4.i; +- rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, +- (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), +- ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0) +- ); +- assert( pC->deferredMoveto==0 ); +- pC->cacheStatus = CACHE_STALE; +- } ++ rc = sqlite3VdbeSorterWrite(pC, pIn2); + if( rc) goto abort_due_to_error; + break; + } + +-/* Opcode: IdxDelete P1 P2 P3 * * ++/* Opcode: IdxDelete P1 P2 P3 * P5 + ** Synopsis: key=r[P2@P3] + ** + ** The content of P3 registers starting at register P2 form + ** an unpacked index key. This opcode removes that entry from the + ** index opened by cursor P1. ++** ++** If P5 is not zero, then raise an SQLITE_CORRUPT_INDEX error ++** if no matching index entry is found. This happens when running ++** an UPDATE or DELETE statement and the index entry to be updated ++** or deleted is not found. For some uses of IdxDelete ++** (example: the EXCEPT operator) it does not matter that no matching ++** entry is found. For those cases, P5 is zero. + */ + case OP_IdxDelete: { + VdbeCursor *pC; +@@ -90505,7 +90815,6 @@ case OP_IdxDelete: { + sqlite3VdbeIncrWriteCounter(p, pC); + pCrsr = pC->uc.pCursor; + assert( pCrsr!=0 ); +- assert( pOp->p5==0 ); + r.pKeyInfo = pC->pKeyInfo; + r.nField = (u16)pOp->p3; + r.default_rc = 0; +@@ -90515,6 +90824,9 @@ case OP_IdxDelete: { + if( res==0 ){ + rc = sqlite3BtreeDelete(pCrsr, BTREE_AUXDELETE); + if( rc ) goto abort_due_to_error; ++ }else if( pOp->p5 ){ ++ rc = SQLITE_CORRUPT_INDEX; ++ goto abort_due_to_error; + } + assert( pC->deferredMoveto==0 ); + pC->cacheStatus = CACHE_STALE; +@@ -91317,7 +91629,7 @@ case OP_Program: { /* jump */ + int i; + for(i=0; inMem; i++){ + aMem[i].pScopyFrom = 0; /* Prevent false-positive AboutToChange() errs */ +- aMem[i].flags |= MEM_Undefined; /* Cause a fault if this reg is reused */ ++ MemSetTypeFlag(&aMem[i], MEM_Undefined); /* Fault if this reg is reused */ + } + } + #endif +@@ -92428,7 +92740,7 @@ case OP_MaxPgcnt: { /* out2 */ + #endif + + /* Opcode: Function P1 P2 P3 P4 * +-** Synopsis: r[P3]=func(r[P2@P5]) ++** Synopsis: r[P3]=func(r[P2@NP]) + ** + ** Invoke a user function (P4 is a pointer to an sqlite3_context object that + ** contains a pointer to the function to be run) with arguments taken +@@ -92447,7 +92759,7 @@ case OP_MaxPgcnt: { /* out2 */ + ** See also: AggStep, AggFinal, PureFunc + */ + /* Opcode: PureFunc P1 P2 P3 P4 * +-** Synopsis: r[P3]=func(r[P2@P5]) ++** Synopsis: r[P3]=func(r[P2@NP]) + ** + ** Invoke a user function (P4 is a pointer to an sqlite3_context object that + ** contains a pointer to the function to be run) with arguments taken +@@ -92836,7 +93148,7 @@ no_mem: + ** flag. + */ + abort_due_to_interrupt: +- assert( db->u1.isInterrupted ); ++ assert( AtomicLoad(&db->u1.isInterrupted) ); + rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT; + p->rc = rc; + sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc)); +@@ -94174,8 +94486,8 @@ static int vdbeSorterCompareText( + int n2; + int res; + +- getVarint32(&p1[1], n1); +- getVarint32(&p2[1], n2); ++ getVarint32NR(&p1[1], n1); ++ getVarint32NR(&p2[1], n2); + res = memcmp(v1, v2, (MIN(n1, n2) - 13)/2); + if( res==0 ){ + res = n1 - n2; +@@ -95132,7 +95444,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterWrite( + + assert( pCsr->eCurType==CURTYPE_SORTER ); + pSorter = pCsr->uc.pSorter; +- getVarint32((const u8*)&pVal->z[1], t); ++ getVarint32NR((const u8*)&pVal->z[1], t); + if( t>0 && t<10 && t!=7 ){ + pSorter->typeMask &= SORTER_TYPE_INTEGER; + }else if( t>10 && (t & 0x01) ){ +@@ -96119,6 +96431,433 @@ SQLITE_PRIVATE int sqlite3VdbeSorterCompare( + } + + /************** End of vdbesort.c ********************************************/ ++/************** Begin file vdbevtab.c ****************************************/ ++/* ++** 2020-03-23 ++** ++** 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 implements virtual-tables for examining the bytecode content ++** of a prepared statement. ++*/ ++/* #include "sqliteInt.h" */ ++#if defined(SQLITE_ENABLE_BYTECODE_VTAB) && !defined(SQLITE_OMIT_VIRTUALTABLE) ++/* #include "vdbeInt.h" */ ++ ++/* An instance of the bytecode() table-valued function. ++*/ ++typedef struct bytecodevtab bytecodevtab; ++struct bytecodevtab { ++ sqlite3_vtab base; /* Base class - must be first */ ++ sqlite3 *db; /* Database connection */ ++ int bTablesUsed; /* 2 for tables_used(). 0 for bytecode(). */ ++}; ++ ++/* A cursor for scanning through the bytecode ++*/ ++typedef struct bytecodevtab_cursor bytecodevtab_cursor; ++struct bytecodevtab_cursor { ++ sqlite3_vtab_cursor base; /* Base class - must be first */ ++ sqlite3_stmt *pStmt; /* The statement whose bytecode is displayed */ ++ int iRowid; /* The rowid of the output table */ ++ int iAddr; /* Address */ ++ int needFinalize; /* Cursors owns pStmt and must finalize it */ ++ int showSubprograms; /* Provide a listing of subprograms */ ++ Op *aOp; /* Operand array */ ++ char *zP4; /* Rendered P4 value */ ++ const char *zType; /* tables_used.type */ ++ const char *zSchema; /* tables_used.schema */ ++ const char *zName; /* tables_used.name */ ++ Mem sub; /* Subprograms */ ++}; ++ ++/* ++** Create a new bytecode() table-valued function. ++*/ ++static int bytecodevtabConnect( ++ sqlite3 *db, ++ void *pAux, ++ int argc, const char *const*argv, ++ sqlite3_vtab **ppVtab, ++ char **pzErr ++){ ++ bytecodevtab *pNew; ++ int rc; ++ int isTabUsed = pAux!=0; ++ const char *azSchema[2] = { ++ /* bytecode() schema */ ++ "CREATE TABLE x(" ++ "addr INT," ++ "opcode TEXT," ++ "p1 INT," ++ "p2 INT," ++ "p3 INT," ++ "p4 TEXT," ++ "p5 INT," ++ "comment TEXT," ++ "subprog TEXT," ++ "stmt HIDDEN" ++ ");", ++ ++ /* Tables_used() schema */ ++ "CREATE TABLE x(" ++ "type TEXT," ++ "schema TEXT," ++ "name TEXT," ++ "wr INT," ++ "subprog TEXT," ++ "stmt HIDDEN" ++ ");" ++ }; ++ ++ rc = sqlite3_declare_vtab(db, azSchema[isTabUsed]); ++ if( rc==SQLITE_OK ){ ++ pNew = sqlite3_malloc( sizeof(*pNew) ); ++ *ppVtab = (sqlite3_vtab*)pNew; ++ if( pNew==0 ) return SQLITE_NOMEM; ++ memset(pNew, 0, sizeof(*pNew)); ++ pNew->db = db; ++ pNew->bTablesUsed = isTabUsed*2; ++ } ++ return rc; ++} ++ ++/* ++** This method is the destructor for bytecodevtab objects. ++*/ ++static int bytecodevtabDisconnect(sqlite3_vtab *pVtab){ ++ bytecodevtab *p = (bytecodevtab*)pVtab; ++ sqlite3_free(p); ++ return SQLITE_OK; ++} ++ ++/* ++** Constructor for a new bytecodevtab_cursor object. ++*/ ++static int bytecodevtabOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){ ++ bytecodevtab *pVTab = (bytecodevtab*)p; ++ bytecodevtab_cursor *pCur; ++ pCur = sqlite3_malloc( sizeof(*pCur) ); ++ if( pCur==0 ) return SQLITE_NOMEM; ++ memset(pCur, 0, sizeof(*pCur)); ++ sqlite3VdbeMemInit(&pCur->sub, pVTab->db, 1); ++ *ppCursor = &pCur->base; ++ return SQLITE_OK; ++} ++ ++/* ++** Clear all internal content from a bytecodevtab cursor. ++*/ ++static void bytecodevtabCursorClear(bytecodevtab_cursor *pCur){ ++ sqlite3_free(pCur->zP4); ++ pCur->zP4 = 0; ++ sqlite3VdbeMemRelease(&pCur->sub); ++ sqlite3VdbeMemSetNull(&pCur->sub); ++ if( pCur->needFinalize ){ ++ sqlite3_finalize(pCur->pStmt); ++ } ++ pCur->pStmt = 0; ++ pCur->needFinalize = 0; ++ pCur->zType = 0; ++ pCur->zSchema = 0; ++ pCur->zName = 0; ++} ++ ++/* ++** Destructor for a bytecodevtab_cursor. ++*/ ++static int bytecodevtabClose(sqlite3_vtab_cursor *cur){ ++ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur; ++ bytecodevtabCursorClear(pCur); ++ sqlite3_free(pCur); ++ return SQLITE_OK; ++} ++ ++ ++/* ++** Advance a bytecodevtab_cursor to its next row of output. ++*/ ++static int bytecodevtabNext(sqlite3_vtab_cursor *cur){ ++ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur; ++ bytecodevtab *pTab = (bytecodevtab*)cur->pVtab; ++ int rc; ++ if( pCur->zP4 ){ ++ sqlite3_free(pCur->zP4); ++ pCur->zP4 = 0; ++ } ++ if( pCur->zName ){ ++ pCur->zName = 0; ++ pCur->zType = 0; ++ pCur->zSchema = 0; ++ } ++ rc = sqlite3VdbeNextOpcode( ++ (Vdbe*)pCur->pStmt, ++ pCur->showSubprograms ? &pCur->sub : 0, ++ pTab->bTablesUsed, ++ &pCur->iRowid, ++ &pCur->iAddr, ++ &pCur->aOp); ++ if( rc!=SQLITE_OK ){ ++ sqlite3VdbeMemSetNull(&pCur->sub); ++ pCur->aOp = 0; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Return TRUE if the cursor has been moved off of the last ++** row of output. ++*/ ++static int bytecodevtabEof(sqlite3_vtab_cursor *cur){ ++ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur; ++ return pCur->aOp==0; ++} ++ ++/* ++** Return values of columns for the row at which the bytecodevtab_cursor ++** is currently pointing. ++*/ ++static int bytecodevtabColumn( ++ sqlite3_vtab_cursor *cur, /* The cursor */ ++ sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ ++ int i /* Which column to return */ ++){ ++ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur; ++ bytecodevtab *pVTab = (bytecodevtab*)cur->pVtab; ++ Op *pOp = pCur->aOp + pCur->iAddr; ++ if( pVTab->bTablesUsed ){ ++ if( i==4 ){ ++ i = 8; ++ }else{ ++ if( i<=2 && pCur->zType==0 ){ ++ Schema *pSchema; ++ HashElem *k; ++ int iDb = pOp->p3; ++ int iRoot = pOp->p2; ++ sqlite3 *db = pVTab->db; ++ pSchema = db->aDb[iDb].pSchema; ++ pCur->zSchema = db->aDb[iDb].zDbSName; ++ for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ ++ Table *pTab = (Table*)sqliteHashData(k); ++ if( !IsVirtual(pTab) && pTab->tnum==iRoot ){ ++ pCur->zName = pTab->zName; ++ pCur->zType = "table"; ++ break; ++ } ++ } ++ if( pCur->zName==0 ){ ++ for(k=sqliteHashFirst(&pSchema->idxHash); k; k=sqliteHashNext(k)){ ++ Index *pIdx = (Index*)sqliteHashData(k); ++ if( pIdx->tnum==iRoot ){ ++ pCur->zName = pIdx->zName; ++ pCur->zType = "index"; ++ } ++ } ++ } ++ } ++ i += 10; ++ } ++ } ++ switch( i ){ ++ case 0: /* addr */ ++ sqlite3_result_int(ctx, pCur->iAddr); ++ break; ++ case 1: /* opcode */ ++ sqlite3_result_text(ctx, (char*)sqlite3OpcodeName(pOp->opcode), ++ -1, SQLITE_STATIC); ++ break; ++ case 2: /* p1 */ ++ sqlite3_result_int(ctx, pOp->p1); ++ break; ++ case 3: /* p2 */ ++ sqlite3_result_int(ctx, pOp->p2); ++ break; ++ case 4: /* p3 */ ++ sqlite3_result_int(ctx, pOp->p3); ++ break; ++ case 5: /* p4 */ ++ case 7: /* comment */ ++ if( pCur->zP4==0 ){ ++ pCur->zP4 = sqlite3VdbeDisplayP4(pVTab->db, pOp); ++ } ++ if( i==5 ){ ++ sqlite3_result_text(ctx, pCur->zP4, -1, SQLITE_STATIC); ++ }else{ ++#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS ++ char *zCom = sqlite3VdbeDisplayComment(pVTab->db, pOp, pCur->zP4); ++ sqlite3_result_text(ctx, zCom, -1, sqlite3_free); ++#endif ++ } ++ break; ++ case 6: /* p5 */ ++ sqlite3_result_int(ctx, pOp->p5); ++ break; ++ case 8: { /* subprog */ ++ Op *aOp = pCur->aOp; ++ assert( aOp[0].opcode==OP_Init ); ++ assert( aOp[0].p4.z==0 || strncmp(aOp[0].p4.z,"-" "- ",3)==0 ); ++ if( pCur->iRowid==pCur->iAddr+1 ){ ++ break; /* Result is NULL for the main program */ ++ }else if( aOp[0].p4.z!=0 ){ ++ sqlite3_result_text(ctx, aOp[0].p4.z+3, -1, SQLITE_STATIC); ++ }else{ ++ sqlite3_result_text(ctx, "(FK)", 4, SQLITE_STATIC); ++ } ++ break; ++ } ++ case 10: /* tables_used.type */ ++ sqlite3_result_text(ctx, pCur->zType, -1, SQLITE_STATIC); ++ break; ++ case 11: /* tables_used.schema */ ++ sqlite3_result_text(ctx, pCur->zSchema, -1, SQLITE_STATIC); ++ break; ++ case 12: /* tables_used.name */ ++ sqlite3_result_text(ctx, pCur->zName, -1, SQLITE_STATIC); ++ break; ++ case 13: /* tables_used.wr */ ++ sqlite3_result_int(ctx, pOp->opcode==OP_OpenWrite); ++ break; ++ } ++ return SQLITE_OK; ++} ++ ++/* ++** Return the rowid for the current row. In this implementation, the ++** rowid is the same as the output value. ++*/ ++static int bytecodevtabRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ ++ bytecodevtab_cursor *pCur = (bytecodevtab_cursor*)cur; ++ *pRowid = pCur->iRowid; ++ return SQLITE_OK; ++} ++ ++/* ++** Initialize a cursor. ++** ++** idxNum==0 means show all subprograms ++** idxNum==1 means show only the main bytecode and omit subprograms. ++*/ ++static int bytecodevtabFilter( ++ sqlite3_vtab_cursor *pVtabCursor, ++ int idxNum, const char *idxStr, ++ int argc, sqlite3_value **argv ++){ ++ bytecodevtab_cursor *pCur = (bytecodevtab_cursor *)pVtabCursor; ++ bytecodevtab *pVTab = (bytecodevtab *)pVtabCursor->pVtab; ++ int rc = SQLITE_OK; ++ ++ bytecodevtabCursorClear(pCur); ++ pCur->iRowid = 0; ++ pCur->iAddr = 0; ++ pCur->showSubprograms = idxNum==0; ++ assert( argc==1 ); ++ if( sqlite3_value_type(argv[0])==SQLITE_TEXT ){ ++ const char *zSql = (const char*)sqlite3_value_text(argv[0]); ++ if( zSql==0 ){ ++ rc = SQLITE_NOMEM; ++ }else{ ++ rc = sqlite3_prepare_v2(pVTab->db, zSql, -1, &pCur->pStmt, 0); ++ pCur->needFinalize = 1; ++ } ++ }else{ ++ pCur->pStmt = (sqlite3_stmt*)sqlite3_value_pointer(argv[0],"stmt-pointer"); ++ } ++ if( pCur->pStmt==0 ){ ++ pVTab->base.zErrMsg = sqlite3_mprintf( ++ "argument to %s() is not a valid SQL statement", ++ pVTab->bTablesUsed ? "tables_used" : "bytecode" ++ ); ++ rc = SQLITE_ERROR; ++ }else{ ++ bytecodevtabNext(pVtabCursor); ++ } ++ return rc; ++} ++ ++/* ++** We must have a single stmt=? constraint that will be passed through ++** into the xFilter method. If there is no valid stmt=? constraint, ++** then return an SQLITE_CONSTRAINT error. ++*/ ++static int bytecodevtabBestIndex( ++ sqlite3_vtab *tab, ++ sqlite3_index_info *pIdxInfo ++){ ++ int i; ++ int rc = SQLITE_CONSTRAINT; ++ struct sqlite3_index_constraint *p; ++ bytecodevtab *pVTab = (bytecodevtab*)tab; ++ int iBaseCol = pVTab->bTablesUsed ? 4 : 8; ++ pIdxInfo->estimatedCost = (double)100; ++ pIdxInfo->estimatedRows = 100; ++ pIdxInfo->idxNum = 0; ++ for(i=0, p=pIdxInfo->aConstraint; inConstraint; i++, p++){ ++ if( p->usable==0 ) continue; ++ if( p->op==SQLITE_INDEX_CONSTRAINT_EQ && p->iColumn==iBaseCol+1 ){ ++ rc = SQLITE_OK; ++ pIdxInfo->aConstraintUsage[i].omit = 1; ++ pIdxInfo->aConstraintUsage[i].argvIndex = 1; ++ } ++ if( p->op==SQLITE_INDEX_CONSTRAINT_ISNULL && p->iColumn==iBaseCol ){ ++ pIdxInfo->aConstraintUsage[i].omit = 1; ++ pIdxInfo->idxNum = 1; ++ } ++ } ++ return rc; ++} ++ ++/* ++** This following structure defines all the methods for the ++** virtual table. ++*/ ++static sqlite3_module bytecodevtabModule = { ++ /* iVersion */ 0, ++ /* xCreate */ 0, ++ /* xConnect */ bytecodevtabConnect, ++ /* xBestIndex */ bytecodevtabBestIndex, ++ /* xDisconnect */ bytecodevtabDisconnect, ++ /* xDestroy */ 0, ++ /* xOpen */ bytecodevtabOpen, ++ /* xClose */ bytecodevtabClose, ++ /* xFilter */ bytecodevtabFilter, ++ /* xNext */ bytecodevtabNext, ++ /* xEof */ bytecodevtabEof, ++ /* xColumn */ bytecodevtabColumn, ++ /* xRowid */ bytecodevtabRowid, ++ /* xUpdate */ 0, ++ /* xBegin */ 0, ++ /* xSync */ 0, ++ /* xCommit */ 0, ++ /* xRollback */ 0, ++ /* xFindMethod */ 0, ++ /* xRename */ 0, ++ /* xSavepoint */ 0, ++ /* xRelease */ 0, ++ /* xRollbackTo */ 0, ++ /* xShadowName */ 0 ++}; ++ ++ ++SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ ++ int rc; ++ rc = sqlite3_create_module(db, "bytecode", &bytecodevtabModule, 0); ++ if( rc==SQLITE_OK ){ ++ rc = sqlite3_create_module(db, "tables_used", &bytecodevtabModule, &db); ++ } ++ return rc; ++} ++#elif defined(SQLITE_ENABLE_BYTECODE_VTAB) ++SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLITE_OK; } ++#endif /* SQLITE_ENABLE_BYTECODE_VTAB */ ++ ++/************** End of vdbevtab.c ********************************************/ + /************** Begin file memjournal.c **************************************/ + /* + ** 2008 October 7 +@@ -96710,15 +97449,16 @@ SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){ + struct SrcList_item *pItem; + + pSrc = p->pSrc; +- assert( pSrc!=0 ); +- for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ +- if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){ +- return WRC_Abort; +- } +- if( pItem->fg.isTabFunc +- && sqlite3WalkExprList(pWalker, pItem->u1.pFuncArg) +- ){ +- return WRC_Abort; ++ if( pSrc ){ ++ for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ ++ if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){ ++ return WRC_Abort; ++ } ++ if( pItem->fg.isTabFunc ++ && sqlite3WalkExprList(pWalker, pItem->u1.pFuncArg) ++ ){ ++ return WRC_Abort; ++ } + } + } + return WRC_Continue; +@@ -96761,6 +97501,43 @@ SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){ + return WRC_Continue; + } + ++/* Increase the walkerDepth when entering a subquery, and ++** descrease when leaving the subquery. ++*/ ++SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker *pWalker, Select *pSelect){ ++ UNUSED_PARAMETER(pSelect); ++ pWalker->walkerDepth++; ++ return WRC_Continue; ++} ++SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker *pWalker, Select *pSelect){ ++ UNUSED_PARAMETER(pSelect); ++ pWalker->walkerDepth--; ++} ++ ++ ++/* ++** No-op routine for the parse-tree walker. ++** ++** When this routine is the Walker.xExprCallback then expression trees ++** are walked without any actions being taken at each node. Presumably, ++** when this routine is used for Walker.xExprCallback then ++** Walker.xSelectCallback is set to do something useful for every ++** subquery in the parser tree. ++*/ ++SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ ++ UNUSED_PARAMETER2(NotUsed, NotUsed2); ++ return WRC_Continue; ++} ++ ++/* ++** No-op routine for the parse-tree walker for SELECT statements. ++** subquery in the parser tree. ++*/ ++SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){ ++ UNUSED_PARAMETER2(NotUsed, NotUsed2); ++ return WRC_Continue; ++} ++ + /************** End of walker.c **********************************************/ + /************** Begin file resolve.c *****************************************/ + /* +@@ -96789,6 +97566,8 @@ SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){ + ** + ** incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..) + ** is a helper function - a callback for the tree walker. ++** ++** See also the sqlite3WindowExtraAggFuncDepth() routine in window.c + */ + static int incrAggDepth(Walker *pWalker, Expr *pExpr){ + if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n; +@@ -96905,7 +97684,7 @@ SQLITE_PRIVATE int sqlite3MatchEName( + ){ + int n; + const char *zSpan; +- if( NEVER(pItem->eEName!=ENAME_TAB) ) return 0; ++ if( pItem->eEName!=ENAME_TAB ) return 0; + zSpan = pItem->zEName; + for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} + if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){ +@@ -96940,6 +97719,31 @@ static int areDoubleQuotedStringsEnabled(sqlite3 *db, NameContext *pTopNC){ + } + } + ++/* ++** The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN. ++** return the appropriate colUsed mask. ++*/ ++SQLITE_PRIVATE Bitmask sqlite3ExprColUsed(Expr *pExpr){ ++ int n; ++ Table *pExTab; ++ ++ n = pExpr->iColumn; ++ pExTab = pExpr->y.pTab; ++ assert( pExTab!=0 ); ++ if( (pExTab->tabFlags & TF_HasGenerated)!=0 ++ && (pExTab->aCol[n].colFlags & COLFLAG_GENERATED)!=0 ++ ){ ++ testcase( pExTab->nCol==BMS-1 ); ++ testcase( pExTab->nCol==BMS ); ++ return pExTab->nCol>=BMS ? ALLBITS : MASKBIT(pExTab->nCol)-1; ++ }else{ ++ testcase( n==BMS-1 ); ++ testcase( n==BMS ); ++ if( n>=BMS ) n = BMS-1; ++ return ((Bitmask)1)<nDb && sqlite3StrICmp("main", zDb)==0 ){ ++ /* This branch is taken when the main database has been renamed ++ ** using SQLITE_DBCONFIG_MAINDBNAME. */ ++ pSchema = db->aDb[0].pSchema; ++ zDb = db->aDb[0].zDbSName; ++ } + } + } + +@@ -97028,6 +97838,7 @@ static int lookupName( + + if( pSrcList ){ + for(i=0, pItem=pSrcList->a; inSrc; i++, pItem++){ ++ u8 hCol; + pTab = pItem->pTab; + assert( pTab!=0 && pTab->zName!=0 ); + assert( pTab->nCol>0 ); +@@ -97061,8 +97872,9 @@ static int lookupName( + if( 0==(cntTab++) ){ + pMatch = pItem; + } ++ hCol = sqlite3StrIHash(zCol); + for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ +- if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ ++ if( pCol->hName==hCol && sqlite3StrICmp(pCol->zName, zCol)==0 ){ + /* If there has been exactly one prior match and this match + ** is for the right-hand table of a NATURAL JOIN or is in a + ** USING clause, then skip this match. +@@ -97123,10 +97935,11 @@ static int lookupName( + + if( pTab ){ + int iCol; ++ u8 hCol = sqlite3StrIHash(zCol); + pSchema = pTab->pSchema; + cntTab++; + for(iCol=0, pCol=pTab->aCol; iColnCol; iCol++, pCol++){ +- if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ ++ if( pCol->hName==hCol && sqlite3StrICmp(pCol->zName, zCol)==0 ){ + if( iCol==pTab->iPKey ){ + iCol = -1; + } +@@ -97336,22 +98149,7 @@ static int lookupName( + ** of the table. + */ + if( pExpr->iColumn>=0 && pMatch!=0 ){ +- int n = pExpr->iColumn; +- Table *pExTab = pExpr->y.pTab; +- assert( pExTab!=0 ); +- assert( pMatch->iCursor==pExpr->iTable ); +- if( (pExTab->tabFlags & TF_HasGenerated)!=0 +- && (pExTab->aCol[n].colFlags & COLFLAG_GENERATED)!=0 +- ){ +- testcase( pExTab->nCol==BMS-1 ); +- testcase( pExTab->nCol==BMS ); +- pMatch->colUsed = pExTab->nCol>=BMS ? ALLBITS : MASKBIT(pExTab->nCol)-1; +- }else{ +- testcase( n==BMS-1 ); +- testcase( n==BMS ); +- if( n>=BMS ) n = BMS-1; +- pMatch->colUsed |= ((Bitmask)1)<colUsed |= sqlite3ExprColUsed(pExpr); + } + + /* Clean up and return +@@ -97816,7 +98614,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ + assert( !ExprHasProperty(pExpr, EP_Reduced) ); + /* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE", + ** and "x IS NOT FALSE". */ +- if( pRight->op==TK_ID ){ ++ if( pRight && pRight->op==TK_ID ){ + int rc = resolveExprStep(pWalker, pRight); + if( rc==WRC_Abort ) return WRC_Abort; + if( pRight->op==TK_TRUEFALSE ){ +@@ -97942,7 +98740,7 @@ static int resolveOrderByTermToExprList( + nc.nErr = 0; + db = pParse->db; + savedSuppErr = db->suppressErr; +- db->suppressErr = 1; ++ if( IN_RENAME_OBJECT==0 ) db->suppressErr = 1; + rc = sqlite3ResolveExprNames(&nc, pE); + db->suppressErr = savedSuppErr; + if( rc ) return 0; +@@ -98577,11 +99375,41 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames( + ExprList *pList /* The expression list to be analyzed. */ + ){ + int i; +- if( pList ){ +- for(i=0; inExpr; i++){ +- if( sqlite3ResolveExprNames(pNC, pList->a[i].pExpr) ) return WRC_Abort; ++ int savedHasAgg = 0; ++ Walker w; ++ if( pList==0 ) return WRC_Continue; ++ w.pParse = pNC->pParse; ++ w.xExprCallback = resolveExprStep; ++ w.xSelectCallback = resolveSelectStep; ++ w.xSelectCallback2 = 0; ++ w.u.pNC = pNC; ++ savedHasAgg = pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin); ++ pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin); ++ for(i=0; inExpr; i++){ ++ Expr *pExpr = pList->a[i].pExpr; ++ if( pExpr==0 ) continue; ++#if SQLITE_MAX_EXPR_DEPTH>0 ++ w.pParse->nHeight += pExpr->nHeight; ++ if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ ++ return WRC_Abort; + } ++#endif ++ sqlite3WalkExpr(&w, pExpr); ++#if SQLITE_MAX_EXPR_DEPTH>0 ++ w.pParse->nHeight -= pExpr->nHeight; ++#endif ++ assert( EP_Agg==NC_HasAgg ); ++ assert( EP_Win==NC_HasWin ); ++ testcase( pNC->ncFlags & NC_HasAgg ); ++ testcase( pNC->ncFlags & NC_HasWin ); ++ if( pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin) ){ ++ ExprSetProperty(pExpr, pNC->ncFlags & (NC_HasAgg|NC_HasWin) ); ++ savedHasAgg |= pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin); ++ pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin); ++ } ++ if( pNC->nErr>0 || w.pParse->nErr>0 ) return WRC_Abort; + } ++ pNC->ncFlags |= savedHasAgg; + return WRC_Continue; + } + +@@ -98712,17 +99540,22 @@ SQLITE_PRIVATE char sqlite3TableColumnAffinity(Table *pTab, int iCol){ + ** SELECT a AS b FROM t1 WHERE b; + ** SELECT * FROM t1 WHERE (select a from t1); + */ +-SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ ++SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){ + int op; + while( ExprHasProperty(pExpr, EP_Skip) ){ +- assert( pExpr->op==TK_COLLATE ); ++ assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW ); + pExpr = pExpr->pLeft; + assert( pExpr!=0 ); + } + op = pExpr->op; + if( op==TK_SELECT ){ + assert( pExpr->flags&EP_xIsSelect ); +- return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); ++ if( ALWAYS(pExpr->x.pSelect) ++ && pExpr->x.pSelect->pEList ++ && ALWAYS(pExpr->x.pSelect->pEList->a[0].pExpr) ++ ){ ++ return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); ++ } + } + if( op==TK_REGISTER ) op = pExpr->op2; + #ifndef SQLITE_OMIT_CAST +@@ -98782,7 +99615,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(Parse *pParse, Expr *pExpr, con + */ + SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){ + while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){ +- assert( pExpr->op==TK_COLLATE ); ++ assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW ); + pExpr = pExpr->pLeft; + } + return pExpr; +@@ -98801,7 +99634,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr *pExpr){ + assert( pExpr->op==TK_FUNCTION ); + pExpr = pExpr->x.pList->a[0].pExpr; + }else{ +- assert( pExpr->op==TK_COLLATE ); ++ assert( pExpr->op==TK_COLLATE || pExpr->op==TK_IF_NULL_ROW ); + pExpr = pExpr->pLeft; + } + } +@@ -98822,10 +99655,10 @@ SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr *pExpr){ + ** COLLATE operators take first precedence. Left operands take + ** precedence over right operands. + */ +-SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ ++SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr){ + sqlite3 *db = pParse->db; + CollSeq *pColl = 0; +- Expr *p = pExpr; ++ const Expr *p = pExpr; + while( p ){ + int op = p->op; + if( op==TK_REGISTER ) op = p->op2; +@@ -98894,7 +99727,7 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ + ** The sqlite3ExprCollSeq() routine works the same except that it + ** returns NULL if there is no defined collation. + */ +-SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, Expr *pExpr){ ++SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, const Expr *pExpr){ + CollSeq *p = sqlite3ExprCollSeq(pParse, pExpr); + if( p==0 ) p = pParse->db->pDfltColl; + assert( p!=0 ); +@@ -98904,7 +99737,7 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, Expr *pExpr){ + /* + ** Return TRUE if the two expressions have equivalent collating sequences. + */ +-SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse *pParse, Expr *pE1, Expr *pE2){ ++SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse *pParse, const Expr *pE1, const Expr *pE2){ + CollSeq *pColl1 = sqlite3ExprNNCollSeq(pParse, pE1); + CollSeq *pColl2 = sqlite3ExprNNCollSeq(pParse, pE2); + return sqlite3StrICmp(pColl1->zName, pColl2->zName)==0; +@@ -98915,7 +99748,7 @@ SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse *pParse, Expr *pE1, Expr *pE2){ + ** type affinity of the other operand. This routine returns the + ** type affinity that should be used for the comparison operator. + */ +-SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){ ++SQLITE_PRIVATE char sqlite3CompareAffinity(const Expr *pExpr, char aff2){ + char aff1 = sqlite3ExprAffinity(pExpr); + if( aff1>SQLITE_AFF_NONE && aff2>SQLITE_AFF_NONE ){ + /* Both sides of the comparison are columns. If one has numeric +@@ -98937,7 +99770,7 @@ SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){ + ** pExpr is a comparison operator. Return the type affinity that should + ** be applied to both operands prior to doing the comparison. + */ +-static char comparisonAffinity(Expr *pExpr){ ++static char comparisonAffinity(const Expr *pExpr){ + char aff; + assert( pExpr->op==TK_EQ || pExpr->op==TK_IN || pExpr->op==TK_LT || + pExpr->op==TK_GT || pExpr->op==TK_GE || pExpr->op==TK_LE || +@@ -98960,7 +99793,7 @@ static char comparisonAffinity(Expr *pExpr){ + ** if the index with affinity idx_affinity may be used to implement + ** the comparison in pExpr. + */ +-SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){ ++SQLITE_PRIVATE int sqlite3IndexAffinityOk(const Expr *pExpr, char idx_affinity){ + char aff = comparisonAffinity(pExpr); + if( affpRight, p->pLeft); + }else{ +@@ -99264,6 +100101,7 @@ static void codeVectorCompare( + int addrDone = sqlite3VdbeMakeLabel(pParse); + int isCommuted = ExprHasProperty(pExpr,EP_Commuted); + ++ assert( !ExprHasVVAProperty(pExpr,EP_Immutable) ); + if( pParse->nErr ) return; + if( nLeft!=sqlite3ExprVectorSize(pRight) ){ + sqlite3ErrorMsg(pParse, "row value misused"); +@@ -99876,7 +100714,7 @@ static int dupedExprStructSize(Expr *p, int flags){ + assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) ); + assert( !ExprHasProperty(p, EP_FromJoin) ); + assert( !ExprHasProperty(p, EP_MemToken) ); +- assert( !ExprHasProperty(p, EP_NoReduce) ); ++ assert( !ExprHasVVAProperty(p, EP_NoReduce) ); + if( p->pLeft || p->x.pList ){ + nSize = EXPR_REDUCEDSIZE | EP_Reduced; + }else{ +@@ -99981,6 +100819,10 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){ + pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static|EP_MemToken); + pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly); + pNew->flags |= staticFlag; ++ ExprClearVVAProperties(pNew); ++ if( dupFlags ){ ++ ExprSetVVAProperty(pNew, EP_Immutable); ++ } + + /* Copy the p->u.zToken string, if any. */ + if( nToken ){ +@@ -100448,6 +101290,7 @@ SQLITE_PRIVATE void sqlite3ExprListSetName( + int dequote /* True to cause the name to be dequoted */ + ){ + assert( pList!=0 || pParse->db->mallocFailed!=0 ); ++ assert( pParse->eParseMode!=PARSE_MODE_UNMAP || dequote==0 ); + if( pList ){ + struct ExprList_item *pItem; + assert( pList->nExpr>0 ); +@@ -100455,9 +101298,14 @@ SQLITE_PRIVATE void sqlite3ExprListSetName( + assert( pItem->zEName==0 ); + assert( pItem->eEName==ENAME_NAME ); + pItem->zEName = sqlite3DbStrNDup(pParse->db, pName->z, pName->n); +- if( dequote ) sqlite3Dequote(pItem->zEName); +- if( IN_RENAME_OBJECT ){ +- sqlite3RenameTokenMap(pParse, (void*)pItem->zEName, pName); ++ if( dequote ){ ++ /* If dequote==0, then pName->z does not point to part of a DDL ++ ** statement handled by the parser. And so no token need be added ++ ** to the token-map. */ ++ sqlite3Dequote(pItem->zEName); ++ if( IN_RENAME_OBJECT ){ ++ sqlite3RenameTokenMap(pParse, (void*)pItem->zEName, pName); ++ } + } + } + } +@@ -100698,8 +101546,10 @@ static int exprNodeIsConstant(Walker *pWalker, Expr *pExpr){ + /* Fall through */ + case TK_IF_NULL_ROW: + case TK_REGISTER: ++ case TK_DOT: + testcase( pExpr->op==TK_REGISTER ); + testcase( pExpr->op==TK_IF_NULL_ROW ); ++ testcase( pExpr->op==TK_DOT ); + pWalker->eCode = 0; + return WRC_Abort; + case TK_VARIABLE: +@@ -100757,7 +101607,7 @@ SQLITE_PRIVATE int sqlite3ExprIsConstant(Expr *p){ + ** + ** When this routine returns true, it indicates that the expression + ** can be added to the pParse->pConstExpr list and evaluated once when +-** the prepared statement starts up. See sqlite3ExprCodeAtInit(). ++** the prepared statement starts up. See sqlite3ExprCodeRunJustOnce(). + */ + SQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr *p){ + return exprIsConst(p, 2, 0); +@@ -101520,6 +102370,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( + + /* Begin coding the subroutine */ + ExprSetProperty(pExpr, EP_Subrtn); ++ assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); + pExpr->y.sub.regReturn = ++pParse->nMem; + pExpr->y.sub.iAddr = + sqlite3VdbeAddOp2(v, OP_Integer, 0, pExpr->y.sub.regReturn) + 1; +@@ -101601,6 +102452,8 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( + affinity = sqlite3ExprAffinity(pLeft); + if( affinity<=SQLITE_AFF_NONE ){ + affinity = SQLITE_AFF_BLOB; ++ }else if( affinity==SQLITE_AFF_REAL ){ ++ affinity = SQLITE_AFF_NUMERIC; + } + if( pKeyInfo ){ + assert( sqlite3KeyInfoIsWriteable(pKeyInfo) ); +@@ -101839,7 +102692,9 @@ static void sqlite3ExprCodeIN( + int destNotNull; /* Jump here if a comparison is not true in step 6 */ + int addrTop; /* Top of the step-6 loop */ + int iTab = 0; /* Index to use */ ++ u8 okConstFactor = pParse->okConstFactor; + ++ assert( !ExprHasVVAProperty(pExpr,EP_Immutable) ); + pLeft = pExpr->pLeft; + if( sqlite3ExprCheckIN(pParse, pExpr) ) return; + zAff = exprINAffinity(pParse, pExpr); +@@ -101882,8 +102737,14 @@ static void sqlite3ExprCodeIN( + ** so that the fields are in the same order as an existing index. The + ** aiMap[] array contains a mapping from the original LHS field order to + ** the field order that matches the RHS index. +- */ ++ ** ++ ** Avoid factoring the LHS of the IN(...) expression out of the loop, ++ ** even if it is constant, as OP_Affinity may be used on the register ++ ** by code generated below. */ ++ assert( pParse->okConstFactor==okConstFactor ); ++ pParse->okConstFactor = 0; + rLhsOrig = exprCodeVector(pParse, pLeft, &iDummy); ++ pParse->okConstFactor = okConstFactor; + for(i=0; ipLeft)==SQLITE_AFF_REAL; + for(ii=0; iinExpr; ii++){ +- if( bLhsReal ){ +- r2 = regToFree = sqlite3GetTempReg(pParse); +- sqlite3ExprCode(pParse, pList->a[ii].pExpr, r2); +- sqlite3VdbeAddOp4(v, OP_Affinity, r2, 1, 0, "E", P4_STATIC); +- }else{ +- r2 = sqlite3ExprCodeTemp(pParse, pList->a[ii].pExpr, ®ToFree); +- } ++ r2 = sqlite3ExprCodeTemp(pParse, pList->a[ii].pExpr, ®ToFree); + if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){ + sqlite3VdbeAddOp3(v, OP_BitAnd, regCkNull, r2, regCkNull); + } +@@ -102166,7 +103019,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn( + }else{ + iAddr = 0; + } +- sqlite3ExprCode(pParse, pCol->pDflt, regOut); ++ sqlite3ExprCodeCopy(pParse, pCol->pDflt, regOut); + if( pCol->affinity>=SQLITE_AFF_TEXT ){ + sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1); + } +@@ -102307,6 +103160,16 @@ static int exprCodeVector(Parse *pParse, Expr *p, int *piFreeable){ + return iResult; + } + ++/* ++** If the last opcode is a OP_Copy, then set the do-not-merge flag (p5) ++** so that a subsequent copy will not be merged into this one. ++*/ ++static void setDoNotMergeFlagOnCopy(Vdbe *v){ ++ if( sqlite3VdbeGetOp(v, -1)->opcode==OP_Copy ){ ++ sqlite3VdbeChangeP5(v, 1); /* Tag trailing OP_Copy as not mergable */ ++ } ++} ++ + /* + ** Generate code to implement special SQL functions that are implemented + ** in-line rather than by using the usual callbacks. +@@ -102338,12 +103201,17 @@ static int exprCodeInlineFunction( + VdbeCoverage(v); + sqlite3ExprCode(pParse, pFarg->a[i].pExpr, target); + } +- if( sqlite3VdbeGetOp(v, -1)->opcode==OP_Copy ){ +- sqlite3VdbeChangeP5(v, 1); /* Tag trailing OP_Copy as not mergable */ +- } ++ setDoNotMergeFlagOnCopy(v); + sqlite3VdbeResolveLabel(v, endCoalesce); + break; + } ++ case INLINEFUNC_iif: { ++ Expr caseExpr; ++ memset(&caseExpr, 0, sizeof(caseExpr)); ++ caseExpr.op = TK_CASE; ++ caseExpr.x.pList = pFarg; ++ return sqlite3ExprCodeTarget(pParse, &caseExpr, target); ++ } + + default: { + /* The UNLIKELY() function is a no-op. The result is the value +@@ -102442,18 +103310,31 @@ expr_code_doover: + if( pExpr==0 ){ + op = TK_NULL; + }else{ ++ assert( !ExprHasVVAProperty(pExpr,EP_Immutable) ); + op = pExpr->op; + } + switch( op ){ + case TK_AGG_COLUMN: { + AggInfo *pAggInfo = pExpr->pAggInfo; +- struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg]; ++ struct AggInfo_col *pCol; ++ assert( pAggInfo!=0 ); ++ assert( pExpr->iAgg>=0 && pExpr->iAggnColumn ); ++ pCol = &pAggInfo->aCol[pExpr->iAgg]; + if( !pAggInfo->directMode ){ + assert( pCol->iMem>0 ); + return pCol->iMem; + }else if( pAggInfo->useSortingIdx ){ ++ Table *pTab = pCol->pTab; + sqlite3VdbeAddOp3(v, OP_Column, pAggInfo->sortingIdxPTab, + pCol->iSorterColumn, target); ++ if( pCol->iColumn<0 ){ ++ VdbeComment((v,"%s.rowid",pTab->zName)); ++ }else{ ++ VdbeComment((v,"%s.%s",pTab->zName,pTab->aCol[pCol->iColumn].zName)); ++ if( pTab->aCol[pCol->iColumn].affinity==SQLITE_AFF_REAL ){ ++ sqlite3VdbeAddOp1(v, OP_RealAffinity, target); ++ } ++ } + return target; + } + /* Otherwise, fall thru into the TK_COLUMN case */ +@@ -102479,10 +103360,6 @@ expr_code_doover: + static const char zAff[] = "B\000C\000D\000E"; + assert( SQLITE_AFF_BLOB=='A' ); + assert( SQLITE_AFF_TEXT=='B' ); +- if( iReg!=target ){ +- sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target); +- iReg = target; +- } + sqlite3VdbeAddOp4(v, OP_Affinity, iReg, 1, 0, + &zAff[(aff-'B')*2], P4_STATIC); + } +@@ -102696,6 +103573,7 @@ expr_code_doover: + tempX.op = TK_INTEGER; + tempX.flags = EP_IntValue|EP_TokenOnly; + tempX.u.iValue = 0; ++ ExprClearVVAProperties(&tempX); + r1 = sqlite3ExprCodeTemp(pParse, &tempX, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free2); + sqlite3VdbeAddOp3(v, OP_Subtract, r2, r1, target); +@@ -102741,7 +103619,10 @@ expr_code_doover: + } + case TK_AGG_FUNCTION: { + AggInfo *pInfo = pExpr->pAggInfo; +- if( pInfo==0 ){ ++ if( pInfo==0 ++ || NEVER(pExpr->iAgg<0) ++ || NEVER(pExpr->iAgg>=pInfo->nFunc) ++ ){ + assert( !ExprHasProperty(pExpr, EP_IntValue) ); + sqlite3ErrorMsg(pParse, "misuse of aggregate: %s()", pExpr->u.zToken); + }else{ +@@ -102767,16 +103648,13 @@ expr_code_doover: + #endif + + if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ +- /* SQL functions can be expensive. So try to move constant functions +- ** out of the inner loop, even if that means an extra OP_Copy. */ +- return sqlite3ExprCodeAtInit(pParse, pExpr, -1); ++ /* SQL functions can be expensive. So try to avoid running them ++ ** multiple times if we know they always give the same result */ ++ return sqlite3ExprCodeRunJustOnce(pParse, pExpr, -1); + } + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); +- if( ExprHasProperty(pExpr, EP_TokenOnly) ){ +- pFarg = 0; +- }else{ +- pFarg = pExpr->x.pList; +- } ++ assert( !ExprHasProperty(pExpr, EP_TokenOnly) ); ++ pFarg = pExpr->x.pList; + nFarg = pFarg ? pFarg->nExpr : 0; + assert( !ExprHasProperty(pExpr, EP_IntValue) ); + zId = pExpr->u.zToken; +@@ -103111,6 +103989,7 @@ expr_code_doover: + sqlite3VdbeAddOp2(v, OP_Null, 0, target); + } + sqlite3ExprDelete(db, pDel); ++ setDoNotMergeFlagOnCopy(v); + sqlite3VdbeResolveLabel(v, endLabel); + break; + } +@@ -103121,7 +104000,7 @@ expr_code_doover: + || pExpr->affExpr==OE_Fail + || pExpr->affExpr==OE_Ignore + ); +- if( !pParse->pTriggerTab ){ ++ if( !pParse->pTriggerTab && !pParse->nested ){ + sqlite3ErrorMsg(pParse, + "RAISE() may only be used within a trigger-program"); + return 0; +@@ -103135,8 +104014,9 @@ expr_code_doover: + v, OP_Halt, SQLITE_OK, OE_Ignore, 0, pExpr->u.zToken,0); + VdbeCoverage(v); + }else{ +- sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_TRIGGER, +- pExpr->affExpr, pExpr->u.zToken, 0, 0); ++ sqlite3HaltConstraint(pParse, ++ pParse->pTriggerTab ? SQLITE_CONSTRAINT_TRIGGER : SQLITE_ERROR, ++ pExpr->affExpr, pExpr->u.zToken, 0, 0); + } + + break; +@@ -103149,15 +104029,23 @@ expr_code_doover: + } + + /* +-** Factor out the code of the given expression to initialization time. ++** Generate code that will evaluate expression pExpr just one time ++** per prepared statement execution. ++** ++** If the expression uses functions (that might throw an exception) then ++** guard them with an OP_Once opcode to ensure that the code is only executed ++** once. If no functions are involved, then factor the code out and put it at ++** the end of the prepared statement in the initialization section. + ** + ** If regDest>=0 then the result is always stored in that register and the + ** result is not reusable. If regDest<0 then this routine is free to + ** store the value whereever it wants. The register where the expression +-** is stored is returned. When regDest<0, two identical expressions will +-** code to the same register. ++** is stored is returned. When regDest<0, two identical expressions might ++** code to the same register, if they do not contain function calls and hence ++** are factored out into the initialization section at the end of the ++** prepared statement. + */ +-SQLITE_PRIVATE int sqlite3ExprCodeAtInit( ++SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce( + Parse *pParse, /* Parsing context */ + Expr *pExpr, /* The expression to code when the VDBE initializes */ + int regDest /* Store the value in this register */ +@@ -103175,14 +104063,29 @@ SQLITE_PRIVATE int sqlite3ExprCodeAtInit( + } + } + pExpr = sqlite3ExprDup(pParse->db, pExpr, 0); +- p = sqlite3ExprListAppend(pParse, p, pExpr); +- if( p ){ +- struct ExprList_item *pItem = &p->a[p->nExpr-1]; +- pItem->reusable = regDest<0; +- if( regDest<0 ) regDest = ++pParse->nMem; +- pItem->u.iConstExprReg = regDest; ++ if( pExpr!=0 && ExprHasProperty(pExpr, EP_HasFunc) ){ ++ Vdbe *v = pParse->pVdbe; ++ int addr; ++ assert( v ); ++ addr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); ++ pParse->okConstFactor = 0; ++ if( !pParse->db->mallocFailed ){ ++ if( regDest<0 ) regDest = ++pParse->nMem; ++ sqlite3ExprCode(pParse, pExpr, regDest); ++ } ++ pParse->okConstFactor = 1; ++ sqlite3ExprDelete(pParse->db, pExpr); ++ sqlite3VdbeJumpHere(v, addr); ++ }else{ ++ p = sqlite3ExprListAppend(pParse, p, pExpr); ++ if( p ){ ++ struct ExprList_item *pItem = &p->a[p->nExpr-1]; ++ pItem->reusable = regDest<0; ++ if( regDest<0 ) regDest = ++pParse->nMem; ++ pItem->u.iConstExprReg = regDest; ++ } ++ pParse->pConstExpr = p; + } +- pParse->pConstExpr = p; + return regDest; + } + +@@ -103207,7 +104110,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *pReg){ + && sqlite3ExprIsConstantNotJoin(pExpr) + ){ + *pReg = 0; +- r2 = sqlite3ExprCodeAtInit(pParse, pExpr, -1); ++ r2 = sqlite3ExprCodeRunJustOnce(pParse, pExpr, -1); + }else{ + int r1 = sqlite3GetTempReg(pParse); + r2 = sqlite3ExprCodeTarget(pParse, pExpr, r1); +@@ -103229,6 +104132,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *pReg){ + SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){ + int inReg; + ++ assert( pExpr==0 || !ExprHasVVAProperty(pExpr,EP_Immutable) ); + assert( target>0 && target<=pParse->nMem ); + inReg = sqlite3ExprCodeTarget(pParse, pExpr, target); + assert( pParse->pVdbe!=0 || pParse->db->mallocFailed ); +@@ -103263,9 +104167,9 @@ SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse *pParse, Expr *pExpr, int target){ + */ + SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr, int target){ + if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){ +- sqlite3ExprCodeAtInit(pParse, pExpr, target); ++ sqlite3ExprCodeRunJustOnce(pParse, pExpr, target); + }else{ +- sqlite3ExprCode(pParse, pExpr, target); ++ sqlite3ExprCodeCopy(pParse, pExpr, target); + } + } + +@@ -103323,7 +104227,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeExprList( + }else if( (flags & SQLITE_ECEL_FACTOR)!=0 + && sqlite3ExprIsConstantNotJoin(pExpr) + ){ +- sqlite3ExprCodeAtInit(pParse, pExpr, target+i); ++ sqlite3ExprCodeRunJustOnce(pParse, pExpr, target+i); + }else{ + int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i); + if( inReg!=target+i ){ +@@ -103446,6 +104350,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int + assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); + if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ + if( NEVER(pExpr==0) ) return; /* No way this can happen */ ++ assert( !ExprHasVVAProperty(pExpr, EP_Immutable) ); + op = pExpr->op; + switch( op ){ + case TK_AND: +@@ -103587,6 +104492,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int + assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); + if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ + if( pExpr==0 ) return; ++ assert( !ExprHasVVAProperty(pExpr,EP_Immutable) ); + + /* The value of pExpr->op and op are related as follows: + ** +@@ -103870,7 +104776,7 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTa + } + if( (pA->flags & (EP_Distinct|EP_Commuted)) + != (pB->flags & (EP_Distinct|EP_Commuted)) ) return 2; +- if( (combinedFlags & EP_TokenOnly)==0 ){ ++ if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){ + if( combinedFlags & EP_xIsSelect ) return 2; + if( (combinedFlags & EP_FixedCol)==0 + && sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2; +@@ -103878,24 +104784,10 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTa + if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2; + if( pA->op!=TK_STRING + && pA->op!=TK_TRUEFALSE +- && (combinedFlags & EP_Reduced)==0 ++ && ALWAYS((combinedFlags & EP_Reduced)==0) + ){ + if( pA->iColumn!=pB->iColumn ) return 2; +- if( pA->op2!=pB->op2 ){ +- if( pA->op==TK_TRUTH ) return 2; +- if( pA->op==TK_FUNCTION && iTab<0 ){ +- /* Ex: CREATE TABLE t1(a CHECK( aop2!=pB->op2 && pA->op==TK_TRUTH ) return 2; + if( pA->op!=TK_IN && pA->iTable!=pB->iTable && pA->iTable!=iTab ){ + return 2; + } +@@ -104133,19 +105025,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){ + case TK_LT: + case TK_LE: + case TK_GT: +- case TK_GE: ++ case TK_GE: { ++ Expr *pLeft = pExpr->pLeft; ++ Expr *pRight = pExpr->pRight; + testcase( pExpr->op==TK_EQ ); + testcase( pExpr->op==TK_NE ); + testcase( pExpr->op==TK_LT ); + testcase( pExpr->op==TK_LE ); + testcase( pExpr->op==TK_GT ); + testcase( pExpr->op==TK_GE ); +- if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab)) +- || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab)) ++ /* The y.pTab=0 assignment in wherecode.c always happens after the ++ ** impliesNotNullRow() test */ ++ if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0) ++ && IsVirtual(pLeft->y.pTab)) ++ || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0) ++ && IsVirtual(pRight->y.pTab)) + ){ +- return WRC_Prune; ++ return WRC_Prune; + } +- ++ } + default: + return WRC_Continue; + } +@@ -104257,10 +105155,25 @@ SQLITE_PRIVATE int sqlite3ExprCoveredByIndex( + */ + struct SrcCount { + SrcList *pSrc; /* One particular FROM clause in a nested query */ ++ int iSrcInner; /* Smallest cursor number in this context */ + int nThis; /* Number of references to columns in pSrcList */ + int nOther; /* Number of references to columns in other FROM clauses */ + }; + ++/* ++** xSelect callback for sqlite3FunctionUsesThisSrc(). If this is the first ++** SELECT with a FROM clause encountered during this iteration, set ++** SrcCount.iSrcInner to the cursor number of the leftmost object in ++** the FROM cause. ++*/ ++static int selectSrcCount(Walker *pWalker, Select *pSel){ ++ struct SrcCount *p = pWalker->u.pSrcCount; ++ if( p->iSrcInner==0x7FFFFFFF && ALWAYS(pSel->pSrc) && pSel->pSrc->nSrc ){ ++ pWalker->u.pSrcCount->iSrcInner = pSel->pSrc->a[0].iCursor; ++ } ++ return WRC_Continue; ++} ++ + /* + ** Count the number of references to columns. + */ +@@ -104281,7 +105194,7 @@ static int exprSrcCount(Walker *pWalker, Expr *pExpr){ + } + if( inThis++; +- }else if( nSrc==0 || pExpr->iTablea[0].iCursor ){ ++ }else if( pExpr->iTableiSrcInner ){ + /* In a well-formed parse tree (no name resolution errors), + ** TK_COLUMN nodes with smaller Expr.iTable values are in an + ** outer context. Those are the only ones to count as "other" */ +@@ -104303,9 +105216,10 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pExpr, SrcList *pSrcList){ + assert( pExpr->op==TK_AGG_FUNCTION ); + memset(&w, 0, sizeof(w)); + w.xExprCallback = exprSrcCount; +- w.xSelectCallback = sqlite3SelectWalkNoop; ++ w.xSelectCallback = selectSrcCount; + w.u.pSrcCount = &cnt; + cnt.pSrc = pSrcList; ++ cnt.iSrcInner = (pSrcList&&pSrcList->nSrc)?pSrcList->a[0].iCursor:0x7FFFFFFF; + cnt.nThis = 0; + cnt.nOther = 0; + sqlite3WalkExprList(&w, pExpr->x.pList); +@@ -104317,6 +105231,64 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pExpr, SrcList *pSrcList){ + return cnt.nThis>0 || cnt.nOther==0; + } + ++/* ++** This is a Walker expression node callback. ++** ++** For Expr nodes that contain pAggInfo pointers, make sure the AggInfo ++** object that is referenced does not refer directly to the Expr. If ++** it does, make a copy. This is done because the pExpr argument is ++** subject to change. ++** ++** The copy is stored on pParse->pConstExpr with a register number of 0. ++** This will cause the expression to be deleted automatically when the ++** Parse object is destroyed, but the zero register number means that it ++** will not generate any code in the preamble. ++*/ ++static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){ ++ if( ALWAYS(!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced)) ++ && pExpr->pAggInfo!=0 ++ ){ ++ AggInfo *pAggInfo = pExpr->pAggInfo; ++ int iAgg = pExpr->iAgg; ++ Parse *pParse = pWalker->pParse; ++ sqlite3 *db = pParse->db; ++ assert( pExpr->op==TK_AGG_COLUMN || pExpr->op==TK_AGG_FUNCTION ); ++ if( pExpr->op==TK_AGG_COLUMN ){ ++ assert( iAgg>=0 && iAggnColumn ); ++ if( pAggInfo->aCol[iAgg].pExpr==pExpr ){ ++ pExpr = sqlite3ExprDup(db, pExpr, 0); ++ if( pExpr ){ ++ pAggInfo->aCol[iAgg].pExpr = pExpr; ++ pParse->pConstExpr = ++ sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr); ++ } ++ } ++ }else{ ++ assert( iAgg>=0 && iAggnFunc ); ++ if( pAggInfo->aFunc[iAgg].pExpr==pExpr ){ ++ pExpr = sqlite3ExprDup(db, pExpr, 0); ++ if( pExpr ){ ++ pAggInfo->aFunc[iAgg].pExpr = pExpr; ++ pParse->pConstExpr = ++ sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr); ++ } ++ } ++ } ++ } ++ return WRC_Continue; ++} ++ ++/* ++** Initialize a Walker object so that will persist AggInfo entries referenced ++** by the tree that is walked. ++*/ ++SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker *pWalker, Parse *pParse){ ++ memset(pWalker, 0, sizeof(*pWalker)); ++ pWalker->pParse = pParse; ++ pWalker->xExprCallback = agginfoPersistExprCb; ++ pWalker->xSelectCallback = sqlite3SelectWalkNoop; ++} ++ + /* + ** Add a new element to the pAggInfo->aCol[] array. Return the index of + ** the new element. Return a negative number if malloc fails. +@@ -104347,7 +105319,7 @@ static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ + &i + ); + return i; +-} ++} + + /* + ** This is the xExprCallback for a tree walker. It is used to +@@ -104480,15 +105452,6 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ + } + return WRC_Continue; + } +-static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ +- UNUSED_PARAMETER(pSelect); +- pWalker->walkerDepth++; +- return WRC_Continue; +-} +-static void analyzeAggregatesInSelectEnd(Walker *pWalker, Select *pSelect){ +- UNUSED_PARAMETER(pSelect); +- pWalker->walkerDepth--; +-} + + /* + ** Analyze the pExpr expression looking for aggregate functions and +@@ -104502,8 +105465,8 @@ static void analyzeAggregatesInSelectEnd(Walker *pWalker, Select *pSelect){ + SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){ + Walker w; + w.xExprCallback = analyzeAggregate; +- w.xSelectCallback = analyzeAggregatesInSelect; +- w.xSelectCallback2 = analyzeAggregatesInSelectEnd; ++ w.xSelectCallback = sqlite3WalkerDepthIncrease; ++ w.xSelectCallback2 = sqlite3WalkerDepthDecrease; + w.walkerDepth = 0; + w.u.pNC = pNC; + w.pParse = 0; +@@ -104742,7 +105705,10 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( + /* Check that a table or index named 'zName' does not already exist + ** in database iDb. If so, this is an error. + */ +- if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ ++ if( sqlite3FindTable(db, zName, zDb) ++ || sqlite3FindIndex(db, zName, zDb) ++ || sqlite3IsShadowTableOf(db, pTab, zName) ++ ){ + sqlite3ErrorMsg(pParse, + "there is already another table or index with this name: %s", zName); + goto exit_rename_table; +@@ -104874,6 +105840,22 @@ exit_rename_table: + db->mDbFlags = savedDbFlags; + } + ++/* ++** Write code that will raise an error if the table described by ++** zDb and zTab is not empty. ++*/ ++static void sqlite3ErrorIfNotEmpty( ++ Parse *pParse, /* Parsing context */ ++ const char *zDb, /* Schema holding the table */ ++ const char *zTab, /* Table to check for empty */ ++ const char *zErr /* Error message text */ ++){ ++ sqlite3NestedParse(pParse, ++ "SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"", ++ zErr, zDb, zTab ++ ); ++} ++ + /* + ** This function is called after an "ALTER TABLE ... ADD" statement + ** has been parsed. Argument pColDef contains the text of the new +@@ -104926,7 +105908,8 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ + return; + } + if( pNew->pIndex ){ +- sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column"); ++ sqlite3ErrorMsg(pParse, ++ "Cannot add a UNIQUE column"); + return; + } + if( (pCol->colFlags & COLFLAG_GENERATED)==0 ){ +@@ -104939,16 +105922,15 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ + pDflt = 0; + } + if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){ +- sqlite3ErrorMsg(pParse, ++ sqlite3ErrorIfNotEmpty(pParse, zDb, zTab, + "Cannot add a REFERENCES column with non-NULL default value"); +- return; + } + if( pCol->notNull && !pDflt ){ +- sqlite3ErrorMsg(pParse, ++ sqlite3ErrorIfNotEmpty(pParse, zDb, zTab, + "Cannot add a NOT NULL column with default value NULL"); +- return; + } + ++ + /* Ensure the default expression is something that sqlite3ValueFromExpr() + ** can handle (i.e. not CURRENT_TIME etc.) + */ +@@ -104962,14 +105944,13 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ + return; + } + if( !pVal ){ +- sqlite3ErrorMsg(pParse,"Cannot add a column with non-constant default"); +- return; ++ sqlite3ErrorIfNotEmpty(pParse, zDb, zTab, ++ "Cannot add a column with non-constant default"); + } + sqlite3ValueFree(pVal); + } + }else if( pCol->colFlags & COLFLAG_STORED ){ +- sqlite3ErrorMsg(pParse, "cannot add a STORED column"); +- return; ++ sqlite3ErrorIfNotEmpty(pParse, zDb, zTab, "cannot add a STORED column"); + } + + +@@ -105088,6 +106069,7 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){ + for(i=0; inCol; i++){ + Column *pCol = &pNew->aCol[i]; + pCol->zName = sqlite3DbStrDup(db, pCol->zName); ++ pCol->hName = sqlite3StrIHash(pCol->zName); + pCol->zColl = 0; + pCol->pDflt = 0; + } +@@ -105316,7 +106298,7 @@ SQLITE_PRIVATE void *sqlite3RenameTokenMap(Parse *pParse, void *pPtr, Token *pTo + RenameToken *pNew; + assert( pPtr || pParse->db->mallocFailed ); + renameTokenCheckAll(pParse, pPtr); +- if( pParse->eParseMode!=PARSE_MODE_UNMAP ){ ++ if( ALWAYS(pParse->eParseMode!=PARSE_MODE_UNMAP) ){ + pNew = sqlite3DbMallocZero(pParse->db, sizeof(RenameToken)); + if( pNew ){ + pNew->p = pPtr; +@@ -105374,6 +106356,21 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){ + } + } + ++/* ++** Unmap all tokens in the IdList object passed as the second argument. ++*/ ++static void unmapColumnIdlistNames( ++ Parse *pParse, ++ IdList *pIdList ++){ ++ if( pIdList ){ ++ int ii; ++ for(ii=0; iinId; ii++){ ++ sqlite3RenameTokenRemap(pParse, 0, (void*)pIdList->a[ii].zName); ++ } ++ } ++} ++ + /* + ** Walker callback used by sqlite3RenameExprUnmap(). + */ +@@ -105395,6 +106392,7 @@ static int renameUnmapSelectCb(Walker *pWalker, Select *p){ + for(i=0; inSrc; i++){ + sqlite3RenameTokenRemap(pParse, 0, (void*)pSrc->a[i].zName); + if( sqlite3WalkExpr(pWalker, pSrc->a[i].pOn) ) return WRC_Abort; ++ unmapColumnIdlistNames(pParse, pSrc->a[i].pUsing); + } + } + +@@ -105603,6 +106601,7 @@ static void renameColumnIdlistNames( + } + } + ++ + /* + ** Parse the SQL statement zSql using Parse object (*p). The Parse object + ** is initialized by this function before it is used. +@@ -106514,6 +107513,11 @@ static void openStatTable( + Vdbe *v = sqlite3GetVdbe(pParse); + int aRoot[ArraySize(aTable)]; + u8 aCreateTbl[ArraySize(aTable)]; ++#ifdef SQLITE_ENABLE_STAT4 ++ const int nToOpen = OptimizationEnabled(db,SQLITE_Stat4) ? 2 : 1; ++#else ++ const int nToOpen = 1; ++#endif + + if( v==0 ) return; + assert( sqlite3BtreeHoldsAllMutexes(db) ); +@@ -106526,8 +107530,9 @@ static void openStatTable( + for(i=0; izDbSName))==0 ){ +- if( aTable[i].zCols ){ ++ if( iregRoot. This is important +@@ -106543,7 +107548,6 @@ static void openStatTable( + ** associated with the table zWhere. If zWhere is NULL, delete the + ** entire contents of the table. */ + aRoot[i] = pStat->tnum; +- aCreateTbl[i] = 0; + sqlite3TableLock(pParse, iDb, aRoot[i], 1, zTab); + if( zWhere ){ + sqlite3NestedParse(pParse, +@@ -106562,7 +107566,7 @@ static void openStatTable( + } + + /* Open the sqlite_stat[134] tables for writing. */ +- for(i=0; aTable[i].zCols; i++){ ++ for(i=0; inRowid ){ + sqlite3DbFree(db, p->u.aRowid); +@@ -106631,7 +107640,7 @@ static void sampleClear(sqlite3 *db, Stat4Sample *p){ + /* Initialize the BLOB value of a ROWID + */ + #ifdef SQLITE_ENABLE_STAT4 +-static void sampleSetRowid(sqlite3 *db, Stat4Sample *p, int n, const u8 *pData){ ++static void sampleSetRowid(sqlite3 *db, StatSample *p, int n, const u8 *pData){ + assert( db!=0 ); + if( p->nRowid ) sqlite3DbFree(db, p->u.aRowid); + p->u.aRowid = sqlite3DbMallocRawNN(db, n); +@@ -106647,7 +107656,7 @@ static void sampleSetRowid(sqlite3 *db, Stat4Sample *p, int n, const u8 *pData){ + /* Initialize the INTEGER value of a ROWID. + */ + #ifdef SQLITE_ENABLE_STAT4 +-static void sampleSetRowidInt64(sqlite3 *db, Stat4Sample *p, i64 iRowid){ ++static void sampleSetRowidInt64(sqlite3 *db, StatSample *p, i64 iRowid){ + assert( db!=0 ); + if( p->nRowid ) sqlite3DbFree(db, p->u.aRowid); + p->nRowid = 0; +@@ -106660,7 +107669,7 @@ static void sampleSetRowidInt64(sqlite3 *db, Stat4Sample *p, i64 iRowid){ + ** Copy the contents of object (*pFrom) into (*pTo). + */ + #ifdef SQLITE_ENABLE_STAT4 +-static void sampleCopy(Stat4Accum *p, Stat4Sample *pTo, Stat4Sample *pFrom){ ++static void sampleCopy(StatAccum *p, StatSample *pTo, StatSample *pFrom){ + pTo->isPSample = pFrom->isPSample; + pTo->iCol = pFrom->iCol; + pTo->iHash = pFrom->iHash; +@@ -106676,40 +107685,41 @@ static void sampleCopy(Stat4Accum *p, Stat4Sample *pTo, Stat4Sample *pFrom){ + #endif + + /* +-** Reclaim all memory of a Stat4Accum structure. ++** Reclaim all memory of a StatAccum structure. + */ +-static void stat4Destructor(void *pOld){ +- Stat4Accum *p = (Stat4Accum*)pOld; ++static void statAccumDestructor(void *pOld){ ++ StatAccum *p = (StatAccum*)pOld; + #ifdef SQLITE_ENABLE_STAT4 +- int i; +- for(i=0; inCol; i++) sampleClear(p->db, p->aBest+i); +- for(i=0; imxSample; i++) sampleClear(p->db, p->a+i); +- sampleClear(p->db, &p->current); ++ if( p->mxSample ){ ++ int i; ++ for(i=0; inCol; i++) sampleClear(p->db, p->aBest+i); ++ for(i=0; imxSample; i++) sampleClear(p->db, p->a+i); ++ sampleClear(p->db, &p->current); ++ } + #endif + sqlite3DbFree(p->db, p); + } + + /* +-** Implementation of the stat_init(N,K,C) SQL function. The three parameters ++** Implementation of the stat_init(N,K,C,L) SQL function. The four parameters + ** are: + ** N: The number of columns in the index including the rowid/pk (note 1) + ** K: The number of columns in the index excluding the rowid/pk. +-** C: The number of rows in the index (note 2) ++** C: Estimated number of rows in the index ++** L: A limit on the number of rows to scan, or 0 for no-limit + ** + ** Note 1: In the special case of the covering index that implements a + ** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the + ** total number of columns in the table. + ** +-** Note 2: C is only used for STAT4. +-** + ** For indexes on ordinary rowid tables, N==K+1. But for indexes on + ** WITHOUT ROWID tables, N=K+P where P is the number of columns in the + ** PRIMARY KEY of the table. The covering index that implements the + ** original WITHOUT ROWID table as N==K as a special case. + ** +-** This routine allocates the Stat4Accum object in heap memory. The return +-** value is a pointer to the Stat4Accum object. The datatype of the +-** return value is BLOB, but it is really just a pointer to the Stat4Accum ++** This routine allocates the StatAccum object in heap memory. The return ++** value is a pointer to the StatAccum object. The datatype of the ++** return value is BLOB, but it is really just a pointer to the StatAccum + ** object. + */ + static void statInit( +@@ -106717,14 +107727,15 @@ static void statInit( + int argc, + sqlite3_value **argv + ){ +- Stat4Accum *p; ++ StatAccum *p; + int nCol; /* Number of columns in index being sampled */ + int nKeyCol; /* Number of key columns */ + int nColUp; /* nCol rounded up for alignment */ + int n; /* Bytes of space to allocate */ +- sqlite3 *db; /* Database connection */ ++ sqlite3 *db = sqlite3_context_db_handle(context); /* Database connection */ + #ifdef SQLITE_ENABLE_STAT4 +- int mxSample = SQLITE_STAT4_SAMPLES; ++ /* Maximum number of samples. 0 if STAT4 data is not collected */ ++ int mxSample = OptimizationEnabled(db,SQLITE_Stat4) ?SQLITE_STAT4_SAMPLES :0; + #endif + + /* Decode the three function arguments */ +@@ -106736,16 +107747,17 @@ static void statInit( + assert( nKeyCol<=nCol ); + assert( nKeyCol>0 ); + +- /* Allocate the space required for the Stat4Accum object */ ++ /* Allocate the space required for the StatAccum object */ + n = sizeof(*p) +- + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ +- + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ ++ + sizeof(tRowcnt)*nColUp /* StatAccum.anEq */ ++ + sizeof(tRowcnt)*nColUp; /* StatAccum.anDLt */ + #ifdef SQLITE_ENABLE_STAT4 +- + sizeof(tRowcnt)*nColUp /* Stat4Accum.anLt */ +- + sizeof(Stat4Sample)*(nCol+mxSample) /* Stat4Accum.aBest[], a[] */ +- + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample) ++ if( mxSample ){ ++ n += sizeof(tRowcnt)*nColUp /* StatAccum.anLt */ ++ + sizeof(StatSample)*(nCol+mxSample) /* StatAccum.aBest[], a[] */ ++ + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample); ++ } + #endif +- ; + db = sqlite3_context_db_handle(context); + p = sqlite3DbMallocZero(db, n); + if( p==0 ){ +@@ -106754,25 +107766,28 @@ static void statInit( + } + + p->db = db; ++ p->nEst = sqlite3_value_int64(argv[2]); + p->nRow = 0; ++ p->nLimit = sqlite3_value_int64(argv[3]); + p->nCol = nCol; + p->nKeyCol = nKeyCol; ++ p->nSkipAhead = 0; + p->current.anDLt = (tRowcnt*)&p[1]; + p->current.anEq = &p->current.anDLt[nColUp]; + + #ifdef SQLITE_ENABLE_STAT4 +- { ++ p->mxSample = p->nLimit==0 ? mxSample : 0; ++ if( mxSample ){ + u8 *pSpace; /* Allocated space not yet assigned */ + int i; /* Used to iterate through p->aSample[] */ + + p->iGet = -1; +- p->mxSample = mxSample; +- p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); ++ p->nPSample = (tRowcnt)(p->nEst/(mxSample/3+1) + 1); + p->current.anLt = &p->current.anEq[nColUp]; + p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]); + +- /* Set up the Stat4Accum.a[] and aBest[] arrays */ +- p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; ++ /* Set up the StatAccum.a[] and aBest[] arrays */ ++ p->a = (struct StatSample*)&p->current.anLt[nColUp]; + p->aBest = &p->a[mxSample]; + pSpace = (u8*)(&p->a[mxSample+nCol]); + for(i=0; i<(mxSample+nCol); i++){ +@@ -106792,10 +107807,10 @@ static void statInit( + ** only the pointer (the 2nd parameter) matters. The size of the object + ** (given by the 3rd parameter) is never used and can be any positive + ** value. */ +- sqlite3_result_blob(context, p, sizeof(*p), stat4Destructor); ++ sqlite3_result_blob(context, p, sizeof(*p), statAccumDestructor); + } + static const FuncDef statInitFuncdef = { +- 2+IsStat4, /* nArg */ ++ 4, /* nArg */ + SQLITE_UTF8, /* funcFlags */ + 0, /* pUserData */ + 0, /* pNext */ +@@ -106819,9 +107834,9 @@ static const FuncDef statInitFuncdef = { + ** the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. + */ + static int sampleIsBetterPost( +- Stat4Accum *pAccum, +- Stat4Sample *pNew, +- Stat4Sample *pOld ++ StatAccum *pAccum, ++ StatSample *pNew, ++ StatSample *pOld + ){ + int nCol = pAccum->nCol; + int i; +@@ -106843,9 +107858,9 @@ static int sampleIsBetterPost( + ** the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. + */ + static int sampleIsBetter( +- Stat4Accum *pAccum, +- Stat4Sample *pNew, +- Stat4Sample *pOld ++ StatAccum *pAccum, ++ StatSample *pNew, ++ StatSample *pOld + ){ + tRowcnt nEqNew = pNew->anEq[pNew->iCol]; + tRowcnt nEqOld = pOld->anEq[pOld->iCol]; +@@ -106865,21 +107880,21 @@ static int sampleIsBetter( + ** Copy the contents of sample *pNew into the p->a[] array. If necessary, + ** remove the least desirable sample from p->a[] to make room. + */ +-static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ +- Stat4Sample *pSample = 0; ++static void sampleInsert(StatAccum *p, StatSample *pNew, int nEqZero){ ++ StatSample *pSample = 0; + int i; + + assert( IsStat4 || nEqZero==0 ); + +- /* Stat4Accum.nMaxEqZero is set to the maximum number of leading 0 +- ** values in the anEq[] array of any sample in Stat4Accum.a[]. In ++ /* StatAccum.nMaxEqZero is set to the maximum number of leading 0 ++ ** values in the anEq[] array of any sample in StatAccum.a[]. In + ** other words, if nMaxEqZero is n, then it is guaranteed that there +- ** are no samples with Stat4Sample.anEq[m]==0 for (m>=n). */ ++ ** are no samples with StatSample.anEq[m]==0 for (m>=n). */ + if( nEqZero>p->nMaxEqZero ){ + p->nMaxEqZero = nEqZero; + } + if( pNew->isPSample==0 ){ +- Stat4Sample *pUpgrade = 0; ++ StatSample *pUpgrade = 0; + assert( pNew->anEq[pNew->iCol]>0 ); + + /* This sample is being added because the prefix that ends in column +@@ -106888,7 +107903,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ + ** this one. Instead, upgrade the priority of the highest priority + ** existing sample that shares this prefix. */ + for(i=p->nSample-1; i>=0; i--){ +- Stat4Sample *pOld = &p->a[i]; ++ StatSample *pOld = &p->a[i]; + if( pOld->anEq[pNew->iCol]==0 ){ + if( pOld->isPSample ) return; + assert( pOld->iCol>pNew->iCol ); +@@ -106907,7 +107922,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ + + /* If necessary, remove sample iMin to make room for the new sample. */ + if( p->nSample>=p->mxSample ){ +- Stat4Sample *pMin = &p->a[p->iMin]; ++ StatSample *pMin = &p->a[p->iMin]; + tRowcnt *anEq = pMin->anEq; + tRowcnt *anLt = pMin->anLt; + tRowcnt *anDLt = pMin->anDLt; +@@ -106950,20 +107965,20 @@ find_new_min: + } + #endif /* SQLITE_ENABLE_STAT4 */ + ++#ifdef SQLITE_ENABLE_STAT4 + /* + ** Field iChng of the index being scanned has changed. So at this point + ** p->current contains a sample that reflects the previous row of the + ** index. The value of anEq[iChng] and subsequent anEq[] elements are + ** correct at this point. + */ +-static void samplePushPrevious(Stat4Accum *p, int iChng){ +-#ifdef SQLITE_ENABLE_STAT4 ++static void samplePushPrevious(StatAccum *p, int iChng){ + int i; + + /* Check if any samples from the aBest[] array should be pushed + ** into IndexSample.a[] at this point. */ + for(i=(p->nCol-2); i>=iChng; i--){ +- Stat4Sample *pBest = &p->aBest[i]; ++ StatSample *pBest = &p->aBest[i]; + pBest->anEq[i] = p->current.anEq[i]; + if( p->nSamplemxSample || sampleIsBetter(p, pBest, &p->a[p->iMin]) ){ + sampleInsert(p, pBest, i); +@@ -106987,27 +108002,25 @@ static void samplePushPrevious(Stat4Accum *p, int iChng){ + } + p->nMaxEqZero = iChng; + } +-#endif +- +-#ifndef SQLITE_ENABLE_STAT4 +- UNUSED_PARAMETER( p ); +- UNUSED_PARAMETER( iChng ); +-#endif + } ++#endif /* SQLITE_ENABLE_STAT4 */ + + /* + ** Implementation of the stat_push SQL function: stat_push(P,C,R) + ** Arguments: + ** +-** P Pointer to the Stat4Accum object created by stat_init() ++** P Pointer to the StatAccum object created by stat_init() + ** C Index of left-most column to differ from previous row + ** R Rowid for the current row. Might be a key record for + ** WITHOUT ROWID tables. + ** +-** This SQL function always returns NULL. It's purpose it to accumulate +-** statistical data and/or samples in the Stat4Accum object about the +-** index being analyzed. The stat_get() SQL function will later be used to +-** extract relevant information for constructing the sqlite_statN tables. ++** The purpose of this routine is to collect statistical data and/or ++** samples from the index being analyzed into the StatAccum object. ++** The stat_get() SQL function will be used afterwards to ++** retrieve the information gathered. ++** ++** This SQL function usually returns NULL, but might return an integer ++** if it wants the byte-code to do special processing. + ** + ** The R parameter is only used for STAT4 + */ +@@ -107019,7 +108032,7 @@ static void statPush( + int i; + + /* The three function arguments */ +- Stat4Accum *p = (Stat4Accum*)sqlite3_value_blob(argv[0]); ++ StatAccum *p = (StatAccum*)sqlite3_value_blob(argv[0]); + int iChng = sqlite3_value_int(argv[1]); + + UNUSED_PARAMETER( argc ); +@@ -107032,7 +108045,9 @@ static void statPush( + for(i=0; inCol; i++) p->current.anEq[i] = 1; + }else{ + /* Second and subsequent calls get processed here */ +- samplePushPrevious(p, iChng); ++#ifdef SQLITE_ENABLE_STAT4 ++ if( p->mxSample ) samplePushPrevious(p, iChng); ++#endif + + /* Update anDLt[], anLt[] and anEq[] to reflect the values that apply + ** to the current row of the index. */ +@@ -107042,26 +108057,25 @@ static void statPush( + for(i=iChng; inCol; i++){ + p->current.anDLt[i]++; + #ifdef SQLITE_ENABLE_STAT4 +- p->current.anLt[i] += p->current.anEq[i]; ++ if( p->mxSample ) p->current.anLt[i] += p->current.anEq[i]; + #endif + p->current.anEq[i] = 1; + } + } +- p->nRow++; +-#ifdef SQLITE_ENABLE_STAT4 +- if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){ +- sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2])); +- }else{ +- sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]), +- sqlite3_value_blob(argv[2])); +- } +- p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345; +-#endif + ++ p->nRow++; + #ifdef SQLITE_ENABLE_STAT4 +- { +- tRowcnt nLt = p->current.anLt[p->nCol-1]; ++ if( p->mxSample ){ ++ tRowcnt nLt; ++ if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){ ++ sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2])); ++ }else{ ++ sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]), ++ sqlite3_value_blob(argv[2])); ++ } ++ p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345; + ++ nLt = p->current.anLt[p->nCol-1]; + /* Check if this is to be a periodic sample. If so, add it. */ + if( (nLt/p->nPSample)!=(nLt+1)/p->nPSample ){ + p->current.isPSample = 1; +@@ -107077,9 +108091,14 @@ static void statPush( + sampleCopy(p, &p->aBest[i], &p->current); + } + } +- } ++ }else + #endif ++ if( p->nLimit && p->nRow>(tRowcnt)p->nLimit*(p->nSkipAhead+1) ){ ++ p->nSkipAhead++; ++ sqlite3_result_int(context, p->current.anDLt[0]>0); ++ } + } ++ + static const FuncDef statPushFuncdef = { + 2+IsStat4, /* nArg */ + SQLITE_UTF8, /* funcFlags */ +@@ -107101,15 +108120,15 @@ static const FuncDef statPushFuncdef = { + /* + ** Implementation of the stat_get(P,J) SQL function. This routine is + ** used to query statistical information that has been gathered into +-** the Stat4Accum object by prior calls to stat_push(). The P parameter +-** has type BLOB but it is really just a pointer to the Stat4Accum object. ++** the StatAccum object by prior calls to stat_push(). The P parameter ++** has type BLOB but it is really just a pointer to the StatAccum object. + ** The content to returned is determined by the parameter J + ** which is one of the STAT_GET_xxxx values defined above. + ** + ** The stat_get(P,J) function is not available to generic SQL. It is + ** inserted as part of a manually constructed bytecode program. (See + ** the callStatGet() routine below.) It is guaranteed that the P +-** parameter will always be a poiner to a Stat4Accum object, never a ++** parameter will always be a pointer to a StatAccum object, never a + ** NULL. + ** + ** If STAT4 is not enabled, then J is always +@@ -107122,7 +108141,7 @@ static void statGet( + int argc, + sqlite3_value **argv + ){ +- Stat4Accum *p = (Stat4Accum*)sqlite3_value_blob(argv[0]); ++ StatAccum *p = (StatAccum*)sqlite3_value_blob(argv[0]); + #ifdef SQLITE_ENABLE_STAT4 + /* STAT4 has a parameter on this routine. */ + int eCall = sqlite3_value_int(argv[1]); +@@ -107131,6 +108150,7 @@ static void statGet( + || eCall==STAT_GET_ROWID || eCall==STAT_GET_NLT + || eCall==STAT_GET_NDLT + ); ++ assert( eCall==STAT_GET_STAT1 || p->mxSample ); + if( eCall==STAT_GET_STAT1 ) + #else + assert( argc==1 ); +@@ -107143,7 +108163,7 @@ static void statGet( + ** the index. The first integer in the list is the total number of + ** entries in the index. There is one additional integer in the list + ** for each indexed column. This additional integer is an estimate of +- ** the number of rows matched by a stabbing query on the index using ++ ** the number of rows matched by a equality query on the index using + ** a key with the corresponding number of fields. In other words, + ** if the index is on columns (a,b) and the sqlite_stat1 value is + ** "100 10 2", then SQLite estimates that: +@@ -107166,7 +108186,8 @@ static void statGet( + return; + } + +- sqlite3_snprintf(24, zRet, "%llu", (u64)p->nRow); ++ sqlite3_snprintf(24, zRet, "%llu", ++ p->nSkipAhead ? (u64)p->nEst : (u64)p->nRow); + z = zRet + sqlite3Strlen30(zRet); + for(i=0; inKeyCol; i++){ + u64 nDistinct = p->current.anDLt[i] + 1; +@@ -107186,7 +108207,7 @@ static void statGet( + p->iGet = 0; + } + if( p->iGetnSample ){ +- Stat4Sample *pS = p->a + p->iGet; ++ StatSample *pS = p->a + p->iGet; + if( pS->nRowid==0 ){ + sqlite3_result_int64(context, pS->u.iRowid); + }else{ +@@ -107242,16 +108263,16 @@ static const FuncDef statGetFuncdef = { + {0} + }; + +-static void callStatGet(Parse *pParse, int regStat4, int iParam, int regOut){ ++static void callStatGet(Parse *pParse, int regStat, int iParam, int regOut){ + #ifdef SQLITE_ENABLE_STAT4 +- sqlite3VdbeAddOp2(pParse->pVdbe, OP_Integer, iParam, regStat4+1); ++ sqlite3VdbeAddOp2(pParse->pVdbe, OP_Integer, iParam, regStat+1); + #elif SQLITE_DEBUG + assert( iParam==STAT_GET_STAT1 ); + #else + UNUSED_PARAMETER( iParam ); + #endif +- assert( regOut!=regStat4 && regOut!=regStat4+1 ); +- sqlite3VdbeAddFunctionCall(pParse, 0, regStat4, regOut, 1+IsStat4, ++ assert( regOut!=regStat && regOut!=regStat+1 ); ++ sqlite3VdbeAddFunctionCall(pParse, 0, regStat, regOut, 1+IsStat4, + &statGetFuncdef, 0); + } + +@@ -107277,12 +108298,11 @@ static void analyzeOneTable( + int iDb; /* Index of database containing pTab */ + u8 needTableCnt = 1; /* True to count the table */ + int regNewRowid = iMem++; /* Rowid for the inserted record */ +- int regStat4 = iMem++; /* Register to hold Stat4Accum object */ ++ int regStat = iMem++; /* Register to hold StatAccum object */ + int regChng = iMem++; /* Index of changed index field */ +-#ifdef SQLITE_ENABLE_STAT4 + int regRowid = iMem++; /* Rowid argument passed to stat_push() */ +-#endif + int regTemp = iMem++; /* Temporary use register */ ++ int regTemp2 = iMem++; /* Second temporary use register */ + int regTabname = iMem++; /* Register containing table name */ + int regIdxname = iMem++; /* Register containing index name */ + int regStat1 = iMem++; /* Value for the stat column of sqlite_stat1 */ +@@ -107410,17 +108430,26 @@ static void analyzeOneTable( + ** (1) the number of columns in the index including the rowid + ** (or for a WITHOUT ROWID table, the number of PK columns), + ** (2) the number of columns in the key without the rowid/pk +- ** (3) the number of rows in the index, +- ** +- ** +- ** The third argument is only used for STAT4 ++ ** (3) estimated number of rows in the index, + */ ++ sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat+1); ++ assert( regRowid==regStat+2 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regRowid); + #ifdef SQLITE_ENABLE_STAT4 +- sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+3); ++ if( OptimizationEnabled(db, SQLITE_Stat4) ){ ++ sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regTemp); ++ addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur); ++ VdbeCoverage(v); ++ }else + #endif +- sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat4+1); +- sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regStat4+2); +- sqlite3VdbeAddFunctionCall(pParse, 0, regStat4+1, regStat4, 2+IsStat4, ++ { ++ addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur); ++ VdbeCoverage(v); ++ sqlite3VdbeAddOp3(v, OP_Count, iIdxCur, regTemp, 1); ++ } ++ assert( regTemp2==regStat+4 ); ++ sqlite3VdbeAddOp2(v, OP_Integer, db->nAnalysisLimit, regTemp2); ++ sqlite3VdbeAddFunctionCall(pParse, 0, regStat+1, regStat, 4, + &statInitFuncdef, 0); + + /* Implementation of the following: +@@ -107431,8 +108460,6 @@ static void analyzeOneTable( + ** goto next_push_0; + ** + */ +- addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur); +- VdbeCoverage(v); + sqlite3VdbeAddOp2(v, OP_Integer, 0, regChng); + addrNextRow = sqlite3VdbeCurrentAddr(v); + +@@ -107465,6 +108492,7 @@ static void analyzeOneTable( + char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]); + sqlite3VdbeAddOp2(v, OP_Integer, i, regChng); + sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp); ++ VdbeComment((v, "%s.column(%d)", pIdx->zName, i)); + aGotoChng[i] = + sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ); + sqlite3VdbeChangeP5(v, SQLITE_NULLEQ); +@@ -107485,6 +108513,7 @@ static void analyzeOneTable( + for(i=0; izName, i)); + } + sqlite3VdbeResolveLabel(v, endDistinctTest); + sqlite3DbFree(db, aGotoChng); +@@ -107498,30 +108527,46 @@ static void analyzeOneTable( + ** if !eof(csr) goto next_row; + */ + #ifdef SQLITE_ENABLE_STAT4 +- assert( regRowid==(regStat4+2) ); +- if( HasRowid(pTab) ){ +- sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid); +- }else{ +- Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable); +- int j, k, regKey; +- regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol); +- for(j=0; jnKeyCol; j++){ +- k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]); +- assert( k>=0 && knColumn ); +- sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j); +- VdbeComment((v, "%s", pTab->aCol[pPk->aiColumn[j]].zName)); ++ if( OptimizationEnabled(db, SQLITE_Stat4) ){ ++ assert( regRowid==(regStat+2) ); ++ if( HasRowid(pTab) ){ ++ sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid); ++ }else{ ++ Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable); ++ int j, k, regKey; ++ regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol); ++ for(j=0; jnKeyCol; j++){ ++ k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]); ++ assert( k>=0 && knColumn ); ++ sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j); ++ VdbeComment((v, "%s.column(%d)", pIdx->zName, i)); ++ } ++ sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid); ++ sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol); + } +- sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid); +- sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol); + } + #endif +- assert( regChng==(regStat4+1) ); +- sqlite3VdbeAddFunctionCall(pParse, 1, regStat4, regTemp, 2+IsStat4, +- &statPushFuncdef, 0); +- sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v); ++ assert( regChng==(regStat+1) ); ++ { ++ sqlite3VdbeAddFunctionCall(pParse, 1, regStat, regTemp, 2+IsStat4, ++ &statPushFuncdef, 0); ++ if( db->nAnalysisLimit ){ ++ int j1, j2, j3; ++ j1 = sqlite3VdbeAddOp1(v, OP_IsNull, regTemp); VdbeCoverage(v); ++ j2 = sqlite3VdbeAddOp1(v, OP_If, regTemp); VdbeCoverage(v); ++ j3 = sqlite3VdbeAddOp4Int(v, OP_SeekGT, iIdxCur, 0, regPrev, 1); ++ VdbeCoverage(v); ++ sqlite3VdbeJumpHere(v, j1); ++ sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v); ++ sqlite3VdbeJumpHere(v, j2); ++ sqlite3VdbeJumpHere(v, j3); ++ }else{ ++ sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v); ++ } ++ } + + /* Add the entry to the stat1 table. */ +- callStatGet(pParse, regStat4, STAT_GET_STAT1, regStat1); ++ callStatGet(pParse, regStat, STAT_GET_STAT1, regStat1); + assert( "BBB"[0]==SQLITE_AFF_TEXT ); + sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0); + sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid); +@@ -107533,7 +108578,7 @@ static void analyzeOneTable( + + /* Add the entries to the stat4 table. */ + #ifdef SQLITE_ENABLE_STAT4 +- { ++ if( OptimizationEnabled(db, SQLITE_Stat4) && db->nAnalysisLimit==0 ){ + int regEq = regStat1; + int regLt = regStat1+1; + int regDLt = regStat1+2; +@@ -107547,12 +108592,12 @@ static void analyzeOneTable( + pParse->nMem = MAX(pParse->nMem, regCol+nCol); + + addrNext = sqlite3VdbeCurrentAddr(v); +- callStatGet(pParse, regStat4, STAT_GET_ROWID, regSampleRowid); ++ callStatGet(pParse, regStat, STAT_GET_ROWID, regSampleRowid); + addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid); + VdbeCoverage(v); +- callStatGet(pParse, regStat4, STAT_GET_NEQ, regEq); +- callStatGet(pParse, regStat4, STAT_GET_NLT, regLt); +- callStatGet(pParse, regStat4, STAT_GET_NDLT, regDLt); ++ callStatGet(pParse, regStat, STAT_GET_NEQ, regEq); ++ callStatGet(pParse, regStat, STAT_GET_NLT, regLt); ++ callStatGet(pParse, regStat, STAT_GET_NDLT, regDLt); + sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0); + VdbeCoverage(v); + for(i=0; iaDb[iDb].zDbSName, zName)==0 ++ || (iDb==0 && sqlite3StrICmp("main", zName)==0) ++ ); ++} ++ + /* + ** An SQL user-function registered to do the work of an ATTACH statement. The + ** three arguments to the function come directly from an attach statement: +@@ -108318,9 +109374,8 @@ static void attachFunc( + goto attach_error; + } + for(i=0; inDb; i++){ +- char *z = db->aDb[i].zDbSName; +- assert( z && zName ); +- if( sqlite3StrICmp(z, zName)==0 ){ ++ assert( zName ); ++ if( sqlite3DbIsNamed(db, i, zName) ){ + zErrDyn = sqlite3MPrintf(db, "database %s is already in use", zName); + goto attach_error; + } +@@ -108388,43 +109443,7 @@ static void attachFunc( + if( rc==SQLITE_OK && pNew->zDbSName==0 ){ + rc = SQLITE_NOMEM_BKPT; + } +- +- +-#ifdef SQLITE_HAS_CODEC +- if( rc==SQLITE_OK ){ +- extern int sqlite3CodecAttach(sqlite3*, int, const void*, int); +- extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*); +- int nKey; +- char *zKey; +- int t = sqlite3_value_type(argv[2]); +- switch( t ){ +- case SQLITE_INTEGER: +- case SQLITE_FLOAT: +- zErrDyn = sqlite3DbStrDup(db, "Invalid key value"); +- rc = SQLITE_ERROR; +- break; +- +- case SQLITE_TEXT: +- case SQLITE_BLOB: +- nKey = sqlite3_value_bytes(argv[2]); +- zKey = (char *)sqlite3_value_blob(argv[2]); +- rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey); +- break; +- +- case SQLITE_NULL: +- /* No key specified. Use the key from URI filename, or if none, +- ** use the key from the main database. */ +- if( sqlite3CodecQueryParameters(db, zName, zPath)==0 ){ +- sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); +- if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){ +- rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey); +- } +- } +- break; +- } +- } +-#endif +- sqlite3_free( zPath ); ++ sqlite3_free_filename( zPath ); + + /* If the file was opened successfully, read the schema for the new database. + ** If this fails, or if opening the file failed, then close the file and +@@ -108509,7 +109528,7 @@ static void detachFunc( + for(i=0; inDb; i++){ + pDb = &db->aDb[i]; + if( pDb->pBt==0 ) continue; +- if( sqlite3StrICmp(pDb->zDbSName, zName)==0 ) break; ++ if( sqlite3DbIsNamed(db, i, zName) ) break; + } + + if( i>=db->nDb ){ +@@ -108700,20 +109719,21 @@ SQLITE_PRIVATE int sqlite3FixSrcList( + SrcList *pList /* The Source list to check and modify */ + ){ + int i; +- const char *zDb; + struct SrcList_item *pItem; ++ sqlite3 *db = pFix->pParse->db; ++ int iDb = sqlite3FindDbName(db, pFix->zDb); + + if( NEVER(pList==0) ) return 0; +- zDb = pFix->zDb; ++ + for(i=0, pItem=pList->a; inSrc; i++, pItem++){ + if( pFix->bTemp==0 ){ +- if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){ ++ if( pItem->zDatabase && iDb!=sqlite3FindDbName(db, pItem->zDatabase) ){ + sqlite3ErrorMsg(pFix->pParse, + "%s %T cannot reference objects in database %s", + pFix->zType, pFix->pName, pItem->zDatabase); + return 1; + } +- sqlite3DbFree(pFix->pParse->db, pItem->zDatabase); ++ sqlite3DbFree(db, pItem->zDatabase); + pItem->zDatabase = 0; + pItem->pSchema = pFix->pSchema; + pItem->fg.fromDDL = 1; +@@ -109330,12 +110350,21 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ + */ + sqlite3AutoincrementBegin(pParse); + +- /* Code constant expressions that where factored out of inner loops */ ++ /* Code constant expressions that where factored out of inner loops. ++ ** ++ ** The pConstExpr list might also contain expressions that we simply ++ ** want to keep around until the Parse object is deleted. Such ++ ** expressions have iConstExprReg==0. Do not generate code for ++ ** those expressions, of course. ++ */ + if( pParse->pConstExpr ){ + ExprList *pEL = pParse->pConstExpr; + pParse->okConstFactor = 0; + for(i=0; inExpr; i++){ +- sqlite3ExprCode(pParse, pEL->a[i].pExpr, pEL->a[i].u.iConstExprReg); ++ int iReg = pEL->a[i].u.iConstExprReg; ++ if( iReg>0 ){ ++ sqlite3ExprCode(pParse, pEL->a[i].pExpr, iReg); ++ } + } + } + +@@ -109435,22 +110464,39 @@ SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const cha + return 0; + } + #endif +- while(1){ +- for(i=OMIT_TEMPDB; inDb; i++){ +- int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ +- if( zDatabase==0 || sqlite3StrICmp(zDatabase, db->aDb[j].zDbSName)==0 ){ +- assert( sqlite3SchemaMutexHeld(db, j, 0) ); +- p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName); +- if( p ) return p; ++ if( zDatabase ){ ++ for(i=0; inDb; i++){ ++ if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break; ++ } ++ if( i>=db->nDb ){ ++ /* No match against the official names. But always match "main" ++ ** to schema 0 as a legacy fallback. */ ++ if( sqlite3StrICmp(zDatabase,"main")==0 ){ ++ i = 0; ++ }else{ ++ return 0; + } + } +- /* Not found. If the name we were looking for was temp.sqlite_master +- ** then change the name to sqlite_temp_master and try again. */ +- if( sqlite3StrICmp(zName, MASTER_NAME)!=0 ) break; +- if( sqlite3_stricmp(zDatabase, db->aDb[1].zDbSName)!=0 ) break; +- zName = TEMP_MASTER_NAME; ++ p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName); ++ if( p==0 && i==1 && sqlite3StrICmp(zName, MASTER_NAME)==0 ){ ++ /* All temp.sqlite_master to be an alias for sqlite_temp_master */ ++ p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, TEMP_MASTER_NAME); ++ } ++ }else{ ++ /* Match against TEMP first */ ++ p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, zName); ++ if( p ) return p; ++ /* The main database is second */ ++ p = sqlite3HashFind(&db->aDb[0].pSchema->tblHash, zName); ++ if( p ) return p; ++ /* Attached databases are in order of attachment */ ++ for(i=2; inDb; i++){ ++ assert( sqlite3SchemaMutexHeld(db, i, 0) ); ++ p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName); ++ if( p ) break; ++ } + } +- return 0; ++ return p; + } + + /* +@@ -109560,7 +110606,7 @@ SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const cha + int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ + Schema *pSchema = db->aDb[j].pSchema; + assert( pSchema ); +- if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zDbSName) ) continue; ++ if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue; + assert( sqlite3SchemaMutexHeld(db, j, 0) ); + p = sqlite3HashFind(&pSchema->idxHash, zName); + if( p ) break; +@@ -109713,6 +110759,7 @@ SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){ + assert( pTable!=0 ); + if( (pCol = pTable->aCol)!=0 ){ + for(i=0; inCol; i++, pCol++){ ++ assert( pCol->zName==0 || pCol->hName==sqlite3StrIHash(pCol->zName) ); + sqlite3DbFree(db, pCol->zName); + sqlite3ExprDelete(db, pCol->pDflt); + sqlite3DbFree(db, pCol->zColl); +@@ -110361,6 +111408,7 @@ SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token *pName, Token *pType){ + pCol = &p->aCol[p->nCol]; + memset(pCol, 0, sizeof(p->aCol[0])); + pCol->zName = z; ++ pCol->hName = sqlite3StrIHash(z); + sqlite3ColumnPropertiesFromName(p, pCol); + + if( pType->n==0 ){ +@@ -111252,6 +112300,28 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ + recomputeColumnsNotIndexed(pPk); + } + ++ ++#ifndef SQLITE_OMIT_VIRTUALTABLE ++/* ++** Return true if pTab is a virtual table and zName is a shadow table name ++** for that virtual table. ++*/ ++SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3 *db, Table *pTab, const char *zName){ ++ int nName; /* Length of zName */ ++ Module *pMod; /* Module for the virtual table */ ++ ++ if( !IsVirtual(pTab) ) return 0; ++ nName = sqlite3Strlen30(pTab->zName); ++ if( sqlite3_strnicmp(zName, pTab->zName, nName)!=0 ) return 0; ++ if( zName[nName]!='_' ) return 0; ++ pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]); ++ if( pMod==0 ) return 0; ++ if( pMod->pModule->iVersion<3 ) return 0; ++ if( pMod->pModule->xShadowName==0 ) return 0; ++ return pMod->pModule->xShadowName(zName+nName+1); ++} ++#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ ++ + #ifndef SQLITE_OMIT_VIRTUALTABLE + /* + ** Return true if zName is a shadow table name in the current database +@@ -111263,8 +112333,6 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ + SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName){ + char *zTail; /* Pointer to the last "_" in zName */ + Table *pTab; /* Table that zName is a shadow of */ +- Module *pMod; /* Module for the virtual table */ +- + zTail = strrchr(zName, '_'); + if( zTail==0 ) return 0; + *zTail = 0; +@@ -111272,14 +112340,37 @@ SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName){ + *zTail = '_'; + if( pTab==0 ) return 0; + if( !IsVirtual(pTab) ) return 0; +- pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]); +- if( pMod==0 ) return 0; +- if( pMod->pModule->iVersion<3 ) return 0; +- if( pMod->pModule->xShadowName==0 ) return 0; +- return pMod->pModule->xShadowName(zTail+1); ++ return sqlite3IsShadowTableOf(db, pTab, zName); + } + #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ + ++ ++#ifdef SQLITE_DEBUG ++/* ++** Mark all nodes of an expression as EP_Immutable, indicating that ++** they should not be changed. Expressions attached to a table or ++** index definition are tagged this way to help ensure that we do ++** not pass them into code generator routines by mistake. ++*/ ++static int markImmutableExprStep(Walker *pWalker, Expr *pExpr){ ++ ExprSetVVAProperty(pExpr, EP_Immutable); ++ return WRC_Continue; ++} ++static void markExprListImmutable(ExprList *pList){ ++ if( pList ){ ++ Walker w; ++ memset(&w, 0, sizeof(w)); ++ w.xExprCallback = markImmutableExprStep; ++ w.xSelectCallback = sqlite3SelectWalkNoop; ++ w.xSelectCallback2 = 0; ++ sqlite3WalkExprList(&w, pList); ++ } ++} ++#else ++#define markExprListImmutable(X) /* no-op */ ++#endif /* SQLITE_DEBUG */ ++ ++ + /* + ** This routine is called to report the final ")" that terminates + ** a CREATE TABLE statement. +@@ -111372,6 +112463,8 @@ SQLITE_PRIVATE void sqlite3EndTable( + ** actually be used if PRAGMA writable_schema=ON is set. */ + sqlite3ExprListDelete(db, p->pCheck); + p->pCheck = 0; ++ }else{ ++ markExprListImmutable(p->pCheck); + } + } + #endif /* !defined(SQLITE_OMIT_CHECK) */ +@@ -113723,7 +114816,7 @@ SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){ + } + db->aDb[1].pBt = pBt; + assert( db->aDb[1].pSchema ); +- if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, -1, 0) ){ ++ if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, 0, 0) ){ + sqlite3OomFault(db); + return 1; + } +@@ -113834,7 +114927,7 @@ SQLITE_PRIVATE void sqlite3HaltConstraint( + u8 p5Errmsg /* P5_ErrMsg type */ + ){ + Vdbe *v = sqlite3GetVdbe(pParse); +- assert( (errCode&0xff)==SQLITE_CONSTRAINT ); ++ assert( (errCode&0xff)==SQLITE_CONSTRAINT || pParse->nested ); + if( onError==OE_Abort ){ + sqlite3MayAbort(pParse); + } +@@ -114313,17 +115406,30 @@ SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq( + int create /* True to create CollSeq if doesn't already exist */ + ){ + CollSeq *pColl; ++ assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 ); ++ assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE ); + if( zName ){ + pColl = findCollSeqEntry(db, zName, create); ++ if( pColl ) pColl += enc-1; + }else{ + pColl = db->pDfltColl; + } +- assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 ); +- assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE ); +- if( pColl ) pColl += enc-1; + return pColl; + } + ++/* ++** Change the text encoding for a database connection. This means that ++** the pDfltColl must change as well. ++*/ ++SQLITE_PRIVATE void sqlite3SetTextEncoding(sqlite3 *db, u8 enc){ ++ assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); ++ db->enc = enc; ++ /* EVIDENCE-OF: R-08308-17224 The default collating function for all ++ ** strings is BINARY. ++ */ ++ db->pDfltColl = sqlite3FindCollSeq(db, enc, sqlite3StrBINARY, 0); ++} ++ + /* + ** This function is responsible for invoking the collation factory callback + ** or substituting a collation sequence of a different encoding when the +@@ -115209,7 +116315,9 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( + iTabCur, aToOpen, &iDataCur, &iIdxCur); + assert( pPk || IsVirtual(pTab) || iDataCur==iTabCur ); + assert( pPk || IsVirtual(pTab) || iIdxCur==iDataCur+1 ); +- if( eOnePass==ONEPASS_MULTI ) sqlite3VdbeJumpHere(v, iAddrOnce); ++ if( eOnePass==ONEPASS_MULTI ){ ++ sqlite3VdbeJumpHereOrPopInst(v, iAddrOnce); ++ } + } + + /* Set up a loop over the rowids/primary-keys that were found in the +@@ -115532,6 +116640,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete( + &iPartIdxLabel, pPrior, r1); + sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1, + pIdx->uniqNotNull ? pIdx->nKeyCol : pIdx->nColumn); ++ sqlite3VdbeChangeP5(v, 1); /* Cause IdxDelete to error if no entry found */ + sqlite3ResolvePartIdxLabel(pParse, iPartIdxLabel); + pPrior = pIdx; + } +@@ -116495,6 +117604,7 @@ static void likeFunc( + int nPat; + sqlite3 *db = sqlite3_context_db_handle(context); + struct compareInfo *pInfo = sqlite3_user_data(context); ++ struct compareInfo backupInfo; + + #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS + if( sqlite3_value_type(argv[0])==SQLITE_BLOB +@@ -116530,6 +117640,12 @@ static void likeFunc( + return; + } + escape = sqlite3Utf8Read(&zEsc); ++ if( escape==pInfo->matchAll || escape==pInfo->matchOne ){ ++ memcpy(&backupInfo, pInfo, sizeof(backupInfo)); ++ pInfo = &backupInfo; ++ if( escape==pInfo->matchAll ) pInfo->matchAll = 0; ++ if( escape==pInfo->matchOne ) pInfo->matchOne = 0; ++ } + }else{ + escape = pInfo->matchSet; + } +@@ -116918,7 +118034,7 @@ static void replaceFunc( + ** whose index is a power of two: 1, 2, 4, 8, 16, 32, ... */ + u8 *zOld; + zOld = zOut; +- zOut = sqlite3_realloc64(zOut, (int)nOut + (nOut - nStr - 1)); ++ zOut = sqlite3Realloc(zOut, (int)nOut + (nOut - nStr - 1)); + if( zOut==0 ){ + sqlite3_result_error_nomem(context); + sqlite3_free(zOld); +@@ -117512,6 +118628,16 @@ SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocas + if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ + return 0; + } ++ ++ /* The memcpy() statement assumes that the wildcard characters are ++ ** the first three statements in the compareInfo structure. The ++ ** asserts() that follow verify that assumption ++ */ ++ memcpy(aWc, pDef->pUserData, 3); ++ assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll ); ++ assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne ); ++ assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet ); ++ + if( nExpr<3 ){ + aWc[3] = 0; + }else{ +@@ -117520,17 +118646,11 @@ SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocas + if( pEscape->op!=TK_STRING ) return 0; + zEscape = pEscape->u.zToken; + if( zEscape[0]==0 || zEscape[1]!=0 ) return 0; ++ if( zEscape[0]==aWc[0] ) return 0; ++ if( zEscape[0]==aWc[1] ) return 0; + aWc[3] = zEscape[0]; + } + +- /* The memcpy() statement assumes that the wildcard characters are +- ** the first three statements in the compareInfo structure. The +- ** asserts() that follow verify that assumption +- */ +- memcpy(aWc, pDef->pUserData, 3); +- assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll ); +- assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne ); +- assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet ); + *pIsNocase = (pDef->funcFlags & SQLITE_FUNC_CASE)==0; + return 1; + } +@@ -117611,7 +118731,7 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ + FUNCTION(upper, 1, 0, 0, upperFunc ), + FUNCTION(lower, 1, 0, 0, lowerFunc ), + FUNCTION(hex, 1, 0, 0, hexFunc ), +- INLINE_FUNC(ifnull, 2, INLINEFUNC_coalesce, SQLITE_FUNC_COALESCE), ++ INLINE_FUNC(ifnull, 2, INLINEFUNC_coalesce, 0 ), + VFUNCTION(random, 0, 0, 0, randomFunc ), + VFUNCTION(randomblob, 1, 0, 0, randomBlob ), + FUNCTION(nullif, 2, 0, 1, nullifFunc ), +@@ -117651,7 +118771,8 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ + #endif + FUNCTION(coalesce, 1, 0, 0, 0 ), + FUNCTION(coalesce, 0, 0, 0, 0 ), +- INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, SQLITE_FUNC_COALESCE), ++ INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ), ++ INLINE_FUNC(iif, 3, INLINEFUNC_iif, 0 ), + }; + #ifndef SQLITE_OMIT_ALTERTABLE + sqlite3AlterFunctions(); +@@ -118339,7 +119460,7 @@ static void fkScanChildren( + /* Clean up the WHERE clause constructed above. */ + sqlite3ExprDelete(db, pWhere); + if( iFkIfZero ){ +- sqlite3VdbeJumpHere(v, iFkIfZero); ++ sqlite3VdbeJumpHereOrPopInst(v, iFkIfZero); + } + } + +@@ -120738,7 +121859,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( + VdbeCoverage(v); + assert( (pCol->colFlags & COLFLAG_GENERATED)==0 ); + nSeenReplace++; +- sqlite3ExprCode(pParse, pCol->pDflt, iReg); ++ sqlite3ExprCodeCopy(pParse, pCol->pDflt, iReg); + sqlite3VdbeJumpHere(v, addr1); + break; + } +@@ -120793,6 +121914,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( + onError = overrideError!=OE_Default ? overrideError : OE_Abort; + for(i=0; inExpr; i++){ + int allOk; ++ Expr *pCopy; + Expr *pExpr = pCheck->a[i].pExpr; + if( aiChng + && !sqlite3ExprReferencesUpdatedColumn(pExpr, aiChng, pkChng) +@@ -120801,9 +121923,17 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( + ** updated so there is no point it verifying the check constraint */ + continue; + } ++ if( bAffinityDone==0 ){ ++ sqlite3TableAffinity(v, pTab, regNewData+1); ++ bAffinityDone = 1; ++ } + allOk = sqlite3VdbeMakeLabel(pParse); + sqlite3VdbeVerifyAbortable(v, onError); +- sqlite3ExprIfTrue(pParse, pExpr, allOk, SQLITE_JUMPIFNULL); ++ pCopy = sqlite3ExprDup(db, pExpr, 0); ++ if( !db->mallocFailed ){ ++ sqlite3ExprIfTrue(pParse, pCopy, allOk, SQLITE_JUMPIFNULL); ++ } ++ sqlite3ExprDelete(db, pCopy); + if( onError==OE_Ignore ){ + sqlite3VdbeGoto(v, ignoreDest); + }else{ +@@ -121067,7 +122197,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( + sqlite3TableAffinity(v, pTab, regNewData+1); + bAffinityDone = 1; + } +- VdbeNoopComment((v, "uniqueness check for %s", pIdx->zName)); ++ VdbeNoopComment((v, "prep index %s", pIdx->zName)); + iThisCur = iIdxCur+ix; + + +@@ -121917,14 +123047,13 @@ static int xferOptimization( + addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid); + assert( (pDest->tabFlags & TF_Autoincrement)==0 ); + } +- sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1); + if( db->mDbFlags & DBFLAG_Vacuum ){ + sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest); +- insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID| +- OPFLAG_APPEND|OPFLAG_USESEEKRESULT; ++ insFlags = OPFLAG_APPEND|OPFLAG_USESEEKRESULT; + }else{ + insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND; + } ++ sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1); + sqlite3VdbeAddOp4(v, OP_Insert, iDest, regData, regRowid, + (char*)pDest, P4_TABLE); + sqlite3VdbeChangeP5(v, insFlags); +@@ -121949,7 +123078,6 @@ static int xferOptimization( + sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR); + VdbeComment((v, "%s", pDestIdx->zName)); + addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0); VdbeCoverage(v); +- sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1); + if( db->mDbFlags & DBFLAG_Vacuum ){ + /* This INSERT command is part of a VACUUM operation, which guarantees + ** that the destination table is empty. If all indexed columns use +@@ -121973,10 +123101,10 @@ static int xferOptimization( + idxInsFlags = OPFLAG_USESEEKRESULT; + sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest); + } +- } +- if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){ ++ }else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){ + idxInsFlags |= OPFLAG_NCHANGE; + } ++ sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1); + sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, regData); + sqlite3VdbeChangeP5(v, idxInsFlags|OPFLAG_APPEND); + sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1+1); VdbeCoverage(v); +@@ -122497,6 +123625,11 @@ struct sqlite3_api_routines { + const char *(*filename_database)(const char*); + const char *(*filename_journal)(const char*); + const char *(*filename_wal)(const char*); ++ /* Version 3.32.0 and later */ ++ char *(*create_filename)(const char*,const char*,const char*, ++ int,const char**); ++ void (*free_filename)(char*); ++ sqlite3_file *(*database_file_object)(const char*); + }; + + /* +@@ -122797,6 +123930,10 @@ typedef int (*sqlite3_loadext_entry)( + #define sqlite3_filename_database sqlite3_api->filename_database + #define sqlite3_filename_journal sqlite3_api->filename_journal + #define sqlite3_filename_wal sqlite3_api->filename_wal ++/* Version 3.32.0 and later */ ++#define sqlite3_create_filename sqlite3_api->create_filename ++#define sqlite3_free_filename sqlite3_api->free_filename ++#define sqlite3_database_file_object sqlite3_api->database_file_object + #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ + + #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) +@@ -123275,8 +124412,20 @@ static const sqlite3_api_routines sqlite3Apis = { + sqlite3_filename_database, + sqlite3_filename_journal, + sqlite3_filename_wal, ++ /* Version 3.32.0 and later */ ++ sqlite3_create_filename, ++ sqlite3_free_filename, ++ sqlite3_database_file_object, + }; + ++/* True if x is the directory separator character ++*/ ++#if SQLITE_OS_WIN ++# define DirSep(X) ((X)=='/'||(X)=='\\') ++#else ++# define DirSep(X) ((X)=='/') ++#endif ++ + /* + ** Attempt to load an SQLite extension library contained in the file + ** zFile. The entry point is zProc. zProc may be 0 in which case a +@@ -123378,7 +124527,7 @@ static int sqlite3LoadExtension( + return SQLITE_NOMEM_BKPT; + } + memcpy(zAltEntry, "sqlite3_", 8); +- for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){} ++ for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){} + iFile++; + if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3; + for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){ +@@ -123681,49 +124830,49 @@ SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ + */ + + /* The various pragma types */ +-#define PragTyp_HEADER_VALUE 0 +-#define PragTyp_AUTO_VACUUM 1 +-#define PragTyp_FLAG 2 +-#define PragTyp_BUSY_TIMEOUT 3 +-#define PragTyp_CACHE_SIZE 4 +-#define PragTyp_CACHE_SPILL 5 +-#define PragTyp_CASE_SENSITIVE_LIKE 6 +-#define PragTyp_COLLATION_LIST 7 +-#define PragTyp_COMPILE_OPTIONS 8 +-#define PragTyp_DATA_STORE_DIRECTORY 9 +-#define PragTyp_DATABASE_LIST 10 +-#define PragTyp_DEFAULT_CACHE_SIZE 11 +-#define PragTyp_ENCODING 12 +-#define PragTyp_FOREIGN_KEY_CHECK 13 +-#define PragTyp_FOREIGN_KEY_LIST 14 +-#define PragTyp_FUNCTION_LIST 15 +-#define PragTyp_HARD_HEAP_LIMIT 16 +-#define PragTyp_INCREMENTAL_VACUUM 17 +-#define PragTyp_INDEX_INFO 18 +-#define PragTyp_INDEX_LIST 19 +-#define PragTyp_INTEGRITY_CHECK 20 +-#define PragTyp_JOURNAL_MODE 21 +-#define PragTyp_JOURNAL_SIZE_LIMIT 22 +-#define PragTyp_LOCK_PROXY_FILE 23 +-#define PragTyp_LOCKING_MODE 24 +-#define PragTyp_PAGE_COUNT 25 +-#define PragTyp_MMAP_SIZE 26 +-#define PragTyp_MODULE_LIST 27 +-#define PragTyp_OPTIMIZE 28 +-#define PragTyp_PAGE_SIZE 29 +-#define PragTyp_PRAGMA_LIST 30 +-#define PragTyp_SECURE_DELETE 31 +-#define PragTyp_SHRINK_MEMORY 32 +-#define PragTyp_SOFT_HEAP_LIMIT 33 +-#define PragTyp_SYNCHRONOUS 34 +-#define PragTyp_TABLE_INFO 35 +-#define PragTyp_TEMP_STORE 36 +-#define PragTyp_TEMP_STORE_DIRECTORY 37 +-#define PragTyp_THREADS 38 +-#define PragTyp_WAL_AUTOCHECKPOINT 39 +-#define PragTyp_WAL_CHECKPOINT 40 +-#define PragTyp_ACTIVATE_EXTENSIONS 41 +-#define PragTyp_KEY 42 ++#define PragTyp_ACTIVATE_EXTENSIONS 0 ++#define PragTyp_ANALYSIS_LIMIT 1 ++#define PragTyp_HEADER_VALUE 2 ++#define PragTyp_AUTO_VACUUM 3 ++#define PragTyp_FLAG 4 ++#define PragTyp_BUSY_TIMEOUT 5 ++#define PragTyp_CACHE_SIZE 6 ++#define PragTyp_CACHE_SPILL 7 ++#define PragTyp_CASE_SENSITIVE_LIKE 8 ++#define PragTyp_COLLATION_LIST 9 ++#define PragTyp_COMPILE_OPTIONS 10 ++#define PragTyp_DATA_STORE_DIRECTORY 11 ++#define PragTyp_DATABASE_LIST 12 ++#define PragTyp_DEFAULT_CACHE_SIZE 13 ++#define PragTyp_ENCODING 14 ++#define PragTyp_FOREIGN_KEY_CHECK 15 ++#define PragTyp_FOREIGN_KEY_LIST 16 ++#define PragTyp_FUNCTION_LIST 17 ++#define PragTyp_HARD_HEAP_LIMIT 18 ++#define PragTyp_INCREMENTAL_VACUUM 19 ++#define PragTyp_INDEX_INFO 20 ++#define PragTyp_INDEX_LIST 21 ++#define PragTyp_INTEGRITY_CHECK 22 ++#define PragTyp_JOURNAL_MODE 23 ++#define PragTyp_JOURNAL_SIZE_LIMIT 24 ++#define PragTyp_LOCK_PROXY_FILE 25 ++#define PragTyp_LOCKING_MODE 26 ++#define PragTyp_PAGE_COUNT 27 ++#define PragTyp_MMAP_SIZE 28 ++#define PragTyp_MODULE_LIST 29 ++#define PragTyp_OPTIMIZE 30 ++#define PragTyp_PAGE_SIZE 31 ++#define PragTyp_PRAGMA_LIST 32 ++#define PragTyp_SECURE_DELETE 33 ++#define PragTyp_SHRINK_MEMORY 34 ++#define PragTyp_SOFT_HEAP_LIMIT 35 ++#define PragTyp_SYNCHRONOUS 36 ++#define PragTyp_TABLE_INFO 37 ++#define PragTyp_TEMP_STORE 38 ++#define PragTyp_TEMP_STORE_DIRECTORY 39 ++#define PragTyp_THREADS 40 ++#define PragTyp_WAL_AUTOCHECKPOINT 41 ++#define PragTyp_WAL_CHECKPOINT 42 + #define PragTyp_LOCK_STATUS 43 + #define PragTyp_STATS 44 + +@@ -123809,13 +124958,18 @@ typedef struct PragmaName { + u64 iArg; /* Extra argument */ + } PragmaName; + static const PragmaName aPragmaName[] = { +-#if defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD) ++#if defined(SQLITE_ENABLE_CEROD) + {/* zName: */ "activate_extensions", + /* ePragTyp: */ PragTyp_ACTIVATE_EXTENSIONS, + /* ePragFlg: */ 0, + /* ColNames: */ 0, 0, + /* iArg: */ 0 }, + #endif ++ {/* zName: */ "analysis_limit", ++ /* ePragTyp: */ PragTyp_ANALYSIS_LIMIT, ++ /* ePragFlg: */ PragFlg_Result0, ++ /* ColNames: */ 0, 0, ++ /* iArg: */ 0 }, + #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS) + {/* zName: */ "application_id", + /* ePragTyp: */ PragTyp_HEADER_VALUE, +@@ -124005,18 +125159,6 @@ static const PragmaName aPragmaName[] = { + /* ePragFlg: */ PragFlg_Result0, + /* ColNames: */ 0, 0, + /* iArg: */ 0 }, +-#if defined(SQLITE_HAS_CODEC) +- {/* zName: */ "hexkey", +- /* ePragTyp: */ PragTyp_KEY, +- /* ePragFlg: */ 0, +- /* ColNames: */ 0, 0, +- /* iArg: */ 2 }, +- {/* zName: */ "hexrekey", +- /* ePragTyp: */ PragTyp_KEY, +- /* ePragFlg: */ 0, +- /* ColNames: */ 0, 0, +- /* iArg: */ 3 }, +-#endif + #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) + #if !defined(SQLITE_OMIT_CHECK) + {/* zName: */ "ignore_check_constraints", +@@ -124069,13 +125211,6 @@ static const PragmaName aPragmaName[] = { + /* ColNames: */ 0, 0, + /* iArg: */ 0 }, + #endif +-#if defined(SQLITE_HAS_CODEC) +- {/* zName: */ "key", +- /* ePragTyp: */ PragTyp_KEY, +- /* ePragFlg: */ 0, +- /* ColNames: */ 0, 0, +- /* iArg: */ 0 }, +-#endif + #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) + {/* zName: */ "legacy_alter_table", + /* ePragTyp: */ PragTyp_FLAG, +@@ -124183,15 +125318,6 @@ static const PragmaName aPragmaName[] = { + /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1, + /* ColNames: */ 0, 0, + /* iArg: */ SQLITE_RecTriggers }, +-#endif +-#if defined(SQLITE_HAS_CODEC) +- {/* zName: */ "rekey", +- /* ePragTyp: */ PragTyp_KEY, +- /* ePragFlg: */ 0, +- /* ColNames: */ 0, 0, +- /* iArg: */ 1 }, +-#endif +-#if !defined(SQLITE_OMIT_FLAG_PRAGMAS) + {/* zName: */ "reverse_unordered_selects", + /* ePragTyp: */ PragTyp_FLAG, + /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1, +@@ -124275,18 +125401,6 @@ static const PragmaName aPragmaName[] = { + /* ePragFlg: */ PragFlg_NoColumns1, + /* ColNames: */ 0, 0, + /* iArg: */ 0 }, +-#endif +-#if defined(SQLITE_HAS_CODEC) +- {/* zName: */ "textkey", +- /* ePragTyp: */ PragTyp_KEY, +- /* ePragFlg: */ 0, +- /* ColNames: */ 0, 0, +- /* iArg: */ 4 }, +- {/* zName: */ "textrekey", +- /* ePragTyp: */ PragTyp_KEY, +- /* ePragFlg: */ 0, +- /* ColNames: */ 0, 0, +- /* iArg: */ 5 }, + #endif + {/* zName: */ "threads", + /* ePragTyp: */ PragTyp_THREADS, +@@ -124356,7 +125470,7 @@ static const PragmaName aPragmaName[] = { + /* iArg: */ SQLITE_WriteSchema|SQLITE_NoSchemaError }, + #endif + }; +-/* Number of pragmas: 66 on by default, 82 total. */ ++/* Number of pragmas: 67 on by default, 77 total. */ + + /************** End of pragma.h **********************************************/ + /************** Continuing where we left off in pragma.c *********************/ +@@ -124886,7 +126000,7 @@ SQLITE_PRIVATE void sqlite3Pragma( + ** buffer that the pager module resizes using sqlite3_realloc(). + */ + db->nextPagesize = sqlite3Atoi(zRight); +- if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize,-1,0) ){ ++ if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize,0,0) ){ + sqlite3OomFault(db); + } + } +@@ -126060,7 +127174,6 @@ SQLITE_PRIVATE void sqlite3Pragma( + } + sqlite3VdbeAddOp2(v, OP_Next, iDataCur, loopTop); VdbeCoverage(v); + sqlite3VdbeJumpHere(v, loopTop-1); +-#ifndef SQLITE_OMIT_BTREECOUNT + if( !isQuick ){ + sqlite3VdbeLoadString(v, 2, "wrong # of entries in index "); + for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ +@@ -126074,7 +127187,6 @@ SQLITE_PRIVATE void sqlite3Pragma( + sqlite3VdbeJumpHere(v, addr); + } + } +-#endif /* SQLITE_OMIT_BTREECOUNT */ + } + } + { +@@ -126155,21 +127267,12 @@ SQLITE_PRIVATE void sqlite3Pragma( + ** will be overwritten when the schema is next loaded. If it does not + ** already exists, it will be created to use the new encoding value. + */ +- int canChangeEnc = 1; /* True if allowed to change the encoding */ +- int i; /* For looping over all attached databases */ +- for(i=0; inDb; i++){ +- if( db->aDb[i].pBt!=0 +- && DbHasProperty(db,i,DB_SchemaLoaded) +- && !DbHasProperty(db,i,DB_Empty) +- ){ +- canChangeEnc = 0; +- } +- } +- if( canChangeEnc ){ ++ if( (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){ + for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ + if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ +- SCHEMA_ENC(db) = ENC(db) = +- pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE; ++ u8 enc = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE; ++ SCHEMA_ENC(db) = enc; ++ sqlite3SetTextEncoding(db, enc); + break; + } + } +@@ -126518,6 +127621,25 @@ SQLITE_PRIVATE void sqlite3Pragma( + break; + } + ++ /* ++ ** PRAGMA analysis_limit ++ ** PRAGMA analysis_limit = N ++ ** ++ ** Configure the maximum number of rows that ANALYZE will examine ++ ** in each index that it looks at. Return the new limit. ++ */ ++ case PragTyp_ANALYSIS_LIMIT: { ++ sqlite3_int64 N; ++ if( zRight ++ && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ++ && N>=0 ++ ){ ++ db->nAnalysisLimit = (int)(N&0x7fffffff); ++ } ++ returnSingleInt(v, db->nAnalysisLimit); ++ break; ++ } ++ + #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) + /* + ** Report the current state of file logs for all databases +@@ -126546,59 +127668,11 @@ SQLITE_PRIVATE void sqlite3Pragma( + } + #endif + +-#ifdef SQLITE_HAS_CODEC +- /* Pragma iArg +- ** ---------- ------ +- ** key 0 +- ** rekey 1 +- ** hexkey 2 +- ** hexrekey 3 +- ** textkey 4 +- ** textrekey 5 +- */ +- case PragTyp_KEY: { +- if( zRight ){ +- char zBuf[40]; +- const char *zKey = zRight; +- int n; +- if( pPragma->iArg==2 || pPragma->iArg==3 ){ +- u8 iByte; +- int i; +- for(i=0, iByte=0; iiArg<4 ? sqlite3Strlen30(zRight) : -1; +- } +- if( (pPragma->iArg & 1)==0 ){ +- rc = sqlite3_key_v2(db, zDb, zKey, n); +- }else{ +- rc = sqlite3_rekey_v2(db, zDb, zKey, n); +- } +- if( rc==SQLITE_OK && n!=0 ){ +- sqlite3VdbeSetNumCols(v, 1); +- sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "ok", SQLITE_STATIC); +- returnSingleText(v, "ok"); +- } +- } +- break; +- } +-#endif +-#if defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD) ++#if defined(SQLITE_ENABLE_CEROD) + case PragTyp_ACTIVATE_EXTENSIONS: if( zRight ){ +-#ifdef SQLITE_HAS_CODEC +- if( sqlite3StrNICmp(zRight, "see-", 4)==0 ){ +- sqlite3_activate_see(&zRight[4]); +- } +-#endif +-#ifdef SQLITE_ENABLE_CEROD + if( sqlite3StrNICmp(zRight, "cerod-", 6)==0 ){ + sqlite3_activate_cerod(&zRight[6]); + } +-#endif + } + break; + #endif +@@ -127026,7 +128100,7 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char + assert( argc==5 ); + UNUSED_PARAMETER2(NotUsed, argc); + assert( sqlite3_mutex_held(db->mutex) ); +- DbClearProperty(db, iDb, DB_Empty); ++ db->mDbFlags |= DBFLAG_EncodingFixed; + pData->nInitRow++; + if( db->mallocFailed ){ + corruptSchema(pData, argv[1], 0); +@@ -127114,6 +128188,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl + InitData initData; + const char *zMasterName; + int openedTransaction = 0; ++ int mask = ((db->mDbFlags & DBFLAG_EncodingFixed) | ~DBFLAG_EncodingFixed); + + assert( (db->mDbFlags & DBFLAG_SchemaKnownOk)==0 ); + assert( iDb>=0 && iDbnDb ); +@@ -127142,6 +128217,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl + initData.mInitFlags = mFlags; + initData.nInitRow = 0; + sqlite3InitCallback(&initData, 5, (char **)azArg, 0); ++ db->mDbFlags &= mask; + if( initData.rc ){ + rc = initData.rc; + goto error_out; +@@ -127201,27 +128277,25 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl + ** as sqlite3.enc. + */ + if( meta[BTREE_TEXT_ENCODING-1] ){ /* text encoding */ +- if( iDb==0 ){ +-#ifndef SQLITE_OMIT_UTF16 ++ if( iDb==0 && (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){ + u8 encoding; ++#ifndef SQLITE_OMIT_UTF16 + /* If opening the main database, set ENC(db). */ + encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3; + if( encoding==0 ) encoding = SQLITE_UTF8; +- ENC(db) = encoding; + #else +- ENC(db) = SQLITE_UTF8; ++ encoding = SQLITE_UTF8; + #endif ++ sqlite3SetTextEncoding(db, encoding); + }else{ + /* If opening an attached database, the encoding much match ENC(db) */ +- if( meta[BTREE_TEXT_ENCODING-1]!=ENC(db) ){ ++ if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){ + sqlite3SetString(pzErrMsg, db, "attached databases must use the same" + " text encoding as main database"); + rc = SQLITE_ERROR; + goto initone_error_out; + } + } +- }else{ +- DbSetProperty(db, iDb, DB_Empty); + } + pDb->pSchema->enc = ENC(db); + +@@ -127333,8 +128407,7 @@ error_out: + ** error occurs, write an error message into *pzErrMsg. + ** + ** After a database is initialized, the DB_SchemaLoaded bit is set +-** bit is set in the flags field of the Db structure. If the database +-** file was of zero-length, then the DB_Empty flag is also set. ++** bit is set in the flags field of the Db structure. + */ + SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){ + int i, rc; +@@ -127465,11 +128538,26 @@ SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){ + return i; + } + ++/* ++** Deallocate a single AggInfo object ++*/ ++static void agginfoFree(sqlite3 *db, AggInfo *p){ ++ sqlite3DbFree(db, p->aCol); ++ sqlite3DbFree(db, p->aFunc); ++ sqlite3DbFree(db, p); ++} ++ + /* + ** Free all memory allocations in the pParse object + */ + SQLITE_PRIVATE void sqlite3ParserReset(Parse *pParse){ + sqlite3 *db = pParse->db; ++ AggInfo *pThis = pParse->pAggList; ++ while( pThis ){ ++ AggInfo *pNext = pThis->pNext; ++ agginfoFree(db, pThis); ++ pThis = pNext; ++ } + sqlite3DbFree(db, pParse->aLabel); + sqlite3ExprListDelete(db, pParse->pConstExpr); + if( db ){ +@@ -127970,7 +129058,6 @@ static void clearSelect(sqlite3 *db, Select *p, int bFree){ + if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){ + sqlite3WindowListDelete(db, p->pWinDefn); + } +- assert( p->pWin==0 ); + #endif + if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith); + if( bFree ) sqlite3DbFreeNN(db, p); +@@ -129891,6 +130978,7 @@ SQLITE_PRIVATE int sqlite3ColumnsFromExprList( + if( cnt>3 ) sqlite3_randomness(sizeof(cnt), &cnt); + } + pCol->zName = zName; ++ pCol->hName = sqlite3StrIHash(zName); + sqlite3ColumnPropertiesFromName(0, pCol); + if( zName && sqlite3HashInsert(&ht, zName, pCol)==pCol ){ + sqlite3OomFault(db); +@@ -130584,9 +131672,7 @@ static int multiSelect( + selectOpName(p->op))); + rc = sqlite3Select(pParse, p, &uniondest); + testcase( rc!=SQLITE_OK ); +- /* Query flattening in sqlite3Select() might refill p->pOrderBy. +- ** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */ +- sqlite3ExprListDelete(db, p->pOrderBy); ++ assert( p->pOrderBy==0 ); + pDelete = p->pPrior; + p->pPrior = pPrior; + p->pOrderBy = 0; +@@ -130673,6 +131759,7 @@ static int multiSelect( + /* Generate code to take the intersection of the two temporary + ** tables. + */ ++ if( rc ) break; + assert( p->pEList ); + iBreak = sqlite3VdbeMakeLabel(pParse); + iCont = sqlite3VdbeMakeLabel(pParse); +@@ -131343,7 +132430,10 @@ static Expr *substExpr( + ){ + pExpr->iRightJoinTable = pSubst->iNewTable; + } +- if( pExpr->op==TK_COLUMN && pExpr->iTable==pSubst->iTable ){ ++ if( pExpr->op==TK_COLUMN ++ && pExpr->iTable==pSubst->iTable ++ && !ExprHasProperty(pExpr, EP_FixedCol) ++ ){ + if( pExpr->iColumn<0 ){ + pExpr->op = TK_NULL; + }else{ +@@ -131361,6 +132451,7 @@ static Expr *substExpr( + ifNullRow.op = TK_IF_NULL_ROW; + ifNullRow.pLeft = pCopy; + ifNullRow.iTable = pSubst->iNewTable; ++ ifNullRow.flags = EP_Skip; + pCopy = &ifNullRow; + } + testcase( ExprHasProperty(pCopy, EP_Subquery) ); +@@ -131447,6 +132538,38 @@ static void substSelect( + } + #endif /* !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) */ + ++#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) ++/* ++** pSelect is a SELECT statement and pSrcItem is one item in the FROM ++** clause of that SELECT. ++** ++** This routine scans the entire SELECT statement and recomputes the ++** pSrcItem->colUsed mask. ++*/ ++static int recomputeColumnsUsedExpr(Walker *pWalker, Expr *pExpr){ ++ struct SrcList_item *pItem; ++ if( pExpr->op!=TK_COLUMN ) return WRC_Continue; ++ pItem = pWalker->u.pSrcItem; ++ if( pItem->iCursor!=pExpr->iTable ) return WRC_Continue; ++ if( pExpr->iColumn<0 ) return WRC_Continue; ++ pItem->colUsed |= sqlite3ExprColUsed(pExpr); ++ return WRC_Continue; ++} ++static void recomputeColumnsUsed( ++ Select *pSelect, /* The complete SELECT statement */ ++ struct SrcList_item *pSrcItem /* Which FROM clause item to recompute */ ++){ ++ Walker w; ++ if( NEVER(pSrcItem->pTab==0) ) return; ++ memset(&w, 0, sizeof(w)); ++ w.xExprCallback = recomputeColumnsUsedExpr; ++ w.xSelectCallback = sqlite3SelectWalkNoop; ++ w.u.pSrcItem = pSrcItem; ++ pSrcItem->colUsed = 0; ++ sqlite3WalkSelect(&w, pSelect); ++} ++#endif /* !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) */ ++ + #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) + /* + ** This routine attempts to flatten subqueries as a performance optimization. +@@ -131622,6 +132745,7 @@ static int flattenSubquery( + Expr *pWhere; /* The WHERE clause */ + struct SrcList_item *pSubitem; /* The subquery */ + sqlite3 *db = pParse->db; ++ Walker w; /* Walker to persist agginfo data */ + + /* Check to see if flattening is permitted. Return 0 if not. + */ +@@ -131935,7 +133059,7 @@ static int flattenSubquery( + ** We look at every expression in the outer query and every place we see + ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". + */ +- if( pSub->pOrderBy ){ ++ if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){ + /* At this point, any non-zero iOrderByCol values indicate that the + ** ORDER BY column expression is identical to the iOrderByCol'th + ** expression returned by SELECT statement pSub. Since these values +@@ -131959,7 +133083,13 @@ static int flattenSubquery( + if( isLeftJoin>0 ){ + sqlite3SetJoinExpr(pWhere, iNewParent); + } +- pParent->pWhere = sqlite3ExprAnd(pParse, pWhere, pParent->pWhere); ++ if( pWhere ){ ++ if( pParent->pWhere ){ ++ pParent->pWhere = sqlite3PExpr(pParse, TK_AND, pWhere, pParent->pWhere); ++ }else{ ++ pParent->pWhere = pWhere; ++ } ++ } + if( db->mallocFailed==0 ){ + SubstContext x; + x.pParse = pParse; +@@ -131985,11 +133115,19 @@ static int flattenSubquery( + pParent->pLimit = pSub->pLimit; + pSub->pLimit = 0; + } ++ ++ /* Recompute the SrcList_item.colUsed masks for the flattened ++ ** tables. */ ++ for(i=0; ia[i+iFrom]); ++ } + } + + /* Finially, delete what is left of the subquery and return + ** success. + */ ++ sqlite3AggInfoPersistWalkerInit(&w, pParse); ++ sqlite3WalkSelect(&w,pSub1); + sqlite3SelectDelete(db, pSub1); + + #if SELECTTRACE_ENABLED +@@ -132033,9 +133171,8 @@ static void constInsert( + assert( pColumn->op==TK_COLUMN ); + assert( sqlite3ExprIsConstant(pValue) ); + +- if( !ExprHasProperty(pValue, EP_FixedCol) && sqlite3ExprAffinity(pValue)!=0 ){ +- return; +- } ++ if( ExprHasProperty(pColumn, EP_FixedCol) ) return; ++ if( sqlite3ExprAffinity(pValue)!=0 ) return; + if( !sqlite3IsBinary(sqlite3ExprCompareCollSeq(pConst->pParse,pExpr)) ){ + return; + } +@@ -132058,9 +133195,6 @@ static void constInsert( + if( pConst->apExpr==0 ){ + pConst->nConst = 0; + }else{ +- if( ExprHasProperty(pValue, EP_FixedCol) ){ +- pValue = pValue->pLeft; +- } + pConst->apExpr[pConst->nConst*2-2] = pColumn; + pConst->apExpr[pConst->nConst*2-1] = pValue; + } +@@ -132254,11 +133388,14 @@ static int pushDownWhereTerms( + ){ + Expr *pNew; + int nChng = 0; ++ Select *pSel; + if( pWhere==0 ) return 0; + if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */ + + #ifndef SQLITE_OMIT_WINDOWFUNC +- if( pSubq->pWin ) return 0; /* restriction (6) */ ++ for(pSel=pSubq; pSel; pSel=pSel->pPrior){ ++ if( pSel->pWin ) return 0; /* restriction (6) */ ++ } + #endif + + #ifdef SQLITE_DEBUG +@@ -132336,7 +133473,7 @@ static u8 minMaxQuery(sqlite3 *db, Expr *pFunc, ExprList **ppMinMax){ + ExprList *pEList = pFunc->x.pList; /* Arguments to agg function */ + const char *zFunc; /* Name of aggregate function pFunc */ + ExprList *pOrderBy; +- u8 sortFlags; ++ u8 sortFlags = 0; + + assert( *ppMinMax==0 ); + assert( pFunc->op==TK_AGG_FUNCTION ); +@@ -132347,7 +133484,9 @@ static u8 minMaxQuery(sqlite3 *db, Expr *pFunc, ExprList **ppMinMax){ + zFunc = pFunc->u.zToken; + if( sqlite3StrICmp(zFunc, "min")==0 ){ + eRet = WHERE_ORDERBY_MIN; +- sortFlags = KEYINFO_ORDER_BIGNULL; ++ if( sqlite3ExprCanBeNull(pEList->a[0].pExpr) ){ ++ sortFlags = KEYINFO_ORDER_BIGNULL; ++ } + }else if( sqlite3StrICmp(zFunc, "max")==0 ){ + eRet = WHERE_ORDERBY_MAX; + sortFlags = KEYINFO_ORDER_DESC; +@@ -132456,6 +133595,14 @@ static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){ + 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; ++#ifndef SQLITE_OMIT_WINDOWFUNC ++ /* If iOrderByCol is already non-zero, then it has already been matched ++ ** to a result column of the SELECT statement. This occurs when the ++ ** SELECT is rewritten for window-functions processing and then passed ++ ** to sqlite3SelectPrep() and similar a second time. The rewriting done ++ ** by this function is not required in this case. */ ++ if( a[0].u.x.iOrderByCol ) return WRC_Continue; ++#endif + for(i=p->pOrderBy->nExpr-1; i>=0; i--){ + if( a[i].pExpr->flags & EP_Collate ) break; + } +@@ -133015,7 +134162,7 @@ static int selectExpander(Walker *pWalker, Select *p){ + pNew = sqlite3ExprListAppend(pParse, pNew, pExpr); + sqlite3TokenInit(&sColname, zColname); + sqlite3ExprListSetName(pParse, pNew, &sColname, 0); +- if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){ ++ if( pNew && (p->selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){ + struct ExprList_item *pX = &pNew->a[pNew->nExpr-1]; + sqlite3DbFree(db, pX->zEName); + if( pSub ){ +@@ -133055,29 +134202,6 @@ static int selectExpander(Walker *pWalker, Select *p){ + return WRC_Continue; + } + +-/* +-** No-op routine for the parse-tree walker. +-** +-** When this routine is the Walker.xExprCallback then expression trees +-** are walked without any actions being taken at each node. Presumably, +-** when this routine is used for Walker.xExprCallback then +-** Walker.xSelectCallback is set to do something useful for every +-** subquery in the parser tree. +-*/ +-SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ +- UNUSED_PARAMETER2(NotUsed, NotUsed2); +- return WRC_Continue; +-} +- +-/* +-** No-op routine for the parse-tree walker for SELECT statements. +-** subquery in the parser tree. +-*/ +-SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){ +- UNUSED_PARAMETER2(NotUsed, NotUsed2); +- return WRC_Continue; +-} +- + #if SQLITE_DEBUG + /* + ** Always assert. This xSelectCallback2 implementation proves that the +@@ -133219,6 +134343,7 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){ + struct AggInfo_func *pFunc; + int nReg = pAggInfo->nFunc + pAggInfo->nColumn; + if( nReg==0 ) return; ++ if( pParse->nErr ) return; + #ifdef SQLITE_DEBUG + /* Verify that all AggInfo registers are within the range specified by + ** AggInfo.mnReg..AggInfo.mxReg */ +@@ -133360,7 +134485,7 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){ + + pAggInfo->directMode = 0; + if( addrHitTest ){ +- sqlite3VdbeJumpHere(v, addrHitTest); ++ sqlite3VdbeJumpHereOrPopInst(v, addrHitTest); + } + } + +@@ -133598,10 +134723,10 @@ SQLITE_PRIVATE int sqlite3Select( + Expr *pWhere; /* The WHERE clause. May be NULL */ + ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */ + Expr *pHaving; /* The HAVING clause. May be NULL */ ++ AggInfo *pAggInfo = 0; /* Aggregate information */ + int rc = 1; /* Value to return from this function */ + DistinctCtx sDistinct; /* Info on how to code the DISTINCT keyword */ + SortCtx sSort; /* Info on how to code the ORDER BY clause */ +- AggInfo sAggInfo; /* Information used by aggregate queries */ + int iEnd; /* Address of the end of the query */ + sqlite3 *db; /* The database connection */ + ExprList *pMinMaxOrderBy = 0; /* Added ORDER BY for min/max queries */ +@@ -133613,7 +134738,6 @@ SQLITE_PRIVATE int sqlite3Select( + return 1; + } + if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; +- memset(&sAggInfo, 0, sizeof(sAggInfo)); + #if SELECTTRACE_ENABLED + SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain)); + if( sqlite3SelectTrace & 0x100 ){ +@@ -133635,6 +134759,7 @@ SQLITE_PRIVATE int sqlite3Select( + sqlite3ExprListDelete(db, p->pOrderBy); + p->pOrderBy = 0; + p->selFlags &= ~SF_Distinct; ++ p->selFlags |= SF_NoopOrderBy; + } + sqlite3SelectPrep(pParse, p, 0); + if( pParse->nErr || db->mallocFailed ){ +@@ -134203,14 +135328,20 @@ SQLITE_PRIVATE int sqlite3Select( + ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the + ** SELECT statement. + */ ++ pAggInfo = sqlite3DbMallocZero(db, sizeof(*pAggInfo) ); ++ if( pAggInfo==0 ){ ++ goto select_end; ++ } ++ pAggInfo->pNext = pParse->pAggList; ++ pParse->pAggList = pAggInfo; + memset(&sNC, 0, sizeof(sNC)); + sNC.pParse = pParse; + sNC.pSrcList = pTabList; +- sNC.uNC.pAggInfo = &sAggInfo; ++ sNC.uNC.pAggInfo = pAggInfo; + VVA_ONLY( sNC.ncFlags = NC_UAggInfo; ) +- sAggInfo.mnReg = pParse->nMem+1; +- sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; +- sAggInfo.pGroupBy = pGroupBy; ++ pAggInfo->mnReg = pParse->nMem+1; ++ pAggInfo->nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; ++ pAggInfo->pGroupBy = pGroupBy; + sqlite3ExprAnalyzeAggList(&sNC, pEList); + sqlite3ExprAnalyzeAggList(&sNC, sSort.pOrderBy); + if( pHaving ){ +@@ -134223,14 +135354,14 @@ SQLITE_PRIVATE int sqlite3Select( + } + sqlite3ExprAnalyzeAggregates(&sNC, pHaving); + } +- sAggInfo.nAccumulator = sAggInfo.nColumn; +- if( p->pGroupBy==0 && p->pHaving==0 && sAggInfo.nFunc==1 ){ +- minMaxFlag = minMaxQuery(db, sAggInfo.aFunc[0].pExpr, &pMinMaxOrderBy); ++ pAggInfo->nAccumulator = pAggInfo->nColumn; ++ if( p->pGroupBy==0 && p->pHaving==0 && pAggInfo->nFunc==1 ){ ++ minMaxFlag = minMaxQuery(db, pAggInfo->aFunc[0].pExpr, &pMinMaxOrderBy); + }else{ + minMaxFlag = WHERE_ORDERBY_NORMAL; + } +- for(i=0; inFunc; i++){ ++ Expr *pExpr = pAggInfo->aFunc[i].pExpr; + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + sNC.ncFlags |= NC_InAggFunc; + sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList); +@@ -134242,22 +135373,22 @@ SQLITE_PRIVATE int sqlite3Select( + #endif + sNC.ncFlags &= ~NC_InAggFunc; + } +- sAggInfo.mxReg = pParse->nMem; ++ pAggInfo->mxReg = pParse->nMem; + if( db->mallocFailed ) goto select_end; + #if SELECTTRACE_ENABLED + if( sqlite3SelectTrace & 0x400 ){ + int ii; +- SELECTTRACE(0x400,pParse,p,("After aggregate analysis:\n")); ++ SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo)); + sqlite3TreeViewSelect(0, p, 0); +- for(ii=0; iinColumn; ii++){ + sqlite3DebugPrintf("agg-column[%d] iMem=%d\n", +- ii, sAggInfo.aCol[ii].iMem); +- sqlite3TreeViewExpr(0, sAggInfo.aCol[ii].pExpr, 0); ++ ii, pAggInfo->aCol[ii].iMem); ++ sqlite3TreeViewExpr(0, pAggInfo->aCol[ii].pExpr, 0); + } +- for(ii=0; iinFunc; ii++){ + sqlite3DebugPrintf("agg-func[%d]: iMem=%d\n", +- ii, sAggInfo.aFunc[ii].iMem); +- sqlite3TreeViewExpr(0, sAggInfo.aFunc[ii].pExpr, 0); ++ ii, pAggInfo->aFunc[ii].iMem); ++ sqlite3TreeViewExpr(0, pAggInfo->aFunc[ii].pExpr, 0); + } + } + #endif +@@ -134282,10 +135413,11 @@ SQLITE_PRIVATE int sqlite3Select( + ** that we do not need it after all, the OP_SorterOpen instruction + ** will be converted into a Noop. + */ +- sAggInfo.sortingIdx = pParse->nTab++; +- pKeyInfo = sqlite3KeyInfoFromExprList(pParse,pGroupBy,0,sAggInfo.nColumn); ++ pAggInfo->sortingIdx = pParse->nTab++; ++ pKeyInfo = sqlite3KeyInfoFromExprList(pParse, pGroupBy, ++ 0, pAggInfo->nColumn); + addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, +- sAggInfo.sortingIdx, sAggInfo.nSortingColumn, ++ pAggInfo->sortingIdx, pAggInfo->nSortingColumn, + 0, (char*)pKeyInfo, P4_KEYINFO); + + /* Initialize memory locations used by GROUP BY aggregate processing +@@ -134340,8 +135472,8 @@ SQLITE_PRIVATE int sqlite3Select( + nGroupBy = pGroupBy->nExpr; + nCol = nGroupBy; + j = nGroupBy; +- for(i=0; i=j ){ ++ for(i=0; inColumn; i++){ ++ if( pAggInfo->aCol[i].iSorterColumn>=j ){ + nCol++; + j++; + } +@@ -134349,8 +135481,8 @@ SQLITE_PRIVATE int sqlite3Select( + regBase = sqlite3GetTempRange(pParse, nCol); + sqlite3ExprCodeExprList(pParse, pGroupBy, regBase, 0, 0); + j = nGroupBy; +- for(i=0; inColumn; i++){ ++ struct AggInfo_col *pCol = &pAggInfo->aCol[i]; + if( pCol->iSorterColumn>=j ){ + int r1 = j + regBase; + sqlite3ExprCodeGetColumnOfTable(v, +@@ -134360,16 +135492,16 @@ SQLITE_PRIVATE int sqlite3Select( + } + regRecord = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regRecord); +- sqlite3VdbeAddOp2(v, OP_SorterInsert, sAggInfo.sortingIdx, regRecord); ++ sqlite3VdbeAddOp2(v, OP_SorterInsert, pAggInfo->sortingIdx, regRecord); + sqlite3ReleaseTempReg(pParse, regRecord); + sqlite3ReleaseTempRange(pParse, regBase, nCol); + sqlite3WhereEnd(pWInfo); +- sAggInfo.sortingIdxPTab = sortPTab = pParse->nTab++; ++ pAggInfo->sortingIdxPTab = sortPTab = pParse->nTab++; + sortOut = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp3(v, OP_OpenPseudo, sortPTab, sortOut, nCol); +- sqlite3VdbeAddOp2(v, OP_SorterSort, sAggInfo.sortingIdx, addrEnd); ++ sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd); + VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v); +- sAggInfo.useSortingIdx = 1; ++ pAggInfo->useSortingIdx = 1; + } + + /* If the index or temporary table used by the GROUP BY sort +@@ -134393,14 +135525,14 @@ SQLITE_PRIVATE int sqlite3Select( + */ + addrTopOfLoop = sqlite3VdbeCurrentAddr(v); + if( groupBySort ){ +- sqlite3VdbeAddOp3(v, OP_SorterData, sAggInfo.sortingIdx, ++ sqlite3VdbeAddOp3(v, OP_SorterData, pAggInfo->sortingIdx, + sortOut, sortPTab); + } + for(j=0; jnExpr; j++){ + if( groupBySort ){ + sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j); + }else{ +- sAggInfo.directMode = 1; ++ pAggInfo->directMode = 1; + sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); + } + } +@@ -134430,14 +135562,14 @@ SQLITE_PRIVATE int sqlite3Select( + ** the current row + */ + sqlite3VdbeJumpHere(v, addr1); +- updateAccumulator(pParse, iUseFlag, &sAggInfo); ++ updateAccumulator(pParse, iUseFlag, pAggInfo); + sqlite3VdbeAddOp2(v, OP_Integer, 1, iUseFlag); + VdbeComment((v, "indicate data in accumulator")); + + /* End of the loop + */ + if( groupBySort ){ +- sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop); ++ sqlite3VdbeAddOp2(v, OP_SorterNext, pAggInfo->sortingIdx, addrTopOfLoop); + VdbeCoverage(v); + }else{ + sqlite3WhereEnd(pWInfo); +@@ -134470,7 +135602,7 @@ SQLITE_PRIVATE int sqlite3Select( + VdbeCoverage(v); + VdbeComment((v, "Groupby result generator entry point")); + sqlite3VdbeAddOp1(v, OP_Return, regOutputRow); +- finalizeAggFunctions(pParse, &sAggInfo); ++ finalizeAggFunctions(pParse, pAggInfo); + sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL); + selectInnerLoop(pParse, p, -1, &sSort, + &sDistinct, pDest, +@@ -134481,16 +135613,15 @@ SQLITE_PRIVATE int sqlite3Select( + /* Generate a subroutine that will reset the group-by accumulator + */ + sqlite3VdbeResolveLabel(v, addrReset); +- resetAccumulator(pParse, &sAggInfo); ++ resetAccumulator(pParse, pAggInfo); + sqlite3VdbeAddOp2(v, OP_Integer, 0, iUseFlag); + VdbeComment((v, "indicate accumulator empty")); + sqlite3VdbeAddOp1(v, OP_Return, regReset); + + } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */ + else { +-#ifndef SQLITE_OMIT_BTREECOUNT + Table *pTab; +- if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){ ++ if( (pTab = isSimpleCount(p, pAggInfo))!=0 ){ + /* If isSimpleCount() returns a pointer to a Table structure, then + ** the SQL statement is of the form: + ** +@@ -134524,13 +135655,15 @@ SQLITE_PRIVATE int sqlite3Select( + ** passed to keep OP_OpenRead happy. + */ + if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab); +- for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ +- if( pIdx->bUnordered==0 +- && pIdx->szIdxRowszTabRow +- && pIdx->pPartIdxWhere==0 +- && (!pBest || pIdx->szIdxRowszIdxRow) +- ){ +- pBest = pIdx; ++ if( !p->pSrc->a[0].fg.notIndexed ){ ++ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ ++ if( pIdx->bUnordered==0 ++ && pIdx->szIdxRowszTabRow ++ && pIdx->pPartIdxWhere==0 ++ && (!pBest || pIdx->szIdxRowszIdxRow) ++ ){ ++ pBest = pIdx; ++ } + } + } + if( pBest ){ +@@ -134543,12 +135676,10 @@ SQLITE_PRIVATE int sqlite3Select( + if( pKeyInfo ){ + sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO); + } +- sqlite3VdbeAddOp2(v, OP_Count, iCsr, sAggInfo.aFunc[0].iMem); ++ sqlite3VdbeAddOp2(v, OP_Count, iCsr, pAggInfo->aFunc[0].iMem); + sqlite3VdbeAddOp1(v, OP_Close, iCsr); + explainSimpleCount(pParse, pTab, pBest); +- }else +-#endif /* SQLITE_OMIT_BTREECOUNT */ +- { ++ }else{ + int regAcc = 0; /* "populate accumulators" flag */ + + /* If there are accumulator registers but no min() or max() functions +@@ -134560,12 +135691,16 @@ SQLITE_PRIVATE int sqlite3Select( + ** first row visited by the aggregate, so that they are updated at + ** least once even if the FILTER clause means the min() or max() + ** function visits zero rows. */ +- if( sAggInfo.nAccumulator ){ +- for(i=0; ifuncFlags&SQLITE_FUNC_NEEDCOLL ) break; ++ if( pAggInfo->nAccumulator ){ ++ for(i=0; inFunc; i++){ ++ if( ExprHasProperty(pAggInfo->aFunc[i].pExpr, EP_WinFunc) ){ ++ continue; ++ } ++ if( pAggInfo->aFunc[i].pFunc->funcFlags&SQLITE_FUNC_NEEDCOLL ){ ++ break; ++ } + } +- if( i==sAggInfo.nFunc ){ ++ if( i==pAggInfo->nFunc ){ + regAcc = ++pParse->nMem; + sqlite3VdbeAddOp2(v, OP_Integer, 0, regAcc); + } +@@ -134576,7 +135711,7 @@ SQLITE_PRIVATE int sqlite3Select( + ** of output. + */ + assert( p->pGroupBy==0 ); +- resetAccumulator(pParse, &sAggInfo); ++ resetAccumulator(pParse, pAggInfo); + + /* If this query is a candidate for the min/max optimization, then + ** minMaxFlag will have been previously set to either +@@ -134592,7 +135727,7 @@ SQLITE_PRIVATE int sqlite3Select( + if( pWInfo==0 ){ + goto select_end; + } +- updateAccumulator(pParse, regAcc, &sAggInfo); ++ updateAccumulator(pParse, regAcc, pAggInfo); + if( regAcc ) sqlite3VdbeAddOp2(v, OP_Integer, 1, regAcc); + if( sqlite3WhereIsOrdered(pWInfo)>0 ){ + sqlite3VdbeGoto(v, sqlite3WhereBreakLabel(pWInfo)); +@@ -134600,7 +135735,7 @@ SQLITE_PRIVATE int sqlite3Select( + (minMaxFlag==WHERE_ORDERBY_MIN?"min":"max"))); + } + sqlite3WhereEnd(pWInfo); +- finalizeAggFunctions(pParse, &sAggInfo); ++ finalizeAggFunctions(pParse, pAggInfo); + } + + sSort.pOrderBy = 0; +@@ -134639,8 +135774,25 @@ SQLITE_PRIVATE int sqlite3Select( + */ + select_end: + sqlite3ExprListDelete(db, pMinMaxOrderBy); +- sqlite3DbFree(db, sAggInfo.aCol); +- sqlite3DbFree(db, sAggInfo.aFunc); ++#ifdef SQLITE_DEBUG ++ if( pAggInfo && !db->mallocFailed ){ ++ for(i=0; inColumn; i++){ ++ Expr *pExpr = pAggInfo->aCol[i].pExpr; ++ assert( pExpr!=0 || db->mallocFailed ); ++ if( pExpr==0 ) continue; ++ assert( pExpr->pAggInfo==pAggInfo ); ++ assert( pExpr->iAgg==i ); ++ } ++ for(i=0; inFunc; i++){ ++ Expr *pExpr = pAggInfo->aFunc[i].pExpr; ++ assert( pExpr!=0 || db->mallocFailed ); ++ if( pExpr==0 ) continue; ++ assert( pExpr->pAggInfo==pAggInfo ); ++ assert( pExpr->iAgg==i ); ++ } ++ } ++#endif ++ + #if SELECTTRACE_ENABLED + SELECTTRACE(0x1,pParse,p,("end processing\n")); + if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){ +@@ -134711,7 +135863,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){ + if( p->nData + need > p->nAlloc ){ + char **azNew; + p->nAlloc = p->nAlloc*2 + need; +- azNew = sqlite3_realloc64( p->azResult, sizeof(char*)*p->nAlloc ); ++ azNew = sqlite3Realloc( p->azResult, sizeof(char*)*p->nAlloc ); + if( azNew==0 ) goto malloc_failed; + p->azResult = azNew; + } +@@ -134820,7 +135972,7 @@ SQLITE_API int sqlite3_get_table( + } + if( res.nAlloc>res.nData ){ + char **azNew; +- azNew = sqlite3_realloc64( res.azResult, sizeof(char*)*res.nData ); ++ azNew = sqlite3Realloc( res.azResult, sizeof(char*)*res.nData ); + if( azNew==0 ){ + sqlite3_free_table(&res.azResult[1]); + db->errCode = SQLITE_NOMEM; +@@ -135436,7 +136588,7 @@ SQLITE_PRIVATE void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr) + assert( zDb!=0 || sqlite3BtreeHoldsAllMutexes(db) ); + for(i=OMIT_TEMPDB; inDb; i++){ + int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ +- if( zDb && sqlite3StrICmp(db->aDb[j].zDbSName, zDb) ) continue; ++ if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue; + assert( sqlite3SchemaMutexHeld(db, j, 0) ); + pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName); + if( pTrigger ) break; +@@ -136110,10 +137262,10 @@ static void updateVirtualTable( + ** function is capable of transforming these types of expressions into + ** sqlite3_value objects. + ** +-** If parameter iReg is not negative, code an OP_RealAffinity instruction +-** on register iReg. This is used when an equivalent integer value is +-** stored in place of an 8-byte floating point value in order to save +-** space. ++** If column as REAL affinity and the table is an ordinary b-tree table ++** (not a virtual table) then the value might have been stored as an ++** integer. In that case, add an OP_RealAffinity opcode to make sure ++** it has been converted into REAL. + */ + SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){ + assert( pTab!=0 ); +@@ -136130,7 +137282,7 @@ SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){ + } + } + #ifndef SQLITE_OMIT_FLOATING_POINT +- if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){ ++ if( pTab->aCol[i].affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){ + sqlite3VdbeAddOp1(v, OP_RealAffinity, iReg); + } + #endif +@@ -136673,7 +137825,9 @@ SQLITE_PRIVATE void sqlite3Update( + } + sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, 0, iBaseCur, + aToOpen, 0, 0); +- if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); ++ if( addrOnce ){ ++ sqlite3VdbeJumpHereOrPopInst(v, addrOnce); ++ } + } + + /* Top of the update loop */ +@@ -137626,18 +138780,7 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3RunVacuum( + } + db->mDbFlags |= DBFLAG_VacuumInto; + } +- nRes = sqlite3BtreeGetOptimalReserve(pMain); +- +- /* A VACUUM cannot change the pagesize of an encrypted database. */ +-#ifdef SQLITE_HAS_CODEC +- if( db->nextPagesize ){ +- extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*); +- int nKey; +- char *zKey; +- sqlite3CodecGetKey(db, iDb, (void**)&zKey, &nKey); +- if( nKey ) db->nextPagesize = 0; +- } +-#endif ++ nRes = sqlite3BtreeGetRequestedReserve(pMain); + + sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size); + sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0)); +@@ -137781,7 +138924,7 @@ end_of_vacuum: + db->nChange = saved_nChange; + db->nTotalChange = saved_nTotalChange; + db->mTrace = saved_mTrace; +- sqlite3BtreeSetPageSize(pMain, -1, -1, 1); ++ sqlite3BtreeSetPageSize(pMain, -1, 0, 1); + + /* Currently there is an SQL level transaction open on the vacuum + ** database. No locks are held on any other files (since the main file +@@ -138988,7 +140131,7 @@ SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse *pParse, Table *pTab){ + if( pTab==pToplevel->apVtabLock[i] ) return; + } + n = (pToplevel->nVtabLock+1)*sizeof(pToplevel->apVtabLock[0]); +- apVtabLock = sqlite3_realloc64(pToplevel->apVtabLock, n); ++ apVtabLock = sqlite3Realloc(pToplevel->apVtabLock, n); + if( apVtabLock ){ + pToplevel->apVtabLock = apVtabLock; + pToplevel->apVtabLock[pToplevel->nVtabLock++] = pTab; +@@ -139445,6 +140588,12 @@ struct WhereTerm { + #define TERM_LIKE 0x0400 /* The original LIKE operator */ + #define TERM_IS 0x0800 /* Term.pExpr is an IS operator */ + #define TERM_VARSELECT 0x1000 /* Term.pExpr contains a correlated sub-query */ ++#define TERM_HEURTRUTH 0x2000 /* Heuristic truthProb used */ ++#ifdef SQLITE_ENABLE_STAT4 ++# define TERM_HIGHTRUTH 0x4000 /* Term excludes few rows */ ++#else ++# define TERM_HIGHTRUTH 0 /* Only used with STAT4 */ ++#endif + + /* + ** An instance of the WhereScan object is used as an iterator for locating +@@ -139559,13 +140708,16 @@ struct WhereLoopBuilder { + UnpackedRecord *pRec; /* Probe for stat4 (if required) */ + int nRecValid; /* Number of valid fields currently in pRec */ + #endif +- unsigned int bldFlags; /* SQLITE_BLDF_* flags */ ++ unsigned char bldFlags1; /* First set of SQLITE_BLDF_* flags */ ++ unsigned char bldFlags2; /* Second set of SQLITE_BLDF_* flags */ + unsigned int iPlanLimit; /* Search limiter */ + }; + + /* Allowed values for WhereLoopBuider.bldFlags */ +-#define SQLITE_BLDF_INDEXED 0x0001 /* An index is used */ +-#define SQLITE_BLDF_UNIQUE 0x0002 /* All keys of a UNIQUE index used */ ++#define SQLITE_BLDF1_INDEXED 0x0001 /* An index is used */ ++#define SQLITE_BLDF1_UNIQUE 0x0002 /* All keys of a UNIQUE index used */ ++ ++#define SQLITE_BLDF2_2NDPASS 0x0004 /* Second builder pass needed */ + + /* The WhereLoopBuilder.iPlanLimit is used to limit the number of + ** index+constraint combinations the query planner will consider for a +@@ -141179,7 +142331,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( + pCompare->pRight = pRight = sqlite3Expr(db, TK_REGISTER, 0); + if( pRight ){ + pRight->iTable = iReg+j+2; +- sqlite3ExprIfFalse(pParse, pCompare, pLevel->addrCont, 0); ++ sqlite3ExprIfFalse( ++ pParse, pCompare, pLevel->addrCont, SQLITE_JUMPIFNULL ++ ); + } + pCompare->pLeft = 0; + sqlite3ExprDelete(db, pCompare); +@@ -141456,6 +142610,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( + nExtraReg = 1; + bSeekPastNull = 1; + pLevel->regBignull = regBignull = ++pParse->nMem; ++ if( pLevel->iLeftJoin ){ ++ sqlite3VdbeAddOp2(v, OP_Integer, 0, regBignull); ++ } + pLevel->addrBignull = sqlite3VdbeMakeLabel(pParse); + } + +@@ -142593,7 +143750,8 @@ static int isAuxiliaryVtabOperator( + ** MATCH(expression,vtab_column) + */ + pCol = pList->a[1].pExpr; +- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ ++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); ++ if( ExprIsVtab(pCol) ){ + for(i=0; iu.zToken, aOp[i].zOp)==0 ){ + *peOp2 = aOp[i].eOp2; +@@ -142615,7 +143773,8 @@ static int isAuxiliaryVtabOperator( + ** with function names in an arbitrary case. + */ + pCol = pList->a[0].pExpr; +- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ ++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); ++ if( ExprIsVtab(pCol) ){ + sqlite3_vtab *pVtab; + sqlite3_module *pMod; + void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**); +@@ -142638,10 +143797,12 @@ static int isAuxiliaryVtabOperator( + int res = 0; + Expr *pLeft = pExpr->pLeft; + Expr *pRight = pExpr->pRight; +- if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){ ++ testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 ); ++ if( ExprIsVtab(pLeft) ){ + res++; + } +- if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){ ++ testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 ); ++ if( pRight && ExprIsVtab(pRight) ){ + res++; + SWAP(Expr*, pLeft, pRight); + } +@@ -146125,7 +147286,9 @@ static void whereLoopOutputAdjust( + /* In the absence of explicit truth probabilities, use heuristics to + ** guess a reasonable truth probability. */ + pLoop->nOut--; +- if( pTerm->eOperator&(WO_EQ|WO_IS) ){ ++ if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 ++ && (pTerm->wtFlags & TERM_HIGHTRUTH)==0 /* tag-20200224-1 */ ++ ){ + Expr *pRight = pTerm->pExpr->pRight; + int k = 0; + testcase( pTerm->pExpr->op==TK_IS ); +@@ -146134,7 +147297,10 @@ static void whereLoopOutputAdjust( + }else{ + k = 20; + } +- if( iReducewtFlags |= TERM_HEURTRUTH; ++ iReduce = k; ++ } + } + } + } +@@ -146316,9 +147482,9 @@ static int whereLoopAddBtreeIndex( + } + + if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){ +- pBuilder->bldFlags |= SQLITE_BLDF_UNIQUE; ++ pBuilder->bldFlags1 |= SQLITE_BLDF1_UNIQUE; + }else{ +- pBuilder->bldFlags |= SQLITE_BLDF_INDEXED; ++ pBuilder->bldFlags1 |= SQLITE_BLDF1_INDEXED; + } + pNew->wsFlags = saved_wsFlags; + pNew->u.btree.nEq = saved_nEq; +@@ -146483,6 +147649,27 @@ static int whereLoopAddBtreeIndex( + if( rc!=SQLITE_OK ) break; /* Jump out of the pTerm loop */ + if( nOut ){ + pNew->nOut = sqlite3LogEst(nOut); ++ if( nEq==1 ++ /* TUNING: Mark terms as "low selectivity" if they seem likely ++ ** to be true for half or more of the rows in the table. ++ ** See tag-202002240-1 */ ++ && pNew->nOut+10 > pProbe->aiRowLogEst[0] ++ ){ ++#if WHERETRACE_ENABLED /* 0x01 */ ++ if( sqlite3WhereTrace & 0x01 ){ ++ sqlite3DebugPrintf( ++ "STAT4 determines term has low selectivity:\n"); ++ sqlite3WhereTermPrint(pTerm, 999); ++ } ++#endif ++ pTerm->wtFlags |= TERM_HIGHTRUTH; ++ if( pTerm->wtFlags & TERM_HEURTRUTH ){ ++ /* If the term has previously been used with an assumption of ++ ** higher selectivity, then set the flag to rerun the ++ ** loop computations. */ ++ pBuilder->bldFlags2 |= SQLITE_BLDF2_2NDPASS; ++ } ++ } + if( pNew->nOut>saved_nOut ) pNew->nOut = saved_nOut; + pNew->nOut -= nIn; + } +@@ -146559,6 +147746,7 @@ static int whereLoopAddBtreeIndex( + && saved_nEq+1nKeyCol + && saved_nEq==pNew->nLTerm + && pProbe->noSkipScan==0 ++ && pProbe->hasStat1!=0 + && OptimizationEnabled(db, SQLITE_SkipScan) + && pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */ + && (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK +@@ -146906,9 +148094,9 @@ static int whereLoopAddBtree( + } + } + +- pBuilder->bldFlags = 0; ++ pBuilder->bldFlags1 = 0; + rc = whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, 0); +- if( pBuilder->bldFlags==SQLITE_BLDF_INDEXED ){ ++ if( pBuilder->bldFlags1==SQLITE_BLDF1_INDEXED ){ + /* If a non-unique index is used, or if a prefix of the key for + ** unique index is used (making the index functionally non-unique) + ** then the sqlite_stat1 data becomes important for scoring the +@@ -147579,8 +148767,11 @@ static i8 wherePathSatisfiesOrderBy( + if( j>=pLoop->nLTerm ) continue; + } + if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && pOBExpr->iColumn>=0 ){ +- if( sqlite3ExprCollSeqMatch(pWInfo->pParse, +- pOrderBy->a[i].pExpr, pTerm->pExpr)==0 ){ ++ Parse *pParse = pWInfo->pParse; ++ CollSeq *pColl1 = sqlite3ExprNNCollSeq(pParse, pOrderBy->a[i].pExpr); ++ CollSeq *pColl2 = sqlite3ExprCompareCollSeq(pParse, pTerm->pExpr); ++ assert( pColl1 ); ++ if( pColl2==0 || sqlite3StrICmp(pColl1->zName, pColl2->zName) ){ + continue; + } + testcase( pTerm->pExpr->op==TK_IS ); +@@ -148360,6 +149551,28 @@ static int exprIsDeterministic(Expr *p){ + return w.eCode; + } + ++ ++#ifdef WHERETRACE_ENABLED ++/* ++** Display all WhereLoops in pWInfo ++*/ ++static void showAllWhereLoops(WhereInfo *pWInfo, WhereClause *pWC){ ++ if( sqlite3WhereTrace ){ /* Display all of the WhereLoop objects */ ++ WhereLoop *p; ++ int i; ++ static const char zLabel[] = "0123456789abcdefghijklmnopqrstuvwyxz" ++ "ABCDEFGHIJKLMNOPQRSTUVWYXZ"; ++ for(p=pWInfo->pLoops, i=0; p; p=p->pNextLoop, i++){ ++ p->cId = zLabel[i%(sizeof(zLabel)-1)]; ++ sqlite3WhereLoopPrint(p, pWC); ++ } ++ } ++} ++# define WHERETRACE_ALL_LOOPS(W,C) showAllWhereLoops(W,C) ++#else ++# define WHERETRACE_ALL_LOOPS(W,C) ++#endif ++ + /* + ** Generate the beginning of the loop used for WHERE clause processing. + ** The return value is a pointer to an opaque structure that contains +@@ -148661,19 +149874,28 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ + rc = whereLoopAddAll(&sWLB); + if( rc ) goto whereBeginError; +- +-#ifdef WHERETRACE_ENABLED +- if( sqlite3WhereTrace ){ /* Display all of the WhereLoop objects */ +- WhereLoop *p; +- int i; +- static const char zLabel[] = "0123456789abcdefghijklmnopqrstuvwyxz" +- "ABCDEFGHIJKLMNOPQRSTUVWYXZ"; +- for(p=pWInfo->pLoops, i=0; p; p=p->pNextLoop, i++){ +- p->cId = zLabel[i%(sizeof(zLabel)-1)]; +- sqlite3WhereLoopPrint(p, sWLB.pWC); +- } +- } +-#endif ++ ++#ifdef SQLITE_ENABLE_STAT4 ++ /* If one or more WhereTerm.truthProb values were used in estimating ++ ** loop parameters, but then those truthProb values were subsequently ++ ** changed based on STAT4 information while computing subsequent loops, ++ ** then we need to rerun the whole loop building process so that all ++ ** loops will be built using the revised truthProb values. */ ++ if( sWLB.bldFlags2 & SQLITE_BLDF2_2NDPASS ){ ++ WHERETRACE_ALL_LOOPS(pWInfo, sWLB.pWC); ++ WHERETRACE(0xffff, ++ ("**** Redo all loop computations due to" ++ " TERM_HIGHTRUTH changes ****\n")); ++ while( pWInfo->pLoops ){ ++ WhereLoop *p = pWInfo->pLoops; ++ pWInfo->pLoops = p->pNextLoop; ++ whereLoopDelete(db, p); ++ } ++ rc = whereLoopAddAll(&sWLB); ++ if( rc ) goto whereBeginError; ++ } ++#endif ++ WHERETRACE_ALL_LOOPS(pWInfo, sWLB.pWC); + + wherePathSolver(pWInfo, 0); + if( db->mallocFailed ) goto whereBeginError; +@@ -148944,7 +150166,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( + && (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0 + && pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED + ){ +- sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ); /* Hint to COMDB2 */ ++ sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ); + } + VdbeComment((v, "%s", pIx->zName)); + #ifdef SQLITE_ENABLE_COLUMN_USED_MASK +@@ -149102,12 +150324,6 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ + if( pIn->eEndLoopOp!=OP_Noop ){ + if( pIn->nPrefix ){ + assert( pLoop->wsFlags & WHERE_IN_EARLYOUT ); +- if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 ){ +- sqlite3VdbeAddOp4Int(v, OP_IfNoHope, pLevel->iIdxCur, +- sqlite3VdbeCurrentAddr(v)+2+(pLevel->iLeftJoin!=0), +- pIn->iBase, pIn->nPrefix); +- VdbeCoverage(v); +- } + if( pLevel->iLeftJoin ){ + /* For LEFT JOIN queries, cursor pIn->iCur may not have been + ** opened yet. This occurs for WHERE clauses such as +@@ -149118,10 +150334,17 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ + ** jump over the OP_Next or OP_Prev instruction about to + ** be coded. */ + sqlite3VdbeAddOp2(v, OP_IfNotOpen, pIn->iCur, +- sqlite3VdbeCurrentAddr(v) + 2 ++ sqlite3VdbeCurrentAddr(v) + 2 + ++ ((pLoop->wsFlags & WHERE_VIRTUALTABLE)==0) + ); + VdbeCoverage(v); + } ++ if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 ){ ++ sqlite3VdbeAddOp4Int(v, OP_IfNoHope, pLevel->iIdxCur, ++ sqlite3VdbeCurrentAddr(v)+2, ++ pIn->iBase, pIn->nPrefix); ++ VdbeCoverage(v); ++ } + } + sqlite3VdbeAddOp2(v, pIn->eEndLoopOp, pIn->iCur, pIn->addrInTop); + VdbeCoverage(v); +@@ -150200,13 +151423,19 @@ static ExprList *exprListAppendList( + int i; + int nInit = pList ? pList->nExpr : 0; + for(i=0; inExpr; i++){ +- int iDummy; + Expr *pDup = sqlite3ExprDup(pParse->db, pAppend->a[i].pExpr, 0); + assert( pDup==0 || !ExprHasProperty(pDup, EP_MemToken) ); +- if( bIntToNull && pDup && sqlite3ExprIsInteger(pDup, &iDummy) ){ +- pDup->op = TK_NULL; +- pDup->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse); +- pDup->u.zToken = 0; ++ if( bIntToNull && pDup ){ ++ int iDummy; ++ Expr *pSub; ++ for(pSub=pDup; ExprHasProperty(pSub, EP_Skip); pSub=pSub->pLeft){ ++ assert( pSub ); ++ } ++ if( sqlite3ExprIsInteger(pSub, &iDummy) ){ ++ pSub->op = TK_NULL; ++ pSub->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse); ++ pSub->u.zToken = 0; ++ } + } + pList = sqlite3ExprListAppend(pParse, pList, pDup); + if( pList ) pList->a[nInit+i].sortFlags = pAppend->a[i].sortFlags; +@@ -150215,6 +151444,23 @@ static ExprList *exprListAppendList( + return pList; + } + ++/* ++** When rewriting a query, if the new subquery in the FROM clause ++** contains TK_AGG_FUNCTION nodes that refer to an outer query, ++** then we have to increase the Expr->op2 values of those nodes ++** due to the extra subquery layer that was added. ++** ++** See also the incrAggDepth() routine in resolve.c ++*/ ++static int sqlite3WindowExtraAggFuncDepth(Walker *pWalker, Expr *pExpr){ ++ if( pExpr->op==TK_AGG_FUNCTION ++ && pExpr->op2>=pWalker->walkerDepth ++ ){ ++ pExpr->op2++; ++ } ++ return WRC_Continue; ++} ++ + /* + ** If the SELECT statement passed as the second argument does not invoke + ** any SQL window functions, this function is a no-op. Otherwise, it +@@ -150238,11 +151484,16 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){ + Window *pMWin = p->pWin; /* Master window object */ + Window *pWin; /* Window object iterator */ + Table *pTab; ++ Walker w; ++ ++ u32 selFlags = p->selFlags; + + pTab = sqlite3DbMallocZero(db, sizeof(Table)); + if( pTab==0 ){ + return sqlite3ErrorToParser(db, SQLITE_NOMEM); + } ++ sqlite3AggInfoPersistWalkerInit(&w, pParse); ++ sqlite3WalkSelect(&w, p); + + p->pSrc = 0; + p->pWhere = 0; +@@ -150327,6 +151578,7 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){ + sqlite3SrcListAssignCursors(pParse, p->pSrc); + pSub->selFlags |= SF_Expanded; + pTab2 = sqlite3ResultSetOfSelect(pParse, pSub, SQLITE_AFF_NONE); ++ pSub->selFlags |= (selFlags & SF_Aggregate); + if( pTab2==0 ){ + /* Might actually be some other kind of error, but in that case + ** pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get +@@ -150337,6 +151589,11 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){ + pTab->tabFlags |= TF_Ephemeral; + p->pSrc->a[0].pTab = pTab; + pTab = pTab2; ++ memset(&w, 0, sizeof(w)); ++ w.xExprCallback = sqlite3WindowExtraAggFuncDepth; ++ w.xSelectCallback = sqlite3WalkerDepthIncrease; ++ w.xSelectCallback2 = sqlite3WalkerDepthDecrease; ++ sqlite3WalkSelect(&w, pSub); + } + }else{ + sqlite3SelectDelete(db, pSub); +@@ -151215,6 +152472,7 @@ static int windowInitAccum(Parse *pParse, Window *pMWin){ + Window *pWin; + for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ + FuncDef *pFunc = pWin->pFunc; ++ assert( pWin->regAccum ); + sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regAccum); + nArg = MAX(nArg, windowArgCount(pWin)); + if( pMWin->regStartRowid==0 ){ +@@ -151593,6 +152851,10 @@ SQLITE_PRIVATE Window *sqlite3WindowDup(sqlite3 *db, Expr *pOwner, Window *p){ + pNew->eStart = p->eStart; + pNew->eExclude = p->eExclude; + pNew->regResult = p->regResult; ++ pNew->regAccum = p->regAccum; ++ pNew->iArgCol = p->iArgCol; ++ pNew->iEphCsr = p->iEphCsr; ++ pNew->bExprArgs = p->bExprArgs; + pNew->pStart = sqlite3ExprDup(db, p->pStart, 0); + pNew->pEnd = sqlite3ExprDup(db, p->pEnd, 0); + pNew->pOwner = pOwner; +@@ -152430,6 +153692,7 @@ static void disableLookaside(Parse *pParse){ + p->op = (u8)op; + p->affExpr = 0; + p->flags = EP_Leaf; ++ ExprClearVVAProperties(p); + p->iAgg = -1; + p->pLeft = p->pRight = 0; + p->x.pList = 0; +@@ -156498,6 +157761,13 @@ static YYACTIONTYPE yy_reduce( + */ + sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy202); + yymsp[-4].minor.yy202 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy192 ? "1" : "0"); ++ }else if( yymsp[-1].minor.yy242->nExpr==1 && sqlite3ExprIsConstant(yymsp[-1].minor.yy242->a[0].pExpr) ){ ++ Expr *pRHS = yymsp[-1].minor.yy242->a[0].pExpr; ++ yymsp[-1].minor.yy242->a[0].pExpr = 0; ++ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy242); ++ pRHS = sqlite3PExpr(pParse, TK_UPLUS, pRHS, 0); ++ yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_EQ, yymsp[-4].minor.yy202, pRHS); ++ if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0); + }else{ + yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0); + if( yymsp[-4].minor.yy202 ){ +@@ -157769,12 +159039,17 @@ static int keywordCode(const char *z, int n, int *pType){ + i = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n) % 127; + for(i=((int)aKWHash[i])-1; i>=0; i=((int)aKWNext[i])-1){ + if( aKWLen[i]!=n ) continue; +- j = 0; + zKW = &zKWText[aKWOffset[i]]; + #ifdef SQLITE_ASCII ++ if( (z[0]&~0x20)!=zKW[0] ) continue; ++ if( (z[1]&~0x20)!=zKW[1] ) continue; ++ j = 2; + while( jaLimit[SQLITE_LIMIT_SQL_LENGTH]; + if( db->nVdbeActive==0 ){ +- db->u1.isInterrupted = 0; ++ AtomicStore(&db->u1.isInterrupted, 0); + } + pParse->rc = SQLITE_OK; + pParse->zTail = zSql; +@@ -158417,7 +159692,7 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzEr + if( tokenType>=TK_SPACE ){ + assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL ); + #endif /* SQLITE_OMIT_WINDOWFUNC */ +- if( db->u1.isInterrupted ){ ++ if( AtomicLoad(&db->u1.isInterrupted) ){ + pParse->rc = SQLITE_INTERRUPT; + break; + } +@@ -159084,15 +160359,78 @@ SQLITE_PRIVATE int sqlite3IcuInit(sqlite3 *db); + /************** End of sqliteicu.h *******************************************/ + /************** Continuing where we left off in main.c ***********************/ + #endif ++ ++/* ++** This is an extension initializer that is a no-op and always ++** succeeds, except that it fails if the fault-simulation is set ++** to 500. ++*/ ++static int sqlite3TestExtInit(sqlite3 *db){ ++ (void)db; ++ return sqlite3FaultSim(500); ++} ++ ++ ++/* ++** Forward declarations of external module initializer functions ++** for modules that need them. ++*/ ++#ifdef SQLITE_ENABLE_FTS1 ++SQLITE_PRIVATE int sqlite3Fts1Init(sqlite3*); ++#endif ++#ifdef SQLITE_ENABLE_FTS2 ++SQLITE_PRIVATE int sqlite3Fts2Init(sqlite3*); ++#endif ++#ifdef SQLITE_ENABLE_FTS5 ++SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*); ++#endif + #ifdef SQLITE_ENABLE_JSON1 + SQLITE_PRIVATE int sqlite3Json1Init(sqlite3*); + #endif + #ifdef SQLITE_ENABLE_STMTVTAB + SQLITE_PRIVATE int sqlite3StmtVtabInit(sqlite3*); + #endif ++ ++/* ++** An array of pointers to extension initializer functions for ++** built-in extensions. ++*/ ++static int (*const sqlite3BuiltinExtensions[])(sqlite3*) = { ++#ifdef SQLITE_ENABLE_FTS1 ++ sqlite3Fts1Init, ++#endif ++#ifdef SQLITE_ENABLE_FTS2 ++ sqlite3Fts2Init, ++#endif ++#ifdef SQLITE_ENABLE_FTS3 ++ sqlite3Fts3Init, ++#endif + #ifdef SQLITE_ENABLE_FTS5 +-SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*); ++ sqlite3Fts5Init, ++#endif ++#if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS) ++ sqlite3IcuInit, ++#endif ++#ifdef SQLITE_ENABLE_RTREE ++ sqlite3RtreeInit, ++#endif ++#ifdef SQLITE_ENABLE_DBPAGE_VTAB ++ sqlite3DbpageRegister, ++#endif ++#ifdef SQLITE_ENABLE_DBSTAT_VTAB ++ sqlite3DbstatRegister, ++#endif ++ sqlite3TestExtInit, ++#ifdef SQLITE_ENABLE_JSON1 ++ sqlite3Json1Init, ++#endif ++#ifdef SQLITE_ENABLE_STMTVTAB ++ sqlite3StmtVtabInit, + #endif ++#ifdef SQLITE_ENABLE_BYTECODE_VTAB ++ sqlite3VdbeBytecodeVtabInit, ++#endif ++}; + + #ifndef SQLITE_AMALGAMATION + /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant +@@ -159220,7 +160558,10 @@ SQLITE_API int sqlite3_initialize(void){ + ** must be complete. So isInit must not be set until the very end + ** of this routine. + */ +- if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; ++ if( sqlite3GlobalConfig.isInit ){ ++ sqlite3MemoryBarrier(); ++ return SQLITE_OK; ++ } + + /* Make sure the mutex subsystem is initialized. If unable to + ** initialize the mutex subsystem, return early with the error. +@@ -159306,6 +160647,7 @@ SQLITE_API int sqlite3_initialize(void){ + if( rc==SQLITE_OK ){ + sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, + sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage); ++ sqlite3MemoryBarrier(); + sqlite3GlobalConfig.isInit = 1; + #ifdef SQLITE_EXTRA_INIT + bRunExtraInit = 1; +@@ -160607,8 +161949,7 @@ SQLITE_PRIVATE const char *sqlite3ErrStr(int rc){ + */ + static int sqliteDefaultBusyCallback( + void *ptr, /* Database connection */ +- int count, /* Number of times table has been busy */ +- sqlite3_file *pFile /* The file on which the lock occurred */ ++ int count /* Number of times table has been busy */ + ){ + #if SQLITE_OS_WIN || HAVE_USLEEP + /* This case is for systems that have support for sleeping for fractions of +@@ -160622,19 +161963,6 @@ static int sqliteDefaultBusyCallback( + int tmout = db->busyTimeout; + int delay, prior; + +-#ifdef SQLITE_ENABLE_SETLK_TIMEOUT +- if( sqlite3OsFileControl(pFile,SQLITE_FCNTL_LOCK_TIMEOUT,&tmout)==SQLITE_OK ){ +- if( count ){ +- tmout = 0; +- sqlite3OsFileControl(pFile, SQLITE_FCNTL_LOCK_TIMEOUT, &tmout); +- return 0; +- }else{ +- return 1; +- } +- } +-#else +- UNUSED_PARAMETER(pFile); +-#endif + assert( count>=0 ); + if( count < NDELAY ){ + delay = delays[count]; +@@ -160654,7 +161982,6 @@ static int sqliteDefaultBusyCallback( + ** must be done in increments of whole seconds */ + sqlite3 *db = (sqlite3 *)ptr; + int tmout = ((sqlite3 *)ptr)->busyTimeout; +- UNUSED_PARAMETER(pFile); + if( (count+1)*1000 > tmout ){ + return 0; + } +@@ -160672,19 +161999,10 @@ static int sqliteDefaultBusyCallback( + ** If this routine returns non-zero, the lock is retried. If it + ** returns 0, the operation aborts with an SQLITE_BUSY error. + */ +-SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p, sqlite3_file *pFile){ ++SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){ + int rc; + if( p->xBusyHandler==0 || p->nBusy<0 ) return 0; +- if( p->bExtraFileArg ){ +- /* Add an extra parameter with the pFile pointer to the end of the +- ** callback argument list */ +- int (*xTra)(void*,int,sqlite3_file*); +- xTra = (int(*)(void*,int,sqlite3_file*))p->xBusyHandler; +- rc = xTra(p->pBusyArg, p->nBusy, pFile); +- }else{ +- /* Legacy style busy handler callback */ +- rc = p->xBusyHandler(p->pBusyArg, p->nBusy); +- } ++ rc = p->xBusyHandler(p->pBusyArg, p->nBusy); + if( rc==0 ){ + p->nBusy = -1; + }else{ +@@ -160709,7 +162027,6 @@ SQLITE_API int sqlite3_busy_handler( + db->busyHandler.xBusyHandler = xBusy; + db->busyHandler.pBusyArg = pArg; + db->busyHandler.nBusy = 0; +- db->busyHandler.bExtraFileArg = 0; + db->busyTimeout = 0; + sqlite3_mutex_leave(db->mutex); + return SQLITE_OK; +@@ -160760,7 +162077,6 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){ + sqlite3_busy_handler(db, (int(*)(void*,int))sqliteDefaultBusyCallback, + (void*)db); + db->busyTimeout = ms; +- db->busyHandler.bExtraFileArg = 1; + }else{ + sqlite3_busy_handler(db, 0, 0); + } +@@ -160777,7 +162093,7 @@ SQLITE_API void sqlite3_interrupt(sqlite3 *db){ + return; + } + #endif +- db->u1.isInterrupted = 1; ++ AtomicStore(&db->u1.isInterrupted, 1); + } + + +@@ -161399,7 +162715,7 @@ SQLITE_API int sqlite3_wal_checkpoint_v2( + /* If there are no active statements, clear the interrupt flag at this + ** point. */ + if( db->nVdbeActive==0 ){ +- db->u1.isInterrupted = 0; ++ AtomicStore(&db->u1.isInterrupted, 0); + } + + sqlite3_mutex_leave(db->mutex); +@@ -161809,9 +163125,11 @@ SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ + ** + ** If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to + ** the VFS that should be used to open the database file. *pzFile is set to +-** point to a buffer containing the name of the file to open. It is the +-** responsibility of the caller to eventually call sqlite3_free() to release +-** this buffer. ++** point to a buffer containing the name of the file to open. The value ++** stored in *pzFile is a database name acceptable to sqlite3_uri_parameter() ++** and is in the same format as names created using sqlite3_create_filename(). ++** The caller must invoke sqlite3_free_filename() (not sqlite3_free()!) on ++** the value returned in *pzFile to avoid a memory leak. + ** + ** If an error occurs, then an SQLite error code is returned and *pzErrMsg + ** may be set to point to a buffer containing an English language error +@@ -161843,7 +163161,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( + int eState; /* Parser state when parsing URI */ + int iIn; /* Input character index */ + int iOut = 0; /* Output character index */ +- u64 nByte = nUri+2; /* Bytes of space to allocate */ ++ u64 nByte = nUri+8; /* Bytes of space to allocate */ + + /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen + ** method that there may be extra parameters following the file-name. */ +@@ -161853,6 +163171,9 @@ SQLITE_PRIVATE int sqlite3ParseUri( + zFile = sqlite3_malloc64(nByte); + if( !zFile ) return SQLITE_NOMEM_BKPT; + ++ memset(zFile, 0, 4); /* 4-byte of 0x00 is the start of DB name marker */ ++ zFile += 4; ++ + iIn = 5; + #ifdef SQLITE_ALLOW_URI_AUTHORITY + if( strncmp(zUri+5, "///", 3)==0 ){ +@@ -161942,8 +163263,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( + zFile[iOut++] = c; + } + if( eState==1 ) zFile[iOut++] = '\0'; +- zFile[iOut++] = '\0'; +- zFile[iOut++] = '\0'; ++ memset(zFile+iOut, 0, 4); /* end-of-options + empty journal filenames */ + + /* Check if there were any options specified that should be interpreted + ** here. Options that are interpreted here include "vfs" and those that +@@ -162023,13 +163343,14 @@ SQLITE_PRIVATE int sqlite3ParseUri( + } + + }else{ +- zFile = sqlite3_malloc64(nUri+2); ++ zFile = sqlite3_malloc64(nUri+8); + if( !zFile ) return SQLITE_NOMEM_BKPT; ++ memset(zFile, 0, 4); ++ zFile += 4; + if( nUri ){ + memcpy(zFile, zUri, nUri); + } +- zFile[nUri] = '\0'; +- zFile[nUri+1] = '\0'; ++ memset(zFile+nUri, 0, 4); + flags &= ~SQLITE_OPEN_URI; + } + +@@ -162040,7 +163361,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( + } + parse_uri_out: + if( rc!=SQLITE_OK ){ +- sqlite3_free(zFile); ++ sqlite3_free_filename(zFile); + zFile = 0; + } + *pFlags = flags; +@@ -162048,39 +163369,21 @@ SQLITE_PRIVATE int sqlite3ParseUri( + return rc; + } + +-#if defined(SQLITE_HAS_CODEC) + /* +-** Process URI filename query parameters relevant to the SQLite Encryption +-** Extension. Return true if any of the relevant query parameters are +-** seen and return false if not. ++** This routine does the core work of extracting URI parameters from a ++** database filename for the sqlite3_uri_parameter() interface. + */ +-SQLITE_PRIVATE int sqlite3CodecQueryParameters( +- sqlite3 *db, /* Database connection */ +- const char *zDb, /* Which schema is being created/attached */ +- const char *zUri /* URI filename */ +-){ +- const char *zKey; +- if( (zKey = sqlite3_uri_parameter(zUri, "hexkey"))!=0 && zKey[0] ){ +- u8 iByte; +- int i; +- char zDecoded[40]; +- for(i=0, iByte=0; iaCollSeq); +@@ -162268,11 +163575,6 @@ static int openDatabase( + if( db->mallocFailed ){ + goto opendb_out; + } +- /* EVIDENCE-OF: R-08308-17224 The default collating function for all +- ** strings is BINARY. +- */ +- db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, sqlite3StrBINARY, 0); +- assert( db->pDfltColl!=0 ); + + /* Parse the filename/URI argument + ** +@@ -162294,7 +163596,7 @@ static int openDatabase( + testcase( (1<<(flags&7))==0x04 ); /* READWRITE */ + testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */ + if( ((1<<(flags&7)) & 0x46)==0 ){ +- rc = SQLITE_MISUSE_BKPT; /* IMP: R-65497-44594 */ ++ rc = SQLITE_MISUSE_BKPT; /* IMP: R-18321-05872 */ + }else{ + rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg); + } +@@ -162317,7 +163619,9 @@ static int openDatabase( + } + sqlite3BtreeEnter(db->aDb[0].pBt); + db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt); +- if( !db->mallocFailed ) ENC(db) = SCHEMA_ENC(db); ++ if( !db->mallocFailed ){ ++ sqlite3SetTextEncoding(db, SCHEMA_ENC(db)); ++ } + sqlite3BtreeLeave(db->aDb[0].pBt); + db->aDb[1].pSchema = sqlite3SchemaGet(db, 0); + +@@ -162342,14 +163646,11 @@ static int openDatabase( + sqlite3RegisterPerConnectionBuiltinFunctions(db); + rc = sqlite3_errcode(db); + +-#ifdef SQLITE_ENABLE_FTS5 +- /* Register any built-in FTS5 module before loading the automatic +- ** extensions. This allows automatic extensions to register FTS5 +- ** tokenizers and auxiliary functions. */ +- if( !db->mallocFailed && rc==SQLITE_OK ){ +- rc = sqlite3Fts5Init(db); ++ ++ /* Load compiled-in extensions */ ++ for(i=0; rc==SQLITE_OK && imallocFailed ){ +- extern int sqlite3Fts1Init(sqlite3*); +- rc = sqlite3Fts1Init(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_FTS2 +- if( !db->mallocFailed && rc==SQLITE_OK ){ +- extern int sqlite3Fts2Init(sqlite3*); +- rc = sqlite3Fts2Init(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_FTS3 /* automatically defined by SQLITE_ENABLE_FTS4 */ +- if( !db->mallocFailed && rc==SQLITE_OK ){ +- rc = sqlite3Fts3Init(db); +- } +-#endif +- +-#if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS) +- if( !db->mallocFailed && rc==SQLITE_OK ){ +- rc = sqlite3IcuInit(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_RTREE +- if( !db->mallocFailed && rc==SQLITE_OK){ +- rc = sqlite3RtreeInit(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_DBPAGE_VTAB +- if( !db->mallocFailed && rc==SQLITE_OK){ +- rc = sqlite3DbpageRegister(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_DBSTAT_VTAB +- if( !db->mallocFailed && rc==SQLITE_OK){ +- rc = sqlite3DbstatRegister(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_JSON1 +- if( !db->mallocFailed && rc==SQLITE_OK){ +- rc = sqlite3Json1Init(db); +- } +-#endif +- +-#ifdef SQLITE_ENABLE_STMTVTAB +- if( !db->mallocFailed && rc==SQLITE_OK){ +- rc = sqlite3StmtVtabInit(db); +- } +-#endif +- + #ifdef SQLITE_ENABLE_INTERNAL_FUNCTIONS + /* Testing use only!!! The -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time + ** option gives access to internal functions by default. +@@ -162465,10 +163710,7 @@ opendb_out: + sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0); + } + #endif +-#if defined(SQLITE_HAS_CODEC) +- if( rc==SQLITE_OK ) sqlite3CodecQueryParameters(db, 0, zOpen); +-#endif +- sqlite3_free(zOpen); ++ sqlite3_free_filename(zOpen); + return rc & 0xff; + } + +@@ -162695,13 +163937,15 @@ SQLITE_PRIVATE int sqlite3CantopenError(int lineno){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + return sqlite3ReportError(SQLITE_CANTOPEN, lineno, "cannot open file"); + } +-#ifdef SQLITE_DEBUG ++#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_CORRUPT_PGNO) + SQLITE_PRIVATE int sqlite3CorruptPgnoError(int lineno, Pgno pgno){ + char zMsg[100]; + sqlite3_snprintf(sizeof(zMsg), zMsg, "database corruption page %d", pgno); + testcase( sqlite3GlobalConfig.xLog!=0 ); + return sqlite3ReportError(SQLITE_CORRUPT, lineno, zMsg); + } ++#endif ++#ifdef SQLITE_DEBUG + SQLITE_PRIVATE int sqlite3NomemError(int lineno){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + return sqlite3ReportError(SQLITE_NOMEM, lineno, "OOM"); +@@ -162904,6 +164148,13 @@ SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, vo + }else if( op==SQLITE_FCNTL_DATA_VERSION ){ + *(unsigned int*)pArg = sqlite3PagerDataVersion(pPager); + rc = SQLITE_OK; ++ }else if( op==SQLITE_FCNTL_RESERVE_BYTES ){ ++ int iNew = *(int*)pArg; ++ *(int*)pArg = sqlite3BtreeGetRequestedReserve(pBtree); ++ if( iNew>=0 && iNew<=255 ){ ++ sqlite3BtreeSetPageSize(pBtree, 0, iNew, 0); ++ } ++ rc = SQLITE_OK; + }else{ + rc = sqlite3OsFileControl(fd, op, pArg); + } +@@ -163120,20 +164371,6 @@ SQLITE_API int sqlite3_test_control(int op, ...){ + break; + } + +- /* sqlite3_test_control(SQLITE_TESTCTRL_RESERVE, sqlite3 *db, int N) +- ** +- ** Set the nReserve size to N for the main database on the database +- ** connection db. +- */ +- case SQLITE_TESTCTRL_RESERVE: { +- sqlite3 *db = va_arg(ap, sqlite3*); +- int x = va_arg(ap,int); +- sqlite3_mutex_enter(db->mutex); +- sqlite3BtreeSetPageSize(db->aDb[0].pBt, 0, x, 0); +- sqlite3_mutex_leave(db->mutex); +- break; +- } +- + /* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N) + ** + ** Enable or disable various optimizations for testing purposes. The +@@ -163317,6 +164554,68 @@ static const char *databaseName(const char *zName){ + return zName; + } + ++/* ++** Append text z[] to the end of p[]. Return a pointer to the first ++** character after then zero terminator on the new text in p[]. ++*/ ++static char *appendText(char *p, const char *z){ ++ size_t n = strlen(z); ++ memcpy(p, z, n+1); ++ return p+n+1; ++} ++ ++/* ++** Allocate memory to hold names for a database, journal file, WAL file, ++** and query parameters. The pointer returned is valid for use by ++** sqlite3_filename_database() and sqlite3_uri_parameter() and related ++** functions. ++** ++** Memory layout must be compatible with that generated by the pager ++** and expected by sqlite3_uri_parameter() and databaseName(). ++*/ ++SQLITE_API char *sqlite3_create_filename( ++ const char *zDatabase, ++ const char *zJournal, ++ const char *zWal, ++ int nParam, ++ const char **azParam ++){ ++ sqlite3_int64 nByte; ++ int i; ++ char *pResult, *p; ++ nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10; ++ for(i=0; i='0' && z[i]<='9'; i++){ ++ iVal = iVal*10 + (z[i] - '0'); ++ if( iVal>0x7FFFFFFF ) return -1; ++ } ++ *pnOut = (int)iVal; ++ return i; ++} ++ + /* + ** This function interprets the string at (*pp) as a non-negative integer + ** value. It reads the integer and sets *pnOut to the value read, then +@@ -165888,19 +167196,17 @@ static char *fts3WriteExprList(Fts3Table *p, const char *zFunc, int *pRc){ + */ + static int fts3GobbleInt(const char **pp, int *pnOut){ + const int MAX_NPREFIX = 10000000; +- const char *p; /* Iterator pointer */ + int nInt = 0; /* Output value */ +- +- for(p=*pp; p[0]>='0' && p[0]<='9'; p++){ +- nInt = nInt * 10 + (p[0] - '0'); +- if( nInt>MAX_NPREFIX ){ +- nInt = 0; +- break; +- } ++ int nByte; ++ nByte = sqlite3Fts3ReadInt(*pp, &nInt); ++ if( nInt>MAX_NPREFIX ){ ++ nInt = 0; ++ } ++ if( nByte==0 ){ ++ return SQLITE_ERROR; + } +- if( p==*pp ) return SQLITE_ERROR; + *pnOut = nInt; +- *pp = p; ++ *pp += nByte; + return SQLITE_OK; + } + +@@ -166795,6 +168101,7 @@ static int fts3ScanInteriorNode( + i64 nAlloc = 0; /* Size of allocated buffer */ + int isFirstTerm = 1; /* True when processing first term on page */ + sqlite3_int64 iChild; /* Block id of child node to descend to */ ++ int nBuffer = 0; /* Total term size */ + + /* Skip over the 'height' varint that occurs at the start of every + ** interior node. Then load the blockid of the left-child of the b-tree +@@ -166819,12 +168126,15 @@ static int fts3ScanInteriorNode( + int cmp; /* memcmp() result */ + int nSuffix; /* Size of term suffix */ + int nPrefix = 0; /* Size of term prefix */ +- int nBuffer; /* Total term size */ + + /* Load the next term on the node into zBuffer. Use realloc() to expand + ** the size of zBuffer if required. */ + if( !isFirstTerm ){ + zCsr += fts3GetVarint32(zCsr, &nPrefix); ++ if( nPrefix>nBuffer ){ ++ rc = FTS_CORRUPT_VTAB; ++ goto finish_scan; ++ } + } + isFirstTerm = 0; + zCsr += fts3GetVarint32(zCsr, &nSuffix); +@@ -167078,7 +168388,9 @@ static void fts3ReadNextPos( + sqlite3_int64 *pi /* IN/OUT: Value read from position-list */ + ){ + if( (**pp)&0xFE ){ +- fts3GetDeltaVarint(pp, pi); ++ int iVal; ++ *pp += fts3GetVarint32((*pp), &iVal); ++ *pi += iVal; + *pi -= 2; + }else{ + *pi = POSITION_LIST_END; +@@ -167158,6 +168470,9 @@ static int fts3PoslistMerge( + */ + fts3GetDeltaVarint(&p1, &i1); + fts3GetDeltaVarint(&p2, &i2); ++ if( i1<2 || i2<2 ){ ++ break; ++ } + do { + fts3PutDeltaVarint(&p, &iPrev, (i10 ); + assert( *pbEof==0 ); +- assert( p || *piDocid==0 ); ++ assert_fts3_nc( p || *piDocid==0 ); + assert( !p || (p>=aDoclist && p<=&aDoclist[nDoclist]) ); + + if( p==0 ){ +@@ -170061,7 +171376,7 @@ static void fts3EvalInvalidatePoslist(Fts3Phrase *pPhrase){ + ** + ** Parameter nNear is passed the NEAR distance of the expression (5 in + ** the example above). When this function is called, *paPoslist points to +-** the position list, and *pnToken is the number of phrase tokens in, the ++** the position list, and *pnToken is the number of phrase tokens in the + ** phrase on the other side of the NEAR operator to pPhrase. For example, + ** if pPhrase refers to the "def ghi" phrase, then *paPoslist points to + ** the position list associated with phrase "abc". +@@ -170208,6 +171523,7 @@ static void fts3EvalNextRow( + fts3EvalNextRow(pCsr, pLeft, pRc); + } + } ++ pRight->bEof = pLeft->bEof = 1; + } + } + break; +@@ -171978,10 +173294,7 @@ static int getNextNode( + if( pKey->eType==FTSQUERY_NEAR ){ + assert( nKey==4 ); + if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){ +- nNear = 0; +- for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){ +- nNear = nNear * 10 + (zInput[nKey] - '0'); +- } ++ nKey += 1+sqlite3Fts3ReadInt(&zInput[nKey+1], &nNear); + } + } + +@@ -174987,7 +176300,7 @@ static int fts3tokFilterMethod( + if( pCsr->zInput==0 ){ + rc = SQLITE_NOMEM; + }else{ +- memcpy(pCsr->zInput, zByte, nByte); ++ if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte); + pCsr->zInput[nByte] = 0; + rc = pTab->pMod->xOpen(pTab->pTok, pCsr->zInput, nByte, &pCsr->pCsr); + if( rc==SQLITE_OK ){ +@@ -176510,6 +177823,7 @@ static int fts3SegReaderNext( + */ + if( pReader->nDoclist > pReader->nNode-(pReader->aDoclist-pReader->aNode) + || (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) ++ || pReader->nDoclist==0 + ){ + return FTS_CORRUPT_VTAB; + } +@@ -177597,7 +178911,7 @@ static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){ + if( rc!=SQLITE_OK ) return rc; + sqlite3_bind_int64(pStmt, 1, iAbsLevel+1); + sqlite3_bind_int64(pStmt, 2, +- ((iAbsLevel/FTS3_SEGDIR_MAXLEVEL)+1) * FTS3_SEGDIR_MAXLEVEL ++ (((u64)iAbsLevel/FTS3_SEGDIR_MAXLEVEL)+1) * FTS3_SEGDIR_MAXLEVEL + ); + + *pbMax = 0; +@@ -178163,11 +179477,11 @@ static void fts3ReadEndBlockField( + if( zText ){ + int i; + int iMul = 1; +- i64 iVal = 0; ++ u64 iVal = 0; + for(i=0; zText[i]>='0' && zText[i]<='9'; i++){ + iVal = iVal*10 + (zText[i] - '0'); + } +- *piEndBlock = iVal; ++ *piEndBlock = (i64)iVal; + while( zText[i]==' ' ) i++; + iVal = 0; + if( zText[i]=='-' ){ +@@ -178177,7 +179491,7 @@ static void fts3ReadEndBlockField( + for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){ + iVal = iVal*10 + (zText[i] - '0'); + } +- *pnByte = (iVal * (i64)iMul); ++ *pnByte = ((i64)iVal * (i64)iMul); + } + } + +@@ -180048,6 +181362,12 @@ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ + ** Exit early in this case. */ + if( nSeg<=0 ) break; + ++ assert( nMod<=0x7FFFFFFF ); ++ if( iAbsLevel<0 || iAbsLevel>(nMod<<32) ){ ++ rc = FTS_CORRUPT_VTAB; ++ break; ++ } ++ + /* Open a cursor to iterate through the contents of the oldest nSeg + ** indexes of absolute level iAbsLevel. If this cursor is opened using + ** the 'hint' parameters, it is possible that there are less than nSeg +@@ -181749,7 +183069,7 @@ static int fts3ExprLHits( + iStart = pExpr->iPhrase * ((p->nCol + 31) / 32); + } + +- while( 1 ){ ++ if( pIter ) while( 1 ){ + int nHit = fts3ColumnlistCount(&pIter); + if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){ + if( p->flag==FTS3_MATCHINFO_LHITS ){ +@@ -183663,6 +184983,7 @@ static int jsonGrow(JsonString *p, u32 N){ + /* Append N bytes from zIn onto the end of the JsonString string. + */ + static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){ ++ if( N==0 ) return; + if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return; + memcpy(p->zBuf+p->nUsed, zIn, N); + p->nUsed += N; +@@ -189783,8 +191104,10 @@ static int rtreeInit( + }else if( pRtree->nAux>0 ){ + break; + }else{ ++ static const char *azFormat[] = {",%.*s REAL", ",%.*s INT"}; + pRtree->nDim2++; +- sqlite3_str_appendf(pSql, ",%.*s NUM", rtreeTokenLength(zArg), zArg); ++ sqlite3_str_appendf(pSql, azFormat[eCoordType], ++ rtreeTokenLength(zArg), zArg); + } + } + sqlite3_str_appendf(pSql, ");"); +@@ -192520,7 +193843,7 @@ static int icuLikeCompare( + ** 3. uPattern is an unescaped escape character, or + ** 4. uPattern is to be handled as an ordinary character + */ +- if( !prevEscape && uPattern==MATCH_ALL ){ ++ if( uPattern==MATCH_ALL && !prevEscape && uPattern!=(uint32_t)uEsc ){ + /* Case 1. */ + uint8_t c; + +@@ -192546,12 +193869,12 @@ static int icuLikeCompare( + } + return 0; + +- }else if( !prevEscape && uPattern==MATCH_ONE ){ ++ }else if( uPattern==MATCH_ONE && !prevEscape && uPattern!=(uint32_t)uEsc ){ + /* Case 2. */ + if( *zString==0 ) return 0; + SQLITE_ICU_SKIP_UTF8(zString); + +- }else if( !prevEscape && uPattern==(uint32_t)uEsc){ ++ }else if( uPattern==(uint32_t)uEsc && !prevEscape ){ + /* Case 3. */ + prevEscape = 1; + +@@ -199353,6 +200676,7 @@ static int statBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ + i = 0; + if( iSchema>=0 ){ + pIdxInfo->aConstraintUsage[iSchema].argvIndex = ++i; ++ pIdxInfo->aConstraintUsage[iSchema].omit = 1; + pIdxInfo->idxNum |= 0x01; + } + if( iName>=0 ){ +@@ -199567,7 +200891,9 @@ static int statDecodePage(Btree *pBt, StatPage *p){ + if( nPayload>(u32)nLocal ){ + int j; + int nOvfl = ((nPayload - nLocal) + nUsable-4 - 1) / (nUsable - 4); +- if( iOff+nLocal>nUsable ) goto statPageIsCorrupt; ++ if( iOff+nLocal>nUsable || nPayload>0x7fffffff ){ ++ goto statPageIsCorrupt; ++ } + pCell->nLastOvfl = (nPayload-nLocal) - (nOvfl-1) * (nUsable-4); + pCell->nOvfl = nOvfl; + pCell->aOvfl = sqlite3_malloc64(sizeof(u32)*nOvfl); +@@ -203900,7 +205226,7 @@ static int sessionDeleteRow( + SessionBuffer buf = {0, 0, 0}; + int nPk = 0; + +- sessionAppendStr(&buf, "DELETE FROM ", &rc); ++ sessionAppendStr(&buf, "DELETE FROM main.", &rc); + sessionAppendIdent(&buf, zTab, &rc); + sessionAppendStr(&buf, " WHERE ", &rc); + +@@ -203983,7 +205309,7 @@ static int sessionUpdateRow( + SessionBuffer buf = {0, 0, 0}; + + /* Append "UPDATE tbl SET " */ +- sessionAppendStr(&buf, "UPDATE ", &rc); ++ sessionAppendStr(&buf, "UPDATE main.", &rc); + sessionAppendIdent(&buf, zTab, &rc); + sessionAppendStr(&buf, " SET ", &rc); + +@@ -223669,7 +224995,7 @@ static void fts5SourceIdFunc( + ){ + assert( nArg==0 ); + UNUSED_PARAM2(nArg, apUnused); +- sqlite3_result_text(pCtx, "fts5: 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6", -1, SQLITE_TRANSIENT); ++ sqlite3_result_text(pCtx, "fts5: 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd", -1, SQLITE_TRANSIENT); + } + + /* +@@ -227412,6 +228738,7 @@ struct Fts5VocabTable { + sqlite3 *db; /* Database handle */ + Fts5Global *pGlobal; /* FTS5 global object for this database */ + int eType; /* FTS5_VOCAB_COL, ROW or INSTANCE */ ++ unsigned bBusy; /* True if busy */ + }; + + struct Fts5VocabCursor { +@@ -227694,6 +229021,12 @@ static int fts5VocabOpenMethod( + sqlite3_stmt *pStmt = 0; + char *zSql = 0; + ++ if( pTab->bBusy ){ ++ pVTab->zErrMsg = sqlite3_mprintf( ++ "recursive definition for %s.%s", pTab->zFts5Db, pTab->zFts5Tbl ++ ); ++ return SQLITE_ERROR; ++ } + zSql = sqlite3Fts5Mprintf(&rc, + "SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'", + pTab->zFts5Tbl, pTab->zFts5Db, pTab->zFts5Tbl, pTab->zFts5Tbl +@@ -227705,10 +229038,12 @@ static int fts5VocabOpenMethod( + assert( rc==SQLITE_OK || pStmt==0 ); + if( rc==SQLITE_ERROR ) rc = SQLITE_OK; + ++ pTab->bBusy = 1; + if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ + i64 iId = sqlite3_column_int64(pStmt, 0); + pFts5 = sqlite3Fts5TableFromCsrid(pTab->pGlobal, iId); + } ++ pTab->bBusy = 0; + + if( rc==SQLITE_OK ){ + if( pFts5==0 ){ +@@ -228311,7 +229646,8 @@ static int stmtColumn( + sqlite3_result_int(ctx, sqlite3_stmt_busy(pCur->pStmt)); + break; + } +- case STMT_COLUMN_MEM: { ++ default: { ++ assert( i==STMT_COLUMN_MEM ); + i = SQLITE_STMTSTATUS_MEMUSED + + STMT_COLUMN_NSCAN - SQLITE_STMTSTATUS_FULLSCAN_STEP; + /* Fall thru */ +@@ -228442,9 +229778,9 @@ SQLITE_API int sqlite3_stmt_init( + #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ + + /************** End of stmt.c ************************************************/ +-#if __LINE__!=228443 ++#if __LINE__!=229781 + #undef SQLITE_SOURCE_ID +-#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt2" ++#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933calt2" + #endif + /* Return the source-id for this library */ + SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } +diff --git a/third_party/sqlite3/src/sqlite3.h b/third_party/sqlite3/src/sqlite3.h +index 2847b36..f34a7b5 100644 +--- a/third_party/sqlite3/src/sqlite3.h ++++ b/third_party/sqlite3/src/sqlite3.h +@@ -31,40 +31,41 @@ + ** part of the build process. + */ + #ifndef SQLITE3_H +-# define SQLITE3_H +-# include /* Needed for the definition of va_list */ ++#define SQLITE3_H ++#include /* Needed for the definition of va_list */ + + /* + ** Make sure we can call this stuff from C++. + */ +-# ifdef __cplusplus ++#ifdef __cplusplus + extern "C" { +-# endif ++#endif ++ + + /* + ** Provide the ability to override linkage features of the interface. + */ +-# ifndef SQLITE_EXTERN +-# define SQLITE_EXTERN extern +-# endif +-# ifndef SQLITE_API +-# define SQLITE_API +-# endif +-# ifndef SQLITE_CDECL +-# define SQLITE_CDECL +-# endif +-# ifndef SQLITE_APICALL +-# define SQLITE_APICALL +-# endif +-# ifndef SQLITE_STDCALL +-# define SQLITE_STDCALL SQLITE_APICALL +-# endif +-# ifndef SQLITE_CALLBACK +-# define SQLITE_CALLBACK +-# endif +-# ifndef SQLITE_SYSAPI +-# define SQLITE_SYSAPI +-# endif ++#ifndef SQLITE_EXTERN ++# define SQLITE_EXTERN extern ++#endif ++#ifndef SQLITE_API ++# define SQLITE_API ++#endif ++#ifndef SQLITE_CDECL ++# define SQLITE_CDECL ++#endif ++#ifndef SQLITE_APICALL ++# define SQLITE_APICALL ++#endif ++#ifndef SQLITE_STDCALL ++# define SQLITE_STDCALL SQLITE_APICALL ++#endif ++#ifndef SQLITE_CALLBACK ++# define SQLITE_CALLBACK ++#endif ++#ifndef SQLITE_SYSAPI ++# define SQLITE_SYSAPI ++#endif + + /* + ** These no-op macros are used in front of interfaces to mark those +@@ -79,18 +80,18 @@ extern "C" { + ** that we have taken it all out and gone back to using simple + ** noop macros. + */ +-# define SQLITE_DEPRECATED +-# define SQLITE_EXPERIMENTAL ++#define SQLITE_DEPRECATED ++#define SQLITE_EXPERIMENTAL + + /* + ** Ensure these symbols were not defined by some previous header file. + */ +-# ifdef SQLITE_VERSION +-# undef SQLITE_VERSION +-# endif +-# ifdef SQLITE_VERSION_NUMBER +-# undef SQLITE_VERSION_NUMBER +-# endif ++#ifdef SQLITE_VERSION ++# undef SQLITE_VERSION ++#endif ++#ifdef SQLITE_VERSION_NUMBER ++# undef SQLITE_VERSION_NUMBER ++#endif + + /* + ** CAPI3REF: Compile-Time Library Version Numbers +@@ -107,7 +108,7 @@ extern "C" { + ** be held constant and Z will be incremented or else Y will be incremented + ** and Z will be reset to zero. + ** +-** Since [version 3.6.18] ([dateof:3.6.18]), ++** Since [version 3.6.18] ([dateof:3.6.18]), + ** SQLite source code has been stored in the + ** Fossil configuration management + ** system. ^The SQLITE_SOURCE_ID macro evaluates to +@@ -122,11 +123,9 @@ extern "C" { + ** [sqlite3_libversion_number()], [sqlite3_sourceid()], + ** [sqlite_version()] and [sqlite_source_id()]. + */ +-# define SQLITE_VERSION "3.31.1" +-# define SQLITE_VERSION_NUMBER 3031001 +-# define SQLITE_SOURCE_ID \ +- "2020-01-27 19:55:54 " \ +- "3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6" ++#define SQLITE_VERSION "3.32.3" ++#define SQLITE_VERSION_NUMBER 3032003 ++#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" + + /* + ** CAPI3REF: Run-Time Library Version Numbers +@@ -152,8 +151,8 @@ extern "C" { + ** function is provided for use in DLLs since DLL users usually do not have + ** direct access to string constants within the DLL. ^The + ** sqlite3_libversion_number() function returns an integer equal to +-** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns +-** a pointer to a string constant whose value is the same as the ++** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns ++** a pointer to a string constant whose value is the same as the + ** [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built + ** using an edited copy of [the amalgamation], then the last four characters + ** of the hash might be different from [SQLITE_SOURCE_ID].)^ +@@ -161,39 +160,39 @@ extern "C" { + ** See also: [sqlite_version()] and [sqlite_source_id()]. + */ + SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; +-SQLITE_API const char* sqlite3_libversion(void); +-SQLITE_API const char* sqlite3_sourceid(void); ++SQLITE_API const char *sqlite3_libversion(void); ++SQLITE_API const char *sqlite3_sourceid(void); + SQLITE_API int sqlite3_libversion_number(void); + + /* + ** CAPI3REF: Run-Time Library Compilation Options Diagnostics + ** +-** ^The sqlite3_compileoption_used() function returns 0 or 1 +-** indicating whether the specified option was defined at +-** compile time. ^The SQLITE_ prefix may be omitted from the +-** option name passed to sqlite3_compileoption_used(). ++** ^The sqlite3_compileoption_used() function returns 0 or 1 ++** indicating whether the specified option was defined at ++** compile time. ^The SQLITE_ prefix may be omitted from the ++** option name passed to sqlite3_compileoption_used(). + ** + ** ^The sqlite3_compileoption_get() function allows iterating + ** over the list of options that were defined at compile time by + ** returning the N-th compile time option string. ^If N is out of range, +-** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +-** prefix is omitted from any strings returned by ++** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ ++** prefix is omitted from any strings returned by + ** sqlite3_compileoption_get(). + ** + ** ^Support for the diagnostic functions sqlite3_compileoption_used() +-** and sqlite3_compileoption_get() may be omitted by specifying the ++** and sqlite3_compileoption_get() may be omitted by specifying the + ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. + ** + ** See also: SQL functions [sqlite_compileoption_used()] and + ** [sqlite_compileoption_get()] and the [compile_options pragma]. + */ +-# ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS +-SQLITE_API int sqlite3_compileoption_used(const char* zOptName); +-SQLITE_API const char* sqlite3_compileoption_get(int N); +-# else +-# define sqlite3_compileoption_used(X) 0 +-# define sqlite3_compileoption_get(X) ((void*)0) +-# endif ++#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS ++SQLITE_API int sqlite3_compileoption_used(const char *zOptName); ++SQLITE_API const char *sqlite3_compileoption_get(int N); ++#else ++# define sqlite3_compileoption_used(X) 0 ++# define sqlite3_compileoption_get(X) ((void*)0) ++#endif + + /* + ** CAPI3REF: Test To See If The Library Is Threadsafe +@@ -205,7 +204,7 @@ SQLITE_API const char* sqlite3_compileoption_get(int N); + ** SQLite can be compiled with or without mutexes. When + ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes + ** are enabled and SQLite is threadsafe. When the +-** [SQLITE_THREADSAFE] macro is 0, ++** [SQLITE_THREADSAFE] macro is 0, + ** the mutexes are omitted. Without the mutexes, it is not safe + ** to use SQLite concurrently from more than one thread. + ** +@@ -262,23 +261,23 @@ typedef struct sqlite3 sqlite3; + ** + ** ^The sqlite3_int64 and sqlite_int64 types can store integer values + ** between -9223372036854775808 and +9223372036854775807 inclusive. ^The +-** sqlite3_uint64 and sqlite_uint64 types can store integer values ++** sqlite3_uint64 and sqlite_uint64 types can store integer values + ** between 0 and +18446744073709551615 inclusive. + */ +-# ifdef SQLITE_INT64_TYPE +-typedef SQLITE_INT64_TYPE sqlite_int64; +-# ifdef SQLITE_UINT64_TYPE +-typedef SQLITE_UINT64_TYPE sqlite_uint64; +-# else +-typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; +-# endif +-# elif defined(_MSC_VER) || defined(__BORLANDC__) +-typedef __int64 sqlite_int64; +-typedef unsigned __int64 sqlite_uint64; +-# else +-typedef long long int sqlite_int64; +-typedef unsigned long long int sqlite_uint64; +-# endif ++#ifdef SQLITE_INT64_TYPE ++ typedef SQLITE_INT64_TYPE sqlite_int64; ++# ifdef SQLITE_UINT64_TYPE ++ typedef SQLITE_UINT64_TYPE sqlite_uint64; ++# else ++ typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; ++# endif ++#elif defined(_MSC_VER) || defined(__BORLANDC__) ++ typedef __int64 sqlite_int64; ++ typedef unsigned __int64 sqlite_uint64; ++#else ++ typedef long long int sqlite_int64; ++ typedef unsigned long long int sqlite_uint64; ++#endif + typedef sqlite_int64 sqlite3_int64; + typedef sqlite_uint64 sqlite3_uint64; + +@@ -286,9 +285,9 @@ typedef sqlite_uint64 sqlite3_uint64; + ** If compiling for a processor that lacks floating point support, + ** substitute integer for floating-point. + */ +-# ifdef SQLITE_OMIT_FLOATING_POINT +-# define double sqlite3_int64 +-# endif ++#ifdef SQLITE_OMIT_FLOATING_POINT ++# define double sqlite3_int64 ++#endif + + /* + ** CAPI3REF: Closing A Database Connection +@@ -300,26 +299,22 @@ typedef sqlite_uint64 sqlite3_uint64; + ** the [sqlite3] object is successfully destroyed and all associated + ** resources are deallocated. + ** +-** ^If the database connection is associated with unfinalized prepared +-** statements or unfinished sqlite3_backup objects then sqlite3_close() +-** will leave the database connection open and return [SQLITE_BUSY]. +-** ^If sqlite3_close_v2() is called with unfinalized prepared statements +-** and/or unfinished sqlite3_backups, then the database connection becomes +-** an unusable "zombie" which will automatically be deallocated when the +-** last prepared statement is finalized or the last sqlite3_backup is +-** finished. The sqlite3_close_v2() interface is intended for use with +-** host languages that are garbage collected, and where the order in which +-** destructors are called is arbitrary. +-** +-** Applications should [sqlite3_finalize | finalize] all [prepared statements], +-** [sqlite3_blob_close | close] all [BLOB handles], and ++** Ideally, applications should [sqlite3_finalize | finalize] all ++** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and + ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated +-** with the [sqlite3] object prior to attempting to close the object. ^If +-** sqlite3_close_v2() is called on a [database connection] that still has +-** outstanding [prepared statements], [BLOB handles], and/or +-** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation +-** of resources is deferred until all [prepared statements], [BLOB handles], +-** and [sqlite3_backup] objects are also destroyed. ++** with the [sqlite3] object prior to attempting to close the object. ++** ^If the database connection is associated with unfinalized prepared ++** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then ++** sqlite3_close() will leave the database connection open and return ++** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared ++** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups, ++** it returns [SQLITE_OK] regardless, but instead of deallocating the database ++** connection immediately, it marks the database connection as an unusable ++** "zombie" and makes arrangements to automatically deallocate the database ++** connection after all prepared statements are finalized, all BLOB handles ++** are closed, and all backups have finished. The sqlite3_close_v2() interface ++** is intended for use with host languages that are garbage collected, and ++** where the order in which destructors are called is arbitrary. + ** + ** ^If an [sqlite3] object is destroyed while a transaction is open, + ** the transaction is automatically rolled back. +@@ -340,7 +335,7 @@ SQLITE_API int sqlite3_close_v2(sqlite3*); + ** This is legacy and deprecated. It is included for historical + ** compatibility and is not documented. + */ +-typedef int (*sqlite3_callback)(void*, int, char**, char**); ++typedef int (*sqlite3_callback)(void*,int,char**, char**); + + /* + ** CAPI3REF: One-Step Query Execution Interface +@@ -349,7 +344,7 @@ typedef int (*sqlite3_callback)(void*, int, char**, char**); + ** The sqlite3_exec() interface is a convenience wrapper around + ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], + ** that allows an application to run multiple statements of SQL +-** without having to use a lot of C code. ++** without having to use a lot of C code. + ** + ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, + ** semicolon-separate SQL statements passed into its 2nd argument, +@@ -389,7 +384,7 @@ typedef int (*sqlite3_callback)(void*, int, char**, char**); + ** from [sqlite3_column_name()]. + ** + ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +-** to an empty string, or a pointer that contains only whitespace and/or ++** to an empty string, or a pointer that contains only whitespace and/or + ** SQL comments, then no SQL statements are evaluated and the database + ** is not changed. + ** +@@ -404,12 +399,12 @@ typedef int (*sqlite3_callback)(void*, int, char**, char**); + ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. + **
    + */ +-SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ +- const char* sql, /* SQL to be evaluated */ +- int (*callback)(void*, int, char**, +- char**), /* Callback function */ +- void*, /* 1st argument to callback */ +- char** errmsg /* Error msg written here */ ++SQLITE_API int sqlite3_exec( ++ sqlite3*, /* An open database */ ++ const char *sql, /* SQL to be evaluated */ ++ int (*callback)(void*,int,char**,char**), /* Callback function */ ++ void *, /* 1st argument to callback */ ++ char **errmsg /* Error msg written here */ + ); + + /* +@@ -423,38 +418,38 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + ** + ** See also: [extended result code definitions] + */ +-# define SQLITE_OK 0 /* Successful result */ ++#define SQLITE_OK 0 /* Successful result */ + /* beginning-of-error-codes */ +-# define SQLITE_ERROR 1 /* Generic error */ +-# define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ +-# define SQLITE_PERM 3 /* Access permission denied */ +-# define SQLITE_ABORT 4 /* Callback routine requested an abort */ +-# define SQLITE_BUSY 5 /* The database file is locked */ +-# define SQLITE_LOCKED 6 /* A table in the database is locked */ +-# define SQLITE_NOMEM 7 /* A malloc() failed */ +-# define SQLITE_READONLY 8 /* Attempt to write a readonly database */ +-# define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ +-# define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ +-# define SQLITE_CORRUPT 11 /* The database disk image is malformed */ +-# define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */ +-# define SQLITE_FULL 13 /* Insertion failed because database is full */ +-# define SQLITE_CANTOPEN 14 /* Unable to open the database file */ +-# define SQLITE_PROTOCOL 15 /* Database lock protocol error */ +-# define SQLITE_EMPTY 16 /* Internal use only */ +-# define SQLITE_SCHEMA 17 /* The database schema changed */ +-# define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ +-# define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ +-# define SQLITE_MISMATCH 20 /* Data type mismatch */ +-# define SQLITE_MISUSE 21 /* Library used incorrectly */ +-# define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ +-# define SQLITE_AUTH 23 /* Authorization denied */ +-# define SQLITE_FORMAT 24 /* Not used */ +-# 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 */ ++#define SQLITE_ERROR 1 /* Generic error */ ++#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ ++#define SQLITE_PERM 3 /* Access permission denied */ ++#define SQLITE_ABORT 4 /* Callback routine requested an abort */ ++#define SQLITE_BUSY 5 /* The database file is locked */ ++#define SQLITE_LOCKED 6 /* A table in the database is locked */ ++#define SQLITE_NOMEM 7 /* A malloc() failed */ ++#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ ++#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ ++#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ ++#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ ++#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */ ++#define SQLITE_FULL 13 /* Insertion failed because database is full */ ++#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ ++#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ ++#define SQLITE_EMPTY 16 /* Internal use only */ ++#define SQLITE_SCHEMA 17 /* The database schema changed */ ++#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ ++#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ ++#define SQLITE_MISMATCH 20 /* Data type mismatch */ ++#define SQLITE_MISUSE 21 /* Library used incorrectly */ ++#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ ++#define SQLITE_AUTH 23 /* Authorization denied */ ++#define SQLITE_FORMAT 24 /* Not used */ ++#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 */ + + /* +@@ -474,76 +469,79 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + ** the most recent error can be obtained using + ** [sqlite3_extended_errcode()]. + */ +-# define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1 << 8)) +-# define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2 << 8)) +-# define SQLITE_ERROR_SNAPSHOT (SQLITE_ERROR | (3 << 8)) +-# define SQLITE_IOERR_READ (SQLITE_IOERR | (1 << 8)) +-# define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2 << 8)) +-# define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3 << 8)) +-# define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4 << 8)) +-# define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5 << 8)) +-# define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6 << 8)) +-# define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7 << 8)) +-# define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8 << 8)) +-# define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9 << 8)) +-# define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10 << 8)) +-# define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11 << 8)) +-# define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12 << 8)) +-# define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13 << 8)) +-# define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14 << 8)) +-# define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15 << 8)) +-# define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16 << 8)) +-# define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17 << 8)) +-# define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18 << 8)) +-# define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19 << 8)) +-# define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20 << 8)) +-# 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_IOERR_GETTEMPPATH (SQLITE_IOERR | (25 << 8)) +-# define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26 << 8)) +-# define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27 << 8)) +-# define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28 << 8)) +-# define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29 << 8)) +-# define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30 << 8)) +-# define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31 << 8)) +-# define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1 << 8)) +-# define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2 << 8)) +-# define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1 << 8)) +-# define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2 << 8)) +-# define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1 << 8)) +-# define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2 << 8)) +-# define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3 << 8)) +-# define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4 << 8)) +-# define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5 << 8)) /* Not Used */ +-# define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6 << 8)) +-# define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1 << 8)) +-# define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2 << 8)) +-# define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1 << 8)) +-# define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2 << 8)) +-# define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3 << 8)) +-# define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4 << 8)) +-# define SQLITE_READONLY_CANTINIT (SQLITE_READONLY | (5 << 8)) +-# define SQLITE_READONLY_DIRECTORY (SQLITE_READONLY | (6 << 8)) +-# define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2 << 8)) +-# define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1 << 8)) +-# define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2 << 8)) +-# define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3 << 8)) +-# define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4 << 8)) +-# define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5 << 8)) +-# define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6 << 8)) +-# 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_CONSTRAINT_ROWID (SQLITE_CONSTRAINT | (10 << 8)) +-# define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT | (11 << 8)) +-# define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1 << 8)) +-# define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2 << 8)) +-# define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1 << 8)) +-# define SQLITE_AUTH_USER (SQLITE_AUTH | (1 << 8)) +-# define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1 << 8)) +-# define SQLITE_OK_SYMLINK (SQLITE_OK | (2 << 8)) ++#define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1<<8)) ++#define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2<<8)) ++#define SQLITE_ERROR_SNAPSHOT (SQLITE_ERROR | (3<<8)) ++#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8)) ++#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8)) ++#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8)) ++#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8)) ++#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8)) ++#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8)) ++#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8)) ++#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8)) ++#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8)) ++#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8)) ++#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8)) ++#define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8)) ++#define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8)) ++#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8)) ++#define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) ++#define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) ++#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) ++#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) ++#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) ++#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) ++#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_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8)) ++#define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26<<8)) ++#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8)) ++#define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8)) ++#define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8)) ++#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8)) ++#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8)) ++#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8)) ++#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) ++#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8)) ++#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) ++#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8)) ++#define SQLITE_BUSY_TIMEOUT (SQLITE_BUSY | (3<<8)) ++#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) ++#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) ++#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) ++#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) ++#define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */ ++#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8)) ++#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) ++#define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8)) ++#define SQLITE_CORRUPT_INDEX (SQLITE_CORRUPT | (3<<8)) ++#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) ++#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) ++#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8)) ++#define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4<<8)) ++#define SQLITE_READONLY_CANTINIT (SQLITE_READONLY | (5<<8)) ++#define SQLITE_READONLY_DIRECTORY (SQLITE_READONLY | (6<<8)) ++#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8)) ++#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8)) ++#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8)) ++#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8)) ++#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8)) ++#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8)) ++#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8)) ++#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_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8)) ++#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8)) ++#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) ++#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) ++#define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) ++#define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) ++#define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) ++#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) + + /* + ** CAPI3REF: Flags For File Open Operations +@@ -552,27 +550,27 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + ** 3rd parameter to the [sqlite3_open_v2()] interface and + ** in the 4th parameter to the [sqlite3_vfs.xOpen] method. + */ +-# define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ +-# define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ +-# define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ +-# define SQLITE_OPEN_URI 0x00000040 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_MEMORY 0x00000080 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ +-# define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ +-# define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ +-# define SQLITE_OPEN_MAIN_JOURNAL 0x00000800 /* VFS only */ +-# define SQLITE_OPEN_TEMP_JOURNAL 0x00001000 /* VFS only */ +-# define SQLITE_OPEN_SUBJOURNAL 0x00002000 /* VFS only */ +-# define SQLITE_OPEN_MASTER_JOURNAL 0x00004000 /* VFS only */ +-# define SQLITE_OPEN_NOMUTEX 0x00008000 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ +-# define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ +-# define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ ++#define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ ++#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ ++#define SQLITE_OPEN_URI 0x00000040 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_MEMORY 0x00000080 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ ++#define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ ++#define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ ++#define SQLITE_OPEN_MAIN_JOURNAL 0x00000800 /* VFS only */ ++#define SQLITE_OPEN_TEMP_JOURNAL 0x00001000 /* VFS only */ ++#define SQLITE_OPEN_SUBJOURNAL 0x00002000 /* VFS only */ ++#define SQLITE_OPEN_MASTER_JOURNAL 0x00004000 /* VFS only */ ++#define SQLITE_OPEN_NOMUTEX 0x00008000 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ ++#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ ++#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */ + + /* Reserved: 0x00F00000 */ + +@@ -609,21 +607,21 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and + ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. + */ +-# define SQLITE_IOCAP_ATOMIC 0x00000001 +-# define SQLITE_IOCAP_ATOMIC512 0x00000002 +-# define SQLITE_IOCAP_ATOMIC1K 0x00000004 +-# define SQLITE_IOCAP_ATOMIC2K 0x00000008 +-# define SQLITE_IOCAP_ATOMIC4K 0x00000010 +-# define SQLITE_IOCAP_ATOMIC8K 0x00000020 +-# define SQLITE_IOCAP_ATOMIC16K 0x00000040 +-# define SQLITE_IOCAP_ATOMIC32K 0x00000080 +-# define SQLITE_IOCAP_ATOMIC64K 0x00000100 +-# define SQLITE_IOCAP_SAFE_APPEND 0x00000200 +-# define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +-# define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 +-# define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000 +-# define SQLITE_IOCAP_IMMUTABLE 0x00002000 +-# define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000 ++#define SQLITE_IOCAP_ATOMIC 0x00000001 ++#define SQLITE_IOCAP_ATOMIC512 0x00000002 ++#define SQLITE_IOCAP_ATOMIC1K 0x00000004 ++#define SQLITE_IOCAP_ATOMIC2K 0x00000008 ++#define SQLITE_IOCAP_ATOMIC4K 0x00000010 ++#define SQLITE_IOCAP_ATOMIC8K 0x00000020 ++#define SQLITE_IOCAP_ATOMIC16K 0x00000040 ++#define SQLITE_IOCAP_ATOMIC32K 0x00000080 ++#define SQLITE_IOCAP_ATOMIC64K 0x00000100 ++#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 ++#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 ++#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 ++#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000 ++#define SQLITE_IOCAP_IMMUTABLE 0x00002000 ++#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000 + + /* + ** CAPI3REF: File Locking Levels +@@ -632,11 +630,11 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + ** argument to calls it makes to the xLock() and xUnlock() methods + ** of an [sqlite3_io_methods] object. + */ +-# define SQLITE_LOCK_NONE 0 +-# define SQLITE_LOCK_SHARED 1 +-# define SQLITE_LOCK_RESERVED 2 +-# define SQLITE_LOCK_PENDING 3 +-# define SQLITE_LOCK_EXCLUSIVE 4 ++#define SQLITE_LOCK_NONE 0 ++#define SQLITE_LOCK_SHARED 1 ++#define SQLITE_LOCK_RESERVED 2 ++#define SQLITE_LOCK_PENDING 3 ++#define SQLITE_LOCK_EXCLUSIVE 4 + + /* + ** CAPI3REF: Synchronization Type Flags +@@ -664,14 +662,14 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + ** operating systems natively supported by SQLite, only Mac OSX + ** cares about the difference.) + */ +-# define SQLITE_SYNC_NORMAL 0x00002 +-# define SQLITE_SYNC_FULL 0x00003 +-# define SQLITE_SYNC_DATAONLY 0x00010 ++#define SQLITE_SYNC_NORMAL 0x00002 ++#define SQLITE_SYNC_FULL 0x00003 ++#define SQLITE_SYNC_DATAONLY 0x00010 + + /* + ** CAPI3REF: OS Interface Open File Handle + ** +-** An [sqlite3_file] object represents an open file in the ++** An [sqlite3_file] object represents an open file in the + ** [sqlite3_vfs | OS interface layer]. Individual OS interface + ** implementations will + ** want to subclass this object by appending additional fields +@@ -681,7 +679,7 @@ SQLITE_API int sqlite3_exec(sqlite3*, /* An open database */ + */ + typedef struct sqlite3_file sqlite3_file; + struct sqlite3_file { +- const struct sqlite3_io_methods* pMethods; /* Methods for an open file */ ++ const struct sqlite3_io_methods *pMethods; /* Methods for an open file */ + }; + + /* +@@ -693,7 +691,7 @@ struct sqlite3_file { + ** This object defines the methods used to perform various operations + ** against the open file represented by the [sqlite3_file] object. + ** +-** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element ++** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element + ** to a non-NULL pointer, then the sqlite3_io_methods.xClose method + ** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The + ** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] +@@ -786,11 +784,11 @@ struct sqlite3_io_methods { + int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); + int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); + int (*xSync)(sqlite3_file*, int flags); +- int (*xFileSize)(sqlite3_file*, sqlite3_int64* pSize); ++ int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); + int (*xLock)(sqlite3_file*, int); + int (*xUnlock)(sqlite3_file*, int); +- int (*xCheckReservedLock)(sqlite3_file*, int* pResOut); +- int (*xFileControl)(sqlite3_file*, int op, void* pArg); ++ int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); ++ int (*xFileControl)(sqlite3_file*, int op, void *pArg); + int (*xSectorSize)(sqlite3_file*); + int (*xDeviceCharacteristics)(sqlite3_file*); + /* Methods above are valid for version 1 */ +@@ -799,8 +797,8 @@ 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); ++ 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 */ + }; +@@ -843,7 +841,7 @@ struct sqlite3_io_methods { + **
  • [[SQLITE_FCNTL_CHUNK_SIZE]] + ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS + ** extends and truncates the database file in chunks of a size specified +-** by the user. The fourth argument to [sqlite3_file_control()] should ++** by the user. The fourth argument to [sqlite3_file_control()] should + ** point to an integer (type int) containing the new chunk-size to use + ** for the nominated database. Allocating database file space in large + ** chunks (say 1MB at a time), may reduce file-system fragmentation and +@@ -866,24 +864,24 @@ struct sqlite3_io_methods { + **
  • [[SQLITE_FCNTL_SYNC]] + ** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and + ** sent to the VFS immediately before the xSync method is invoked on a +-** database file descriptor. Or, if the xSync method is not invoked +-** because the user has configured SQLite with +-** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place ++** database file descriptor. Or, if the xSync method is not invoked ++** because the user has configured SQLite with ++** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place + ** of the xSync method. In most cases, the pointer argument passed with + ** this file-control is NULL. However, if the database file is being synced + ** as part of a multi-database commit, the argument points to a nul-terminated +-** string containing the transactions master-journal file name. VFSes that +-** do not need this signal should silently ignore this opcode. Applications +-** should not call [sqlite3_file_control()] with this opcode as doing so may +-** disrupt the operation of the specialized VFSes that do require it. ++** string containing the transactions master-journal file name. VFSes that ++** do not need this signal should silently ignore this opcode. Applications ++** should not call [sqlite3_file_control()] with this opcode as doing so may ++** disrupt the operation of the specialized VFSes that do require it. + ** + **
  • [[SQLITE_FCNTL_COMMIT_PHASETWO]] + ** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite + ** and sent to the VFS after a transaction has been committed immediately + ** but before the database is unlocked. VFSes that do not need this signal + ** should silently ignore this opcode. Applications should not call +-** [sqlite3_file_control()] with this opcode as doing so may disrupt the +-** operation of the specialized VFSes that do require it. ++** [sqlite3_file_control()] with this opcode as doing so may disrupt the ++** operation of the specialized VFSes that do require it. + ** + **
  • [[SQLITE_FCNTL_WIN32_AV_RETRY]] + ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +@@ -931,13 +929,13 @@ struct sqlite3_io_methods { + **
  • [[SQLITE_FCNTL_OVERWRITE]] + ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening + ** a write transaction to indicate that, unless it is rolled back for some +-** reason, the entire database file will be overwritten by the current ++** reason, the entire database file will be overwritten by the current + ** transaction. This is used by VACUUM operations. + ** + **
  • [[SQLITE_FCNTL_VFSNAME]] + ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of + ** all [VFSes] in the VFS stack. The names are of all VFS shims and the +-** final bottom-level VFS are written into memory obtained from ++** final bottom-level VFS are written into memory obtained from + ** [sqlite3_malloc()] and the result is stored in the char* variable + ** that the fourth parameter of [sqlite3_file_control()] points to. + ** The caller is responsible for freeing the memory when done. As with +@@ -956,7 +954,7 @@ struct sqlite3_io_methods { + ** upper-most shim only. + ** + **
  • [[SQLITE_FCNTL_PRAGMA]] +-** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] ++** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] + ** file control is sent to the open [sqlite3_file] object corresponding + ** to the database file to which the pragma statement refers. ^The argument + ** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +@@ -967,7 +965,7 @@ struct sqlite3_io_methods { + ** of the char** argument point to a string obtained from [sqlite3_mprintf()] + ** or the equivalent and that string will become the result of the pragma or + ** the error message if the pragma fails. ^If the +-** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal ++** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal + ** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] + ** file control returns [SQLITE_OK], then the parser assumes that the + ** VFS has handled the PRAGMA itself and the parser generates a no-op +@@ -1007,7 +1005,7 @@ struct sqlite3_io_methods { + ** 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 ++** 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]. + ** +@@ -1051,7 +1049,7 @@ struct sqlite3_io_methods { + **
  • [[SQLITE_FCNTL_RBU]] + ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by + ** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +-** this opcode. ++** this opcode. + ** + **
  • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] + ** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +@@ -1068,7 +1066,7 @@ struct sqlite3_io_methods { + ** + **
  • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] + ** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +-** operations since the previous successful call to ++** operations since the previous successful call to + ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. + ** This file control returns [SQLITE_OK] if and only if the writes were + ** all performed successfully and have been committed to persistent storage. +@@ -1080,7 +1078,7 @@ struct sqlite3_io_methods { + ** + **
  • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] + ** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +-** operations since the previous successful call to ++** operations since the previous successful call to + ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. + ** ^This file control takes the file descriptor out of batch write mode + ** so that all subsequent write operations are independent. +@@ -1088,10 +1086,12 @@ struct sqlite3_io_methods { + ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. + ** + **
  • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +-** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain +-** a file lock using the xLock or xShmLock methods of the VFS to wait +-** for up to M milliseconds before failing, where M is the single +-** unsigned integer parameter. ++** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS ++** to block for up to M milliseconds before failing when attempting to ++** obtain a file lock using the xLock or xShmLock methods of the VFS. ++** The parameter is a pointer to a 32-bit signed integer that contains ++** the value that M is to be set to. Before returning, the 32-bit signed ++** integer is overwritten with the previous value of M. + ** + **
  • [[SQLITE_FCNTL_DATA_VERSION]] + ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +@@ -1113,6 +1113,11 @@ struct sqlite3_io_methods { + ** happen either internally or externally and that are associated with + ** a particular attached database. + ** ++**
  • [[SQLITE_FCNTL_CKPT_START]] ++** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint ++** in wal mode before the client starts to copy pages from the wal ++** file to the database file. ++** + **
  • [[SQLITE_FCNTL_CKPT_DONE]] + ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint + ** in wal mode after the client has finished copying pages from the wal +@@ -1120,47 +1125,50 @@ struct sqlite3_io_methods { + ** record the fact that the pages have been checkpointed. + ** + */ +-# define SQLITE_FCNTL_LOCKSTATE 1 +-# define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 +-# define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 +-# define SQLITE_FCNTL_LAST_ERRNO 4 +-# define SQLITE_FCNTL_SIZE_HINT 5 +-# define SQLITE_FCNTL_CHUNK_SIZE 6 +-# define SQLITE_FCNTL_FILE_POINTER 7 +-# define SQLITE_FCNTL_SYNC_OMITTED 8 +-# define SQLITE_FCNTL_WIN32_AV_RETRY 9 +-# define SQLITE_FCNTL_PERSIST_WAL 10 +-# define SQLITE_FCNTL_OVERWRITE 11 +-# define SQLITE_FCNTL_VFSNAME 12 +-# define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 +-# define SQLITE_FCNTL_PRAGMA 14 +-# define SQLITE_FCNTL_BUSYHANDLER 15 +-# define SQLITE_FCNTL_TEMPFILENAME 16 +-# define SQLITE_FCNTL_MMAP_SIZE 18 +-# define SQLITE_FCNTL_TRACE 19 +-# define SQLITE_FCNTL_HAS_MOVED 20 +-# define SQLITE_FCNTL_SYNC 21 +-# define SQLITE_FCNTL_COMMIT_PHASETWO 22 +-# define SQLITE_FCNTL_WIN32_SET_HANDLE 23 +-# define SQLITE_FCNTL_WAL_BLOCK 24 +-# define SQLITE_FCNTL_ZIPVFS 25 +-# define SQLITE_FCNTL_RBU 26 +-# define SQLITE_FCNTL_VFS_POINTER 27 +-# define SQLITE_FCNTL_JOURNAL_POINTER 28 +-# define SQLITE_FCNTL_WIN32_GET_HANDLE 29 +-# define SQLITE_FCNTL_PDB 30 +-# define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31 +-# define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32 +-# define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 +-# define SQLITE_FCNTL_LOCK_TIMEOUT 34 +-# define SQLITE_FCNTL_DATA_VERSION 35 +-# define SQLITE_FCNTL_SIZE_LIMIT 36 +-# define SQLITE_FCNTL_CKPT_DONE 37 ++#define SQLITE_FCNTL_LOCKSTATE 1 ++#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 ++#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 ++#define SQLITE_FCNTL_LAST_ERRNO 4 ++#define SQLITE_FCNTL_SIZE_HINT 5 ++#define SQLITE_FCNTL_CHUNK_SIZE 6 ++#define SQLITE_FCNTL_FILE_POINTER 7 ++#define SQLITE_FCNTL_SYNC_OMITTED 8 ++#define SQLITE_FCNTL_WIN32_AV_RETRY 9 ++#define SQLITE_FCNTL_PERSIST_WAL 10 ++#define SQLITE_FCNTL_OVERWRITE 11 ++#define SQLITE_FCNTL_VFSNAME 12 ++#define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 ++#define SQLITE_FCNTL_PRAGMA 14 ++#define SQLITE_FCNTL_BUSYHANDLER 15 ++#define SQLITE_FCNTL_TEMPFILENAME 16 ++#define SQLITE_FCNTL_MMAP_SIZE 18 ++#define SQLITE_FCNTL_TRACE 19 ++#define SQLITE_FCNTL_HAS_MOVED 20 ++#define SQLITE_FCNTL_SYNC 21 ++#define SQLITE_FCNTL_COMMIT_PHASETWO 22 ++#define SQLITE_FCNTL_WIN32_SET_HANDLE 23 ++#define SQLITE_FCNTL_WAL_BLOCK 24 ++#define SQLITE_FCNTL_ZIPVFS 25 ++#define SQLITE_FCNTL_RBU 26 ++#define SQLITE_FCNTL_VFS_POINTER 27 ++#define SQLITE_FCNTL_JOURNAL_POINTER 28 ++#define SQLITE_FCNTL_WIN32_GET_HANDLE 29 ++#define SQLITE_FCNTL_PDB 30 ++#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31 ++#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32 ++#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 ++#define SQLITE_FCNTL_LOCK_TIMEOUT 34 ++#define SQLITE_FCNTL_DATA_VERSION 35 ++#define SQLITE_FCNTL_SIZE_LIMIT 36 ++#define SQLITE_FCNTL_CKPT_DONE 37 ++#define SQLITE_FCNTL_RESERVE_BYTES 38 ++#define SQLITE_FCNTL_CKPT_START 39 + + /* deprecated names */ +-# define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE +-# define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE +-# define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO ++#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE ++#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE ++#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO ++ + + /* + ** CAPI3REF: Mutex Handle +@@ -1238,14 +1246,14 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; + ** the [sqlite3_file] can safely store a pointer to the + ** filename if it needs to remember the filename for some reason. + ** If the zFilename parameter to xOpen is a NULL pointer then xOpen +-** must invent its own temporary name for the file. ^Whenever the ++** must invent its own temporary name for the file. ^Whenever the + ** xFilename parameter is NULL it will also be the case that the + ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. + ** + ** The flags argument to xOpen() includes all bits set in + ** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] + ** or [sqlite3_open16()] is used, then flags includes at least +-** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. ++** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. + ** If xOpen() opens a file read-only then it sets *pOutFlags to + ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. + ** +@@ -1287,10 +1295,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; + ** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction + ** with the [SQLITE_OPEN_CREATE] flag, which are both directly + ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() +-** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the ++** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the + ** SQLITE_OPEN_CREATE, is used to indicate that file should always + ** be created, and that it is an error if it already exists. +-** It is not used to indicate the file should be opened ++** It is not used to indicate the file should be opened + ** for exclusive access. + ** + ** ^At least szOsFile bytes of memory are allocated by SQLite +@@ -1314,7 +1322,7 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; + ** non-zero error code if there is an I/O error or if the name of + ** the file given in the second argument is illegal. If SQLITE_OK + ** is returned, then non-zero or zero is written into *pResOut to indicate +-** whether or not the file is accessible. ++** whether or not the file is accessible. + ** + ** ^SQLite will always allocate at least mxPathname+1 bytes for the + ** output buffer xFullPathname. The exact size of the output buffer +@@ -1334,16 +1342,16 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; + ** method returns a Julian Day Number for the current date and time as + ** a floating point value. + ** ^The xCurrentTimeInt64() method returns, as an integer, the Julian +-** Day Number multiplied by 86400000 (the number of milliseconds in +-** a 24-hour day). ++** Day Number multiplied by 86400000 (the number of milliseconds in ++** a 24-hour day). + ** ^SQLite will use the xCurrentTimeInt64() method to get the current +-** date and time if that method is available (if iVersion is 2 or ++** date and time if that method is available (if iVersion is 2 or + ** greater and the function pointer is not NULL) and will fall back + ** to xCurrentTime() if xCurrentTimeInt64() is unavailable. + ** + ** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces + ** are not used by the SQLite core. These optional interfaces are provided +-** by some VFSes to facilitate testing of the VFS code. By overriding ++** by some VFSes to facilitate testing of the VFS code. By overriding + ** system calls with functions under its control, a test program can + ** simulate faults and error conditions that would otherwise be difficult + ** or impossible to induce. The set of system calls that can be overridden +@@ -1356,25 +1364,25 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; + typedef struct sqlite3_vfs sqlite3_vfs; + typedef void (*sqlite3_syscall_ptr)(void); + struct sqlite3_vfs { +- int iVersion; /* Structure version number (currently 3) */ +- int szOsFile; /* Size of subclassed sqlite3_file */ +- int mxPathname; /* Maximum file pathname length */ +- sqlite3_vfs* pNext; /* Next registered VFS */ +- const char* zName; /* Name of this virtual file system */ +- void* pAppData; /* Pointer to application-specific data */ +- int (*xOpen)(sqlite3_vfs*, const char* zName, sqlite3_file*, int flags, +- int* pOutFlags); +- int (*xDelete)(sqlite3_vfs*, const char* zName, int syncDir); +- int (*xAccess)(sqlite3_vfs*, const char* zName, int flags, int* pResOut); +- int (*xFullPathname)(sqlite3_vfs*, const char* zName, int nOut, char* zOut); +- void* (*xDlOpen)(sqlite3_vfs*, const char* zFilename); +- void (*xDlError)(sqlite3_vfs*, int nByte, char* zErrMsg); +- void (*(*xDlSym)(sqlite3_vfs*, void*, const char* zSymbol))(void); ++ int iVersion; /* Structure version number (currently 3) */ ++ int szOsFile; /* Size of subclassed sqlite3_file */ ++ int mxPathname; /* Maximum file pathname length */ ++ sqlite3_vfs *pNext; /* Next registered VFS */ ++ const char *zName; /* Name of this virtual file system */ ++ void *pAppData; /* Pointer to application-specific data */ ++ int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, ++ int flags, int *pOutFlags); ++ int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); ++ int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); ++ int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); ++ void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); ++ void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); ++ void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); + void (*xDlClose)(sqlite3_vfs*, void*); +- int (*xRandomness)(sqlite3_vfs*, int nByte, char* zOut); ++ int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); + int (*xSleep)(sqlite3_vfs*, int microseconds); + int (*xCurrentTime)(sqlite3_vfs*, double*); +- int (*xGetLastError)(sqlite3_vfs*, int, char*); ++ int (*xGetLastError)(sqlite3_vfs*, int, char *); + /* + ** The methods above are in version 1 of the sqlite_vfs object + ** definition. Those that follow are added in version 2 or later +@@ -1384,13 +1392,13 @@ struct sqlite3_vfs { + ** The methods above are in versions 1 and 2 of the sqlite_vfs object. + ** Those below are for version 3 and greater. + */ +- int (*xSetSystemCall)(sqlite3_vfs*, const char* zName, sqlite3_syscall_ptr); +- sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char* zName); +- const char* (*xNextSystemCall)(sqlite3_vfs*, const char* zName); ++ int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); ++ sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); ++ const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); + /* + ** The methods above are in versions 1 through 3 of the sqlite_vfs object. + ** New fields may be appended in future versions. The iVersion +- ** value will increment whenever this happens. ++ ** value will increment whenever this happens. + */ + }; + +@@ -1414,9 +1422,9 @@ struct sqlite3_vfs { + ** currently unused, though it might be used in a future release of + ** SQLite. + */ +-# define SQLITE_ACCESS_EXISTS 0 +-# define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ +-# define SQLITE_ACCESS_READ 2 /* Unused */ ++#define SQLITE_ACCESS_EXISTS 0 ++#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ ++#define SQLITE_ACCESS_READ 2 /* Unused */ + + /* + ** CAPI3REF: Flags for the xShmLock VFS method +@@ -1434,16 +1442,16 @@ struct sqlite3_vfs { + ** + ** + ** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as +-** was given on the corresponding lock. ++** was given on the corresponding lock. + ** + ** The xShmLock method can transition between unlocked and SHARED or + ** between unlocked and EXCLUSIVE. It cannot transition between SHARED + ** and EXCLUSIVE. + */ +-# define SQLITE_SHM_UNLOCK 1 +-# define SQLITE_SHM_LOCK 2 +-# define SQLITE_SHM_SHARED 4 +-# define SQLITE_SHM_EXCLUSIVE 8 ++#define SQLITE_SHM_UNLOCK 1 ++#define SQLITE_SHM_LOCK 2 ++#define SQLITE_SHM_SHARED 4 ++#define SQLITE_SHM_EXCLUSIVE 8 + + /* + ** CAPI3REF: Maximum xShmLock index +@@ -1453,7 +1461,8 @@ struct sqlite3_vfs { + ** The SQLite core will never attempt to acquire or release a + ** lock outside of this range + */ +-# define SQLITE_SHM_NLOCK 8 ++#define SQLITE_SHM_NLOCK 8 ++ + + /* + ** CAPI3REF: Initialize The SQLite Library +@@ -1578,7 +1587,7 @@ SQLITE_API int sqlite3_config(int, ...); + ** [database connection] (specified in the first argument). + ** + ** The second argument to sqlite3_db_config(D,V,...) is the +-** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code ++** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code + ** that indicates what aspect of the [database connection] is being configured. + ** Subsequent arguments vary depending on the configuration verb. + ** +@@ -1596,7 +1605,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); + ** This object is used in only one place in the SQLite interface. + ** A pointer to an instance of this object is the argument to + ** [sqlite3_config()] when the configuration option is +-** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. ++** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. + ** By creating an instance of this object + ** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) + ** during configuration, an application can specify an alternative +@@ -1626,7 +1635,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); + ** allocators round up memory allocations at least to the next multiple + ** of 8. Some allocators round up to a larger multiple or to a power of 2. + ** Every memory allocation request coming in through [sqlite3_malloc()] +-** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, ++** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, + ** that causes the corresponding memory allocation to fail. + ** + ** The xInit method initializes the memory allocator. For example, +@@ -1652,14 +1661,14 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); + */ + typedef struct sqlite3_mem_methods sqlite3_mem_methods; + struct sqlite3_mem_methods { +- void* (*xMalloc)(int); /* Memory allocation function */ ++ void *(*xMalloc)(int); /* Memory allocation function */ + void (*xFree)(void*); /* Free a prior allocation */ +- void* (*xRealloc)(void*, int); /* Resize an allocation */ ++ void *(*xRealloc)(void*,int); /* Resize an allocation */ + int (*xSize)(void*); /* Return the size of an allocation */ + int (*xRoundup)(int); /* Round up request size to allocation size */ + int (*xInit)(void*); /* Initialize the memory allocator */ + void (*xShutdown)(void*); /* Deinitialize the memory allocator */ +- void* pAppData; /* Argument to xInit() and xShutdown() */ ++ void *pAppData; /* Argument to xInit() and xShutdown() */ + }; + + /* +@@ -1684,7 +1693,7 @@ struct sqlite3_mem_methods { + ** by a single thread. ^If SQLite is compiled with + ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then + ** it is not possible to change the [threading mode] from its default +-** value of Single-thread and so [sqlite3_config()] will return ++** value of Single-thread and so [sqlite3_config()] will return + ** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD + ** configuration option. + ** +@@ -1719,7 +1728,7 @@ struct sqlite3_mem_methods { + ** SQLITE_CONFIG_SERIALIZED configuration option. + ** + ** [[SQLITE_CONFIG_MALLOC]]
    SQLITE_CONFIG_MALLOC
    +-**
    ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is ++**
    ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is + ** a pointer to an instance of the [sqlite3_mem_methods] structure. + ** The argument specifies + ** alternative low-level memory allocation routines to be used in place of +@@ -1770,7 +1779,7 @@ struct sqlite3_mem_methods { + ** [[SQLITE_CONFIG_PAGECACHE]]
    SQLITE_CONFIG_PAGECACHE
    + **
    ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool + ** that SQLite can use for the database page cache with the default page +-** cache implementation. ++** cache implementation. + ** This configuration option is a no-op if an application-defined page + ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. + ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to +@@ -1798,7 +1807,7 @@ struct sqlite3_mem_methods { + ** additional cache line.
    + ** + ** [[SQLITE_CONFIG_HEAP]]
    SQLITE_CONFIG_HEAP
    +-**
    ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer ++**
    ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer + ** that SQLite will use for all of its dynamic memory allocation needs + ** beyond those provided for by [SQLITE_CONFIG_PAGECACHE]. + ** ^The SQLITE_CONFIG_HEAP option is only available if SQLite is compiled +@@ -1853,7 +1862,7 @@ struct sqlite3_mem_methods { + ** configuration on individual connections.)^
    + ** + ** [[SQLITE_CONFIG_PCACHE2]]
    SQLITE_CONFIG_PCACHE2
    +-**
    ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is ++**
    ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is + ** a pointer to an [sqlite3_pcache_methods2] object. This object specifies + ** the interface to a custom page cache implementation.)^ + ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
    +@@ -1867,7 +1876,7 @@ struct sqlite3_mem_methods { + **
    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*), ++** 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 + ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. +@@ -1976,7 +1985,7 @@ struct sqlite3_mem_methods { + ** [[SQLITE_CONFIG_STMTJRNL_SPILL]] + **
    SQLITE_CONFIG_STMTJRNL_SPILL + **
    ^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which +-** becomes the [statement journal] spill-to-disk threshold. ++** becomes the [statement journal] spill-to-disk threshold. + ** [Statement journals] are held in memory until their size (in bytes) + ** exceeds this threshold, at which point they are written to disk. + ** Or if the threshold is -1, statement journals are always held +@@ -1998,7 +2007,7 @@ struct sqlite3_mem_methods { + ** than the configured sorter-reference size threshold - then a reference + ** is stored in each sorted record and the required column values loaded + ** from the database as records are returned in sorted order. The default +-** value for this option is to never use this optimization. Specifying a ++** value for this option is to never use this optimization. Specifying a + ** negative value for this option restores the default behaviour. + ** This option is only available if SQLite is compiled with the + ** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option. +@@ -2015,35 +2024,35 @@ struct sqlite3_mem_methods { + ** compile-time option is not set, then the default maximum is 1073741824. + ** + */ +-# define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ +-# define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ +-# define SQLITE_CONFIG_SERIALIZED 3 /* nil */ +-# define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ +-# define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ +-# define SQLITE_CONFIG_SCRATCH 6 /* No longer used */ +-# define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ +-# define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ +-# define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ +-# define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ +-# define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ +-/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +-# define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ +-# define SQLITE_CONFIG_PCACHE 14 /* no-op */ +-# define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ +-# define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ +-# define SQLITE_CONFIG_URI 17 /* int */ +-# define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ +-# 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 */ +-# define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ +-# define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ +-# define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ +-# define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */ +-# define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */ +-# define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */ +-# define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */ ++#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ ++#define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ ++#define SQLITE_CONFIG_SERIALIZED 3 /* nil */ ++#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ ++#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ ++#define SQLITE_CONFIG_SCRATCH 6 /* No longer used */ ++#define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ ++#define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ ++#define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ ++#define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ ++#define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ ++/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ ++#define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ ++#define SQLITE_CONFIG_PCACHE 14 /* no-op */ ++#define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ ++#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ ++#define SQLITE_CONFIG_URI 17 /* int */ ++#define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ ++#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 */ ++#define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ ++#define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ ++#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ ++#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */ ++#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */ ++#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */ ++#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */ + + /* + ** CAPI3REF: Database Connection Configuration Options +@@ -2061,7 +2070,7 @@ struct sqlite3_mem_methods { + **
    + ** [[SQLITE_DBCONFIG_LOOKASIDE]] + **
    SQLITE_DBCONFIG_LOOKASIDE
    +-**
    ^This option takes three additional arguments that determine the ++**
    ^This option takes three additional arguments that determine the + ** [lookaside memory allocator] configuration for the [database connection]. + ** ^The first argument (the third parameter to [sqlite3_db_config()] is a + ** pointer to a memory buffer to use for lookaside memory. +@@ -2079,7 +2088,7 @@ struct sqlite3_mem_methods { + ** when the "current value" returned by + ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. + ** Any attempt to change the lookaside memory configuration when lookaside +-** memory is in use leaves the configuration unchanged and returns ++** memory is in use leaves the configuration unchanged and returns + ** [SQLITE_BUSY].)^
    + ** + ** [[SQLITE_DBCONFIG_ENABLE_FKEY]] +@@ -2156,11 +2165,11 @@ struct sqlite3_mem_methods { + ** until after the database connection closes. + **
    + ** +-** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]] ++** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]] + **
    SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
    +-**
    Usually, when a database in wal mode is closed or detached from a +-** database handle, SQLite checks if this will mean that there are now no +-** connections at all to the database. If so, it performs a checkpoint ++**
    Usually, when a database in wal mode is closed or detached from a ++** database handle, SQLite checks if this will mean that there are now no ++** connections at all to the database. If so, it performs a checkpoint + ** operation before closing the connection. This option may be used to + ** override this behaviour. The first parameter passed to this operation + ** is an integer - positive to disable checkpoints-on-close, or zero (the +@@ -2179,7 +2188,7 @@ struct sqlite3_mem_methods { + ** slower. But the QPSG has the advantage of more predictable behavior. With + ** the QPSG active, SQLite will always use the same query plan in the field as + ** was used during testing in the lab. +-** The first argument to this setting is an integer which is 0 to disable ++** The first argument to this setting is an integer which is 0 to disable + ** the QPSG, positive to enable QPSG, or negative to leave the setting + ** unchanged. The second parameter is a pointer to an integer into which + ** is written 0 or 1 to indicate whether the QPSG is disabled or enabled +@@ -2187,15 +2196,15 @@ struct sqlite3_mem_methods { + **
    + ** + ** [[SQLITE_DBCONFIG_TRIGGER_EQP]]
    SQLITE_DBCONFIG_TRIGGER_EQP
    +-**
    By default, the output of EXPLAIN QUERY PLAN commands does not ++**
    By default, the output of EXPLAIN QUERY PLAN commands does not + ** include output for any operations performed by trigger programs. This + ** option is used to set or clear (the default) a flag that governs this + ** behavior. The first parameter passed to this operation is an integer - + ** positive to enable output for trigger programs, or zero to disable it, + ** or negative to leave the setting unchanged. +-** The second parameter is a pointer to an integer into which is written +-** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if +-** it is not disabled, 1 if it is. ++** The second parameter is a pointer to an integer into which is written ++** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if ++** it is not disabled, 1 if it is. + **
    + ** + ** [[SQLITE_DBCONFIG_RESET_DATABASE]]
    SQLITE_DBCONFIG_RESET_DATABASE
    +@@ -2209,7 +2218,7 @@ struct sqlite3_mem_methods { + ** database, or calling sqlite3_table_column_metadata(), ignoring any + ** errors. This step is only necessary if the application desires to keep + ** the database in WAL mode after the reset if it was in WAL mode before +-** the reset. ++** the reset. + **
  • sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0); + **
  • [sqlite3_exec](db, "[VACUUM]", 0, 0, 0); + **
  • sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0); +@@ -2221,7 +2230,7 @@ struct sqlite3_mem_methods { + ** [[SQLITE_DBCONFIG_DEFENSIVE]]
    SQLITE_DBCONFIG_DEFENSIVE
    + **
    The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the + ** "defensive" flag for a database connection. When the defensive +-** flag is enabled, language features that allow ordinary SQL to ++** flag is enabled, language features that allow ordinary SQL to + ** deliberately corrupt the database file are disabled. The disabled + ** features include but are not limited to the following: + **
      +@@ -2236,7 +2245,7 @@ struct sqlite3_mem_methods { + **
      The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the + ** "writable_schema" flag. This has the same effect and is logically equivalent + ** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF]. +-** The first argument to this setting is an integer which is 0 to disable ++** The first argument to this setting is an integer which is 0 to disable + ** the writable_schema, positive to enable writable_schema, or negative to + ** leave the setting unchanged. The second parameter is a pointer to an + ** integer into which is written 0 or 1 to indicate whether the writable_schema +@@ -2281,7 +2290,7 @@ struct sqlite3_mem_methods { + ** including: + **
        + **
      • Prohibit the use of SQL functions inside triggers, views, +-** CHECK constraints, DEFAULT clauses, expression indexes, ++** CHECK constraints, DEFAULT clauses, expression indexes, + ** partial indexes, or generated columns + ** unless those functions are tagged with [SQLITE_INNOCUOUS]. + **
      • Prohibit the use of virtual tables inside of triggers or views +@@ -2302,7 +2311,7 @@ struct sqlite3_mem_methods { + ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, + ** newly created databases are generally not understandable by SQLite versions + ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there +-** is now scarcely any need to generated database files that are compatible ++** is now scarcely any need to generated database files that are compatible + ** all the way back to version 3.0.0, and so this setting is of little + ** practical use, but is provided so that SQLite can continue to claim the + ** ability to generate new database files that are compatible with version +@@ -2315,25 +2324,25 @@ struct sqlite3_mem_methods { + **
      + ** + */ +-# define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ +-# define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */ +-# define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */ +-# define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */ +-# define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */ +-# define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 1005 /* int int* */ +-# define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */ +-# define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */ +-# define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ +-# define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ +-# define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ +-# define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ +-# define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */ +-# define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ +-# define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ +-# define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ +-# define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ +-# define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ +-# define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ ++#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ ++#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */ ++#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */ ++#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */ ++#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */ ++#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 1005 /* int int* */ ++#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */ ++#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */ ++#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ ++#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ ++#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ ++#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ ++#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */ ++#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ ++#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ ++#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ ++#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ ++#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ ++#define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ + + /* + ** CAPI3REF: Enable Or Disable Extended Result Codes +@@ -2360,8 +2369,8 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); + ** ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of + ** the most recent successful [INSERT] into a rowid table or [virtual table] + ** on database connection D. ^Inserts into [WITHOUT ROWID] tables are not +-** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred +-** on the database connection D, then sqlite3_last_insert_rowid(D) returns ++** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred ++** on the database connection D, then sqlite3_last_insert_rowid(D) returns + ** zero. + ** + ** As well as being set automatically as rows are inserted into database +@@ -2371,15 +2380,15 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); + ** Some virtual table implementations may INSERT rows into rowid tables as + ** part of committing a transaction (e.g. to flush data accumulated in memory + ** to disk). In this case subsequent calls to this function return the rowid +-** associated with these internal INSERT operations, which leads to ++** associated with these internal INSERT operations, which leads to + ** unintuitive results. Virtual table implementations that do write to rowid +-** tables in this way can avoid this problem by restoring the original +-** rowid value using [sqlite3_set_last_insert_rowid()] before returning ++** tables in this way can avoid this problem by restoring the original ++** rowid value using [sqlite3_set_last_insert_rowid()] before returning + ** control to the user. + ** +-** ^(If an [INSERT] occurs within a trigger then this routine will +-** return the [rowid] of the inserted row as long as the trigger is +-** running. Once the trigger program ends, the value returned ++** ^(If an [INSERT] occurs within a trigger then this routine will ++** return the [rowid] of the inserted row as long as the trigger is ++** running. Once the trigger program ends, the value returned + ** by this routine reverts to what it was before the trigger was fired.)^ + ** + ** ^An [INSERT] that fails due to a constraint violation is not a +@@ -2412,10 +2421,10 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); + ** METHOD: sqlite3 + ** + ** The sqlite3_set_last_insert_rowid(D, R) method allows the application to +-** set the value returned by calling sqlite3_last_insert_rowid(D) to R ++** set the value returned by calling sqlite3_last_insert_rowid(D) to R + ** without inserting a row into the database. + */ +-SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*, sqlite3_int64); ++SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*,sqlite3_int64); + + /* + ** CAPI3REF: Count The Number Of Rows Modified +@@ -2428,37 +2437,37 @@ SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*, sqlite3_int64); + ** returned by this function. + ** + ** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are +-** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], ++** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], + ** [foreign key actions] or [REPLACE] constraint resolution are not counted. +-** +-** Changes to a view that are intercepted by +-** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value +-** returned by sqlite3_changes() immediately after an INSERT, UPDATE or +-** DELETE statement run on a view is always zero. Only changes made to real ++** ++** Changes to a view that are intercepted by ++** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value ++** returned by sqlite3_changes() immediately after an INSERT, UPDATE or ++** DELETE statement run on a view is always zero. Only changes made to real + ** tables are counted. + ** + ** Things are more complicated if the sqlite3_changes() function is + ** executed while a trigger program is running. This may happen if the + ** program uses the [changes() SQL function], or if some other callback + ** function invokes sqlite3_changes() directly. Essentially: +-** ++** + **
        + **
      • ^(Before entering a trigger program the value returned by +-** sqlite3_changes() function is saved. After the trigger program ++** sqlite3_changes() function is saved. After the trigger program + ** has finished, the original value is restored.)^ +-** +-**
      • ^(Within a trigger program each INSERT, UPDATE and DELETE +-** statement sets the value returned by sqlite3_changes() +-** upon completion as normal. Of course, this value will not include +-** any changes performed by sub-triggers, as the sqlite3_changes() ++** ++**
      • ^(Within a trigger program each INSERT, UPDATE and DELETE ++** statement sets the value returned by sqlite3_changes() ++** upon completion as normal. Of course, this value will not include ++** any changes performed by sub-triggers, as the sqlite3_changes() + ** value will be saved and restored after each sub-trigger has run.)^ + **
      +-** ++** + ** ^This means that if the changes() SQL function (or similar) is used +-** by the first INSERT, UPDATE or DELETE statement within a trigger, it ++** by the first INSERT, UPDATE or DELETE statement within a trigger, it + ** returns the value as set when the calling statement began executing. +-** ^If it is used by the second or subsequent such statement within a trigger +-** program, the value returned reflects the number of rows modified by the ++** ^If it is used by the second or subsequent such statement within a trigger ++** program, the value returned reflects the number of rows modified by the + ** previous INSERT, UPDATE or DELETE statement within the same trigger. + ** + ** If a separate thread makes changes on the same database connection +@@ -2484,10 +2493,10 @@ SQLITE_API int sqlite3_changes(sqlite3*); + ** since the database connection was opened, including those executed as + ** part of trigger programs. ^Executing any other type of SQL statement + ** does not affect the value returned by sqlite3_total_changes(). +-** ++** + ** ^Changes made as part of [foreign key actions] are included in the + ** count, but those made as part of REPLACE constraint resolution are +-** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ++** not. ^Changes to a view that are intercepted by INSTEAD OF triggers + ** are not counted. + ** + ** The [sqlite3_total_changes(D)] interface only reports the number +@@ -2496,7 +2505,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); + ** To detect changes against a database file from other database + ** connections use the [PRAGMA data_version] command or the + ** [SQLITE_FCNTL_DATA_VERSION] [file control]. +-** ++** + ** If a separate thread makes changes on the same database connection + ** while [sqlite3_total_changes()] is running then the value + ** returned is unpredictable and not meaningful. +@@ -2538,7 +2547,7 @@ SQLITE_API int sqlite3_total_changes(sqlite3*); + ** + ** ^The sqlite3_interrupt(D) call is in effect until all currently running + ** SQL statements on [database connection] D complete. ^Any new SQL statements +-** that are started after the sqlite3_interrupt() call and before the ++** that are started after the sqlite3_interrupt() call and before the + ** running statement count reaches zero are interrupted as if they had been + ** running prior to the sqlite3_interrupt() call. ^New SQL statements + ** that are started after the running statement count reaches zero are +@@ -2570,7 +2579,7 @@ SQLITE_API void sqlite3_interrupt(sqlite3*); + ** ^These routines do not parse the SQL statements thus + ** will not detect syntactically incorrect SQL. + ** +-** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ++** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior + ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked + ** automatically by sqlite3_complete16(). If that initialization fails, + ** then the return value from sqlite3_complete16() will be non-zero +@@ -2582,8 +2591,8 @@ SQLITE_API void sqlite3_interrupt(sqlite3*); + ** The input to [sqlite3_complete16()] must be a zero-terminated + ** UTF-16 string in native byte order. + */ +-SQLITE_API int sqlite3_complete(const char* sql); +-SQLITE_API int sqlite3_complete16(const void* sql); ++SQLITE_API int sqlite3_complete(const char *sql); ++SQLITE_API int sqlite3_complete16(const void *sql); + + /* + ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors +@@ -2615,7 +2624,7 @@ SQLITE_API int sqlite3_complete16(const void* sql); + ** The presence of a busy handler does not guarantee that it will be invoked + ** when there is lock contention. ^If SQLite determines that invoking the busy + ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] +-** to the application instead of invoking the ++** to the application instead of invoking the + ** busy handler. + ** Consider a scenario where one process is holding a read lock that + ** it is trying to promote to a reserved lock and +@@ -2640,11 +2649,11 @@ SQLITE_API int sqlite3_complete16(const void* sql); + ** database connection that invoked the busy handler. In other words, + ** the busy handler is not reentrant. Any such actions + ** result in undefined behavior. +-** ++** + ** A busy handler must not close the database connection + ** or [prepared statement] that invoked the busy handler. + */ +-SQLITE_API int sqlite3_busy_handler(sqlite3*, int (*)(void*, int), void*); ++SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); + + /* + ** CAPI3REF: Set A Busy Timeout +@@ -2743,14 +2752,14 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); + ** [sqlite3_errmsg()]. + */ + SQLITE_API int sqlite3_get_table( +- sqlite3* db, /* An open database */ +- const char* zSql, /* SQL to be evaluated */ +- char*** pazResult, /* Results of the query */ +- int* pnRow, /* Number of result rows written here */ +- int* pnColumn, /* Number of result columns written here */ +- char** pzErrmsg /* Error msg written here */ ++ sqlite3 *db, /* An open database */ ++ const char *zSql, /* SQL to be evaluated */ ++ char ***pazResult, /* Results of the query */ ++ int *pnRow, /* Number of result rows written here */ ++ int *pnColumn, /* Number of result columns written here */ ++ char **pzErrmsg /* Error msg written here */ + ); +-SQLITE_API void sqlite3_free_table(char** result); ++SQLITE_API void sqlite3_free_table(char **result); + + /* + ** CAPI3REF: Formatted String Printing Functions +@@ -2758,7 +2767,7 @@ SQLITE_API void sqlite3_free_table(char** result); + ** These routines are work-alikes of the "printf()" family of functions + ** from the standard C library. + ** These routines understand most of the common formatting options from +-** the standard library printf() ++** the standard library printf() + ** plus some additional non-standard formats ([%q], [%Q], [%w], and [%z]). + ** See the [built-in printf()] documentation for details. + ** +@@ -2792,10 +2801,10 @@ SQLITE_API void sqlite3_free_table(char** result); + ** + ** See also: [built-in printf()], [printf() SQL function] + */ +-SQLITE_API char* sqlite3_mprintf(const char*, ...); +-SQLITE_API char* sqlite3_vmprintf(const char*, va_list); +-SQLITE_API char* sqlite3_snprintf(int, char*, const char*, ...); +-SQLITE_API char* sqlite3_vsnprintf(int, char*, const char*, va_list); ++SQLITE_API char *sqlite3_mprintf(const char*,...); ++SQLITE_API char *sqlite3_vmprintf(const char*, va_list); ++SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); ++SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); + + /* + ** CAPI3REF: Memory Allocation Subsystem +@@ -2872,10 +2881,10 @@ SQLITE_API char* sqlite3_vsnprintf(int, char*, const char*, va_list); + ** a block of memory after it has been released using + ** [sqlite3_free()] or [sqlite3_realloc()]. + */ +-SQLITE_API void* sqlite3_malloc(int); +-SQLITE_API void* sqlite3_malloc64(sqlite3_uint64); +-SQLITE_API void* sqlite3_realloc(void*, int); +-SQLITE_API void* sqlite3_realloc64(void*, sqlite3_uint64); ++SQLITE_API void *sqlite3_malloc(int); ++SQLITE_API void *sqlite3_malloc64(sqlite3_uint64); ++SQLITE_API void *sqlite3_realloc(void*, int); ++SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64); + SQLITE_API void sqlite3_free(void*); + SQLITE_API sqlite3_uint64 sqlite3_msize(void*); + +@@ -2926,7 +2935,7 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag); + ** internally and without recourse to the [sqlite3_vfs] xRandomness + ** method. + */ +-SQLITE_API void sqlite3_randomness(int N, void* P); ++SQLITE_API void sqlite3_randomness(int N, void *P); + + /* + ** CAPI3REF: Compile-Time Authorization Callbacks +@@ -2954,7 +2963,7 @@ SQLITE_API void sqlite3_randomness(int N, void* P); + ** requested is ok. ^When the callback returns [SQLITE_DENY], the + ** [sqlite3_prepare_v2()] or equivalent call that triggered the + ** authorizer will fail with an error message explaining that +-** access is denied. ++** access is denied. + ** + ** ^The first parameter to the authorizer callback is a copy of the third + ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter +@@ -3007,7 +3016,7 @@ SQLITE_API void sqlite3_randomness(int N, void* P); + ** database connections for the meaning of "modify" in this paragraph. + ** + ** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the +-** statement might be re-prepared during [sqlite3_step()] due to a ++** statement might be re-prepared during [sqlite3_step()] due to a + ** schema change. Hence, the application should ensure that the + ** correct authorizer callback remains in place during the [sqlite3_step()]. + ** +@@ -3017,11 +3026,11 @@ SQLITE_API void sqlite3_randomness(int N, void* P); + ** as stated in the previous paragraph, sqlite3_step() invokes + ** sqlite3_prepare_v2() to reprepare a statement after a schema change. + */ +-SQLITE_API int sqlite3_set_authorizer(sqlite3*, +- int (*xAuth)(void*, int, const char*, +- const char*, const char*, +- const char*), +- void* pUserData); ++SQLITE_API int sqlite3_set_authorizer( ++ sqlite3*, ++ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), ++ void *pUserData ++); + + /* + ** CAPI3REF: Authorizer Return Codes +@@ -3035,9 +3044,8 @@ SQLITE_API int sqlite3_set_authorizer(sqlite3*, + ** Note that SQLITE_IGNORE is also used as a [conflict resolution mode] + ** returned from the [sqlite3_vtab_on_conflict()] interface. + */ +-# define SQLITE_DENY 1 /* Abort the SQL statement with an error */ +-# define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error \ +- */ ++#define SQLITE_DENY 1 /* Abort the SQL statement with an error */ ++#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */ + + /* + ** CAPI3REF: Authorizer Action Codes +@@ -3059,40 +3067,40 @@ SQLITE_API int sqlite3_set_authorizer(sqlite3*, + ** top-level SQL code. + */ + /******************************************* 3rd ************ 4th ***********/ +-# define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ +-# define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ +-# define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ +-# define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ +-# define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ +-# define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ +-# define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ +-# define SQLITE_CREATE_VIEW 8 /* View Name NULL */ +-# define SQLITE_DELETE 9 /* Table Name NULL */ +-# define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ +-# define SQLITE_DROP_TABLE 11 /* Table Name NULL */ +-# define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ +-# define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ +-# define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ +-# define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ +-# define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ +-# define SQLITE_DROP_VIEW 17 /* View Name NULL */ +-# define SQLITE_INSERT 18 /* Table Name NULL */ +-# define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ +-# define SQLITE_READ 20 /* Table Name Column Name */ +-# define SQLITE_SELECT 21 /* NULL NULL */ +-# define SQLITE_TRANSACTION 22 /* Operation NULL */ +-# define SQLITE_UPDATE 23 /* Table Name Column Name */ +-# define SQLITE_ATTACH 24 /* Filename NULL */ +-# define SQLITE_DETACH 25 /* Database Name NULL */ +-# define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ +-# define SQLITE_REINDEX 27 /* Index Name NULL */ +-# define SQLITE_ANALYZE 28 /* Table Name NULL */ +-# define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */ +-# define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */ +-# define SQLITE_FUNCTION 31 /* NULL Function Name */ +-# define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */ +-# define SQLITE_COPY 0 /* No longer used */ +-# define SQLITE_RECURSIVE 33 /* NULL NULL */ ++#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */ ++#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */ ++#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */ ++#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */ ++#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */ ++#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */ ++#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */ ++#define SQLITE_CREATE_VIEW 8 /* View Name NULL */ ++#define SQLITE_DELETE 9 /* Table Name NULL */ ++#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */ ++#define SQLITE_DROP_TABLE 11 /* Table Name NULL */ ++#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */ ++#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */ ++#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */ ++#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */ ++#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */ ++#define SQLITE_DROP_VIEW 17 /* View Name NULL */ ++#define SQLITE_INSERT 18 /* Table Name NULL */ ++#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ ++#define SQLITE_READ 20 /* Table Name Column Name */ ++#define SQLITE_SELECT 21 /* NULL NULL */ ++#define SQLITE_TRANSACTION 22 /* Operation NULL */ ++#define SQLITE_UPDATE 23 /* Table Name Column Name */ ++#define SQLITE_ATTACH 24 /* Filename NULL */ ++#define SQLITE_DETACH 25 /* Database Name NULL */ ++#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ ++#define SQLITE_REINDEX 27 /* Index Name NULL */ ++#define SQLITE_ANALYZE 28 /* Table Name NULL */ ++#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */ ++#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */ ++#define SQLITE_FUNCTION 31 /* NULL Function Name */ ++#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */ ++#define SQLITE_COPY 0 /* No longer used */ ++#define SQLITE_RECURSIVE 33 /* NULL NULL */ + + /* + ** CAPI3REF: Tracing And Profiling Functions +@@ -3126,10 +3134,10 @@ SQLITE_API int sqlite3_set_authorizer(sqlite3*, + ** either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the + ** profile callback. + */ +-SQLITE_API SQLITE_DEPRECATED void* sqlite3_trace( +- sqlite3*, void (*xTrace)(void*, const char*), void*); +-SQLITE_API SQLITE_DEPRECATED void* sqlite3_profile( +- sqlite3*, void (*xProfile)(void*, const char*, sqlite3_uint64), void*); ++SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*, ++ void(*xTrace)(void*,const char*), void*); ++SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ++ void(*xProfile)(void*,const char*,sqlite3_uint64), void*); + + /* + ** CAPI3REF: SQL Trace Event Codes +@@ -3156,7 +3164,7 @@ SQLITE_API SQLITE_DEPRECATED void* sqlite3_profile( + ** execution of the prepared statement, such as at the start of each + ** trigger subprogram. ^The P argument is a pointer to the + ** [prepared statement]. ^The X argument is a pointer to a string which +-** is the unexpanded SQL text of the prepared statement or an SQL comment ++** is the unexpanded SQL text of the prepared statement or an SQL comment + ** that indicates the invocation of a trigger. ^The callback can compute + ** the same text that would have been returned by the legacy [sqlite3_trace()] + ** interface by using the X argument when X begins with "--" and invoking +@@ -3172,7 +3180,7 @@ SQLITE_API SQLITE_DEPRECATED void* sqlite3_profile( + ** + ** [[SQLITE_TRACE_ROW]]
      SQLITE_TRACE_ROW
      + **
      ^An SQLITE_TRACE_ROW callback is invoked whenever a prepared +-** statement generates a single row of result. ++** statement generates a single row of result. + ** ^The P argument is a pointer to the [prepared statement] and the + ** X argument is unused. + ** +@@ -3183,10 +3191,10 @@ SQLITE_API SQLITE_DEPRECATED void* sqlite3_profile( + ** and the X argument is unused. + ** + */ +-# define SQLITE_TRACE_STMT 0x01 +-# define SQLITE_TRACE_PROFILE 0x02 +-# define SQLITE_TRACE_ROW 0x04 +-# define SQLITE_TRACE_CLOSE 0x08 ++#define SQLITE_TRACE_STMT 0x01 ++#define SQLITE_TRACE_PROFILE 0x02 ++#define SQLITE_TRACE_ROW 0x04 ++#define SQLITE_TRACE_CLOSE 0x08 + + /* + ** CAPI3REF: SQL Trace Hook +@@ -3199,10 +3207,10 @@ SQLITE_API SQLITE_DEPRECATED void* sqlite3_profile( + ** M argument should be the bitwise OR-ed combination of + ** zero or more [SQLITE_TRACE] constants. + ** +-** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides ++** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides + ** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). + ** +-** ^The X callback is invoked whenever any of the events identified by ++** ^The X callback is invoked whenever any of the events identified by + ** mask M occur. ^The integer return value from the callback is currently + ** ignored, though this may change in future releases. Callback + ** implementations should return zero to ensure future compatibility. +@@ -3217,9 +3225,12 @@ SQLITE_API SQLITE_DEPRECATED void* sqlite3_profile( + ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which + ** are deprecated. + */ +-SQLITE_API int sqlite3_trace_v2(sqlite3*, unsigned uMask, +- int (*xCallback)(unsigned, void*, void*, void*), +- void* pCtx); ++SQLITE_API int sqlite3_trace_v2( ++ sqlite3*, ++ unsigned uMask, ++ int(*xCallback)(unsigned,void*,void*,void*), ++ void *pCtx ++); + + /* + ** CAPI3REF: Query Progress Callbacks +@@ -3231,8 +3242,8 @@ SQLITE_API int sqlite3_trace_v2(sqlite3*, unsigned uMask, + ** database connection D. An example use for this + ** interface is to keep a GUI updated during a large query. + ** +-** ^The parameter P is passed through as the only parameter to the +-** callback function X. ^The parameter N is the approximate number of ++** ^The parameter P is passed through as the only parameter to the ++** callback function X. ^The parameter N is the approximate number of + ** [virtual machine instructions] that are evaluated between successive + ** invocations of the callback X. ^If N is less than one then the progress + ** handler is disabled. +@@ -3253,13 +3264,13 @@ SQLITE_API int sqlite3_trace_v2(sqlite3*, unsigned uMask, + ** database connections for the meaning of "modify" in this paragraph. + ** + */ +-SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); ++SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); + + /* + ** CAPI3REF: Opening A New Database Connection + ** CONSTRUCTOR: sqlite3 + ** +-** ^These routines open an SQLite database file as specified by the ++** ^These routines open an SQLite database file as specified by the + ** filename argument. ^The filename argument is interpreted as UTF-8 for + ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte + ** order for sqlite3_open16(). ^(A [database connection] handle is usually +@@ -3378,17 +3389,17 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); + ** information. + ** + ** URI filenames are parsed according to RFC 3986. ^If the URI contains an +-** authority, then it must be either an empty string or the string +-** "localhost". ^If the authority is not an empty string or "localhost", an +-** error is returned to the caller. ^The fragment component of a URI, if ++** authority, then it must be either an empty string or the string ++** "localhost". ^If the authority is not an empty string or "localhost", an ++** error is returned to the caller. ^The fragment component of a URI, if + ** present, is ignored. + ** + ** ^SQLite uses the path component of the URI as the name of the disk file +-** which contains the database. ^If the path begins with a '/' character, +-** then it is interpreted as an absolute path. ^If the path does not begin ++** which contains the database. ^If the path begins with a '/' character, ++** then it is interpreted as an absolute path. ^If the path does not begin + ** with a '/' (meaning that the authority section is omitted from the URI) +-** then the path is interpreted as a relative path. +-** ^(On windows, the first component of an absolute path ++** then the path is interpreted as a relative path. ++** ^(On windows, the first component of an absolute path + ** is a drive specification (e.g. "C:").)^ + ** + ** [[core URI query parameters]] +@@ -3408,13 +3419,13 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); + ** + **
    • mode: ^(The mode parameter may be set to either "ro", "rw", + ** "rwc", or "memory". Attempting to set it to any other value is +-** an error)^. +-** ^If "ro" is specified, then the database is opened for read-only +-** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the +-** third argument to sqlite3_open_v2(). ^If the mode option is set to +-** "rw", then the database is opened for read-write (but not create) +-** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had +-** been set. ^Value "rwc" is equivalent to setting both ++** an error)^. ++** ^If "ro" is specified, then the database is opened for read-only ++** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the ++** third argument to sqlite3_open_v2(). ^If the mode option is set to ++** "rw", then the database is opened for read-write (but not create) ++** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had ++** been set. ^Value "rwc" is equivalent to setting both + ** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is + ** set to "memory" then a pure [in-memory database] that never reads + ** or writes from disk is used. ^It is an error to specify a value for +@@ -3424,7 +3435,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); + **
    • cache: ^The cache parameter may be set to either "shared" or + ** "private". ^Setting it to "shared" is equivalent to setting the + ** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to +-** sqlite3_open_v2(). ^Setting the cache parameter to "private" is ++** sqlite3_open_v2(). ^Setting the cache parameter to "private" is + ** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. + ** ^If sqlite3_open_v2() is used and the "cache" parameter is present in + ** a URI filename, its value overrides any behavior requested by setting +@@ -3450,7 +3461,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); + ** property on a database file that does in fact change can result + ** in incorrect query results and/or [SQLITE_CORRUPT] errors. + ** See also: [SQLITE_IOCAP_IMMUTABLE]. +-** ++** + **
    + ** + ** ^Specifying an unknown parameter in the query component of a URI is not an +@@ -3462,36 +3473,36 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); + ** + ** + **
    URI filenames Results +-**
    file:data.db ++**
    file:data.db + ** Open the file "data.db" in the current directory. + **
    file:/home/fred/data.db
    +-** file:///home/fred/data.db
    +-** file://localhost/home/fred/data.db
    ++** file:///home/fred/data.db
    ++** file://localhost/home/fred/data.db
    + ** Open the database file "/home/fred/data.db". +-**
    file://darkstar/home/fred/data.db ++**
    file://darkstar/home/fred/data.db + ** An error. "darkstar" is not a recognized authority. +-**
    ++**
    + ** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db + ** Windows only: Open the file "data.db" on fred's desktop on drive +-** C:. Note that the %20 escaping in this example is not strictly ++** C:. Note that the %20 escaping in this example is not strictly + ** necessary - space characters can be used literally + ** in URI filenames. +-**
    file:data.db?mode=ro&cache=private ++**
    file:data.db?mode=ro&cache=private + ** Open file "data.db" in the current directory for read-only access. + ** Regardless of whether or not shared-cache mode is enabled by + ** default, use a private cache. + **
    file:/home/fred/data.db?vfs=unix-dotfile + ** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" + ** that uses dot-files in place of posix advisory locking. +-**
    file:data.db?mode=readonly ++**
    file:data.db?mode=readonly + ** An error. "readonly" is not a valid option for the "mode" parameter. + **
    + ** + ** ^URI hexadecimal escape sequences (%HH) are supported within the path and + ** query components of a URI. A hexadecimal escape sequence consists of a +-** percent sign - "%" - followed by exactly two hexadecimal digits ++** percent sign - "%" - followed by exactly two hexadecimal digits + ** specifying an octet value. ^Before the path or query components of a +-** URI filename are interpreted, they are encoded using UTF-8 and all ++** URI filename are interpreted, they are encoded using UTF-8 and all + ** hexadecimal escape sequences replaced by a single byte containing the + ** corresponding octet. If this process generates an invalid UTF-8 encoding, + ** the results are undefined. +@@ -3509,32 +3520,43 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int (*)(void*), void*); + ** See also: [sqlite3_temp_directory] + */ + SQLITE_API int sqlite3_open( +- const char* filename, /* Database filename (UTF-8) */ +- sqlite3** ppDb /* OUT: SQLite db handle */ ++ const char *filename, /* Database filename (UTF-8) */ ++ sqlite3 **ppDb /* OUT: SQLite db handle */ + ); + SQLITE_API int sqlite3_open16( +- const void* filename, /* Database filename (UTF-16) */ +- sqlite3** ppDb /* OUT: SQLite db handle */ ++ const void *filename, /* Database filename (UTF-16) */ ++ sqlite3 **ppDb /* OUT: SQLite db handle */ + ); + SQLITE_API int sqlite3_open_v2( +- const char* filename, /* Database filename (UTF-8) */ +- sqlite3** ppDb, /* OUT: SQLite db handle */ +- int flags, /* Flags */ +- const char* zVfs /* Name of VFS module to use */ ++ const char *filename, /* Database filename (UTF-8) */ ++ sqlite3 **ppDb, /* OUT: SQLite db handle */ ++ int flags, /* Flags */ ++ const char *zVfs /* Name of VFS module to use */ + ); + + /* + ** CAPI3REF: Obtain Values For URI Parameters + ** + ** These are utility routines, useful to [VFS|custom VFS implementations], +-** that check if a database file was a URI that contained a specific query ++** that check if a database file was a URI that contained a specific query + ** parameter, and if so obtains the value of that query parameter. + ** +-** If F is the database filename pointer passed into the xOpen() method of +-** a VFS implementation or it is the return value of [sqlite3_db_filename()] ++** The first parameter to these interfaces (hereafter referred to ++** as F) must be one of: ++**
      ++**
    • A database filename pointer created by the SQLite core and ++** passed into the xOpen() method of a VFS implemention, or ++**
    • A filename obtained from [sqlite3_db_filename()], or ++**
    • A new filename constructed using [sqlite3_create_filename()]. ++**
    ++** If the F parameter is not one of the above, then the behavior is ++** undefined and probably undesirable. Older versions of SQLite were ++** more tolerant of invalid F parameters than newer versions. ++** ++** If F is a suitable filename (as described in the previous paragraph) + ** and if P is the name of the query parameter, then + ** sqlite3_uri_parameter(F,P) returns the value of the P +-** parameter if it exists or a NULL pointer if P does not appear as a ++** parameter if it exists or a NULL pointer if P does not appear as a + ** query parameter on F. If P is a query parameter of F and it + ** has no explicit value, then sqlite3_uri_parameter(F,P) returns + ** a pointer to an empty string. +@@ -3543,7 +3565,7 @@ SQLITE_API int sqlite3_open_v2( + ** parameter and returns true (1) or false (0) according to the value + ** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the + ** value of query parameter P is one of "yes", "true", or "on" in any +-** case or if the value begins with a non-zero number. The ++** case or if the value begins with a non-zero number. The + ** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of + ** query parameter P is one of "no", "false", or "off" in any case or + ** if the value begins with a numeric zero. If P is not a query +@@ -3561,7 +3583,7 @@ SQLITE_API int sqlite3_open_v2( + ** parameters minus 1. The N value is zero-based so N should be 0 to obtain + ** the name of the first query parameter, 1 for the second parameter, and + ** so forth. +-** ++** + ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and + ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and + ** is not a database file pathname pointer that the SQLite core passed +@@ -3578,13 +3600,10 @@ SQLITE_API int sqlite3_open_v2( + ** + ** See the [URI filename] documentation for additional information. + */ +-SQLITE_API const char* sqlite3_uri_parameter(const char* zFilename, +- const char* zParam); +-SQLITE_API int sqlite3_uri_boolean(const char* zFile, const char* zParam, +- int bDefault); +-SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, +- sqlite3_int64); +-SQLITE_API const char* sqlite3_uri_key(const char* zFilename, int N); ++SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam); ++SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); ++SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64); ++SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N); + + /* + ** CAPI3REF: Translate filenames +@@ -3613,20 +3632,93 @@ SQLITE_API const char* sqlite3_uri_key(const char* zFilename, int N); + ** return value from [sqlite3_db_filename()], then the result is + ** undefined and is likely a memory access violation. + */ +-SQLITE_API const char* sqlite3_filename_database(const char*); +-SQLITE_API const char* sqlite3_filename_journal(const char*); +-SQLITE_API const char* sqlite3_filename_wal(const char*); ++SQLITE_API const char *sqlite3_filename_database(const char*); ++SQLITE_API const char *sqlite3_filename_journal(const char*); ++SQLITE_API const char *sqlite3_filename_wal(const char*); ++ ++/* ++** CAPI3REF: Database File Corresponding To A Journal ++** ++** ^If X is the name of a rollback or WAL-mode journal file that is ++** passed into the xOpen method of [sqlite3_vfs], then ++** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file] ++** object that represents the main database file. ++** ++** This routine is intended for use in custom [VFS] implementations ++** only. It is not a general-purpose interface. ++** The argument sqlite3_file_object(X) must be a filename pointer that ++** has been passed into [sqlite3_vfs].xOpen method where the ++** flags parameter to xOpen contains one of the bits ++** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use ++** of this routine results in undefined and probably undesirable ++** behavior. ++*/ ++SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); ++ ++/* ++** CAPI3REF: Create and Destroy VFS Filenames ++** ++** These interfces are provided for use by [VFS shim] implementations and ++** are not useful outside of that context. ++** ++** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of ++** database filename D with corresponding journal file J and WAL file W and ++** with N URI parameters key/values pairs in the array P. The result from ++** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that ++** is safe to pass to routines like: ++**
      ++**
    • [sqlite3_uri_parameter()], ++**
    • [sqlite3_uri_boolean()], ++**
    • [sqlite3_uri_int64()], ++**
    • [sqlite3_uri_key()], ++**
    • [sqlite3_filename_database()], ++**
    • [sqlite3_filename_journal()], or ++**
    • [sqlite3_filename_wal()]. ++**
    ++** If a memory allocation error occurs, sqlite3_create_filename() might ++** return a NULL pointer. The memory obtained from sqlite3_create_filename(X) ++** must be released by a corresponding call to sqlite3_free_filename(Y). ++** ++** The P parameter in sqlite3_create_filename(D,J,W,N,P) should be an array ++** of 2*N pointers to strings. Each pair of pointers in this array corresponds ++** to a key and value for a query parameter. The P parameter may be a NULL ++** pointer if N is zero. None of the 2*N pointers in the P array may be ++** NULL pointers and key pointers should not be empty strings. ++** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may ++** be NULL pointers, though they can be empty strings. ++** ++** The sqlite3_free_filename(Y) routine releases a memory allocation ++** previously obtained from sqlite3_create_filename(). Invoking ++** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op. ++** ++** If the Y parameter to sqlite3_free_filename(Y) is anything other ++** than a NULL pointer or a pointer previously acquired from ++** sqlite3_create_filename(), then bad things such as heap ++** corruption or segfaults may occur. The value Y should be ++** used again after sqlite3_free_filename(Y) has been called. This means ++** that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y, ++** then the corresponding [sqlite3_module.xClose() method should also be ++** invoked prior to calling sqlite3_free_filename(Y). ++*/ ++SQLITE_API char *sqlite3_create_filename( ++ const char *zDatabase, ++ const char *zJournal, ++ const char *zWal, ++ int nParam, ++ const char **azParam ++); ++SQLITE_API void sqlite3_free_filename(char*); + + /* + ** CAPI3REF: Error Codes And Messages + ** METHOD: sqlite3 + ** +-** ^If the most recent sqlite3_* API call associated with ++** ^If the most recent sqlite3_* API call associated with + ** [database connection] D failed, then the sqlite3_errcode(D) interface + ** returns the numeric [result code] or [extended result code] for that + ** API call. + ** ^The sqlite3_extended_errcode() +-** interface is the same except that it always returns the ++** interface is the same except that it always returns the + ** [extended result code] even when extended result codes are + ** disabled. + ** +@@ -3669,11 +3761,11 @@ SQLITE_API const char* sqlite3_filename_wal(const char*); + ** was invoked incorrectly by the application. In that case, the + ** error code and message may or may not be set. + */ +-SQLITE_API int sqlite3_errcode(sqlite3* db); +-SQLITE_API int sqlite3_extended_errcode(sqlite3* db); +-SQLITE_API const char* sqlite3_errmsg(sqlite3*); +-SQLITE_API const void* sqlite3_errmsg16(sqlite3*); +-SQLITE_API const char* sqlite3_errstr(int); ++SQLITE_API int sqlite3_errcode(sqlite3 *db); ++SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); ++SQLITE_API const char *sqlite3_errmsg(sqlite3*); ++SQLITE_API const void *sqlite3_errmsg16(sqlite3*); ++SQLITE_API const char *sqlite3_errstr(int); + + /* + ** CAPI3REF: Prepared Statement Object +@@ -3683,7 +3775,7 @@ SQLITE_API const char* sqlite3_errstr(int); + ** has been compiled into binary form and is ready to be evaluated. + ** + ** Think of each SQL statement as a separate computer program. The +-** original SQL text is source code. A prepared statement object ++** original SQL text is source code. A prepared statement object + ** is the compiled object code. All SQL must be converted into a + ** prepared statement before it can be run. + ** +@@ -3713,7 +3805,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; + ** new limit for that construct.)^ + ** + ** ^If the new limit is a negative number, the limit is unchanged. +-** ^(For each limit category SQLITE_LIMIT_NAME there is a ++** ^(For each limit category SQLITE_LIMIT_NAME there is a + ** [limits | hard upper bound] + ** set at compile-time by a C preprocessor macro called + ** [limits | SQLITE_MAX_NAME]. +@@ -3721,7 +3813,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; + ** ^Attempts to increase a limit above its hard upper bound are + ** silently truncated to the hard upper bound. + ** +-** ^Regardless of whether or not the limit was changed, the ++** ^Regardless of whether or not the limit was changed, the + ** [sqlite3_limit()] interface returns the prior value of the limit. + ** ^Hence, to find the current value of a limit without changing it, + ** simply invoke this interface with the third parameter set to -1. +@@ -3799,18 +3891,18 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** [prepared statement] may start.
    )^ + ** + */ +-# define SQLITE_LIMIT_LENGTH 0 +-# define SQLITE_LIMIT_SQL_LENGTH 1 +-# define SQLITE_LIMIT_COLUMN 2 +-# define SQLITE_LIMIT_EXPR_DEPTH 3 +-# define SQLITE_LIMIT_COMPOUND_SELECT 4 +-# define SQLITE_LIMIT_VDBE_OP 5 +-# define SQLITE_LIMIT_FUNCTION_ARG 6 +-# define SQLITE_LIMIT_ATTACHED 7 +-# define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 +-# define SQLITE_LIMIT_VARIABLE_NUMBER 9 +-# define SQLITE_LIMIT_TRIGGER_DEPTH 10 +-# define SQLITE_LIMIT_WORKER_THREADS 11 ++#define SQLITE_LIMIT_LENGTH 0 ++#define SQLITE_LIMIT_SQL_LENGTH 1 ++#define SQLITE_LIMIT_COLUMN 2 ++#define SQLITE_LIMIT_EXPR_DEPTH 3 ++#define SQLITE_LIMIT_COMPOUND_SELECT 4 ++#define SQLITE_LIMIT_VDBE_OP 5 ++#define SQLITE_LIMIT_FUNCTION_ARG 6 ++#define SQLITE_LIMIT_ATTACHED 7 ++#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 ++#define SQLITE_LIMIT_VARIABLE_NUMBER 9 ++#define SQLITE_LIMIT_TRIGGER_DEPTH 10 ++#define SQLITE_LIMIT_WORKER_THREADS 11 + + /* + ** CAPI3REF: Prepare Flags +@@ -3826,7 +3918,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + **
    The SQLITE_PREPARE_PERSISTENT flag is a hint to the query planner + ** that the prepared statement will be retained for a long time and + ** probably reused many times.)^ ^Without this flag, [sqlite3_prepare_v3()] +-** and [sqlite3_prepare16_v3()] assume that the prepared statement will ++** and [sqlite3_prepare16_v3()] assume that the prepared statement will + ** be used just once or at most a few times and then destroyed using + ** [sqlite3_finalize()] relatively soon. The current implementation acts + ** on this hint by avoiding the use of [lookaside memory] so as not to +@@ -3847,9 +3939,9 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** any virtual tables. + ** + */ +-# define SQLITE_PREPARE_PERSISTENT 0x01 +-# define SQLITE_PREPARE_NORMALIZE 0x02 +-# define SQLITE_PREPARE_NO_VTAB 0x04 ++#define SQLITE_PREPARE_PERSISTENT 0x01 ++#define SQLITE_PREPARE_NORMALIZE 0x02 ++#define SQLITE_PREPARE_NO_VTAB 0x04 + + /* + ** CAPI3REF: Compiling An SQL Statement +@@ -3933,12 +4025,12 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + **
  • + ** + **
  • +-** ^If the specific value bound to a [parameter | host parameter] in the ++** ^If the specific value bound to a [parameter | host parameter] in the + ** WHERE clause might influence the choice of query plan for a statement, +-** then the statement will be automatically recompiled, as if there had been ++** then the statement will be automatically recompiled, as if there had been + ** a schema change, on the first [sqlite3_step()] call following any change +-** to the [sqlite3_bind_text | bindings] of that [parameter]. +-** ^The specific value of a WHERE-clause [parameter] might influence the ++** to the [sqlite3_bind_text | bindings] of that [parameter]. ++** ^The specific value of a WHERE-clause [parameter] might influence the + ** choice of query plan if the parameter is the left-hand side of a [LIKE] + ** or [GLOB] operator or if the parameter is compared to an indexed column + ** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled. +@@ -3952,48 +4044,48 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** sqlite3_prepare_v3() with a zero prepFlags parameter. + */ + SQLITE_API int sqlite3_prepare( +- sqlite3* db, /* Database handle */ +- const char* zSql, /* SQL statement, UTF-8 encoded */ +- int nByte, /* Maximum length of zSql in bytes. */ +- sqlite3_stmt** ppStmt, /* OUT: Statement handle */ +- const char** pzTail /* OUT: Pointer to unused portion of zSql */ ++ sqlite3 *db, /* Database handle */ ++ const char *zSql, /* SQL statement, UTF-8 encoded */ ++ int nByte, /* Maximum length of zSql in bytes. */ ++ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ ++ const char **pzTail /* OUT: Pointer to unused portion of zSql */ + ); + SQLITE_API int sqlite3_prepare_v2( +- sqlite3* db, /* Database handle */ +- const char* zSql, /* SQL statement, UTF-8 encoded */ +- int nByte, /* Maximum length of zSql in bytes. */ +- sqlite3_stmt** ppStmt, /* OUT: Statement handle */ +- const char** pzTail /* OUT: Pointer to unused portion of zSql */ ++ sqlite3 *db, /* Database handle */ ++ const char *zSql, /* SQL statement, UTF-8 encoded */ ++ int nByte, /* Maximum length of zSql in bytes. */ ++ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ ++ const char **pzTail /* OUT: Pointer to unused portion of zSql */ + ); + SQLITE_API int sqlite3_prepare_v3( +- sqlite3* db, /* Database handle */ +- const char* zSql, /* SQL statement, UTF-8 encoded */ +- int nByte, /* Maximum length of zSql in bytes. */ +- unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ +- sqlite3_stmt** ppStmt, /* OUT: Statement handle */ +- const char** pzTail /* OUT: Pointer to unused portion of zSql */ ++ sqlite3 *db, /* Database handle */ ++ const char *zSql, /* SQL statement, UTF-8 encoded */ ++ int nByte, /* Maximum length of zSql in bytes. */ ++ unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ ++ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ ++ const char **pzTail /* OUT: Pointer to unused portion of zSql */ + ); + SQLITE_API int sqlite3_prepare16( +- sqlite3* db, /* Database handle */ +- const void* zSql, /* SQL statement, UTF-16 encoded */ +- int nByte, /* Maximum length of zSql in bytes. */ +- sqlite3_stmt** ppStmt, /* OUT: Statement handle */ +- const void** pzTail /* OUT: Pointer to unused portion of zSql */ ++ sqlite3 *db, /* Database handle */ ++ const void *zSql, /* SQL statement, UTF-16 encoded */ ++ int nByte, /* Maximum length of zSql in bytes. */ ++ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ ++ const void **pzTail /* OUT: Pointer to unused portion of zSql */ + ); + SQLITE_API int sqlite3_prepare16_v2( +- sqlite3* db, /* Database handle */ +- const void* zSql, /* SQL statement, UTF-16 encoded */ +- int nByte, /* Maximum length of zSql in bytes. */ +- sqlite3_stmt** ppStmt, /* OUT: Statement handle */ +- const void** pzTail /* OUT: Pointer to unused portion of zSql */ ++ sqlite3 *db, /* Database handle */ ++ const void *zSql, /* SQL statement, UTF-16 encoded */ ++ int nByte, /* Maximum length of zSql in bytes. */ ++ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ ++ const void **pzTail /* OUT: Pointer to unused portion of zSql */ + ); + SQLITE_API int sqlite3_prepare16_v3( +- sqlite3* db, /* Database handle */ +- const void* zSql, /* SQL statement, UTF-16 encoded */ +- int nByte, /* Maximum length of zSql in bytes. */ +- unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ +- sqlite3_stmt** ppStmt, /* OUT: Statement handle */ +- const void** pzTail /* OUT: Pointer to unused portion of zSql */ ++ sqlite3 *db, /* Database handle */ ++ const void *zSql, /* SQL statement, UTF-16 encoded */ ++ int nByte, /* Maximum length of zSql in bytes. */ ++ unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */ ++ sqlite3_stmt **ppStmt, /* OUT: Statement handle */ ++ const void **pzTail /* OUT: Pointer to unused portion of zSql */ + ); + + /* +@@ -4034,9 +4126,9 @@ SQLITE_API int sqlite3_prepare16_v3( + ** is obtained from [sqlite3_malloc()] and must be free by the application + ** by passing it to [sqlite3_free()]. + */ +-SQLITE_API const char* sqlite3_sql(sqlite3_stmt* pStmt); +-SQLITE_API char* sqlite3_expanded_sql(sqlite3_stmt* pStmt); +-SQLITE_API const char* sqlite3_normalized_sql(sqlite3_stmt* pStmt); ++SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); ++SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ++SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Determine If An SQL Statement Writes The Database +@@ -4047,8 +4139,8 @@ SQLITE_API const char* sqlite3_normalized_sql(sqlite3_stmt* pStmt); + ** the content of the database file. + ** + ** Note that [application-defined SQL functions] or +-** [virtual tables] might change the database indirectly as a side effect. +-** ^(For example, if an application defines a function "eval()" that ++** [virtual tables] might change the database indirectly as a side effect. ++** ^(For example, if an application defines a function "eval()" that + ** calls [sqlite3_exec()], then the following SQL statement would + ** change the database file through side-effects: + ** +@@ -4062,17 +4154,17 @@ SQLITE_API const char* sqlite3_normalized_sql(sqlite3_stmt* pStmt); + ** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], + ** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, + ** since the statements themselves do not actually modify the database but +-** rather they control the timing of when other statements modify the ++** rather they control the timing of when other statements modify the + ** database. ^The [ATTACH] and [DETACH] statements also cause + ** sqlite3_stmt_readonly() to return true since, while those statements +-** change the configuration of a database connection, they do not make ++** change the configuration of a database connection, they do not make + ** changes to the content of the database files on disk. + ** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since + ** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and + ** [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so + ** sqlite3_stmt_readonly() returns false for those commands. + */ +-SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt* pStmt); ++SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement +@@ -4084,25 +4176,25 @@ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt* pStmt); + ** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is + ** an ordinary statement or a NULL pointer. + */ +-SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt* pStmt); ++SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Determine If A Prepared Statement Has Been Reset + ** METHOD: sqlite3_stmt + ** + ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the +-** [prepared statement] S has been stepped at least once using ++** [prepared statement] S has been stepped at least once using + ** [sqlite3_step(S)] but has neither run to completion (returned + ** [SQLITE_DONE] from [sqlite3_step(S)]) nor + ** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) +-** interface returns false if S is a NULL pointer. If S is not a ++** interface returns false if S is a NULL pointer. If S is not a + ** NULL pointer and is not a pointer to a valid [prepared statement] + ** object, then the behavior is undefined and probably undesirable. + ** + ** This interface can be used in combination [sqlite3_next_stmt()] +-** to locate all prepared statements associated with a database ++** to locate all prepared statements associated with a database + ** connection that are in need of being reset. This can be used, +-** for example, in diagnostic routines to search for prepared ++** for example, in diagnostic routines to search for prepared + ** statements that are holding a transaction open. + */ + SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); +@@ -4121,7 +4213,7 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); + ** will accept either a protected or an unprotected sqlite3_value. + ** Every interface that accepts sqlite3_value arguments specifies + ** whether or not it requires a protected sqlite3_value. The +-** [sqlite3_value_dup()] interface can be used to construct a new ++** [sqlite3_value_dup()] interface can be used to construct a new + ** protected sqlite3_value from an unprotected sqlite3_value. + ** + ** The terms "protected" and "unprotected" refer to whether or not +@@ -4129,7 +4221,7 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); + ** sqlite3_value object but no mutex is held for an unprotected + ** sqlite3_value object. If SQLite is compiled to be single-threaded + ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) +-** or if SQLite is run in one of reduced mutex modes ++** or if SQLite is run in one of reduced mutex modes + ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] + ** then there is no distinction between protected and unprotected + ** sqlite3_value objects and they can be used interchangeably. However, +@@ -4198,12 +4290,30 @@ typedef struct sqlite3_context sqlite3_context; + ** [sqlite3_bind_parameter_index()] API if desired. ^The index + ** for "?NNN" parameters is the value of NNN. + ** ^The NNN value must be between 1 and the [sqlite3_limit()] +-** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). ++** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 32766). + ** + ** ^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(). ++** ^If the third parameter to sqlite3_bind_text() is not NULL, then ++** it should be a pointer to well-formed UTF8 text. ++** ^If the third parameter to sqlite3_bind_text16() is not NULL, then ++** it should be a pointer to well-formed UTF16 text. ++** ^If the third parameter to sqlite3_bind_text64() is not NULL, then ++** it should be a pointer to a well-formed unicode string that is ++** either UTF8 if the sixth parameter is SQLITE_UTF8, or UTF16 ++** otherwise. ++** ++** [[byte-order determination rules]] ^The byte-order of ++** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF) ++** found in first character, which is removed, or in the absence of a BOM ++** the byte order is the native byte order of the host ++** machine for sqlite3_bind_text16() or the byte order specified in ++** the 6th parameter for sqlite3_bind_text64().)^ ++** ^If UTF16 input text contains invalid unicode ++** characters, then SQLite might change those invalid characters ++** into the unicode replacement character: U+FFFD. + ** + ** ^(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 +@@ -4217,7 +4327,7 @@ typedef struct sqlite3_context sqlite3_context; + ** or sqlite3_bind_text16() or sqlite3_bind_text64() then + ** that parameter must be the byte offset + ** where the NUL terminator would occur assuming the string were NUL +-** terminated. If any NUL characters occur at byte offsets less than ++** terminated. If any NUL characters occurs at byte offsets less than + ** the value of the fourth parameter then the resulting string value will + ** contain embedded NULs. The result of expressions involving strings + ** with embedded NULs is undefined. +@@ -4281,24 +4391,19 @@ typedef struct sqlite3_context sqlite3_context; + ** See also: [sqlite3_bind_parameter_count()], + ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. + */ +-SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, +- void (*)(void*)); +-SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, +- sqlite3_uint64, void (*)(void*)); ++SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); ++SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, ++ void(*)(void*)); + SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); + SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int); + SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); + SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int); +-SQLITE_API int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int, +- void (*)(void*)); +-SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, +- void (*)(void*)); +-SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, +- sqlite3_uint64, void (*)(void*), +- unsigned char encoding); ++SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); ++SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); ++SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, ++ void(*)(void*), unsigned char encoding); + SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); +-SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*, +- void (*)(void*)); ++SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*)); + SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); + SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); + +@@ -4349,7 +4454,7 @@ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); + ** [sqlite3_bind_parameter_count()], and + ** [sqlite3_bind_parameter_index()]. + */ +-SQLITE_API const char* sqlite3_bind_parameter_name(sqlite3_stmt*, int); ++SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); + + /* + ** CAPI3REF: Index Of A Parameter With A Given Name +@@ -4367,7 +4472,7 @@ SQLITE_API const char* sqlite3_bind_parameter_name(sqlite3_stmt*, int); + ** [sqlite3_bind_parameter_count()], and + ** [sqlite3_bind_parameter_name()]. + */ +-SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char* zName); ++SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); + + /* + ** CAPI3REF: Reset All Bindings On A Prepared Statement +@@ -4384,7 +4489,7 @@ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); + ** METHOD: sqlite3_stmt + ** + ** ^Return the number of columns in the result set returned by the +-** [prepared statement]. ^If this routine returns 0, that means the ++** [prepared statement]. ^If this routine returns 0, that means the + ** [prepared statement] returns no data (for example an [UPDATE]). + ** ^However, just because this routine returns a positive number does not + ** mean that one or more rows of data will be returned. ^A SELECT statement +@@ -4393,7 +4498,7 @@ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); + ** + ** See also: [sqlite3_data_count()] + */ +-SQLITE_API int sqlite3_column_count(sqlite3_stmt* pStmt); ++SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Column Names In A Result Set +@@ -4422,8 +4527,8 @@ SQLITE_API int sqlite3_column_count(sqlite3_stmt* pStmt); + ** then the name of the column is unspecified and may change from + ** one release of SQLite to the next. + */ +-SQLITE_API const char* sqlite3_column_name(sqlite3_stmt*, int N); +-SQLITE_API const void* sqlite3_column_name16(sqlite3_stmt*, int N); ++SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); ++SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); + + /* + ** CAPI3REF: Source Of Data In A Query Result +@@ -4467,12 +4572,12 @@ SQLITE_API const void* sqlite3_column_name16(sqlite3_stmt*, int N); + ** for the same [prepared statement] and result column + ** at the same time then the results are undefined. + */ +-SQLITE_API const char* sqlite3_column_database_name(sqlite3_stmt*, int); +-SQLITE_API const void* sqlite3_column_database_name16(sqlite3_stmt*, int); +-SQLITE_API const char* sqlite3_column_table_name(sqlite3_stmt*, int); +-SQLITE_API const void* sqlite3_column_table_name16(sqlite3_stmt*, int); +-SQLITE_API const char* sqlite3_column_origin_name(sqlite3_stmt*, int); +-SQLITE_API const void* sqlite3_column_origin_name16(sqlite3_stmt*, int); ++SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); ++SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); ++SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); ++SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); ++SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); ++SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); + + /* + ** CAPI3REF: Declared Datatype Of A Query Result +@@ -4504,8 +4609,8 @@ SQLITE_API const void* sqlite3_column_origin_name16(sqlite3_stmt*, int); + ** is associated with individual values, not with the containers + ** used to hold those values. + */ +-SQLITE_API const char* sqlite3_column_decltype(sqlite3_stmt*, int); +-SQLITE_API const void* sqlite3_column_decltype16(sqlite3_stmt*, int); ++SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); ++SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); + + /* + ** CAPI3REF: Evaluate An SQL Statement +@@ -4566,7 +4671,7 @@ SQLITE_API const void* sqlite3_column_decltype16(sqlite3_stmt*, int); + ** For all versions of SQLite up to and including 3.6.23.1, a call to + ** [sqlite3_reset()] was required after sqlite3_step() returned anything + ** other than [SQLITE_ROW] before any subsequent invocation of +-** sqlite3_step(). Failure to reset the prepared statement using ++** sqlite3_step(). Failure to reset the prepared statement using + ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from + ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], + ** sqlite3_step() began +@@ -4610,7 +4715,7 @@ SQLITE_API int sqlite3_step(sqlite3_stmt*); + ** + ** See also: [sqlite3_column_count()] + */ +-SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); ++SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Fundamental Datatypes +@@ -4633,16 +4738,16 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); + ** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not + ** SQLITE_TEXT. + */ +-# define SQLITE_INTEGER 1 +-# define SQLITE_FLOAT 2 +-# define SQLITE_BLOB 4 +-# define SQLITE_NULL 5 +-# ifdef SQLITE_TEXT +-# undef SQLITE_TEXT +-# else +-# define SQLITE_TEXT 3 +-# endif +-# define SQLITE3_TEXT 3 ++#define SQLITE_INTEGER 1 ++#define SQLITE_FLOAT 2 ++#define SQLITE_BLOB 4 ++#define SQLITE_NULL 5 ++#ifdef SQLITE_TEXT ++# undef SQLITE_TEXT ++#else ++# define SQLITE_TEXT 3 ++#endif ++#define SQLITE3_TEXT 3 + + /* + ** CAPI3REF: Result Values From A Query +@@ -4657,7 +4762,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); + ** sqlite3_column_int64→64-bit INTEGER result + ** sqlite3_column_text→UTF-8 TEXT result + ** sqlite3_column_text16→UTF-16 TEXT result +-** sqlite3_column_value→The result as an ++** sqlite3_column_value→The result as an + ** [sqlite3_value|unprotected sqlite3_value] object. + **     + ** sqlite3_column_bytes→Size of a BLOB +@@ -4705,7 +4810,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); + ** The return value of sqlite3_column_type() can be used to decide which + ** of the first six interface should be used to extract the column value. + ** The value returned by sqlite3_column_type() is only meaningful if no +-** automatic type conversions have occurred for the value in question. ++** automatic type conversions have occurred for the value in question. + ** After a type conversion, the result of calling sqlite3_column_type() + ** is undefined, though harmless. Future + ** versions of SQLite may change the behavior of sqlite3_column_type() +@@ -4733,7 +4838,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); + ** the number of bytes in that string. + ** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. + ** +-** ^The values returned by [sqlite3_column_bytes()] and ++** ^The values returned by [sqlite3_column_bytes()] and + ** [sqlite3_column_bytes16()] do not include the zero terminators at the end + ** of the string. ^For clarity: the values returned by + ** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of +@@ -4752,7 +4857,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); + ** to routines like [sqlite3_value_int()], [sqlite3_value_text()], + ** or [sqlite3_value_bytes()], the behavior is not threadsafe. + ** Hence, the sqlite3_column_value() interface +-** is normally only useful within the implementation of ++** is normally only useful within the implementation of + ** [application-defined SQL functions] or [virtual tables], not within + ** top-level application code. + ** +@@ -4853,13 +4958,13 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt* pStmt); + ** return value is obtained and before any + ** other SQLite interface is called on the same [database connection]. + */ +-SQLITE_API const void* sqlite3_column_blob(sqlite3_stmt*, int iCol); ++SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); + SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol); + SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol); + SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol); +-SQLITE_API const unsigned char* sqlite3_column_text(sqlite3_stmt*, int iCol); +-SQLITE_API const void* sqlite3_column_text16(sqlite3_stmt*, int iCol); +-SQLITE_API sqlite3_value* sqlite3_column_value(sqlite3_stmt*, int iCol); ++SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); ++SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); ++SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); + SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); + SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol); + SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); +@@ -4890,7 +4995,7 @@ SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); + ** statement after it has been finalized can result in undefined and + ** undesirable behavior such as segfaults and heap corruption. + */ +-SQLITE_API int sqlite3_finalize(sqlite3_stmt* pStmt); ++SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Reset A Prepared Statement Object +@@ -4917,7 +5022,7 @@ SQLITE_API int sqlite3_finalize(sqlite3_stmt* pStmt); + ** ^The [sqlite3_reset(S)] interface does not change the values + ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. + */ +-SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); ++SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Create Or Redefine SQL Functions +@@ -4927,8 +5032,8 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** ^These functions (collectively known as "function creation routines") + ** are used to add SQL functions or aggregates or to redefine the behavior + ** of existing SQL functions or aggregates. The only differences between +-** the three "sqlite3_create_function*" routines are the text encoding +-** expected for the second parameter (the name of the function being ++** the three "sqlite3_create_function*" routines are the text encoding ++** expected for the second parameter (the name of the function being + ** created) and the presence or absence of a destructor callback for + ** the application data pointer. Function sqlite3_create_window_function() + ** is similar, but allows the user to supply the extra callback functions +@@ -4942,7 +5047,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** ^The second parameter is the name of the SQL function to be created or + ** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 + ** representation, exclusive of the zero-terminator. ^Note that the name +-** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. ++** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. + ** ^Any attempt to create a function with a longer name + ** will result in [SQLITE_MISUSE] being returned. + ** +@@ -4957,7 +5062,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** ^The fourth parameter, eTextRep, specifies what + ** [SQLITE_UTF8 | text encoding] this SQL function prefers for + ** its parameters. The application should set this parameter to +-** [SQLITE_UTF16LE] if the function implementation invokes ++** [SQLITE_UTF16LE] if the function implementation invokes + ** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the + ** implementation invokes [sqlite3_value_text16be()] on an input, or + ** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] +@@ -4984,7 +5089,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** For best security, the [SQLITE_DIRECTONLY] flag is recommended for + ** all application-defined SQL functions that do not need to be + ** used inside of triggers, view, CHECK constraints, or other elements of +-** the database schema. This flags is especially recommended for SQL ++** the database schema. This flags is especially recommended for SQL + ** functions that have side effects or reveal internal application state. + ** Without this flag, an attacker might be able to modify the schema of + ** a database file to include invocations of the function with parameters +@@ -5005,21 +5110,21 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** SQL function or aggregate, pass NULL pointers for all three function + ** callbacks. + ** +-** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue ++** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue + ** and xInverse) passed to sqlite3_create_window_function are pointers to + ** C-language callbacks that implement the new function. xStep and xFinal + ** must both be non-NULL. xValue and xInverse may either both be NULL, in +-** which case a regular aggregate function is created, or must both be ++** which case a regular aggregate function is created, or must both be + ** non-NULL, in which case the new function may be used as either an aggregate + ** or aggregate window function. More details regarding the implementation +-** of aggregate window functions are ++** of aggregate window functions are + ** [user-defined window functions|available here]. + ** + ** ^(If the final parameter to sqlite3_create_function_v2() or + ** sqlite3_create_window_function() is not NULL, then it is destructor for +-** the application data pointer. The destructor is invoked when the function +-** is deleted, either by being overloaded or when the database connection +-** closes.)^ ^The destructor is also invoked if the call to ++** the application data pointer. The destructor is invoked when the function ++** is deleted, either by being overloaded or when the database connection ++** closes.)^ ^The destructor is also invoked if the call to + ** sqlite3_create_function_v2() fails. ^When the destructor callback is + ** invoked, it is passed a single argument which is a copy of the application + ** data pointer which was the fifth parameter to sqlite3_create_function_v2(). +@@ -5032,7 +5137,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** nArg parameter is a better match than a function implementation with + ** a negative nArg. ^A function where the preferred text encoding + ** matches the database encoding is a better +-** match than a function where the encoding is different. ++** match than a function where the encoding is different. + ** ^A function where the encoding difference is between UTF16le and UTF16be + ** is a closer match than a function where the encoding difference is + ** between UTF8 and UTF16. +@@ -5045,26 +5150,48 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt* pStmt); + ** statement in which the function is running. + */ + SQLITE_API int sqlite3_create_function( +- sqlite3* db, const char* zFunctionName, int nArg, int eTextRep, void* pApp, +- void (*xFunc)(sqlite3_context*, int, sqlite3_value**), +- void (*xStep)(sqlite3_context*, int, sqlite3_value**), +- void (*xFinal)(sqlite3_context*)); ++ sqlite3 *db, ++ const char *zFunctionName, ++ int nArg, ++ int eTextRep, ++ void *pApp, ++ void (*xFunc)(sqlite3_context*,int,sqlite3_value**), ++ void (*xStep)(sqlite3_context*,int,sqlite3_value**), ++ void (*xFinal)(sqlite3_context*) ++); + SQLITE_API int sqlite3_create_function16( +- sqlite3* db, const void* zFunctionName, int nArg, int eTextRep, void* pApp, +- void (*xFunc)(sqlite3_context*, int, sqlite3_value**), +- void (*xStep)(sqlite3_context*, int, sqlite3_value**), +- void (*xFinal)(sqlite3_context*)); ++ sqlite3 *db, ++ const void *zFunctionName, ++ int nArg, ++ int eTextRep, ++ void *pApp, ++ void (*xFunc)(sqlite3_context*,int,sqlite3_value**), ++ void (*xStep)(sqlite3_context*,int,sqlite3_value**), ++ void (*xFinal)(sqlite3_context*) ++); + SQLITE_API int sqlite3_create_function_v2( +- sqlite3* db, const char* zFunctionName, int nArg, int eTextRep, void* pApp, +- void (*xFunc)(sqlite3_context*, int, sqlite3_value**), +- void (*xStep)(sqlite3_context*, int, sqlite3_value**), +- void (*xFinal)(sqlite3_context*), void (*xDestroy)(void*)); ++ sqlite3 *db, ++ const char *zFunctionName, ++ int nArg, ++ int eTextRep, ++ void *pApp, ++ void (*xFunc)(sqlite3_context*,int,sqlite3_value**), ++ void (*xStep)(sqlite3_context*,int,sqlite3_value**), ++ void (*xFinal)(sqlite3_context*), ++ void(*xDestroy)(void*) ++); + SQLITE_API int sqlite3_create_window_function( +- sqlite3* db, const char* zFunctionName, int nArg, int eTextRep, void* pApp, +- void (*xStep)(sqlite3_context*, int, sqlite3_value**), +- void (*xFinal)(sqlite3_context*), void (*xValue)(sqlite3_context*), +- void (*xInverse)(sqlite3_context*, int, sqlite3_value**), +- void (*xDestroy)(void*)); ++ sqlite3 *db, ++ const char *zFunctionName, ++ int nArg, ++ int eTextRep, ++ void *pApp, ++ void (*xStep)(sqlite3_context*,int,sqlite3_value**), ++ void (*xFinal)(sqlite3_context*), ++ void (*xValue)(sqlite3_context*), ++ void (*xInverse)(sqlite3_context*,int,sqlite3_value**), ++ void(*xDestroy)(void*) ++); + + /* + ** CAPI3REF: Text Encodings +@@ -5072,17 +5199,17 @@ SQLITE_API int sqlite3_create_window_function( + ** These constant define integer codes that represent the various + ** text encodings supported by SQLite. + */ +-# define SQLITE_UTF8 1 /* IMP: R-37514-35566 */ +-# define SQLITE_UTF16LE 2 /* IMP: R-03371-37637 */ +-# define SQLITE_UTF16BE 3 /* IMP: R-51971-34154 */ +-# define SQLITE_UTF16 4 /* Use native byte order */ +-# define SQLITE_ANY 5 /* Deprecated */ +-# define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */ ++#define SQLITE_UTF8 1 /* IMP: R-37514-35566 */ ++#define SQLITE_UTF16LE 2 /* IMP: R-03371-37637 */ ++#define SQLITE_UTF16BE 3 /* IMP: R-51971-34154 */ ++#define SQLITE_UTF16 4 /* Use native byte order */ ++#define SQLITE_ANY 5 /* Deprecated */ ++#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */ + + /* + ** CAPI3REF: Function Flags + ** +-** These constants may be ORed together with the ++** These constants may be ORed together with the + ** [SQLITE_UTF8 | preferred text encoding] as the fourth argument + ** to [sqlite3_create_function()], [sqlite3_create_function16()], or + ** [sqlite3_create_function_v2()]. +@@ -5098,10 +5225,10 @@ SQLITE_API int sqlite3_create_window_function( + ** SQLite might also optimize deterministic functions by factoring them + ** out of inner loops. + ** +-** ++** + ** [[SQLITE_DIRECTONLY]]
    SQLITE_DIRECTONLY
    + ** The SQLITE_DIRECTONLY flag means that the function may only be invoked +-** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in ++** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in + ** schema structures such as [CHECK constraints], [DEFAULT clauses], + ** [expression indexes], [partial indexes], or [generated columns]. + ** The SQLITE_DIRECTONLY flags is a security feature which is recommended +@@ -5144,31 +5271,30 @@ SQLITE_API int sqlite3_create_window_function( + **
    + ** + */ +-# define SQLITE_DETERMINISTIC 0x000000800 +-# define SQLITE_DIRECTONLY 0x000080000 +-# define SQLITE_SUBTYPE 0x000100000 +-# define SQLITE_INNOCUOUS 0x000200000 ++#define SQLITE_DETERMINISTIC 0x000000800 ++#define SQLITE_DIRECTONLY 0x000080000 ++#define SQLITE_SUBTYPE 0x000100000 ++#define SQLITE_INNOCUOUS 0x000200000 + + /* + ** CAPI3REF: Deprecated Functions + ** DEPRECATED + ** + ** These functions are [deprecated]. In order to maintain +-** backwards compatibility with older code, these functions continue ++** backwards compatibility with older code, these functions continue + ** to be supported. However, new applications should avoid + ** the use of these functions. To encourage programmers to avoid + ** these functions, we will not explain what they do. + */ +-# ifndef SQLITE_OMIT_DEPRECATED ++#ifndef SQLITE_OMIT_DEPRECATED + SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*); + SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); +-SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, +- sqlite3_stmt*); ++SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); + SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void); + SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); +-SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( +- void (*)(void*, sqlite3_int64, int), void*, sqlite3_int64); +-# endif ++SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), ++ void*,sqlite3_int64); ++#endif + + /* + ** CAPI3REF: Obtaining SQL Values +@@ -5223,11 +5349,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( + ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces + ** extract UTF-16 strings as big-endian and little-endian respectively. + ** +-** ^If [sqlite3_value] object V was initialized ++** ^If [sqlite3_value] object V was initialized + ** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)] + ** and if X and Y are strings that compare equal according to strcmp(X,Y), + ** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise, +-** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer() ++** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer() + ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. + ** + ** ^(The sqlite3_value_type(V) interface returns the +@@ -5298,15 +5424,15 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( + ** return value is obtained and before any + ** other SQLite interface is called on the same [database connection]. + */ +-SQLITE_API const void* sqlite3_value_blob(sqlite3_value*); ++SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); + SQLITE_API double sqlite3_value_double(sqlite3_value*); + SQLITE_API int sqlite3_value_int(sqlite3_value*); + SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*); +-SQLITE_API void* sqlite3_value_pointer(sqlite3_value*, const char*); +-SQLITE_API const unsigned char* sqlite3_value_text(sqlite3_value*); +-SQLITE_API const void* sqlite3_value_text16(sqlite3_value*); +-SQLITE_API const void* sqlite3_value_text16le(sqlite3_value*); +-SQLITE_API const void* sqlite3_value_text16be(sqlite3_value*); ++SQLITE_API void *sqlite3_value_pointer(sqlite3_value*, const char*); ++SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*); ++SQLITE_API const void *sqlite3_value_text16(sqlite3_value*); ++SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*); ++SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*); + SQLITE_API int sqlite3_value_bytes(sqlite3_value*); + SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); + SQLITE_API int sqlite3_value_type(sqlite3_value*); +@@ -5340,7 +5466,7 @@ SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); + ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer + ** then sqlite3_value_free(V) is a harmless no-op. + */ +-SQLITE_API sqlite3_value* sqlite3_value_dup(const sqlite3_value*); ++SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*); + SQLITE_API void sqlite3_value_free(sqlite3_value*); + + /* +@@ -5350,7 +5476,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); + ** Implementations of aggregate SQL functions use this + ** routine to allocate memory for storing their state. + ** +-** ^The first time the sqlite3_aggregate_context(C,N) routine is called ++** ^The first time the sqlite3_aggregate_context(C,N) routine is called + ** for a particular aggregate function, SQLite allocates + ** N bytes of memory, zeroes out that memory, and returns a pointer + ** to the new memory. ^On second and subsequent calls to +@@ -5363,19 +5489,19 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); + ** In those cases, sqlite3_aggregate_context() might be called for the + ** first time from within xFinal().)^ + ** +-** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer ++** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer + ** when first called if N is less than or equal to zero or if a memory + ** allocate error occurs. + ** + ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is + ** determined by the N parameter on first successful call. Changing the +-** value of N in any subsequents call to sqlite3_aggregate_context() within ++** value of N in any subsequent call to sqlite3_aggregate_context() within + ** the same aggregate function instance will not resize the memory + ** allocation.)^ Within the xFinal callback, it is customary to set +-** N=0 in calls to sqlite3_aggregate_context(C,N) so that no ++** N=0 in calls to sqlite3_aggregate_context(C,N) so that no + ** pointless memory allocations occur. + ** +-** ^SQLite automatically frees the memory allocated by ++** ^SQLite automatically frees the memory allocated by + ** sqlite3_aggregate_context() when the aggregate query concludes. + ** + ** The first parameter must be a copy of the +@@ -5386,7 +5512,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); + ** This routine must be called from the same thread in which + ** the aggregate SQL function is running. + */ +-SQLITE_API void* sqlite3_aggregate_context(sqlite3_context*, int nBytes); ++SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); + + /* + ** CAPI3REF: User Data For Functions +@@ -5401,7 +5527,7 @@ SQLITE_API void* sqlite3_aggregate_context(sqlite3_context*, int nBytes); + ** This routine must be called from the same thread in which + ** the application-defined function is running. + */ +-SQLITE_API void* sqlite3_user_data(sqlite3_context*); ++SQLITE_API void *sqlite3_user_data(sqlite3_context*); + + /* + ** CAPI3REF: Database Connection For Functions +@@ -5413,7 +5539,7 @@ SQLITE_API void* sqlite3_user_data(sqlite3_context*); + ** and [sqlite3_create_function16()] routines that originally + ** registered the application defined function. + */ +-SQLITE_API sqlite3* sqlite3_context_db_handle(sqlite3_context*); ++SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); + + /* + ** CAPI3REF: Function Auxiliary Data +@@ -5425,7 +5551,7 @@ SQLITE_API sqlite3* sqlite3_context_db_handle(sqlite3_context*); + ** some circumstances the associated metadata may be preserved. An example + ** of where this might be useful is in a regular-expression matching + ** function. The compiled version of the regular expression can be stored as +-** metadata associated with the pattern string. ++** metadata associated with the pattern string. + ** Then as long as the pattern string remains the same, + ** the compiled regular expression can be reused on multiple + ** invocations of the same function. +@@ -5451,10 +5577,10 @@ SQLITE_API sqlite3* sqlite3_context_db_handle(sqlite3_context*); + ** SQL statement)^, or + **
  • ^(when sqlite3_set_auxdata() is invoked again on the same + ** parameter)^, or +-**
  • ^(during the original sqlite3_set_auxdata() call when a memory ++**
  • ^(during the original sqlite3_set_auxdata() call when a memory + ** allocation error occurs.)^ + ** +-** Note the last bullet in particular. The destructor X in ++** Note the last bullet in particular. The destructor X in + ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the + ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() + ** should be called near the end of the function implementation and the +@@ -5472,9 +5598,9 @@ SQLITE_API sqlite3* sqlite3_context_db_handle(sqlite3_context*); + ** These routines must be called from the same thread in which + ** the SQL function is running. + */ +-SQLITE_API void* sqlite3_get_auxdata(sqlite3_context*, int N); +-SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, +- void (*)(void*)); ++SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); ++SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); ++ + + /* + ** CAPI3REF: Constants Defining Special Destructor Behavior +@@ -5491,8 +5617,8 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, + ** C++ compilers. + */ + typedef void (*sqlite3_destructor_type)(void*); +-# define SQLITE_STATIC ((sqlite3_destructor_type)0) +-# define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) ++#define SQLITE_STATIC ((sqlite3_destructor_type)0) ++#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) + + /* + ** CAPI3REF: Setting The Result Of An SQL Function +@@ -5526,8 +5652,9 @@ typedef void (*sqlite3_destructor_type)(void*); + ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() + ** as the text of an error message. ^SQLite interprets the error + ** message string from sqlite3_result_error() as UTF-8. ^SQLite +-** interprets the string from sqlite3_result_error16() as UTF-16 in native +-** byte order. ^If the third parameter to sqlite3_result_error() ++** interprets the string from sqlite3_result_error16() as UTF-16 using ++** the same [byte-order determination rules] as [sqlite3_bind_text16()]. ++** ^If the third parameter to sqlite3_result_error() + ** or sqlite3_result_error16() is negative then SQLite takes as the error + ** message all text up through the first zero character. + ** ^If the third parameter to sqlite3_result_error() or +@@ -5595,6 +5722,25 @@ typedef void (*sqlite3_destructor_type)(void*); + ** then SQLite makes a copy of the result into space obtained + ** from [sqlite3_malloc()] before it returns. + ** ++** ^For the sqlite3_result_text16(), sqlite3_result_text16le(), and ++** sqlite3_result_text16be() routines, and for sqlite3_result_text64() ++** when the encoding is not UTF8, if the input UTF16 begins with a ++** byte-order mark (BOM, U+FEFF) then the BOM is removed from the ++** string and the rest of the string is interpreted according to the ++** byte-order specified by the BOM. ^The byte-order specified by ++** the BOM at the beginning of the text overrides the byte-order ++** specified by the interface procedure. ^So, for example, if ++** sqlite3_result_text16le() is invoked with text that begins ++** with bytes 0xfe, 0xff (a big-endian byte-order mark) then the ++** first two bytes of input are skipped and the remaining input ++** is interpreted as UTF16BE text. ++** ++** ^For UTF16 input text to the sqlite3_result_text16(), ++** sqlite3_result_text16be(), sqlite3_result_text16le(), and ++** sqlite3_result_text64() routines, if the text contains invalid ++** UTF16 characters, the invalid characters might be converted ++** into the unicode replacement character, U+FFFD. ++** + ** ^The sqlite3_result_value() interface sets the result of + ** the application-defined function to be a copy of the + ** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The +@@ -5607,7 +5753,7 @@ typedef void (*sqlite3_destructor_type)(void*); + ** + ** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an + ** SQL NULL value, just like [sqlite3_result_null(C)], except that it +-** also associates the host-language pointer P or type T with that ++** also associates the host-language pointer P or type T with that + ** NULL value such that the pointer can be retrieved within an + ** [application-defined SQL function] using [sqlite3_value_pointer()]. + ** ^If the D parameter is not NULL, then it is a pointer to a destructor +@@ -5620,10 +5766,9 @@ typedef void (*sqlite3_destructor_type)(void*); + ** than the one containing the application-defined function that received + ** the [sqlite3_context] pointer, the results are undefined. + */ +-SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, +- void (*)(void*)); +-SQLITE_API void sqlite3_result_blob64(sqlite3_context*, const void*, +- sqlite3_uint64, void (*)(void*)); ++SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); ++SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, ++ sqlite3_uint64,void(*)(void*)); + SQLITE_API void sqlite3_result_double(sqlite3_context*, double); + SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int); + SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int); +@@ -5633,36 +5778,31 @@ SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int); + SQLITE_API void sqlite3_result_int(sqlite3_context*, int); + SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64); + SQLITE_API void sqlite3_result_null(sqlite3_context*); +-SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, +- void (*)(void*)); +-SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*, +- sqlite3_uint64, void (*)(void*), +- unsigned char encoding); +-SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, +- void (*)(void*)); +-SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int, +- void (*)(void*)); +-SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int, +- void (*)(void*)); ++SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); ++SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, ++ void(*)(void*), unsigned char encoding); ++SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); ++SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); ++SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); + SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); +-SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*, const char*, +- void (*)(void*)); ++SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*)); + SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); + SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); + ++ + /* + ** CAPI3REF: Setting The Subtype Of An SQL Function + ** METHOD: sqlite3_context + ** + ** The sqlite3_result_subtype(C,T) function causes the subtype of +-** the result from the [application-defined SQL function] with +-** [sqlite3_context] C to be the value T. Only the lower 8 bits ++** the result from the [application-defined SQL function] with ++** [sqlite3_context] C to be the value T. Only the lower 8 bits + ** of the subtype T are preserved in current versions of SQLite; + ** higher order bits are discarded. + ** The number of subtype bytes preserved by SQLite might increase + ** in future releases of SQLite. + */ +-SQLITE_API void sqlite3_result_subtype(sqlite3_context*, unsigned int); ++SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); + + /* + ** CAPI3REF: Define New Collating Sequences +@@ -5703,7 +5843,7 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context*, unsigned int); + ** deleted. ^When all collating functions having the same name are deleted, + ** that collation is no longer usable. + ** +-** ^The collating function callback is invoked with a copy of the pArg ++** ^The collating function callback is invoked with a copy of the pArg + ** application data pointer and with two strings in the encoding specified + ** by the eTextRep argument. The two integer parameters to the collating + ** function callback are the length of the two strings, in bytes. The collating +@@ -5734,28 +5874,39 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context*, unsigned int); + ** calls to the collation creation functions or when the + ** [database connection] is closed using [sqlite3_close()]. + ** +-** ^The xDestroy callback is not called if the ++** ^The xDestroy callback is not called if the + ** sqlite3_create_collation_v2() function fails. Applications that invoke +-** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should ++** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should + ** check the return code and dispose of the application data pointer + ** themselves rather than expecting SQLite to deal with it for them. +-** This is different from every other SQLite interface. The inconsistency +-** is unfortunate but cannot be changed without breaking backwards ++** This is different from every other SQLite interface. The inconsistency ++** is unfortunate but cannot be changed without breaking backwards + ** compatibility. + ** + ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. + */ +-SQLITE_API int sqlite3_create_collation(sqlite3*, const char* zName, +- int eTextRep, void* pArg, +- int (*xCompare)(void*, int, const void*, +- int, const void*)); ++SQLITE_API int sqlite3_create_collation( ++ sqlite3*, ++ const char *zName, ++ int eTextRep, ++ void *pArg, ++ int(*xCompare)(void*,int,const void*,int,const void*) ++); + SQLITE_API int sqlite3_create_collation_v2( +- sqlite3*, const char* zName, int eTextRep, void* pArg, +- int (*xCompare)(void*, int, const void*, int, const void*), +- void (*xDestroy)(void*)); ++ sqlite3*, ++ const char *zName, ++ int eTextRep, ++ void *pArg, ++ int(*xCompare)(void*,int,const void*,int,const void*), ++ void(*xDestroy)(void*) ++); + SQLITE_API int sqlite3_create_collation16( +- sqlite3*, const void* zName, int eTextRep, void* pArg, +- int (*xCompare)(void*, int, const void*, int, const void*)); ++ sqlite3*, ++ const void *zName, ++ int eTextRep, ++ void *pArg, ++ int(*xCompare)(void*,int,const void*,int,const void*) ++); + + /* + ** CAPI3REF: Collation Needed Callbacks +@@ -5784,63 +5935,26 @@ SQLITE_API int sqlite3_create_collation16( + ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or + ** [sqlite3_create_collation_v2()]. + */ +-SQLITE_API int sqlite3_collation_needed(sqlite3*, void*, +- void (*)(void*, sqlite3*, int eTextRep, +- const char*)); +-SQLITE_API int sqlite3_collation_needed16(sqlite3*, void*, +- void (*)(void*, sqlite3*, +- int eTextRep, const void*)); +- +-# ifdef SQLITE_HAS_CODEC +-/* +-** Specify the key for an encrypted database. This routine should be +-** called right after sqlite3_open(). +-** +-** The code to implement this API is not available in the public release +-** of SQLite. +-*/ +-SQLITE_API int sqlite3_key(sqlite3* db, /* Database to be rekeyed */ +- const void* pKey, int nKey /* The key */ ++SQLITE_API int sqlite3_collation_needed( ++ sqlite3*, ++ void*, ++ void(*)(void*,sqlite3*,int eTextRep,const char*) + ); +-SQLITE_API int sqlite3_key_v2(sqlite3* db, /* Database to be rekeyed */ +- const char* zDbName, /* Name of the database */ +- const void* pKey, int nKey /* The key */ ++SQLITE_API int sqlite3_collation_needed16( ++ sqlite3*, ++ void*, ++ void(*)(void*,sqlite3*,int eTextRep,const void*) + ); + ++#ifdef SQLITE_ENABLE_CEROD + /* +-** Change the key on an open database. If the current database is not +-** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the +-** database is decrypted. +-** +-** The code to implement this API is not available in the public release +-** of SQLite. +-*/ +-SQLITE_API int sqlite3_rekey(sqlite3* db, /* Database to be rekeyed */ +- const void* pKey, int nKey /* The new key */ +-); +-SQLITE_API int sqlite3_rekey_v2(sqlite3* db, /* Database to be rekeyed */ +- const char* zDbName, /* Name of the database */ +- const void* pKey, int nKey /* The new key */ +-); +- +-/* +-** Specify the activation key for a SEE database. Unless +-** activated, none of the SEE routines will work. +-*/ +-SQLITE_API void sqlite3_activate_see( +- const char* zPassPhrase /* Activation phrase */ +-); +-# endif +- +-# ifdef SQLITE_ENABLE_CEROD +-/* +-** Specify the activation key for a CEROD database. Unless ++** Specify the activation key for a CEROD database. Unless + ** activated, none of the CEROD routines will work. + */ + SQLITE_API void sqlite3_activate_cerod( +- const char* zPassPhrase /* Activation phrase */ ++ const char *zPassPhrase /* Activation phrase */ + ); +-# endif ++#endif + + /* + ** CAPI3REF: Suspend Execution For A Short Time +@@ -5890,7 +6004,7 @@ SQLITE_API int sqlite3_sleep(int); + ** ^The [temp_store_directory pragma] may modify this variable and cause + ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, + ** the [temp_store_directory pragma] always assumes that any string +-** that this variable points to is held in memory obtained from ++** that this variable points to is held in memory obtained from + ** [sqlite3_malloc] and the pragma may attempt to free that memory + ** using [sqlite3_free]. + ** Hence, if this variable is modified directly, either it should be +@@ -5917,7 +6031,7 @@ SQLITE_API int sqlite3_sleep(int); + ** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); + ** + */ +-SQLITE_API SQLITE_EXTERN char* sqlite3_temp_directory; ++SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; + + /* + ** CAPI3REF: Name Of The Folder Holding Database Files +@@ -5947,14 +6061,14 @@ SQLITE_API SQLITE_EXTERN char* sqlite3_temp_directory; + ** ^The [data_store_directory pragma] may modify this variable and cause + ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, + ** the [data_store_directory pragma] always assumes that any string +-** that this variable points to is held in memory obtained from ++** that this variable points to is held in memory obtained from + ** [sqlite3_malloc] and the pragma may attempt to free that memory + ** using [sqlite3_free]. + ** Hence, if this variable is modified directly, either it should be + ** made NULL or made to point to memory obtained from [sqlite3_malloc] + ** or else the use of the [data_store_directory pragma] should be avoided. + */ +-SQLITE_API SQLITE_EXTERN char* sqlite3_data_directory; ++SQLITE_API SQLITE_EXTERN char *sqlite3_data_directory; + + /* + ** CAPI3REF: Win32 Specific Interface +@@ -5976,13 +6090,11 @@ SQLITE_API SQLITE_EXTERN char* sqlite3_data_directory; + ** UTF-8 or UTF-16, respectively. + */ + SQLITE_API int sqlite3_win32_set_directory( +- unsigned long type, /* Identifier for directory being set or reset */ +- void* zValue /* New value for directory being set or reset */ ++ unsigned long type, /* Identifier for directory being set or reset */ ++ void *zValue /* New value for directory being set or reset */ + ); +-SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, +- const char* zValue); +-SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, +- const void* zValue); ++SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue); ++SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue); + + /* + ** CAPI3REF: Win32 Directory Types +@@ -5990,8 +6102,8 @@ SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, + ** These macros are only available on Windows. They define the allowed values + ** for the type argument to the [sqlite3_win32_set_directory] interface. + */ +-# define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1 +-# define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2 ++#define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1 ++#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2 + + /* + ** CAPI3REF: Test For Auto-Commit Mode +@@ -6028,7 +6140,7 @@ SQLITE_API int sqlite3_get_autocommit(sqlite3*); + ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to + ** create the statement in the first place. + */ +-SQLITE_API sqlite3* sqlite3_db_handle(sqlite3_stmt*); ++SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); + + /* + ** CAPI3REF: Return The Filename For A Database Connection +@@ -6060,7 +6172,7 @@ SQLITE_API sqlite3* sqlite3_db_handle(sqlite3_stmt*); + **
  • [sqlite3_filename_wal()] + ** + */ +-SQLITE_API const char* sqlite3_db_filename(sqlite3* db, const char* zDbName); ++SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); + + /* + ** CAPI3REF: Determine if a database is read-only +@@ -6070,7 +6182,7 @@ SQLITE_API const char* sqlite3_db_filename(sqlite3* db, const char* zDbName); + ** of connection D is read-only, 0 if it is read/write, or -1 if N is not + ** the name of a database on connection D. + */ +-SQLITE_API int sqlite3_db_readonly(sqlite3* db, const char* zDbName); ++SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName); + + /* + ** CAPI3REF: Find the next prepared statement +@@ -6086,7 +6198,7 @@ SQLITE_API int sqlite3_db_readonly(sqlite3* db, const char* zDbName); + ** [sqlite3_next_stmt(D,S)] must refer to an open database + ** connection and in particular must not be a NULL pointer. + */ +-SQLITE_API sqlite3_stmt* sqlite3_next_stmt(sqlite3* pDb, sqlite3_stmt* pStmt); ++SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); + + /* + ** CAPI3REF: Commit And Rollback Notification Callbacks +@@ -6135,8 +6247,8 @@ SQLITE_API sqlite3_stmt* sqlite3_next_stmt(sqlite3* pDb, sqlite3_stmt* pStmt); + ** + ** See also the [sqlite3_update_hook()] interface. + */ +-SQLITE_API void* sqlite3_commit_hook(sqlite3*, int (*)(void*), void*); +-SQLITE_API void* sqlite3_rollback_hook(sqlite3*, void (*)(void*), void*); ++SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); ++SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); + + /* + ** CAPI3REF: Data Change Notification Callbacks +@@ -6187,10 +6299,11 @@ SQLITE_API void* sqlite3_rollback_hook(sqlite3*, void (*)(void*), void*); + ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], + ** and [sqlite3_preupdate_hook()] interfaces. + */ +-SQLITE_API void* sqlite3_update_hook(sqlite3*, +- void (*)(void*, int, char const*, +- char const*, sqlite3_int64), +- void*); ++SQLITE_API void *sqlite3_update_hook( ++ sqlite3*, ++ void(*)(void *,int ,char const *,char const *,sqlite3_int64), ++ void* ++); + + /* + ** CAPI3REF: Enable Or Disable Shared Pager Cache +@@ -6201,7 +6314,7 @@ SQLITE_API void* sqlite3_update_hook(sqlite3*, + ** and disabled if the argument is false.)^ + ** + ** ^Cache sharing is enabled and disabled for an entire process. +-** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). ++** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). + ** In prior versions of SQLite, + ** sharing was enabled or disabled for each thread separately. + ** +@@ -6222,8 +6335,8 @@ SQLITE_API void* sqlite3_update_hook(sqlite3*, + ** with the [SQLITE_OPEN_SHAREDCACHE] flag. + ** + ** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 +-** and will always return SQLITE_MISUSE. On those systems, +-** shared cache mode should be enabled per-database connection via ++** and will always return SQLITE_MISUSE. On those systems, ++** shared cache mode should be enabled per-database connection via + ** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. + ** + ** This interface is threadsafe on processors where writing a +@@ -6276,7 +6389,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); + ** as heap memory usages approaches the limit. + ** ^The soft heap limit is "soft" because even though SQLite strives to stay + ** below the limit, it will exceed the limit rather than generate +-** an [SQLITE_NOMEM] error. In other words, the soft heap limit ++** an [SQLITE_NOMEM] error. In other words, the soft heap limit + ** is advisory only. + ** + ** ^The sqlite3_hard_heap_limit64(N) interface sets a hard upper bound of +@@ -6341,6 +6454,7 @@ SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); + */ + SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + ++ + /* + ** CAPI3REF: Extract Metadata About A Column Of A Table + ** METHOD: sqlite3 +@@ -6391,7 +6505,7 @@ SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + ** + ** ^If the specified table is actually a view, an [error code] is returned. + ** +-** ^If the specified column is "rowid", "oid" or "_rowid_" and the table ++** ^If the specified column is "rowid", "oid" or "_rowid_" and the table + ** is not a [WITHOUT ROWID] table and an + ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output + ** parameters are set for the explicitly declared column. ^(If there is no +@@ -6411,15 +6525,15 @@ SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + ** any errors are encountered while loading the schema. + */ + SQLITE_API int sqlite3_table_column_metadata( +- sqlite3* db, /* Connection handle */ +- const char* zDbName, /* Database name or NULL */ +- const char* zTableName, /* Table name */ +- const char* zColumnName, /* Column name */ +- char const** pzDataType, /* OUTPUT: Declared data type */ +- char const** pzCollSeq, /* OUTPUT: Collation sequence name */ +- int* pNotNull, /* OUTPUT: True if NOT NULL constraint exists */ +- int* pPrimaryKey, /* OUTPUT: True if column part of PK */ +- int* pAutoinc /* OUTPUT: True if column is auto-increment */ ++ sqlite3 *db, /* Connection handle */ ++ const char *zDbName, /* Database name or NULL */ ++ const char *zTableName, /* Table name */ ++ const char *zColumnName, /* Column name */ ++ char const **pzDataType, /* OUTPUT: Declared data type */ ++ char const **pzCollSeq, /* OUTPUT: Collation sequence name */ ++ int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */ ++ int *pPrimaryKey, /* OUTPUT: True if column part of PK */ ++ int *pAutoinc /* OUTPUT: True if column is auto-increment */ + ); + + /* +@@ -6457,7 +6571,7 @@ SQLITE_API int sqlite3_table_column_metadata( + ** prior to calling this API, + ** otherwise an error will be returned. + ** +-** Security warning: It is recommended that the ++** Security warning: It is recommended that the + ** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this + ** interface. The use of the [sqlite3_enable_load_extension()] interface + ** should be avoided. This will keep the SQL function [load_extension()] +@@ -6467,10 +6581,10 @@ SQLITE_API int sqlite3_table_column_metadata( + ** See also the [load_extension() SQL function]. + */ + SQLITE_API int sqlite3_load_extension( +- sqlite3* db, /* Load the extension into this database connection */ +- const char* zFile, /* Name of the shared library containing extension */ +- const char* zProc, /* Entry point. Derived from zFile if 0 */ +- char** pzErrMsg /* Put error message here if not 0 */ ++ sqlite3 *db, /* Load the extension into this database connection */ ++ const char *zFile, /* Name of the shared library containing extension */ ++ const char *zProc, /* Entry point. Derived from zFile if 0 */ ++ char **pzErrMsg /* Put error message here if not 0 */ + ); + + /* +@@ -6498,7 +6612,7 @@ SQLITE_API int sqlite3_load_extension( + ** remains disabled. This will prevent SQL injections from giving attackers + ** access to extension loading capabilities. + */ +-SQLITE_API int sqlite3_enable_load_extension(sqlite3* db, int onoff); ++SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); + + /* + ** CAPI3REF: Automatically Load Statically Linked Extensions +@@ -6536,7 +6650,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3* db, int onoff); + ** See also: [sqlite3_reset_auto_extension()] + ** and [sqlite3_cancel_auto_extension()] + */ +-SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void)); ++SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); + + /* + ** CAPI3REF: Cancel Automatic Extension Loading +@@ -6544,11 +6658,11 @@ SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void)); + ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the + ** initialization routine X that was registered using a prior call to + ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] +-** routine returns 1 if initialization routine X was successfully ++** routine returns 1 if initialization routine X was successfully + ** unregistered and it returns 0 if X was not on the list of initialization + ** routines. + */ +-SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); ++SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)); + + /* + ** CAPI3REF: Reset Automatic Extension Loading +@@ -6579,8 +6693,8 @@ typedef struct sqlite3_module sqlite3_module; + ** CAPI3REF: Virtual Table Object + ** KEYWORDS: sqlite3_module {virtual table module} + ** +-** This structure, sometimes called a "virtual table module", +-** defines the implementation of a [virtual table]. ++** This structure, sometimes called a "virtual table module", ++** defines the implementation of a [virtual table]. + ** This structure consists mostly of methods for the module. + ** + ** ^A virtual table module is created by filling in a persistent +@@ -6593,35 +6707,37 @@ typedef struct sqlite3_module sqlite3_module; + */ + struct sqlite3_module { + int iVersion; +- int (*xCreate)(sqlite3*, void* pAux, int argc, const char* const* argv, +- sqlite3_vtab** ppVTab, char**); +- int (*xConnect)(sqlite3*, void* pAux, int argc, const char* const* argv, +- sqlite3_vtab** ppVTab, char**); +- int (*xBestIndex)(sqlite3_vtab* pVTab, sqlite3_index_info*); +- int (*xDisconnect)(sqlite3_vtab* pVTab); +- int (*xDestroy)(sqlite3_vtab* pVTab); +- int (*xOpen)(sqlite3_vtab* pVTab, sqlite3_vtab_cursor** ppCursor); ++ int (*xCreate)(sqlite3*, void *pAux, ++ int argc, const char *const*argv, ++ sqlite3_vtab **ppVTab, char**); ++ int (*xConnect)(sqlite3*, void *pAux, ++ int argc, const char *const*argv, ++ sqlite3_vtab **ppVTab, char**); ++ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); ++ int (*xDisconnect)(sqlite3_vtab *pVTab); ++ int (*xDestroy)(sqlite3_vtab *pVTab); ++ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); + int (*xClose)(sqlite3_vtab_cursor*); +- int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char* idxStr, int argc, +- sqlite3_value** argv); ++ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, ++ int argc, sqlite3_value **argv); + int (*xNext)(sqlite3_vtab_cursor*); + int (*xEof)(sqlite3_vtab_cursor*); + int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); +- int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64* pRowid); +- int (*xUpdate)(sqlite3_vtab*, int, sqlite3_value**, sqlite3_int64*); +- int (*xBegin)(sqlite3_vtab* pVTab); +- int (*xSync)(sqlite3_vtab* pVTab); +- int (*xCommit)(sqlite3_vtab* pVTab); +- int (*xRollback)(sqlite3_vtab* pVTab); +- int (*xFindFunction)(sqlite3_vtab* pVtab, int nArg, const char* zName, +- void (**pxFunc)(sqlite3_context*, int, sqlite3_value**), +- void** ppArg); +- int (*xRename)(sqlite3_vtab* pVtab, const char* zNew); +- /* The methods above are in version 1 of the sqlite_module object. Those ++ int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); ++ int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); ++ int (*xBegin)(sqlite3_vtab *pVTab); ++ int (*xSync)(sqlite3_vtab *pVTab); ++ int (*xCommit)(sqlite3_vtab *pVTab); ++ int (*xRollback)(sqlite3_vtab *pVTab); ++ int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, ++ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), ++ void **ppArg); ++ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); ++ /* The methods above are in version 1 of the sqlite_module object. Those + ** below are for version 2 and greater. */ +- int (*xSavepoint)(sqlite3_vtab* pVTab, int); +- int (*xRelease)(sqlite3_vtab* pVTab, int); +- int (*xRollbackTo)(sqlite3_vtab* pVTab, int); ++ int (*xSavepoint)(sqlite3_vtab *pVTab, int); ++ int (*xRelease)(sqlite3_vtab *pVTab, int); ++ int (*xRollbackTo)(sqlite3_vtab *pVTab, int); + /* The methods above are in versions 1 and 2 of the sqlite_module object. + ** Those below are for version 3 and greater. */ + int (*xShadowName)(const char*); +@@ -6667,7 +6783,7 @@ struct sqlite3_module { + ** required by SQLite. If the table has at least 64 columns and any column + ** to the right of the first 63 is required, then bit 63 of colUsed is also + ** set. In other words, column iCol may be required if the expression +-** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to ++** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to + ** non-zero. + ** + ** The [xBestIndex] method must fill aConstraintUsage[] with information +@@ -6694,17 +6810,17 @@ struct sqlite3_module { + ** + ** ^The estimatedCost value is an estimate of the cost of a particular + ** strategy. A cost of N indicates that the cost of the strategy is similar +-** to a linear scan of an SQLite table with N rows. A cost of log(N) ++** to a linear scan of an SQLite table with N rows. A cost of log(N) + ** indicates that the expense of the operation is similar to that of a + ** binary search on a unique indexed field of an SQLite table with N rows. + ** + ** ^The estimatedRows value is an estimate of the number of rows that + ** will be returned by the strategy. + ** +-** The xBestIndex method may optionally populate the idxFlags field with a ++** The xBestIndex method may optionally populate the idxFlags field with a + ** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - + ** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite +-** assumes that the strategy may visit at most one row. ++** assumes that the strategy may visit at most one row. + ** + ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then + ** SQLite also assumes that if a call to the xUpdate() method is made as +@@ -6717,58 +6833,58 @@ struct sqlite3_module { + ** the xUpdate method are automatically rolled back by SQLite. + ** + ** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info +-** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). ++** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). + ** If a virtual table extension is +-** used with an SQLite version earlier than 3.8.2, the results of attempting +-** to read or write the estimatedRows field are undefined (but are likely ++** used with an SQLite version earlier than 3.8.2, the results of attempting ++** to read or write the estimatedRows field are undefined (but are likely + ** to include crashing the application). The estimatedRows field should + ** therefore only be used if [sqlite3_libversion_number()] returns a + ** value greater than or equal to 3008002. Similarly, the idxFlags field +-** was added for [version 3.9.0] ([dateof:3.9.0]). ++** was added for [version 3.9.0] ([dateof:3.9.0]). + ** It may therefore only be used if + ** sqlite3_libversion_number() returns a value greater than or equal to + ** 3009000. + */ + struct sqlite3_index_info { + /* Inputs */ +- int nConstraint; /* Number of entries in aConstraint */ ++ int nConstraint; /* Number of entries in aConstraint */ + struct sqlite3_index_constraint { +- int iColumn; /* Column constrained. -1 for ROWID */ +- unsigned char op; /* Constraint operator */ +- unsigned char usable; /* True if this constraint is usable */ +- int iTermOffset; /* Used internally - xBestIndex should ignore */ +- } * aConstraint; /* Table of WHERE clause constraints */ +- int nOrderBy; /* Number of terms in the ORDER BY clause */ ++ int iColumn; /* Column constrained. -1 for ROWID */ ++ unsigned char op; /* Constraint operator */ ++ unsigned char usable; /* True if this constraint is usable */ ++ int iTermOffset; /* Used internally - xBestIndex should ignore */ ++ } *aConstraint; /* Table of WHERE clause constraints */ ++ int nOrderBy; /* Number of terms in the ORDER BY clause */ + struct sqlite3_index_orderby { +- int iColumn; /* Column number */ +- unsigned char desc; /* True for DESC. False for ASC. */ +- } * aOrderBy; /* The ORDER BY clause */ ++ int iColumn; /* Column number */ ++ unsigned char desc; /* True for DESC. False for ASC. */ ++ } *aOrderBy; /* The ORDER BY clause */ + /* Outputs */ + struct sqlite3_index_constraint_usage { +- int argvIndex; /* if >0, constraint is part of argv to xFilter */ +- unsigned char omit; /* Do not code a test for this constraint */ +- } * aConstraintUsage; +- int idxNum; /* Number used to identify the index */ +- char* idxStr; /* String, possibly obtained from sqlite3_malloc */ +- int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */ +- int orderByConsumed; /* True if output is already ordered */ +- double estimatedCost; /* Estimated cost of using this index */ ++ int argvIndex; /* if >0, constraint is part of argv to xFilter */ ++ unsigned char omit; /* Do not code a test for this constraint */ ++ } *aConstraintUsage; ++ int idxNum; /* Number used to identify the index */ ++ char *idxStr; /* String, possibly obtained from sqlite3_malloc */ ++ int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */ ++ int orderByConsumed; /* True if output is already ordered */ ++ double estimatedCost; /* Estimated cost of using this index */ + /* Fields below are only available in SQLite 3.8.2 and later */ +- sqlite3_int64 estimatedRows; /* Estimated number of rows returned */ ++ sqlite3_int64 estimatedRows; /* Estimated number of rows returned */ + /* Fields below are only available in SQLite 3.9.0 and later */ +- int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */ ++ int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */ + /* Fields below are only available in SQLite 3.10.0 and later */ +- sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */ ++ sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */ + }; + + /* + ** CAPI3REF: Virtual Table Scan Flags + ** +-** Virtual table implementations are allowed to set the ++** Virtual table implementations are allowed to set the + ** [sqlite3_index_info].idxFlags field to some combination of + ** these bits. + */ +-# define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */ ++#define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */ + + /* + ** CAPI3REF: Virtual Table Constraint Operator Codes +@@ -6778,21 +6894,21 @@ struct sqlite3_index_info { + ** an operator that is part of a constraint term in the wHERE clause of + ** a query that uses a [virtual table]. + */ +-# define SQLITE_INDEX_CONSTRAINT_EQ 2 +-# define SQLITE_INDEX_CONSTRAINT_GT 4 +-# define SQLITE_INDEX_CONSTRAINT_LE 8 +-# define SQLITE_INDEX_CONSTRAINT_LT 16 +-# define SQLITE_INDEX_CONSTRAINT_GE 32 +-# define SQLITE_INDEX_CONSTRAINT_MATCH 64 +-# define SQLITE_INDEX_CONSTRAINT_LIKE 65 +-# define SQLITE_INDEX_CONSTRAINT_GLOB 66 +-# define SQLITE_INDEX_CONSTRAINT_REGEXP 67 +-# define SQLITE_INDEX_CONSTRAINT_NE 68 +-# define SQLITE_INDEX_CONSTRAINT_ISNOT 69 +-# define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 +-# define SQLITE_INDEX_CONSTRAINT_ISNULL 71 +-# define SQLITE_INDEX_CONSTRAINT_IS 72 +-# define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 ++#define SQLITE_INDEX_CONSTRAINT_EQ 2 ++#define SQLITE_INDEX_CONSTRAINT_GT 4 ++#define SQLITE_INDEX_CONSTRAINT_LE 8 ++#define SQLITE_INDEX_CONSTRAINT_LT 16 ++#define SQLITE_INDEX_CONSTRAINT_GE 32 ++#define SQLITE_INDEX_CONSTRAINT_MATCH 64 ++#define SQLITE_INDEX_CONSTRAINT_LIKE 65 ++#define SQLITE_INDEX_CONSTRAINT_GLOB 66 ++#define SQLITE_INDEX_CONSTRAINT_REGEXP 67 ++#define SQLITE_INDEX_CONSTRAINT_NE 68 ++#define SQLITE_INDEX_CONSTRAINT_ISNOT 69 ++#define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70 ++#define SQLITE_INDEX_CONSTRAINT_ISNULL 71 ++#define SQLITE_INDEX_CONSTRAINT_IS 72 ++#define SQLITE_INDEX_CONSTRAINT_FUNCTION 150 + + /* + ** CAPI3REF: Register A Virtual Table Implementation +@@ -6804,7 +6920,7 @@ struct sqlite3_index_info { + ** preexisting [virtual table] for the module. + ** + ** ^The module name is registered on the [database connection] specified +-** by the first parameter. ^The name of the module is given by the ++** by the first parameter. ^The name of the module is given by the + ** second parameter. ^The third parameter is a pointer to + ** the implementation of the [virtual table module]. ^The fourth + ** parameter is an arbitrary client data pointer that is passed through +@@ -6827,17 +6943,17 @@ struct sqlite3_index_info { + ** See also: [sqlite3_drop_modules()] + */ + SQLITE_API int sqlite3_create_module( +- sqlite3* db, /* SQLite connection to register module with */ +- const char* zName, /* Name of the module */ +- const sqlite3_module* p, /* Methods for the module */ +- void* pClientData /* Client data for xCreate/xConnect */ ++ sqlite3 *db, /* SQLite connection to register module with */ ++ const char *zName, /* Name of the module */ ++ const sqlite3_module *p, /* Methods for the module */ ++ void *pClientData /* Client data for xCreate/xConnect */ + ); + SQLITE_API int sqlite3_create_module_v2( +- sqlite3* db, /* SQLite connection to register module with */ +- const char* zName, /* Name of the module */ +- const sqlite3_module* p, /* Methods for the module */ +- void* pClientData, /* Client data for xCreate/xConnect */ +- void (*xDestroy)(void*) /* Module destructor function */ ++ sqlite3 *db, /* SQLite connection to register module with */ ++ const char *zName, /* Name of the module */ ++ const sqlite3_module *p, /* Methods for the module */ ++ void *pClientData, /* Client data for xCreate/xConnect */ ++ void(*xDestroy)(void*) /* Module destructor function */ + ); + + /* +@@ -6853,8 +6969,8 @@ SQLITE_API int sqlite3_create_module_v2( + ** See also: [sqlite3_create_module()] + */ + SQLITE_API int sqlite3_drop_modules( +- sqlite3* db, /* Remove modules from this connection */ +- const char** azKeep /* Except, do not remove the ones named here */ ++ sqlite3 *db, /* Remove modules from this connection */ ++ const char **azKeep /* Except, do not remove the ones named here */ + ); + + /* +@@ -6876,9 +6992,9 @@ SQLITE_API int sqlite3_drop_modules( + ** freed by sqlite3_free() and the zErrMsg field will be zeroed. + */ + struct sqlite3_vtab { +- const sqlite3_module* pModule; /* The module for this virtual table */ +- int nRef; /* Number of open cursors */ +- char* zErrMsg; /* Error message from sqlite3_mprintf() */ ++ const sqlite3_module *pModule; /* The module for this virtual table */ ++ int nRef; /* Number of open cursors */ ++ char *zErrMsg; /* Error message from sqlite3_mprintf() */ + /* Virtual table implementations will typically add additional fields */ + }; + +@@ -6900,7 +7016,7 @@ struct sqlite3_vtab { + ** are common to all implementations. + */ + struct sqlite3_vtab_cursor { +- sqlite3_vtab* pVtab; /* Virtual table of this cursor */ ++ sqlite3_vtab *pVtab; /* Virtual table of this cursor */ + /* Virtual table implementations will typically add additional fields */ + }; + +@@ -6912,14 +7028,14 @@ struct sqlite3_vtab_cursor { + ** to declare the format (the names and datatypes of the columns) of + ** the virtual tables they implement. + */ +-SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char* zSQL); ++SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); + + /* + ** CAPI3REF: Overload A Function For A Virtual Table + ** METHOD: sqlite3 + ** + ** ^(Virtual tables can provide alternative implementations of functions +-** using the [xFindFunction] method of the [virtual table module]. ++** using the [xFindFunction] method of the [virtual table module]. + ** But global versions of those functions + ** must exist in order to be overloaded.)^ + ** +@@ -6931,8 +7047,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char* zSQL); + ** purpose is to be a placeholder function that can be overloaded + ** by a [virtual table]. + */ +-SQLITE_API int sqlite3_overload_function(sqlite3*, const char* zFuncName, +- int nArg); ++SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); + + /* + ** The interface to the virtual-table mechanism defined above (back up +@@ -6971,7 +7086,7 @@ typedef struct sqlite3_blob sqlite3_blob; + ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow; + ** )^ + ** +-** ^(Parameter zDb is not the filename that contains the database, but ++** ^(Parameter zDb is not the filename that contains the database, but + ** rather the symbolic name of the database. For attached databases, this is + ** the name that appears after the AS keyword in the [ATTACH] statement. + ** For the main database file, the database name is "main". For TEMP +@@ -6984,28 +7099,28 @@ typedef struct sqlite3_blob sqlite3_blob; + ** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored + ** in *ppBlob. Otherwise an [error code] is returned and, unless the error + ** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided +-** the API is not misused, it is always safe to call [sqlite3_blob_close()] ++** the API is not misused, it is always safe to call [sqlite3_blob_close()] + ** on *ppBlob after this function it returns. + ** + ** This function fails with SQLITE_ERROR if any of the following are true: + **
      +-**
    • ^(Database zDb does not exist)^, +-**
    • ^(Table zTable does not exist within database zDb)^, +-**
    • ^(Table zTable is a WITHOUT ROWID table)^, ++**
    • ^(Database zDb does not exist)^, ++**
    • ^(Table zTable does not exist within database zDb)^, ++**
    • ^(Table zTable is a WITHOUT ROWID table)^, + **
    • ^(Column zColumn does not exist)^, + **
    • ^(Row iRow is not present in the table)^, + **
    • ^(The specified column of row iRow contains a value that is not + ** a TEXT or BLOB value)^, +-**
    • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE ++**
    • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE + ** constraint and the blob is being opened for read/write access)^, +-**
    • ^([foreign key constraints | Foreign key constraints] are enabled, ++**
    • ^([foreign key constraints | Foreign key constraints] are enabled, + ** column zColumn is part of a [child key] definition and the blob is + ** being opened for read/write access)^. + **
    + ** +-** ^Unless it returns SQLITE_MISUSE, this function sets the +-** [database connection] error code and message accessible via +-** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ++** ^Unless it returns SQLITE_MISUSE, this function sets the ++** [database connection] error code and message accessible via ++** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. + ** + ** A BLOB referenced by sqlite3_blob_open() may be read using the + ** [sqlite3_blob_read()] interface and modified by using +@@ -7031,7 +7146,7 @@ typedef struct sqlite3_blob sqlite3_blob; + ** blob. + ** + ** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces +-** and the built-in [zeroblob] SQL function may be used to create a ++** and the built-in [zeroblob] SQL function may be used to create a + ** zero-filled blob to read or write using the incremental-blob interface. + ** + ** To avoid a resource leak, every open [BLOB handle] should eventually +@@ -7041,9 +7156,15 @@ typedef struct sqlite3_blob sqlite3_blob; + ** [sqlite3_blob_reopen()], [sqlite3_blob_read()], + ** [sqlite3_blob_bytes()], [sqlite3_blob_write()]. + */ +-SQLITE_API int sqlite3_blob_open(sqlite3*, const char* zDb, const char* zTable, +- const char* zColumn, sqlite3_int64 iRow, +- int flags, sqlite3_blob** ppBlob); ++SQLITE_API int sqlite3_blob_open( ++ sqlite3*, ++ const char *zDb, ++ const char *zTable, ++ const char *zColumn, ++ sqlite3_int64 iRow, ++ int flags, ++ sqlite3_blob **ppBlob ++); + + /* + ** CAPI3REF: Move a BLOB Handle to a New Row +@@ -7068,14 +7189,14 @@ SQLITE_API int sqlite3_blob_open(sqlite3*, const char* zDb, const char* zTable, + ** + ** ^This function sets the database handle error code and message. + */ +-SQLITE_API int sqlite3_blob_reopen(sqlite3_blob*, sqlite3_int64); ++SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); + + /* + ** CAPI3REF: Close A BLOB Handle + ** DESTRUCTOR: sqlite3_blob + ** + ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed +-** unconditionally. Even if this routine returns an error code, the ++** unconditionally. Even if this routine returns an error code, the + ** handle is still closed.)^ + ** + ** ^If the blob handle being closed was opened for read-write access, and if +@@ -7085,19 +7206,19 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob*, sqlite3_int64); + ** code is returned and the transaction rolled back. + ** + ** Calling this function with an argument that is not a NULL pointer or an +-** open blob handle results in undefined behaviour. ^Calling this routine +-** with a null pointer (such as would be returned by a failed call to ++** open blob handle results in undefined behaviour. ^Calling this routine ++** with a null pointer (such as would be returned by a failed call to + ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function +-** is passed a valid open blob handle, the values returned by the ++** is passed a valid open blob handle, the values returned by the + ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. + */ +-SQLITE_API int sqlite3_blob_close(sqlite3_blob*); ++SQLITE_API int sqlite3_blob_close(sqlite3_blob *); + + /* + ** CAPI3REF: Return The Size Of An Open BLOB + ** METHOD: sqlite3_blob + ** +-** ^Returns the size in bytes of the BLOB accessible via the ++** ^Returns the size in bytes of the BLOB accessible via the + ** successfully opened [BLOB handle] in its only argument. ^The + ** incremental blob I/O routines can only read or overwriting existing + ** blob content; they cannot change the size of a blob. +@@ -7107,7 +7228,7 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob*); + ** been closed by [sqlite3_blob_close()]. Passing any other pointer in + ** to this routine results in undefined and probably undesirable behavior. + */ +-SQLITE_API int sqlite3_blob_bytes(sqlite3_blob*); ++SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); + + /* + ** CAPI3REF: Read Data From A BLOB Incrementally +@@ -7136,7 +7257,7 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob*); + ** + ** See also: [sqlite3_blob_write()]. + */ +-SQLITE_API int sqlite3_blob_read(sqlite3_blob*, void* Z, int N, int iOffset); ++SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); + + /* + ** CAPI3REF: Write Data Into A BLOB Incrementally +@@ -7148,9 +7269,9 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob*, void* Z, int N, int iOffset); + ** + ** ^(On success, sqlite3_blob_write() returns SQLITE_OK. + ** Otherwise, an [error code] or an [extended error code] is returned.)^ +-** ^Unless SQLITE_MISUSE is returned, this function sets the +-** [database connection] error code and message accessible via +-** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ++** ^Unless SQLITE_MISUSE is returned, this function sets the ++** [database connection] error code and message accessible via ++** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. + ** + ** ^If the [BLOB handle] passed as the first argument was not opened for + ** writing (the flags parameter to [sqlite3_blob_open()] was zero), +@@ -7159,9 +7280,9 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob*, void* Z, int N, int iOffset); + ** This function may only modify the contents of the BLOB; it is + ** not possible to increase the size of a BLOB using this API. + ** ^If offset iOffset is less than N bytes from the end of the BLOB, +-** [SQLITE_ERROR] is returned and no data is written. The size of the +-** BLOB (and hence the maximum value of N+iOffset) can be determined +-** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less ++** [SQLITE_ERROR] is returned and no data is written. The size of the ++** BLOB (and hence the maximum value of N+iOffset) can be determined ++** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less + ** than zero [SQLITE_ERROR] is returned and no data is written. + ** + ** ^An attempt to write to an expired [BLOB handle] fails with an +@@ -7178,8 +7299,7 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob*, void* Z, int N, int iOffset); + ** + ** See also: [sqlite3_blob_read()]. + */ +-SQLITE_API int sqlite3_blob_write(sqlite3_blob*, const void* z, int n, +- int iOffset); ++SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); + + /* + ** CAPI3REF: Virtual File System Objects +@@ -7210,7 +7330,7 @@ SQLITE_API int sqlite3_blob_write(sqlite3_blob*, const void* z, int n, + ** ^(If the default VFS is unregistered, another VFS is chosen as + ** the default. The choice for the new VFS is arbitrary.)^ + */ +-SQLITE_API sqlite3_vfs* sqlite3_vfs_find(const char* zVfsName); ++SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); + SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); + SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); + +@@ -7314,7 +7434,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); + ** ^(Some systems (for example, Windows 95) do not support the operation + ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() + ** will always return SQLITE_BUSY. The SQLite core only ever uses +-** sqlite3_mutex_try() as an optimization so this is acceptable ++** sqlite3_mutex_try() as an optimization so this is acceptable + ** behavior.)^ + ** + ** ^The sqlite3_mutex_leave() routine exits a mutex that was +@@ -7328,7 +7448,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); + ** + ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. + */ +-SQLITE_API sqlite3_mutex* sqlite3_mutex_alloc(int); ++SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); + SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); + SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); + SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); +@@ -7403,13 +7523,13 @@ typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; + struct sqlite3_mutex_methods { + int (*xMutexInit)(void); + int (*xMutexEnd)(void); +- sqlite3_mutex* (*xMutexAlloc)(int); +- void (*xMutexFree)(sqlite3_mutex*); +- void (*xMutexEnter)(sqlite3_mutex*); +- int (*xMutexTry)(sqlite3_mutex*); +- void (*xMutexLeave)(sqlite3_mutex*); +- int (*xMutexHeld)(sqlite3_mutex*); +- int (*xMutexNotheld)(sqlite3_mutex*); ++ sqlite3_mutex *(*xMutexAlloc)(int); ++ void (*xMutexFree)(sqlite3_mutex *); ++ void (*xMutexEnter)(sqlite3_mutex *); ++ int (*xMutexTry)(sqlite3_mutex *); ++ void (*xMutexLeave)(sqlite3_mutex *); ++ int (*xMutexHeld)(sqlite3_mutex *); ++ int (*xMutexNotheld)(sqlite3_mutex *); + }; + + /* +@@ -7441,10 +7561,10 @@ struct sqlite3_mutex_methods { + ** the appropriate thing to do. The sqlite3_mutex_notheld() + ** interface should also return 1 when given a NULL pointer. + */ +-# ifndef NDEBUG ++#ifndef NDEBUG + SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); + SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); +-# endif ++#endif + + /* + ** CAPI3REF: Mutex Types +@@ -7456,34 +7576,34 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); + ** next. Applications that override the built-in mutex logic must be + ** prepared to accommodate additional static mutexes. + */ +-# define SQLITE_MUTEX_FAST 0 +-# define SQLITE_MUTEX_RECURSIVE 1 +-# define SQLITE_MUTEX_STATIC_MASTER 2 +-# define SQLITE_MUTEX_STATIC_MEM 3 /* sqlite3_malloc() */ +-# define SQLITE_MUTEX_STATIC_MEM2 4 /* NOT USED */ +-# define SQLITE_MUTEX_STATIC_OPEN 4 /* sqlite3BtreeOpen() */ +-# define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_randomness() */ +-# define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */ +-# define SQLITE_MUTEX_STATIC_LRU2 7 /* NOT USED */ +-# define SQLITE_MUTEX_STATIC_PMEM 7 /* sqlite3PageMalloc() */ +-# define SQLITE_MUTEX_STATIC_APP1 8 /* For use by application */ +-# define SQLITE_MUTEX_STATIC_APP2 9 /* For use by application */ +-# define SQLITE_MUTEX_STATIC_APP3 10 /* For use by application */ +-# define SQLITE_MUTEX_STATIC_VFS1 11 /* For use by built-in VFS */ +-# define SQLITE_MUTEX_STATIC_VFS2 12 /* For use by extension VFS */ +-# define SQLITE_MUTEX_STATIC_VFS3 13 /* For use by application VFS */ ++#define SQLITE_MUTEX_FAST 0 ++#define SQLITE_MUTEX_RECURSIVE 1 ++#define SQLITE_MUTEX_STATIC_MASTER 2 ++#define SQLITE_MUTEX_STATIC_MEM 3 /* sqlite3_malloc() */ ++#define SQLITE_MUTEX_STATIC_MEM2 4 /* NOT USED */ ++#define SQLITE_MUTEX_STATIC_OPEN 4 /* sqlite3BtreeOpen() */ ++#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_randomness() */ ++#define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */ ++#define SQLITE_MUTEX_STATIC_LRU2 7 /* NOT USED */ ++#define SQLITE_MUTEX_STATIC_PMEM 7 /* sqlite3PageMalloc() */ ++#define SQLITE_MUTEX_STATIC_APP1 8 /* For use by application */ ++#define SQLITE_MUTEX_STATIC_APP2 9 /* For use by application */ ++#define SQLITE_MUTEX_STATIC_APP3 10 /* For use by application */ ++#define SQLITE_MUTEX_STATIC_VFS1 11 /* For use by built-in VFS */ ++#define SQLITE_MUTEX_STATIC_VFS2 12 /* For use by extension VFS */ ++#define SQLITE_MUTEX_STATIC_VFS3 13 /* For use by application VFS */ + + /* + ** CAPI3REF: Retrieve the mutex for a database connection + ** METHOD: sqlite3 + ** +-** ^This interface returns a pointer the [sqlite3_mutex] object that ++** ^This interface returns a pointer the [sqlite3_mutex] object that + ** serializes access to the [database connection] given in the argument + ** when the [threading mode] is Serialized. + ** ^If the [threading mode] is Single-thread or Multi-thread then this + ** routine returns a NULL pointer. + */ +-SQLITE_API sqlite3_mutex* sqlite3_db_mutex(sqlite3*); ++SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); + + /* + ** CAPI3REF: Low-Level Control Of Database Files +@@ -7504,7 +7624,7 @@ SQLITE_API sqlite3_mutex* sqlite3_db_mutex(sqlite3*); + ** method becomes the return value of this routine. + ** + ** A few opcodes for [sqlite3_file_control()] are handled directly +-** by the SQLite core and never invoke the ++** by the SQLite core and never invoke the + ** sqlite3_io_methods.xFileControl method. + ** ^The [SQLITE_FCNTL_FILE_POINTER] value for the op parameter causes + ** a pointer to the underlying [sqlite3_file] object to be written into +@@ -7526,8 +7646,7 @@ SQLITE_API sqlite3_mutex* sqlite3_db_mutex(sqlite3*); + ** + ** See also: [file control opcodes] + */ +-SQLITE_API int sqlite3_file_control(sqlite3*, const char* zDbName, int op, +- void*); ++SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); + + /* + ** CAPI3REF: Testing Interface +@@ -7559,40 +7678,40 @@ SQLITE_API int sqlite3_test_control(int op, ...); + ** Applications should not use any of these parameters or the + ** [sqlite3_test_control()] interface. + */ +-# define SQLITE_TESTCTRL_FIRST 5 +-# define SQLITE_TESTCTRL_PRNG_SAVE 5 +-# define SQLITE_TESTCTRL_PRNG_RESTORE 6 +-# define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */ +-# define SQLITE_TESTCTRL_BITVEC_TEST 8 +-# define SQLITE_TESTCTRL_FAULT_INSTALL 9 +-# define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 +-# define SQLITE_TESTCTRL_PENDING_BYTE 11 +-# define SQLITE_TESTCTRL_ASSERT 12 +-# define SQLITE_TESTCTRL_ALWAYS 13 +-# define SQLITE_TESTCTRL_RESERVE 14 +-# define SQLITE_TESTCTRL_OPTIMIZATIONS 15 +-# define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ +-# define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ +-# define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17 +-# define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 +-# define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */ +-# define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19 +-# define SQLITE_TESTCTRL_NEVER_CORRUPT 20 +-# define SQLITE_TESTCTRL_VDBE_COVERAGE 21 +-# define SQLITE_TESTCTRL_BYTEORDER 22 +-# define SQLITE_TESTCTRL_ISINIT 23 +-# define SQLITE_TESTCTRL_SORTER_MMAP 24 +-# define SQLITE_TESTCTRL_IMPOSTER 25 +-# define SQLITE_TESTCTRL_PARSER_COVERAGE 26 +-# define SQLITE_TESTCTRL_RESULT_INTREAL 27 +-# define SQLITE_TESTCTRL_PRNG_SEED 28 +-# define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 +-# define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */ ++#define SQLITE_TESTCTRL_FIRST 5 ++#define SQLITE_TESTCTRL_PRNG_SAVE 5 ++#define SQLITE_TESTCTRL_PRNG_RESTORE 6 ++#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */ ++#define SQLITE_TESTCTRL_BITVEC_TEST 8 ++#define SQLITE_TESTCTRL_FAULT_INSTALL 9 ++#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 ++#define SQLITE_TESTCTRL_PENDING_BYTE 11 ++#define SQLITE_TESTCTRL_ASSERT 12 ++#define SQLITE_TESTCTRL_ALWAYS 13 ++#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */ ++#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 ++#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ ++#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ ++#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17 ++#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 ++#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */ ++#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19 ++#define SQLITE_TESTCTRL_NEVER_CORRUPT 20 ++#define SQLITE_TESTCTRL_VDBE_COVERAGE 21 ++#define SQLITE_TESTCTRL_BYTEORDER 22 ++#define SQLITE_TESTCTRL_ISINIT 23 ++#define SQLITE_TESTCTRL_SORTER_MMAP 24 ++#define SQLITE_TESTCTRL_IMPOSTER 25 ++#define SQLITE_TESTCTRL_PARSER_COVERAGE 26 ++#define SQLITE_TESTCTRL_RESULT_INTREAL 27 ++#define SQLITE_TESTCTRL_PRNG_SEED 28 ++#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 ++#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */ + + /* + ** CAPI3REF: SQL Keyword Checking + ** +-** These routines provide access to the set of SQL language keywords ++** These routines provide access to the set of SQL language keywords + ** recognized by SQLite. Applications can uses these routines to determine + ** whether or not a specific identifier needs to be escaped (for example, + ** by enclosing in double-quotes) so as not to confuse the parser. +@@ -7637,8 +7756,8 @@ SQLITE_API int sqlite3_test_control(int op, ...); + ** new keywords may be added to future releases of SQLite. + */ + SQLITE_API int sqlite3_keyword_count(void); +-SQLITE_API int sqlite3_keyword_name(int, const char**, int*); +-SQLITE_API int sqlite3_keyword_check(const char*, int); ++SQLITE_API int sqlite3_keyword_name(int,const char**,int*); ++SQLITE_API int sqlite3_keyword_check(const char*,int); + + /* + ** CAPI3REF: Dynamic String Object +@@ -7664,14 +7783,14 @@ typedef struct sqlite3_str sqlite3_str; + ** + ** ^The [sqlite3_str_new(D)] interface allocates and initializes + ** a new [sqlite3_str] object. To avoid memory leaks, the object returned by +-** [sqlite3_str_new()] must be freed by a subsequent call to ++** [sqlite3_str_new()] must be freed by a subsequent call to + ** [sqlite3_str_finish(X)]. + ** + ** ^The [sqlite3_str_new(D)] interface always returns a pointer to a + ** valid [sqlite3_str] object, though in the event of an out-of-memory + ** error the returned object might be a special singleton that will +-** silently reject new text, always return SQLITE_NOMEM from +-** [sqlite3_str_errcode()], always return 0 for ++** silently reject new text, always return SQLITE_NOMEM from ++** [sqlite3_str_errcode()], always return 0 for + ** [sqlite3_str_length()], and always return NULL from + ** [sqlite3_str_finish(X)]. It is always safe to use the value + ** returned by [sqlite3_str_new(D)] as the sqlite3_str parameter +@@ -7683,7 +7802,7 @@ typedef struct sqlite3_str sqlite3_str; + ** the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead + ** of [SQLITE_MAX_LENGTH]. + */ +-SQLITE_API sqlite3_str* sqlite3_str_new(sqlite3*); ++SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*); + + /* + ** CAPI3REF: Finalize A Dynamic String +@@ -7698,7 +7817,7 @@ SQLITE_API sqlite3_str* sqlite3_str_new(sqlite3*); + ** [sqlite3_str_finish(X)] interface will also return a NULL pointer if the + ** string in [sqlite3_str] object X is zero bytes long. + */ +-SQLITE_API char* sqlite3_str_finish(sqlite3_str*); ++SQLITE_API char *sqlite3_str_finish(sqlite3_str*); + + /* + ** CAPI3REF: Add Content To A Dynamic String +@@ -7707,9 +7826,9 @@ SQLITE_API char* sqlite3_str_finish(sqlite3_str*); + ** These interfaces add content to an sqlite3_str object previously obtained + ** from [sqlite3_str_new()]. + ** +-** ^The [sqlite3_str_appendf(X,F,...)] and ++** ^The [sqlite3_str_appendf(X,F,...)] and + ** [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf] +-** functionality of SQLite to append formatted text onto the end of ++** functionality of SQLite to append formatted text onto the end of + ** [sqlite3_str] object X. + ** + ** ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S +@@ -7726,17 +7845,16 @@ SQLITE_API char* sqlite3_str_finish(sqlite3_str*); + ** ^This method can be used, for example, to add whitespace indentation. + ** + ** ^The [sqlite3_str_reset(X)] method resets the string under construction +-** inside [sqlite3_str] object X back to zero bytes in length. ++** inside [sqlite3_str] object X back to zero bytes in length. + ** + ** These methods do not return a result code. ^If an error occurs, that fact + ** is recorded in the [sqlite3_str] object and can be recovered by a + ** subsequent call to [sqlite3_str_errcode(X)]. + */ +-SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char* zFormat, ...); +-SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char* zFormat, +- va_list); +-SQLITE_API void sqlite3_str_append(sqlite3_str*, const char* zIn, int N); +-SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char* zIn); ++SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...); ++SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list); ++SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N); ++SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn); + SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C); + SQLITE_API void sqlite3_str_reset(sqlite3_str*); + +@@ -7771,7 +7889,7 @@ SQLITE_API void sqlite3_str_reset(sqlite3_str*); + */ + SQLITE_API int sqlite3_str_errcode(sqlite3_str*); + SQLITE_API int sqlite3_str_length(sqlite3_str*); +-SQLITE_API char* sqlite3_str_value(sqlite3_str*); ++SQLITE_API char *sqlite3_str_value(sqlite3_str*); + + /* + ** CAPI3REF: SQLite Runtime Status +@@ -7799,10 +7917,14 @@ SQLITE_API char* sqlite3_str_value(sqlite3_str*); + ** + ** See also: [sqlite3_db_status()] + */ +-SQLITE_API int sqlite3_status(int op, int* pCurrent, int* pHighwater, +- int resetFlag); +-SQLITE_API int sqlite3_status64(int op, sqlite3_int64* pCurrent, +- sqlite3_int64* pHighwater, int resetFlag); ++SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); ++SQLITE_API int sqlite3_status64( ++ int op, ++ sqlite3_int64 *pCurrent, ++ sqlite3_int64 *pHighwater, ++ int resetFlag ++); ++ + + /* + ** CAPI3REF: Status Parameters +@@ -7825,7 +7947,7 @@ SQLITE_API int sqlite3_status64(int op, sqlite3_int64* pCurrent, + **
    This parameter records the largest memory allocation request + ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their + ** internal equivalents). Only the value returned in the +-** *pHighwater parameter to [sqlite3_status()] is of interest. ++** *pHighwater parameter to [sqlite3_status()] is of interest. + ** The value written into the *pCurrent parameter is undefined.
    )^ + ** + ** [[SQLITE_STATUS_MALLOC_COUNT]] ^(
    SQLITE_STATUS_MALLOC_COUNT
    +@@ -7834,11 +7956,11 @@ SQLITE_API int sqlite3_status64(int op, sqlite3_int64* pCurrent, + ** + ** [[SQLITE_STATUS_PAGECACHE_USED]] ^(
    SQLITE_STATUS_PAGECACHE_USED
    + **
    This parameter returns the number of pages used out of the +-** [pagecache memory allocator] that was configured using ++** [pagecache memory allocator] that was configured using + ** [SQLITE_CONFIG_PAGECACHE]. The + ** value returned is in pages, not in bytes.
    )^ + ** +-** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] ++** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] + ** ^(
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    + **
    This parameter returns the number of bytes of page cache + ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] +@@ -7851,7 +7973,7 @@ SQLITE_API int sqlite3_status64(int op, sqlite3_int64* pCurrent, + ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(
    SQLITE_STATUS_PAGECACHE_SIZE
    + **
    This parameter records the largest memory allocation request + ** handed to the [pagecache memory allocator]. Only the value returned in the +-** *pHighwater parameter to [sqlite3_status()] is of interest. ++** *pHighwater parameter to [sqlite3_status()] is of interest. + ** The value written into the *pCurrent parameter is undefined.
    )^ + ** + ** [[SQLITE_STATUS_SCRATCH_USED]]
    SQLITE_STATUS_SCRATCH_USED
    +@@ -7864,34 +7986,34 @@ SQLITE_API int sqlite3_status64(int op, sqlite3_int64* pCurrent, + **
    No longer used.
    + ** + ** [[SQLITE_STATUS_PARSER_STACK]] ^(
    SQLITE_STATUS_PARSER_STACK
    +-**
    The *pHighwater parameter records the deepest parser stack. ++**
    The *pHighwater parameter records the deepest parser stack. + ** The *pCurrent value is undefined. The *pHighwater value is only + ** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
    )^ + ** + ** + ** New status parameters may be added from time to time. + */ +-# define SQLITE_STATUS_MEMORY_USED 0 +-# define SQLITE_STATUS_PAGECACHE_USED 1 +-# define SQLITE_STATUS_PAGECACHE_OVERFLOW 2 +-# define SQLITE_STATUS_SCRATCH_USED 3 /* NOT USED */ +-# define SQLITE_STATUS_SCRATCH_OVERFLOW 4 /* NOT USED */ +-# define SQLITE_STATUS_MALLOC_SIZE 5 +-# define SQLITE_STATUS_PARSER_STACK 6 +-# define SQLITE_STATUS_PAGECACHE_SIZE 7 +-# define SQLITE_STATUS_SCRATCH_SIZE 8 /* NOT USED */ +-# define SQLITE_STATUS_MALLOC_COUNT 9 ++#define SQLITE_STATUS_MEMORY_USED 0 ++#define SQLITE_STATUS_PAGECACHE_USED 1 ++#define SQLITE_STATUS_PAGECACHE_OVERFLOW 2 ++#define SQLITE_STATUS_SCRATCH_USED 3 /* NOT USED */ ++#define SQLITE_STATUS_SCRATCH_OVERFLOW 4 /* NOT USED */ ++#define SQLITE_STATUS_MALLOC_SIZE 5 ++#define SQLITE_STATUS_PARSER_STACK 6 ++#define SQLITE_STATUS_PAGECACHE_SIZE 7 ++#define SQLITE_STATUS_SCRATCH_SIZE 8 /* NOT USED */ ++#define SQLITE_STATUS_MALLOC_COUNT 9 + + /* + ** CAPI3REF: Database Connection Status + ** METHOD: sqlite3 + ** +-** ^This interface is used to retrieve runtime status information ++** ^This interface is used to retrieve runtime status information + ** about a single [database connection]. ^The first argument is the + ** database connection object to be interrogated. ^The second argument + ** is an integer constant, taken from the set of + ** [SQLITE_DBSTATUS options], that +-** determines the parameter to interrogate. The set of ++** determines the parameter to interrogate. The set of + ** [SQLITE_DBSTATUS options] is likely + ** to grow in future releases of SQLite. + ** +@@ -7905,8 +8027,7 @@ SQLITE_API int sqlite3_status64(int op, sqlite3_int64* pCurrent, + ** + ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. + */ +-SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, +- int resetFlg); ++SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); + + /* + ** CAPI3REF: Status Parameters for database connections +@@ -7927,7 +8048,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** checked out.)^ + ** + ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
    SQLITE_DBSTATUS_LOOKASIDE_HIT
    +-**
    This parameter returns the number of malloc attempts that were ++**
    This parameter returns the number of malloc attempts that were + ** satisfied using lookaside memory. Only the high-water value is meaningful; + ** the current value is always zero.)^ + ** +@@ -7952,7 +8073,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** memory used by all pager caches associated with the database connection.)^ + ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. + ** +-** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] ++** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] + ** ^(
    SQLITE_DBSTATUS_CACHE_USED_SHARED
    + **
    This parameter is similar to DBSTATUS_CACHE_USED, except that if a + ** pager cache is shared between two or more connections the bytes of heap +@@ -7967,7 +8088,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
    SQLITE_DBSTATUS_SCHEMA_USED
    + **
    This parameter returns the approximate number of bytes of heap + ** memory used to store the schema for all databases associated +-** with the connection - main, temp, and any [ATTACH]-ed databases.)^ ++** with the connection - main, temp, and any [ATTACH]-ed databases.)^ + ** ^The full amount of memory used by the schemas is reported, even if the + ** schema memory is shared with other database connections due to + ** [shared cache mode] being enabled. +@@ -7982,13 +8103,13 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** + ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(
    SQLITE_DBSTATUS_CACHE_HIT
    + **
    This parameter returns the number of pager cache hits that have +-** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT ++** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT + ** is always 0. + **
    + ** + ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
    SQLITE_DBSTATUS_CACHE_MISS
    + **
    This parameter returns the number of pager cache misses that have +-** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ++** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS + ** is always 0. + **
    + ** +@@ -8019,20 +8140,21 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** + ** + */ +-# define SQLITE_DBSTATUS_LOOKASIDE_USED 0 +-# define SQLITE_DBSTATUS_CACHE_USED 1 +-# define SQLITE_DBSTATUS_SCHEMA_USED 2 +-# define SQLITE_DBSTATUS_STMT_USED 3 +-# define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 +-# define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 +-# define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 +-# define SQLITE_DBSTATUS_CACHE_HIT 7 +-# define SQLITE_DBSTATUS_CACHE_MISS 8 +-# define SQLITE_DBSTATUS_CACHE_WRITE 9 +-# define SQLITE_DBSTATUS_DEFERRED_FKS 10 +-# define SQLITE_DBSTATUS_CACHE_USED_SHARED 11 +-# define SQLITE_DBSTATUS_CACHE_SPILL 12 +-# define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */ ++#define SQLITE_DBSTATUS_LOOKASIDE_USED 0 ++#define SQLITE_DBSTATUS_CACHE_USED 1 ++#define SQLITE_DBSTATUS_SCHEMA_USED 2 ++#define SQLITE_DBSTATUS_STMT_USED 3 ++#define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 ++#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 ++#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 ++#define SQLITE_DBSTATUS_CACHE_HIT 7 ++#define SQLITE_DBSTATUS_CACHE_MISS 8 ++#define SQLITE_DBSTATUS_CACHE_WRITE 9 ++#define SQLITE_DBSTATUS_DEFERRED_FKS 10 ++#define SQLITE_DBSTATUS_CACHE_USED_SHARED 11 ++#define SQLITE_DBSTATUS_CACHE_SPILL 12 ++#define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */ ++ + + /* + ** CAPI3REF: Prepared Statement Status +@@ -8045,7 +8167,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** statements. For example, if the number of table steps greatly exceeds + ** the number of table searches or result rows, that would tend to indicate + ** that the prepared statement is using a full table scan rather than +-** an index. ++** an index. + ** + ** ^(This interface is used to retrieve and reset counter values from + ** a [prepared statement]. The first argument is the prepared statement +@@ -8058,7 +8180,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int* pCur, int* pHiwtr, + ** + ** See also: [sqlite3_status()] and [sqlite3_db_status()]. + */ +-SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op, int resetFlg); ++SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); + + /* + ** CAPI3REF: Status Parameters for prepared statements +@@ -8072,7 +8194,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op, int resetFlg); + ** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]]
    SQLITE_STMTSTATUS_FULLSCAN_STEP
    + **
    ^This is the number of times that SQLite has stepped forward in + ** a table as part of a full table scan. Large numbers for this counter +-** may indicate opportunities for performance improvement through ++** may indicate opportunities for performance improvement through + ** careful use of indices.
    + ** + ** [[SQLITE_STMTSTATUS_SORT]]
    SQLITE_STMTSTATUS_SORT
    +@@ -8090,14 +8212,14 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op, int resetFlg); + ** [[SQLITE_STMTSTATUS_VM_STEP]]
    SQLITE_STMTSTATUS_VM_STEP
    + **
    ^This is the number of virtual machine operations executed + ** by the prepared statement if that number is less than or equal +-** to 2147483647. The number of virtual machine operations can be ++** to 2147483647. The number of virtual machine operations can be + ** used as a proxy for the total work done by the prepared statement. + ** If the number of virtual machine operations exceeds 2147483647 + ** then the value returned by this statement status code is undefined. + ** + ** [[SQLITE_STMTSTATUS_REPREPARE]]
    SQLITE_STMTSTATUS_REPREPARE
    + **
    ^This is the number of times that the prepare statement has been +-** automatically regenerated due to schema changes or changes to ++** automatically regenerated due to schema changes or changes to + ** [bound parameters] that might affect the query plan. + ** + ** [[SQLITE_STMTSTATUS_RUN]]
    SQLITE_STMTSTATUS_RUN
    +@@ -8115,13 +8237,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op, int resetFlg); + ** + ** + */ +-# define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 +-# define SQLITE_STMTSTATUS_SORT 2 +-# define SQLITE_STMTSTATUS_AUTOINDEX 3 +-# define SQLITE_STMTSTATUS_VM_STEP 4 +-# define SQLITE_STMTSTATUS_REPREPARE 5 +-# define SQLITE_STMTSTATUS_RUN 6 +-# define SQLITE_STMTSTATUS_MEMUSED 99 ++#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 ++#define SQLITE_STMTSTATUS_SORT 2 ++#define SQLITE_STMTSTATUS_AUTOINDEX 3 ++#define SQLITE_STMTSTATUS_VM_STEP 4 ++#define SQLITE_STMTSTATUS_REPREPARE 5 ++#define SQLITE_STMTSTATUS_RUN 6 ++#define SQLITE_STMTSTATUS_MEMUSED 99 + + /* + ** CAPI3REF: Custom Page Cache Object +@@ -8148,8 +8270,8 @@ typedef struct sqlite3_pcache sqlite3_pcache; + */ + typedef struct sqlite3_pcache_page sqlite3_pcache_page; + struct sqlite3_pcache_page { +- void* pBuf; /* The content of the page */ +- void* pExtra; /* Extra information associated with the page */ ++ void *pBuf; /* The content of the page */ ++ void *pExtra; /* Extra information associated with the page */ + }; + + /* +@@ -8157,15 +8279,15 @@ struct sqlite3_pcache_page { + ** KEYWORDS: {page cache} + ** + ** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can +-** register an alternative page cache implementation by passing in an ++** register an alternative page cache implementation by passing in an + ** instance of the sqlite3_pcache_methods2 structure.)^ +-** In many applications, most of the heap memory allocated by ++** In many applications, most of the heap memory allocated by + ** SQLite is used for the page cache. +-** By implementing a ++** By implementing a + ** custom page cache using this API, an application can better control +-** the amount of memory consumed by SQLite, the way in which +-** that memory is allocated and released, and the policies used to +-** determine exactly which parts of a database file are cached and for ++** the amount of memory consumed by SQLite, the way in which ++** that memory is allocated and released, and the policies used to ++** determine exactly which parts of a database file are cached and for + ** how long. + ** + ** The alternative page cache mechanism is an +@@ -8178,19 +8300,19 @@ struct sqlite3_pcache_page { + ** [sqlite3_config()] returns.)^ + ** + ** [[the xInit() page cache method]] +-** ^(The xInit() method is called once for each effective ++** ^(The xInit() method is called once for each effective + ** call to [sqlite3_initialize()])^ + ** (usually only once during the lifetime of the process). ^(The xInit() + ** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ +-** The intent of the xInit() method is to set up global data structures +-** required by the custom page cache implementation. +-** ^(If the xInit() method is NULL, then the ++** The intent of the xInit() method is to set up global data structures ++** required by the custom page cache implementation. ++** ^(If the xInit() method is NULL, then the + ** built-in default page cache is used instead of the application defined + ** page cache.)^ + ** + ** [[the xShutdown() page cache method]] + ** ^The xShutdown() method is called by [sqlite3_shutdown()]. +-** It can be used to clean up ++** It can be used to clean up + ** any outstanding resources before process shutdown, if required. + ** ^The xShutdown() method may be NULL. + ** +@@ -8209,7 +8331,7 @@ struct sqlite3_pcache_page { + ** though this is not guaranteed. ^The + ** first parameter, szPage, is the size in bytes of the pages that must + ** be allocated by the cache. ^szPage will always a power of two. ^The +-** second parameter szExtra is a number of bytes of extra storage ++** second parameter szExtra is a number of bytes of extra storage + ** associated with each page cache entry. ^The szExtra parameter will + ** a number less than 250. SQLite will use the + ** extra szExtra bytes on each page to store metadata about the underlying +@@ -8222,7 +8344,7 @@ struct sqlite3_pcache_page { + ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will + ** never invoke xUnpin() except to deliberately delete a page. + ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to +-** false will always have the "discard" flag set to true. ++** false will always have the "discard" flag set to true. + ** ^Hence, a cache created with bPurgeable false will + ** never contain any unpinned pages. + ** +@@ -8237,12 +8359,12 @@ struct sqlite3_pcache_page { + ** [[the xPagecount() page cache methods]] + ** The xPagecount() method must return the number of pages currently + ** stored in the cache, both pinned and unpinned. +-** ++** + ** [[the xFetch() page cache methods]] +-** The xFetch() method locates a page in the cache and returns a pointer to ++** The xFetch() method locates a page in the cache and returns a pointer to + ** an sqlite3_pcache_page object associated with that page, or a NULL pointer. + ** The pBuf element of the returned sqlite3_pcache_page object will be a +-** pointer to a buffer of szPage bytes used to store the content of a ++** pointer to a buffer of szPage bytes used to store the content of a + ** single database page. The pExtra element of sqlite3_pcache_page will be + ** a pointer to the szExtra bytes of extra storage that SQLite has requested + ** for each entry in the page cache. +@@ -8281,8 +8403,8 @@ struct sqlite3_pcache_page { + ** page cache implementation. ^The page cache implementation + ** may choose to evict unpinned pages at any time. + ** +-** The cache must not perform any reference counting. A single +-** call to xUnpin() unpins the page regardless of the number of prior calls ++** The cache must not perform any reference counting. A single ++** call to xUnpin() unpins the page regardless of the number of prior calls + ** to xFetch(). + ** + ** [[the xRekey() page cache methods]] +@@ -8314,16 +8436,16 @@ struct sqlite3_pcache_page { + typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; + struct sqlite3_pcache_methods2 { + int iVersion; +- void* pArg; ++ void *pArg; + int (*xInit)(void*); + void (*xShutdown)(void*); +- sqlite3_pcache* (*xCreate)(int szPage, int szExtra, int bPurgeable); ++ sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); +- sqlite3_pcache_page* (*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); ++ sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); +- void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, unsigned oldKey, +- unsigned newKey); ++ void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, ++ unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); + void (*xShrink)(sqlite3_pcache*); +@@ -8336,19 +8458,20 @@ struct sqlite3_pcache_methods2 { + */ + typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; + struct sqlite3_pcache_methods { +- void* pArg; ++ void *pArg; + int (*xInit)(void*); + void (*xShutdown)(void*); +- sqlite3_pcache* (*xCreate)(int szPage, int bPurgeable); ++ sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); + void (*xCachesize)(sqlite3_pcache*, int nCachesize); + int (*xPagecount)(sqlite3_pcache*); +- void* (*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); ++ void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); + void (*xUnpin)(sqlite3_pcache*, void*, int discard); + void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); + void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); + void (*xDestroy)(sqlite3_pcache*); + }; + ++ + /* + ** CAPI3REF: Online Backup Object + ** +@@ -8366,7 +8489,7 @@ typedef struct sqlite3_backup sqlite3_backup; + ** + ** The backup API copies the content of one database into another. + ** It is useful either for creating backups of databases or +-** for copying in-memory databases to or from persistent files. ++** for copying in-memory databases to or from persistent files. + ** + ** See Also: [Using the SQLite Online Backup API] + ** +@@ -8377,36 +8500,36 @@ typedef struct sqlite3_backup sqlite3_backup; + ** ^Thus, the backup may be performed on a live source database without + ** preventing other database connections from + ** reading or writing to the source database while the backup is underway. +-** +-** ^(To perform a backup operation: ++** ++** ^(To perform a backup operation: + **
      + **
    1. sqlite3_backup_init() is called once to initialize the +-** backup, +-**
    2. sqlite3_backup_step() is called one or more times to transfer ++** backup, ++**
    3. sqlite3_backup_step() is called one or more times to transfer + ** the data between the two databases, and finally +-**
    4. sqlite3_backup_finish() is called to release all resources +-** associated with the backup operation. ++**
    5. sqlite3_backup_finish() is called to release all resources ++** associated with the backup operation. + **
    )^ + ** There should be exactly one call to sqlite3_backup_finish() for each + ** successful call to sqlite3_backup_init(). + ** + ** [[sqlite3_backup_init()]] sqlite3_backup_init() + ** +-** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +-** [database connection] associated with the destination database ++** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the ++** [database connection] associated with the destination database + ** and the database name, respectively. + ** ^The database name is "main" for the main database, "temp" for the + ** temporary database, or the name specified after the AS keyword in + ** an [ATTACH] statement for an attached database. +-** ^The S and M arguments passed to ++** ^The S and M arguments passed to + ** sqlite3_backup_init(D,N,S,M) identify the [database connection] + ** and database name of the source database, respectively. + ** ^The source and destination [database connections] (parameters S and D) + ** must be different or else sqlite3_backup_init(D,N,S,M) will fail with + ** an error. + ** +-** ^A call to sqlite3_backup_init() will fail, returning NULL, if +-** there is already a read or read-write transaction open on the ++** ^A call to sqlite3_backup_init() will fail, returning NULL, if ++** there is already a read or read-write transaction open on the + ** destination database. + ** + ** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is +@@ -8418,14 +8541,14 @@ typedef struct sqlite3_backup sqlite3_backup; + ** ^A successful call to sqlite3_backup_init() returns a pointer to an + ** [sqlite3_backup] object. + ** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and +-** sqlite3_backup_finish() functions to perform the specified backup ++** sqlite3_backup_finish() functions to perform the specified backup + ** operation. + ** + ** [[sqlite3_backup_step()]] sqlite3_backup_step() + ** +-** ^Function sqlite3_backup_step(B,N) will copy up to N pages between ++** ^Function sqlite3_backup_step(B,N) will copy up to N pages between + ** the source and destination databases specified by [sqlite3_backup] object B. +-** ^If N is negative, all remaining source pages are copied. ++** ^If N is negative, all remaining source pages are copied. + ** ^If sqlite3_backup_step(B,N) successfully copies N pages and there + ** are still more pages to be copied, then the function returns [SQLITE_OK]. + ** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages +@@ -8447,8 +8570,8 @@ typedef struct sqlite3_backup sqlite3_backup; + ** + ** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then + ** the [sqlite3_busy_handler | busy-handler function] +-** is invoked (if one is specified). ^If the +-** busy-handler returns non-zero before the lock is available, then ++** is invoked (if one is specified). ^If the ++** busy-handler returns non-zero before the lock is available, then + ** [SQLITE_BUSY] is returned to the caller. ^In this case the call to + ** sqlite3_backup_step() can be retried later. ^If the source + ** [database connection] +@@ -8456,15 +8579,15 @@ typedef struct sqlite3_backup sqlite3_backup; + ** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this + ** case the call to sqlite3_backup_step() can be retried later on. ^(If + ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or +-** [SQLITE_READONLY] is returned, then +-** there is no point in retrying the call to sqlite3_backup_step(). These +-** errors are considered fatal.)^ The application must accept +-** that the backup operation has failed and pass the backup operation handle ++** [SQLITE_READONLY] is returned, then ++** there is no point in retrying the call to sqlite3_backup_step(). These ++** errors are considered fatal.)^ The application must accept ++** that the backup operation has failed and pass the backup operation handle + ** to the sqlite3_backup_finish() to release associated resources. + ** + ** ^The first call to sqlite3_backup_step() obtains an exclusive lock +-** on the destination file. ^The exclusive lock is not released until either +-** sqlite3_backup_finish() is called or the backup operation is complete ++** on the destination file. ^The exclusive lock is not released until either ++** sqlite3_backup_finish() is called or the backup operation is complete + ** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to + ** sqlite3_backup_step() obtains a [shared lock] on the source database that + ** lasts for the duration of the sqlite3_backup_step() call. +@@ -8473,18 +8596,18 @@ typedef struct sqlite3_backup sqlite3_backup; + ** through the backup process. ^If the source database is modified by an + ** external process or via a database connection other than the one being + ** used by the backup operation, then the backup will be automatically +-** restarted by the next call to sqlite3_backup_step(). ^If the source ++** restarted by the next call to sqlite3_backup_step(). ^If the source + ** database is modified by the using the same database connection as is used + ** by the backup operation, then the backup database is automatically + ** updated at the same time. + ** + ** [[sqlite3_backup_finish()]] sqlite3_backup_finish() + ** +-** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the ++** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the + ** application wishes to abandon the backup operation, the application + ** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). + ** ^The sqlite3_backup_finish() interfaces releases all +-** resources associated with the [sqlite3_backup] object. ++** resources associated with the [sqlite3_backup] object. + ** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any + ** active write-transaction on the destination database is rolled back. + ** The [sqlite3_backup] object is invalid +@@ -8524,8 +8647,8 @@ typedef struct sqlite3_backup sqlite3_backup; + ** connections, then the source database connection may be used concurrently + ** from within other threads. + ** +-** However, the application must guarantee that the destination +-** [database connection] is not passed to any other API (by any thread) after ++** However, the application must guarantee that the destination ++** [database connection] is not passed to any other API (by any thread) after + ** sqlite3_backup_init() is called and before the corresponding call to + ** sqlite3_backup_finish(). SQLite does not currently check to see + ** if the application incorrectly accesses the destination [database connection] +@@ -8536,27 +8659,27 @@ typedef struct sqlite3_backup sqlite3_backup; + ** If running in [shared cache mode], the application must + ** guarantee that the shared cache used by the destination database + ** is not accessed while the backup is running. In practice this means +-** that the application must guarantee that the disk file being ++** that the application must guarantee that the disk file being + ** backed up to is not accessed by any connection within the process, + ** not just the specific connection that was passed to sqlite3_backup_init(). + ** +-** The [sqlite3_backup] object itself is partially threadsafe. Multiple ++** The [sqlite3_backup] object itself is partially threadsafe. Multiple + ** threads may safely make multiple concurrent calls to sqlite3_backup_step(). + ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() + ** APIs are not strictly speaking threadsafe. If they are invoked at the + ** same time as another thread is invoking sqlite3_backup_step() it is + ** possible that they return invalid values. + */ +-SQLITE_API sqlite3_backup* sqlite3_backup_init( +- sqlite3* pDest, /* Destination database handle */ +- const char* zDestName, /* Destination database name */ +- sqlite3* pSource, /* Source database handle */ +- const char* zSourceName /* Source database name */ ++SQLITE_API sqlite3_backup *sqlite3_backup_init( ++ sqlite3 *pDest, /* Destination database handle */ ++ const char *zDestName, /* Destination database name */ ++ sqlite3 *pSource, /* Source database handle */ ++ const char *zSourceName /* Source database name */ + ); +-SQLITE_API int sqlite3_backup_step(sqlite3_backup* p, int nPage); +-SQLITE_API int sqlite3_backup_finish(sqlite3_backup* p); +-SQLITE_API int sqlite3_backup_remaining(sqlite3_backup* p); +-SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); ++SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage); ++SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p); ++SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p); ++SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); + + /* + ** CAPI3REF: Unlock Notification +@@ -8565,8 +8688,8 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** ^When running in shared-cache mode, a database operation may fail with + ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or + ** individual tables within the shared-cache cannot be obtained. See +-** [SQLite Shared-Cache Mode] for a description of shared-cache locking. +-** ^This API may be used to register a callback that SQLite will invoke ++** [SQLite Shared-Cache Mode] for a description of shared-cache locking. ++** ^This API may be used to register a callback that SQLite will invoke + ** when the connection currently holding the required lock relinquishes it. + ** ^This API is only available if the library was compiled with the + ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. +@@ -8574,14 +8697,14 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** See Also: [Using the SQLite Unlock Notification Feature]. + ** + ** ^Shared-cache locks are released when a database connection concludes +-** its current transaction, either by committing it or rolling it back. ++** its current transaction, either by committing it or rolling it back. + ** + ** ^When a connection (known as the blocked connection) fails to obtain a + ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the + ** identity of the database connection (the blocking connection) that +-** has locked the required resource is stored internally. ^After an ++** has locked the required resource is stored internally. ^After an + ** application receives an SQLITE_LOCKED error, it may call the +-** sqlite3_unlock_notify() method with the blocked connection handle as ++** sqlite3_unlock_notify() method with the blocked connection handle as + ** the first argument to register for a callback that will be invoked + ** when the blocking connections current transaction is concluded. ^The + ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] +@@ -8595,15 +8718,15 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** + ** ^If the blocked connection is attempting to obtain a write-lock on a + ** shared-cache table, and more than one other connection currently holds +-** a read-lock on the same table, then SQLite arbitrarily selects one of ++** a read-lock on the same table, then SQLite arbitrarily selects one of + ** the other connections to use as the blocking connection. + ** +-** ^(There may be at most one unlock-notify callback registered by a ++** ^(There may be at most one unlock-notify callback registered by a + ** blocked connection. If sqlite3_unlock_notify() is called when the + ** blocked connection already has a registered unlock-notify callback, + ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is + ** called with a NULL pointer as its second argument, then any existing +-** unlock-notify callback is canceled. ^The blocked connections ++** unlock-notify callback is canceled. ^The blocked connections + ** unlock-notify callback may also be canceled by closing the blocked + ** connection using [sqlite3_close()]. + ** +@@ -8616,7 +8739,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** + ** Callback Invocation Details + ** +-** When an unlock-notify callback is registered, the application provides a ++** When an unlock-notify callback is registered, the application provides a + ** single void* pointer that is passed to the callback when it is invoked. + ** However, the signature of the callback function allows SQLite to pass + ** it an array of void* context pointers. The first argument passed to +@@ -8629,12 +8752,12 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** same callback function, then instead of invoking the callback function + ** multiple times, it is invoked once with the set of void* context pointers + ** specified by the blocked connections bundled together into an array. +-** This gives the application an opportunity to prioritize any actions ++** This gives the application an opportunity to prioritize any actions + ** related to the set of unblocked database connections. + ** + ** Deadlock Detection + ** +-** Assuming that after registering for an unlock-notify callback a ++** Assuming that after registering for an unlock-notify callback a + ** database waits for the callback to be issued before taking any further + ** action (a reasonable assumption), then using this API may cause the + ** application to deadlock. For example, if connection X is waiting for +@@ -8657,7 +8780,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** + ** The "DROP TABLE" Exception + ** +-** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost ++** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost + ** always appropriate to call sqlite3_unlock_notify(). There is however, + ** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, + ** SQLite checks if there are any currently executing SELECT statements +@@ -8670,15 +8793,16 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup* p); + ** One way around this problem is to check the extended error code returned + ** by an sqlite3_step() call. ^(If there is a blocking connection, then the + ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in +-** the special "DROP TABLE/INDEX" case, the extended error code is just ++** the special "DROP TABLE/INDEX" case, the extended error code is just + ** SQLITE_LOCKED.)^ + */ + SQLITE_API int sqlite3_unlock_notify( +- sqlite3* pBlocked, /* Waiting connection */ +- void (*xNotify)(void** apArg, int nArg), /* Callback function to invoke */ +- void* pNotifyArg /* Argument to pass to xNotify */ ++ sqlite3 *pBlocked, /* Waiting connection */ ++ void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ ++ void *pNotifyArg /* Argument to pass to xNotify */ + ); + ++ + /* + ** CAPI3REF: String Comparison + ** +@@ -8687,8 +8811,8 @@ SQLITE_API int sqlite3_unlock_notify( + ** strings in a case-independent fashion, using the same definition of "case + ** independence" that SQLite uses internally when comparing identifiers. + */ +-SQLITE_API int sqlite3_stricmp(const char*, const char*); +-SQLITE_API int sqlite3_strnicmp(const char*, const char*, int); ++SQLITE_API int sqlite3_stricmp(const char *, const char *); ++SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); + + /* + ** CAPI3REF: String Globbing +@@ -8705,7 +8829,7 @@ SQLITE_API int sqlite3_strnicmp(const char*, const char*, int); + ** + ** See also: [sqlite3_strlike()]. + */ +-SQLITE_API int sqlite3_strglob(const char* zGlob, const char* zStr); ++SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr); + + /* + ** CAPI3REF: String LIKE Matching +@@ -8728,8 +8852,7 @@ SQLITE_API int sqlite3_strglob(const char* zGlob, const char* zStr); + ** + ** See also: [sqlite3_strglob()]. + */ +-SQLITE_API int sqlite3_strlike(const char* zGlob, const char* zStr, +- unsigned int cEsc); ++SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); + + /* + ** CAPI3REF: Error Logging Interface +@@ -8752,7 +8875,7 @@ SQLITE_API int sqlite3_strlike(const char* zGlob, const char* zStr, + ** a few hundred characters, it will be truncated to the length of the + ** buffer. + */ +-SQLITE_API void sqlite3_log(int iErrCode, const char* zFormat, ...); ++SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); + + /* + ** CAPI3REF: Write-Ahead Log Commit Hook +@@ -8761,8 +8884,8 @@ SQLITE_API void sqlite3_log(int iErrCode, const char* zFormat, ...); + ** ^The [sqlite3_wal_hook()] function is used to register a callback that + ** is invoked each time data is committed to a database in wal mode. + ** +-** ^(The callback is invoked by SQLite after the commit has taken place and +-** the associated write-lock on the database released)^, so the implementation ++** ^(The callback is invoked by SQLite after the commit has taken place and ++** the associated write-lock on the database released)^, so the implementation + ** may read, write or [checkpoint] the database as required. + ** + ** ^The first parameter passed to the callback function when it is invoked +@@ -8781,16 +8904,18 @@ SQLITE_API void sqlite3_log(int iErrCode, const char* zFormat, ...); + ** that does not correspond to any valid SQLite error code, the results + ** are undefined. + ** +-** A single database handle may have at most a single write-ahead log callback ++** A single database handle may have at most a single write-ahead log callback + ** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any + ** previously registered write-ahead log callback. ^Note that the + ** [sqlite3_wal_autocheckpoint()] interface and the + ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will + ** overwrite any prior [sqlite3_wal_hook()] settings. + */ +-SQLITE_API void* sqlite3_wal_hook(sqlite3*, +- int (*)(void*, sqlite3*, const char*, int), +- void*); ++SQLITE_API void *sqlite3_wal_hook( ++ sqlite3*, ++ int(*)(void *,sqlite3*,const char*,int), ++ void* ++); + + /* + ** CAPI3REF: Configure an auto-checkpoint +@@ -8800,7 +8925,7 @@ SQLITE_API void* sqlite3_wal_hook(sqlite3*, + ** [sqlite3_wal_hook()] that causes any database on [database connection] D + ** to automatically [checkpoint] + ** after committing a transaction if there are N or +-** more frames in the [write-ahead log] file. ^Passing zero or ++** more frames in the [write-ahead log] file. ^Passing zero or + ** a negative value as the nFrame parameter disables automatic + ** checkpoints entirely. + ** +@@ -8821,7 +8946,7 @@ SQLITE_API void* sqlite3_wal_hook(sqlite3*, + ** is only necessary if the default setting is found to be suboptimal + ** for a particular application. + */ +-SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3* db, int N); ++SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); + + /* + ** CAPI3REF: Checkpoint a database +@@ -8830,7 +8955,7 @@ SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3* db, int N); + ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to + ** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ + ** +-** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the ++** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the + ** [write-ahead log] for database X on [database connection] D to be + ** transferred into the database file and for the write-ahead log to + ** be reset. See the [checkpointing] documentation for addition +@@ -8843,7 +8968,7 @@ SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3* db, int N); + ** start a callback but which do not need the full power (and corresponding + ** complication) of [sqlite3_wal_checkpoint_v2()]. + */ +-SQLITE_API int sqlite3_wal_checkpoint(sqlite3* db, const char* zDb); ++SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); + + /* + ** CAPI3REF: Checkpoint a database +@@ -8856,10 +8981,10 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3* db, const char* zDb); + ** + **
    + **
    SQLITE_CHECKPOINT_PASSIVE
    +-** ^Checkpoint as many frames as possible without waiting for any database +-** readers or writers to finish, then sync the database file if all frames ++** ^Checkpoint as many frames as possible without waiting for any database ++** readers or writers to finish, then sync the database file if all frames + ** in the log were checkpointed. ^The [busy-handler callback] +-** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. ++** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. + ** ^On the other hand, passive mode might leave the checkpoint unfinished + ** if there are concurrent readers or writers. + ** +@@ -8873,9 +8998,9 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3* db, const char* zDb); + ** + **
    SQLITE_CHECKPOINT_RESTART
    + ** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition +-** that after checkpointing the log file it blocks (calls the ++** that after checkpointing the log file it blocks (calls the + ** [busy-handler callback]) +-** until all readers are reading from the database file only. ^This ensures ++** until all readers are reading from the database file only. ^This ensures + ** that the next writer will restart the log file from the beginning. + ** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new + ** database writer attempts while it is pending, but does not impede readers. +@@ -8897,31 +9022,31 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3* db, const char* zDb); + ** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. + ** + ** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If +-** any other process is running a checkpoint operation at the same time, the +-** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a ++** any other process is running a checkpoint operation at the same time, the ++** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a + ** busy-handler configured, it will not be invoked in this case. + ** +-** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the ++** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the + ** exclusive "writer" lock on the database file. ^If the writer lock cannot be + ** obtained immediately, and a busy-handler is configured, it is invoked and + ** the writer lock retried until either the busy-handler returns 0 or the lock + ** is successfully obtained. ^The busy-handler is also invoked while waiting for + ** database readers as described above. ^If the busy-handler returns 0 before + ** the writer lock is obtained or while waiting for database readers, the +-** checkpoint operation proceeds from that point in the same way as +-** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible ++** checkpoint operation proceeds from that point in the same way as ++** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible + ** without blocking any further. ^SQLITE_BUSY is returned in this case. + ** + ** ^If parameter zDb is NULL or points to a zero length string, then the +-** specified operation is attempted on all WAL databases [attached] to ++** specified operation is attempted on all WAL databases [attached] to + ** [database connection] db. In this case the +-** values written to output parameters *pnLog and *pnCkpt are undefined. ^If +-** an SQLITE_BUSY error is encountered when processing one or more of the +-** attached WAL databases, the operation is still attempted on any remaining +-** attached databases and SQLITE_BUSY is returned at the end. ^If any other +-** error occurs while processing an attached database, processing is abandoned +-** and the error code is returned to the caller immediately. ^If no error +-** (SQLITE_BUSY or otherwise) is encountered while processing the attached ++** values written to output parameters *pnLog and *pnCkpt are undefined. ^If ++** an SQLITE_BUSY error is encountered when processing one or more of the ++** attached WAL databases, the operation is still attempted on any remaining ++** attached databases and SQLITE_BUSY is returned at the end. ^If any other ++** error occurs while processing an attached database, processing is abandoned ++** and the error code is returned to the caller immediately. ^If no error ++** (SQLITE_BUSY or otherwise) is encountered while processing the attached + ** databases, SQLITE_OK is returned. + ** + ** ^If database zDb is the name of an attached database that is not in WAL +@@ -8938,11 +9063,11 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3* db, const char* zDb); + ** from SQL. + */ + SQLITE_API int sqlite3_wal_checkpoint_v2( +- sqlite3* db, /* Database handle */ +- const char* zDb, /* Name of attached database (or NULL) */ +- int eMode, /* SQLITE_CHECKPOINT_* value */ +- int* pnLog, /* OUT: Size of WAL log in frames */ +- int* pnCkpt /* OUT: Total number of frames checkpointed */ ++ sqlite3 *db, /* Database handle */ ++ const char *zDb, /* Name of attached database (or NULL) */ ++ int eMode, /* SQLITE_CHECKPOINT_* value */ ++ int *pnLog, /* OUT: Size of WAL log in frames */ ++ int *pnCkpt /* OUT: Total number of frames checkpointed */ + ); + + /* +@@ -8954,12 +9079,10 @@ SQLITE_API int sqlite3_wal_checkpoint_v2( + ** See the [sqlite3_wal_checkpoint_v2()] documentation for details on the + ** meaning of each of these checkpoint modes. + */ +-# define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking \ +- */ +-# define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */ +-# define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */ +-# define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL \ +- */ ++#define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */ ++#define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */ ++#define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */ ++#define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */ + + /* + ** CAPI3REF: Virtual Table Interface Configuration +@@ -8983,7 +9106,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); + + /* + ** CAPI3REF: Virtual Table Configuration Options +-** KEYWORDS: {virtual table configuration options} ++** KEYWORDS: {virtual table configuration options} + ** KEYWORDS: {virtual table configuration option} + ** + ** These macros define the various options to the +@@ -9006,20 +9129,20 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); + ** If X is non-zero, then the virtual table implementation guarantees + ** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before + ** any modifications to internal or persistent data structures have been made. +-** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite ++** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite + ** is able to roll back a statement or database transaction, and abandon +-** or continue processing the current SQL statement as appropriate. ++** or continue processing the current SQL statement as appropriate. + ** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns + ** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode + ** had been ABORT. + ** + ** Virtual table implementations that are required to handle OR REPLACE +-** must do so within the [xUpdate] method. If a call to the +-** [sqlite3_vtab_on_conflict()] function indicates that the current ON +-** CONFLICT policy is REPLACE, the virtual table implementation should ++** must do so within the [xUpdate] method. If a call to the ++** [sqlite3_vtab_on_conflict()] function indicates that the current ON ++** CONFLICT policy is REPLACE, the virtual table implementation should + ** silently replace the appropriate rows within the xUpdate callback and + ** return SQLITE_OK. Or, if this is not possible, it may return +-** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT ++** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT + ** constraint handling. + **
    + ** +@@ -9043,9 +9166,9 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); + ** + **
    + */ +-# define SQLITE_VTAB_CONSTRAINT_SUPPORT 1 +-# define SQLITE_VTAB_INNOCUOUS 2 +-# define SQLITE_VTAB_DIRECTONLY 3 ++#define SQLITE_VTAB_CONSTRAINT_SUPPORT 1 ++#define SQLITE_VTAB_INNOCUOUS 2 ++#define SQLITE_VTAB_DIRECTONLY 3 + + /* + ** CAPI3REF: Determine The Virtual Table Conflict Policy +@@ -9057,7 +9180,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); + ** of the SQL statement that triggered the call to the [xUpdate] method of the + ** [virtual table]. + */ +-SQLITE_API int sqlite3_vtab_on_conflict(sqlite3*); ++SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *); + + /* + ** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE +@@ -9082,17 +9205,16 @@ SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*); + ** CAPI3REF: Determine The Collation For a Virtual Table Constraint + ** + ** This function may only be called from within a call to the [xBestIndex] +-** method of a [virtual table]. ++** method of a [virtual table]. + ** + ** The first argument must be the sqlite3_index_info object that is the + ** first parameter to the xBestIndex() method. The second argument must be + ** an index into the aConstraint[] array belonging to the sqlite3_index_info +-** structure passed to xBestIndex. This function returns a pointer to a buffer ++** structure passed to xBestIndex. This function returns a pointer to a buffer + ** containing the name of the collation sequence for the corresponding + ** constraint. + */ +-SQLITE_API SQLITE_EXPERIMENTAL const char* sqlite3_vtab_collation( +- sqlite3_index_info*, int); ++SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int); + + /* + ** CAPI3REF: Conflict resolution modes +@@ -9106,11 +9228,11 @@ SQLITE_API SQLITE_EXPERIMENTAL const char* sqlite3_vtab_collation( + ** return value from the [sqlite3_set_authorizer()] callback and that + ** [SQLITE_ABORT] is also a [result code]. + */ +-# define SQLITE_ROLLBACK 1 ++#define SQLITE_ROLLBACK 1 + /* #define SQLITE_IGNORE 2 // Also used by sqlite3_authorizer() callback */ +-# define SQLITE_FAIL 3 ++#define SQLITE_FAIL 3 + /* #define SQLITE_ABORT 4 // Also an error code */ +-# define SQLITE_REPLACE 5 ++#define SQLITE_REPLACE 5 + + /* + ** CAPI3REF: Prepared Statement Scan Status Opcodes +@@ -9159,12 +9281,12 @@ SQLITE_API SQLITE_EXPERIMENTAL const char* sqlite3_vtab_collation( + ** of an [EXPLAIN QUERY PLAN] query. + ** + */ +-# define SQLITE_SCANSTAT_NLOOP 0 +-# define SQLITE_SCANSTAT_NVISIT 1 +-# define SQLITE_SCANSTAT_EST 2 +-# define SQLITE_SCANSTAT_NAME 3 +-# define SQLITE_SCANSTAT_EXPLAIN 4 +-# define SQLITE_SCANSTAT_SELECTID 5 ++#define SQLITE_SCANSTAT_NLOOP 0 ++#define SQLITE_SCANSTAT_NVISIT 1 ++#define SQLITE_SCANSTAT_EST 2 ++#define SQLITE_SCANSTAT_NAME 3 ++#define SQLITE_SCANSTAT_EXPLAIN 4 ++#define SQLITE_SCANSTAT_SELECTID 5 + + /* + ** CAPI3REF: Prepared Statement Scan Status +@@ -9198,11 +9320,11 @@ SQLITE_API SQLITE_EXPERIMENTAL const char* sqlite3_vtab_collation( + ** See also: [sqlite3_stmt_scanstatus_reset()] + */ + SQLITE_API int sqlite3_stmt_scanstatus( +- sqlite3_stmt* pStmt, /* Prepared statement for which info desired */ +- int idx, /* Index of loop to report on */ +- int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ +- void* pOut /* Result written here */ +-); ++ sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ ++ int idx, /* Index of loop to report on */ ++ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ ++ void *pOut /* Result written here */ ++); + + /* + ** CAPI3REF: Zero Scan-Status Counters +@@ -9220,15 +9342,15 @@ SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); + ** + ** ^If a write-transaction is open on [database connection] D when the + ** [sqlite3_db_cacheflush(D)] interface invoked, any dirty +-** pages in the pager-cache that are not currently in use are written out ++** pages in the pager-cache that are not currently in use are written out + ** to disk. A dirty page may be in use if a database cursor created by an + ** active SQL statement is reading from it, or if it is page 1 of a database + ** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] + ** interface flushes caches for all schemas - "main", "temp", and + ** any [attached] databases. + ** +-** ^If this function needs to obtain extra database locks before dirty pages +-** can be flushed to disk, it does so. ^If those locks cannot be obtained ++** ^If this function needs to obtain extra database locks before dirty pages ++** can be flushed to disk, it does so. ^If those locks cannot be obtained + ** immediately and there is a busy-handler callback configured, it is invoked + ** in the usual manner. ^If the required lock still cannot be obtained, then + ** the database is skipped and an attempt made to flush any dirty pages +@@ -9275,16 +9397,16 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); + ** kind of update operation that is about to occur. + ** ^(The fourth parameter to the preupdate callback is the name of the + ** database within the database connection that is being modified. This +-** will be "main" for the main database or "temp" for TEMP tables or ++** will be "main" for the main database or "temp" for TEMP tables or + ** the name given after the AS keyword in the [ATTACH] statement for attached + ** databases.)^ + ** ^The fifth parameter to the preupdate callback is the name of the + ** table that is being modified. + ** + ** For an UPDATE or DELETE operation on a [rowid table], the sixth +-** parameter passed to the preupdate callback is the initial [rowid] of the ++** parameter passed to the preupdate callback is the initial [rowid] of the + ** row being modified or deleted. For an INSERT operation on a rowid table, +-** or any operation on a WITHOUT ROWID table, the value of the sixth ++** or any operation on a WITHOUT ROWID table, the value of the sixth + ** parameter is undefined. For an INSERT or UPDATE on a rowid table the + ** seventh parameter is the final rowid value of the row being inserted + ** or updated. The value of the seventh parameter passed to the callback +@@ -9323,30 +9445,31 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); + ** + ** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate + ** callback was invoked as a result of a direct insert, update, or delete +-** operation; or 1 for inserts, updates, or deletes invoked by top-level ++** operation; or 1 for inserts, updates, or deletes invoked by top-level + ** triggers; or 2 for changes resulting from triggers called by top-level + ** triggers; and so forth. + ** + ** See also: [sqlite3_update_hook()] + */ +-# if defined(SQLITE_ENABLE_PREUPDATE_HOOK) +-SQLITE_API void* sqlite3_preupdate_hook( +- sqlite3* db, +- void (*xPreUpdate)( +- void* pCtx, /* Copy of third arg to preupdate_hook() */ +- sqlite3* db, /* Database handle */ +- int op, /* SQLITE_UPDATE, DELETE or INSERT */ +- char const* zDb, /* Database name */ +- char const* zName, /* Table name */ +- sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ +- sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ +- ), +- void*); +-SQLITE_API int sqlite3_preupdate_old(sqlite3*, int, sqlite3_value**); +-SQLITE_API int sqlite3_preupdate_count(sqlite3*); +-SQLITE_API int sqlite3_preupdate_depth(sqlite3*); +-SQLITE_API int sqlite3_preupdate_new(sqlite3*, int, sqlite3_value**); +-# endif ++#if defined(SQLITE_ENABLE_PREUPDATE_HOOK) ++SQLITE_API void *sqlite3_preupdate_hook( ++ sqlite3 *db, ++ void(*xPreUpdate)( ++ void *pCtx, /* Copy of third arg to preupdate_hook() */ ++ sqlite3 *db, /* Database handle */ ++ int op, /* SQLITE_UPDATE, DELETE or INSERT */ ++ char const *zDb, /* Database name */ ++ char const *zName, /* Table name */ ++ sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ ++ sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ ++ ), ++ void* ++); ++SQLITE_API int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); ++SQLITE_API int sqlite3_preupdate_count(sqlite3 *); ++SQLITE_API int sqlite3_preupdate_depth(sqlite3 *); ++SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); ++#endif + + /* + ** CAPI3REF: Low-level system error code +@@ -9356,7 +9479,7 @@ SQLITE_API int sqlite3_preupdate_new(sqlite3*, int, sqlite3_value**); + ** The return value is OS-dependent. For example, on unix systems, after + ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be + ** called to get back the underlying "errno" that caused the problem, such +-** as ENOSPC, EAUTH, EISDIR, and so forth. ++** as ENOSPC, EAUTH, EISDIR, and so forth. + */ + SQLITE_API int sqlite3_system_errno(sqlite3*); + +@@ -9394,12 +9517,12 @@ typedef struct sqlite3_snapshot { + ** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly + ** created [sqlite3_snapshot] object into *P and returns SQLITE_OK. + ** If there is not already a read-transaction open on schema S when +-** this function is called, one is opened automatically. ++** this function is called, one is opened automatically. + ** + ** The following must be true for this function to succeed. If any of + ** the following statements are false when sqlite3_snapshot_get() is + ** called, SQLITE_ERROR is returned. The final value of *P is undefined +-** in this case. ++** in this case. + ** + **
      + **
    • The database handle must not be in [autocommit mode]. +@@ -9411,13 +9534,13 @@ typedef struct sqlite3_snapshot { + ** + **
    • One or more transactions must have been written to the current wal + ** file since it was created on disk (by any connection). This means +-** that a snapshot cannot be taken on a wal mode database with no wal ++** that a snapshot cannot be taken on a wal mode database with no wal + ** file immediately after it is first opened. At least one transaction + ** must be written to it first. + **
    + ** + ** This function may also return SQLITE_NOMEM. If it is called with the +-** database handle in autocommit mode but fails for some other reason, ++** database handle in autocommit mode but fails for some other reason, + ** whether or not a read transaction is opened on schema S is undefined. + ** + ** The [sqlite3_snapshot] object returned from a successful call to +@@ -9428,44 +9551,47 @@ typedef struct sqlite3_snapshot { + ** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. + */ + SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( +- sqlite3* db, const char* zSchema, sqlite3_snapshot** ppSnapshot); ++ sqlite3 *db, ++ const char *zSchema, ++ sqlite3_snapshot **ppSnapshot ++); + + /* + ** CAPI3REF: Start a read transaction on an historical snapshot + ** METHOD: sqlite3_snapshot + ** +-** ^The [sqlite3_snapshot_open(D,S,P)] interface either starts a new read +-** transaction or upgrades an existing one for schema S of +-** [database connection] D such that the read transaction refers to +-** historical [snapshot] P, rather than the most recent change to the +-** database. ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK ++** ^The [sqlite3_snapshot_open(D,S,P)] interface either starts a new read ++** transaction or upgrades an existing one for schema S of ++** [database connection] D such that the read transaction refers to ++** historical [snapshot] P, rather than the most recent change to the ++** database. ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK + ** on success or an appropriate [error code] if it fails. + ** +-** ^In order to succeed, the database connection must not be in ++** ^In order to succeed, the database connection must not be in + ** [autocommit mode] when [sqlite3_snapshot_open(D,S,P)] is called. If there + ** is already a read transaction open on schema S, then the database handle + ** must have no active statements (SELECT statements that have been passed +-** to sqlite3_step() but not sqlite3_reset() or sqlite3_finalize()). ++** to sqlite3_step() but not sqlite3_reset() or sqlite3_finalize()). + ** SQLITE_ERROR is returned if either of these conditions is violated, or + ** if schema S does not exist, or if the snapshot object is invalid. + ** + ** ^A call to sqlite3_snapshot_open() will fail to open if the specified +-** snapshot has been overwritten by a [checkpoint]. In this case ++** snapshot has been overwritten by a [checkpoint]. In this case + ** SQLITE_ERROR_SNAPSHOT is returned. + ** +-** If there is already a read transaction open when this function is ++** If there is already a read transaction open when this function is + ** invoked, then the same read transaction remains open (on the same + ** database snapshot) if SQLITE_ERROR, SQLITE_BUSY or SQLITE_ERROR_SNAPSHOT + ** is returned. If another error code - for example SQLITE_PROTOCOL or an + ** SQLITE_IOERR error code - is returned, then the final state of the +-** read transaction is undefined. If SQLITE_OK is returned, then the ++** read transaction is undefined. If SQLITE_OK is returned, then the + ** read transaction is now open on database snapshot P. + ** + ** ^(A call to [sqlite3_snapshot_open(D,S,P)] will fail if the + ** database connection D does not know that the database file for + ** schema S is in [WAL mode]. A database connection might not know + ** that the database file is in [WAL mode] if there has been no prior +-** I/O on that database connection, or if the database entered [WAL mode] ++** I/O on that database connection, or if the database entered [WAL mode] + ** after the most recent I/O on the database connection.)^ + ** (Hint: Run "[PRAGMA application_id]" against a newly opened + ** database connection in order to make it ready to use snapshots.) +@@ -9474,7 +9600,10 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( + ** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used. + */ + SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open( +- sqlite3* db, const char* zSchema, sqlite3_snapshot* pSnapshot); ++ sqlite3 *db, ++ const char *zSchema, ++ sqlite3_snapshot *pSnapshot ++); + + /* + ** CAPI3REF: Destroy a snapshot +@@ -9494,17 +9623,17 @@ SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); + ** METHOD: sqlite3_snapshot + ** + ** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages +-** of two valid snapshot handles. ++** of two valid snapshot handles. + ** +-** If the two snapshot handles are not associated with the same database +-** file, the result of the comparison is undefined. ++** If the two snapshot handles are not associated with the same database ++** file, the result of the comparison is undefined. + ** + ** Additionally, the result of the comparison is only valid if both of the + ** snapshot handles were obtained by calling sqlite3_snapshot_get() since the + ** last time the wal file was deleted. The wal file is deleted when the + ** database is changed back to rollback mode or when the number of database +-** clients drops to zero. If either snapshot handle was obtained before the +-** wal file was last deleted, the value returned by this function ++** clients drops to zero. If either snapshot handle was obtained before the ++** wal file was last deleted, the value returned by this function + ** is undefined. + ** + ** Otherwise, this API returns a negative value if P1 refers to an older +@@ -9514,8 +9643,10 @@ SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); + ** This interface is only available if SQLite is compiled with the + ** [SQLITE_ENABLE_SNAPSHOT] option. + */ +-SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(sqlite3_snapshot* p1, +- sqlite3_snapshot* p2); ++SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp( ++ sqlite3_snapshot *p1, ++ sqlite3_snapshot *p2 ++); + + /* + ** CAPI3REF: Recover snapshots from a wal file +@@ -9540,8 +9671,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(sqlite3_snapshot* p1, + ** This interface is only available if SQLite is compiled with the + ** [SQLITE_ENABLE_SNAPSHOT] option. + */ +-SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3* db, +- const char* zDb); ++SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb); + + /* + ** CAPI3REF: Serialize a database +@@ -9568,7 +9698,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3* db, + ** representation of the database will usually only exist if there has + ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same + ** values of D and S. +-** The size of the database is written into *P even if the ++** The size of the database is written into *P even if the + ** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy + ** of the database exists. + ** +@@ -9579,11 +9709,11 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3* db, + ** This interface is only available if SQLite is compiled with the + ** [SQLITE_ENABLE_DESERIALIZE] option. + */ +-SQLITE_API unsigned char* sqlite3_serialize( +- sqlite3* db, /* The database connection */ +- const char* zSchema, /* Which DB to serialize. ex: "main", "temp", ... */ +- sqlite3_int64* piSize, /* Write size of the DB here, if not NULL */ +- unsigned int mFlags /* Zero or more SQLITE_SERIALIZE_* flags */ ++SQLITE_API unsigned char *sqlite3_serialize( ++ sqlite3 *db, /* The database connection */ ++ const char *zSchema, /* Which DB to serialize. ex: "main", "temp", ... */ ++ sqlite3_int64 *piSize, /* Write size of the DB here, if not NULL */ ++ unsigned int mFlags /* Zero or more SQLITE_SERIALIZE_* flags */ + ); + + /* +@@ -9600,12 +9730,12 @@ SQLITE_API unsigned char* sqlite3_serialize( + ** using a contiguous in-memory database if it has been initialized by a + ** prior call to [sqlite3_deserialize()]. + */ +-# define SQLITE_SERIALIZE_NOCOPY 0x001 /* Do no memory allocations */ ++#define SQLITE_SERIALIZE_NOCOPY 0x001 /* Do no memory allocations */ + + /* + ** CAPI3REF: Deserialize a database + ** +-** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the ++** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the + ** [database connection] D to disconnect from database S and then + ** reopen S as an in-memory database based on the serialization contained + ** in P. The serialized database P is N bytes in size. M is the size of +@@ -9624,7 +9754,7 @@ SQLITE_API unsigned char* sqlite3_serialize( + ** database is currently in a read transaction or is involved in a backup + ** operation. + ** +-** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the ++** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the + ** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then + ** [sqlite3_free()] is invoked on argument P prior to returning. + ** +@@ -9632,12 +9762,12 @@ SQLITE_API unsigned char* sqlite3_serialize( + ** [SQLITE_ENABLE_DESERIALIZE] option. + */ + SQLITE_API int sqlite3_deserialize( +- sqlite3* db, /* The database connection */ +- const char* zSchema, /* Which DB to reopen with the deserialization */ +- unsigned char* pData, /* The serialized database content */ +- sqlite3_int64 szDb, /* Number bytes in the deserialization */ +- sqlite3_int64 szBuf, /* Total size of buffer pData[] */ +- unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ++ sqlite3 *db, /* The database connection */ ++ const char *zSchema, /* Which DB to reopen with the deserialization */ ++ unsigned char *pData, /* The serialized database content */ ++ sqlite3_int64 szDb, /* Number bytes in the deserialization */ ++ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ ++ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ + ); + + /* +@@ -9661,22 +9791,21 @@ SQLITE_API int sqlite3_deserialize( + ** The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database + ** should be treated as read-only. + */ +-# define SQLITE_DESERIALIZE_FREEONCLOSE 1 /* Call sqlite3_free() on close */ +-# define SQLITE_DESERIALIZE_RESIZEABLE 2 /* Resize using sqlite3_realloc64() \ +- */ +-# define SQLITE_DESERIALIZE_READONLY 4 /* Database is read-only */ ++#define SQLITE_DESERIALIZE_FREEONCLOSE 1 /* Call sqlite3_free() on close */ ++#define SQLITE_DESERIALIZE_RESIZEABLE 2 /* Resize using sqlite3_realloc64() */ ++#define SQLITE_DESERIALIZE_READONLY 4 /* Database is read-only */ + + /* + ** Undo the hack that converts floating point types to integer for + ** builds on processors without floating point support. + */ +-# ifdef SQLITE_OMIT_FLOATING_POINT +-# undef double +-# endif ++#ifdef SQLITE_OMIT_FLOATING_POINT ++# undef double ++#endif + +-# ifdef __cplusplus +-} /* End of the 'extern "C"' block */ +-# endif ++#ifdef __cplusplus ++} /* End of the 'extern "C"' block */ ++#endif + #endif /* SQLITE3_H */ + + /******** Begin file sqlite3rtree.h *********/ +@@ -9694,11 +9823,12 @@ SQLITE_API int sqlite3_deserialize( + */ + + #ifndef _SQLITE3RTREE_H_ +-# define _SQLITE3RTREE_H_ ++#define _SQLITE3RTREE_H_ + +-# ifdef __cplusplus ++ ++#ifdef __cplusplus + extern "C" { +-# endif ++#endif + + typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry; + typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info; +@@ -9706,11 +9836,11 @@ typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info; + /* The double-precision datatype used by RTree depends on the + ** SQLITE_RTREE_INT_ONLY compile-time option. + */ +-# ifdef SQLITE_RTREE_INT_ONLY +-typedef sqlite3_int64 sqlite3_rtree_dbl; +-# else +-typedef double sqlite3_rtree_dbl; +-# endif ++#ifdef SQLITE_RTREE_INT_ONLY ++ typedef sqlite3_int64 sqlite3_rtree_dbl; ++#else ++ typedef double sqlite3_rtree_dbl; ++#endif + + /* + ** Register a geometry callback named zGeom that can be used as part of an +@@ -9719,35 +9849,42 @@ typedef double sqlite3_rtree_dbl; + ** SELECT ... FROM WHERE MATCH $zGeom(... params ...) + */ + SQLITE_API int sqlite3_rtree_geometry_callback( +- sqlite3* db, const char* zGeom, +- int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*, int*), +- void* pContext); ++ sqlite3 *db, ++ const char *zGeom, ++ int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), ++ void *pContext ++); ++ + + /* + ** A pointer to a structure of the following type is passed as the first + ** argument to callbacks registered using rtree_geometry_callback(). + */ + struct sqlite3_rtree_geometry { +- void* pContext; /* Copy of pContext passed to s_r_g_c() */ +- int nParam; /* Size of array aParam[] */ +- sqlite3_rtree_dbl* aParam; /* Parameters passed to SQL geom function */ +- void* pUser; /* Callback implementation user data */ +- void (*xDelUser)(void*); /* Called by SQLite to clean up pUser */ ++ void *pContext; /* Copy of pContext passed to s_r_g_c() */ ++ int nParam; /* Size of array aParam[] */ ++ sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ ++ void *pUser; /* Callback implementation user data */ ++ void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ + }; + + /* +-** Register a 2nd-generation geometry callback named zScore that can be ++** Register a 2nd-generation geometry callback named zScore that can be + ** used as part of an R-Tree geometry query as follows: + ** + ** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) + */ + SQLITE_API int sqlite3_rtree_query_callback( +- sqlite3* db, const char* zQueryFunc, +- int (*xQueryFunc)(sqlite3_rtree_query_info*), void* pContext, +- void (*xDestructor)(void*)); ++ sqlite3 *db, ++ const char *zQueryFunc, ++ int (*xQueryFunc)(sqlite3_rtree_query_info*), ++ void *pContext, ++ void (*xDestructor)(void*) ++); ++ + + /* +-** A pointer to a structure of the following type is passed as the ++** A pointer to a structure of the following type is passed as the + ** argument to scored geometry callback registered using + ** sqlite3_rtree_query_callback(). + ** +@@ -9756,50 +9893,52 @@ SQLITE_API int sqlite3_rtree_query_callback( + ** sqlite3_rtree_geometry. + */ + struct sqlite3_rtree_query_info { +- void* pContext; /* pContext from when function registered */ +- int nParam; /* Number of function parameters */ +- sqlite3_rtree_dbl* aParam; /* value of function parameters */ +- void* pUser; /* callback can use this, if desired */ +- void (*xDelUser)(void*); /* function to free pUser */ +- sqlite3_rtree_dbl* aCoord; /* Coordinates of node or entry to check */ +- unsigned int* anQueue; /* Number of pending entries in the queue */ +- int nCoord; /* Number of coordinates */ +- int iLevel; /* Level of current node or entry */ +- int mxLevel; /* The largest iLevel value in the tree */ +- sqlite3_int64 iRowid; /* Rowid for current entry */ +- sqlite3_rtree_dbl rParentScore; /* Score of parent node */ +- int eParentWithin; /* Visibility of parent node */ +- int eWithin; /* OUT: Visibility */ +- sqlite3_rtree_dbl rScore; /* OUT: Write the score here */ ++ void *pContext; /* pContext from when function registered */ ++ int nParam; /* Number of function parameters */ ++ sqlite3_rtree_dbl *aParam; /* value of function parameters */ ++ void *pUser; /* callback can use this, if desired */ ++ void (*xDelUser)(void*); /* function to free pUser */ ++ sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ ++ unsigned int *anQueue; /* Number of pending entries in the queue */ ++ int nCoord; /* Number of coordinates */ ++ int iLevel; /* Level of current node or entry */ ++ int mxLevel; /* The largest iLevel value in the tree */ ++ sqlite3_int64 iRowid; /* Rowid for current entry */ ++ sqlite3_rtree_dbl rParentScore; /* Score of parent node */ ++ int eParentWithin; /* Visibility of parent node */ ++ int eWithin; /* OUT: Visibility */ ++ sqlite3_rtree_dbl rScore; /* OUT: Write the score here */ + /* The following fields are only available in 3.8.11 and later */ +- sqlite3_value** apSqlParam; /* Original SQL values of parameters */ ++ sqlite3_value **apSqlParam; /* Original SQL values of parameters */ + }; + + /* + ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. + */ +-# define NOT_WITHIN 0 /* Object completely outside of query region */ +-# define PARTLY_WITHIN 1 /* Object partially overlaps query region */ +-# define FULLY_WITHIN 2 /* Object fully contained within query region */ ++#define NOT_WITHIN 0 /* Object completely outside of query region */ ++#define PARTLY_WITHIN 1 /* Object partially overlaps query region */ ++#define FULLY_WITHIN 2 /* Object fully contained within query region */ ++ + +-# ifdef __cplusplus +-} /* end of the 'extern "C"' block */ +-# endif ++#ifdef __cplusplus ++} /* end of the 'extern "C"' block */ ++#endif + +-#endif /* ifndef _SQLITE3RTREE_H_ */ ++#endif /* ifndef _SQLITE3RTREE_H_ */ + + /******** End of sqlite3rtree.h *********/ + /******** Begin file sqlite3session.h *********/ + + #if !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) +-# define __SQLITESESSION_H_ 1 ++#define __SQLITESESSION_H_ 1 + + /* + ** Make sure we can call this stuff from C++. + */ +-# ifdef __cplusplus ++#ifdef __cplusplus + extern "C" { +-# endif ++#endif ++ + + /* + ** CAPI3REF: Session Object Handle +@@ -9840,7 +9979,7 @@ typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; + ** is not possible for an application to register a pre-update hook on a + ** database handle that has one or more session objects attached. Nor is + ** it possible to create a session object attached to a database handle for +-** which a pre-update hook is already defined. The results of attempting ++** which a pre-update hook is already defined. The results of attempting + ** either of these things are undefined. + ** + ** The session object will be used to create changesets for tables in +@@ -9849,25 +9988,26 @@ typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; + ** to the database when the session object is created. + */ + SQLITE_API int sqlite3session_create( +- sqlite3* db, /* Database handle */ +- const char* zDb, /* Name of db (e.g. "main") */ +- sqlite3_session** ppSession /* OUT: New session object */ ++ sqlite3 *db, /* Database handle */ ++ const char *zDb, /* Name of db (e.g. "main") */ ++ sqlite3_session **ppSession /* OUT: New session object */ + ); + + /* + ** CAPI3REF: Delete A Session Object + ** DESTRUCTOR: sqlite3_session + ** +-** Delete a session object previously allocated using ++** Delete a session object previously allocated using + ** [sqlite3session_create()]. Once a session object has been deleted, the + ** results of attempting to use pSession with any other session module + ** function are undefined. + ** + ** Session objects must be deleted before the database handle to which they +-** are attached is closed. Refer to the documentation for ++** are attached is closed. Refer to the documentation for + ** [sqlite3session_create()] for details. + */ +-SQLITE_API void sqlite3session_delete(sqlite3_session* pSession); ++SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); ++ + + /* + ** CAPI3REF: Enable Or Disable A Session Object +@@ -9881,13 +10021,13 @@ SQLITE_API void sqlite3session_delete(sqlite3_session* pSession); + ** the eventual changesets. + ** + ** Passing zero to this function disables the session. Passing a value +-** greater than zero enables it. Passing a value less than zero is a ++** greater than zero enables it. Passing a value less than zero is a + ** no-op, and may be used to query the current state of the session. + ** +-** The return value indicates the final state of the session object: 0 if ++** The return value indicates the final state of the session object: 0 if + ** the session is disabled, or 1 if it is enabled. + */ +-SQLITE_API int sqlite3session_enable(sqlite3_session* pSession, int bEnable); ++SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); + + /* + ** CAPI3REF: Set Or Clear the Indirect Change Flag +@@ -9899,7 +10039,7 @@ SQLITE_API int sqlite3session_enable(sqlite3_session* pSession, int bEnable); + **
      + **
    • The session object "indirect" flag is set when the change is + ** made, or +-**
    • The change is made by an SQL trigger or foreign key action ++**
    • The change is made by an SQL trigger or foreign key action + ** instead of directly as a result of a users SQL statement. + **
    + ** +@@ -9911,34 +10051,33 @@ SQLITE_API int sqlite3session_enable(sqlite3_session* pSession, int bEnable); + ** flag. If the second argument passed to this function is zero, then the + ** indirect flag is cleared. If it is greater than zero, the indirect flag + ** is set. Passing a value less than zero does not modify the current value +-** of the indirect flag, and may be used to query the current state of the ++** of the indirect flag, and may be used to query the current state of the + ** indirect flag for the specified session object. + ** +-** The return value indicates the final state of the indirect flag: 0 if ++** The return value indicates the final state of the indirect flag: 0 if + ** it is clear, or 1 if it is set. + */ +-SQLITE_API int sqlite3session_indirect(sqlite3_session* pSession, +- int bIndirect); ++SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); + + /* + ** CAPI3REF: Attach A Table To A Session Object + ** METHOD: sqlite3_session + ** + ** If argument zTab is not NULL, then it is the name of a table to attach +-** to the session object passed as the first argument. All subsequent changes +-** made to the table while the session object is enabled will be recorded. See ++** to the session object passed as the first argument. All subsequent changes ++** made to the table while the session object is enabled will be recorded. See + ** documentation for [sqlite3session_changeset()] for further details. + ** + ** Or, if argument zTab is NULL, then changes are recorded for all tables +-** in the database. If additional tables are added to the database (by +-** executing "CREATE TABLE" statements) after this call is made, changes for ++** in the database. If additional tables are added to the database (by ++** executing "CREATE TABLE" statements) after this call is made, changes for + ** the new tables are also recorded. + ** + ** Changes can only be recorded for tables that have a PRIMARY KEY explicitly +-** defined as part of their CREATE TABLE statement. It does not matter if the ++** defined as part of their CREATE TABLE statement. It does not matter if the + ** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY + ** KEY may consist of a single column, or may be a composite key. +-** ++** + ** It is not an error if the named table does not exist in the database. Nor + ** is it an error if the named table does not have a PRIMARY KEY. However, + ** no changes will be recorded in either of these scenarios. +@@ -9946,29 +10085,29 @@ SQLITE_API int sqlite3session_indirect(sqlite3_session* pSession, + ** Changes are not recorded for individual rows that have NULL values stored + ** in one or more of their PRIMARY KEY columns. + ** +-** SQLITE_OK is returned if the call completes without error. Or, if an error ++** SQLITE_OK is returned if the call completes without error. Or, if an error + ** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. + ** + **

    Special sqlite_stat1 Handling

    + ** +-** As of SQLite version 3.22.0, the "sqlite_stat1" table is an exception to ++** As of SQLite version 3.22.0, the "sqlite_stat1" table is an exception to + ** some of the rules above. In SQLite, the schema of sqlite_stat1 is: + **
    +-**        CREATE TABLE sqlite_stat1(tbl,idx,stat)
    ++**        CREATE TABLE sqlite_stat1(tbl,idx,stat)  
    + **  
    + ** +-** Even though sqlite_stat1 does not have a PRIMARY KEY, changes are +-** recorded for it as if the PRIMARY KEY is (tbl,idx). Additionally, changes ++** Even though sqlite_stat1 does not have a PRIMARY KEY, changes are ++** recorded for it as if the PRIMARY KEY is (tbl,idx). Additionally, changes + ** are recorded for rows for which (idx IS NULL) is true. However, for such + ** rows a zero-length blob (SQL value X'') is stored in the changeset or + ** patchset instead of a NULL value. This allows such changesets to be + ** manipulated by legacy implementations of sqlite3changeset_invert(), + ** concat() and similar. + ** +-** The sqlite3changeset_apply() function automatically converts the ++** The sqlite3changeset_apply() function automatically converts the + ** zero-length blob back to a NULL value when updating the sqlite_stat1 + ** table. However, if the application calls sqlite3changeset_new(), +-** sqlite3changeset_old() or sqlite3changeset_conflict on a changeset ++** sqlite3changeset_old() or sqlite3changeset_conflict on a changeset + ** iterator directly (including on a changeset iterator passed to a + ** conflict-handler callback) then the X'' value is returned. The application + ** must translate X'' to NULL itself if required. +@@ -9979,35 +10118,36 @@ SQLITE_API int sqlite3session_indirect(sqlite3_session* pSession, + ** sqlite_stat1 table that are part of a changeset or patchset. + */ + SQLITE_API int sqlite3session_attach( +- sqlite3_session* pSession, /* Session object */ +- const char* zTab /* Table name */ ++ sqlite3_session *pSession, /* Session object */ ++ const char *zTab /* Table name */ + ); + + /* + ** CAPI3REF: Set a table filter on a Session Object. + ** METHOD: sqlite3_session + ** +-** The second argument (xFilter) is the "filter callback". For changes to rows ++** The second argument (xFilter) is the "filter callback". For changes to rows + ** in tables that are not attached to the Session object, the filter is called +-** to determine whether changes to the table's rows should be tracked or not. +-** If xFilter returns 0, changes are not tracked. Note that once a table is ++** to determine whether changes to the table's rows should be tracked or not. ++** If xFilter returns 0, changes are not tracked. Note that once a table is + ** attached, xFilter will not be called again. + */ + SQLITE_API void sqlite3session_table_filter( +- sqlite3_session* pSession, /* Session object */ +- int (*xFilter)(void* pCtx, /* Copy of third arg to _filter_table() */ +- const char* zTab /* Table name */ +- ), +- void* pCtx /* First argument passed to xFilter */ ++ sqlite3_session *pSession, /* Session object */ ++ int(*xFilter)( ++ void *pCtx, /* Copy of third arg to _filter_table() */ ++ const char *zTab /* Table name */ ++ ), ++ void *pCtx /* First argument passed to xFilter */ + ); + + /* + ** CAPI3REF: Generate A Changeset From A Session Object + ** METHOD: sqlite3_session + ** +-** Obtain a changeset containing changes to the tables attached to the +-** session object passed as the first argument. If successful, +-** set *ppChangeset to point to a buffer containing the changeset ++** Obtain a changeset containing changes to the tables attached to the ++** session object passed as the first argument. If successful, ++** set *ppChangeset to point to a buffer containing the changeset + ** and *pnChangeset to the size of the changeset in bytes before returning + ** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to + ** zero and return an SQLite error code. +@@ -10022,7 +10162,7 @@ SQLITE_API void sqlite3session_table_filter( + ** modifies the values of primary key columns. If such a change is made, it + ** is represented in a changeset as a DELETE followed by an INSERT. + ** +-** Changes are not recorded for rows that have NULL values stored in one or ++** Changes are not recorded for rows that have NULL values stored in one or + ** more of their PRIMARY KEY columns. If such a row is inserted or deleted, + ** no corresponding change is present in the changesets returned by this + ** function. If an existing row with one or more NULL values stored in +@@ -10075,14 +10215,14 @@ SQLITE_API void sqlite3session_table_filter( + **
      + **
    • For each record generated by an insert, the database is queried + ** for a row with a matching primary key. If one is found, an INSERT +-** change is added to the changeset. If no such row is found, no change ++** change is added to the changeset. If no such row is found, no change + ** is added to the changeset. + ** +-**
    • For each record generated by an update or delete, the database is ++**
    • For each record generated by an update or delete, the database is + ** queried for a row with a matching primary key. If such a row is + ** found and one or more of the non-primary key fields have been +-** modified from their original values, an UPDATE change is added to +-** the changeset. Or, if no such row is found in the table, a DELETE ++** modified from their original values, an UPDATE change is added to ++** the changeset. Or, if no such row is found in the table, a DELETE + ** change is added to the changeset. If there is a row with a matching + ** primary key in the database, but all fields contain their original + ** values, no change is added to the changeset. +@@ -10090,7 +10230,7 @@ SQLITE_API void sqlite3session_table_filter( + ** + ** This means, amongst other things, that if a row is inserted and then later + ** deleted while a session object is active, neither the insert nor the delete +-** will be present in the changeset. Or if a row is deleted and then later a ++** will be present in the changeset. Or if a row is deleted and then later a + ** row with the same primary key values inserted while a session object is + ** active, the resulting changeset will contain an UPDATE change instead of + ** a DELETE and an INSERT. +@@ -10099,17 +10239,17 @@ SQLITE_API void sqlite3session_table_filter( + ** it does not accumulate records when rows are inserted, updated or deleted. + ** This may appear to have some counter-intuitive effects if a single row + ** is written to more than once during a session. For example, if a row +-** is inserted while a session object is enabled, then later deleted while ++** is inserted while a session object is enabled, then later deleted while + ** the same session object is disabled, no INSERT record will appear in the + ** changeset, even though the delete took place while the session was disabled. +-** Or, if one field of a row is updated while a session is disabled, and ++** Or, if one field of a row is updated while a session is disabled, and + ** another field of the same row is updated while the session is enabled, the + ** resulting changeset will contain an UPDATE change that updates both fields. + */ + SQLITE_API int sqlite3session_changeset( +- sqlite3_session* pSession, /* Session object */ +- int* pnChangeset, /* OUT: Size of buffer at *ppChangeset */ +- void** ppChangeset /* OUT: Buffer containing changeset */ ++ sqlite3_session *pSession, /* Session object */ ++ int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ ++ void **ppChangeset /* OUT: Buffer containing changeset */ + ); + + /* +@@ -10123,7 +10263,7 @@ SQLITE_API int sqlite3session_changeset( + ** an error). + ** + ** Argument zFromDb must be the name of a database ("main", "temp" etc.) +-** attached to the same database handle as the session object that contains ++** attached to the same database handle as the session object that contains + ** a table compatible with the table attached to the session by this function. + ** A table is considered compatible if it: + ** +@@ -10139,25 +10279,25 @@ SQLITE_API int sqlite3session_changeset( + ** APIs, tables without PRIMARY KEYs are simply ignored. + ** + ** This function adds a set of changes to the session object that could be +-** used to update the table in database zFrom (call this the "from-table") +-** so that its content is the same as the table attached to the session ++** used to update the table in database zFrom (call this the "from-table") ++** so that its content is the same as the table attached to the session + ** object (call this the "to-table"). Specifically: + ** + **
        +-**
      • For each row (primary key) that exists in the to-table but not in ++**
      • For each row (primary key) that exists in the to-table but not in + ** the from-table, an INSERT record is added to the session object. + ** +-**
      • For each row (primary key) that exists in the to-table but not in ++**
      • For each row (primary key) that exists in the to-table but not in + ** the from-table, a DELETE record is added to the session object. + ** +-**
      • For each row (primary key) that exists in both tables, but features ++**
      • For each row (primary key) that exists in both tables, but features + ** different non-PK values in each, an UPDATE record is added to the +-** session. ++** session. + **
      + ** + ** To clarify, if this function is called and then a changeset constructed +-** using [sqlite3session_changeset()], then after applying that changeset to +-** database zFrom the contents of the two compatible tables would be ++** using [sqlite3session_changeset()], then after applying that changeset to ++** database zFrom the contents of the two compatible tables would be + ** identical. + ** + ** It an error if database zFrom does not exist or does not contain the +@@ -10165,13 +10305,17 @@ SQLITE_API int sqlite3session_changeset( + ** + ** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite + ** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg +-** may be set to point to a buffer containing an English language error ++** may be set to point to a buffer containing an English language error + ** message. It is the responsibility of the caller to free this buffer using + ** sqlite3_free(). + */ +-SQLITE_API int sqlite3session_diff(sqlite3_session* pSession, +- const char* zFromDb, const char* zTbl, +- char** pzErrMsg); ++SQLITE_API int sqlite3session_diff( ++ sqlite3_session *pSession, ++ const char *zFromDb, ++ const char *zTbl, ++ char **pzErrMsg ++); ++ + + /* + ** CAPI3REF: Generate A Patchset From A Session Object +@@ -10180,19 +10324,19 @@ SQLITE_API int sqlite3session_diff(sqlite3_session* pSession, + ** The differences between a patchset and a changeset are that: + ** + **
        +-**
      • DELETE records consist of the primary key fields only. The ++**
      • DELETE records consist of the primary key fields only. The + ** original values of other fields are omitted. +-**
      • The original values of any modified fields are omitted from ++**
      • The original values of any modified fields are omitted from + ** UPDATE records. + **
      + ** +-** A patchset blob may be used with up to date versions of all +-** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), ++** A patchset blob may be used with up to date versions of all ++** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), + ** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly, + ** attempting to use a patchset blob with old versions of the +-** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. ++** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. + ** +-** Because the non-primary key "old.*" fields are omitted, no ++** Because the non-primary key "old.*" fields are omitted, no + ** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset + ** is passed to the sqlite3changeset_apply() API. Other conflict types work + ** in the same way as for changesets. +@@ -10203,30 +10347,30 @@ SQLITE_API int sqlite3session_diff(sqlite3_session* pSession, + ** they were attached to the session object). + */ + SQLITE_API int sqlite3session_patchset( +- sqlite3_session* pSession, /* Session object */ +- int* pnPatchset, /* OUT: Size of buffer at *ppPatchset */ +- void** ppPatchset /* OUT: Buffer containing patchset */ ++ sqlite3_session *pSession, /* Session object */ ++ int *pnPatchset, /* OUT: Size of buffer at *ppPatchset */ ++ void **ppPatchset /* OUT: Buffer containing patchset */ + ); + + /* + ** CAPI3REF: Test if a changeset has recorded any changes. + ** +-** Return non-zero if no changes to attached tables have been recorded by +-** the session object passed as the first argument. Otherwise, if one or ++** Return non-zero if no changes to attached tables have been recorded by ++** the session object passed as the first argument. Otherwise, if one or + ** more changes have been recorded, return zero. + ** + ** Even if this function returns zero, it is possible that calling + ** [sqlite3session_changeset()] on the session handle may still return a +-** changeset that contains no changes. This can happen when a row in +-** an attached table is modified and then later on the original values ++** changeset that contains no changes. This can happen when a row in ++** an attached table is modified and then later on the original values + ** are restored. However, if this function returns non-zero, then it is +-** guaranteed that a call to sqlite3session_changeset() will return a ++** guaranteed that a call to sqlite3session_changeset() will return a + ** changeset containing zero changes. + */ +-SQLITE_API int sqlite3session_isempty(sqlite3_session* pSession); ++SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); + + /* +-** CAPI3REF: Create An Iterator To Traverse A Changeset ++** CAPI3REF: Create An Iterator To Traverse A Changeset + ** CONSTRUCTOR: sqlite3_changeset_iter + ** + ** Create an iterator used to iterate through the contents of a changeset. +@@ -10234,7 +10378,7 @@ SQLITE_API int sqlite3session_isempty(sqlite3_session* pSession); + ** is returned. Otherwise, if an error occurs, *pp is set to zero and an + ** SQLite error code is returned. + ** +-** The following functions can be used to advance and query a changeset ++** The following functions can be used to advance and query a changeset + ** iterator created by this function: + ** + **
        +@@ -10251,12 +10395,12 @@ SQLITE_API int sqlite3session_isempty(sqlite3_session* pSession); + ** + ** Assuming the changeset blob was created by one of the + ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or +-** [sqlite3changeset_invert()] functions, all changes within the changeset +-** that apply to a single table are grouped together. This means that when +-** an application iterates through a changeset using an iterator created by +-** this function, all changes that relate to a single table are visited +-** consecutively. There is no chance that the iterator will visit a change +-** the applies to table X, then one for table Y, and then later on visit ++** [sqlite3changeset_invert()] functions, all changes within the changeset ++** that apply to a single table are grouped together. This means that when ++** an application iterates through a changeset using an iterator created by ++** this function, all changes that relate to a single table are visited ++** consecutively. There is no chance that the iterator will visit a change ++** the applies to table X, then one for table Y, and then later on visit + ** another change for table X. + ** + ** The behavior of sqlite3changeset_start_v2() and its streaming equivalent +@@ -10267,15 +10411,15 @@ SQLITE_API int sqlite3session_isempty(sqlite3_session* pSession); + ** and therefore subject to change. + */ + SQLITE_API int sqlite3changeset_start( +- sqlite3_changeset_iter** pp, /* OUT: New changeset iterator handle */ +- int nChangeset, /* Size of changeset blob in bytes */ +- void* pChangeset /* Pointer to blob containing changeset */ ++ sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ ++ int nChangeset, /* Size of changeset blob in bytes */ ++ void *pChangeset /* Pointer to blob containing changeset */ + ); + SQLITE_API int sqlite3changeset_start_v2( +- sqlite3_changeset_iter** pp, /* OUT: New changeset iterator handle */ +- int nChangeset, /* Size of changeset blob in bytes */ +- void* pChangeset, /* Pointer to blob containing changeset */ +- int flags /* SESSION_CHANGESETSTART_* flags */ ++ sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ ++ int nChangeset, /* Size of changeset blob in bytes */ ++ void *pChangeset, /* Pointer to blob containing changeset */ ++ int flags /* SESSION_CHANGESETSTART_* flags */ + ); + + /* +@@ -10289,7 +10433,8 @@ SQLITE_API int sqlite3changeset_start_v2( + ** inverting a changeset using sqlite3changeset_invert() before applying it. + ** It is an error to specify this flag with a patchset. + */ +-# define SQLITE_CHANGESETSTART_INVERT 0x0002 ++#define SQLITE_CHANGESETSTART_INVERT 0x0002 ++ + + /* + ** CAPI3REF: Advance A Changeset Iterator +@@ -10306,15 +10451,15 @@ SQLITE_API int sqlite3changeset_start_v2( + ** point to the first change in the changeset. Each subsequent call advances + ** the iterator to point to the next change in the changeset (if any). If + ** no error occurs and the iterator points to a valid change after a call +-** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. ++** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. + ** Otherwise, if all changes in the changeset have already been visited, + ** SQLITE_DONE is returned. + ** +-** If an error occurs, an SQLite error code is returned. Possible error +-** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or ++** If an error occurs, an SQLite error code is returned. Possible error ++** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or + ** SQLITE_NOMEM. + */ +-SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter* pIter); ++SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); + + /* + ** CAPI3REF: Obtain The Current Operation From A Changeset Iterator +@@ -10329,14 +10474,14 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter* pIter); + ** If argument pzTab is not NULL, then *pzTab is set to point to a + ** nul-terminated utf-8 encoded string containing the name of the table + ** affected by the current change. The buffer remains valid until either +-** sqlite3changeset_next() is called on the iterator or until the +-** conflict-handler function returns. If pnCol is not NULL, then *pnCol is ++** sqlite3changeset_next() is called on the iterator or until the ++** conflict-handler function returns. If pnCol is not NULL, then *pnCol is + ** set to the number of columns in the table affected by the change. If + ** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change + ** is an indirect change, or false (0) otherwise. See the documentation for + ** [sqlite3session_indirect()] for a description of direct and indirect +-** changes. Finally, if pOp is not NULL, then *pOp is set to one of +-** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the ++** changes. Finally, if pOp is not NULL, then *pOp is set to one of ++** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the + ** type of change that the iterator currently points to. + ** + ** If no error occurs, SQLITE_OK is returned. If an error does occur, an +@@ -10344,11 +10489,11 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter* pIter); + ** be trusted in this case. + */ + SQLITE_API int sqlite3changeset_op( +- sqlite3_changeset_iter* pIter, /* Iterator object */ +- const char** pzTab, /* OUT: Pointer to table name */ +- int* pnCol, /* OUT: Number of columns in table */ +- int* pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ +- int* pbIndirect /* OUT: True for an 'indirect' change */ ++ sqlite3_changeset_iter *pIter, /* Iterator object */ ++ const char **pzTab, /* OUT: Pointer to table name */ ++ int *pnCol, /* OUT: Number of columns in table */ ++ int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ ++ int *pbIndirect /* OUT: True for an 'indirect' change */ + ); + + /* +@@ -10378,9 +10523,9 @@ SQLITE_API int sqlite3changeset_op( + ** above. + */ + SQLITE_API int sqlite3changeset_pk( +- sqlite3_changeset_iter* pIter, /* Iterator object */ +- unsigned char** pabPK, /* OUT: Array of boolean - true for PK cols */ +- int* pnCol /* OUT: Number of entries in output array */ ++ sqlite3_changeset_iter *pIter, /* Iterator object */ ++ unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ ++ int *pnCol /* OUT: Number of entries in output array */ + ); + + /* +@@ -10390,7 +10535,7 @@ SQLITE_API int sqlite3changeset_pk( + ** The pIter argument passed to this function may either be an iterator + ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator + ** created by [sqlite3changeset_start()]. In the latter case, the most recent +-** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ++** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. + ** Furthermore, it may only be called if the type of change that the iterator + ** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise, + ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. +@@ -10400,18 +10545,18 @@ SQLITE_API int sqlite3changeset_pk( + ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. + ** + ** If successful, this function sets *ppValue to point to a protected +-** sqlite3_value object containing the iVal'th value from the vector of ++** sqlite3_value object containing the iVal'th value from the vector of + ** original row values stored as part of the UPDATE or DELETE change and +-** returns SQLITE_OK. The name of the function comes from the fact that this ++** returns SQLITE_OK. The name of the function comes from the fact that this + ** is similar to the "old.*" columns available to update or delete triggers. + ** + ** If some other error occurs (e.g. an OOM condition), an SQLite error code + ** is returned and *ppValue is set to NULL. + */ + SQLITE_API int sqlite3changeset_old( +- sqlite3_changeset_iter* pIter, /* Changeset iterator */ +- int iVal, /* Column number */ +- sqlite3_value** ppValue /* OUT: Old value (or NULL pointer) */ ++ sqlite3_changeset_iter *pIter, /* Changeset iterator */ ++ int iVal, /* Column number */ ++ sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ + ); + + /* +@@ -10421,7 +10566,7 @@ SQLITE_API int sqlite3changeset_old( + ** The pIter argument passed to this function may either be an iterator + ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator + ** created by [sqlite3changeset_start()]. In the latter case, the most recent +-** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ++** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. + ** Furthermore, it may only be called if the type of change that the iterator + ** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise, + ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. +@@ -10431,21 +10576,21 @@ SQLITE_API int sqlite3changeset_old( + ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. + ** + ** If successful, this function sets *ppValue to point to a protected +-** sqlite3_value object containing the iVal'th value from the vector of ++** sqlite3_value object containing the iVal'th value from the vector of + ** new row values stored as part of the UPDATE or INSERT change and + ** returns SQLITE_OK. If the change is an UPDATE and does not include +-** a new value for the requested column, *ppValue is set to NULL and +-** SQLITE_OK returned. The name of the function comes from the fact that +-** this is similar to the "new.*" columns available to update or delete ++** a new value for the requested column, *ppValue is set to NULL and ++** SQLITE_OK returned. The name of the function comes from the fact that ++** this is similar to the "new.*" columns available to update or delete + ** triggers. + ** + ** If some other error occurs (e.g. an OOM condition), an SQLite error code + ** is returned and *ppValue is set to NULL. + */ + SQLITE_API int sqlite3changeset_new( +- sqlite3_changeset_iter* pIter, /* Changeset iterator */ +- int iVal, /* Column number */ +- sqlite3_value** ppValue /* OUT: New value (or NULL pointer) */ ++ sqlite3_changeset_iter *pIter, /* Changeset iterator */ ++ int iVal, /* Column number */ ++ sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ + ); + + /* +@@ -10463,7 +10608,7 @@ SQLITE_API int sqlite3changeset_new( + ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. + ** + ** If successful, this function sets *ppValue to point to a protected +-** sqlite3_value object containing the iVal'th value from the ++** sqlite3_value object containing the iVal'th value from the + ** "conflicting row" associated with the current conflict-handler callback + ** and returns SQLITE_OK. + ** +@@ -10471,9 +10616,9 @@ SQLITE_API int sqlite3changeset_new( + ** is returned and *ppValue is set to NULL. + */ + SQLITE_API int sqlite3changeset_conflict( +- sqlite3_changeset_iter* pIter, /* Changeset iterator */ +- int iVal, /* Column number */ +- sqlite3_value** ppValue /* OUT: Value from conflicting row */ ++ sqlite3_changeset_iter *pIter, /* Changeset iterator */ ++ int iVal, /* Column number */ ++ sqlite3_value **ppValue /* OUT: Value from conflicting row */ + ); + + /* +@@ -10488,10 +10633,11 @@ SQLITE_API int sqlite3changeset_conflict( + ** In all other cases this function returns SQLITE_MISUSE. + */ + SQLITE_API int sqlite3changeset_fk_conflicts( +- sqlite3_changeset_iter* pIter, /* Changeset iterator */ +- int* pnOut /* OUT: Number of FK violations */ ++ sqlite3_changeset_iter *pIter, /* Changeset iterator */ ++ int *pnOut /* OUT: Number of FK violations */ + ); + ++ + /* + ** CAPI3REF: Finalize A Changeset Iterator + ** METHOD: sqlite3_changeset_iter +@@ -10506,7 +10652,7 @@ SQLITE_API int sqlite3changeset_fk_conflicts( + ** call has no effect. + ** + ** If an error was encountered within a call to an sqlite3changeset_xxx() +-** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an ++** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an + ** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding + ** to that error is returned by this function. Otherwise, SQLITE_OK is + ** returned. This is to allow the following pattern (pseudo-code): +@@ -10518,11 +10664,11 @@ SQLITE_API int sqlite3changeset_fk_conflicts( + ** } + ** rc = sqlite3changeset_finalize(); + ** if( rc!=SQLITE_OK ){ +-** // An error has occurred ++** // An error has occurred + ** } + ** + */ +-SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter* pIter); ++SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); + + /* + ** CAPI3REF: Invert A Changeset +@@ -10546,26 +10692,25 @@ SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter* pIter); + ** zeroed and an SQLite error code returned. + ** + ** It is the responsibility of the caller to eventually call sqlite3_free() +-** on the *ppOut pointer to free the buffer allocation following a successful ++** on the *ppOut pointer to free the buffer allocation following a successful + ** call to this function. + ** + ** WARNING/TODO: This function currently assumes that the input is a valid + ** changeset. If it is not, the results are undefined. + */ +-SQLITE_API int sqlite3changeset_invert(int nIn, +- const void* pIn, /* Input changeset */ +- int* pnOut, +- void** ppOut /* OUT: Inverse of input */ ++SQLITE_API int sqlite3changeset_invert( ++ int nIn, const void *pIn, /* Input changeset */ ++ int *pnOut, void **ppOut /* OUT: Inverse of input */ + ); + + /* + ** CAPI3REF: Concatenate Two Changeset Objects + ** +-** This function is used to concatenate two changesets, A and B, into a ++** This function is used to concatenate two changesets, A and B, into a + ** single changeset. The result is a changeset equivalent to applying +-** changeset A followed by changeset B. ++** changeset A followed by changeset B. + ** +-** This function combines the two input changesets using an ++** This function combines the two input changesets using an + ** sqlite3_changegroup object. Calling it produces similar results as the + ** following code fragment: + ** +@@ -10585,18 +10730,19 @@ SQLITE_API int sqlite3changeset_invert(int nIn, + ** Refer to the sqlite3_changegroup documentation below for details. + */ + SQLITE_API int sqlite3changeset_concat( +- int nA, /* Number of bytes in buffer pA */ +- void* pA, /* Pointer to buffer containing changeset A */ +- int nB, /* Number of bytes in buffer pB */ +- void* pB, /* Pointer to buffer containing changeset B */ +- int* pnOut, /* OUT: Number of bytes in output changeset */ +- void** ppOut /* OUT: Buffer containing output changeset */ ++ int nA, /* Number of bytes in buffer pA */ ++ void *pA, /* Pointer to buffer containing changeset A */ ++ int nB, /* Number of bytes in buffer pB */ ++ void *pB, /* Pointer to buffer containing changeset B */ ++ int *pnOut, /* OUT: Number of bytes in output changeset */ ++ void **ppOut /* OUT: Buffer containing output changeset */ + ); + ++ + /* + ** CAPI3REF: Changegroup Handle + ** +-** A changegroup is an object used to combine two or more ++** A changegroup is an object used to combine two or more + ** [changesets] or [patchsets] + */ + typedef struct sqlite3_changegroup sqlite3_changegroup; +@@ -10612,7 +10758,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; + ** + ** If successful, this function returns SQLITE_OK and populates (*pp) with + ** a pointer to a new sqlite3_changegroup object before returning. The caller +-** should eventually free the returned object using a call to ++** should eventually free the returned object using a call to + ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code + ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. + ** +@@ -10624,7 +10770,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; + **
      • Zero or more changesets (or patchsets) are added to the object + ** by calling sqlite3changegroup_add(). + ** +-**
      • The result of combining all input changesets together is obtained ++**
      • The result of combining all input changesets together is obtained + ** by the application via a call to sqlite3changegroup_output(). + ** + **
      • The object is deleted using a call to sqlite3changegroup_delete(). +@@ -10633,18 +10779,18 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; + ** Any number of calls to add() and output() may be made between the calls to + ** new() and delete(), and in any order. + ** +-** As well as the regular sqlite3changegroup_add() and ++** As well as the regular sqlite3changegroup_add() and + ** sqlite3changegroup_output() functions, also available are the streaming + ** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). + */ +-SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup** pp); ++SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp); + + /* + ** CAPI3REF: Add A Changeset To A Changegroup + ** METHOD: sqlite3_changegroup + ** + ** Add all changes within the changeset (or patchset) in buffer pData (size +-** nData bytes) to the changegroup. ++** nData bytes) to the changegroup. + ** + ** If the buffer contains a patchset, then all prior calls to this function + ** on the same changegroup object must also have specified patchsets. Or, if +@@ -10671,7 +10817,7 @@ SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup** pp); + ** changeset was recorded immediately after the changesets already + ** added to the changegroup. + ** INSERT UPDATE +-** The INSERT change remains in the changegroup. The values in the ++** The INSERT change remains in the changegroup. The values in the + ** INSERT change are modified as if the row was inserted by the + ** existing change and then updated according to the new change. + ** INSERT DELETE +@@ -10682,17 +10828,17 @@ SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup** pp); + ** changeset was recorded immediately after the changesets already + ** added to the changegroup. + ** UPDATE UPDATE +-** The existing UPDATE remains within the changegroup. It is amended +-** so that the accompanying values are as if the row was updated once ++** The existing UPDATE remains within the changegroup. It is amended ++** so that the accompanying values are as if the row was updated once + ** by the existing change and then again by the new change. + ** UPDATE DELETE + ** The existing UPDATE is replaced by the new DELETE within the + ** changegroup. + ** DELETE INSERT + ** If one or more of the column values in the row inserted by the +-** new change differ from those in the row deleted by the existing ++** new change differ from those in the row deleted by the existing + ** change, the existing DELETE is replaced by an UPDATE within the +-** changegroup. Otherwise, if the inserted row is exactly the same ++** changegroup. Otherwise, if the inserted row is exactly the same + ** as the deleted row, the existing DELETE is simply discarded. + ** DELETE UPDATE + ** The new change is ignored. This case does not occur if the new +@@ -10715,8 +10861,7 @@ SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup** pp); + ** + ** If no error occurs, SQLITE_OK is returned. + */ +-SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, +- void* pData); ++SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData); + + /* + ** CAPI3REF: Obtain A Composite Changeset From A Changegroup +@@ -10738,14 +10883,15 @@ SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, + ** + ** If an error occurs, an SQLite error code is returned and the output + ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK +-** is returned and the output variables are set to the size of and a ++** is returned and the output variables are set to the size of and a + ** pointer to the output buffer, respectively. In this case it is the + ** responsibility of the caller to eventually free the buffer using a + ** call to sqlite3_free(). + */ + SQLITE_API int sqlite3changegroup_output( +- sqlite3_changegroup*, int* pnData, /* OUT: Size of output buffer in bytes */ +- void** ppData /* OUT: Pointer to output buffer */ ++ sqlite3_changegroup*, ++ int *pnData, /* OUT: Size of output buffer in bytes */ ++ void **ppData /* OUT: Pointer to output buffer */ + ); + + /* +@@ -10759,7 +10905,7 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** + ** Apply a changeset or patchset to a database. These functions attempt to + ** update the "main" database attached to handle db with the changes found in +-** the changeset passed via the second and third arguments. ++** the changeset passed via the second and third arguments. + ** + ** The fourth argument (xFilter) passed to these functions is the "filter + ** callback". If it is not NULL, then for each table affected by at least one +@@ -10770,16 +10916,16 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** Otherwise, if the return value is non-zero or the xFilter argument to + ** is NULL, all changes related to the table are attempted. + ** +-** For each table that is not excluded by the filter callback, this function +-** tests that the target database contains a compatible table. A table is ++** For each table that is not excluded by the filter callback, this function ++** tests that the target database contains a compatible table. A table is + ** considered compatible if all of the following are true: + ** + **
          +-**
        • The table has the same name as the name recorded in the ++**
        • The table has the same name as the name recorded in the + ** changeset, and +-**
        • The table has at least as many columns as recorded in the ++**
        • The table has at least as many columns as recorded in the + ** changeset, and +-**
        • The table has primary key columns in the same position as ++**
        • The table has primary key columns in the same position as + ** recorded in the changeset. + **
        + ** +@@ -10788,11 +10934,11 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most + ** one such warning is issued for each table in the changeset. + ** +-** For each change for which there is a compatible table, an attempt is made +-** to modify the table contents according to the UPDATE, INSERT or DELETE +-** change. If a change cannot be applied cleanly, the conflict handler +-** function passed as the fifth argument to sqlite3changeset_apply() may be +-** invoked. A description of exactly when the conflict handler is invoked for ++** For each change for which there is a compatible table, an attempt is made ++** to modify the table contents according to the UPDATE, INSERT or DELETE ++** change. If a change cannot be applied cleanly, the conflict handler ++** function passed as the fifth argument to sqlite3changeset_apply() may be ++** invoked. A description of exactly when the conflict handler is invoked for + ** each type of change is below. + ** + ** Unlike the xFilter argument, xConflict may not be passed NULL. The results +@@ -10800,23 +10946,23 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** argument are undefined. + ** + ** Each time the conflict handler function is invoked, it must return one +-** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or ++** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or + ** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned + ** if the second argument passed to the conflict handler is either + ** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler + ** returns an illegal value, any changes already made are rolled back and +-** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different ++** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different + ** actions are taken by sqlite3changeset_apply() depending on the value + ** returned by each invocation of the conflict-handler function. Refer to +-** the documentation for the three ++** the documentation for the three + ** [SQLITE_CHANGESET_OMIT|available return values] for details. + ** + **
        + **
        DELETE Changes
        +-** For each DELETE change, the function checks if the target database +-** contains a row with the same primary key value (or values) as the +-** original row values stored in the changeset. If it does, and the values +-** stored in all non-primary key columns also match the values stored in ++** For each DELETE change, the function checks if the target database ++** contains a row with the same primary key value (or values) as the ++** original row values stored in the changeset. If it does, and the values ++** stored in all non-primary key columns also match the values stored in + ** the changeset the row is deleted from the target database. + ** + ** If a row with matching primary key values is found, but one or more of +@@ -10845,22 +10991,22 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** database table, the trailing fields are populated with their default + ** values. + ** +-** If the attempt to insert the row fails because the database already ++** If the attempt to insert the row fails because the database already + ** contains a row with the same primary key values, the conflict handler +-** function is invoked with the second argument set to ++** function is invoked with the second argument set to + ** [SQLITE_CHANGESET_CONFLICT]. + ** + ** If the attempt to insert the row fails because of some other constraint +-** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is ++** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is + ** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT]. +-** This includes the case where the INSERT operation is re-attempted because +-** an earlier call to the conflict handler function returned ++** This includes the case where the INSERT operation is re-attempted because ++** an earlier call to the conflict handler function returned + ** [SQLITE_CHANGESET_REPLACE]. + ** + **
        UPDATE Changes
        +-** For each UPDATE change, the function checks if the target database +-** contains a row with the same primary key value (or values) as the +-** original row values stored in the changeset. If it does, and the values ++** For each UPDATE change, the function checks if the target database ++** contains a row with the same primary key value (or values) as the ++** original row values stored in the changeset. If it does, and the values + ** stored in all modified non-primary key columns also match the values + ** stored in the changeset the row is updated within the target database. + ** +@@ -10876,12 +11022,12 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] + ** passed as the second argument. + ** +-** If the UPDATE operation is attempted, but SQLite returns +-** SQLITE_CONSTRAINT, the conflict-handler function is invoked with ++** If the UPDATE operation is attempted, but SQLite returns ++** SQLITE_CONSTRAINT, the conflict-handler function is invoked with + ** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument. +-** This includes the case where the UPDATE operation is attempted after ++** This includes the case where the UPDATE operation is attempted after + ** an earlier call to the conflict handler function returned +-** [SQLITE_CHANGESET_REPLACE]. ++** [SQLITE_CHANGESET_REPLACE]. + **
        + ** + ** It is safe to execute SQL statements, including those that write to the +@@ -10892,12 +11038,12 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** All changes made by these functions are enclosed in a savepoint transaction. + ** If any other error (aside from a constraint failure when attempting to + ** write to the target database) occurs, then the savepoint transaction is +-** rolled back, restoring the target database to its original state, and an ++** rolled back, restoring the target database to its original state, and an + ** SQLite error code returned. + ** + ** If the output parameters (ppRebase) and (pnRebase) are non-NULL and + ** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2() +-** may set (*ppRebase) to point to a "rebase" that may be used with the ++** may set (*ppRebase) to point to a "rebase" that may be used with the + ** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase) + ** is set to the size of the buffer in bytes. It is the responsibility of the + ** caller to eventually free any such buffer using sqlite3_free(). The buffer +@@ -10913,34 +11059,36 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*); + ** and therefore subject to change. + */ + SQLITE_API int sqlite3changeset_apply( +- sqlite3* db, /* Apply change to "main" db of this handle */ +- int nChangeset, /* Size of changeset in bytes */ +- void* pChangeset, /* Changeset blob */ +- int (*xFilter)(void* pCtx, /* Copy of sixth arg to _apply() */ +- const char* zTab /* Table name */ +- ), +- int (*xConflict)( +- void* pCtx, /* Copy of sixth arg to _apply() */ +- int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ +- sqlite3_changeset_iter* p /* Handle describing change and conflict */ +- ), +- void* pCtx /* First argument passed to xConflict */ ++ sqlite3 *db, /* Apply change to "main" db of this handle */ ++ int nChangeset, /* Size of changeset in bytes */ ++ void *pChangeset, /* Changeset blob */ ++ int(*xFilter)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ const char *zTab /* Table name */ ++ ), ++ int(*xConflict)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ ++ sqlite3_changeset_iter *p /* Handle describing change and conflict */ ++ ), ++ void *pCtx /* First argument passed to xConflict */ + ); + SQLITE_API int sqlite3changeset_apply_v2( +- sqlite3* db, /* Apply change to "main" db of this handle */ +- int nChangeset, /* Size of changeset in bytes */ +- void* pChangeset, /* Changeset blob */ +- int (*xFilter)(void* pCtx, /* Copy of sixth arg to _apply() */ +- const char* zTab /* Table name */ +- ), +- int (*xConflict)( +- void* pCtx, /* Copy of sixth arg to _apply() */ +- int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ +- sqlite3_changeset_iter* p /* Handle describing change and conflict */ +- ), +- void* pCtx, /* First argument passed to xConflict */ +- void** ppRebase, int* pnRebase, /* OUT: Rebase data */ +- int flags /* SESSION_CHANGESETAPPLY_* flags */ ++ sqlite3 *db, /* Apply change to "main" db of this handle */ ++ int nChangeset, /* Size of changeset in bytes */ ++ void *pChangeset, /* Changeset blob */ ++ int(*xFilter)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ const char *zTab /* Table name */ ++ ), ++ int(*xConflict)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ ++ sqlite3_changeset_iter *p /* Handle describing change and conflict */ ++ ), ++ void *pCtx, /* First argument passed to xConflict */ ++ void **ppRebase, int *pnRebase, /* OUT: Rebase data */ ++ int flags /* SESSION_CHANGESETAPPLY_* flags */ + ); + + /* +@@ -10956,7 +11104,7 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** SAVEPOINT is committed if the changeset or patchset is successfully + ** applied, or rolled back if an error occurs. Specifying this flag + ** causes the sessions module to omit this savepoint. In this case, if the +-** caller has an open transaction or savepoint when apply_v2() is called, ++** caller has an open transaction or savepoint when apply_v2() is called, + ** it may revert the partially applied changeset by rolling it back. + ** + **
        SQLITE_CHANGESETAPPLY_INVERT
        +@@ -10964,10 +11112,10 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** a changeset using sqlite3changeset_invert() before applying it. It is + ** an error to specify this flag with a patchset. + */ +-# define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 +-# define SQLITE_CHANGESETAPPLY_INVERT 0x0002 ++#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 ++#define SQLITE_CHANGESETAPPLY_INVERT 0x0002 + +-/* ++/* + ** CAPI3REF: Constants Passed To The Conflict Handler + ** + ** Values that may be passed as the second argument to a conflict-handler. +@@ -10976,32 +11124,32 @@ SQLITE_API int sqlite3changeset_apply_v2( + **
        SQLITE_CHANGESET_DATA
        + ** The conflict handler is invoked with CHANGESET_DATA as the second argument + ** when processing a DELETE or UPDATE change if a row with the required +-** PRIMARY KEY fields is present in the database, but one or more other +-** (non primary-key) fields modified by the update do not contain the ++** PRIMARY KEY fields is present in the database, but one or more other ++** (non primary-key) fields modified by the update do not contain the + ** expected "before" values. +-** ++** + ** The conflicting row, in this case, is the database row with the matching + ** primary key. +-** ++** + **
        SQLITE_CHANGESET_NOTFOUND
        + ** The conflict handler is invoked with CHANGESET_NOTFOUND as the second + ** argument when processing a DELETE or UPDATE change if a row with the + ** required PRIMARY KEY fields is not present in the database. +-** ++** + ** There is no conflicting row in this case. The results of invoking the + ** sqlite3changeset_conflict() API are undefined. +-** ++** + **
        SQLITE_CHANGESET_CONFLICT
        + ** CHANGESET_CONFLICT is passed as the second argument to the conflict +-** handler while processing an INSERT change if the operation would result ++** handler while processing an INSERT change if the operation would result + ** in duplicate primary key values. +-** ++** + ** The conflicting row in this case is the database row with the matching + ** primary key. + ** + **
        SQLITE_CHANGESET_FOREIGN_KEY
        + ** If foreign key handling is enabled, and applying a changeset leaves the +-** database in a state containing foreign key violations, the conflict ++** database in a state containing foreign key violations, the conflict + ** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument + ** exactly once before the changeset is committed. If the conflict handler + ** returns CHANGESET_OMIT, the changes, including those that caused the +@@ -11011,24 +11159,24 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** No current or conflicting row information is provided. The only function + ** it is possible to call on the supplied sqlite3_changeset_iter handle + ** is sqlite3changeset_fk_conflicts(). +-** ++** + **
        SQLITE_CHANGESET_CONSTRAINT
        +-** If any other constraint violation occurs while applying a change (i.e. +-** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is ++** If any other constraint violation occurs while applying a change (i.e. ++** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is + ** invoked with CHANGESET_CONSTRAINT as the second argument. +-** ++** + ** There is no conflicting row in this case. The results of invoking the + ** sqlite3changeset_conflict() API are undefined. + ** + ** + */ +-# define SQLITE_CHANGESET_DATA 1 +-# define SQLITE_CHANGESET_NOTFOUND 2 +-# define SQLITE_CHANGESET_CONFLICT 3 +-# define SQLITE_CHANGESET_CONSTRAINT 4 +-# define SQLITE_CHANGESET_FOREIGN_KEY 5 ++#define SQLITE_CHANGESET_DATA 1 ++#define SQLITE_CHANGESET_NOTFOUND 2 ++#define SQLITE_CHANGESET_CONFLICT 3 ++#define SQLITE_CHANGESET_CONSTRAINT 4 ++#define SQLITE_CHANGESET_FOREIGN_KEY 5 + +-/* ++/* + ** CAPI3REF: Constants Returned By The Conflict Handler + ** + ** A conflict handler callback must return one of the following three values. +@@ -11036,13 +11184,13 @@ SQLITE_API int sqlite3changeset_apply_v2( + **
        + **
        SQLITE_CHANGESET_OMIT
        + ** If a conflict handler returns this value no special action is taken. The +-** change that caused the conflict is not applied. The session module ++** change that caused the conflict is not applied. The session module + ** continues to the next change in the changeset. + ** + **
        SQLITE_CHANGESET_REPLACE
        + ** This value may only be returned if the second argument to the conflict + ** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this +-** is not the case, any changes applied so far are rolled back and the ++** is not the case, any changes applied so far are rolled back and the + ** call to sqlite3changeset_apply() returns SQLITE_MISUSE. + ** + ** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict +@@ -11055,28 +11203,28 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** the original row is restored to the database before continuing. + ** + **
        SQLITE_CHANGESET_ABORT
        +-** If this value is returned, any changes applied so far are rolled back ++** If this value is returned, any changes applied so far are rolled back + ** and the call to sqlite3changeset_apply() returns SQLITE_ABORT. + **
        + */ +-# define SQLITE_CHANGESET_OMIT 0 +-# define SQLITE_CHANGESET_REPLACE 1 +-# define SQLITE_CHANGESET_ABORT 2 ++#define SQLITE_CHANGESET_OMIT 0 ++#define SQLITE_CHANGESET_REPLACE 1 ++#define SQLITE_CHANGESET_ABORT 2 + +-/* ++/* + ** CAPI3REF: Rebasing changesets + ** EXPERIMENTAL + ** + ** Suppose there is a site hosting a database in state S0. And that + ** modifications are made that move that database to state S1 and a + ** changeset recorded (the "local" changeset). Then, a changeset based +-** on S0 is received from another site (the "remote" changeset) and +-** applied to the database. The database is then in state ++** on S0 is received from another site (the "remote" changeset) and ++** applied to the database. The database is then in state + ** (S1+"remote"), where the exact state depends on any conflict + ** resolution decisions (OMIT or REPLACE) made while applying "remote". +-** Rebasing a changeset is to update it to take those conflict ++** Rebasing a changeset is to update it to take those conflict + ** resolution decisions into account, so that the same conflicts +-** do not have to be resolved elsewhere in the network. ++** do not have to be resolved elsewhere in the network. + ** + ** For example, if both the local and remote changesets contain an + ** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)": +@@ -11095,7 +11243,7 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** + **
        + **
        Local INSERT
        +-** This may only conflict with a remote INSERT. If the conflict ++** This may only conflict with a remote INSERT. If the conflict + ** resolution was OMIT, then add an UPDATE change to the rebased + ** changeset. Or, if the conflict resolution was REPLACE, add + ** nothing to the rebased changeset. +@@ -11119,12 +11267,12 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** the old.* values are rebased using the new.* values in the remote + ** change. Or, if the resolution is REPLACE, then the change is copied + ** into the rebased changeset with updates to columns also updated by +-** the conflicting remote UPDATE removed. If this means no columns would ++** the conflicting remote UPDATE removed. If this means no columns would + ** be updated, the change is omitted. + **
        + ** +-** A local change may be rebased against multiple remote changes +-** simultaneously. If a single key is modified by multiple remote ++** A local change may be rebased against multiple remote changes ++** simultaneously. If a single key is modified by multiple remote + ** changesets, they are combined as follows before the local changeset + ** is rebased: + ** +@@ -11137,10 +11285,10 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** of the OMIT resolutions. + **
      + ** +-** Note that conflict resolutions from multiple remote changesets are +-** combined on a per-field basis, not per-row. This means that in the +-** case of multiple remote UPDATE operations, some fields of a single +-** local change may be rebased for REPLACE while others are rebased for ++** Note that conflict resolutions from multiple remote changesets are ++** combined on a per-field basis, not per-row. This means that in the ++** case of multiple remote UPDATE operations, some fields of a single ++** local change may be rebased for REPLACE while others are rebased for + ** OMIT. + ** + ** In order to rebase a local changeset, the remote changeset must first +@@ -11148,7 +11296,7 @@ SQLITE_API int sqlite3changeset_apply_v2( + ** the buffer of rebase information captured. Then: + ** + **
        +-**
      1. An sqlite3_rebaser object is created by calling ++**
      2. An sqlite3_rebaser object is created by calling + ** sqlite3rebaser_create(). + **
      3. The new object is configured with the rebase buffer obtained from + ** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure(). +@@ -11169,10 +11317,10 @@ typedef struct sqlite3_rebaser sqlite3_rebaser; + ** + ** Allocate a new changeset rebaser object. If successful, set (*ppNew) to + ** point to the new object and return SQLITE_OK. Otherwise, if an error +-** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew) +-** to NULL. ++** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew) ++** to NULL. + */ +-SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser** ppNew); ++SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew); + + /* + ** CAPI3REF: Configure a changeset rebaser object. +@@ -11183,8 +11331,10 @@ SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser** ppNew); + ** bytes), which must have been obtained from a previous call to + ** sqlite3changeset_apply_v2(). + */ +-SQLITE_API int sqlite3rebaser_configure(sqlite3_rebaser*, int nRebase, +- const void* pRebase); ++SQLITE_API int sqlite3rebaser_configure( ++ sqlite3_rebaser*, ++ int nRebase, const void *pRebase ++); + + /* + ** CAPI3REF: Rebase a changeset +@@ -11194,14 +11344,17 @@ SQLITE_API int sqlite3rebaser_configure(sqlite3_rebaser*, int nRebase, + ** in size. This function allocates and populates a buffer with a copy + ** of the changeset rebased according to the configuration of the + ** rebaser object passed as the first argument. If successful, (*ppOut) +-** is set to point to the new buffer containing the rebased changeset and ++** is set to point to the new buffer containing the rebased changeset and + ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the + ** responsibility of the caller to eventually free the new buffer using + ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) + ** are set to zero and an SQLite error code returned. + */ +-SQLITE_API int sqlite3rebaser_rebase(sqlite3_rebaser*, int nIn, const void* pIn, +- int* pnOut, void** ppOut); ++SQLITE_API int sqlite3rebaser_rebase( ++ sqlite3_rebaser*, ++ int nIn, const void *pIn, ++ int *pnOut, void **ppOut ++); + + /* + ** CAPI3REF: Delete a changeset rebaser object. +@@ -11211,30 +11364,30 @@ SQLITE_API int sqlite3rebaser_rebase(sqlite3_rebaser*, int nIn, const void* pIn, + ** should be one call to this function for each successful invocation + ** of sqlite3rebaser_create(). + */ +-SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser* p); ++SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p); + + /* + ** CAPI3REF: Streaming Versions of API functions. + ** +-** The six streaming API xxx_strm() functions serve similar purposes to the ++** The six streaming API xxx_strm() functions serve similar purposes to the + ** corresponding non-streaming API functions: + ** + ** + ** +-**
        Streaming functionNon-streaming equivalent
        sqlite3changeset_apply_strm[sqlite3changeset_apply] +-**
        sqlite3changeset_apply_strm_v2[sqlite3changeset_apply_v2] +-**
        sqlite3changeset_concat_strm[sqlite3changeset_concat] +-**
        sqlite3changeset_invert_strm[sqlite3changeset_invert] +-**
        sqlite3changeset_start_strm[sqlite3changeset_start] +-**
        sqlite3session_changeset_strm[sqlite3session_changeset] +-**
        sqlite3session_patchset_strm[sqlite3session_patchset] ++**
        sqlite3changeset_apply_strm[sqlite3changeset_apply] ++**
        sqlite3changeset_apply_strm_v2[sqlite3changeset_apply_v2] ++**
        sqlite3changeset_concat_strm[sqlite3changeset_concat] ++**
        sqlite3changeset_invert_strm[sqlite3changeset_invert] ++**
        sqlite3changeset_start_strm[sqlite3changeset_start] ++**
        sqlite3session_changeset_strm[sqlite3session_changeset] ++**
        sqlite3session_patchset_strm[sqlite3session_patchset] + **
        + ** + ** Non-streaming functions that accept changesets (or patchsets) as input +-** require that the entire changeset be stored in a single buffer in memory. +-** Similarly, those that return a changeset or patchset do so by returning +-** a pointer to a single large buffer allocated using sqlite3_malloc(). +-** Normally this is convenient. However, if an application running in a ++** require that the entire changeset be stored in a single buffer in memory. ++** Similarly, those that return a changeset or patchset do so by returning ++** a pointer to a single large buffer allocated using sqlite3_malloc(). ++** Normally this is convenient. However, if an application running in a + ** low-memory environment is required to handle very large changesets, the + ** large contiguous memory allocations required can become onerous. + ** +@@ -11256,12 +11409,12 @@ SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser* p); + ** + ** + ** Each time the xInput callback is invoked by the sessions module, the first +-** argument passed is a copy of the supplied pIn context pointer. The second +-** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no +-** error occurs the xInput method should copy up to (*pnData) bytes of data +-** into the buffer and set (*pnData) to the actual number of bytes copied +-** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) +-** should be set to zero to indicate this. Or, if an error occurs, an SQLite ++** argument passed is a copy of the supplied pIn context pointer. The second ++** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no ++** error occurs the xInput method should copy up to (*pnData) bytes of data ++** into the buffer and set (*pnData) to the actual number of bytes copied ++** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) ++** should be set to zero to indicate this. Or, if an error occurs, an SQLite + ** error code should be returned. In all cases, if an xInput callback returns + ** an error, all processing is abandoned and the streaming API function + ** returns a copy of the error code to the caller. +@@ -11269,7 +11422,7 @@ SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser* p); + ** In the case of sqlite3changeset_start_strm(), the xInput callback may be + ** invoked by the sessions module at any point during the lifetime of the + ** iterator. If such an xInput callback returns an error, the iterator enters +-** an error state, whereby all subsequent calls to iterator functions ++** an error state, whereby all subsequent calls to iterator functions + ** immediately fail with the same error code as returned by xInput. + ** + ** Similarly, streaming API functions that return changesets (or patchsets) +@@ -11299,84 +11452,107 @@ SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser* p); + ** is immediately abandoned and the streaming API function returns a copy + ** of the xOutput error code to the application. + ** +-** The sessions module never invokes an xOutput callback with the third ++** The sessions module never invokes an xOutput callback with the third + ** parameter set to a value less than or equal to zero. Other than this, + ** no guarantees are made as to the size of the chunks of data returned. + */ + SQLITE_API int sqlite3changeset_apply_strm( +- sqlite3* db, /* Apply change to "main" db of this handle */ +- int (*xInput)(void* pIn, void* pData, int* pnData), /* Input function */ +- void* pIn, /* First arg for xInput */ +- int (*xFilter)(void* pCtx, /* Copy of sixth arg to _apply() */ +- const char* zTab /* Table name */ +- ), +- int (*xConflict)( +- void* pCtx, /* Copy of sixth arg to _apply() */ +- int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ +- sqlite3_changeset_iter* p /* Handle describing change and conflict */ +- ), +- void* pCtx /* First argument passed to xConflict */ ++ sqlite3 *db, /* Apply change to "main" db of this handle */ ++ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ ++ void *pIn, /* First arg for xInput */ ++ int(*xFilter)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ const char *zTab /* Table name */ ++ ), ++ int(*xConflict)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ ++ sqlite3_changeset_iter *p /* Handle describing change and conflict */ ++ ), ++ void *pCtx /* First argument passed to xConflict */ + ); + SQLITE_API int sqlite3changeset_apply_v2_strm( +- sqlite3* db, /* Apply change to "main" db of this handle */ +- int (*xInput)(void* pIn, void* pData, int* pnData), /* Input function */ +- void* pIn, /* First arg for xInput */ +- int (*xFilter)(void* pCtx, /* Copy of sixth arg to _apply() */ +- const char* zTab /* Table name */ +- ), +- int (*xConflict)( +- void* pCtx, /* Copy of sixth arg to _apply() */ +- int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ +- sqlite3_changeset_iter* p /* Handle describing change and conflict */ +- ), +- void* pCtx, /* First argument passed to xConflict */ +- void** ppRebase, int* pnRebase, int flags); ++ sqlite3 *db, /* Apply change to "main" db of this handle */ ++ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ ++ void *pIn, /* First arg for xInput */ ++ int(*xFilter)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ const char *zTab /* Table name */ ++ ), ++ int(*xConflict)( ++ void *pCtx, /* Copy of sixth arg to _apply() */ ++ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ ++ sqlite3_changeset_iter *p /* Handle describing change and conflict */ ++ ), ++ void *pCtx, /* First argument passed to xConflict */ ++ void **ppRebase, int *pnRebase, ++ int flags ++); + SQLITE_API int sqlite3changeset_concat_strm( +- int (*xInputA)(void* pIn, void* pData, int* pnData), void* pInA, +- int (*xInputB)(void* pIn, void* pData, int* pnData), void* pInB, +- int (*xOutput)(void* pOut, const void* pData, int nData), void* pOut); ++ int (*xInputA)(void *pIn, void *pData, int *pnData), ++ void *pInA, ++ int (*xInputB)(void *pIn, void *pData, int *pnData), ++ void *pInB, ++ int (*xOutput)(void *pOut, const void *pData, int nData), ++ void *pOut ++); + SQLITE_API int sqlite3changeset_invert_strm( +- int (*xInput)(void* pIn, void* pData, int* pnData), void* pIn, +- int (*xOutput)(void* pOut, const void* pData, int nData), void* pOut); +-SQLITE_API int sqlite3changeset_start_strm(sqlite3_changeset_iter** pp, +- int (*xInput)(void* pIn, void* pData, +- int* pnData), +- void* pIn); ++ int (*xInput)(void *pIn, void *pData, int *pnData), ++ void *pIn, ++ int (*xOutput)(void *pOut, const void *pData, int nData), ++ void *pOut ++); ++SQLITE_API int sqlite3changeset_start_strm( ++ sqlite3_changeset_iter **pp, ++ int (*xInput)(void *pIn, void *pData, int *pnData), ++ void *pIn ++); + SQLITE_API int sqlite3changeset_start_v2_strm( +- sqlite3_changeset_iter** pp, +- int (*xInput)(void* pIn, void* pData, int* pnData), void* pIn, int flags); ++ sqlite3_changeset_iter **pp, ++ int (*xInput)(void *pIn, void *pData, int *pnData), ++ void *pIn, ++ int flags ++); + SQLITE_API int sqlite3session_changeset_strm( +- sqlite3_session* pSession, +- int (*xOutput)(void* pOut, const void* pData, int nData), void* pOut); ++ sqlite3_session *pSession, ++ int (*xOutput)(void *pOut, const void *pData, int nData), ++ void *pOut ++); + SQLITE_API int sqlite3session_patchset_strm( +- sqlite3_session* pSession, +- int (*xOutput)(void* pOut, const void* pData, int nData), void* pOut); +-SQLITE_API int sqlite3changegroup_add_strm(sqlite3_changegroup*, +- int (*xInput)(void* pIn, void* pData, +- int* pnData), +- void* pIn); +-SQLITE_API int sqlite3changegroup_output_strm( +- sqlite3_changegroup*, +- int (*xOutput)(void* pOut, const void* pData, int nData), void* pOut); ++ sqlite3_session *pSession, ++ int (*xOutput)(void *pOut, const void *pData, int nData), ++ void *pOut ++); ++SQLITE_API int sqlite3changegroup_add_strm(sqlite3_changegroup*, ++ int (*xInput)(void *pIn, void *pData, int *pnData), ++ void *pIn ++); ++SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*, ++ int (*xOutput)(void *pOut, const void *pData, int nData), ++ void *pOut ++); + SQLITE_API int sqlite3rebaser_rebase_strm( +- sqlite3_rebaser* pRebaser, +- int (*xInput)(void* pIn, void* pData, int* pnData), void* pIn, +- int (*xOutput)(void* pOut, const void* pData, int nData), void* pOut); ++ sqlite3_rebaser *pRebaser, ++ int (*xInput)(void *pIn, void *pData, int *pnData), ++ void *pIn, ++ int (*xOutput)(void *pOut, const void *pData, int nData), ++ void *pOut ++); + + /* + ** CAPI3REF: Configure global parameters + ** + ** The sqlite3session_config() interface is used to make global configuration +-** changes to the sessions module in order to tune it to the specific needs ++** changes to the sessions module in order to tune it to the specific needs + ** of the application. + ** + ** The sqlite3session_config() interface is not threadsafe. If it is invoked + ** while any other thread is inside any other sessions method then the + ** results are undefined. Furthermore, if it is invoked after any sessions +-** related objects have been created, the results are also undefined. ++** related objects have been created, the results are also undefined. + ** + ** The first argument to the sqlite3session_config() function must be one +-** of the SQLITE_SESSION_CONFIG_XXX constants defined below. The ++** of the SQLITE_SESSION_CONFIG_XXX constants defined below. The + ** interpretation of the (void*) value passed as the second parameter and + ** the effect of calling this function depends on the value of the first + ** parameter. +@@ -11396,21 +11572,21 @@ SQLITE_API int sqlite3rebaser_rebase_strm( + ** This function returns SQLITE_OK if successful, or an SQLite error code + ** otherwise. + */ +-SQLITE_API int sqlite3session_config(int op, void* pArg); ++SQLITE_API int sqlite3session_config(int op, void *pArg); + + /* + ** CAPI3REF: Values for sqlite3session_config(). + */ +-# define SQLITE_SESSION_CONFIG_STRMSIZE 1 ++#define SQLITE_SESSION_CONFIG_STRMSIZE 1 + + /* + ** Make sure we can call this stuff from C++. + */ +-# ifdef __cplusplus ++#ifdef __cplusplus + } +-# endif ++#endif + +-#endif /* !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) */ ++#endif /* !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) */ + + /******** End of sqlite3session.h *********/ + /******** Begin file fts5.h *********/ +@@ -11426,19 +11602,21 @@ SQLITE_API int sqlite3session_config(int op, void* pArg); + ** + ****************************************************************************** + ** +-** Interfaces to extend FTS5. Using the interfaces defined in this file, ++** Interfaces to extend FTS5. Using the interfaces defined in this file, + ** FTS5 may be extended with: + ** + ** * custom tokenizers, and + ** * custom auxiliary functions. + */ + ++ + #ifndef _FTS5_H +-# define _FTS5_H ++#define _FTS5_H ++ + +-# ifdef __cplusplus ++#ifdef __cplusplus + extern "C" { +-# endif ++#endif + + /************************************************************************* + ** CUSTOM AUXILIARY FUNCTIONS +@@ -11452,35 +11630,35 @@ typedef struct Fts5Context Fts5Context; + typedef struct Fts5PhraseIter Fts5PhraseIter; + + typedef void (*fts5_extension_function)( +- const Fts5ExtensionApi* pApi, /* API offered by current FTS version */ +- Fts5Context* pFts, /* First arg to pass to pApi functions */ +- sqlite3_context* pCtx, /* Context for returning result/error */ +- int nVal, /* Number of values in apVal[] array */ +- sqlite3_value** apVal /* Array of trailing arguments */ ++ const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ ++ Fts5Context *pFts, /* First arg to pass to pApi functions */ ++ sqlite3_context *pCtx, /* Context for returning result/error */ ++ int nVal, /* Number of values in apVal[] array */ ++ sqlite3_value **apVal /* Array of trailing arguments */ + ); + + struct Fts5PhraseIter { +- const unsigned char* a; +- const unsigned char* b; ++ const unsigned char *a; ++ const unsigned char *b; + }; + + /* + ** EXTENSION API FUNCTIONS + ** + ** xUserData(pFts): +-** Return a copy of the context pointer the extension function was ++** Return a copy of the context pointer the extension function was + ** registered with. + ** + ** xColumnTotalSize(pFts, iCol, pnToken): + ** If parameter iCol is less than zero, set output variable *pnToken + ** to the total number of tokens in the FTS5 table. Or, if iCol is + ** non-negative but less than the number of columns in the table, return +-** the total number of tokens in column iCol, considering all rows in ++** the total number of tokens in column iCol, considering all rows in + ** the FTS5 table. + ** + ** If parameter iCol is greater than or equal to the number of columns + ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +-** an OOM condition or IO error), an appropriate SQLite error code is ++** an OOM condition or IO error), an appropriate SQLite error code is + ** returned. + ** + ** xColumnCount(pFts): +@@ -11494,7 +11672,7 @@ struct Fts5PhraseIter { + ** + ** If parameter iCol is greater than or equal to the number of columns + ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. +-** an OOM condition or IO error), an appropriate SQLite error code is ++** an OOM condition or IO error), an appropriate SQLite error code is + ** returned. + ** + ** This function may be quite inefficient if used with an FTS5 table +@@ -11521,8 +11699,8 @@ struct Fts5PhraseIter { + ** an error code (i.e. SQLITE_NOMEM) if an error occurs. + ** + ** This API can be quite slow if used with an FTS5 table created with the +-** "detail=none" or "detail=column" option. If the FTS5 table is created +-** with either "detail=none" or "detail=column" and "content=" option ++** "detail=none" or "detail=column" option. If the FTS5 table is created ++** with either "detail=none" or "detail=column" and "content=" option + ** (i.e. if it is a contentless table), then this API always returns 0. + ** + ** xInst: +@@ -11537,7 +11715,7 @@ struct Fts5PhraseIter { + ** code (i.e. SQLITE_NOMEM) if an error occurs. + ** + ** This API can be quite slow if used with an FTS5 table created with the +-** "detail=none" or "detail=column" option. ++** "detail=none" or "detail=column" option. + ** + ** xRowid: + ** Returns the rowid of the current row. +@@ -11553,11 +11731,11 @@ struct Fts5PhraseIter { + ** + ** with $p set to a phrase equivalent to the phrase iPhrase of the + ** current query is executed. Any column filter that applies to +-** phrase iPhrase of the current query is included in $p. For each +-** row visited, the callback function passed as the fourth argument +-** is invoked. The context and API objects passed to the callback ++** phrase iPhrase of the current query is included in $p. For each ++** row visited, the callback function passed as the fourth argument ++** is invoked. The context and API objects passed to the callback + ** function may be used to access the properties of each matched row. +-** Invoking Api.xUserData() returns a copy of the pointer passed as ++** Invoking Api.xUserData() returns a copy of the pointer passed as + ** the third argument to pUserData. + ** + ** If the callback function returns any value other than SQLITE_OK, the +@@ -11572,14 +11750,14 @@ struct Fts5PhraseIter { + ** + ** xSetAuxdata(pFts5, pAux, xDelete) + ** +-** Save the pointer passed as the second argument as the extension function's ++** Save the pointer passed as the second argument as the extension function's + ** "auxiliary data". The pointer may then be retrieved by the current or any + ** future invocation of the same fts5 extension function made as part of + ** the same MATCH query using the xGetAuxdata() API. + ** + ** Each extension function is allocated a single auxiliary data slot for +-** each FTS query (MATCH expression). If the extension function is invoked +-** more than once for a single FTS query, then all invocations share a ++** each FTS query (MATCH expression). If the extension function is invoked ++** more than once for a single FTS query, then all invocations share a + ** single auxiliary data context. + ** + ** If there is already an auxiliary data pointer when this function is +@@ -11598,7 +11776,7 @@ struct Fts5PhraseIter { + ** + ** xGetAuxdata(pFts5, bClear) + ** +-** Returns the current auxiliary data pointer for the fts5 extension ++** Returns the current auxiliary data pointer for the fts5 extension + ** function. See the xSetAuxdata() method for details. + ** + ** If the bClear argument is non-zero, then the auxiliary data is cleared +@@ -11618,7 +11796,7 @@ struct Fts5PhraseIter { + ** method, to iterate through all instances of a single query phrase within + ** the current row. This is the same information as is accessible via the + ** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient +-** to use, this API may be faster under some circumstances. To iterate ++** to use, this API may be faster under some circumstances. To iterate + ** through instances of phrase iPhrase, use the following code: + ** + ** Fts5PhraseIter iter; +@@ -11636,8 +11814,8 @@ struct Fts5PhraseIter { + ** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). + ** + ** This API can be quite slow if used with an FTS5 table created with the +-** "detail=none" or "detail=column" option. If the FTS5 table is created +-** with either "detail=none" or "detail=column" and "content=" option ++** "detail=none" or "detail=column" option. If the FTS5 table is created ++** with either "detail=none" or "detail=column" and "content=" option + ** (i.e. if it is a contentless table), then this API always iterates + ** through an empty set (all calls to xPhraseFirst() set iCol to -1). + ** +@@ -11661,67 +11839,67 @@ struct Fts5PhraseIter { + ** } + ** + ** This API can be quite slow if used with an FTS5 table created with the +-** "detail=none" option. If the FTS5 table is created with either +-** "detail=none" "content=" option (i.e. if it is a contentless table), +-** then this API always iterates through an empty set (all calls to ++** "detail=none" option. If the FTS5 table is created with either ++** "detail=none" "content=" option (i.e. if it is a contentless table), ++** then this API always iterates through an empty set (all calls to + ** xPhraseFirstColumn() set iCol to -1). + ** + ** The information accessed using this API and its companion + ** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext + ** (or xInst/xInstCount). The chief advantage of this API is that it is + ** significantly more efficient than those alternatives when used with +-** "detail=column" tables. ++** "detail=column" tables. + ** + ** xPhraseNextColumn() + ** See xPhraseFirstColumn above. + */ + struct Fts5ExtensionApi { +- int iVersion; /* Currently always set to 3 */ ++ int iVersion; /* Currently always set to 3 */ + +- void* (*xUserData)(Fts5Context*); ++ void *(*xUserData)(Fts5Context*); + + int (*xColumnCount)(Fts5Context*); +- int (*xRowCount)(Fts5Context*, sqlite3_int64* pnRow); +- int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64* pnToken); +- +- int (*xTokenize)(Fts5Context*, const char* pText, +- int nText, /* Text to tokenize */ +- void* pCtx, /* Context passed to xToken() */ +- int (*xToken)(void*, int, const char*, int, int, +- int) /* Callback */ ++ int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); ++ int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); ++ ++ int (*xTokenize)(Fts5Context*, ++ const char *pText, int nText, /* Text to tokenize */ ++ void *pCtx, /* Context passed to xToken() */ ++ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ + ); + + int (*xPhraseCount)(Fts5Context*); + int (*xPhraseSize)(Fts5Context*, int iPhrase); + +- int (*xInstCount)(Fts5Context*, int* pnInst); +- int (*xInst)(Fts5Context*, int iIdx, int* piPhrase, int* piCol, int* piOff); ++ int (*xInstCount)(Fts5Context*, int *pnInst); ++ int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); + + sqlite3_int64 (*xRowid)(Fts5Context*); +- int (*xColumnText)(Fts5Context*, int iCol, const char** pz, int* pn); +- int (*xColumnSize)(Fts5Context*, int iCol, int* pnToken); ++ int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); ++ int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); + +- int (*xQueryPhrase)(Fts5Context*, int iPhrase, void* pUserData, +- int (*)(const Fts5ExtensionApi*, Fts5Context*, void*)); +- int (*xSetAuxdata)(Fts5Context*, void* pAux, void (*xDelete)(void*)); +- void* (*xGetAuxdata)(Fts5Context*, int bClear); ++ int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, ++ int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) ++ ); ++ int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); ++ void *(*xGetAuxdata)(Fts5Context*, int bClear); + + int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); +- void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int* piCol, int* piOff); ++ void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); + + int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); +- void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int* piCol); ++ void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); + }; + +-/* ++/* + ** CUSTOM AUXILIARY FUNCTIONS + *************************************************************************/ + + /************************************************************************* + ** CUSTOM TOKENIZERS + ** +-** Applications may also register custom tokenizer types. A tokenizer +-** is registered by providing fts5 with a populated instance of the ++** Applications may also register custom tokenizer types. A tokenizer ++** is registered by providing fts5 with a populated instance of the + ** following structure. All structure methods must be defined, setting + ** any member of the fts5_tokenizer struct to NULL leads to undefined + ** behaviour. The structure methods are expected to function as follows: +@@ -11732,16 +11910,16 @@ struct Fts5ExtensionApi { + ** + ** The first argument passed to this function is a copy of the (void*) + ** pointer provided by the application when the fts5_tokenizer object +-** was registered with FTS5 (the third argument to xCreateTokenizer()). ++** was registered with FTS5 (the third argument to xCreateTokenizer()). + ** The second and third arguments are an array of nul-terminated strings + ** containing the tokenizer arguments, if any, specified following the + ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used + ** to create the FTS5 table. + ** +-** The final argument is an output variable. If successful, (*ppOut) ++** The final argument is an output variable. If successful, (*ppOut) + ** should be set to point to the new tokenizer handle and SQLITE_OK + ** returned. If an error occurs, some value other than SQLITE_OK should +-** be returned. In this case, fts5 assumes that the final value of *ppOut ++** be returned. In this case, fts5 assumes that the final value of *ppOut + ** is undefined. + ** + ** xDelete: +@@ -11750,7 +11928,7 @@ struct Fts5ExtensionApi { + ** be invoked exactly once for each successful call to xCreate(). + ** + ** xTokenize: +-** This function is expected to tokenize the nText byte string indicated ++** This function is expected to tokenize the nText byte string indicated + ** by argument pText. pText may or may not be nul-terminated. The first + ** argument passed to this function is a pointer to an Fts5Tokenizer object + ** returned by an earlier call to xCreate(). +@@ -11764,8 +11942,8 @@ struct Fts5ExtensionApi { + ** determine the set of tokens to add to (or delete from) the + ** FTS index. + ** +-**
      4. FTS5_TOKENIZE_QUERY - A MATCH query is being executed +-** against the FTS index. The tokenizer is being called to tokenize ++**
      5. FTS5_TOKENIZE_QUERY - A MATCH query is being executed ++** against the FTS index. The tokenizer is being called to tokenize + ** a bareword or quoted string specified as part of the query. + ** + **
      6. (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as +@@ -11773,10 +11951,10 @@ struct Fts5ExtensionApi { + ** followed by a "*" character, indicating that the last token + ** returned by the tokenizer will be treated as a token prefix. + ** +-**
      7. FTS5_TOKENIZE_AUX - The tokenizer is being invoked to ++**
      8. FTS5_TOKENIZE_AUX - The tokenizer is being invoked to + ** satisfy an fts5_api.xTokenize() request made by an auxiliary + ** function. Or an fts5_api.xColumnSize() request made by the same +-** on a columnsize=0 database. ++** on a columnsize=0 database. + **
    + ** + ** For each token in the input string, the supplied callback xToken() must +@@ -11788,10 +11966,10 @@ struct Fts5ExtensionApi { + ** which the token is derived within the input. + ** + ** The second argument passed to the xToken() callback ("tflags") should +-** normally be set to 0. The exception is if the tokenizer supports ++** normally be set to 0. The exception is if the tokenizer supports + ** synonyms. In this case see the discussion below for details. + ** +-** FTS5 assumes the xToken() callback is invoked for each token in the ++** FTS5 assumes the xToken() callback is invoked for each token in the + ** order that they occur within the input text. + ** + ** If an xToken() callback returns any value other than SQLITE_OK, then +@@ -11805,7 +11983,7 @@ struct Fts5ExtensionApi { + ** SYNONYM SUPPORT + ** + ** Custom tokenizers may also support synonyms. Consider a case in which a +-** user wishes to query for a phrase such as "first place". Using the ++** user wishes to query for a phrase such as "first place". Using the + ** built-in tokenizers, the FTS5 query 'first + place' will match instances + ** of "first place" within the document set, but not alternative forms + ** such as "1st place". In some applications, it would be better to match +@@ -11825,34 +12003,34 @@ struct Fts5ExtensionApi { + ** + **
  • By querying the index for all synonyms of each query term + ** separately. In this case, when tokenizing query text, the +-** tokenizer may provide multiple synonyms for a single term +-** within the document. FTS5 then queries the index for each ++** tokenizer may provide multiple synonyms for a single term ++** within the document. FTS5 then queries the index for each + ** synonym individually. For example, faced with the query: + ** + ** + ** ... MATCH 'first place' + ** + ** the tokenizer offers both "1st" and "first" as synonyms for the +-** first token in the MATCH query and FTS5 effectively runs a query ++** first token in the MATCH query and FTS5 effectively runs a query + ** similar to: + ** + ** + ** ... MATCH '(first OR 1st) place' + ** + ** except that, for the purposes of auxiliary functions, the query +-** still appears to contain just two phrases - "(first OR 1st)" ++** still appears to contain just two phrases - "(first OR 1st)" + ** being treated as a single phrase. + ** + **
  • By adding multiple synonyms for a single term to the FTS index. + ** Using this method, when tokenizing document text, the tokenizer +-** provides multiple synonyms for each token. So that when a ++** provides multiple synonyms for each token. So that when a + ** document such as "I won first place" is tokenized, entries are + ** added to the FTS index for "i", "won", "first", "1st" and + ** "place". + ** + ** This way, even if the tokenizer does not provide synonyms + ** when tokenizing query text (it should not - to do so would be +-** inefficient), it doesn't matter if the user queries for ++** inefficient), it doesn't matter if the user queries for + ** 'first + place' or '1st + place', as there are entries in the + ** FTS index corresponding to both forms of the first token. + ** +@@ -11873,11 +12051,11 @@ struct Fts5ExtensionApi { + ** + ** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time + ** xToken() is called. Multiple synonyms may be specified for a single token +-** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. ++** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. + ** There is no limit to the number of synonyms that may be provided for a + ** single token. + ** +-** In many cases, method (1) above is the best approach. It does not add ++** In many cases, method (1) above is the best approach. It does not add + ** extra data to the FTS index or require FTS5 to query for multiple terms, + ** so it is efficient in terms of disk space and query speed. However, it + ** does not support prefix queries very well. If, as suggested above, the +@@ -11889,18 +12067,18 @@ struct Fts5ExtensionApi { + ** will not match documents that contain the token "1st" (as the tokenizer + ** will probably not map "1s" to any prefix of "first"). + ** +-** For full prefix support, method (3) may be preferred. In this case, ++** For full prefix support, method (3) may be preferred. In this case, + ** because the index contains entries for both "first" and "1st", prefix + ** queries such as 'fi*' or '1s*' will match correctly. However, because + ** extra entries are added to the FTS index, this method uses more space + ** within the database. + ** + ** Method (2) offers a midpoint between (1) and (3). Using this method, +-** a query such as '1s*' will match documents that contain the literal ++** a query such as '1s*' will match documents that contain the literal + ** token "1st", but not "first" (assuming the tokenizer is not able to + ** provide synonyms for prefixes). However, a non-prefix query like '1st' + ** will match against "1st" and "first". This method does not require +-** extra disk space, as no extra entries are added to the FTS index. ++** extra disk space, as no extra entries are added to the FTS index. + ** On the other hand, it may require more CPU cycles to run MATCH queries, + ** as separate queries of the FTS index are required for each synonym. + ** +@@ -11912,29 +12090,32 @@ struct Fts5ExtensionApi { + typedef struct Fts5Tokenizer Fts5Tokenizer; + typedef struct fts5_tokenizer fts5_tokenizer; + struct fts5_tokenizer { +- int (*xCreate)(void*, const char** azArg, int nArg, Fts5Tokenizer** ppOut); ++ int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); + void (*xDelete)(Fts5Tokenizer*); +- int (*xTokenize)( +- Fts5Tokenizer*, void* pCtx, int flags, /* Mask of FTS5_TOKENIZE_* flags */ +- const char* pText, int nText, +- int (*xToken)(void* pCtx, /* Copy of 2nd argument to xTokenize() */ +- int tflags, /* Mask of FTS5_TOKEN_* flags */ +- const char* pToken, /* Pointer to buffer containing token */ +- int nToken, /* Size of token in bytes */ +- int iStart, /* Byte offset of token within input text */ +- int iEnd /* Byte offset of end of token within input text */ +- )); ++ int (*xTokenize)(Fts5Tokenizer*, ++ void *pCtx, ++ int flags, /* Mask of FTS5_TOKENIZE_* flags */ ++ const char *pText, int nText, ++ int (*xToken)( ++ void *pCtx, /* Copy of 2nd argument to xTokenize() */ ++ int tflags, /* Mask of FTS5_TOKEN_* flags */ ++ const char *pToken, /* Pointer to buffer containing token */ ++ int nToken, /* Size of token in bytes */ ++ int iStart, /* Byte offset of token within input text */ ++ int iEnd /* Byte offset of end of token within input text */ ++ ) ++ ); + }; + + /* Flags that may be passed as the third argument to xTokenize() */ +-# define FTS5_TOKENIZE_QUERY 0x0001 +-# define FTS5_TOKENIZE_PREFIX 0x0002 +-# define FTS5_TOKENIZE_DOCUMENT 0x0004 +-# define FTS5_TOKENIZE_AUX 0x0008 ++#define FTS5_TOKENIZE_QUERY 0x0001 ++#define FTS5_TOKENIZE_PREFIX 0x0002 ++#define FTS5_TOKENIZE_DOCUMENT 0x0004 ++#define FTS5_TOKENIZE_AUX 0x0008 + + /* Flags that may be passed by the tokenizer implementation back to FTS5 + ** as the third argument to the supplied xToken callback. */ +-# define FTS5_TOKEN_COLOCATED 0x0001 /* Same position as prev. token */ ++#define FTS5_TOKEN_COLOCATED 0x0001 /* Same position as prev. token */ + + /* + ** END OF CUSTOM TOKENIZERS +@@ -11945,29 +12126,42 @@ struct fts5_tokenizer { + */ + typedef struct fts5_api fts5_api; + struct fts5_api { +- int iVersion; /* Currently always set to 2 */ ++ int iVersion; /* Currently always set to 2 */ + + /* Create a new tokenizer */ +- int (*xCreateTokenizer)(fts5_api* pApi, const char* zName, void* pContext, +- fts5_tokenizer* pTokenizer, void (*xDestroy)(void*)); ++ int (*xCreateTokenizer)( ++ fts5_api *pApi, ++ const char *zName, ++ void *pContext, ++ fts5_tokenizer *pTokenizer, ++ void (*xDestroy)(void*) ++ ); + + /* Find an existing tokenizer */ +- int (*xFindTokenizer)(fts5_api* pApi, const char* zName, void** ppContext, +- fts5_tokenizer* pTokenizer); ++ int (*xFindTokenizer)( ++ fts5_api *pApi, ++ const char *zName, ++ void **ppContext, ++ fts5_tokenizer *pTokenizer ++ ); + + /* Create a new auxiliary function */ +- int (*xCreateFunction)(fts5_api* pApi, const char* zName, void* pContext, +- fts5_extension_function xFunction, +- void (*xDestroy)(void*)); ++ int (*xCreateFunction)( ++ fts5_api *pApi, ++ const char *zName, ++ void *pContext, ++ fts5_extension_function xFunction, ++ void (*xDestroy)(void*) ++ ); + }; + + /* + ** END OF REGISTRATION API + *************************************************************************/ + +-# ifdef __cplusplus +-} /* end of the 'extern "C"' block */ +-# endif ++#ifdef __cplusplus ++} /* end of the 'extern "C"' block */ ++#endif + + #endif /* _FTS5_H */ + diff --git a/patches/porting-sh4/Add-sh4-support-to-Thunderbird.patch b/patches/porting-sh4/Add-sh4-support-to-Thunderbird.patch new file mode 100644 index 0000000000..e64bf7bb73 --- /dev/null +++ b/patches/porting-sh4/Add-sh4-support-to-Thunderbird.patch @@ -0,0 +1,559 @@ +From: John Paul Adrian Glaubitz +Date: Thu, 18 May 2017 19:08:05 +0200 +Subject: Add sh4 support to Thunderbird + +Cherry-picked and adapted patches from Firefox upstream: +- 5a74d13630a969473f72a143f37728f5bb87f552 +Bug 1329194 - mozbuild: Add SH4 as target architecture. +- b179235c38eb631286f9e2fd4a7b23361dbab6d2 +Bug 1329194 - js:jit: Use PowerPC atomic operations on SH. +- ba58645c87ed7e08b16adc3b40f0c6e3b6a2e140 +Bug 1329194 - mfbt:tests: Define RETURN_INSTR for SH in TestPoisonArea. +- 942df3d3a4a1db3d182e97c54fb1705c50128470 +Bug 1329194 - ipc:chromium: Add platform defines for SH. +- 85ae466ed90b3a0cac396aed24722ce4d0febb31 +Bug 1329194 - media:webrtc: Add platform defines for SH. +- 5a74d13630a969473f72a143f37728f5bb87f552 +Bug 1329194 - mozbuild: Add SH4 as target architecture. +- (not committed upstream yet) +Bug 382214 - xpcom: Add xptcall support for Linux/SH +- (not committed upstream yet) +Bug 382214 - xpcom: Make SH xpctcall inline assembly position-independent + +Closes: #859508 +--- + python/mozbuild/mozbuild/configure/constants.py | 1 + + .../test/configure/test_toolchain_configure.py | 3 + + xpcom/reflect/xptcall/md/unix/moz.build | 5 + + .../xptcall/md/unix/xptcinvoke_linux_sh.cpp | 210 +++++++++++++++++ + .../reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp | 262 +++++++++++++++++++++ + 5 files changed, 481 insertions(+) + create mode 100644 xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_sh.cpp + create mode 100644 xpcom/reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp + +diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py +index e8401fc..f44db99 100644 +--- a/python/mozbuild/mozbuild/configure/constants.py ++++ b/python/mozbuild/mozbuild/configure/constants.py +@@ -90,6 +90,7 @@ CPU_preprocessor_checks = OrderedDict(( + ('mips32', '__mips__'), + ('sh4', '__sh__'), + ('m68k', '__m68k__'), ++ ('sh4', '__sh__'), + )) + + assert sorted(CPU_preprocessor_checks.keys()) == sorted(CPU.POSSIBLE_VALUES) +diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +index 6783e89..61c612a 100755 +--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py ++++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +@@ -1214,6 +1214,9 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest): + 'm68k-unknown-linux-gnu': big_endian + { + '__m68k__': 1, + }, ++ 'sh4-unknown-linux-gnu': little_endian + { ++ '__sh__': 1, ++ }, + } + + PLATFORMS['powerpc64le-unknown-linux-gnu'] = \ +diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build +index 61a364a..52b7988 100644 +--- a/xpcom/reflect/xptcall/md/unix/moz.build ++++ b/xpcom/reflect/xptcall/md/unix/moz.build +@@ -252,6 +252,11 @@ if CONFIG['OS_ARCH'] == 'Linux': + CXXFLAGS += [ + '-fno-integrated-as', + ] ++ elif CONFIG['OS_TEST'] in ('sh4', 'sh4a'): ++ SOURCES += [ ++ 'xptcinvoke_linux_sh.cpp', ++ 'xptcstubs_linux_sh.cpp', ++ ] + + FINAL_LIBRARY = 'xul' + +diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_sh.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_sh.cpp +new file mode 100644 +index 0000000..6462551 +--- /dev/null ++++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_linux_sh.cpp +@@ -0,0 +1,210 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1998 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * - Copyright (C) 2008-2009 STMicroelectronics ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * Based on the neutroni port, however that assumed that the compiler was pushing params ++ * onto the stack. Change to take this into account. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++ ++/* Recommended reference guides are: ++ * ++ * + SH-4 CPU Core Architecture - http://www.st.com/resource/en/user_manual/cd00147165.pdf ++ * + SH-4 Software Manual - https://documentation.renesas.com/eng/products/mpumcu/rej09b0318_sh_4sm.pdf ++ * ++ */ ++ ++#include "xptcprivate.h" ++ ++extern "C" { ++ ++const int c_int_register_params = 4; ++const int c_float_register_params = 8; ++ ++static PRUint32 __attribute__((__used__)) ++copy_to_stack(PRUint32 **that,PRUint32 methodIndex,PRUint32 paramCount, nsXPTCVariant* s,PRUint32* data) ++{ ++ int intCount = 1; // Because of that ++ int floatCount = 0; ++ PRUint32 *intRegParams=data+1 ; ++ float *floatRegParams = (float *)(data+4); ++ ++ /* Push the that register into the right place so it can be restored on exit */ ++ *data= (PRUint32)(that); ++ data+=12; /* 4 integer registers, and 8 floating point registers */ ++ ++ for ( PRUint32 i = 0; i < paramCount; ++i, ++s ) ++ { ++ nsXPTType type = s->IsPtrData() ? nsXPTType::T_I32 : s->type; ++ ++ switch ( type ) { ++ case nsXPTType::T_I64: ++ case nsXPTType::T_U64: ++ // Space to pass in registers? ++ if ( (c_int_register_params - intCount) >= 2 ) { ++ *((PRInt64 *) intRegParams) = s->val.i64; ++ intRegParams += 2; ++ intCount += 2; ++ } ++ else { ++ *((PRInt64*) data) = s->val.i64; ++ data += 2; ++ } ++ break; ++ case nsXPTType::T_FLOAT: ++ // Space to pass in registers? ++ if ( floatCount < c_float_register_params ) { ++ *floatRegParams = s->val.f; ++ ++floatCount; ++ ++floatRegParams; ++ } ++ else { ++ *((float*) data) = s->val.f; ++ ++data; ++ } ++ break; ++ case nsXPTType::T_DOUBLE: ++ // Space to pass in registers? ++ if ( (c_float_register_params - floatCount) >= 2 ) { ++ if ( (floatCount & 1) != 0 ) { ++ ++floatCount; ++ ++floatRegParams; ++ } ++ *(double *)floatRegParams = s->val.d; ++ floatCount += 2; ++ floatRegParams += 2; ++ } ++ else { ++ *((double *) data) = s->val.d; ++ data += 2; ++ } ++ break; ++ default: // 32 (non-float) value ++ PRInt32 value = (PRInt32) (s->IsPtrData() ? s->ptr : s->val.p); ++ // Space to pass in registers? ++ if ( intCount < c_int_register_params ) { ++ *intRegParams = value; ++ ++intRegParams; ++ ++intCount; ++ } ++ else { ++ *data = value; ++ ++data; ++ } ++ break; ++ } ++ } ++ ++ /* Now calculate the return address ++ * Dereference that to get vtable pointer ++ */ ++ return *( (*(that))+(methodIndex) ); ++ ++} ++ ++} ++ ++ /* This was originally done as a C function, but the original code was ++ * relying on how the compiler laid out the stack. Later versions of ++ * gcc do a better job of optimising and never push the parameters on the ++ * stack. So it is simpler to just write the whole thing in assembler anyway ++ */ ++ ++ /* Because the SH processor passes the first few parameters in registers ++ it is a bit tricky setting things up right. To make things easier, ++ all the hard work will be done by copy_to_stack above. We pass to it ++ a chunk of memory, the bottom of which will be copied to registers r4 to r7 ++ and fr4 to fr11 before calling the target function. ++ */ ++ ++/* r4= that, r5=methodIndex,r6=paramCount,r7=params */ ++ ++ __asm__ ( ++ ++ ++ /* Make space for parameters to be passed to the method. Assume worst case ++ 8 bytes per parameter. Also leave space for 4 longs and 8 floats that ++ will be put into registers. The worst case is all int64 parameters ++ and even in this case 8 bytes are passed in registers so we can ++ deduct this from our allocation. ++ */ ++ ".section .text\n" ++ ".balign 4\n" ++ ".global NS_InvokeByIndex\n" ++ "NS_InvokeByIndex:\n" ++ "mov.l r14, @-r15 \n\t" // Push frame ++ "sts.l pr, @-r15 \n\t" // Push link ++ "mov.l r8, @-r15 \n\t" // Save ++ "mov r15, r14\n\t" // Set frame ++ "mov #3, r1 \n\t" // Assume worse case, all params are 64bit, hence *8 ++ "mov r6, r2\n\t" ++ "shld r1, r2 \n\t" ++ "mov r2, r8 \n\t" // Save stack drop ++ "add #48, r2 \n\t" // Space for 4 longs, 8 floats ++ "sub r2, r15 \n\t" // Drop stack ++ "mov.l 1f, r1 \n\t" // Get relative address of copy_to_stack_function ++ "bsrf r1 \n\t" ++ "mov.l r15, @-r15 \n\t" // Params will be dumped here ++ "0:\n\t" ++ "add #4, r15 \n\t" // Pop stack ptr param. r0 contains method address ++ ++ /* Now everything is laid out nicely in the stack. We just have to ++ load values at the top end of the memory area into registers and ++ make the call. We may load more things into registers than needed, ++ but nobody will care about that. ++ */ ++ ++ "mov.l @r15+, r4 \n\t" // that ++ "mov.l @r15+, r5 \n\t" ++ "mov.l @r15+, r6 \n\t" ++ "mov.l @r15+, r7 \n\t" ++ "fmov.s @r15+, fr5 \n\t" ++ "fmov.s @r15+, fr4 \n\t" ++ "fmov.s @r15+, fr7 \n\t" ++ "fmov.s @r15+, fr6 \n\t" ++ "fmov.s @r15+, fr9 \n\t" ++ "fmov.s @r15+, fr8 \n\t" ++ "fmov.s @r15+, fr11 \n\t" ++ "jsr @r0 \n\t" // Invoke method ++ "fmov.s @r15+, fr10 \n\t" ++ "add r8, r15\n\t" // Pop stack back ++ "mov.l @r15+, r8\n\t" // Restore r8 ++ "lds.l @r15+, pr\n\t" ++ "rts\n\t" ++ "mov.l @r15+, r14\n\t" ++ ".balign 4\n\t" ++ "1: .long copy_to_stack - 0b \n\t" ++ ); +diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp +new file mode 100644 +index 0000000..b40482d +--- /dev/null ++++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_linux_sh.cpp +@@ -0,0 +1,262 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1999 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * - Copyright (C) 2008-2009 STMicroelectronics ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * Based on the neutrino code, with some bug fixes and using the C preprocessor ++ * like all the other ports rather than the python script. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++ ++/* Recommended reference guides are: ++ * ++ * + SH-4 CPU Core Architecture - http://www.st.com/resource/en/user_manual/cd00147165.pdf ++ * + SH-4 Software Manual - https://documentation.renesas.com/eng/products/mpumcu/rej09b0318_sh_4sm.pdf ++ * ++ */ ++ ++#include "xptcprivate.h" ++#include "xptiprivate.h" ++ ++const int c_int_register_params = 3; ++const int c_float_register_params = 8; ++ ++/* ++ Dispatch function for all stubs. ++ ++ The parameters to the original function are spread between 'data' which ++ is value of the stack pointer when the stub was called, intRegParams which ++ points to an area containing the values of r5, r6 and r7 when the stub was ++ called and floatRegParams which points to an area containing the values ++ of float registers fr4 to fr11 when the stub was called. ++ ++ */ ++extern "C" nsresult ++PrepareAndDispatch(nsXPTCStubBase* self, int methodIndex, PRUint32* data, ++ PRUint32 *intRegParams, float *floatRegParams) ++{ ++#define PARAM_BUFFER_COUNT 16 ++ ++ nsresult result = NS_ERROR_FAILURE; ++ int intCount = 0; ++ int floatCount = 0; ++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; ++ nsXPTCMiniVariant* dispatchParams = NULL; ++ const nsXPTMethodInfo* info; ++ PRUint8 paramCount; ++ PRUint8 i; ++ ++ NS_ASSERTION(self,"no self"); ++ ++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); ++ NS_ASSERTION(info,"no interface info"); ++ ++ paramCount = info->GetParamCount(); ++ ++ // setup variant array pointer ++ if(paramCount > PARAM_BUFFER_COUNT) ++ dispatchParams = new nsXPTCMiniVariant[paramCount]; ++ else ++ dispatchParams = paramBuffer; ++ NS_ASSERTION(dispatchParams,"no place for params"); ++ ++ for ( i = 0; i < paramCount; ++i ) { ++ const nsXPTParamInfo& param = info->GetParam(i); ++ nsXPTCMiniVariant* dp = &dispatchParams[i]; ++ nsXPTType type = param.IsOut() ? nsXPTType::T_I32 : param.GetType(); ++ ++ switch ( type ) { ++ case nsXPTType::T_I64: ++ case nsXPTType::T_U64: ++ // Was this passed in a register? ++ if ( (c_int_register_params - intCount) >= 2 ) { ++ dp->val.i64 = *((PRInt64 *) intRegParams); ++ intRegParams += 2; ++ intCount += 2; ++ } ++ else { ++ dp->val.i64 = *((PRInt64*) data); ++ data += 2; ++ } ++ break; ++ case nsXPTType::T_FLOAT: ++ // Was this passed in a register? ++ if ( floatCount < c_float_register_params ) { ++ dp->val.f = *floatRegParams; ++ ++floatCount; ++ ++floatRegParams; ++ } ++ else { ++ dp->val.f = *((float*) data); ++ ++data; ++ } ++ break; ++ case nsXPTType::T_DOUBLE: ++ // Was this passed in a register? ++ if ( (c_float_register_params - floatCount) >= 2 ) { ++ if ( floatCount & 1 != 0 ) { ++ ++floatCount; ++ ++floatRegParams; ++ } ++ dp->val.d = *(double *)floatRegParams; ++ floatCount += 2; ++ floatRegParams += 2; ++ } ++ else { ++ dp->val.d = *((double *) data); ++ data += 2; ++ } ++ break; ++ default: // 32-bit (non-float) value ++ // Was this passed in a register? ++ if ( intCount < c_int_register_params ) { ++ dp->val.i32 = *intRegParams; ++ ++intRegParams; ++ ++intCount; ++ } ++ else { ++ dp->val.i32 = *data; ++ ++data; ++ } ++ break; ++ } ++ } ++ ++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); ++ ++ if(dispatchParams != paramBuffer) ++ delete [] dispatchParams; ++ ++ return result; ++} ++ ++ ++__asm__ ( ++ ".text\n" ++ ".little\n" ++ ++ ".globl SharedStub\n" ++ ".type SharedStub, @function\n" ++ "SharedStub:\n" ++ "mov r15, r1\n" ++ "mov.l r14,@-r15\n" ++ "sts.l pr,@-r15\n" ++ "mov r15, r14\n" ++ ++ /* Some parameters might have been passed in registers, so push them ++ * all onto the stack, PrepareAndDispatch can then work out whats what ++ * given method type information. ++ */ ++ "mov.l r7, @-r15\n" ++ "mov.l r6, @-r15\n" ++ "mov.l r5, @-r15\n" ++ "mov r15, r7\n" /* r7 = PrepareAndDispatch intRegParams param */ ++ ++ "fmov.s fr10, @-r15\n" ++ "fmov.s fr11, @-r15\n" ++ "fmov.s fr8, @-r15\n" ++ "fmov.s fr9, @-r15\n" ++ "fmov.s fr6, @-r15\n" ++ "fmov.s fr7, @-r15\n" ++ "fmov.s fr4, @-r15\n" ++ "fmov.s fr5, @-r15\n" ++ "mov.l r15, @-r15\n" /* PrepareAndDispatch floatRegParams param */ ++ ++ "mov r1, r6\n" /* r6 = PrepareAndDispatch data param */ ++ ++ "mov.l 1f, r1\n" ++ "bsrf r1\n" /* Note, following instruction is executed first*/ ++ "mov r2, r5\n" /* r5 = PrepareAndDispatch methodIndex param */ ++ "0:\n" ++ ++ "mov r14,r15\n" ++ "lds.l @r15+,pr\n" ++ "mov.l @r15+,r14\n" ++ "rts\n" ++ "nop\n" ++ ".align 2\n" ++ "1:\n" ++ ".long PrepareAndDispatch - 0b\n" ++ ); ++ ++#define STUB_ENTRY(n) \ ++__asm__( \ ++ ".text\n" \ ++ ".align 1 \n" \ ++ ".if " #n " < 10\n\t" \ ++ ".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n"\ ++ "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 100\n\t" \ ++ ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n"\ ++ "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 1000\n\t" \ ++ ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n"\ ++ "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \ ++ ".else\n\t" \ ++ ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \ ++ ".endif\n\t" \ ++ "mov.l 1f, r1 \n" \ ++ ".if "#n" < 128 \n" \ ++ "braf r1 \n" \ ++ " mov #"#n",r2 \n" \ ++ ".elseif "#n" < 256 \n" \ ++ "mov #"#n", r2 \n" \ ++ "braf r1 \n" \ ++ " extu.b r2, r2 \n" \ ++ ".else \n" \ ++ "mov #"#n" & 0xff,r2 \n" \ ++ "extu.b r2, r2 \n" \ ++ "mov #"#n">>8, r3 \n" \ ++ "shll8 r3 \n" \ ++ "braf r1 \n" \ ++ " or r3, r2 \n" \ ++ ".endif \n" \ ++ "0: \n" \ ++ ".align 2\n" \ ++ "1:\n" \ ++ ".long SharedStub - 0b\n" \ ++ ); ++ ++ ++#define SENTINEL_ENTRY(n) \ ++nsresult nsXPTCStubBase::Sentinel##n() \ ++{ \ ++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ ++ return NS_ERROR_NOT_IMPLEMENTED; \ ++} ++ ++#include "xptcstubsdef.inc" diff --git a/patches/porting/Disable-optimization-on-alpha-for-the-url-classifier.patch b/patches/porting/Disable-optimization-on-alpha-for-the-url-classifier.patch new file mode 100644 index 0000000000..3cf2b0062f --- /dev/null +++ b/patches/porting/Disable-optimization-on-alpha-for-the-url-classifier.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Sun, 2 Nov 2008 17:56:24 +0100 +Subject: Disable optimization on alpha for the url-classifier component + +The use of this component leads to crashes when built with optimizations. +--- + comm/suite/components/build/Makefile.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/comm/suite/components/build/Makefile.in b/comm/suite/components/build/Makefile.in +index 2387227..d5ca1ba 100644 +--- a/comm/suite/components/build/Makefile.in ++++ b/comm/suite/components/build/Makefile.in +@@ -6,3 +6,7 @@ include $(topsrcdir)/config/rules.mk + + # Ensure that we don't embed a manifest referencing the CRT. + EMBED_MANIFEST_AT = ++ ++ifeq ($(OS_TEST),alpha) ++MOZ_OPTIMIZE_FLAGS := -O0 ++endif diff --git a/patches/porting/Work-around-GCC-ICE-on-mips-i386-and-s390x.patch b/patches/porting/Work-around-GCC-ICE-on-mips-i386-and-s390x.patch new file mode 100644 index 0000000000..052d73d838 --- /dev/null +++ b/patches/porting/Work-around-GCC-ICE-on-mips-i386-and-s390x.patch @@ -0,0 +1,24 @@ +From: Mike Hommey +Date: Fri, 12 Jul 2019 18:28:34 +0900 +Subject: Work around GCC ICE on mips*, i386 and s390x + +Cherry picked from Firefox packaging. + +Closes: #931757 +--- + gfx/skia/skia/third_party/skcms/src/Transform_inl.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gfx/skia/skia/third_party/skcms/src/Transform_inl.h b/gfx/skia/skia/third_party/skcms/src/Transform_inl.h +index c4b3122..698acdc 100644 +--- a/gfx/skia/skia/third_party/skcms/src/Transform_inl.h ++++ b/gfx/skia/skia/third_party/skcms/src/Transform_inl.h +@@ -685,7 +685,7 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) { + // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3) + // when targeting MIPS 64, i386, or s390x, I think attempting to inline clut() into exec_ops(). + #if 1 && defined(__GNUC__) && !defined(__clang__) \ +- && (defined(__mips64) || defined(__i386) || defined(__s390x__)) ++ && (defined(__mips) || defined(__i386) || defined(__s390x__)) + #define MAYBE_NOINLINE __attribute__((noinline)) + #else + #define MAYBE_NOINLINE diff --git a/patches/prefs/Don-t-auto-disable-extensions-in-system-directories.patch b/patches/prefs/Don-t-auto-disable-extensions-in-system-directories.patch new file mode 100644 index 0000000000..264b057f48 --- /dev/null +++ b/patches/prefs/Don-t-auto-disable-extensions-in-system-directories.patch @@ -0,0 +1,21 @@ +From: Christoph Goehre +Date: Sat, 24 Mar 2012 11:54:43 +0100 +Subject: Don't auto-disable extensions in system directories + +--- + comm/mail/app/profile/all-thunderbird.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/comm/mail/app/profile/all-thunderbird.js b/comm/mail/app/profile/all-thunderbird.js +index 363b1da..6bccb25 100644 +--- a/comm/mail/app/profile/all-thunderbird.js ++++ b/comm/mail/app/profile/all-thunderbird.js +@@ -143,7 +143,7 @@ pref("extensions.hotfix.certs.2.sha1Fingerprint", "39:E7:2B:7A:5B:CF:37:78:F9:5D + // Disable add-ons installed into the shared user and shared system areas by + // default. This does not include the application directory. See the SCOPE + // constants in AddonManager.jsm for values to use here +-pref("extensions.autoDisableScopes", 15); ++pref("extensions.autoDisableScopes", 3); + + // Enable add-ons installed and owned by the application, like the default theme. + pref("extensions.startupScanScopes", 4); diff --git a/patches/prefs/Set-javascript.options.showInConsole.patch b/patches/prefs/Set-javascript.options.showInConsole.patch new file mode 100644 index 0000000000..858b2801e0 --- /dev/null +++ b/patches/prefs/Set-javascript.options.showInConsole.patch @@ -0,0 +1,33 @@ +From: Mike Hommey +Date: Sat, 8 Dec 2007 19:24:40 +0100 +Subject: Set javascript.options.showInConsole + +--- + modules/libpref/init/all.js | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js +index aa373d1..a211fe5 100644 +--- a/modules/libpref/init/all.js ++++ b/modules/libpref/init/all.js +@@ -1148,11 +1148,20 @@ pref("javascript.options.ion.offthread_compilation", true); + // memory, but makes things like Function.prototype.toSource() + // fail. + pref("javascript.options.discardSystemSource", false); ++pref("javascript.options.showInConsole", true); + + // Many of the the following preferences tune the SpiderMonkey GC, if you + // change the defaults here please also consider changing them in + // js/src/jsgc.cpp. They're documented in js/src/jsapi.h. + ++// JSGC_MAX_MALLOC_BYTES ++// How much malloc memory can be allocated before triggering a GC, in MB. ++// This preference limits the memory usage of javascript. ++// If you want to change these values for your device, ++// please find Bug 417052 comment 17 and Bug 456721 ++// Comment 32 and Bug 613551. ++pref("javascript.options.mem.high_water_mark", 128); ++ + // JSGC_MAX_BYTES + // SpiderMonkey defaults to 2^32-1 bytes, but this is measured in MB so that + // cannot be represented directly in order to show it in about:config. diff --git a/patches/series b/patches/series new file mode 100644 index 0000000000..891a24e4f2 --- /dev/null +++ b/patches/series @@ -0,0 +1,39 @@ +thunderbird-l10n/sl-change-Edit-Uredi-to-CTRL-E.patch +debian-hacks/Strip-version-number-from-application-before-installation.patch +debian-hacks/Add-another-preferences-directory-for-applications-p.patch +porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch +porting/Disable-optimization-on-alpha-for-the-url-classifier.patch +fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch +fixes/Appdata-Adding-some-German-translations.patch +fixes/Appdata-Fix-up-AppStream-error-by-adding-missing-field.patch +debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch +porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch +debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch +porting-kfreebsd-hurd/Allow-ipc-code-to-build-on-GNU-hurd.patch +fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch +prefs/Set-javascript.options.showInConsole.patch +prefs/Don-t-auto-disable-extensions-in-system-directories.patch +fixes/Bug-628252-os2.cc-fails-to-compile-against-GCC-4.6-m.patch +porting-kfreebsd-hurd/ipc-chromium-fix-if-define-for-kFreeBSD-and-Hurd.patch +porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch +porting-kfreebsd-hurd/adding-missed-HURD-adoptions.patch +porting-m68k/Add-m68k-support-to-Thunderbird.patch +porting-sh4/Add-sh4-support-to-Thunderbird.patch +porting-armel/Bug-1463035-Remove-MOZ_SIGNAL_TRAMPOLINE.-r-darchons.patch +porting-armel/Avoid-using-vmrs-vmsr-on-armel.patch +porting-armhf/Bug-1526653-Include-struct-definitions-for-user_vfp-and-u.patch +fixes/Allow-.js-preference-files-to-set-locked-prefs-with-lockP.patch +fixes/Bug-1556197-amend-Bug-1544631-for-fixing-mips32.patch +debian-hacks/Work-around-Debian-bug-844357.patch +debian-hacks/Set-program-name-from-the-remoting-name.patch +debian-hacks/Use-remoting-name-for-call-to-gdk_set_program_class.patch +porting/Work-around-GCC-ICE-on-mips-i386-and-s390x.patch +porting-ppc64el/work-around-a-build-failure-with-clang-on-ppc64el.patch +porting-armhf/Don-t-use-LLVM-internal-assembler-on-armhf.patch +porting-arm/Reduce-memory-usage-while-linking-on-arm-el-hf-platforms.patch +debian-hacks/Make-Thunderbird-build-reproducible.patch +porting-s390x/Use-more-recent-embedded-version-of-sqlite3.patch +fixes/Add-missing-bindings-for-mips-in-the-authenticator-crate.patch +fixes/reduce-the-rust-debuginfo-level-on-selected-architectures.patch +fixes/Bug-1650299-Unify-the-inclusion-of-the-ICU-data-file.-r-f.patch +fixes/Don-t-build-ICU-in-parallel.patch diff --git a/patches/thunderbird-l10n/sl-change-Edit-Uredi-to-CTRL-E.patch b/patches/thunderbird-l10n/sl-change-Edit-Uredi-to-CTRL-E.patch new file mode 100644 index 0000000000..5ff8b70469 --- /dev/null +++ b/patches/thunderbird-l10n/sl-change-Edit-Uredi-to-CTRL-E.patch @@ -0,0 +1,22 @@ +From: Christoph Goehre +Date: Mon, 5 Sep 2011 19:21:25 +0200 +Subject: sl: change Edit (Uredi) to CTRL+E + +Closes: #601331 +--- + thunderbird-l10n/sl/chrome/sl/locale/sl/communicator/utilityOverlay.dtd | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/thunderbird-l10n/sl/chrome/sl/locale/sl/communicator/utilityOverlay.dtd b/thunderbird-l10n/sl/chrome/sl/locale/sl/communicator/utilityOverlay.dtd +index 0d319bc..1f6ae24 100644 +--- a/thunderbird-l10n/sl/chrome/sl/locale/sl/communicator/utilityOverlay.dtd ++++ b/thunderbird-l10n/sl/chrome/sl/locale/sl/communicator/utilityOverlay.dtd +@@ -10,7 +10,7 @@ + + + +- ++ + + + diff --git a/repack.py b/repack.py new file mode 100755 index 0000000000..47b1171ad6 --- /dev/null +++ b/repack.py @@ -0,0 +1,204 @@ +#!/usr/bin/python3 + +from optparse import OptionParser +import fnmatch +import tarfile +import io +import re +import os +import sys +import email +import urllib.request, urllib.error, urllib.parse +from urllib.parse import urlparse + +class URLFile(object): + '''Simple proxy to urllib2.urlopen, that responds to seek only if + it's called before read. This is enough for tarfile to be happy''' + + def __init__(self, url): + self.file = urllib.request.urlopen(url) + + def seek(self, offset, whence = os.SEEK_SET): + if whence != os.SEEK_SET or offset != 0 or self.read == self._read: + raise "unsupported" + + def _read(self, size = -1): + return self.file.read(size) + + def read(self, size = -1): + self.read = self._read + return self._read(size) + + def close(self): + self.file.close() + +def dirname(filespec): + '''Returns os.path.dirname if a file, and '' if an url''' + if urlparse(filespec).scheme: + return '' + return os.path.dirname(filespec) + +class TarFilterList(object): + def __init__(self, filename): + self.patterns = {} + for filt in open(filename).readlines(): + f = filt.strip().split(None, 1) + if len(f) == 1: + [pat] = f + cmd = None + else: + [pat, cmd] = f + + pat = pat.split(os.sep) + self.add_pattern(pat, self.patterns, cmd) + + def add_pattern(self, pat, patterns, cmd): + if re.search(r'[\[\?\*]', pat[0]): + if not '*' in patterns: + patterns['*'] = [] + patterns['*'].append([os.sep.join(pat), cmd, False]) + else: + if not pat[0] in patterns: + patterns[pat[0]] = {} + if len(pat) > 2: + self.add_pattern(pat[1:], patterns[pat[0]], cmd) + else: + if not '*' in patterns[pat[0]]: + patterns[pat[0]]['*'] = [] + patterns[pat[0]]['*'].append([os.sep.join(pat[1:]), cmd, False]) + + def match(self, name): + name = name.split(os.sep)[1:] + if len(name) == 0: + return False + return self._match(name, self.patterns) + + def _match(self, name, patterns): + if len(name) > 1 and name[0] in patterns: + cmd = self._match(name[1:], patterns[name[0]]) + if cmd != False: + return cmd + if '*' in patterns: + for pat in patterns['*']: + if fnmatch.fnmatch(name[0], pat[0]) or fnmatch.fnmatch(os.sep.join(name), pat[0]): + pat[2] = True + return pat[1] + return False + + def unused(self, patterns=None, root=''): + result = [] + if root: + root += '/' + if not patterns: + patterns = self.patterns + for pat in patterns: + if pat != '*': + result += self.unused(patterns[pat], root + pat) + else: + for p in patterns[pat]: + if not p[2]: + result.append(root + p[0]) + return result + +def file_extension(name): + return os.path.splitext(name)[1][1:] + +def filter_tar(orig, new, filt): + def u8(x): + return x.decode('utf-8') + + filt = TarFilterList(filt) + if urlparse(orig).scheme: + tar = tarfile.open(orig, "r:" + file_extension(orig), URLFile(orig)) + else: + tar = tarfile.open(orig, "r:" + file_extension(orig)) + new_tar = tarfile.open(new + ".new", "w:" + file_extension(new)) + + while True: + info = tar.next() + if not info: + break + do_filt = filt.match(info.name) + if do_filt == None: + print("Removing %s" % (info.name), file=sys.stderr) + continue + + if info.isfile(): + file = tar.extractfile(info) + if do_filt: + print("Filtering %s" % (info.name), file=sys.stderr) + orig = file + file = io.BytesIO() + the_filt = lambda l: u8(l) + if do_filt[0].isalpha(): + f = do_filt.split(do_filt[1]) + if f[0] == 's': + the_filt = lambda l: re.sub(f[1], f[2], u8(l)) + else: + f = do_filt.split(do_filt[0]) + if f[2] == 'd': + the_filt = lambda l: "" if re.search(f[1], u8(l)) else u8(l) + file.writelines([x.encode('utf-8') for x in map(the_filt, orig.readlines())]) + file.seek(2, 0) + info.size = file.tell() + file.seek(0); + new_tar.addfile(info, file) + else: + new_tar.addfile(info) + + tar.close() + new_tar.close() + os.rename(new_tar.name, new) + unused = filt.unused() + if unused: + print('Unused filters:') + print('', '\n '.join(unused)) + exit(1) + +def get_package_name(): + control = os.path.join(os.path.dirname(__file__), "control") + return email.parser.Parser().parse(open(control), headersonly=True)["Source"] + + +def main(): + parser = OptionParser("%prog [options] tarball") + parser.add_option("-u", "--upstream-version", dest="upstream_version", + help="define upstream version number to use when creating the file", + metavar="VERSION") + parser.add_option("-f", "--filter", dest="filter", + help="use the given filter list", metavar="FILE") + parser.add_option("-p", "--package", dest="package", + help="use the given package name", metavar="NAME") + parser.add_option("-c", "--compression", dest="compression", + help="use the given compression for the new tarball") + (options, args) = parser.parse_args() + + if len(args) < 1: + parser.error("Too few arguments! You may want to use option '--help' for usage first?") + return + if len(args) > 1: + parser.error("Too many arguments! You may want to use option '--help' for usage first?") + return + + if not options.upstream_version: + parser.error("Need an upstream version") + return + + if not options.filter: + options.filter = os.path.join(os.path.dirname(__file__), "source.filter") + if not options.package: + options.package = get_package_name() + + if os.path.islink(args[0]): + orig = os.path.realpath(args[0]) + new_file = args[0] + else: + orig = args[0] + compression = options.compression or file_extension(orig) + new_file = options.package + "_" + options.upstream_version + ".orig.tar." + compression + new_file = os.path.realpath(os.path.join(dirname(orig), new_file)) + print(orig, new_file) + filter_tar(orig, new_file, options.filter) + +if __name__ == '__main__': + main() diff --git a/rules b/rules new file mode 100755 index 0000000000..211ac22a7a --- /dev/null +++ b/rules @@ -0,0 +1,189 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +# checking the release type, if $(RELEASE)=UNRELEASED we won't build +# the thunderbird-dbgsym package +include /usr/share/dpkg/pkg-info.mk +RELEASE := $(DEB_DISTRIBUTION) + +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +endif + +THUNDERBIRD_VERSION=$(shell tail -1 comm/mail/config/version.txt) +DEB_AUTO_UPDATE_AUTOCONF=2.13 + +# build directory used for building the thunderbird-l10n files +THUNDERBIRD_L10N_BUILDDIR=debian/thunderbird-l10n-build + +# ID of the l10n language packs from upstream, need to match the application.id +# in thunderbird-l10n/$LANG/manifest.json +export MOZ_LANGPACK_ID = $(shell grep MOZ_LANGPACK_EID comm/mail/locales/Makefile.in | cut -f2 -d @) + +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk +include /usr/share/dpkg/architecture.mk + +# Use dpkg-buildflags to get build flags, but exclude -g, that is dealt with +# via configure options. Picked partially from FF. + +dpkg_buildflags = $(and $(1),$(shell DEB_CFLAGS_MAINT_STRIP="-g" DEB_CXXFLAGS_MAINT_STRIP="-g" dpkg-buildflags --get $(1))) +lazy = $(eval $(1) = $$(if $$(___$(1)),,$$(eval ___$(1) := $(2)))$$(___$(1))) +$(call lazy,CFLAGS,$$(call dpkg_buildflags,CFLAGS)) +$(call lazy,CXXFLAGS,$$(call dpkg_buildflags,CXXFLAGS)) +$(call lazy,CPPFLAGS,$$(call dpkg_buildflags,CPPFLAGS)) +$(call lazy,LDFLAGS,$$(call dpkg_buildflags,LDFLAGS)) + +# special CFLAGS for various platforms +ifeq ($(DEB_BUILD_ARCH),armel) + CFLAGS += -D__ARM_PCS + LDFLAGS += -Wl,-z,muldefs +endif + +# Reduce memory usage of the linker at the expense of processing time +# This should help on lower-end architectures like arm and mips, which +# spend an immense amount of time swapping. +LDFLAGS += -Wl,--reduce-memory-overheads +LDFLAGS += -Wl,--no-keep-memory +LDFLAGS += -Wl,--as-needed + +# Make the linker generate compressed debug sections. dh_strip would do +# the same anyways, but it allows elfhack to work in combination with +# unstripped binaries when they would normally be larger than 2GiB. +# Doing this only on 64bit architectures. +ifeq (64,$(DEB_BUILD_ARCH_BITS)) + LDFLAGS += -Wl,--compress-debug-sections=zlib +endif + +# Add execution time and memory usage stats in the logs +LDFLAGS += -Wl,--stats + +# Using the timestamp for MOZ_BUILD_DATE from the file './sourcestamp.txt' +# which is set by Mozilla while creating the release. +# This ensures we have a one-to-one date across the various package builds +# within Debian for one upstream version. This is important for user which +# are performing a dist-upgrade to a new release. +export MOZ_BUILD_DATE := ${shell head -n1 $(CURDIR)/sourcestamp.txt} +export MOZCONFIG=$(shell pwd)/mozconfig.thunderbird +export MOZILLA_OFFICIAL=1 +export DEB_BUILD_GNU_TYPE +export DEB_HOST_GNU_TYPE +export DEB_BUILD_OPTIONS +# Some Debian build tools clear out some variables +export SHELL=/bin/bash +# Work around https://github.com/rust-lang/cargo/issues/7147 +export CARGO_HOME=$(CURDIR)/debian/.cargo + +%: + dh $@ + +build: + dh $@ + +override_dh_auto_clean: + dh_auto_clean --builddirectory=obj-thunderbird + find -type f -name "*.pyc" -exec rm {} \; + rm -rf third_party/python/psutil/tmp + rm -f configure old-configure js/src/configure js/src/old-configure mozconfig.* + # needed for thunderbird-l10n + rm -rf $(THUNDERBIRD_L10N_BUILDDIR) + rm -rf $(CARGO_HOME) + +override_dh_auto_configure: + # run autoconf for all configure files + if [ "Z$(DEB_AUTO_UPDATE_AUTOCONF)" != Z ] || [ ! -e $(CURDIR)/configure ]; then \ + cd $(CURDIR) && `which autoconf$(DEB_AUTO_UPDATE_AUTOCONF) || which autoconf`; fi + if [ "Z$(DEB_AUTO_UPDATE_AUTOCONF)" != Z ] || [ ! -e $(CURDIR)/js/src/configure ]; then \ + cd $(CURDIR)/js/src && `which autoconf$(DEB_AUTO_UPDATE_AUTOCONF) || which autoconf`; fi + # copy the mozconfig files + cp debian/mozconfig.* . + # Disable debug symbols when building on 32-bits machines, because + # a) the rust compiler can't deal with it in the available address + # space, and b) the linker can't deal with it in the available address + # space either. +ifeq (32,$(DEB_BUILD_ARCH_BITS)) + echo 'ac_add_options --disable-debug-symbols' >> mozconfig.default +endif + echo 'mk_add_options MOZ_OBJDIR=$(CURDIR)/obj-thunderbird' >> mozconfig.thunderbird + echo 'ac_add_options --prefix=$(CURDIR)/debian/tmp/usr' >> mozconfig.default + # configure the various build settings for thunderbird + DIST= python3 ./mach -v configure + +# Ignore autoreconf, there is nothing that could be reconfigured. It's all +# newly generated right before debhelper would call that target. +override_dh_autoreconf: + +override_dh_auto_build: + # building the stuff + dh_auto_build --builddirectory=obj-thunderbird + # build thunderbird-l10n + mkdir -p $(THUNDERBIRD_L10N_BUILDDIR) + cd $(CURDIR)/thunderbird-l10n ;\ + for XPI in *; do \ + locale=`basename $${XPI}` ;\ + USED_LANGPACK_ID=`grep langpack- $${XPI}/manifest.json | tr '"' ' ' | awk '{print $$3}' | cut -f2-3 -d @` ;\ + if [ "$${USED_LANGPACK_ID}" != "$${MOZ_LANGPACK_ID}" ]; then \ + echo "MOZ_LANGPACK_ID mismatch! '$${USED_LANGPACK_ID}' != '$${MOZ_LANGPACK_ID}'" ;\ + echo "thunderbird-l10n l10n source '$${XPI}' uses a different MOZ_LANGPACK_ID than defined in $(CURDIR)/comm/mail/locales/Makefile.in!";\ + exit 1 ;\ + else \ + $(CURDIR)/debian/xpi-pack.sh $${XPI} ../$(THUNDERBIRD_L10N_BUILDDIR)/langpack-$${locale}@$${MOZ_LANGPACK_ID}.xpi ;\ + fi \ + done + +override_dh_auto_install: +ifneq (,$(filter mips,$(DEB_BUILD_ARCH))) + sed -i '/"javascript.options.\(baselinejit\|ion\)"/s/true/false/' obj-thunderbird/dist/bin/greprefs.js +endif + # install thunderbird into temp install folder + python3 ./mach -v install + # install, symlinking thunderbird-l10n packages + cd $(CURDIR)/thunderbird-l10n ;\ + for LANG in *; do \ + locale=`basename $${LANG}` ;\ + lowercase_locale=`echo $${locale} | tr 'A-Z' 'a-z'` ;\ + echo "preparing and working on 'thunderbird-l10n-$${lowercase_locale} (langpack-$${locale}@$${MOZ_LANGPACK_ID}.xpi)" ;\ + mkdir -p $(CURDIR)/debian/thunderbird-l10n-$${lowercase_locale}/usr/lib/thunderbird/extensions/ ;\ + install -D -m 644 ../$(THUNDERBIRD_L10N_BUILDDIR)/langpack-$${locale}@$${MOZ_LANGPACK_ID}.xpi $(CURDIR)/debian/thunderbird-l10n-$${lowercase_locale}/usr/lib/thunderbird/extensions/langpack-$${locale}@$${MOZ_LANGPACK_ID}.xpi ;\ + done + dh_bash-completion + +override_dh_install-arch: + dh_install + # apparmor profile installed by dh_install + dh_apparmor --profile-name=usr.bin.thunderbird -pthunderbird + +override_dh_install-indep: + dh_install + # remove executable rights on *.js, *.png, *.xul files + find debian/thunderbird-l10n*/ -type f \( -name "*.dtd" -o -name "*.js" -o -name "*.png" -o -name "*.properties" -o -name "*.xul" \) -exec chmod 644 {} \; + +override_dh_strip: + if [ "$(RELEASE)" != "UNRELEASED" ]; then \ + dh_strip --automatic-dbgsym ;\ + else \ + dh_strip --no-automatic-dbgsym ;\ + fi + +override_dh_shlibdeps: + dh_shlibdeps -a -l $(CURDIR)/debian/tmp/usr/lib/thunderbird -- -xlibgtk2.0-0 + +override_dh_builddeb: + # just build all packages if there is no 'UNRELEASED' within the changelog + # found, otherwise skip the thunderbird-dbgsym package, it isn't there + if [ "$(RELEASE)" != "UNRELEASED" ]; then \ + dh_builddeb ;\ + else \ + dh_builddeb -pthunderbird ;\ + dh_builddeb -plightning ;\ + for package in `grep -e \ + 'Package: thunderbird-l10n\|Package: lightning-l10n' debian/control | awk '{print $$2;}'`; do \ + dh_builddeb -p$$package ;\ + done ;\ + sed -i '/thunderbird-dbgsym/d' debian/files ;\ + fi + +.PHONY: build diff --git a/source.filter b/source.filter new file mode 100644 index 0000000000..1df46e53e1 --- /dev/null +++ b/source.filter @@ -0,0 +1,431 @@ +# Lines that are commented out are files that are needed later while building. +# Don't remove those files! +browser/app/profile/firefox.js +browser/base/content/test/general/browser_bug477014.js +browser/base/content/test/general/browser_contentAreaClick.js +browser/base/content/test/general/browser_tabkeynavigation.js +# browser/base/content/test/urlbar/browser_action_searchengine_alias.js +browser/components/enterprisepolicies/tests/browser/browser_policy_block_set_desktop_background.js +browser/components/enterprisepolicies/tests/browser/browser_policy_bookmarks.js +browser/components/extensions/test/browser/browser_ext_contextMenus_icons.js +# browser/components/extensions/test/browser/browser_ext_themes_icons.js +browser/components/migration/tests/unit/test_IE7_passwords.js +browser/components/translation/cld2/cld-worker.js +browser/components/translation/test/unit/test_cld2.js +browser/extensions/formautofill/addressmetadata/*.js +browser/extensions/formautofill/content/*.js +browser/extensions/pdfjs/content/build/*.js +browser/extensions/pdfjs/content/web/*.js +build/pgo/blueprint/valid.png +build/pgo/js-input/sunspider/string-tagcloud.html +build/pgo/js-input/sunspider/string-unpack-code.html +build/pymake/tests/pathdir/pathtest.exe +# comm/editor/ui/texzilla/content/TeXZilla.js +# comm/im/themes/messages/bubbles/Footer.html +# comm/mail/app/profile/all-thunderbird.js +# comm/mail/components/compose/content/cloudAttachmentLinkManager.js +# comm/mail/components/im/messages/bubbles/Footer.html +# comm/mail/test/resources/mozmill/docs/_build/html/_static/jquery.js +# comm/mail/test/resources/mozmill/mozmill/extension/content/editor/bespin/BespinEmbedded.js +# comm/mail/test/resources/mozmill/mozmill/extension/content/editor/bespin/BespinMain.js +# comm/mail/test/resources/mozmill/mozmill/extension/content/editor/bespin/BespinWorker.js +comm/mailnews/addrbook/test/unit/test_nsIAbCard.js +comm/mailnews/base/test/unit/test_compactColumnSave.js +comm/other-licenses/7zstub +comm/third_party/rnp/src/tests/* +configure +# devtools/client/debugger/new/debugger.js +# devtools/client/debugger/new/parser-worker.js +# devtools/client/debugger/new/pretty-print-worker.js +# devtools/client/debugger/new/search-worker.js +# devtools/client/debugger/new/test/mochitest/examples/sourcemaps-reload/v1.bundle.js +# devtools/client/debugger/new/test/mochitest/examples/sourcemaps-reload/v2.bundle.js +# devtools/client/debugger/new/test/mochitest/examples/sourcemaps3/bundle.js +# devtools/client/inspector/markup/test/browser_markup_image_tooltip_mutations.js +devtools/client/inspector/markup/test/lib_react_dom_15.4.1.js +devtools/client/inspector/markup/test/lib_react_with_addons_15.4.1.js +# devtools/client/inspector/shared/test/browser_styleinspector_tooltip-background-image.js +# devtools/client/inspector/shared/test/browser_styleinspector_tooltip-multiple-background-images.js +# devtools/client/netmonitor/test/head.js +# devtools/client/shared/demangle.js +# devtools/client/shared/source-map/assets/ +# devtools/client/shared/source-map/index.js +# devtools/client/shared/source-map/worker.js +# devtools/client/shared/test +# devtools/client/shared/vendor/WasmParser.js +# devtools/client/shared/vendor/dagre-d3.js +# devtools/client/shared/vendor/jszip.js +devtools/client/shared/vendor/react-dom-dev.js +devtools/client/shared/vendor/react-dom-server-dev.js +# devtools/client/shared/vendor/react-dom-server.js +# devtools/client/shared/vendor/react-dom.js +# devtools/client/shared/vendor/react-prop-types-dev.js +# devtools/client/shared/vendor/react-prop-types.js +# devtools/client/shared/vendor/react-redux.js +# devtools/client/shared/vendor/react-test-renderer-shallow.js +# devtools/client/shared/vendor/redux.js +# devtools/client/sourceeditor/codemirror/codemirror.bundle.js +# devtools/client/sourceeditor/codemirror/lib/codemirror.js +# devtools/client/sourceeditor/tern/ecma5.js +# devtools/server/actors/utils/automation-timeline.js +# devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js +# devtools/server/tests/unit/test_sourcemaps-09.js +# devtools/shared/acorn/acorn.js +# devtools/shared/acorn/acorn_loose.js +# devtools/shared/acorn/walk.js +# devtools/shared/sourcemap/tests/unit/test_source_node.js +dom/base/crashtests/561981-1-iframe.xhtml +dom/base/crashtests/827190.html +dom/base/crashtests/849727.html +dom/base/crashtests/xhr_html_nullresponse.html +dom/base/test/reftest/test_bug920877.html +dom/base/test/test_bug650776.html +dom/base/test/test_data_uri.html +# dom/canvas/test/crash/test_createImageBitmap-video.html +# dom/canvas/test/test_canvas.html +dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/attrib-location-length-limits.html +dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-define.html +dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1024-character-identifier.frag.html +dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-define.html +dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/shader-with-1025-character-identifier.frag.html +dom/canvas/test/webgl-conf/checkout/conformance2/glsl3/uniform-location-length-limits.html +dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc.html +dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html +dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js +dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js +dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js +# dom/encoding/test/test_BOMEncoding.js +# dom/encoding/test/test_TextDecoder.js +# dom/encoding/test/unit/test_big5.js +# dom/encoding/test/unit/test_euc-jp.js +# dom/encoding/test/unit/test_euc-kr.js +# dom/encoding/test/unit/test_gbk.js +# dom/encoding/test/unit/test_iso-2022-jp.js +# dom/encoding/test/unit/test_misc.js +# dom/encoding/test/unit/test_shift_jis.js +dom/events/test/pointerevents/pointerevent_support.js +dom/html/reftests/toblob-todataurl/sample.js +dom/html/test/bug445004-outer-write.html +# dom/html/test/test_bug582412-2.html +# dom/html/test/test_iframe_sandbox_general.html +# dom/imptests/html/js/builtins/Math.maxmin.js +# dom/indexedDB/test/test_filehandle_write_read_data.html +# dom/indexedDB/test/unit/test_filehandle_append_read_data.js +# dom/indexedDB/test/unit/test_filehandle_append_read_data.js +# dom/indexedDB/test/unit/test_snappyUpgrade.js +# dom/json/test/unit/test_decode_long_input.js +# dom/media/test/test_decoder_disable.html +dom/media/tests/crashtests/1367930_1.html +dom/media/tests/crashtests/1367930_2.html +dom/media/tests/crashtests/855796.html +dom/media/tests/crashtests/863929.html +# dom/push/test/xpcshell/test_crypto.js +dom/security/test/general/test_allow_opening_data_pdf.html +dom/tests/mochitest/localstorage/frameQuota.html +dom/tests/mochitest/localstorage/frameQuotaSessionOnly.html +editor/libeditor/tests/browserscope/lib/richtext/richtext/js/range.js +# editor/libeditor/tests/test_bug520189.html +# editor/libeditor/tests/test_inline_style_cache.html +# image/test/reftest/pngsuite-transparency +image/test/reftest/reftest.list /pngsuite-transparency/d +# image/test/unit/test_async_notification_animated.js +# image/test/unit/test_moz_icon_uri.js +intl/uconv/tests/test_long_doc.html +intl/uconv/tests/unit +js/src/configure +js/src/devtools/rootAnalysis/annotations.js +js/src/jit-test/lib/bullet.js +js/src/jit-test/lib/mandelbrot-results.js +js/src/jit-test/tests +js/src/octane/box2d.js +js/src/octane/pdfjs.js +js/src/octane/regexp.js +js/src/octane/typescript-input.js +js/src/old-configure +js/src/tests/non262/jit/regress-452498-01.js +js/src/tests/non262/RegExp/regress-209067.js +js/src/tests/non262/RegExp/regress-307456.js +js/src/tests/non262/regress/regress-243174.js +js/src/tests/non262/regress/regress-274888.js +js/src/tests/non262/regress/regress-280769.js +js/src/tests/non262/regress/regress-311629.js +js/src/tests/test262/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T1.js +js/src/tests/test262/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T2.js +js/src/tests/test262/built-ins/Array/prototype/reverse/S15.4.4.8_A2_T3.js +js/src/tests/test262/built-ins/encodeURIComponent/S15.1.3.4_A4_T2.js +js/src/tests/test262/built-ins/RegExp/prototype/exec/S15.10.6.2_A4_T12.js +js/src/tests/test262/built-ins/String/prototype/charAt/S15.5.4.4_A1_T1.js +js/src/tests/test262/built-ins/String/prototype/charAt/S15.5.4.4_A1_T2.js +js/src/tests/test262/built-ins/String/prototype/charCodeAt/S15.5.4.5_A1_T1.js +js/src/tests/test262/built-ins/String/prototype/concat/S15.5.4.6_A1_T10.js +js/src/tests/test262/built-ins/String/prototype/constructor/S15.5.4.1_A1_T2.js +js/src/tests/test262/built-ins/String/prototype/split/S15.5.4.14_A1_T13.js +js/src/tests/test262/built-ins/String/prototype/split/S15.5.4.14_A2_T7.js +js/src/tests/test262/built-ins/String/S15.5.5.1_A5.js +js/src/tests/test262/language/expressions/delete/S8.12.7_A3.js +js/src/tests/test262/language/expressions/exponentiation/bigint-arithmetic.js +js/src/tests/test262/language/types/string/S8.4_A6.1.js +js/src/tests/test262/language/types/string/S8.4_A6.2.js +layout/base/crashtests/378325-1.html +# layout/base/tests/test_scroll_snapping.html +layout/docs +layout/generic/crashtests/simple_blank.swf +layout/generic/crashtests/text-overflow-form-elements.html +layout/mathml/tests/stretchy-and-large-operators.js +layout/reftests/bugs/256180-6.html +layout/reftests/bugs/424465-1.html +layout/reftests/font-loading-api/src-list-data-1.html +layout/reftests/svg/nesting-invalid-01.js +layout/style/crashtests/404470-1.html +layout/style/test/test_shorthand_property_getters.html +layout/tools/reftest/reftest-analyzer-structured.xhtml +layout/tools/reftest/reftest-analyzer.xhtml +mobile/android/components/extensions/test/mochitest/head.js +# modules/libpref/init/all.js +modules/freetype2/docs +netwerk/protocol/ftp/doc/rfc959.txt +netwerk/test/crashtests/785753-1.html +netwerk/test/unit/data/signed_win.exe +netwerk/test/unit/test_readline.js +obj-x86_64-pc-linux-gnu/* +old-configure +other-licenses/7zstub/* +# other-licenses/7zstub/firefox/7zSD.sfx +other-licenses/nsis/Contrib/ApplicationID/ApplicationID.rc +other-licenses/nsis/Contrib/ApplicationID/resource.h +other-licenses/nsis/Contrib/ServicesHelper/resource.h +other-licenses/nsis/Contrib/ServicesHelper/ServicesHelper.rc +other-licenses/nsis/nsisui.exe +other-licenses/nsis/Plugins +parser/xml/test +# services/common/kinto-http-client.js +# services/common/kinto-offline-client.js +# testing/marionette/atom.js +# testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py/docs/_build/html/_static/jquery.js +# testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py/docs/_build/html/_static/underscore.js +testing/mochitest/browser-test.js +testing/modules/ajv-4.1.1.js +testing/modules/sinon-7.2.7.js +testing/talos/talos/scripts/jszip.min.js +testing/talos/talos/startup_test/sessionrestore/profile-manywindows/sessionstore.js +testing/talos/talos/startup_test/sessionrestore/profile/sessionstore.js +testing/talos/talos/tests/devtools/addon/content/pages/custom/debugger/static/js/main.js +testing/talos/talos/tests/dromaeo/lib/ext-base.js +testing/talos/talos/tests/dromaeo/lib/ext-core.js +testing/talos/talos/tests/dromaeo/tests/sunspider-string-tagcloud.html +testing/talos/talos/tests/dromaeo/tests/sunspider-string-unpack-code.html +testing/talos/talos/tests/dromaeo/webrunner.js +testing/talos/talos/tests/v8_7/regexp.js +testing/web-platform/tests/acid/acid3/test.html +testing/web-platform/tests/common/performance-timeline-utils.js +testing/web-platform/tests/conformance-checkers/html/elements/table/integrity/Naser_al-Din_Shah_Qajar-novalid.html +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-001.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-002.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-003.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-004.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-005.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-006.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-007.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-008.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-009.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-010.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-011.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-012.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-013.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-014.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-015.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-016.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-017.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-018.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-019.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-020.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-021.xht +testing/web-platform/tests/css/CSS2/text/text-transform-bicameral-022.xht +testing/web-platform/tests/editing/data/indent.js +testing/web-platform/tests/encoding/legacy-mb-japanese/euc-jp/jis0208_index.js +testing/web-platform/tests/encoding/legacy-mb-japanese/euc-jp/jis0212_index.js +testing/web-platform/tests/encoding/legacy-mb-japanese/iso-2022-jp/jis0208_index.js +testing/web-platform/tests/encoding/legacy-mb-japanese/shift_jis/jis0208_index.js +testing/web-platform/tests/encoding/legacy-mb-korean/euc-kr/euckr_index.js +testing/web-platform/tests/encoding/legacy-mb-tchinese/big5/big5_index.js +testing/web-platform/tests/encoding/single-byte-decoder.html +testing/web-platform/tests/encrypted-media/content/content-metadata.js +testing/web-platform/tests/encrypted-media/util/drm-messagehandler.js +testing/web-platform/tests/html/editing/dnd/datastore/001.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/002.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/003.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/004.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/005.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/006.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/007.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/008.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/009-1.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/009.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/010.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/011.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/012.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/013-1.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/014-1.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/016.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/017.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/018.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/019.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/020.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/021.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/022.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/023.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/024.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/025.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/026.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/027.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/028.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/029.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/030.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/031.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/032.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/033.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/034.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/035.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/036.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/037.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/038.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/039.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/040.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/041.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/042.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/043.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/044.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/045.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/046.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/047.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/048.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/049.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/050.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/051.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/052.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/056.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/057.xhtml +testing/web-platform/tests/html/editing/dnd/datastore/helper-drop-box-here.xhtml +testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm +testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/iframe-trying-to-navigate-its-child.html +testing/web-platform/tests/html/semantics/forms/the-form-element/form-autocomplete.html +testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/075.html +testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/094.html +testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html +testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/102.html +testing/web-platform/tests/html/syntax/parsing/html5lib_adoption01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_adoption02.html +testing/web-platform/tests/html/syntax/parsing/html5lib_comments01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_doctype01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_domjs-unsafe.html +testing/web-platform/tests/html/syntax/parsing/html5lib_entities01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_entities02.html +testing/web-platform/tests/html/syntax/parsing/html5lib_html5test-com.html +testing/web-platform/tests/html/syntax/parsing/html5lib_inbody01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_foreign-fragment.html +testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_math.html +testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests4.html +testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests6.html +testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_tests_innerHTML_1.html +testing/web-platform/tests/html/syntax/parsing/html5lib_innerHTML_webkit02.html +testing/web-platform/tests/html/syntax/parsing/html5lib_isindex.html +testing/web-platform/tests/html/syntax/parsing/html5lib_main-element.html +testing/web-platform/tests/html/syntax/parsing/html5lib_menuitem-element.html +testing/web-platform/tests/html/syntax/parsing/html5lib_namespace-sensitivity.html +testing/web-platform/tests/html/syntax/parsing/html5lib_pending-spec-changes.html +testing/web-platform/tests/html/syntax/parsing/html5lib_plain-text-unsafe.html +testing/web-platform/tests/html/syntax/parsing/html5lib_ruby.html +testing/web-platform/tests/html/syntax/parsing/html5lib_scriptdata01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_adoption01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_ark.html +testing/web-platform/tests/html/syntax/parsing/html5lib_scripted_webkit01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tables01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_template.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests10.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests11.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests12.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests14.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests15.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests16.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests17.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests18.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests19.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests1.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests20.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests21.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests22.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests23.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests24.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests25.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests26.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests2.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests3.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests5.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests6.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests7.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests8.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tests9.html +testing/web-platform/tests/html/syntax/parsing/html5lib_tricky01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_webkit01.html +testing/web-platform/tests/html/syntax/parsing/html5lib_webkit02.html +testing/web-platform/tests/IndexedDB/keypath_maxsize.htm +testing/web-platform/tests/navigation-timing/resources/webperftestharness.js +testing/web-platform/tests/pointerevents/pointerevent_support.js +testing/web-platform/tests/resource-timing/resources/webperftestharness.js +testing/web-platform/tests/resource-timing/resource_TAO_match_origin.htm +testing/web-platform/tests/resource-timing/resource_TAO_multi.htm +testing/web-platform/tests/resource-timing/resource_TAO_origin_uppercase.htm +testing/web-platform/tests/user-timing/resources/webperftestharness.js +testing/web-platform/tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.js +testing/web-platform/tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.js +testing/web-platform/tests/WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js +testing/web-platform/tests/WebCryptoAPI/encrypt_decrypt/rsa_vectors.js +testing/web-platform/tests/WebCryptoAPI/import_export/ec_importKey.js +testing/web-platform/tests/WebCryptoAPI/import_export/rsa_importKey.js +testing/web-platform/tests/WebCryptoAPI/sign_verify/ecdsa_vectors.js +testing/web-platform/tests/WebCryptoAPI/sign_verify/hmac_vectors.js +testing/web-platform/tests/WebCryptoAPI/sign_verify/rsa_pkcs_vectors.js +testing/web-platform/tests/WebCryptoAPI/sign_verify/rsa_pss_vectors.js +testing/web-platform/tests/workers/constructors/Worker/unexpected-self-properties.worker.js +testing/xpcshell/moz-http2/moz-http2.js +testing/xpcshell/node-http2/test/compressor.js +third_party/python/coverage/coverage/htmlfiles/*.js +third_party/python/mock-1.0.0/html/_static/*.js +third_party/python/pipenv/pipenv/patched/notpip/_vendor/distlib/*.exe +third_party/python/pipenv/pipenv/vendor/pip9/_vendor/distlib/*.exe +third_party/python/psutil/build/* +third_party/python/psutil-cp27-none-win_amd64/psutil/_psutil_windows.pyd +third_party/python/virtualenv/__virtualenv__/distlib-0.3.1-py2.py3-none-any/distlib/*.exe +# third_party/rust/libloading +third_party/rust/libz-sys/src/zlib/contrib/dotzlib/DotZLib.chm +third_party/rust/pkcs11/NOTICE +third_party/webkit/PerformanceTests/ARES-6/* +third_party/webkit/PerformanceTests/MotionMark/resources/debug-runner/d3.min.js +third_party/webkit/PerformanceTests/Speedometer/resources/todomvc +third_party/webkit/PerformanceTests/wasm-godot/godot.wasm +toolkit/components/maintenanceservice/maintenanceservice.rc +toolkit/components/maintenanceservice/resource.h +toolkit/components/mediasniffer/test/unit/data/*.exe +toolkit/components/normandy/vendor/*.js +# toolkit/components/passwordmgr/test/unit/test_OSCrypto_win.js +toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js +toolkit/components/places/tests/unit/test_bookmarks_html.js +toolkit/components/places/tests/unit/test_bookmarks_json.js +# toolkit/components/prompts/test/test_bug619644.html +toolkit/components/reputationservice/test/unit/data/*.exe +# toolkit/components/search/tests/xpcshell/test_json_cache.js +# toolkit/components/telemetry/tests/marionette +toolkit/components/telemetry/tests/unit/*.dll +toolkit/components/url-classifier/tests/unit/test_hashcompleter_v4.js +toolkit/content/tests/browser/browser_default_image_filename.js +toolkit/crashreporter/client/crashreporter.rc +toolkit/crashreporter/client/resource.h +toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.o +toolkit/crashreporter/google-breakpad/src/tools/windows/binaries +toolkit/crashreporter/test/unit/*.exe +toolkit/mozapps/update/tests/data/*.exe +toolkit/mozapps/update/updater/macbuild/Contents/PkgInfo +toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib +toolkit/mozapps/update/updater/resource.h +toolkit/mozapps/update/updater/updater.rc +# widget/windows/* diff --git a/source/format b/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/source/include-binaries b/source/include-binaries new file mode 100644 index 0000000000..29271e72a4 --- /dev/null +++ b/source/include-binaries @@ -0,0 +1,18 @@ +debian/logo/thunderbird/pre60/mailicon256.png +debian/logo/thunderbird/pre60/mailicon48.png +debian/logo/thunderbird/pre60/mailicon512.png +debian/logo/thunderbird/pre60/mailicon128.png +debian/logo/thunderbird/pre60/mailicon22.png +debian/logo/thunderbird/pre60/mailicon32.png +debian/logo/thunderbird/pre60/mailicon24.png +debian/logo/thunderbird/pre60/mailicon64.png +debian/logo/thunderbird/pre60/mailicon16.png +debian/logo/thunderbird/mailicon48.png +debian/logo/thunderbird/mailicon22.png +debian/logo/thunderbird/mailicon32.png +debian/logo/thunderbird/mailicon64.png +debian/logo/thunderbird/mailicon16.png +debian/logo/thunderbird/mailicon24.png +debian/logo/thunderbird/mailicon128.png +debian/logo/thunderbird/mailicon256.png +debian/logo/thunderbird/mailicon512.png diff --git a/source/lintian-overrides b/source/lintian-overrides new file mode 100644 index 0000000000..57bc40c8bb --- /dev/null +++ b/source/lintian-overrides @@ -0,0 +1,33 @@ +# ignoring files within the test cases +source: source-is-missing comm/*/Footer.html * +source: source-is-missing devtools/* +source: source-is-missing testing/* +source: source-is-missing */tests/* +source: source-is-missing */test/* + +# TexZilla isn't packaged yet too +source: source-is-missing comm/editor/ui/texzilla/content/TeXZilla.js * + +# files are under MPL-2 license with some long lines +source: source-is-missing comm/mail/components/compose/content/cloudAttachmentLinkManager.js * + +# no JS files +source: source-is-missing modules/libpref/init/all.js * + +# needed by TB, some various long lines +source: source-is-missing browser/components/newtab/data/content/activity-stream.bundle.js * +source: source-is-missing browser/components/newtab/aboutwelcome/content/aboutwelcome.bundle.js * +source: source-is-missing browser/components/newtab/vendor/*.js * +source: source-is-missing browser/components/pocket/content/panels/js/* +source: source-is-missing browser/extensions/screenshots/build/*.js * +source: source-is-missing comm/chat/protocols/matrix/lib/* * +source: source-is-missing comm/mail/components/compose/texzilla/TeXZilla.js * +source: source-is-missing dom/svg/crashtests/1507961-1.html * +source: source-is-missing gfx/wr/debugger/dist/build.js * +source: source-is-missing gfx/wr/wrench/script/reftest-analyzer.xhtml * +source: source-is-missing third_party/webkit/PerformanceTests/* +source: source-is-missing toolkit/components/certviewer/content/vendor/* * +source: source-is-missing toolkit/components/utils/mozjexl.js * + +# Lintian is confused by the XML structure, no issue at all. +source: duplicate-globbing-patterns debian/logo/icedove/icedove_icon_plain.svg * diff --git a/tests/control b/tests/control new file mode 100644 index 0000000000..1fe2d6766a --- /dev/null +++ b/tests/control @@ -0,0 +1,14 @@ +Tests: help.sh +Depends: thunderbird, xvfb, xauth + +#Tests: xpcshellTest.sh +#Depends: thunderbird-dev + +#Tests: idlTest.sh +#Depends: thunderbird-dev, build-essential + +#Tests: icudatfileTest.sh +#Depends: thunderbird-dev + +#Tests: soSymlinkTest.sh +#Depends: thunderbird-dev diff --git a/tests/help.sh b/tests/help.sh new file mode 100755 index 0000000000..79bf075020 --- /dev/null +++ b/tests/help.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +# At least check we can execute the main binary +# to catch missing dependencies +echo -n "Test1: checking help output..." +xvfb-run -a /usr/lib/thunderbird/thunderbird -help >/dev/null +echo "done." + +echo -n "Test2: checking version output..." +xvfb-run -a /usr/lib/thunderbird/thunderbird --version | grep -qs Thunderbird +echo "done." diff --git a/tests/icudatfileTest.sh b/tests/icudatfileTest.sh new file mode 100755 index 0000000000..8e3ec99916 --- /dev/null +++ b/tests/icudatfileTest.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +TESTFILE=$(basename $0 .sh) +ICUDATFILE=$(basename /usr/lib/thunderbird/icud*.dat) + +if [ -f "/usr/lib/thunderbird/${ICUDATFILE}" ]; then + echo "Running tests in ${TESTFILE}" + + echo -n "Test1: Check if /usr/lib/thunderbird/${ICUDATFILE} is linked to /usr/share/thunderbird/${ICUDATFILE}..." + if [ "$(readlink -e "/usr/share/thunderbird/${ICUDATFILE}")" = "/usr/lib/thunderbird/${ICUDATFILE}" ]; then + echo "done" + else + echo "No!" + exit 1 + fi +else + echo "Nothing to be done here." +fi + +echo "All Tests in ${TESTFILE} finished succesfully." diff --git a/tests/idlTest.idl b/tests/idlTest.idl new file mode 100644 index 0000000000..148e5d3a4b --- /dev/null +++ b/tests/idlTest.idl @@ -0,0 +1,10 @@ +// Include a file from thunderbird so we're sure these ended up in the right +// location +#include "nsIMsgIncomingServer.idl" + +[scriptable, uuid(1b9d7057-90f5-4ca5-a379-a59aa47acbd2)] +interface IdlTestIncomingServer : nsIMsgIncomingServer +{ + readonly attribute boolean thisIsATest; +}; + diff --git a/tests/idlTest.sh b/tests/idlTest.sh new file mode 100755 index 0000000000..38657399b7 --- /dev/null +++ b/tests/idlTest.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +set -e + +cleanup() { + [ ! -d "${SCRATCHDIR}" ] || rm -rf "${SCRATCHDIR}" +} + +#trap cleanup EXIT + +SCRATCHDIR=`mktemp -d` +TEST_IDL_FILE="debian/tests/idlTest.idl" +TESTFILE=$(basename $0 .sh) + +echo "Running tests in ${TESTFILE}" + +echo -n "Test1: Make sure we can generate typelibs..." +/usr/lib/thunderbird-devel/sdk/bin/typelib.py \ + -I"/usr/lib/thunderbird-devel/idl" \ + -o "${SCRATCHDIR}/test.xpt" \ + "${TEST_IDL_FILE}" +if [ -f "${SCRATCHDIR}/test.xpt" ]; then + echo "done." +else + echo "No!" + echo "Test call successful but no outputfile '${SCRATCHDIR}/test.xpt' found!" + exit 1 +fi + +echo -n "Test2: Make sure we can generate C++ headers..." +/usr/lib/thunderbird-devel/sdk/bin/header.py \ + -I"/usr/lib/thunderbird-devel/idl" \ + -o "${SCRATCHDIR}/test.h" \ + "${TEST_IDL_FILE}" +if [ -f "${SCRATCHDIR}/test.h" ]; then + echo "done." +else + echo "No!" + echo "Test call successful but no outputfile '${SCRATCHDIR}/test.h' found!" + exit 1 +fi + +echo -n "Test3: Compiling generated file..." +g++ -std=c++11 \ + -I/usr/include/thunderbird \ + -I/usr/include/nspr \ + -o "${SCRATCHDIR}/test.o" \ + "${SCRATCHDIR}/test.h" +echo "done." + +echo "All Tests in ${TESTFILE} finished successfully." diff --git a/tests/soSymlinkTest.sh b/tests/soSymlinkTest.sh new file mode 100755 index 0000000000..972f6289c7 --- /dev/null +++ b/tests/soSymlinkTest.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +FAIL=0 + +echo "Check for symlinked .so files in dev package..." + +for SOFILE in `ls /usr/lib/thunderbird-devel/sdk/lib/*.so`; do + if [ ! -L ${SOFILE} ]; then + echo ${SOFILE} is not a symlink! + FAIL=1 + fi +done + +echo -n "Test result is " +if [ ${FAIL} -eq 0 ]; then + echo "done." +else + echo "FAILED!" + exit 1 +fi diff --git a/tests/xpcshellTest.js b/tests/xpcshellTest.js new file mode 100644 index 0000000000..806b28998a --- /dev/null +++ b/tests/xpcshellTest.js @@ -0,0 +1 @@ +dump("running xpcshell..."); diff --git a/tests/xpcshellTest.sh b/tests/xpcshellTest.sh new file mode 100755 index 0000000000..f924bc13de --- /dev/null +++ b/tests/xpcshellTest.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +echo -n "Checking if we can run xpcshell..." + +LD_LIBRARY_PATH=/usr/lib/thunderbird/ \ +/usr/lib/thunderbird-devel/sdk/bin/xpcshell \ + -g /usr/share/thunderbird/ debian/tests/xpcshellTest.js + +echo "done." diff --git a/thunderbird-l10n-all.lintian-overrides b/thunderbird-l10n-all.lintian-overrides new file mode 100644 index 0000000000..3658b09a45 --- /dev/null +++ b/thunderbird-l10n-all.lintian-overrides @@ -0,0 +1,2 @@ +# no, this is metapackage +thunderbird-l10n-all: wrong-section-according-to-package-name thunderbird-l10n-all => localization diff --git a/thunderbird-wrapper-helper.sh b/thunderbird-wrapper-helper.sh new file mode 100644 index 0000000000..e41166cb58 --- /dev/null +++ b/thunderbird-wrapper-helper.sh @@ -0,0 +1,429 @@ +# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=sh textwidth=76 +# +# File: +# /usr/lib/thunderbird/thunderbird-wrapper-helper.sh +# +# Purpose: +# This shell script has helper functions and variables that are used or +# called from the main wrapper-script /usr/bin/thunderbird. +# +# Copyright: +# Licensed under the terms of GPLv2+. + + +# trying to get the DE +if [ "${XDG_CURRENT_DESKTOP}" = "" ]; then + DESKTOP=$(echo "${XDG_DATA_DIRS}" | sed 's/.*\(gnome\|kde\|mate\|xfce\).*/\1/') +else + DESKTOP=${XDG_CURRENT_DESKTOP} +fi + +# timestamp like '2017-02-26-113855' +DATE=$(date +%F-%H%M%S) + +# convert to lower case shell safe +DESKTOP=$(echo "$DESKTOP" | tr '[:upper:]' '[:lower:]') + +######################################### +# message templates for the X11 dialogs # +######################################### + +DEFAULT_X11_MSG="\ +If you see this message something went wrong while +migrating your Icedove profile(s) into the Thunderbird +profile folder. + +The following error occurred:" + +DOT_THUNDERBIRD_EXISTS="\ +${DEFAULT_X11_MSG} + +An existing profile folder (or symlink) '.thunderbird' and a folder +(or symlink) '.icedove' was found in your home directory '${HOME}/' +while trying to migrate the Icedove profile(s) folder. + +This can be caused by an old, currently unused profile folder or you might +be using Thunderbird as provided by upstream Mozilla. +If you don't need this old profile folder, you can remove or backup +it and start Thunderbird again. + +Sorry, but please investigate the situation yourself. + +The Debian wiki has extra information about the migration from +Icedove to Thunderbird. + + https://wiki.debian.org/Thunderbird + +Please also read the information in section 'Profile Migration' in + + /usr/share/doc/thunderbird/README.Debian.gz +" + +THUNDERBIRD_PROFILE_LINKING_ERROR="\ +${DEFAULT_X11_MSG} + +A needed symlink for the Thunderbird profile(s) folder '.thunderbird' +to the old existing Icedove profile '.icedove' couldn't created. + +Sorry, but please investigate the situation by yourself. + +Please mind also the information in section 'Profile Migration' +given in the file + + /usr/share/doc/thunderbird/README.Debian.gz +" + +START_MIGRATION="\ +You see this window because you're starting Thunderbird for the +first time and have profile(s) for Icedove. +The Debian Icedove package is de-branded back to Thunderbird. + +The Icedove profile(s) will now be migrated to the Thunderbird folder. +This will take a short time! + +Please be patient, the Thunderbird program will be started right after +the changes. + +If you need more information on the de-branding and migration please +read + + /usr/share/doc/thunderbird/README.Debian.gz + +The Debian wiki is also holding extra information about the migration of +Icedove to Thunderbird. + + https://wiki.debian.org/Thunderbird +" + +TITLE="Icedove to Thunderbird Profile migration" + +################### +# local functions # +################### + +# Simple search all files where we made a backup from +do_collect_backup_files () { +output_debug "Collecting all files we've made a backup of." +BACKUP_FILES=$(find -L "${TB_PROFILE_FOLDER}/" -type f -name "*backup_thunderbird_migration*") +if [ "${BACKUP_FILES}" != "" ]; then + output_info "The following backups related to the Icedove to Thunderbird transition exist:" + output_info "" + cat << EOF +${BACKUP_FILES} +EOF + output_info "" +else + output_info "No backups related to the Icedove to Thunderbird transition found." +fi +} + +# Create the file .thunderbird/.migrated with some content +do_create_migrated_mark_file (){ +cat < "${TB_PROFILE_FOLDER}/.migrated" +This file is automatically created by /usr/bin/thunderbird, it will be +created on every start of Thunderbird if does not exist. +Remove that file only if you know the propose of this file. + +/usr/share/doc/thunderbird/README.Debian.gz has some information about this +dot file. +EOF +} + +# Fix the file(s) ${TB_PROFILE_FOLDER}/${TB_PROFILE}/mimeTypes.rdf +# Search for pattern of '/usr/bin/iceweasel' and 'icedove' in the file and +# replace them with '/usr/bin/x-www-browser' and 'thunderbird'. +do_fix_mimetypes_rdf (){ +for MIME_TYPES_RDF_FILE in $(find -L "${TB_PROFILE_FOLDER}/" -name mimeTypes.rdf); do + RDF_SEARCH_PATTERN=$(grep '/usr/bin/iceweasel\|icedove' "${MIME_TYPES_RDF_FILE}") + if [ "${RDF_SEARCH_PATTERN}" != "" ]; then + output_debug "Backup ${MIME_TYPES_RDF_FILE} to ${MIME_TYPES_RDF_FILE}.backup_thunderbird_migration-${DATE}" + cp "${MIME_TYPES_RDF_FILE}" "${MIME_TYPES_RDF_FILE}.backup_thunderbird_migration-${DATE}" + + output_debug "Fixing possible broken 'mimeTypes.rdf'." + sed -i "s|/usr/bin/iceweasel|/usr/bin/x-www-browser|g;s|icedove|thunderbird|g" "${MIME_TYPES_RDF_FILE}" + else + output_info "No fix up for ${MIME_TYPES_RDF_FILE} needed." + fi +done +} + +# Inform the user we will starting the migration +do_inform_migration_start () { +# A system admin may avoid the dialog ... +if [ ! -f /etc/thunderbird/no_migration_popup ]; then + case "${DESKTOP}" in + gnome|mate|xfce) + local_zenity --info --no-wrap --title "${TITLE}" --text "${START_MIGRATION}" + if [ $? -ne 0 ]; then + local_xmessage -center "${START_MIGRATION}" + fi + ;; + + kde) + local_kdialog --title "${TITLE}" --msgbox "${START_MIGRATION}" + if [ $? -ne 0 ]; then + local_xmessage -center "${START_MIGRATION}" + fi + ;; + + *) + xmessage -center "${START_MIGRATION}" + ;; + esac +fi +} + +# Function that will do the fixing of mimeapps.list files +do_migrate_old_icedove_desktop() { +# Fix mimeapps.list files in the following folders which may still have +# icedove.desktop associations +# +# ~/.config/ +# ~/.local/share/applications/ +# +# icedove.desktop files are now deprecated, but still commonly around. +# We normally could remove them, but for safety only modify the files. +# These mimeapps.list files configures default applications for MIME types. + +# Only jump in loop if we haven't already done a migration before or the +# user is forcing this by the option '--fixmime'. +if [ ! -f "${TB_PROFILE_FOLDER}/.migrated" ] || [ "${FORCE_MIMEAPPS_MIGRATE}" = "1" ]; then + if [ ! -f "${TB_PROFILE_FOLDER}/.migrated" ]; then + output_debug "No migration mark '${TB_PROFILE_FOLDER}/.migrated' found, checking mimeapps.list files for possible migration." + elif [ "${FORCE_MIMEAPPS_MIGRATE}" = "1" ]; then + output_debug "Migration enforced by user. Checking mimeapps.list files once again for possible migration." + fi + for MIMEAPPS_LIST in ${HOME}/.config/mimeapps.list ${HOME}/.local/share/applications/mimeapps.list; do + # Check if file exists and has old icedove entry + if [ -e "${MIMEAPPS_LIST}" ] && \ + grep -iq "\(userapp-\)*icedove\(-.*\)*\.desktop" "${MIMEAPPS_LIST}"; then + + output_debug "Fixing broken '${MIMEAPPS_LIST}'." + MIMEAPPS_LIST_COPY="${MIMEAPPS_LIST}.backup_thunderbird_migration-${DATE}" + + # Fix mimeapps.list and create a backup, but it's really unlikely we + # have an existing backup so no further checking here! + # (requires GNU sed 3.02 or ssed for case-insensitive "I") + sed -i.backup_thunderbird_migration-"${DATE}" "s|\(userapp-\)*icedove\(-.*\)*\.desktop|thunderbird.desktop|gI" "${MIMEAPPS_LIST}" + if [ $? -ne 0 ]; then + output_info "The configuration file for default applications for some MIME types" + output_info "'${MIMEAPPS_LIST}' couldn't be fixed." + output_info "Please check for potential problems like low disk space or wrong access rights!" + logger -i -p warning -s "$0: [profile migration] Couldn't fix '${MIMEAPPS_LIST}'!" + exit 1 + else + output_debug "A copy of the configuration file of default applications for some MIME types" + output_debug "was saved to '${MIMEAPPS_LIST_COPY}'." + fi + else + output_info "No fix up for ${MIMEAPPS_LIST} needed." + fi + done + output_debug "Setting migration mark '${TB_PROFILE_FOLDER}/.migrated'." + do_create_migrated_mark_file +fi + +# Migrate old user specific *.desktop entries +# Users may have created custom desktop shortcuts for Icedove in +# the past. These associations (files named like 'userapp-Icedove-*.desktop') +# are done in the folder $(HOME)/.local/share/applications/. + +# Remove such old icedove.desktop files, superseeded by system-wide +# /usr/share/applications/thunderbird.desktop. The old ones in $HOME don't +# receive updates and might have missing/outdated fields. +# *.desktop files and their reverse mimeinfo cache provide information +# about available applications. + +for ICEDOVE_DESKTOP in $(find "${HOME}/.local/share/applications/" -iname "*icedove*.desktop"); do + output_debug "Backup ${ICEDOVE_DESKTOP} to ${ICEDOVE_DESKTOP}.backup_thunderbird_migration-${DATE}" + ICEDOVE_DESKTOP_COPY=${ICEDOVE_DESKTOP}.backup_thunderbird_migration-${DATE} + mv "${ICEDOVE_DESKTOP}" "${ICEDOVE_DESKTOP_COPY}" + # Update the mimeinfo cache. + # Not existing *.desktop files in there should simply be ignored by the system anyway. + if [ -x "$(which update-desktop-database)" ]; then + output_debug "Call 'update-desktop-database' to update the mimeinfo cache." + update-desktop-database "${HOME}/.local/share/applications/" + fi +done +} + +# Print out an error message about failed migration +do_thunderbird2icedove_error_out (){ +case "${DESKTOP}" in + gnome|mate|xfce) + local_zenity --info --no-wrap --title "${TITLE}" --text "${DOT_THUNDERBIRD_EXISTS}" + if [ $? -ne 0 ]; then + local_xmessage -center "${DOT_THUNDERBIRD_EXISTS}" + fi + TB_FAIL=1 + ;; + kde) + local_kdialog --title "${TITLE}" --msgbox "${DOT_THUNDERBIRD_EXISTS}" + if [ $? -ne 0 ]; then + local_xmessage -center "${DOT_THUNDERBIRD_EXISTS}" + fi + TB_FAIL=1 + ;; + *) + xmessage -center "${DOT_THUNDERBIRD_EXISTS}" + TB_FAIL=1 + ;; +esac +} + +# Symlink .thunderbird to .icedove +do_thunderbird2icedove_symlink () { +output_debug "Trying to symlink '${TB_PROFILE_FOLDER}' to '${ID_PROFILE_FOLDER}'" +if ln -s "${ID_PROFILE_FOLDER}" "${TB_PROFILE_FOLDER}"; then + output_debug "success." + return 0 +else + case "${DESKTOP}" in + gnome|mate|xfce) + local_zenity --info --no-wrap --title "${TITLE}" --text "${THUNDERBIRD_PROFILE_LINKING_ERROR}" + if [ $? -ne 0 ]; then + local_xmessage -center "${THUNDERBIRD_PROFILE_LINKING_ERROR}" + fi + TB_FAIL=1 + ;; + kde) + local_kdialog --title "${TITLE}" --msgbox "${THUNDERBIRD_PROFILE_LINKING_ERROR}" + if [ $? -ne 0 ]; then + local_xmessage -center "${THUNDERBIRD_PROFILE_LINKING_ERROR}" + fi + TB_FAIL=1 + ;; + *) + xmessage -center "${THUNDERBIRD_PROFILE_LINKING_ERROR}" + TB_FAIL=1 + ;; + esac + output_debug "Ohh, that wasn't working, sorry! Do you have access rights to create a symlink?" + return 1 +fi +} + +# Wrapping /usr/bin/kdialog calls +local_kdialog () { +if [ -f /usr/bin/kdialog ]; then + /usr/bin/kdialog "$@" + return 0 +else + return 1 +fi +} + +# Wrapping /usr/bin/xmessage calls +local_xmessage () { +if [ -f /usr/bin/xmessage ]; then + /usr/bin/xmessage "$@" +else + # this should never be reached as thunderbird has a dependency on x11-utils! + output_info "xmessage not found" +fi +} + +# Wrapping /usr/bin/zenity calls +local_zenity () { +if [ -f /usr/bin/zenity ]; then + /usr/bin/zenity "$@" + return 0 +else + return 1 +fi +} + +# Simple info output function +output_info () { +echo "INFO -> $1" +} + +# Simple debugging output function +output_debug () { +if [ "${TB_VERBOSE}" = "1" ]; then + echo "DEBUG -> $1" +fi +} + +# How this script can be called +usage () { +cat << EOF + +Usage: ${0##*/} [--help|-? ] | [--verbose ] [ -g ] [args-passed-to-thunderbird...] + +This script parses its command line options and passes everything else on to +Thunderbird. Note that some Thunderbird options need an additional argument +that can't be naturally mixed with other options! + + -g Starts Thunderbird within gdb (needs package thunderbird-dbgsym) + + --help or ? Display this help and exit + + --verbose Verbose mode, increase the output messages to stdout + (Logging to /var/log/syslog isn't touched or increased by this + option!) + +Additional options: + + --fixmime Only fixes MIME associations in + ~/.thunderbird/$profile/mimeTypes.rdf and exits. Can be + combined with '--verbose'. + + --show-backup Collect the backup files which where made and print them to + stdout and exits. +EOF +cat << EOF + +Examples: + + ${0##*/} --help + + Writes this help messages on stdout. If any other option is given it + will be ignored. Note that Thunderbird has a '-h' option which needs + to be used if you want the help output for Thunderbird. + + ${0##*/} --verbose + + Enable more debug messages on stdout. Only useful while developing the + thunderbird packages or during profile migration. + + ${0##*/} -g + + Starts Thunderbird in a GDB session if packages gdb and + thunderbird-dbgsym are installed. +EOF +# other debuggers will be added later, we need maybe a separate valgrind +# package! Note MDN site for valgrind +# https://developer.mozilla.org/en-US/docs/Mozilla/Testing/Valgrind +# ${0##*/} -d gdb +# The same as above, only manually specified the GDB debugging tool as +# argument. Note that you probably will need additional parameter to +# enable e.g. writing to a logfile. +# It's also possible to specify valgrind, that will need to add additional +# quoted arguments in any case! +# The thunderbird binary must be compiled with valgrind support if you +# want to use valgrind here! +# +# ${0##*/} -d 'valgrind --arg1 --arg2' -thunderbird-arg1 +cat << EOF + + ${0##*/} [args-passed-to-thunderbird...] + + Some example for invoking Thunderbird from the ommand line: + Run in safe-mode with the JS Error console: + + ${0##*/} --safe-mode --jsconsole + + Call Thunderbird directly to compose a message with a specific + attachement. + + ${0##*/} -compose "to='recipient@tld.org','attachment=/path/attachment'" + + See the all possible arguments for Thunderbird: + + ${0##*/} -h + +EOF +} + +# end local functions diff --git a/thunderbird-wrapper.sh b/thunderbird-wrapper.sh new file mode 100755 index 0000000000..13eeec1f9d --- /dev/null +++ b/thunderbird-wrapper.sh @@ -0,0 +1,270 @@ +#!/bin/bash +# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=sh textwidth=76 +# +# File: +# /usr/bin/thunderbird +# +# Purpose: +# This is a wrapper script for starting the thunderbird binary with taking +# care of the searching for an old user Icedove profile folder and adopting +# the folder into the new place if possible. +# +# Environment: +# The Icedove binary was using the profile folder '${HOME}/.icedove'. The +# Mozilla default for the Thunderbird binary is '${HOME}/.thunderbird'. +# The script will looking for the old profile folder and will symlink the +# folder '${HOME}/.thunderbird' to the profile folder '${HOME}/.icedove'. +# +# Copyright: +# Licensed under the terms of GPLv2+. + +#set -x + +TB_HELPER=${TB_HELPER:-"/usr/lib/thunderbird/thunderbird-wrapper-helper.sh"} +# sourcing external variables and helper functions +# hide the sourcing for http://www.shellcheck.net/ +# shellcheck source=/dev/null +. "${TB_HELPER}" +if [ $? -ne 0 ]; then + echo "sourcing ${TB_HELPER} failed - giving up." + exit 1 +fi + +# some global variables +MOZ_APP_NAME=thunderbird +MOZ_APP_LAUNCHER=$(which "$0") +MOZ_LIBDIR=/usr/lib/${MOZ_APP_NAME} +ID_PROFILE_FOLDER=${HOME}/.icedove +TB_PROFILE_FOLDER=${HOME}/.thunderbird +TB_GDB_DEFAULT_OPTS=${TB_GDB_DEFAULT_OPTS:-"-ex \"handle SIG38 nostop\" -ex \"handle SIGPIPE nostop\""} + +export TB_HELP=0 +export TB_FAIL=0 +export FORCE_MIMEAPPS_MIGRATE=0 +export TB_VERBOSE=0 +unset DEBUG +unset DEBUGGER + +# set MOZ_APP_LAUNCHER for gnome-session +export MOZ_APP_LAUNCHER + +# let Thunderbird detect the system dictionaries +export DICPATH=/usr/share/hunspell + +declare -a TB_ARGS=() + +for ARG in "$@"; do + case "${ARG}" in + --fixmime) + FIXMIME=1 + FORCE_MIMEAPPS_MIGRATE=1 + ;; + -g) + DEBUGGER=1 + DEBUG=1 + ;; +# -d) +# USER_DEBUGGER=$2 +# DEBUG=1 +# shift +# ;; + --help) + TB_HELP=1 + ;; + --show-backup) + SHOW_BACKUP=1 + ;; + --verbose) + output_info "[[ ... using verbose mode ... ]]" + TB_VERBOSE=1 + ;; + '?') + usage >&2 + exit 1 + ;; + # Every other argument is needed to get down to the TB starting call. + *) + TB_ARGS+=("${ARG}") + ;; + esac + shift +done + +# sanity check +if [ "$DEBUGGER" != "" ] && [ "$USER_DEBUGGER" != "" ]; then + output_info "You can't use option '-g and '-d' at the same time!" + usage + exit 1 +fi + +# If '--help' was called show usage() and exit immediately without other +# helpers can be called. +if [ "${TB_HELP}" = "1" ]; then + usage + exit 0 +fi + +# The user is forcing to do the MIME fixing (again). If called a used +# profile(s) folder ~/.thunderbird will be also reworked. That's not the +# case if the user is starting this wrapper for a first time and only a +# folder ~/.thunderbird is existing! +if [ "${FIXMIME}" = "1" ]; then + do_fix_mimetypes_rdf + do_migrate_old_icedove_desktop + do_collect_backup_files + exit 0 +fi + +if [ "${SHOW_BACKUP}" = "1" ]; then + do_collect_backup_files + exit 0 +fi + +############################################################################# +# User Thunderbird Profile Adoptions # +# # +# The users Icedove/Thunderbird profile(s) doesn't need to be modified in a # +# different and complicated way. We simply need to ensure that the # +# Thunderbird binary is finding the existing profiles in the folder # +# $(HOME)/.thunderbird folder or a valid symlink pointing to the profiles. # +# # +# To "migrate" an old existing Icedove profile we can simply do a symlink # +# from $(HOME)/.thunderbird --> $(HOME)/.icedove . # +# # +# Afterwards do some changes to the file mimeTypes.rdf within every # +# profile. Also we can modify existing *icedove*.desktop entries in the # +# files. # +# # +# $(HOME)/.config/mimeapps.list # +# $(HOME)/.local/share/applications/mimeapps.list # +# # +############################################################################# + +# First try the default case for modification, there is only a folder +# ${ID_PROFILE_FOLDER} and we can symlink to this. +if { [ -d "${ID_PROFILE_FOLDER}" ] || [ -L "${ID_PROFILE_FOLDER}" ]; } && \ + { [ ! -d "${TB_PROFILE_FOLDER}" ] && [ ! -L "${TB_PROFILE_FOLDER}" ]; }; then + output_debug "found folder '${ID_PROFILE_FOLDER}'" + output_debug "not found folder or symlink '${TB_PROFILE_FOLDER}'" + output_debug "Start Thunderbird profile adoptions, please be patient!" + + # open a pop-up window with a message about starting migration + do_inform_migration_start + + # do the symlinking + do_thunderbird2icedove_symlink + + # fixing mimeTypes.rdf which may have registered the iceweasel binary + # as browser, instead of x-www-browser + do_fix_mimetypes_rdf + + # Fix local mimeapp.list and *.desktop entries + do_migrate_old_icedove_desktop + + # we are finished + output_info "Thunderbird Profile adoptions done." + do_collect_backup_files +fi + +# We found both profile folder, and .thunderbird is a symlink, +# we need to check if .thunderbird is symlinked to .icedove +if { [ -d "${ID_PROFILE_FOLDER}" ] && [ -L "${TB_PROFILE_FOLDER}" ]; } && \ + [ "$(readlink -e "${TB_PROFILE_FOLDER}")" = "${ID_PROFILE_FOLDER}" ];then + + output_debug "Found folder ${ID_PROFILE_FOLDER}, found a symlink ${TB_PROFILE_FOLDER} pointing to ${ID_PROFILE_FOLDER}" + + # Check if we need to do some migration, the linking could be existing + # before we switched back to Thunderbird. + if [ ! -f "${TB_PROFILE_FOLDER}/.migrated" ]; then + # Fixing mimeTypes.rdf which may have registered the iceweasel binary + # as browser, instead of x-www-browser + do_fix_mimetypes_rdf + + # Fix local mimeapp.list and *.desktop entries + do_migrate_old_icedove_desktop + fi + +# ... or the opposite if .icedove is symlinked to .thunderbird +elif { [ -d "${TB_PROFILE_FOLDER}" ] && [ -L "${ID_PROFILE_FOLDER}" ]; } && \ + [ "$(readlink -e "${ID_PROFILE_FOLDER}")" = "${TB_PROFILE_FOLDER}" ];then + + output_debug "Found folder ${TB_PROFILE_FOLDER}, found a symlink ${ID_PROFILE_FOLDER} pointing to ${TB_PROFILE_FOLDER}" + output_debug "You may want to remove the symlink ${ID_PROFILE_FOLDER}? It's probably not needed anymore." + + # Check if we need to do some migration ... + if [ ! -f "${TB_PROFILE_FOLDER}/.migrated" ]; then + # Fixing mimeTypes.rdf which may have registered the iceweasel binary + # as browser, instead of x-www-browser + do_fix_mimetypes_rdf + + # Fix local mimeapps.list and *.desktop entries + do_migrate_old_icedove_desktop + fi + +# We found both profile folder, but they are not linked to each other! This +# is a state we can't solve on our own !!! The user needs to interact and +# has probably an old or otherwise used Thunderbird installation. Which one +# is the correct one to use? +elif { [ -d "${ID_PROFILE_FOLDER}" ] || [ -L "${ID_PROFILE_FOLDER}" ]; } && \ + { [ -d "${TB_PROFILE_FOLDER}" ] || [ -L "${TB_PROFILE_FOLDER}" ]; } && \ + [ "$(readlink -e "${TB_PROFILE_FOLDER}")" != "$(readlink -e "${ID_PROFILE_FOLDER}")" ]; then + + for CHECK in ${ID_PROFILE_FOLDER} ${TB_PROFILE_FOLDER}; do + FILE_CHECK=$(readlink -e "${CHECK}") + if [ "${FILE_CHECK}" != "" ] && [ -L "${CHECK}" ]; then + output_debug "Found symlink '${CHECK}' pointing to '${FILE_CHECK}'." + elif [ "${FILE_CHECK}" != "" ] && [ -d "${CHECK}" ]; then + output_debug "Found folder '${FILE_CHECK}'." + else + output_debug "${CHECK} is probably a symlink pointing to a non existing target, at least not to ${ID_PROFILE_FOLDER}." + logger -i -p warning -s "$0: [profile migration] ${CHECK} is probably a symlink pointing to a non existing target, at least not to ${ID_PROFILE_FOLDER}." + fi + done + + output_debug "There are already the folders or symlinks '${TB_PROFILE_FOLDER}' and '${ID_PROFILE_FOLDER}'" + output_debug "which not pointing to each other, will do nothing as don't know which folder to use." + output_debug "Please investigate by yourself! Maybe you will find additional information in '/usr/share/doc/thunderbird/README.Debian.gz'." + logger -i -p warning -s "$0: [profile migration] Couldn't migrate Icedove into Thunderbird profile due existing or symlinked folder '${TB_PROFILE_FOLDER}'!" + + # display a graphical advice if possible + do_thunderbird2icedove_error_out + +fi + +if [ "${TB_FAIL}" = 1 ]; then + output_info "An error happened while trying to migrate the old Icedove profile folder '${ID_PROFILE_FOLDER}'." + output_info "Please take a look into the syslog file!" + exit 1 +fi + +# If we are here we going simply further by starting Thunderbird. + +if [ "${DEBUG}" = "" ]; then + TB_ARGS_LINE=$(echo "${TB_ARGS[@]}" | sed "s/'/\"/g") + output_debug "call '${MOZ_LIBDIR}/${MOZ_APP_NAME} ${TB_ARGS_LINE}'" + exec "${MOZ_LIBDIR}"/"${MOZ_APP_NAME}" "${TB_ARGS[@]}" +else + # User has selected GDB? + if [ "${DEBUGGER}" = "1" ]; then + # checking for GDB + if [ -f /usr/bin/gdb ]; then + if dpkg-query -W -f='${Version}' thunderbird-dbgsym &>/dev/null ; then + output_info "Starting Thunderbird with GDB ..." + TB_ARGS_LINE="/usr/bin/gdb ${TB_GDB_DEFAULT_OPTS} -ex run ${MOZ_LIBDIR}/${MOZ_APP_NAME}$(printf ' %q' "${TB_ARGS[@]}")" + output_info "LANG= ${TB_ARGS_LINE}" + LANG='' eval "exec ${TB_ARGS_LINE}" + else + output_info "No package 'thunderbird-dbgsym' installed! Please install first and restart." + output_info "More information how to adjust your sources.list to being able installing" + output_info "dbgsym packages in generally can be found here:" + output_info "https://wiki.debian.org/HowToGetABacktrace#Installing_the_debugging_symbols" + exit 1 + fi + else + output_info "No package 'gdb' installed! Please install first and try again." + exit 1 + fi + fi +fi + +exit 0 diff --git a/thunderbird.1 b/thunderbird.1 new file mode 100644 index 0000000000..7942daa85f --- /dev/null +++ b/thunderbird.1 @@ -0,0 +1,194 @@ +.TH "THUNDERBIRD" "1" "February 27, 2010" "Christoph Göhre" "Linux User's Manual" +.SH "NAME" +thunderbird \- Mail User Agent (MUA) and newsgroup/RSS client for X11 derived from the Mozilla Thunderbird. +.SH "SYNOPSIS" +.B /usr/lib/thunderbird/thunderbird +[\fIOPTIONS\fR] [\fIURL\fR] + +.B /usr/lib/thunderbird/thunderbird\-bin +[\fIOPTIONS\fR] [\fIURL\fR] + +.SH "DESCRIPTION" +\fBThunderbird\fR provides IMAP/POP support, a built-in RSS reader, support for +HTML mail, powerful quick search, saved search folders, advanced message +filtering, junk mail controls, message grouping, labels, return receipts, smart +address book, LDAP address completion, import tools and the ability to manage +multiple identities in email and newsgroup accounts. +.PP +\fBThunderbird\fR provides enterprise and government grade security such as S/MIME, +digital signing, message encryption, and support for certificates and security +devices. + +.SH "USAGE" +\fBthunderbird\fR is a executable file that will set up the +environment for the starting executable, \fBthunderbird\-bin\fR. +If there is an Thunderbird mail client already running, \fBthunderbird\fR will +arrange for it to create a new mail client window; otherwise it will start +the Thunderbird application. + +.SH "OPTIONS" +A summary of the options supported by \fBthunderbird\fR is included below. + +.SS "X11 options" +.TP +.BI \-\-display= DISPLAY +X display to use +.TP +.B \-\-sync +Make X calls synchronous +.TP +.B \-\-g\-fatal\-warnings +Make all warnings fatal + +.SS "Mozilla options" +.TP +.B \-h, \-help +Show summary of options. +.TP +.B \-v, \-version +Print the Thunderbird version. +.TP +\fB\-P\fR [\fIprofile\fR] +Start with \fIprofile\fR. When no profile is given, displays the Profile Manager. May require \fB\-no\-remote\fR, see below. +.TP +.B \-\-profile [\fIpath\fR] +Start with with [\fIprofile\fR] from the given [\fIpath\fR]. +.TP +.B \-\-migration +Start with migration wizard. May require \fB\-no\-remote\fR, see below. +.TP +.B \-\-ProfileManager +Start with profile manager. May require \fB\-no\-remote\fR, see below. +.TP +.B \-\-no\-remote +Don't connect to a running Thunderbird instance. Don't accept or send remote +commands. This option can be necessary in conjunction to several of the options +above, that won't have any effect when an Thunderbird instance is running unless +\fB\-no\-remote\fR is used at the same time. +.TP +.B \-\-new\-instance +Open a new instance instead of a new windows in the running instance. +.TP +\fB\-\-UILocale\fR \fIlocale\fR +Start with \fIlocale\fR resources as User Interface locale. By default, it is +guessed from environment and available locales for Thunderbird. +.TP +.B \-\-safe\-mode +Starts Thunderbird in safe mode, i.e. disabling all extensions and +showing a bit more debugging messages. +.TP +.B \-\-jsconsole +Start with Javascript Console +.TP +.B \-addressbook +Open the address book at startup. +.TP +.B \-compose +Compose a mail or news message. +.TP +.B \-mail +Open the mail folder view. +.TP +\fB\-mail\fR \fIURL\fR +Open the message specified by this \fIURL\fR. +.TP +.B \-news +Open the news client. +.TP +.B \-setDefaultMail +Set Thunderbird as the default mail client. +.TP +.B \-options +Open the options dialog. +.TP +.B \-file +Open the specified email file. + +.SH "DEBUGGING" +.TP +.B \-g +Starts Thunderbird through a debugger (gdb by default). + +.SH "ENVIRONMENT" +\fIMOZILLA_DISABLE_PLUGINS\fR \- when set, totally disables loading plugins. + +.SH "FILES" +\fI/usr/bin/thunderbird\fR \- shell script wrapping +\fBthunderbird\-bin\fR +.br + +\fI/usr/lib/thunderbird/thunderbird\-bin\fR \- \fBthunderbird\fR +executable +.br + +.SH "EXAMPLES" +.SS "Some typical use case for starting Thunderbird from a console" +.sp +Starting Thunderbird without any extra options, useful to any messages from thunderbird in case something went not o.k.: +.sp +.if n \{\ +.RS 4 +.\} +.nf +thunderbird +.fi +.if n \{\ +.RE +.\} +.sp +Starting Thunderbird without any extensions or themes, useful if extensions may make some trouble: +.sp +.if n \{\ +.RS 4 +.\} +.nf +thunderbird \-\-safe-mode +.fi +.if n \{\ +.RE +.\} +.sp +Starting Thunderbird with a composing window: +.sp +.if n \{\ +.RS 4 +.\} +.nf +thunderbird \-compose +.fi +.if n \{\ +.RE +.\} +.sp +Starting Thunderbird with the default debugger: +.sp +.if n \{\ +.RS 4 +.\} +.nf +/usr/lib/thunderbird/run-mozilla.sh \-debug /usr/lib/thunderbird/thunderbird-bin +.fi +.if n \{\ +.RE +.\} +.sp +Starting Thunderbird with the specific debugger: +.sp +.if n \{\ +.RS 4 +.\} +.nf +/usr/lib/thunderbird/run-mozilla.sh \-\-debugger /foo/bar/debugger /usr/lib/thunderbird/thunderbird-bin +.fi +.if n \{\ +.RE +.\} + +.SH "BUGS" +To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR and/or report bugs +to the Debian Bug Tracking System, as usual. + +.SH "AUTHORS" +.TP +.B The Mozilla Organization +.I http://www.mozilla.org/about.html diff --git a/thunderbird.NEWS b/thunderbird.NEWS new file mode 100644 index 0000000000..dd9fc3d261 --- /dev/null +++ b/thunderbird.NEWS @@ -0,0 +1,112 @@ +thunderbird (1:78.3.1-1) unstable; urgency=medium + + The Thunderbird ESR series starting with version 78.x has finally dropped the + support for legacy Add-ons and also for legacy WebExtension Add-ons. + By this some packaged Add-ons within Debian, but also some external installed + Add-ons might not working any more! + + The very popular Add-on Enigmail, which was providing OpenPGP support within + the Thunderbird application, isn't getting further development as an external + Add-on due a consequence of the changed Add-on API. + Instead Thunderbird now has Built-In OpenPGP support since version 78.0. + The latest version of the Enigmail Add-on (>= 2.2) will provide an migration + wizard which helps to migrate the existing OpenPGP keys into Thunderbird. + + Please have a look for further information about Enigmail on the project + homepage and the Add-on website. + + https://www.enigmail.net/index.php/en/home/news + https://addons.thunderbird.net/en/thunderbird/addon/enigmail/ + https://wiki.mozilla.org/Thunderbird:OpenPGP:Smartcards + + You might also want to have a look at README.Debian for more information. + + -- Carsten Schoenert Sun, 20 Sep 2020 8:40:00 +0200 + +thunderbird (1:68.2.2-1) unstable; urgency=medium + + Starting with version 68.2.2-1 src:thunderbird isn't building the binary + package calendar-google-provider any more. + + If you want or need to use this Add-on please install this extension from + + https://addons.thunderbird.net/en-GB/thunderbird/addon/provider-for-google-calendar/ + + (Please choose your preferred language!) + + The removal of this Add-on from the Thunderbird source was discussed within + this issue: + + https://bugzilla.mozilla.org/show_bug.cgi?id=1584614 + + -- Carsten Schoenert Sun, 10 Nov 2019 11:07:00 +0100 + +thunderbird (1:60.0-3) unstable; urgency=medium + + intl.locale.matchOS is replaced by intl.locale.requested + + Thunderbird has taken the locale from the user session by using the + preference 'intl.locale.matchOS' up until version 57. + This preference is replaced by 'intl.locale.requested' since version 58. + + Thunderbird is detecting (again) the locale from the system by using this + preference with an empty string as value. + Starting with this version Thunderbird is taking care of this possibility + by adding this preference to the system wide configuration within + '/etc/thunderbird/pref/thunderbird.js. + + If you have used Thunderbird packages < 1:60.0-3 *and* you have used this + environment settings within your profile by adding a dedicated locale value + which is equal to the system language you can remove this and let + Thunderbird pick up the locale from the system automatically. To do so + remove the following key completely from your local settings: + + intl.locale.requested + + More information can be found here + + https://bugzilla.mozilla.org/show_bug.cgi?id=1437480 + https://bugzilla.mozilla.org/show_bug.cgi?id=1413866 + + Please have also a look into README.Debian for a more in deep explanation, + especially section + 'Enable l10n languages in Thunderbird >= 1:60.0~b2'. + + -- Carsten Schoenert Wed, 5 Aug 2018 20:45:00 +0200 + +thunderbird (1:60.0~b2-1) experimental; urgency=medium + + thunderbird-l10n and lightning-l10n packages are known broken + + Due the modifications by upstream started with Thunderbird 59 related to the + needed changes for the WebExtensions the various l10n packages for + thunderbird itself but also for lightning are currently not working like + previously out of the box. + This is a known fact and mostly confirmed by upstream. + + By a manual workaround for the local profile it's possible to (re-)enable the + requested l10n language. Please have a look at the file README.Debian in the + section 'Enable l10n languages in Thunderbird >= 1:60.0~b2'. + + For more information on this issue you can visit + + https://bugzilla.mozilla.org/show_bug.cgi?id=1437480 + + -- Carsten Schoenert Sat, 7 Apr 2018 10:21:00 +0200 + +thunderbird (1:52.5.0-1) unstable; urgency=high + + The profile for AppArmor within Thunderbird is now disabled by default. + Since the activated Recommends for the apparmor package in recent + kernel-image packages it turns out there are to many things that simply not + working like before if Thunderbird is using the current AppArmor profile. + + Please read README.apparmor for getting more information about the + re-enabling of the AppArmor profile. + People who wants to help to improve the AppAprmor profile are appreciated. + + Take also a look at #882048 for the reason behind that decision. + + https://bugs.debian.org/882048 + + -- Carsten Schoenert Sun, 26 Nov 2017 12:45:00 +0200 diff --git a/thunderbird.bash-completion b/thunderbird.bash-completion new file mode 100644 index 0000000000..e61cb10946 --- /dev/null +++ b/thunderbird.bash-completion @@ -0,0 +1,65 @@ +# bash completion for thunderbird(1) -*- shell-script -*- +# +# Copyright (C) 2017 Carsten Schoenert + +_thunderbird() { +local cur prev OPTS FLAG_FIXMIME FLAG_SHOW_BACKUP +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" +prev="${COMP_WORDS[COMP_CWORD-1]}" +OPTS="--fixmime --help --show-backup -g --verbose" + +case $prev in + '--fixmime') + # Check if '--verbose' is already given, this is the only option that + # '--fixmime' should be combined + if [ ! $(compgen -W "${COMP_WORDS[*]}" -- "--verbose") ]; then + COMPREPLY=( $(compgen -W "--verbose" -- $cur) ) + fi + return 0 + ;; + + '--help'|'-g') + return 0 + ;; + + '--show-backup') + # Check if '--verbose' is already given, this is the only option that + # --show-backup should be combined + if [ ! $(compgen -W "${COMP_WORDS[*]}" -- "--verbose") ]; then + COMPREPLY=( $(compgen -W "--verbose" -- $cur) ) + fi + return 0 + ;; + + '--verbose') + FLAG_FIXMIME="" + FLAG_SHOW_BACKUP="" + + # Check if '--fixmime' is already given + if [ $(compgen -W "${COMP_WORDS[*]}" -- "--fixmime") ]; then + # Yes, we have seen '-fixmime' + FLAG_FIXMIME=1 + fi + + # Check if '--show-backup' is already given + if [ $(compgen -W "${COMP_WORDS[*]}" -- "--show-backup") ]; then + # Yes, we have seen '--show-backup' + FLAG_SHOW_BACKUP=1 + fi + + if [ "$FLAG_FIXMIME" != "1" ] && [ "$FLAG_SHOW_BACKUP" != "1" ]; then + COMPREPLY=( $(compgen -W "--fixmime --show-backup" -- $cur) ) + fi + return 0 + ;; + +esac + + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + +} && +complete -F _thunderbird thunderbird + +# ex: ts=4 sw=4 et filetype=sh diff --git a/thunderbird.desktop b/thunderbird.desktop new file mode 100644 index 0000000000..a406de9ce2 --- /dev/null +++ b/thunderbird.desktop @@ -0,0 +1,115 @@ +[Desktop Entry] +Name=Thunderbird +Comment=Read/Write Mail/News with Thunderbird +GenericName=Mail Client +Exec=/usr/bin/thunderbird %u +Terminal=false +X-MultipleArgs=false +Type=Application +Version=1.0 +Icon=thunderbird +Categories=Network;Email;News;GTK; +MimeType=message/rfc822;x-scheme-handler/mailto;text/calendar;text/x-vcard; +StartupWMClass=thunderbird +StartupNotify=true +Name[ast]=Veceru de corréu Thunderbird +Name[ca]=Client de correu Thunderbird +Name[cs]=PoÅ¡tovní klient Thunderbird +Name[da]=Mozilla Thunderbird - e-post/nyhedsgruppe +Name[de]=Thunderbird E-Mail und Nachrichten +Name[el]=Ηλεκτρονική αλληλογραφία Thunderbird +Name[es]=Cliente de correo Thunderbird +Name[fi]=Thunderbird-sähköposti +Name[fr]=Messagerie Thunderbird +Name[gl]=Cliente de correo Thunderbird +Name[he]=Mozilla Thunderbird דוא״ל/חדשות +Name[hr]=Mozilla Thunderbird e-poÅ¡ta/novosti +Name[hu]=Thunderbird levelezőkliens +Name[it]=Email Mozilla Thunderbird +Name[ja]=Thunderbird電子メールクライアント +Name[ko]=Mozilla Thunderbird +Name[nl]=Mozilla Thunderbird e-mail/nieuws +Name[pl]=Klient poczty Thunderbird +Name[pt_BR]=Cliente de E-mail Thunderbird +Name[ru]=Почтовый клиент Thunderbird +Name[sk]=Thunderbird - poÅ¡tový klient +Name[sv]=E-postklienten Thunderbird +Name[ug]=Mozilla Thunderbird ئېلخەت/خەۋەر +Name[uk]=Поштова програма Thunderbird +Name[vi]=Trình điện thư Mozilla Thunderbird +Name[zh_CN]=Thunderbird 邮件/新闻 +Name[zh_TW]=Thunderbird 郵件 +Comment[ast]=Lleer y escribir corréu electrónicu +Comment[ca]=Llegiu i escriviu correu +Comment[cs]=Čtení a psaní poÅ¡ty +Comment[da]=Læs/skriv post/nyheder med Thunderbird +Comment[de]=E-Mails und Nachrichten mit Thunderbird lesen und schreiben +Comment[el]=Διαβάστε και γράψτε γράμματα με το Mozilla Thunderbird +Comment[es]=Lea y escriba correos y noticias con Thunderbird +Comment[fi]=Lue ja kirjoita sähköposteja +Comment[fr]=Lire et écrire des courriels +Comment[gl]=Lea e escriba correo electrónico +Comment[he]=קריאה/כתיבה של דוא״ל/חדשות באמצעות Mozilla Thunderbird +Comment[hr]=Čitajte/Å¡aljite e-poÅ¡tu s Thunderbird +Comment[hu]=Levelek írása és olvasása a Thunderbirddel +Comment[it]=Per leggere e scrivere email +Comment[ja]=メールの読み書き +Comment[ko]=Mozilla Thunderbird 메일/뉴스 읽기 및 쓰기 클라이언트 +Comment[nl]=E-mail/nieuws lezen en schrijven met Mozilla Thunderbird +Comment[pl]=Czytanie i wysyłanie e-maili +Comment[pt_BR]=Leia e escreva suas mensagens +Comment[ru]=Читайте и пишите письма +Comment[sk]=Čítajte a píšte poÅ¡tu pomocou programu Thunderbird +Comment[sv]=Läs och skriv e-post +Comment[ug]=ئېلخەت ۋە خەۋەرلەرنى Mozilla Thunderbird دا كۆرۈش ۋە يېزىش +Comment[uk]=Читання та написання листів +Comment[vi]=Đọc và soạn thư điện tá»­ +Comment[zh_CN]=阅读邮件或新闻 +Comment[zh_TW]=以 Mozilla Thunderbird 讀寫郵件或新聞 +GenericName[ast]=Client de correu +GenericName[ca]=Client de correu +GenericName[cs]=PoÅ¡tovní klient +GenericName[da]=Postklient +GenericName[de]=E-Mail-Anwendung +GenericName[el]=Λογισμικό αλληλογραφίας +GenericName[es]=Cliente de correo +GenericName[fi]=Sähköpostiohjelma +GenericName[fr]=Client de messagerie +GenericName[gl]=Cliente de correo electrónico +GenericName[he]=לקוח דוא״ל +GenericName[hr]=Klijent e-poÅ¡te +GenericName[hu]=Levelezőkliens +GenericName[it]=Client email +GenericName[ja]=電子メールクライアント +GenericName[ko]=메일 클라이언트 +GenericName[nl]=E-mailprogramma +GenericName[pt_BR]=Cliente de E-mail +GenericName[ru]=Почтовый клиент +GenericName[sk]=PoÅ¡tový klient +GenericName[ug]=ئېلخەت دېتالى +GenericName[uk]=Поштова програма +GenericName[vi]=Phần mềm khách quản lý thư điện tá»­ +GenericName[zh_CN]=邮件新闻客户端 +GenericName[zh_TW]=郵件用戶端 +Keywords=EMail;E-mail;Contact;Addressbook;News; +Keywords[ast]=Corréu;Corréu-e;Noticies;Discusiones;Mensaxes;Canales;RSS +Keywords[ca]=Correu;Email;E-mail;Mailing;Llistes;Notícies;RSS +Keywords[cs]=Email;E-mail;PoÅ¡ta;Elektronická poÅ¡ta;Diskusní skupiny;Čtečka;RSS +Keywords[da]=Email;E-mail;Epost;E-post;Ebrev;E-brev;Kontakt;Adressebog;Nyheder; +Keywords[de]=Mail;E-Mail;Newsgroup;Nachrichten;Feed;RSS;Post;News;Usenet;online;lesen;schreiben +Keywords[el]=Email;E-mail;Newsgroup;Feed;RSS;ημαιλ;Αλληλογραφία;Ροή;ΡΣΣ;Συζητήσεις;Γράμματα +Keywords[es]=Email;Correo electrónico;Noticias;Discusiones;Mensajes;Canales;RSS +Keywords[fi]=Mail;E-Mail;Email;Newsgroup;Feed;RSS;posti;sähköposti;maili;meili;Usenet;uutisryhmät;syöte +Keywords[fr]=Mails;Mels;E-Mails;Emails;Courriels;Courriers;Newsgroup;Feed;RSS;Poster;Thunderbird;Lire;Écrire +Keywords[he]=דוא"ל;דוא״ל;מייל;אי-מייל;אימייל;הודעות;מוזילה;תאנדרבירד;ת׳אנדרבירד;ת'אנדרבירד;ת׳אנדרברד;ת'אנדרברד;דואל; +Keywords[hr]=email;e-mail;e-poÅ¡ta;poÅ¡ta;RSS +Keywords[hu]=Email;E-mail;Levél;Levelezés;Hírcsoport;Feed;Hírforrás;RSS +Keywords[it]=Email;Mail;Posta;Newsgroup;Feed;RSS +Keywords[is]=tölvupóstur;rafpóstur;fréttir;fréttahópar;samtöl;skilaboð;fréttastraumar;RSS +Keywords[ja]=Eメール;イーメール;mail;e-mail;email;メール;電子メール;ニュースグループ;ネットニュース;RSS;フィードリーダー;書く;読む;Mozilla +Keywords[nl]=Email;E-mail;Newsgroup;Feed;RSS;Nieuwsgroep;Post +Keywords[ru]=Email;E-mail;Newsgroup;Feed;RSS;почта;письма;новости;фиды +Keywords[sk]=Email;E-mail;Elektronická poÅ¡ta;Diskusné skupiny;Čítačka kanálov;RSS +Keywords[uk]=Email;E-mail;Newsgroup;Feed;RSS;пошта;новини;подачі;стрічка +Keywords[vi]=Mail;E-Mail;Email;Newsgroup;Feed;RSS;Thư điện tá»­;Gá»­i thư +Keywords[zh_CN]=Mail;E-Mail;Email;Newsgroup;Feed;RSS;电子;邮件;新闻;Thunderbird;tb;雷鸟;电邮;邮箱;阅读器; diff --git a/thunderbird.dirs b/thunderbird.dirs new file mode 100644 index 0000000000..8c66407e7a --- /dev/null +++ b/thunderbird.dirs @@ -0,0 +1,11 @@ +etc/apparmor.d/disable +usr/bin +usr/share/icons/hicolor/16x16/apps +usr/share/icons/hicolor/22x22/apps +usr/share/icons/hicolor/24x24/apps +usr/share/icons/hicolor/32x32/apps +usr/share/icons/hicolor/48x48/apps +usr/share/icons/hicolor/64x64/apps +usr/share/icons/hicolor/128x128/apps +usr/share/icons/hicolor/256x256/apps +usr/share/icons/hicolor/scalable/apps diff --git a/thunderbird.docs b/thunderbird.docs new file mode 100644 index 0000000000..54eb2d6da4 --- /dev/null +++ b/thunderbird.docs @@ -0,0 +1,2 @@ +debian/README.apparmor +#third_party/python/coverage/NOTICE.txt diff --git a/thunderbird.install b/thunderbird.install new file mode 100755 index 0000000000..eab85bc878 --- /dev/null +++ b/thunderbird.install @@ -0,0 +1,34 @@ +#!/usr/bin/dh-exec +debian/logo/thunderbird/mailicon16.png => usr/share/icons/hicolor/16x16/apps/thunderbird.png +debian/logo/thunderbird/mailicon22.png => usr/share/icons/hicolor/22x22/apps/thunderbird.png +debian/logo/thunderbird/mailicon24.png => usr/share/icons/hicolor/24x24/apps/thunderbird.png +debian/logo/thunderbird/mailicon32.png => usr/share/icons/hicolor/32x32/apps/thunderbird.png +debian/logo/thunderbird/mailicon48.png => usr/share/icons/hicolor/48x48/apps/thunderbird.png +debian/logo/thunderbird/mailicon64.png => usr/share/icons/hicolor/64x64/apps/thunderbird.png +debian/logo/thunderbird/mailicon128.png => usr/share/icons/hicolor/128x128/apps/thunderbird.png +debian/logo/thunderbird/mailicon256.png => usr/share/icons/hicolor/256x256/apps/thunderbird.png +debian/thunderbird-wrapper.sh => usr/bin/thunderbird + +comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml usr/share/metainfo +debian/account-autoconfig/* usr/share/thunderbird/isp +debian/logo/thunderbird/thunderbird.svg usr/share/icons/hicolor/scalable/apps +debian/thunderbird.desktop usr/share/applications +debian/thunderbird.js etc/thunderbird/pref +debian/thunderbird-wrapper-helper.sh usr/lib/thunderbird +debian/apparmor/usr.bin.thunderbird etc/apparmor.d +debian/tmp/usr/lib/thunderbird/fonts +debian/tmp/usr/lib/thunderbird/*.ini +debian/tmp/usr/lib/thunderbird/chrome usr/share/thunderbird +debian/tmp/usr/lib/thunderbird/defaults/messenger usr/share/thunderbird/defaults +debian/tmp/usr/lib/thunderbird/defaults/pref usr/share/thunderbird/defaults +debian/tmp/usr/lib/thunderbird/dependentlibs.list +debian/tmp/usr/lib/thunderbird/thunderbird* +debian/tmp/usr/lib/thunderbird/gtk2 +debian/tmp/usr/lib/thunderbird/isp usr/share/thunderbird +debian/tmp/usr/lib/thunderbird/lib* +debian/tmp/usr/lib/thunderbird/omni.ja usr/share/thunderbird +debian/tmp/usr/lib/thunderbird/plugin-container +debian/tmp/usr/lib/thunderbird/removed-files +#[amd64 armel armhf i386] debian/tmp/usr/lib/thunderbird/Throbber-small.gif +#[amd64 armel armhf i386] debian/tmp/usr/lib/thunderbird/crashreporter +debian/vendor.js usr/share/thunderbird/defaults/pref diff --git a/thunderbird.js b/thunderbird.js new file mode 100644 index 0000000000..ad5c492621 --- /dev/null +++ b/thunderbird.js @@ -0,0 +1,42 @@ +// This is the Debian specific preferences file for Mozilla Thunderbird +// You can make any change in here, it is the purpose of this file. +// You can, with this file and all files present in the directory +// +// /etc/thunderbird/pref directory +// +// override any preference that is present in the directory +// +// /usr/lib/thunderbird/defaults/pref +// +// While your changes will be kept on upgrade if you modify files in +// /etc/thunderbird/pref, please note that they won't be kept if you +// do them in /usr/lib/thunderbird/defaults/pref. + +pref("extensions.update.enabled", true); + +// Use LANG environment variable to choose locale from system +// The old environment setting 'pref("intl.locale.matchOS", true);' is +// currently not working anymore. The new introduced setting +// 'intl.locale.requested' is now used for this. Setting an empty string is +// pulling the system locale into Thunderbird. +pref("intl.locale.requested", ""); + +// Disable default mail checking (gnome). +pref("mail.shell.checkDefaultMail", false); + +// Disable default mail client check +pref("mail.shell.checkDefaultClient", false); + +// if you are not using gnome +pref("network.protocol-handler.app.http", "x-www-browser"); +pref("network.protocol-handler.app.https", "x-www-browser"); + +// This setting is a workaround for some crashes inside the JS engine. +// By this Thunderbird will use more memory and acting slower as the sharing +// memory between interacting JS files is disabled. +pref ("javascript.options.baselinejit", false); + +// Uncomment the follwing setting if you want to have a extra mail header field +// for X-Debbugs-Cc, only needed in case you have to work with the Debian +// Bug Tracking System more deeply +//pref("mail.compose.other.header", "X-Debbugs-Cc"); diff --git a/thunderbird.links b/thunderbird.links new file mode 100644 index 0000000000..8328955178 --- /dev/null +++ b/thunderbird.links @@ -0,0 +1,10 @@ +/etc/thunderbird/pref usr/share/thunderbird/defaults/syspref +/usr/share/hunspell usr/lib/thunderbird/dictionaries +# don't link /usr/bin/thunderbird -> /usr/lib/thunderbird/thunderbird +# we need to use a wrapper for Icedove user profile migration +#usr/lib/thunderbird/thunderbird usr/bin/thunderbird +usr/share/thunderbird/chrome usr/lib/thunderbird/chrome +usr/share/thunderbird/defaults usr/lib/thunderbird/defaults +usr/share/thunderbird/isp usr/lib/thunderbird/isp +usr/share/thunderbird/omni.ja usr/lib/thunderbird/omni.ja +usr/lib/thunderbird/thunderbird-bin usr/lib/thunderbird/thunderbird diff --git a/thunderbird.lintian-overrides b/thunderbird.lintian-overrides new file mode 100644 index 0000000000..4acc3c4896 --- /dev/null +++ b/thunderbird.lintian-overrides @@ -0,0 +1,18 @@ +# The embedded libjpeg is libjpeg-turbo, not libjpeg. +thunderbird: embedded-library usr/lib/thunderbird/libxul.so: libjpeg +# Upstream code is not ready to use system library. +#thunderbird: embedded-library usr/lib/thunderbird/libxul.so: srtp +thunderbird: embedded-library usr/lib/thunderbird/libxul.so: libtheora +# The embedded libpng is patched for APNG support. +thunderbird: embedded-library usr/lib/thunderbird/libxul.so: libpng +# We currently need to use the embedded libjsoncpp library. +thunderbird: embedded-library usr/lib/thunderbird/libxul.so: libjsoncpp + +# This is a false positive, can be ignored. +thunderbird: maintainer-script-supports-ancient-package-version postinst:74 5.0-1 (2011-08-03 < 2017-06-18) + +## Uncomment entries if NSPR4 and/or NSS3 are not available in the archive +# NSPR isn't packaged in the required version yet +#thunderbird: embedded-library usr/lib/thunderbird/libnspr4.so: nspr +# NSS isn't packaged in the required version yet +#thunderbird: embedded-library usr/lib/thunderbird/libnss3.so: nss diff --git a/thunderbird.maintscript b/thunderbird.maintscript new file mode 100644 index 0000000000..2d9e3f514f --- /dev/null +++ b/thunderbird.maintscript @@ -0,0 +1,3 @@ +# remove the old Icedove configfile +# command conffile start-version package +rm_conffile /etc/icedove/pref/icedove.js 1:45.7.1-2~ icedove diff --git a/thunderbird.manpages b/thunderbird.manpages new file mode 100644 index 0000000000..52afef8193 --- /dev/null +++ b/thunderbird.manpages @@ -0,0 +1 @@ +debian/thunderbird.1 diff --git a/thunderbird.postinst b/thunderbird.postinst new file mode 100644 index 0000000000..0ce7686497 --- /dev/null +++ b/thunderbird.postinst @@ -0,0 +1,98 @@ +#!/bin/sh +# postinst script for thunderbird +# +# see: dh_installdeb(1) + +set -e +#set -x +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +ICEDOVE_PREF=/etc/icedove/pref +THUNDERBIRD_PREF=/etc/thunderbird/pref +THUNDERBIRD_LIBDIR=/usr/lib/thunderbird +TO_DELETE=0 + +case "$1" in + configure) + # The users might have put some additional files/dirs into the old + # preferences folder '/etc/icedove/pref/', we need to move those files + # into '/etc/thunderbird/pref/' so Thunderbird is picking up those + # configurations as well. + if [ -d ${ICEDOVE_PREF} ]; then + # Check if we have to move files and/or directories. + if [ `ls -a "${ICEDOVE_PREF}" | wc -l` -gt 2 ]; then + # Yes, we found existing data to move! + echo "Moving old Icedove related preferences files ..." + mv ${ICEDOVE_PREF}/* /etc/thunderbird/pref/ + if [ "$?" != "0" ]; then + echo "Something went wrong while moving old Icedove preferences files!" + echo "Please validate files at '/etc/thunderbird/pref' !" + else + # Moving files went fine, we can delete ${ICEDOVE_PREF}. + TO_DELETE=1 + fi + else + # There was nothing, marking folder ${ICEDOVE_PREF} for deleting. + TO_DELETE=1 + fi + if [ "${TO_DELETE}" -eq 1 ]; then + # removing old empty folder /etc/icedove/profile if still existing (last used in squeeze) + if [ -d /etc/icedove/profile ]; then + rmdir /etc/icedove/profile || true + fi + echo "Removing old Icedove pref directory ..." + rmdir ${ICEDOVE_PREF} || true + rmdir /etc/icedove || true + rm -f ${THUNDERBIRD_PREF}/icedove.js.dpkg-remove || true + if [ -f ${THUNDERBIRD_PREF}/icedove.js ]; then + # If dpkg-mainthelper-script wasn't faster and hasn't already removed icedove.js ... + if [ "`md5sum /etc/thunderbird/pref/icedove.js`" = "f7d035193281c76a304391fb07dfd590" ] || \ + [ "`md5sum /etc/thunderbird/pref/icedove.js`" = "049566d25ab2630db3b705197b96f47e" ] ; then + # Remove the file icedove.js, it's the from previous installed Icedove package. + # f7d035193281c76a304391fb07dfd590 <= 1:45.3.0-1 + # 049566d25ab2630db3b705197b96f47e == 1:45.5.1-1 + rm ${THUNDERBIRD_PREF}/icedove.js || true + else + # We have a user modified file icedove.js. + mv ${THUNDERBIRD_PREF}/icedove.js ${THUNDERBIRD_PREF}/icedove.js.dpkg-backup || true + fi + fi + fi + fi + # Disable apparmor on new installations and when we're upgrading from + # a version that had it enabled by default + if test -n "$2" && dpkg --compare-versions "$2" gt "1:52.5.0-1~"; then + : # Leave the disable/ symlink at users choice if + # upgrading from a version that ships the symlink + else + mkdir -p /etc/apparmor.d/disable + [ -f /etc/apparmor.d/disable/usr.bin.thunderbird ] || ln -s /etc/apparmor.d/usr.bin.thunderbird /etc/apparmor.d/disable/usr.bin.thunderbird + fi + ;; + + configure|abort-upgrade) + touch ${THUNDERBID_LIBDIR}/.autoreg + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/thunderbird.prerm b/thunderbird.prerm new file mode 100644 index 0000000000..81a5211a13 --- /dev/null +++ b/thunderbird.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +LIBDIR=/usr/lib/thunderbird + +if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] || [ "$1" = upgrade ]; then + rm -f $LIBDIR/.autoreg +fi + +#DEBHELPER# diff --git a/vendor.js b/vendor.js new file mode 100644 index 0000000000..1a5daea0a2 --- /dev/null +++ b/vendor.js @@ -0,0 +1,2 @@ +// Forbid application updates +pref("app.update.enabled", false, locked); diff --git a/watch b/watch new file mode 100644 index 0000000000..1215966bc7 --- /dev/null +++ b/watch @@ -0,0 +1,3 @@ +version=4 +opts=dversionmangle=s/^(\d\.[\d\.]+)\+dfsg$/$1/ \ +https://download-origin.cdn.mozilla.net/pub/thunderbird/releases/(\d{2}\.[\d\.]+)/source/thunderbird-([\d\.]+).source\.tar\.xz debian python3 -B debian/repack.py diff --git a/xpi-pack.sh b/xpi-pack.sh new file mode 100755 index 0000000000..555e6239fc --- /dev/null +++ b/xpi-pack.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +# Copyright (c) 2008 Alexander Sack, Sasa Bodiroza +# Description: Script to pack indir to xpifile +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# The script searches indir for unpacked jar files, which must be located in +# ./input_dir/path/to/file.jar!/ dir. It will jar it up to +# ./input_dir/path/to/file.jar, and then remove the contents of unpacked dir. +# After that, it will zip up the contents of indir to xpi file. +# Example: xpi-pack ubufox.out ubufox-ver.xpi + +INDIR=$1; +XPIFILE=$2; + +usage() { + echo "$0 - Script to produce XPI file from input directory." + echo + echo "The output XPI file is placed in top-level of the input directory."; + echo "To place it somewhere else, provide relative or absolute path to the"; + echo "output XPI file." + echo + echo "To run it call:"; + echo "$ $0 input_directory output_xpi_file" + echo + echo " input_directory - directory with the XPI source tree"; + echo " output_xpi_file - name of the produced file"; + exit 1; +} + +if [ "$1" = "--help" -o "$1" = "-h" ] ; then + usage +fi; + +if [ -z $INDIR ] ; then + echo "Missing input directory." + echo + usage; +fi; +if [ -z $XPIFILE ] ; then + echo "Missing XPI name." + echo + usage; +fi; +if [ ! -d $INDIR ] ; then + echo "E: Input directory doesn't exist." + echo + usage; +fi; + +START_DIR=`pwd`; +PACK_JAR_PATHS=""; +cd $INDIR; +for JAR_DIR in `find . -type d -name '*.jar\!'` ; do + JAR_FILE=`echo $JAR_DIR | sed "s/jar\!$/jar/"`; + ABS_JAR_PATH=`cd $JAR_DIR ; pwd`; + ABS_JAR_FILE=`echo $ABS_JAR_PATH | sed "s/jar\!$/jar/"`; + ABS_CUR_DIR=`pwd`; + cd $ABS_JAR_PATH; + echo "Packing $JAR_FILE"; + TZ=UTC zip -q -X -r $ABS_JAR_FILE .; + cd $ABS_CUR_DIR; + PACK_JAR_PATHS="$ABS_JAR_FILE $PACK_JAR_PATHS"; + rm -rf $ABS_JAR_PATH; +done; +echo "Packing $XPIFILE"; +TZ=UTC zip -q -X -r $START_DIR/$XPIFILE * -x debian/\* temp-*/\*; +[ -f $START_DIR/$XPIFILE ] && XPIDIR=`dirname $START_DIR/$XPIFILE` +ABS_XPIDIR=`cd $XPIDIR; pwd`; +echo "Packed XPI file. It is located in $ABS_XPIDIR"; +for JAR_PATH in $PACK_JAR_PATHS ; do + echo "Unpacking and removing $JAR_PATH"; + TZ=UTC unzip -q $JAR_PATH -d $JAR_PATH!; + rm -f $JAR_PATH; +done; +cd $START_DIR;