summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-05-10 09:47:26 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-05-10 09:47:26 -0400
commit04d89a151b70eb6837caddde808f977a4d52fd6c (patch)
treefd59d1fbc14ad7d19a9dde581c8b485228f00acb
parent6a7bf7247016c97010c52a81f55ada00a0e8aba5 (diff)
downloadmongo-04d89a151b70eb6837caddde808f977a4d52fd6c.tar.gz
Run the "standard" extensions through the style checks, mostly add a
bunch of function header comments. Change the compression source files to all have roughly identical patterns.
-rw-r--r--dist/dist.py7
-rw-r--r--dist/extlist9
-rw-r--r--dist/s_string.ok4
-rw-r--r--ext/collators/reverse/reverse_collator.c8
-rw-r--r--ext/compressors/bzip2/bzip2_compress.c167
-rw-r--r--ext/compressors/nop/nop_compress.c135
-rw-r--r--ext/compressors/snappy/snappy_compress.c75
-rw-r--r--ext/compressors/zlib/zlib_compress.c31
-rw-r--r--ext/datasources/helium/helium.c6
-rw-r--r--src/include/wiredtiger.in7
-rw-r--r--src/include/wiredtiger_ext.h3
11 files changed, 272 insertions, 180 deletions
diff --git a/dist/dist.py b/dist/dist.py
index 725be8f96e3..6994a9128af 100644
--- a/dist/dist.py
+++ b/dist/dist.py
@@ -1,7 +1,7 @@
import filecmp, glob, os, re, shutil
# source_files --
-# Return a list of the source file names in filelist.
+# Return a list of the WiredTiger source file names.
def source_files(skip_includes=False):
if not skip_includes:
for line in glob.iglob('../src/include/*.[hi]'):
@@ -10,9 +10,12 @@ def source_files(skip_includes=False):
for line in open('filelist', 'r'):
if file_re.match(line):
yield os.path.join('..', line.rstrip())
+ for line in open('extlist', 'r'):
+ if file_re.match(line):
+ yield os.path.join('..', line.rstrip())
# source_dirs --
-# Return a list of the directories in filelist.
+# Return a list of the WiredTiger source directory names.
def source_dirs():
dirs = set()
for f in source_files():
diff --git a/dist/extlist b/dist/extlist
new file mode 100644
index 00000000000..524dcb85992
--- /dev/null
+++ b/dist/extlist
@@ -0,0 +1,9 @@
+# extlist --
+# List of extension source files for WiredTiger library.
+
+ext/collators/reverse/reverse_collator.c
+ext/compressors/bzip2/bzip2_compress.c
+ext/compressors/nop/nop_compress.c
+ext/compressors/snappy/snappy_compress.c
+ext/compressors/zlib/zlib_compress.c
+ext/datasources/helium/helium.c
diff --git a/dist/s_string.ok b/dist/s_string.ok
index 3cb7de14054..ff7def71ae6 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -345,6 +345,8 @@ bzCompressInit
bzDecompress
bzDecompressEnd
bzDecompressInit
+bzalloc
+bzfree
bzip
calloc
catfmt
@@ -978,5 +980,7 @@ xff
xxxx
xxxxx
xxxxxx
+zalloc
+zfree
zlib
zu
diff --git a/ext/collators/reverse/reverse_collator.c b/ext/collators/reverse/reverse_collator.c
index b14048273be..d2fbf319f8e 100644
--- a/ext/collators/reverse/reverse_collator.c
+++ b/ext/collators/reverse/reverse_collator.c
@@ -29,6 +29,10 @@
#include <wiredtiger_ext.h>
+/*
+ * collate_reverse --
+ * WiredTiger reverse collation.
+ */
static int
collate_reverse(WT_COLLATOR *collator, WT_SESSION *session,
const WT_ITEM *k1, const WT_ITEM *k2, int *cmp)
@@ -46,6 +50,10 @@ collate_reverse(WT_COLLATOR *collator, WT_SESSION *session,
static WT_COLLATOR reverse_collator = { collate_reverse, NULL };
+/*
+ * wiredtiger_extension_init --
+ * WiredTiger reverse collation extension.
+ */
int
wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
{
diff --git a/ext/compressors/bzip2/bzip2_compress.c b/ext/compressors/bzip2/bzip2_compress.c
index dd97e2abee3..cd73b237387 100644
--- a/ext/compressors/bzip2/bzip2_compress.c
+++ b/ext/compressors/bzip2/bzip2_compress.c
@@ -34,19 +34,6 @@
#include <wiredtiger.h>
#include <wiredtiger_ext.h>
-static int
-bzip2_compress(WT_COMPRESSOR *, WT_SESSION *,
- uint8_t *, size_t, uint8_t *, size_t, size_t *, int *);
-static int
-bzip2_decompress(WT_COMPRESSOR *, WT_SESSION *,
- uint8_t *, size_t, uint8_t *, size_t, size_t *);
-static int
-bzip2_terminate(WT_COMPRESSOR *, WT_SESSION *);
-static int
-bzip2_compress_raw(WT_COMPRESSOR *, WT_SESSION *, size_t, int,
- size_t, uint8_t *, uint32_t *, uint32_t, uint8_t *, size_t, int,
- size_t *, uint32_t *);
-
/* Local compressor structure. */
typedef struct {
WT_COMPRESSOR compressor; /* Must come first */
@@ -69,71 +56,6 @@ typedef struct {
} BZIP_OPAQUE;
/*
- * bzip2_add_compressor --
- * Add a bzip2 compressor.
- */
-static int
-bzip2_add_compressor(WT_CONNECTION *connection, int raw, const char *name)
-{
- BZIP_COMPRESSOR *bzip_compressor;
-
- /*
- * There are two almost identical bzip2 compressors: one supporting raw
- * compression (used by test/format to test raw compression), the other
- * without raw compression, that might be useful for real applications.
- */
- if ((bzip_compressor = calloc(1, sizeof(BZIP_COMPRESSOR))) == NULL)
- return (errno);
-
- bzip_compressor->compressor.compress = bzip2_compress;
- bzip_compressor->
- compressor.compress_raw = raw ? bzip2_compress_raw : NULL;
- bzip_compressor->compressor.decompress = bzip2_decompress;
- bzip_compressor->compressor.pre_size = NULL;
- bzip_compressor->compressor.terminate = bzip2_terminate;
-
- bzip_compressor->wt_api = connection->get_extension_api(connection);
-
- /* between 0-4: set the amount of verbosity to stderr */
- bzip_compressor->bz_verbosity = 0;
-
- /*
- * between 1-9: set the block size to 100k x this number (compression
- * only)
- */
- bzip_compressor->bz_blocksize100k = 1;
-
- /*
- * between 0-250: workFactor: see bzip2 manual. 0 is a reasonable
- * default (compression only)
- */
- bzip_compressor->bz_workfactor = 0;
-
- /*
- * if nonzero, decompress using less memory, but slower (decompression
- * only)
- */
- bzip_compressor->bz_small = 0;
-
- return (connection->add_compressor( /* Load the compressor */
- connection, name, (WT_COMPRESSOR *)bzip_compressor, NULL));
-}
-
-int
-wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
-{
- int ret;
-
- (void)config; /* Unused parameters */
-
- if ((ret = bzip2_add_compressor(connection, 0, "bzip2")) != 0)
- return (ret);
- if ((ret = bzip2_add_compressor(connection, 1, "bzip2-raw-test")) != 0)
- return (ret);
- return (0);
-}
-
-/*
* bzip2_error --
* Output an error message, and return a standard error code.
*/
@@ -184,6 +106,10 @@ bzip2_error(
return (WT_ERROR);
}
+/*
+ * bzalloc --
+ * Allocate scratch buffers.
+ */
static void *
bzalloc(void *cookie, int number, int size)
{
@@ -196,6 +122,10 @@ bzalloc(void *cookie, int number, int size)
wt_api, opaque->session, (size_t)(number * size)));
}
+/*
+ * bzfree --
+ * Free scratch buffers.
+ */
static void
bzfree(void *cookie, void *p)
{
@@ -207,6 +137,10 @@ bzfree(void *cookie, void *p)
wt_api->scr_free(wt_api, opaque->session, p);
}
+/*
+ * bzip2_compress --
+ * WiredTiger bzip2 compression.
+ */
static int
bzip2_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -343,6 +277,10 @@ bzip2_compress_raw(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (take == 0 ? EAGAIN : 0);
}
+/*
+ * bzip2_decompress --
+ * WiredTiger bzip2 decompression.
+ */
static int
bzip2_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -386,6 +324,10 @@ bzip2_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
0 : bzip2_error(compressor, session, "BZ2_bzDecompressEnd", ret));
}
+/*
+ * bzip2_terminate --
+ * WiredTiger bzip2 compression termination.
+ */
static int
bzip2_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
{
@@ -394,3 +336,72 @@ bzip2_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
free(compressor);
return (0);
}
+
+/*
+ * bzip2_add_compressor --
+ * Add a bzip2 compressor.
+ */
+static int
+bzip2_add_compressor(WT_CONNECTION *connection, int raw, const char *name)
+{
+ BZIP_COMPRESSOR *bzip_compressor;
+
+ /*
+ * There are two almost identical bzip2 compressors: one supporting raw
+ * compression (used by test/format to test raw compression), the other
+ * without raw compression, that might be useful for real applications.
+ */
+ if ((bzip_compressor = calloc(1, sizeof(BZIP_COMPRESSOR))) == NULL)
+ return (errno);
+
+ bzip_compressor->compressor.compress = bzip2_compress;
+ bzip_compressor->
+ compressor.compress_raw = raw ? bzip2_compress_raw : NULL;
+ bzip_compressor->compressor.decompress = bzip2_decompress;
+ bzip_compressor->compressor.pre_size = NULL;
+ bzip_compressor->compressor.terminate = bzip2_terminate;
+
+ bzip_compressor->wt_api = connection->get_extension_api(connection);
+
+ /* between 0-4: set the amount of verbosity to stderr */
+ bzip_compressor->bz_verbosity = 0;
+
+ /*
+ * between 1-9: set the block size to 100k x this number (compression
+ * only)
+ */
+ bzip_compressor->bz_blocksize100k = 1;
+
+ /*
+ * between 0-250: workFactor: see bzip2 manual. 0 is a reasonable
+ * default (compression only)
+ */
+ bzip_compressor->bz_workfactor = 0;
+
+ /*
+ * if nonzero, decompress using less memory, but slower (decompression
+ * only)
+ */
+ bzip_compressor->bz_small = 0;
+
+ return (connection->add_compressor( /* Load the compressor */
+ connection, name, (WT_COMPRESSOR *)bzip_compressor, NULL));
+}
+
+/*
+ * wiredtiger_extension_init --
+ * WiredTiger bzip2 compression extension.
+ */
+int
+wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
+{
+ int ret;
+
+ (void)config; /* Unused parameters */
+
+ if ((ret = bzip2_add_compressor(connection, 0, "bzip2")) != 0)
+ return (ret);
+ if ((ret = bzip2_add_compressor(connection, 1, "bzip2-raw-test")) != 0)
+ return (ret);
+ return (0);
+}
diff --git a/ext/compressors/nop/nop_compress.c b/ext/compressors/nop/nop_compress.c
index b68cc5e041f..e536c8fefd8 100644
--- a/ext/compressors/nop/nop_compress.c
+++ b/ext/compressors/nop/nop_compress.c
@@ -32,67 +32,22 @@
#include <wiredtiger.h>
#include <wiredtiger_ext.h>
-static int
-nop_compress(WT_COMPRESSOR *, WT_SESSION *,
- uint8_t *, size_t, uint8_t *, size_t, size_t *, int *);
-static int
-nop_decompress(WT_COMPRESSOR *, WT_SESSION *,
- uint8_t *, size_t, uint8_t *, size_t, size_t *);
-static int
-nop_pre_size(WT_COMPRESSOR *, WT_SESSION *, uint8_t *, size_t, size_t *);
-static int
-nop_terminate(WT_COMPRESSOR *, WT_SESSION *);
-
-/*! [WT_COMPRESSOR initialization] */
+/*! [WT_COMPRESSOR initialization structure] */
/* Local compressor structure. */
typedef struct {
WT_COMPRESSOR compressor; /* Must come first */
WT_EXTENSION_API *wt_api; /* Extension API */
-} NOP_COMPRESSOR;
-
-/*
- * A simple shared library compression example.
- */
-int
-wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
-{
- NOP_COMPRESSOR *nop_compressor;
-
- (void)config; /* Unused parameters */
-
- if ((nop_compressor = calloc(1, sizeof(NOP_COMPRESSOR))) == NULL)
- return (errno);
-
- /*
- * Allocate a local compressor structure, with a WT_COMPRESSOR structure
- * as the first field, allowing us to treat references to either type of
- * structure as a reference to the other type.
- *
- * This could be simplified if only a single database is opened in the
- * application, we could use a static WT_COMPRESSOR structure, and a
- * static reference to the WT_EXTENSION_API methods, then we don't need
- * to allocate memory when the compressor is initialized or free it when
- * the compressor is terminated. However, this approach is more general
- * purpose and supports multiple databases per application.
- */
- nop_compressor->compressor.compress = nop_compress;
- nop_compressor->compressor.compress_raw = NULL;
- nop_compressor->compressor.decompress = nop_decompress;
- nop_compressor->compressor.pre_size = nop_pre_size;
- nop_compressor->compressor.terminate = nop_terminate;
- nop_compressor->wt_api = connection->get_extension_api(connection);
+ unsigned long nop_calls; /* Count of calls */
- /* Load the compressor */
- return (connection->add_compressor(
- connection, "nop", (WT_COMPRESSOR *)nop_compressor, NULL));
-}
-/*! [WT_COMPRESSOR initialization] */
+} NOP_COMPRESSOR;
+/*! [WT_COMPRESSOR initialization structure] */
/*! [WT_COMPRESSOR compress] */
/*
- * A simple compression example that passes data through unchanged.
+ * nop_compress --
+ * A simple compression example that passes data through unchanged.
*/
static int
nop_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
@@ -100,8 +55,11 @@ nop_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *dst, size_t dst_len,
size_t *result_lenp, int *compression_failed)
{
- (void)compressor; /* Unused parameters */
- (void)session;
+ NOP_COMPRESSOR *nop_compressor = (NOP_COMPRESSOR *)compressor;
+
+ (void)session; /* Unused parameters */
+
+ ++nop_compressor->nop_calls; /* Call count */
*compression_failed = 0;
if (dst_len < src_len) {
@@ -118,7 +76,8 @@ nop_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
/*! [WT_COMPRESSOR decompress] */
/*
- * A simple compression example that passes data through unchanged.
+ * nop_decompress --
+ * A simple decompression example that passes data through unchanged.
*/
static int
nop_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
@@ -126,10 +85,13 @@ nop_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *dst, size_t dst_len,
size_t *result_lenp)
{
- (void)compressor; /* Unused parameters */
- (void)session;
+ NOP_COMPRESSOR *nop_compressor = (NOP_COMPRESSOR *)compressor;
+
+ (void)session; /* Unused parameters */
(void)src_len;
+ ++nop_compressor->nop_calls; /* Call count */
+
/*
* The destination length is the number of uncompressed bytes we're
* expected to return.
@@ -142,18 +104,21 @@ nop_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
/*! [WT_COMPRESSOR presize] */
/*
- * A simple pre-size example that returns the source length.
+ * nop_pre_size --
+ * A simple pre-size example that returns the source length.
*/
static int
nop_pre_size(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
size_t *result_lenp)
{
- /* Unused parameters */
- (void)compressor;
- (void)session;
+ NOP_COMPRESSOR *nop_compressor = (NOP_COMPRESSOR *)compressor;
+
+ (void)session; /* Unused parameters */
(void)src;
+ ++nop_compressor->nop_calls; /* Call count */
+
*result_lenp = src_len;
return (0);
}
@@ -161,14 +126,62 @@ nop_pre_size(WT_COMPRESSOR *compressor, WT_SESSION *session,
/*! [WT_COMPRESSOR terminate] */
/*
- * A simple termination example that frees the allocated memory.
+ * nop_terminate --
+ * WiredTiger no-op compression termination.
*/
static int
nop_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
{
+ NOP_COMPRESSOR *nop_compressor = (NOP_COMPRESSOR *)compressor;
+
(void)session; /* Unused parameters */
+ ++nop_compressor->nop_calls; /* Call count */
+
+ /* Free the allocated memory. */
free(compressor);
+
return (0);
}
/*! [WT_COMPRESSOR terminate] */
+
+/*! [WT_COMPRESSOR initialization function] */
+/*
+ * wiredtiger_extension_init --
+ * A simple shared library compression example.
+ */
+int
+wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
+{
+ NOP_COMPRESSOR *nop_compressor;
+
+ (void)config; /* Unused parameters */
+
+ if ((nop_compressor = calloc(1, sizeof(NOP_COMPRESSOR))) == NULL)
+ return (errno);
+
+ /*
+ * Allocate a local compressor structure, with a WT_COMPRESSOR structure
+ * as the first field, allowing us to treat references to either type of
+ * structure as a reference to the other type.
+ *
+ * This could be simplified if only a single database is opened in the
+ * application, we could use a static WT_COMPRESSOR structure, and a
+ * static reference to the WT_EXTENSION_API methods, then we don't need
+ * to allocate memory when the compressor is initialized or free it when
+ * the compressor is terminated. However, this approach is more general
+ * purpose and supports multiple databases per application.
+ */
+ nop_compressor->compressor.compress = nop_compress;
+ nop_compressor->compressor.compress_raw = NULL;
+ nop_compressor->compressor.decompress = nop_decompress;
+ nop_compressor->compressor.pre_size = nop_pre_size;
+ nop_compressor->compressor.terminate = nop_terminate;
+
+ nop_compressor->wt_api = connection->get_extension_api(connection);
+
+ /* Load the compressor */
+ return (connection->add_compressor(
+ connection, "nop", (WT_COMPRESSOR *)nop_compressor, NULL));
+}
+/*! [WT_COMPRESSOR initialization function] */
diff --git a/ext/compressors/snappy/snappy_compress.c b/ext/compressors/snappy/snappy_compress.c
index f0a36c03509..286c9103f06 100644
--- a/ext/compressors/snappy/snappy_compress.c
+++ b/ext/compressors/snappy/snappy_compress.c
@@ -33,17 +33,6 @@
#include <wiredtiger.h>
#include <wiredtiger_ext.h>
-static int
-wt_snappy_compress(WT_COMPRESSOR *, WT_SESSION *,
- uint8_t *, size_t, uint8_t *, size_t, size_t *, int *);
-static int
-wt_snappy_decompress(WT_COMPRESSOR *, WT_SESSION *,
- uint8_t *, size_t, uint8_t *, size_t, size_t *);
-static int
-wt_snappy_pre_size(WT_COMPRESSOR *, WT_SESSION *, uint8_t *, size_t, size_t *);
-static int
-wt_snappy_terminate(WT_COMPRESSOR *, WT_SESSION *);
-
/* Local compressor structure. */
typedef struct {
WT_COMPRESSOR compressor; /* Must come first */
@@ -51,28 +40,6 @@ typedef struct {
WT_EXTENSION_API *wt_api; /* Extension API */
} SNAPPY_COMPRESSOR;
-int
-wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
-{
- SNAPPY_COMPRESSOR *snappy_compressor;
-
- (void)config; /* Unused parameters */
-
- if ((snappy_compressor = calloc(1, sizeof(SNAPPY_COMPRESSOR))) == NULL)
- return (errno);
-
- snappy_compressor->compressor.compress = wt_snappy_compress;
- snappy_compressor->compressor.compress_raw = NULL;
- snappy_compressor->compressor.decompress = wt_snappy_decompress;
- snappy_compressor->compressor.pre_size = wt_snappy_pre_size;
- snappy_compressor->compressor.terminate = wt_snappy_terminate;
-
- snappy_compressor->wt_api = connection->get_extension_api(connection);
-
- return (connection->add_compressor(
- connection, "snappy", (WT_COMPRESSOR *)snappy_compressor, NULL));
-}
-
/*
* wt_snappy_error --
* Output an error message, and return a standard error code.
@@ -103,6 +70,10 @@ wt_snappy_error(WT_COMPRESSOR *compressor,
return (WT_ERROR);
}
+/*
+ * wt_snappy_compress --
+ * WiredTiger snappy compression.
+ */
static int
wt_snappy_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -143,6 +114,10 @@ wt_snappy_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (wt_snappy_error(compressor, session, "snappy_compress", snret));
}
+/*
+ * wt_snappy_decompress --
+ * WiredTiger snappy decompression.
+ */
static int
wt_snappy_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -177,6 +152,10 @@ wt_snappy_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
wt_snappy_error(compressor, session, "snappy_decompress", snret));
}
+/*
+ * wt_snappy_pre_size --
+ * WiredTiger snappy destination buffer sizing.
+ */
static int
wt_snappy_pre_size(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -196,6 +175,10 @@ wt_snappy_pre_size(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (0);
}
+/*
+ * wt_snappy_terminate --
+ * WiredTiger snappy compression termination.
+ */
static int
wt_snappy_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
{
@@ -204,3 +187,29 @@ wt_snappy_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
free(compressor);
return (0);
}
+
+/*
+ * wiredtiger_extension_init --
+ * WiredTiger snappy compression extension.
+ */
+int
+wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
+{
+ SNAPPY_COMPRESSOR *snappy_compressor;
+
+ (void)config; /* Unused parameters */
+
+ if ((snappy_compressor = calloc(1, sizeof(SNAPPY_COMPRESSOR))) == NULL)
+ return (errno);
+
+ snappy_compressor->compressor.compress = wt_snappy_compress;
+ snappy_compressor->compressor.compress_raw = NULL;
+ snappy_compressor->compressor.decompress = wt_snappy_decompress;
+ snappy_compressor->compressor.pre_size = wt_snappy_pre_size;
+ snappy_compressor->compressor.terminate = wt_snappy_terminate;
+
+ snappy_compressor->wt_api = connection->get_extension_api(connection);
+
+ return (connection->add_compressor(
+ connection, "snappy", (WT_COMPRESSOR *)snappy_compressor, NULL));
+}
diff --git a/ext/compressors/zlib/zlib_compress.c b/ext/compressors/zlib/zlib_compress.c
index a48037c8526..4ddb1afd78d 100644
--- a/ext/compressors/zlib/zlib_compress.c
+++ b/ext/compressors/zlib/zlib_compress.c
@@ -69,6 +69,10 @@ zlib_error(
return (WT_ERROR);
}
+/*
+ * zalloc --
+ * Allocate a scratch buffer.
+ */
static void *
zalloc(void *cookie, u_int number, u_int size)
{
@@ -81,6 +85,10 @@ zalloc(void *cookie, u_int number, u_int size)
wt_api, opaque->session, (size_t)(number * size)));
}
+/*
+ * zfree --
+ * Free a scratch buffer.
+ */
static void
zfree(void *cookie, void *p)
{
@@ -92,6 +100,10 @@ zfree(void *cookie, void *p)
wt_api->scr_free(wt_api, opaque->session, p);
}
+/*
+ * zlib_compress --
+ * WiredTiger zlib compression.
+ */
static int
zlib_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -129,8 +141,7 @@ zlib_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
*compression_failed = 1;
if ((ret = deflateEnd(&zs)) != Z_OK)
- return (
- zlib_error(compressor, session, "deflateEnd", ret));
+ return (zlib_error(compressor, session, "deflateEnd", ret));
return (0);
}
@@ -273,6 +284,10 @@ zlib_compress_raw(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (0);
}
+/*
+ * zlib_decompress --
+ * WiredTiger zlib decompression.
+ */
static int
zlib_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
@@ -312,6 +327,10 @@ zlib_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
0 : zlib_error(compressor, session, "inflate", ret));
}
+/*
+ * zlib_terminate --
+ * WiredTiger zlib compression termination.
+ */
static int
zlib_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
{
@@ -321,6 +340,10 @@ zlib_terminate(WT_COMPRESSOR *compressor, WT_SESSION *session)
return (0);
}
+/*
+ * zlib_add_compressor --
+ * Add a zlib compressor.
+ */
static int
zlib_add_compressor(WT_CONNECTION *connection, int raw, const char *name)
{
@@ -352,6 +375,10 @@ zlib_add_compressor(WT_CONNECTION *connection, int raw, const char *name)
connection, name, &zlib_compressor->compressor, NULL));
}
+/*
+ * wiredtiger_extension_init --
+ * WiredTiger zlib compression extension.
+ */
int
wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
{
diff --git a/ext/datasources/helium/helium.c b/ext/datasources/helium/helium.c
index cc420c89999..2c1b5891fa1 100644
--- a/ext/datasources/helium/helium.c
+++ b/ext/datasources/helium/helium.c
@@ -401,6 +401,10 @@ unlock(WT_EXTENSION_API *wtext, WT_SESSION *session, pthread_rwlock_t *lockp)
}
#if 0
+/*
+ * helium_dump_kv --
+ * Dump a Helium record.
+ */
static void
helium_dump_kv(const char *pfx, uint8_t *p, size_t len, FILE *fp)
{
@@ -416,7 +420,7 @@ helium_dump_kv(const char *pfx, uint8_t *p, size_t len, FILE *fp)
}
/*
- * he_dump --
+ * helium_dump --
* Dump the records in a Helium store.
*/
static int
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 698e4f8e60b..1f8e3b7301f 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -1759,7 +1759,9 @@ struct __wt_connection {
* The application must first implement the WT_COMPRESSOR interface
* and then register the implementation with WiredTiger:
*
- * @snippet nop_compress.c WT_COMPRESSOR initialization
+ * @snippet nop_compress.c WT_COMPRESSOR initialization structure
+ *
+ * @snippet nop_compress.c WT_COMPRESSOR initialization function
*
* @param connection the connection handle
* @param name the name of the compression function to be used in calls
@@ -2572,7 +2574,8 @@ struct __wt_collator {
* Applications register their implementation with WiredTiger by calling
* WT_CONNECTION::add_compressor.
*
- * @snippet nop_compress.c WT_COMPRESSOR initialization
+ * @snippet nop_compress.c WT_COMPRESSOR initialization structure
+ * @snippet nop_compress.c WT_COMPRESSOR initialization function
*/
struct __wt_compressor {
/*!
diff --git a/src/include/wiredtiger_ext.h b/src/include/wiredtiger_ext.h
index acf7efad3d9..ff6bc8ffde4 100644
--- a/src/include/wiredtiger_ext.h
+++ b/src/include/wiredtiger_ext.h
@@ -79,7 +79,8 @@ struct __wt_txn_notify {
* The following code is from the sample compression module, where compression
* extension functions are configured in the extension's entry point:
*
- * @snippet nop_compress.c WT_COMPRESSOR initialization
+ * @snippet nop_compress.c WT_COMPRESSOR initialization structure
+ * @snippet nop_compress.c WT_COMPRESSOR initialization function
*/
struct __wt_extension_api {
/* !!! To maintain backwards compatibility, this structure is append-only. */