aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/compress.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-01-07 19:52:28 +0000
committerdrh <drh@noemail.net>2018-01-07 19:52:28 +0000
commitacd6fdee98ba573ab1e3be9a7f6dd4eeb4a213c8 (patch)
treeb7a8197a554e9bbf639d2e163084609572bec34b /ext/misc/compress.c
parent1fa6d9f96f8cda45b2a3123241cd7e4971914830 (diff)
downloadsqlite-acd6fdee98ba573ab1e3be9a7f6dd4eeb4a213c8.tar.gz
sqlite-acd6fdee98ba573ab1e3be9a7f6dd4eeb4a213c8.zip
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
Diffstat (limited to 'ext/misc/compress.c')
-rw-r--r--ext/misc/compress.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/misc/compress.c b/ext/misc/compress.c
index bf38d4c93..6e7d8b614 100644
--- a/ext/misc/compress.c
+++ b/ext/misc/compress.c
@@ -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,