mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Improved comments on the sqlar.c and compress.c extensions that describe
the differences between the "zlib format" used by SQLAR, the raw deflate format used by ZIP, and the custom format used by compress.c. No changes to code. FossilOrigin-Name: c13415c5caf06eaa73086c500907451dfcdfd1354ac4a9ab63edb7255edbfa1b
This commit is contained in:
@ -27,6 +27,21 @@ SQLITE_EXTENSION_INIT1
|
||||
** seven bits per integer stored in the lower seven bits of each byte.
|
||||
** More significant bits occur first. The most significant bit (0x80)
|
||||
** is a flag to indicate the end of the integer.
|
||||
**
|
||||
** This function, SQLAR, and ZIP all use the same "deflate" compression
|
||||
** algorithm, but each is subtly different:
|
||||
**
|
||||
** * ZIP uses raw deflate.
|
||||
**
|
||||
** * SQLAR uses the "zlib format" which is raw deflate with a two-byte
|
||||
** algorithm-identification header and a four-byte checksum at the end.
|
||||
**
|
||||
** * This utility uses the "zlib format" like SQLAR, but adds the variable-
|
||||
** length integer uncompressed size value at the beginning.
|
||||
**
|
||||
** This function might be extended in the future to support compression
|
||||
** formats other than deflate, by providing a different algorithm-id
|
||||
** mark following the variable-length integer size parameter.
|
||||
*/
|
||||
static void compressFunc(
|
||||
sqlite3_context *context,
|
||||
|
@ -24,6 +24,14 @@ SQLITE_EXTENSION_INIT1
|
||||
** If the type of X is SQLITE_BLOB, and compressing that blob using
|
||||
** zlib utility function compress() yields a smaller blob, return the
|
||||
** compressed blob. Otherwise, return a copy of X.
|
||||
**
|
||||
** SQLar uses the "zlib format" for compressed content. The zlib format
|
||||
** contains a two-byte identification header and a four-byte checksum at
|
||||
** the end. This is different from ZIP which uses the raw deflate format.
|
||||
**
|
||||
** Future enhancements to SQLar might add support for new compression formats.
|
||||
** If so, those new formats will be identified by alternative headers in the
|
||||
** compressed data.
|
||||
*/
|
||||
static void sqlarCompressFunc(
|
||||
sqlite3_context *context,
|
||||
|
Reference in New Issue
Block a user