From 15f7f8f402eab5b7cd03094c358435c4c880b5b6 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 22 Nov 2009 11:36:13 +0100 Subject: more bulk build fixes - update rtorrent, libtorrent and libsigc++ - add skeleton for cfinstaller - fix uclibc samba compile - fix parallel builds - update tcl - update iw - remove mac80211 package, use kernel integrated drivers - mark packages which can not be compiled parallel (make -j2) --- package/Config.in | 1 + package/Makefile | 2 +- package/cfinstall/Config.in | 10 + package/cfinstall/Makefile | 29 + package/cfinstall/src/cfinstall.sh | 4 + package/ctorrent/Config.in | 1 + package/cxxtools/Config.in | 2 +- package/cxxtools/Makefile | 4 +- package/iw/Makefile | 4 +- package/iw/patches/patch-Makefile | 6 +- package/iw/patches/patch-version_sh | 17 +- package/libsigc++/Config.in | 1 + package/libsigc++/Makefile | 6 +- package/libsigc++/patches/patch-Makefile_in | 32 +- package/libtorrent/Config.in | 2 +- package/libtorrent/Makefile | 4 +- .../patches/patch-src_tracker_tracker_dht_cc | 10 - package/nss/Makefile | 5 +- package/rtorrent/Config.in | 9 +- package/rtorrent/Makefile | 7 +- package/rtorrent/patches/patch-configure_ac | 11 - package/rtorrent/patches/patch-src_display_utils_h | 11 - .../patches/patch-source3_registry_reg_perfcount_c | 20 + package/sqlite/Makefile | 10 +- package/sqlite/extra/sqlite3.h | 5772 ++++++++++++++++++++ package/sqlite/patches/patch-Makefile_in | 11 + package/subversion/Makefile | 8 +- package/tcl/Makefile | 15 +- package/tcl/patches/patch-unix_Makefile_in | 21 + package/tcp_wrappers/Makefile | 1 + package/tntnet/Config.in | 18 + package/tntnet/Makefile | 10 +- package/uclibc++/Makefile | 4 +- package/uclibc++/files/config | 6 +- package/uclibc++/patches/patch-fstream_eof | 10 +- .../patches/patch-include_associative_base | 38 + package/uclibc++/patches/patch-include_locale | 19 - package/uclibc++/patches/patch-include_string | 6 +- package/uclibc++/patches/patch-src_string_cpp | 6 +- package/ulogd/Makefile | 1 + package/util-linux-ng/Makefile | 6 +- 41 files changed, 6028 insertions(+), 132 deletions(-) create mode 100644 package/cfinstall/Config.in create mode 100644 package/cfinstall/Makefile create mode 100644 package/cfinstall/src/cfinstall.sh delete mode 100644 package/libtorrent/patches/patch-src_tracker_tracker_dht_cc delete mode 100644 package/rtorrent/patches/patch-configure_ac delete mode 100644 package/rtorrent/patches/patch-src_display_utils_h create mode 100644 package/samba/patches/patch-source3_registry_reg_perfcount_c create mode 100644 package/sqlite/extra/sqlite3.h create mode 100644 package/sqlite/patches/patch-Makefile_in create mode 100644 package/tcl/patches/patch-unix_Makefile_in create mode 100644 package/uclibc++/patches/patch-include_associative_base delete mode 100644 package/uclibc++/patches/patch-include_locale (limited to 'package') diff --git a/package/Config.in b/package/Config.in index 01c79c14f..1d32edd5e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -9,6 +9,7 @@ menu "Basesystem" source "package/base-files/Config.in" source "package/busybox/Config.in" source "package/cfgfs/Config.in" +source "package/cfinstall/Config.in" source "package/cryptinit/Config.in" source "package/uclibc/Config.in" source "package/glibc/Config.in" diff --git a/package/Makefile b/package/Makefile index 5cce2a31d..c12cf3067 100644 --- a/package/Makefile +++ b/package/Makefile @@ -39,6 +39,7 @@ package-$(ADK_PACKAGE_BISON) += bison package-$(ADK_PACKAGE_BZIP2) += bzip2 package-$(ADK_PACKAGE_CA_CERTS) += ca-certificates package-$(ADK_PACKAGE_CFGFS) += cfgfs +package-$(ADK_PACKAGE_CFINSTALL) += cfinstall package-$(ADK_PACKAGE_CPIO) += cpio package-$(ADK_PACKAGE_CRYPTINIT) += cryptinit package-$(ADK_PACKAGE_BIGREQSPROTO) += bigreqsproto @@ -442,7 +443,6 @@ package-$(ADK_PACKAGE_ZLIB_DEV) += zlib package-$(ADK_PACKAGE_ZSH) += zsh # kernel addon packages package-$(ADK_PACKAGE_KMOD_EM28XX) += em28xx -package-$(ADK_PACKAGE_KMOD_MAC80211) += mac80211 package-$(ADK_PACKAGE_NTFS_3G) += ntfs-3g DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m)) diff --git a/package/cfinstall/Config.in b/package/cfinstall/Config.in new file mode 100644 index 000000000..f02c4e809 --- /dev/null +++ b/package/cfinstall/Config.in @@ -0,0 +1,10 @@ +config ADK_PACKAGE_CFINSTALL + prompt "cfinstall........................... compact flash installer" + tristate + select ADK_PACKAGE_SFDISK + select ADK_PACKAGE_PARTED + select ADK_PACKAGE_GRUB_BIN + depends on ADK_LINUX_X86_ALIX1C || ADK_LINUX_MIPS_RB532 + default n + help + Installs a rootfs tar archive onto a Compact Flash disk. diff --git a/package/cfinstall/Makefile b/package/cfinstall/Makefile new file mode 100644 index 000000000..7f10dba27 --- /dev/null +++ b/package/cfinstall/Makefile @@ -0,0 +1,29 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= cfinstall +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_DESCR:= compact flash installer +PKG_SECTION:= base + +WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION} +NO_DISTFILES:= 1 + +include ${TOPDIR}/mk/package.mk + +$(eval $(call PKG_template,CFINSTALL,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +pre-configure: + mkdir -p ${WRKBUILD} + +do-install: + ${INSTALL_DIR} $(IDIR_CFINSTALL)/sbin + ${INSTALL_BIN} ./src/cfinstall.sh $(IDIR_CFINSTALL)/sbin + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/cfinstall/src/cfinstall.sh b/package/cfinstall/src/cfinstall.sh new file mode 100644 index 000000000..1ff908963 --- /dev/null +++ b/package/cfinstall/src/cfinstall.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# installs a rootfs tar archive from OpenADK onto a Compact Flash disk + + diff --git a/package/ctorrent/Config.in b/package/ctorrent/Config.in index 862b8c460..fa6f355d5 100644 --- a/package/ctorrent/Config.in +++ b/package/ctorrent/Config.in @@ -24,6 +24,7 @@ config ADK_COMPILE_CTORRENT_WITH_STDCXX config ADK_COMPILE_CTORRENT_WITH_UCLIBCXX bool "Embedded uClibc++ library" select ADK_PACKAGE_UCLIBCXX + depends on ADK_BROKEN help endchoice diff --git a/package/cxxtools/Config.in b/package/cxxtools/Config.in index bdc0168a7..5c040b674 100644 --- a/package/cxxtools/Config.in +++ b/package/cxxtools/Config.in @@ -10,7 +10,7 @@ config ADK_PACKAGE_CXXTOOLS choice prompt "C++ library to use" depends on ADK_PACKAGE_CXXTOOLS -default ADK_COMPILE_CXXTOOLS_WITH_STDCXX if ADK_TARGET_LIB_GLIBC +default ADK_COMPILE_CXXTOOLS_WITH_STDCXX if ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC default ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC config ADK_COMPILE_CXXTOOLS_WITH_STDCXX diff --git a/package/cxxtools/Makefile b/package/cxxtools/Makefile index f3a270aa8..36e91f35c 100644 --- a/package/cxxtools/Makefile +++ b/package/cxxtools/Makefile @@ -24,8 +24,8 @@ endif $(eval $(call PKG_template,CXXTOOLS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) ifeq (${ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX},y) -TCXXFLAGS+= -fno-builtin -nostdinc++ -I${STAGING_DIR}/usr/include/uClibc++ -TLDFLAGS+= -luClibc++ -liconv -lm -nodefaultlibs +TCXXFLAGS+= -fno-builtin -nostdinc++ -I${STAGING_DIR}/usr/include/uClibc++ -Wl,-E +TLDFLAGS+= -luClibc++ -liconv -lm -nodefaultlibs -shared else TLDFLAGS+= -liconv -shared endif diff --git a/package/iw/Makefile b/package/iw/Makefile index 2f63420c0..606fbadf6 100644 --- a/package/iw/Makefile +++ b/package/iw/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= iw -PKG_VERSION:= 0.9.14 +PKG_VERSION:= 0.9.17 PKG_RELEASE:= 1 -PKG_MD5SUM:= b5059cfe86bc7664511b79c159635a8f +PKG_MD5SUM:= 427841093ac11c5cbc025a3e13aac139 PKG_DESCR:= Tools for setting up WiFi cards via netlink (nl80211) PKG_SECTION:= net PKG_DEPENDS:= libnl diff --git a/package/iw/patches/patch-Makefile b/package/iw/patches/patch-Makefile index 32ef25f93..ec12e1d38 100644 --- a/package/iw/patches/patch-Makefile +++ b/package/iw/patches/patch-Makefile @@ -1,6 +1,6 @@ ---- iw-0.9.14.orig/Makefile 2009-05-13 00:10:08.000000000 +0200 -+++ iw-0.9.14/Makefile 2009-06-13 09:45:08.000000000 +0200 -@@ -81,10 +81,10 @@ check: +--- iw-0.9.17.orig/Makefile 2009-08-26 11:41:41.000000000 +0200 ++++ iw-0.9.17/Makefile 2009-11-20 23:10:19.000000000 +0100 +@@ -86,10 +86,10 @@ check: install: iw iw.8.gz @$(NQ) ' INST iw' $(Q)$(MKDIR) $(DESTDIR)$(BINDIR) diff --git a/package/iw/patches/patch-version_sh b/package/iw/patches/patch-version_sh index b4f0fc044..dfc939354 100644 --- a/package/iw/patches/patch-version_sh +++ b/package/iw/patches/patch-version_sh @@ -1,13 +1,9 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- iw-0.9.14.orig/version.sh 2009-05-13 00:10:08.000000000 +0200 -+++ iw-0.9.14/version.sh 2009-05-21 23:14:24.000000000 +0200 -@@ -1,23 +1,7 @@ --#!/bin/sh -+#!/usr/bin/env bash +--- iw-0.9.17.orig/version.sh 2009-08-26 11:41:41.000000000 +0200 ++++ iw-0.9.17/version.sh 2009-11-20 23:11:10.000000000 +0100 +@@ -5,20 +5,6 @@ OUT="$1" + + echo '#include "iw.h"' > "$OUT" - VERSION="0.9.14" - OUT="$1" -- -if head=`git rev-parse --verify HEAD 2>/dev/null`; then - git update-index --refresh --unmerged > /dev/null - descr=$(git describe) @@ -16,7 +12,6 @@ $Id: update-patches 24 2008-08-31 14:56:13Z wbx $ - # is correct... - [ "${descr%%-*}" = "v$VERSION" ] || exit 2 - -- echo -n 'const char iw_version[] = "' > "$OUT" - v="${descr#v}" - if git diff-index --name-only HEAD | read dummy ; then - v="$v"-dirty @@ -26,4 +21,4 @@ $Id: update-patches 24 2008-08-31 14:56:13Z wbx $ -fi +v="$VERSION" - echo "const char iw_version[] = \"$v\";" > "$OUT" + echo "const char iw_version[] = \"$v\";" >> "$OUT" diff --git a/package/libsigc++/Config.in b/package/libsigc++/Config.in index cf47fe9bf..3eb28a28e 100644 --- a/package/libsigc++/Config.in +++ b/package/libsigc++/Config.in @@ -20,6 +20,7 @@ config ADK_COMPILE_LIBSIGCXX_WITH_STDCXX config ADK_COMPILE_LIBSIGCXX_WITH_UCLIBCXX bool "Embedded uClibc++ library" select ADK_PACKAGE_UCLIBCXX + depends on ADK_BROKEN help endchoice diff --git a/package/libsigc++/Makefile b/package/libsigc++/Makefile index e056aab28..eff341b7f 100644 --- a/package/libsigc++/Makefile +++ b/package/libsigc++/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= libsigc++ -PKG_VERSION:= 2.2.2 +PKG_VERSION:= 2.2.4.2 PKG_RELEASE:= 1 -PKG_MD5SUM:= e27a20ac9bc9100f48effdfca8e8c595 +PKG_MD5SUM:= a79b2fe9de69b40e020617c7a652d704 PKG_DESCR:= Callback framework for C++ PKG_SECTION:= libs PKG_URL:= http://libsigc.sourceforge.net @@ -30,7 +30,7 @@ endif CONFIGURE_STYLE:= gnu BUILD_STYLE:= auto -INSTALL_STYLE:= auto confprog +INSTALL_STYLE:= auto ifeq (${ADK_COMPILE_LIBSIGCXX_WITH_UCLIBCXX},y) # add workaround because libtool tries to link libstdc++ diff --git a/package/libsigc++/patches/patch-Makefile_in b/package/libsigc++/patches/patch-Makefile_in index 8a539b06b..a69fe45b0 100644 --- a/package/libsigc++/patches/patch-Makefile_in +++ b/package/libsigc++/patches/patch-Makefile_in @@ -1,12 +1,20 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- libsigc++-2.2.2.orig/Makefile.in 2008-03-10 13:11:44.000000000 +0100 -+++ libsigc++-2.2.2/Makefile.in 2008-10-10 11:05:33.000000000 +0200 -@@ -206,7 +206,7 @@ top_srcdir = @top_srcdir@ - # other stuff here - EXTRA_DIST = autogen.sh sigc++config.h.in libsigc++-2.0.spec.in - # ACLOCAL_FLAGS = -I scripts --SUBDIRS = sigc++ tests docs examples scripts MSVC_Net2003 -+SUBDIRS = sigc++ scripts - DIST_SUBDIRS = $(SUBDIRS) - sigc_configdir = $(libdir)/sigc++-2.0/include - sigc_config_DATA = sigc++config.h +--- libsigc++-2.2.4.2.orig/Makefile.in 2009-09-02 17:55:19.000000000 +0200 ++++ libsigc++-2.2.4.2/Makefile.in 2009-11-20 20:31:56.000000000 +0100 +@@ -89,7 +89,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re + distclean-recursive maintainer-clean-recursive + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = sigc++ tests examples docs ++DIST_SUBDIRS = sigc++ + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) +@@ -239,7 +239,7 @@ top_srcdir = @top_srcdir@ + ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS} + @ENABLE_DOCUMENTATION_FALSE@doc_subdirs = + @ENABLE_DOCUMENTATION_TRUE@doc_subdirs = docs +-SUBDIRS = sigc++ tests examples $(doc_subdirs) ++SUBDIRS = sigc++ + sigc_configdir = $(libdir)/$(SIGCXX_MODULE_NAME)/include + nodist_sigc_config_HEADERS = sigc++config.h + pkgconfigdir = $(libdir)/pkgconfig diff --git a/package/libtorrent/Config.in b/package/libtorrent/Config.in index ab8ae5585..c77cd4425 100644 --- a/package/libtorrent/Config.in +++ b/package/libtorrent/Config.in @@ -11,7 +11,7 @@ config ADK_PACKAGE_LIBTORRENT choice prompt "C++ library to use" depends on ADK_PACKAGE_LIBTORRENT -default ADK_COMPILE_LIBTORRENT_WITH_STDCXX if ADK_TARGET_LIB_GLIBC +default ADK_COMPILE_LIBTORRENT_WITH_STDCXX if ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC default ADK_COMPILE_LIBTORRENT_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC config ADK_COMPILE_LIBTORRENT_WITH_STDCXX diff --git a/package/libtorrent/Makefile b/package/libtorrent/Makefile index 74ab79c9a..331086440 100644 --- a/package/libtorrent/Makefile +++ b/package/libtorrent/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= libtorrent -PKG_VERSION:= 0.12.4 +PKG_VERSION:= 0.12.5 PKG_RELEASE:= 1 -PKG_MD5SUM:= 7e4b4c29a69c86c38e3e60ec11fc2255 +PKG_MD5SUM:= fe8155d364b220713074423100d4bf29 PKG_DESCR:= A bittorrent library PKG_SECTION:= libs PKG_DEPENDS:= libopenssl libsigc++ diff --git a/package/libtorrent/patches/patch-src_tracker_tracker_dht_cc b/package/libtorrent/patches/patch-src_tracker_tracker_dht_cc deleted file mode 100644 index 94dc7b1a8..000000000 --- a/package/libtorrent/patches/patch-src_tracker_tracker_dht_cc +++ /dev/null @@ -1,10 +0,0 @@ ---- libtorrent-0.12.4.orig/src/tracker/tracker_dht.cc 2008-08-26 22:18:34.000000000 +0200 -+++ libtorrent-0.12.4/src/tracker/tracker_dht.cc 2009-08-28 17:44:05.940697717 +0200 -@@ -37,6 +37,7 @@ - #include "config.h" - - #include -+#include - - #include "dht/dht_router.h" - #include "torrent/connection_manager.h" diff --git a/package/nss/Makefile b/package/nss/Makefile index 931d14a8c..e3011eebb 100644 --- a/package/nss/Makefile +++ b/package/nss/Makefile @@ -5,10 +5,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:= nss PKG_VERSION:= 3.12.4 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= 1ee3ed9c1900079319bd1de51388d856 PKG_DESCR:= Network Security Services (NSS) library PKG_SECTION:= libs +PKG_NOPARALLEL:= 1 PKG_URL:= http://www.mozilla.org/projects/security/pki/nss/ PKG_SITES:= https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_4_RTM/src/ @@ -37,7 +38,7 @@ XAKE_FLAGS+= OS_TEST=${ARCH} NSS_DISABLE_DBM=1 post-install: $(INSTALL_DIR) $(IDIR_NSS)/usr/lib - ${INSTALL_DATA} ${WRKDIST}/dist/lib/*.so $(IDIR_NSS)/usr/lib + ${INSTALL_DATA} ${WRKDIST}/dist/lib/lib{ssl3,smime3,nss3,nssutil3}.so $(IDIR_NSS)/usr/lib ${INSTALL_DIR} ${STAGING_DIR}/usr/include/nss ${INSTALL_DATA} ${WRKDIST}/mozilla/dist/public/nss/* ${STAGING_DIR}/usr/include/nss diff --git a/package/rtorrent/Config.in b/package/rtorrent/Config.in index 19df602aa..e1d033315 100644 --- a/package/rtorrent/Config.in +++ b/package/rtorrent/Config.in @@ -12,11 +12,18 @@ config ADK_PACKAGE_RTORRENT choice prompt "C++ library to use" depends on ADK_PACKAGE_RTORRENT -default ADK_COMPILE_RTORRENT_WITH_STDCXX if ADK_TARGET_LIB_GLIBC +default ADK_COMPILE_RTORRENT_WITH_STDCXX if ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC +default ADK_COMPILE_RTORRENT_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC config ADK_COMPILE_RTORRENT_WITH_STDCXX bool "Standard C++ library" select ADK_PACKAGE_LIBSTDCXX help +config ADK_COMPILE_RTORRENT_WITH_UCLIBCXX + bool "Embedded uClibc++ library" + select ADK_PACKAGE_UCLIBCXX + depends on ADK_BROKEN + help + endchoice diff --git a/package/rtorrent/Makefile b/package/rtorrent/Makefile index e068e8eb4..c2de864ba 100644 --- a/package/rtorrent/Makefile +++ b/package/rtorrent/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= rtorrent -PKG_VERSION:= 0.8.4 +PKG_VERSION:= 0.8.5 PKG_RELEASE:= 1 -PKG_MD5SUM:= dc0f37d933b0b6c713ad617e09441f3b +PKG_MD5SUM:= e701095e1824b7e512a17000f4c0a783 PKG_DESCR:= console torrent application PKG_SECTION:= net PKG_DEPENDS:= libncurses libtorrent libcurl @@ -23,8 +23,7 @@ CONFIGURE_ENV+= CXXFLAGS="-fno-builtin -fno-rtti -nostdinc++ \ LIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc" endif -CONFIGURE_STYLE:= autotool gnu -CONFIGURE_ARGS+= --enable-aligned +CONFIGURE_STYLE:= gnu BUILD_STYLE:= auto INSTALL_STYLE:= auto diff --git a/package/rtorrent/patches/patch-configure_ac b/package/rtorrent/patches/patch-configure_ac deleted file mode 100644 index a0252588f..000000000 --- a/package/rtorrent/patches/patch-configure_ac +++ /dev/null @@ -1,11 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- rtorrent-0.8.2.orig/configure.ac 2008-05-07 14:19:12.000000000 +0200 -+++ rtorrent-0.8.2/configure.ac 2008-12-14 22:11:22.000000000 +0100 -@@ -15,7 +15,6 @@ TORRENT_DISABLE_IPV6 - - AC_SYS_LARGEFILE - --TORRENT_CHECK_EXECINFO() - TORRENT_OTFD() - - TORRENT_ENABLE_ARCH diff --git a/package/rtorrent/patches/patch-src_display_utils_h b/package/rtorrent/patches/patch-src_display_utils_h deleted file mode 100644 index 30f0eabe1..000000000 --- a/package/rtorrent/patches/patch-src_display_utils_h +++ /dev/null @@ -1,11 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- rtorrent-0.8.2.orig/src/display/utils.h 2008-05-07 14:19:11.000000000 +0200 -+++ rtorrent-0.8.2/src/display/utils.h 2009-05-29 01:25:58.000000000 +0200 -@@ -38,6 +38,7 @@ - #define RTORRENT_DISPLAY_UTILS_H - - #include -+#include - #include - - namespace core { diff --git a/package/samba/patches/patch-source3_registry_reg_perfcount_c b/package/samba/patches/patch-source3_registry_reg_perfcount_c new file mode 100644 index 000000000..650394f73 --- /dev/null +++ b/package/samba/patches/patch-source3_registry_reg_perfcount_c @@ -0,0 +1,20 @@ +--- samba-3.4.3.orig/source3/registry/reg_perfcount.c 2009-10-29 08:47:16.000000000 +0100 ++++ samba-3.4.3/source3/registry/reg_perfcount.c 2009-11-20 21:11:54.000000000 +0100 +@@ -613,14 +613,14 @@ static bool _reg_perfcount_add_counter(P + obj = NULL; + memset(buf, 0, PERFCOUNT_MAX_LEN); + memcpy(buf, data.dptr, data.dsize); +- begin = index(buf, '['); +- end = index(buf, ']'); ++ begin = strchr(buf, '['); ++ end = strchr(buf, ']'); + if(begin == NULL || end == NULL) + return False; + start = begin+1; + + while(start < end) { +- stop = index(start, ','); ++ stop = strchr(start, ','); + if(stop == NULL) + stop = end; + *stop = '\0'; diff --git a/package/sqlite/Makefile b/package/sqlite/Makefile index 8bf6f2604..f01b739b0 100644 --- a/package/sqlite/Makefile +++ b/package/sqlite/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= sqlite -PKG_VERSION:= 3.6.17 +PKG_VERSION:= 3.6.20 PKG_RELEASE:= 1 -PKG_MD5SUM:= f89f62afc765e08b3f0e47cdc47a15d4 +PKG_MD5SUM:= 0faf8fc8ccff5297513c6532b2b4ce23 PKG_DESCR:= Self-contained, embeddable, zero-configuration SQL database PKG_SECTION:= libs PKG_URL:= http://www.sqlite.org @@ -25,13 +25,15 @@ CONFIGURE_ENV+= config_BUILD_CC="${HOSTCC}" \ config_TARGET_READLINE_INC="-I${STAGING_DIR}/usr/include" \ config_TARGET_READLINE_LIBS="-L${STAGING_DIR}/usr/lib -lreadline -lncurses" MAKE_FLAGS+= LIBPTHREAD=-lm -CONFIGURE_ARGS+= --disable-tcl +CONFIGURE_ARGS+= --disable-tcl \ + --without-tcl \ + --disable-amalgamation BUILD_STYLE:= auto INSTALL_STYLE:= auto post-install: ${INSTALL_DIR} ${IDIR_LIBSQLITE}/usr/lib - ${CP} ${WRKINST}/usr/lib/libsqlite3.so.* ${IDIR_LIBSQLITE}/usr/lib/ + ${CP} ${WRKINST}/usr/lib/libsqlite3.so* ${IDIR_LIBSQLITE}/usr/lib/ ${INSTALL_DIR} ${IDIR_SQLITE_CLI}/usr/bin ${INSTALL_BIN} ${WRKINST}/usr/bin/sqlite3 ${IDIR_SQLITE_CLI}/usr/bin/ diff --git a/package/sqlite/extra/sqlite3.h b/package/sqlite/extra/sqlite3.h new file mode 100644 index 000000000..fc015b08e --- /dev/null +++ b/package/sqlite/extra/sqlite3.h @@ -0,0 +1,5772 @@ +/* +** 2001 September 15 +** +** 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 header file defines the interface that the SQLite library +** presents to client programs. If a C-function, structure, datatype, +** or constant definition does not appear in this file, then it is +** not a published API of SQLite, is subject to change without +** notice, and should not be referenced by programs that use SQLite. +** +** Some of the definitions that are in this file are marked as +** "experimental". Experimental interfaces are normally new +** features recently added to SQLite. We do not anticipate changes +** to experimental interfaces but reserve the right to make minor changes +** if experience from use "in the wild" suggest such changes are prudent. +** +** The official C-language API documentation for SQLite is derived +** from comments in this file. This file is the authoritative source +** on how SQLite interfaces are suppose to operate. +** +** The name of this file under configuration management is "sqlite.h.in". +** The makefile makes some minor changes to this file (such as inserting +** the version number) and changes its name to "sqlite3.h" as +** part of the build process. +*/ +#ifndef _SQLITE3_H_ +#define _SQLITE3_H_ +#include /* Needed for the definition of va_list */ + +/* +** Make sure we can call this stuff from C++. +*/ +#ifdef __cplusplus +extern "C" { +#endif + + +/* +** Add the ability to override 'extern' +*/ +#ifndef SQLITE_EXTERN +# define SQLITE_EXTERN extern +#endif + +#ifndef SQLITE_API +# define SQLITE_API +#endif + + +/* +** These no-op macros are used in front of interfaces to mark those +** interfaces as either deprecated or experimental. New applications +** should not use deprecated interfaces - they are support for backwards +** compatibility only. Application writers should be aware that +** experimental interfaces are subject to change in point releases. +** +** These macros used to resolve to various kinds of compiler magic that +** would generate warning messages when they were used. But that +** compiler magic ended up generating such a flurry of bug reports +** that we have taken it all out and gone back to using simple +** noop macros. +*/ +#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 + +/* +** CAPI3REF: Compile-Time Library Version Numbers {H10010} +** +** The SQLITE_VERSION and SQLITE_VERSION_NUMBER #defines in +** the sqlite3.h file specify the version of SQLite with which +** that header file is associated. +** +** The "version" of SQLite is a string of the form "W.X.Y" or "W.X.Y.Z". +** The W value is major version number and is always 3 in SQLite3. +** The W value only changes when backwards compatibility is +** broken and we intend to never break backwards compatibility. +** The X value is the minor version number and only changes when +** there are major feature enhancements that are forwards compatible +** but not backwards compatible. +** The Y value is the release number and is incremented with +** each release but resets back to 0 whenever X is incremented. +** The Z value only appears on branch releases. +** +** The SQLITE_VERSION_NUMBER is an integer that is computed as +** follows: +** +**
+** SQLITE_VERSION_NUMBER = W*1000000 + X*1000 + Y
+** 
+** +** Since version 3.6.18, SQLite source code has been stored in the +** fossil configuration management +** system. The SQLITE_SOURCE_ID +** macro is a string which identifies a particular check-in of SQLite +** within its configuration management system. The string contains the +** date and time of the check-in (UTC) and an SHA1 hash of the entire +** source tree. +** +** See also: [sqlite3_libversion()], +** [sqlite3_libversion_number()], [sqlite3_sourceid()], +** [sqlite_version()] and [sqlite_source_id()]. +** +** Requirements: [H10011] [H10014] +*/ +#define SQLITE_VERSION "3.6.20" +#define SQLITE_VERSION_NUMBER 3006020 +#define SQLITE_SOURCE_ID "2009-11-04 13:30:02 eb7a544fe49d1626bacecfe53ddc03fe082e3243" + +/* +** CAPI3REF: Run-Time Library Version Numbers {H10020} +** KEYWORDS: sqlite3_version +** +** These interfaces provide the same information as the [SQLITE_VERSION], +** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] #defines in the header, +** but are associated with the library instead of the header file. Cautious +** programmers might include assert() statements in their application to +** verify that values returned by these interfaces match the macros in +** the header, and thus insure that the application is +** compiled with matching library and header files. +** +**
+** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
+** assert( strcmp(sqlite3_libversion,SQLITE_VERSION)==0 );
+** 
+** +** The sqlite3_libversion() function returns the same information as is +** in the sqlite3_version[] string constant. The function is provided +** for use in DLLs since DLL users usually do not have direct access to string +** constants within the DLL. Similarly, the sqlite3_sourceid() function +** returns the same information as is in the [SQLITE_SOURCE_ID] #define of +** the header file. +** +** See also: [sqlite_version()] and [sqlite_source_id()]. +** +** Requirements: [H10021] [H10022] [H10023] +*/ +SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; +SQLITE_API const char *sqlite3_libversion(void); +SQLITE_API const char *sqlite3_sourceid(void); +SQLITE_API int sqlite3_libversion_number(void); + +/* +** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} +** +** 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, +** the mutexes are omitted. Without the mutexes, it is not safe +** to use SQLite concurrently from more than one thread. +** +** Enabling mutexes incurs a measurable performance penalty. +** So if speed is of utmost importance, it makes sense to disable +** the mutexes. But for maximum safety, mutexes should be enabled. +** The default behavior is for mutexes to be enabled. +** +** This interface can be used by an application to make sure that the +** version of SQLite that it is linking against was compiled with +** the desired setting of the [SQLITE_THREADSAFE] macro. +** +** This interface only reports on the compile-time mutex setting +** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with +** SQLITE_THREADSAFE=1 then mutexes are enabled by default but +** can be fully or partially disabled using a call to [sqlite3_config()] +** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], +** or [SQLITE_CONFIG_MUTEX]. The return value of this function shows +** only the default compile-time setting, not any run-time changes +** to that setting. +** +** See the [threading mode] documentation for additional information. +** +** Requirements: [H10101] [H10102] +*/ +SQLITE_API int sqlite3_threadsafe(void); + +/* +** CAPI3REF: Database Connection Handle {H12000} +** KEYWORDS: {database connection} {database connections} +** +** Each open SQLite database is represented by a pointer to an instance of +** the opaque structure named "sqlite3". It is useful to think of an sqlite3 +** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and +** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()] +** is its destructor. There are many other interfaces (such as +** [sqlite3_prepare_v2()], [sqlite3_create_function()], and +** [sqlite3_busy_timeout()] to name but three) that are methods on an +** sqlite3 object. +*/ +typedef struct sqlite3 sqlite3; + +/* +** CAPI3REF: 64-Bit Integer Types {H10200} +** KEYWORDS: sqlite_int64 sqlite_uint64 +** +** Because there is no cross-platform way to specify 64-bit integer types +** SQLite includes typedefs for 64-bit signed and unsigned integers. +** +** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions. +** The sqlite_int64 and sqlite_uint64 types are supported for backwards +** compatibility only. +** +** Requirements: [H10201] [H10202] +*/ +#ifdef SQLITE_INT64_TYPE + typedef SQLITE_INT64_TYPE sqlite_int64; + typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; +#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; + +/* +** 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 + +/* +** CAPI3REF: Closing A Database Connection {H12010} +** +** This routine is the destructor for the [sqlite3] object. +** +** Applications must [sqlite3_finalize | finalize] all [prepared statements] +** and [sqlite3_blob_close | close] all [BLOB handles] associated with +** the [sqlite3] object prior to attempting to close the object. +** +** If [sqlite3_close()] is invoked while a transaction is open, +** the transaction is automatically rolled back. +** +** The C parameter to [sqlite3_close(C)] must be either a NULL +** pointer or an [sqlite3] object pointer obtained +** from [sqlite3_open()], [sqlite3_open16()], or +** [sqlite3_open_v2()], and not previously closed. +** +** Requirements: +** [H12011] [H12012] [H12013] [H12014] [H12015] [H12019] +*/ +SQLITE_API int sqlite3_close(sqlite3 *); + +/* +** The type for a callback function. +** This is legacy and deprecated. It is included for historical +** compatibility and is not documented. +*/ +typedef int (*sqlite3_callback)(void*,int,char**, char**); + +/* +** CAPI3REF: One-Step Query Execution Interface {H12100} +** +** The sqlite3_exec() interface is a convenient way of running one or more +** SQL statements without having to write a lot of C code. The UTF-8 encoded +** SQL statements are passed in as the second parameter to sqlite3_exec(). +** The statements are evaluated one by one until either an error or +** an interrupt is encountered, or until they are all done. The 3rd parameter +** is an optional callback that is invoked once for each row of any query +** results produced by the SQL statements. The 5th parameter tells where +** to write any error messages. +** +** The error message passed back through the 5th parameter is held +** in memory obtained from [sqlite3_malloc()]. To avoid a memory leak, +** the calling application should call [sqlite3_free()] on any error +** message returned through the 5th parameter when it has finished using +** the error message. +** +** If the SQL statement in the 2nd parameter is NULL or an empty string +** or a string containing only whitespace and comments, then no SQL +** statements are evaluated and the database is not changed. +** +** The sqlite3_exec() interface is implemented in terms of +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. +** The sqlite3_exec() routine does nothing to the database that cannot be done +** by [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. +** +** The first parameter to [sqlite3_exec()] must be an valid and open +** [database connection]. +** +** The database connection must not be closed while +** [sqlite3_exec()] is running. +** +** The calling function should use [sqlite3_free()] to free +** the memory that *errmsg is left pointing at once the error +** message is no longer needed. +** +** The SQL statement text in the 2nd parameter to [sqlite3_exec()] +** must remain unchanged while [sqlite3_exec()] is running. +** +** Requirements: +** [H12101] [H12102] [H12104] [H12105] [H12107] [H12110] [H12113] [H12116] +** [H12119] [H12122] [H12125] [H12131] [H12134] [H12137] [H12138] +*/ +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 */ +); + +/* +** CAPI3REF: Result Codes {H10210} +** KEYWORDS: SQLITE_OK {error code} {error codes} +** KEYWORDS: {result code} {result codes} +** +** Many SQLite functions return an integer result code from the set shown +** here in order to indicates success or failure. +** +** New error codes may be added in future versions of SQLite. +** +** See also: [SQLITE_IOERR_READ | extended result codes] +*/ +#define SQLITE_OK 0 /* Successful result */ +/* beginning-of-error-codes */ +#define SQLITE_ERROR 1 /* SQL error or missing database */ +#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 /* NOT USED. Table or record not found */ +#define SQLITE_FULL 13 /* Insertion failed because database is full */ +#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ +#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */ +#define SQLITE_EMPTY 16 /* Database is empty */ +#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 /* Auxiliary database format error */ +#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ +#define SQLITE_NOTADB 26 /* File opened that is not a database file */ +#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */ +#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */ +/* end-of-error-codes */ + +/* +** CAPI3REF: Extended Result Codes {H10220} +** KEYWORDS: {extended error code} {extended error codes} +** KEYWORDS: {extended result code} {extended result codes} +** +** In its default configuration, SQLite API routines return one of 26 integer +** [SQLITE_OK | result codes]. However, experience has shown that many of +** these result codes are too coarse-grained. They do not provide as +** much information about problems as programmers might like. In an effort to +** address this, newer versions of SQLite (version 3.3.8 and later) include +** support for additional result codes that provide more detailed information +** about errors. The extended result codes are enabled or disabled +** on a per database connection basis using the +** [sqlite3_extended_result_codes()] API. +** +** Some of the available extended result codes are listed here. +** One may expect the number of extended result codes will be expand +** over time. Software that uses extended result codes should expect +** to see new result codes in future releases of SQLite. +** +** The SQLITE_OK result code will never be extended. It will always +** be exactly zero. +*/ +#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_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8) ) + +/* +** CAPI3REF: Flags For File Open Operations {H10230} +** +** These bit values are intended for use in the +** 3rd parameter to the [sqlite3_open_v2()] interface and +** in the 4th parameter to the xOpen method of the +** [sqlite3_vfs] object. +*/ +#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_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() */ + +/* +** CAPI3REF: Device Characteristics {H10240} +** +** The xDeviceCapabilities method of the [sqlite3_io_methods] +** object returns an integer which is a vector of the these +** bit values expressing I/O characteristics of the mass storage +** device that holds the file that the [sqlite3_io_methods] +** refers to. +** +** The SQLITE_IOCAP_ATOMIC property means that all writes of +** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values +** mean that writes of blocks that are nnn bytes in size and +** are aligned to an address which is an integer multiple of +** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means +** that when data is appended to a file, the data is appended +** first then the size of the file is extended, never the other +** way around. The SQLITE_IOCAP_SEQUENTIAL property means that +** information is written to disk in the same order as calls +** to xWrite(). +*/ +#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 + +/* +** CAPI3REF: File Locking Levels {H10250} +** +** SQLite uses one of these integer values as the second +** 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 + +/* +** CAPI3REF: Synchronization Type Flags {H10260} +** +** When SQLite invokes the xSync() method of an +** [sqlite3_io_methods] object it uses a combination of +** these integer values as the second argument. +** +** When the SQLITE_SYNC_DATAONLY flag is used, it means that the +** sync operation only needs to flush data to mass storage. Inode +** information need not be flushed. If the lower four bits of the flag +** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics. +** If the lower four bits equal SQLITE_SYNC_FULL, that means +** to use Mac OS X style fullsync instead of fsync(). +*/ +#define SQLITE_SYNC_NORMAL 0x00002 +#define SQLITE_SYNC_FULL 0x00003 +#define SQLITE_SYNC_DATAONLY 0x00010 + +/* +** CAPI3REF: OS Interface Open File Handle {H11110} +** +** 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 +** for their own use. The pMethods entry is a pointer to an +** [sqlite3_io_methods] object that defines methods for performing +** I/O operations on the open file. +*/ +typedef struct sqlite3_file sqlite3_file; +struct sqlite3_file { + const struct sqlite3_io_methods *pMethods; /* Methods for an open file */ +}; + +/* +** CAPI3REF: OS Interface File Virtual Methods Object {H11120} +** +** Every file opened by the [sqlite3_vfs] xOpen method populates an +** [sqlite3_file] object (or, more commonly, a subclass of the +** [sqlite3_file] object) with a pointer to an instance of this object. +** This object defines the methods used to perform various operations +** against the open file represented by the [sqlite3_file] object. +** +** If the 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 xOpen reported that it failed. The +** only way to prevent a call to xClose following a failed xOpen +** is for the xOpen to set the sqlite3_file.pMethods element to NULL. +** +** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or +** [SQLITE_SYNC_FULL]. The first choice is the normal fsync(). +** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY] +** flag may be ORed in to indicate that only the data of the file +** and not its inode needs to be synced. +** +** The integer values to xLock() and xUnlock() are one of +**
    +**
  • [SQLITE_LOCK_NONE], +**
  • [SQLITE_LOCK_SHARED], +**
  • [SQLITE_LOCK_RESERVED], +**
  • [SQLITE_LOCK_PENDING], or +**
  • [SQLITE_LOCK_EXCLUSIVE]. +**
