Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | A completely new design for the sqlite3_initialize() and sqlite3_shutdown() interfaces. (CVS 5200) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7dfcd73dc8e97e0bdbe05a22d0ed22b2 |
User & Date: | drh 2008-06-10 17:41:45.000 |
Context
2008-06-11
| ||
11:00 | Update utility program speedtest8inst1.c. (CVS 5201) (check-in: 98bdc7b44d user: danielk1977 tags: trunk) | |
2008-06-10
| ||
17:41 | A completely new design for the sqlite3_initialize() and sqlite3_shutdown() interfaces. (CVS 5200) (check-in: 7dfcd73dc8 user: drh tags: trunk) | |
17:30 | Invalidate sqlite3_blob* handles whenever an SQL statement is used to delete or modify the rows containing the open blob. Previously, modifying the table containing the open blob in any way invalidated the handle. This was too restrictive. (CVS 5199) (check-in: e339c91f87 user: danielk1977 tags: trunk) | |
Changes
Changes to VERSION.
|
| | | 1 | 3.6.0 |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ** 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. ** | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ** 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. ** ** @(#) $Id: sqlite.h.in,v 1.324 2008/06/10 17:41:45 drh Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ #include <stdarg.h> /* Needed for the definition of va_list */ /* ** Make sure we can call this stuff from C++. |
︙ | ︙ | |||
839 840 841 842 843 844 845 | ** checks to see if the file is readable. */ #define SQLITE_ACCESS_EXISTS 0 #define SQLITE_ACCESS_READWRITE 1 #define SQLITE_ACCESS_READ 2 /* | | < | | < < | > > | < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < | < < < < | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < | | > | | | < | | < < < < | < < | | > > | | > | | < | | | | | > | | < | > > > | < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | ** checks to see if the file is readable. */ #define SQLITE_ACCESS_EXISTS 0 #define SQLITE_ACCESS_READWRITE 1 #define SQLITE_ACCESS_READ 2 /* ** CAPI3REF: Initialize The SQLite Library {F10130} ** ** The sqlite3_initialize() routine does operating-system specific ** initialization of the SQLite library. The sqlite3_shutdown() ** routine undoes the effect of sqlite3_initialize(). Typical tasks ** performed by these routines include allocation or deallocation ** of static resources, initialization of global variables, ** setting up a default [sqlite3_vfs | VFS] module, or setting up ** a default configuration using [sqlite3_config()]. ** ** The sqlite3_initialize() routine can be called multiple times ** without consequence. Second and subsequent evaluations of ** sqlite3_initialize() are no-ops. The sqlite3_initialize() routine ** only works the first time it is called for a process, or the first ** time it is called after sqlite3_shutdown(). In all other cases, ** sqlite3_initialize() returns SQLITE_OK. ** ** 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 does not typically 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. ** ** Appropriate implementations for sqlite3_initialize() and sqlite3_shutdown() ** are provided as part of SQLite when it is compiled for unix, win32, and ** os/2. However, when SQLite is compiled for other platforms, the ** implementations of sqlite3_initialize() and sqlite3_shutdown() are ** omitted and must be supplied by the application. ** ** The implementations of sqlite3_initialize() for unix, win32, and os/2 ** are threadsafe and never fail. However, the sqlite3_initialize() ** implementation for other operationing systems might not be threadsafe ** and so portable applications may want to invoke sqlite3_initialize() ** at application startup before other threads are created and check ** the return code to make sure that initialization was successful before ** continuing. To restate: it is never necessary to call sqlite3_initialize() ** on unix, win32, or os/2, but making a serialized call to ** sqlite3_initialize() might be necessary on other operating systems. ** ** The sqlite3_shutdown() interface is not threadsafe on any platform and ** should be serialized by the application. Few applications should ever ** need to call sqlite3_shutdown(). About the only reason for calling ** sqlite3_shutdown() is to deallocate static memory allocations to suppress ** spurious reports of memory leaks from program analysis tools. */ int sqlite3_initialize(void); int sqlite3_shutdown(void); /* ** CAPI3REF: Configuring The SQLite Library {F10145} ** ** 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_initialize()]. ** ** 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 (for ** example if one attempts to set a threadsafe option when SQLite is ** compiled with SQLITE_THREADSAFE=0 and is thus incapable of being ** threadsafe) then this routine returns a non-zero [error code]. */ int sqlite3_config(int, ...); /* ** CAPI3REF: Configuration Options {F10160} ** ** These constants are the available integer configuration options that ** can be passed as the first argument to the [sqlite3_config()] interface. ** ** <dl> ** <dt>SQLITE_CONFIG_SINGLETHREAD</dt> ** <dd>There are no arguments to this option. This option disables ** all mutexing and puts SQLite into a mode where it can only be used ** by a single thread.</dd> ** ** <dt>SQLITE_CONFIG_MULTITHREAD</dt> ** <dd>There are no arguments to this option. This option disables ** mutexing on [database connection] and [prepared statement] objects. ** The application is responsible for serializing access to ** [database connections] and [prepared statements]. But other mutexes ** are enabled so that SQLite will be safe to use in a multi-threaded ** environment.</dd> ** ** <dt>SQLITE_CONFIG_SERIALIZED</dt> ** <dd>There are no arguments to this option. This option enables ** all mutexes including the recursive ** mutexes on [database connection] and [prepared statement] objects. ** In this mode (which is the default when SQLite is compiled with ** SQLITE_THREADSAFE=1) the SQLite library will itself serialize access ** to [database connections] and [prepared statements] so that the ** application is free to use the same [database connection] or the ** same [prepared statement] in different threads at the same time.</dd> ** ** <dt>SQLITE_CONFIG_MALLOC</dt> ** <dd>This option takes four arguments. The first three ** arguments are pointers to functions that emulate malloc(), free(), ** and realloc(), respectively. The fourth argument is either a pointer to ** a function that returns the size of a prior allocation, or NULL. If ** the fourth function is NULL, SQLite will keep track of allocation ** sizes itself. This option is used to replace the default memory ** allocator with an application-defined memory allocator.</dd> ** ** <dt>SQLITE_CONFIG_MEMSTATS</dt> ** <dd>This option takes single boolean argument which enables or disables ** the collection of memory allocation statistics. When disabled, the ** following SQLite interfaces become non-operational: ** <ul> ** <li> [sqlite3_memory_used()] ** <li> [sqlite3_memory_highwater()] ** <li> [sqlite3_soft_heap_limit()] ** </ul> ** </dd> ** </dl> */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ #define SQLITE_CONFIG_SERIALIZED 3 /* nil */ #define SQLITE_CONFIG_MALLOC 4 /* malloc, free, realloc, memsize */ #define SQLITE_CONFIG_MEMSTATS 5 /* boolean */ /* These options are to be added later. Currently unused and undocumented. */ #define SQLITE_CONFIG_PAGEMALLOC 6 /* malloc, free */ #define SQLITE_CONFIG_TEMPMALLOC 7 /* malloc, free */ #define SQLITE_CONFIG_HEAP 8 /* void*, int64 */ #define SQLITE_CONFIG_PAGEHEAP 9 /* void*, int64 */ #define SQLITE_CONFIG_TEMPHEAP 10 /* void*, int64 */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes {F12200} ** ** The sqlite3_extended_result_codes() routine enables or disables the ** [SQLITE_IOERR_READ | extended result codes] feature of SQLite. ** The extended result codes are disabled by default for historical |
︙ | ︙ | |||
2698 2699 2700 2701 2702 2703 2704 | ** protected and unprotected sqlite3_value objects and they can be ** used interchangeable. However, for maximum code portability it ** is recommended that applications make the distinction between ** between protected and unprotected sqlite3_value objects even if ** they are single threaded. ** ** The sqlite3_value objects that are passed as parameters into the | | > > | > | | > > > > > > > > | 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 | ** protected and unprotected sqlite3_value objects and they can be ** used interchangeable. However, for maximum code portability it ** is recommended that applications make the distinction between ** between protected and unprotected sqlite3_value objects even if ** they are single threaded. ** ** The sqlite3_value objects that are passed as parameters into the ** implementation of ** [sqlite3_create_function | application-defined SQL functions] ** are protected. ** The sqlite3_value object returned by ** [sqlite3_column_value()] is unprotected. ** Unprotected sqlite3_value objects may only be used with ** [sqlite3_result_value()] and [sqlite3_bind_value()]. ** The [sqlite3_value_blob | sqlite3_value_type()] family of ** interfaces require protected sqlite3_value objects. */ typedef struct Mem sqlite3_value; /* ** CAPI3REF: SQL Function Context Object {F16001} ** ** The context in which an SQL function executes is stored in an ** sqlite3_context object. A pointer to an sqlite3_context ** object is always first parameter to ** [sqlite3_create_function | application-defined SQL functions]. ** The applicationed-defined SQL function implementation will pass this ** pointer through into calls to ** [sqlite3_result_int | sqlite3_result()], ** [sqlite3_aggregate_context()], ** [sqlite3_user_data()], ** [sqlite3_context_db_handle()], ** [sqlite3_get_auxdata()], and/or [sqlite3_set_auxdata()]. */ typedef struct sqlite3_context sqlite3_context; /* ** CAPI3REF: Binding Values To Prepared Statements {F13500} ** ** In the SQL strings input to [sqlite3_prepare_v2()] and its |
︙ | ︙ |