summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2013-03-18 14:57:28 -0400
committerKeith Bostic <keith@wiredtiger.com>2013-03-18 14:57:28 -0400
commit747179ef69103986d0414894f5ff5af6cafe7562 (patch)
tree96a6afbcaee3e659802c4da196a1b9973fe49749
parent2c76df0a1c784227558bce52b46f6c6f5df5fd5c (diff)
downloadmongo-747179ef69103986d0414894f5ff5af6cafe7562.tar.gz
Minor cleanup of the WT_COMPRESSOR docs, list all of the possible structure
members.
-rw-r--r--examples/c/ex_all.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index e3a71ddb978..8ca118649a5 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -856,6 +856,31 @@ my_pre_size(WT_COMPRESSOR *compressor, WT_SESSION *session,
}
/*! [WT_COMPRESSOR presize] */
+static int
+my_compress_raw(WT_COMPRESSOR *compressor, WT_SESSION *session,
+ size_t page_max, u_int split_pct, size_t extra,
+ uint8_t *src, uint32_t *offsets, uint32_t slots,
+ uint8_t *dst, size_t dst_len, int final,
+ size_t *result_lenp, uint32_t *result_slotsp)
+{
+ /* Unused parameters */
+ (void)compressor;
+ (void)session;
+ (void)page_max;
+ (void)split_pct;
+ (void)extra;
+ (void)src;
+ (void)offsets;
+ (void)slots;
+ (void)dst;
+ (void)dst_len;
+ (void)final;
+ (void)result_lenp;
+ (void)result_slotsp;
+
+ return (0);
+}
+
int
add_compressor(WT_CONNECTION *conn)
{
@@ -863,7 +888,11 @@ add_compressor(WT_CONNECTION *conn)
/*! [WT_COMPRESSOR register] */
static WT_COMPRESSOR my_compressor = {
- my_compress, NULL, my_decompress, my_pre_size };
+ my_compress,
+ my_compress_raw, /* NULL, if no raw compression */
+ my_decompress,
+ my_pre_size /* NULL, if pre-sizing not needed */
+ };
ret = conn->add_compressor(conn, "my_compress", &my_compressor, NULL);
/*! [WT_COMPRESSOR register] */