summaryrefslogtreecommitdiff
path: root/src/packing
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2016-03-11 12:21:51 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2016-03-11 12:21:51 +1100
commitccb81f359eb56649978621c6f1ddcfe7e68e1f48 (patch)
tree6273f6ad280656e4fb00ff2f38104aaa05e2d18d /src/packing
parent1f9ccd49f1040161aaa94acda4ba7e7359d5978a (diff)
downloadmongo-ccb81f359eb56649978621c6f1ddcfe7e68e1f48.tar.gz
WT-2404 Make pack/unpack extension API consistent.
Diffstat (limited to 'src/packing')
-rw-r--r--src/packing/pack_stream.c50
1 files changed, 37 insertions, 13 deletions
diff --git a/src/packing/pack_stream.c b/src/packing/pack_stream.c
index 6ab44c123c8..5716c31a9c2 100644
--- a/src/packing/pack_stream.c
+++ b/src/packing/pack_stream.c
@@ -333,10 +333,16 @@ wiredtiger_unpack_uint(WT_PACK_STREAM *ps, uint64_t *up)
* WT_EXTENSION.pack_start method.
*/
int
-__wt_ext_pack_start(WT_SESSION *session, const char *format,
+__wt_ext_pack_start(WT_EXTENSION_API *wt_api,
+ WT_SESSION *wt_session, const char *format,
void *buffer, size_t size, WT_PACK_STREAM **psp)
{
- return (wiredtiger_pack_start(session, format, buffer, size, psp));
+ WT_CONNECTION_IMPL *conn;
+
+ conn = (WT_CONNECTION_IMPL *)wt_api->conn;
+ if (wt_session == NULL)
+ wt_session = (WT_SESSION *)conn->default_session;
+ return (wiredtiger_pack_start(wt_session, format, buffer, size, psp));
}
/*
@@ -344,10 +350,16 @@ __wt_ext_pack_start(WT_SESSION *session, const char *format,
* WT_EXTENSION.unpack_start
*/
int
-__wt_ext_unpack_start(WT_SESSION *session, const char *format,
+__wt_ext_unpack_start(WT_EXTENSION_API *wt_api,
+ WT_SESSION *wt_session, const char *format,
const void *buffer, size_t size, WT_PACK_STREAM **psp)
{
- return (wiredtiger_unpack_start(session, format, buffer, size, psp));
+ WT_CONNECTION_IMPL *conn;
+
+ conn = (WT_CONNECTION_IMPL *)wt_api->conn;
+ if (wt_session == NULL)
+ wt_session = (WT_SESSION *)conn->default_session;
+ return (wiredtiger_unpack_start(wt_session, format, buffer, size, psp));
}
/*
@@ -355,8 +367,9 @@ __wt_ext_unpack_start(WT_SESSION *session, const char *format,
* WT_EXTENSION.pack_close
*/
int
-__wt_ext_pack_close(WT_PACK_STREAM *ps, size_t *usedp)
+__wt_ext_pack_close(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, size_t *usedp)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_pack_close(ps, usedp));
}
@@ -365,8 +378,9 @@ __wt_ext_pack_close(WT_PACK_STREAM *ps, size_t *usedp)
* WT_EXTENSION.pack_item
*/
int
-__wt_ext_pack_item(WT_PACK_STREAM *ps, WT_ITEM *item)
+__wt_ext_pack_item(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, WT_ITEM *item)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_pack_item(ps, item));
}
@@ -375,8 +389,9 @@ __wt_ext_pack_item(WT_PACK_STREAM *ps, WT_ITEM *item)
* WT_EXTENSION.pack_int
*/
int
-__wt_ext_pack_int(WT_PACK_STREAM *ps, int64_t i)
+__wt_ext_pack_int(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, int64_t i)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_pack_int(ps, i));
}
@@ -385,8 +400,9 @@ __wt_ext_pack_int(WT_PACK_STREAM *ps, int64_t i)
* WT_EXTENSION.pack_str
*/
int
-__wt_ext_pack_str(WT_PACK_STREAM *ps, const char *s)
+__wt_ext_pack_str(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, const char *s)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_pack_str(ps, s));
}
@@ -395,8 +411,9 @@ __wt_ext_pack_str(WT_PACK_STREAM *ps, const char *s)
* WT_EXTENSION.pack_uint
*/
int
-__wt_ext_pack_uint(WT_PACK_STREAM *ps, uint64_t u)
+__wt_ext_pack_uint(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, uint64_t u)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_pack_uint(ps, u));
}
@@ -405,8 +422,10 @@ __wt_ext_pack_uint(WT_PACK_STREAM *ps, uint64_t u)
* WT_EXTENSION.unpack_item
*/
int
-__wt_ext_unpack_item(WT_PACK_STREAM *ps, WT_ITEM *item)
+__wt_ext_unpack_item(WT_EXTENSION_API *wt_api,
+ WT_PACK_STREAM *ps, WT_ITEM *item)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_unpack_item(ps, item));
}
@@ -415,8 +434,10 @@ __wt_ext_unpack_item(WT_PACK_STREAM *ps, WT_ITEM *item)
* WT_EXTENSION.unpack_int
*/
int
-__wt_ext_unpack_int(WT_PACK_STREAM *ps, int64_t *ip)
+__wt_ext_unpack_int(WT_EXTENSION_API *wt_api,
+ WT_PACK_STREAM *ps, int64_t *ip)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_unpack_int(ps, ip));
}
@@ -425,8 +446,10 @@ __wt_ext_unpack_int(WT_PACK_STREAM *ps, int64_t *ip)
* WT_EXTENSION.unpack_str
*/
int
-__wt_ext_unpack_str(WT_PACK_STREAM *ps, const char **sp)
+__wt_ext_unpack_str(WT_EXTENSION_API *wt_api,
+ WT_PACK_STREAM *ps, const char **sp)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_unpack_str(ps, sp));
}
@@ -435,7 +458,8 @@ __wt_ext_unpack_str(WT_PACK_STREAM *ps, const char **sp)
* WT_EXTENSION.unpack_uint
*/
int
-__wt_ext_unpack_uint(WT_PACK_STREAM *ps, uint64_t *up)
+__wt_ext_unpack_uint(WT_EXTENSION_API *wt_api, WT_PACK_STREAM *ps, uint64_t *up)
{
+ WT_UNUSED(wt_api);
return (wiredtiger_unpack_uint(ps, up));
}