+** xLock() increases the lock. xUnlock() decreases the lock. +** The xCheckReservedLock() method checks whether any database connection, +** either in this process or in some other process, is holding a RESERVED, +** PENDING, or EXCLUSIVE lock on the file. It returns true +** if such a lock exists and false otherwise. +** +** The xFileControl() method is a generic interface that allows custom +** VFS implementations to directly control an open file using the +** [sqlite3_file_control()] interface. The second "op" argument is an +** integer opcode. The third argument is a generic pointer intended to +** point to a structure that may contain arguments or space in which to +** write return values. Potential uses for xFileControl() might be +** functions to enable blocking locks with timeouts, to change the +** locking strategy (for example to use dot-file locks), to inquire +** about the status of a lock, or to break stale locks. The SQLite +** core reserves all opcodes less than 100 for its own use. +** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available. +** Applications that define a custom xFileControl method should use opcodes +** greater than 100 to avoid conflicts. +** +** The xSectorSize() method returns the sector size of the +** device that underlies the file. The sector size is the +** minimum write that can be performed without disturbing +** other bytes in the file. The xDeviceCharacteristics() +** method returns a bit vector describing behaviors of the +** underlying device: +** +**
    +**
  • [SQLITE_IOCAP_ATOMIC] +**
  • [SQLITE_IOCAP_ATOMIC512] +**
  • [SQLITE_IOCAP_ATOMIC1K] +**
  • [SQLITE_IOCAP_ATOMIC2K] +**
  • [SQLITE_IOCAP_ATOMIC4K] +**
  • [SQLITE_IOCAP_ATOMIC8K] +**
  • [SQLITE_IOCAP_ATOMIC16K] +**
  • [SQLITE_IOCAP_ATOMIC32K] +**
  • [SQLITE_IOCAP_ATOMIC64K] +**
  • [SQLITE_IOCAP_SAFE_APPEND] +**
  • [SQLITE_IOCAP_SEQUENTIAL] +**
