summaryrefslogtreecommitdiff
path: root/src/packing
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-05-04 14:38:50 +0000
committerKeith Bostic <keith@wiredtiger.com>2012-05-04 14:38:50 +0000
commitc4dfc3f4d26eccfea8619670e718164a7550d042 (patch)
tree1e2d5420d209c54596d434635cd87104dc3092d3 /src/packing
parent38c14648506dbe49d9ff3459baab77b4e04a6754 (diff)
downloadmongo-c4dfc3f4d26eccfea8619670e718164a7550d042.tar.gz
Rework WT_EVENT_HANDLERs.
Change the WT_SESSION's WT_EVENT_HANDLER reference to be a real structure, and copy values into it instead of simply pointing to the user-specified structure. The argument for using a reference is the application can swap functions whenever it feels like it, the argument against using a reference is that if the application allocates the structure only long enough to call wiredtiger_open, we're going to drop core. We don't document that the structure needs to persist, and if the application wants to swap functions, it can do it inside the function it gives us, so using a real structure doesn't lose any functionality. Change the semantics of the event-handler error function (used to return void, now returns int) and the progress function (used to return int, now returns void). Change the semantics of the erorr and informational handlers so that if the handler returns failure, we fallback to the default behavior. Document the event-handler parameters. Change the code so that a missing handler calls the default handler function: that means a NULL event-handler structure does the right thing, and eliminates the need for __wt_event_handler_default and some initialization code in a few places, and the need to make the default error and informational message handlers look like the application-specified versions. Delete api/api_event.c, move the default informational and error message handlers into support/err.c Delete the default progress message handler entirely, it didn't do anything. Delete include/progress.i (The only function the file had was the default progress handler function, __wt_progress, which is only used by verify and salvage, the compiler can inline it if it wants.) Moved __wt_progress to support/err.c.
Diffstat (limited to 'src/packing')
-rw-r--r--src/packing/packing_api.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/packing/packing_api.c b/src/packing/packing_api.c
index 0b06c996f4b..0ee1def8925 100644
--- a/src/packing/packing_api.c
+++ b/src/packing/packing_api.c
@@ -19,7 +19,6 @@ wiredtiger_struct_size(const char *fmt, ...)
size_t size;
WT_CLEAR(session);
- session.event_handler = __wt_event_handler_default;
va_start(ap, fmt);
size = __wt_struct_sizev(&session, fmt, ap);
@@ -40,7 +39,6 @@ wiredtiger_struct_pack(void *buffer, size_t size, const char *fmt, ...)
va_list ap;
WT_CLEAR(session);
- session.event_handler = __wt_event_handler_default;
va_start(ap, fmt);
ret = __wt_struct_packv(&session, buffer, size, fmt, ap);
@@ -61,7 +59,6 @@ wiredtiger_struct_unpack(const void *buffer, size_t size, const char *fmt, ...)
va_list ap;
WT_CLEAR(session);
- session.event_handler = __wt_event_handler_default;
va_start(ap, fmt);
ret = __wt_struct_unpackv(&session, buffer, size, fmt, ap);