+** +** The SQLITE_IOCAP_ATOMIC property means that all writes of +** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values +** mean that writes of blocks that are nnn bytes in size and +** are aligned to an address which is an integer multiple of +** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means +** that when data is appended to a file, the data is appended +** first then the size of the file is extended, never the other +** way around. The SQLITE_IOCAP_SEQUENTIAL property means that +** information is written to disk in the same order as calls +** to xWrite(). +** +** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill +** in the unread portions of the buffer with zeros. A VFS that +** fails to zero-fill short reads might seem to work. However, +** failure to zero-fill short reads will eventually lead to +** database corruption. +*/ +typedef struct sqlite3_io_methods sqlite3_io_methods; +struct sqlite3_io_methods { + int iVersion; + int (*xClose)(sqlite3_file*); + int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); + 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 (*xLock)(sqlite3_file*, int); + int (*xUnlock)(sqlite3_file*, int); + int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); + int (*xFileControl)(sqlite3_file*, int op, void *pArg); + int (*xSectorSize)(sqlite3_file*); + int (*xDeviceCharacteristics)(sqlite3_file*); + /* Additional methods may be added in future releases */ +}; + +/* +** CAPI3REF: Standard File Control Opcodes {H11310} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. This capability +** is used during testing and only needs to be supported when SQLITE_TEST +** is defined. +*/ +#define SQLITE_FCNTL_LOCKSTATE 1 +#define SQLITE_GET_LOCKPROXYFILE 2 +#define SQLITE_SET_LOCKPROXYFILE 3 +#define SQLITE_LAST_ERRNO 4 + +/* +** CAPI3REF: Mutex Handle {H17110} +** +** The mutex module within SQLite defines [sqlite3_mutex] to be an +** abstract type for a mutex object. The SQLite core never looks +** at the internal representation of an [sqlite3_mutex]. It only +** deals with pointers to the [sqlite3_mutex] object. +** +** Mutexes are created using [sqlite3_mutex_alloc()]. +*/ +typedef struct sqlite3_mutex sqlite3_mutex; + +/* +** CAPI3REF: OS Interface Object {H11140} +** +** An instance of the sqlite3_vfs object defines the interface between +** the SQLite core and the underlying operating system. The "vfs" +** in the name of the object stands for "virtual file system". +** +** The value of the iVersion field is initially 1 but may be larger in +** future versions of SQLite. Additional fields may be appended to this +** object when the iVersion value is increased. Note that the structure +** of the sqlite3_vfs object changes in the transaction between +** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not +** modified. +** +** The szOsFile field is the size of the subclassed [sqlite3_file] +** structure used by this VFS. mxPathname is the maximum length of +** a pathname in this VFS. +** +** Registered sqlite3_vfs objects are kept on a linked list formed by +** the pNext pointer. The [sqlite3_vfs_register()] +** and [sqlite3_vfs_unregister()] interfaces manage this list +** in a thread-safe way. The [sqlite3_vfs_find()] interface +** searches the list. Neither the application code nor the VFS +** implementation should use the pNext pointer. +** +** The pNext field is the only field in the sqlite3_vfs +** structure that SQLite will ever modify. SQLite will only access +** or modify this field while holding a particular static mutex. +** The application should never modify anything within the sqlite3_vfs +** object once the object has been registered. +** +** The zName field holds the name of the VFS module. The name must +** be unique across all VFS modules. +** +** SQLite will guarantee that the zFilename parameter to xOpen +** is either a NULL pointer or string obtained +** from xFullPathname(). SQLite further guarantees that +** the string will be valid and unchanged until xClose() is +** called. Because of the previous sentence, +** 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 is xOpen is a NULL pointer then xOpen +** 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]. +** If xOpen() opens a file read-only then it sets *pOutFlags to +** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. +** +** SQLite will also add one of the following flags to the xOpen() +** call, depending on the object being opened: +** +**
    +**
  • [SQLITE_OPEN_MAIN_DB] +**
  • [SQLITE_OPEN_MAIN_JOURNAL] +**
  • [SQLITE_OPEN_TEMP_DB] +**
  • [SQLITE_OPEN_TEMP_JOURNAL] +**
  • [SQLITE_OPEN_TRANSIENT_DB] +**
  • [SQLITE_OPEN_SUBJOURNAL] +**
  • [SQLITE_OPEN_MASTER_JOURNAL] +**
+** +** The file I/O implementation can use the object type flags to +** change the way it deals with files. For example, an application +** that does not care about crash recovery or rollback might make +** the open of a journal file a no-op. Writes to this journal would +** also be no-ops, and any attempt to read the journal would return +** SQLITE_IOERR. Or the implementation might recognize that a database +** file will be doing page-aligned sector reads and writes in a random +** order and set up its I/O subsystem accordingly. +** +** SQLite might also add one of the following flags to the xOpen method: +** +**
    +**
  • [SQLITE_OPEN_DELETEONCLOSE] +**
  • [SQLITE_OPEN_EXCLUSIVE] +**
+** +** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be +** deleted when it is closed. The [SQLITE_OPEN_DELETEONCLOSE] +** will be set for TEMP databases, journals and for subjournals. +** +** 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 +** 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 +** for exclusive access. +** +** At least szOsFile bytes of memory are allocated by SQLite +** to hold the [sqlite3_file] structure passed as the third +** argument to xOpen. The xOpen method does not have to +** allocate the structure; it should just fill it in. Note that +** the xOpen method must set the sqlite3_file.pMethods to either +** a valid [sqlite3_io_methods] object or to NULL. xOpen must do +** this even if the open fails. SQLite expects that the sqlite3_file.pMethods +** element will be valid after xOpen returns regardless of the success +** or failure of the xOpen call. +** +** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to +** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] +** to test whether a file is at least readable. The file can be a +** directory. +** +** SQLite will always allocate at least mxPathname+1 bytes for the +** output buffer xFullPathname. The exact size of the output buffer +** is also passed as a parameter to both methods. If the output buffer +** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is +** handled as a fatal error by SQLite, vfs implementations should endeavor +** to prevent this by setting mxPathname to a sufficiently large value. +** +** The xRandomness(), xSleep(), and xCurrentTime() interfaces +** are not strictly a part of the filesystem, but they are +** included in the VFS structure for completeness. +** The xRandomness() function attempts to return nBytes bytes +** of good-quality randomness into zOut. The return value is +** the actual number of bytes of randomness obtained. +** The xSleep() method causes the calling thread to sleep for at +** least the number of microseconds given. The xCurrentTime() +** method returns a Julian Day Number for the current date and time. +** +*/ +typedef struct sqlite3_vfs sqlite3_vfs; +struct sqlite3_vfs { + int iVersion; /* Structure version number */ + 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 (*xSleep)(sqlite3_vfs*, int microseconds); + int (*xCurrentTime)(sqlite3_vfs*, double*); + int (*xGetLastError)(sqlite3_vfs*, int, char *); + /* New fields may be appended in figure versions. The iVersion + ** value will increment whenever this happens. */ +}; + +/* +** CAPI3REF: Flags for the xAccess VFS method {H11190} +** +** These integer constants can be used as the third parameter to +** the xAccess method of an [sqlite3_vfs] object. {END} They determine +** what kind of permissions the xAccess method is looking for. +** With SQLITE_ACCESS_EXISTS, the xAccess method +** simply checks whether the file exists. +** With SQLITE_ACCESS_READWRITE, the xAccess method +** checks whether the file is both readable and writable. +** With SQLITE_ACCESS_READ, the xAccess method +** checks whether the file is readable. +*/ +#define SQLITE_ACCESS_EXISTS 0 +#define SQLITE_ACCESS_READWRITE 1 +#define SQLITE_ACCESS_READ 2 + +/* +** CAPI3REF: Initialize The SQLite Library {H10130} +** +** The sqlite3_initialize() routine initializes the +** SQLite library. The sqlite3_shutdown() routine +** deallocates any resources that were allocated by sqlite3_initialize(). +** This routines are designed to aid in process initialization and +** shutdown on embedded systems. Workstation applications using +** SQLite normally do not need to invoke either of these routines. +** +** A call to sqlite3_initialize() is an "effective" call if it is +** the first time sqlite3_initialize() is invoked during the lifetime of +** the process, or if it is the first time sqlite3_initialize() is invoked +** following a call to sqlite3_shutdown(). Only an effective call +** of sqlite3_initialize() does any initialization. All other calls +** are harmless no-ops. +** +** A call to sqlite3_shutdown() is an "effective" call if it is the first +** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only +** an effective call to sqlite3_shutdown() does any deinitialization. +** All other valid calls to sqlite3_shutdown() are harmless no-ops. +** +** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() +** is not. The sqlite3_shutdown() interface must only be called from a +** single thread. All open [database connections] must be closed and all +** other SQLite resources must be deallocated prior to invoking +** sqlite3_shutdown(). +** +** Among other things, sqlite3_initialize() will invoke +** sqlite3_os_init(). Similarly, sqlite3_shutdown() +** will invoke sqlite3_os_end(). +** +** The sqlite3_initialize() routine returns [SQLITE_OK] on success. +** If for some reason, sqlite3_initialize() is unable to initialize +** the library (perhaps it is unable to allocate a needed resource such +** as a mutex) it returns an [error code] other than [SQLITE_OK]. +** +** The sqlite3_initialize() routine is called internally by many other +** SQLite interfaces so that an application usually does not need to +** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] +** calls sqlite3_initialize() so the SQLite library will be automatically +** initialized when [sqlite3_open()] is called if it has not be initialized +** already. However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] +** compile-time option, then the automatic calls to sqlite3_initialize() +** are omitted and the application must call sqlite3_initialize() directly +** prior to using any other SQLite interface. For maximum portability, +** it is recommended that applications always invoke sqlite3_initialize() +** directly prior to using any other SQLite interface. Future releases +** of SQLite may require this. In other words, the behavior exhibited +** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the +** default behavior in some future release of SQLite. +** +** The sqlite3_os_init() routine does operating-system specific +** initialization of the SQLite library. The sqlite3_os_end() +** routine undoes the effect of sqlite3_os_init(). Typical tasks +** performed by these routines include allocation or deallocation +** of static resources, initialization of global variables, +** setting up a default [sqlite3_vfs] module, or setting up +** a default configuration using [sqlite3_config()]. +** +** The application should never invoke either sqlite3_os_init() +** or sqlite3_os_end() directly. The application should only invoke +** sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init() +** interface is called automatically by sqlite3_initialize() and +** sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate +** implementations for sqlite3_os_init() and sqlite3_os_end() +** are built into SQLite when it is compiled for Unix, Windows, or OS/2. +** When [custom builds | built for other platforms] +** (using the [SQLITE_OS_OTHER=1] compile-time +** option) the application must supply a suitable implementation for +** sqlite3_os_init() and sqlite3_os_end(). An application-supplied +** implementation of sqlite3_os_init() or sqlite3_os_end() +** must return [SQLITE_OK] on success and some other [error code] upon +** failure. +*/ +SQLITE_API int sqlite3_initialize(void); +SQLITE_API int sqlite3_shutdown(void); +SQLITE_API int sqlite3_os_init(void); +SQLITE_API int sqlite3_os_end(void); + +/* +** CAPI3REF: Configuring The SQLite Library {H14100} +** EXPERIMENTAL +** +** The sqlite3_config() interface is used to make global configuration +** changes to SQLite in order to tune SQLite to the specific needs of +** the application. The default configuration is recommended for most +** applications and so this routine is usually not necessary. It is +** provided to support rare applications with unusual needs. +** +** The sqlite3_config() interface is not threadsafe. The application +** must insure that no other SQLite interfaces are invoked by other +** threads while sqlite3_config() is running. Furthermore, sqlite3_config() +** may only be invoked prior to library initialization using +** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. +** Note, however, that sqlite3_config() can be called as part of the +** implementation of an application-defined [sqlite3_os_init()]. +** +** The first argument to sqlite3_config() is an integer +** [SQLITE_CONFIG_SINGLETHREAD | configuration option] that determines +** what property of SQLite is to be configured. Subsequent arguments +** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option] +** in the first argument. +** +** When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. +** If the option is unknown or SQLite is unable to set the option +** then this routine returns a non-zero [error code]. +** +** Requirements: +** [H14103] [H14106] [H14120] [H14123] [H14126] [H14129] [H14132] [H14135] +** [H14138] [H14141] [H14144] [H14147] [H14150] [H14153] [H14156] [H14159] +** [H14162] [H14165] [H14168] +*/ +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); + +/* +** CAPI3REF: Configure database connections {H14200} +** EXPERIMENTAL +** +** The sqlite3_db_config() interface is used to make configuration +** changes to a [database connection]. The interface is similar to +** [sqlite3_config()] except that the changes apply to a single +** [database connection] (specified in the first argument). The +** sqlite3_db_config() interface can only be used immediately after +** the database connection is created using [sqlite3_open()], +** [sqlite3_open16()], or [sqlite3_open_v2()]. +** +** The second argument to sqli