summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/examples/c/ex_all.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/examples/c/ex_all.c')
-rw-r--r--src/third_party/wiredtiger/examples/c/ex_all.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/examples/c/ex_all.c b/src/third_party/wiredtiger/examples/c/ex_all.c
index fe6bf86804b..d9be2299833 100644
--- a/src/third_party/wiredtiger/examples/c/ex_all.c
+++ b/src/third_party/wiredtiger/examples/c/ex_all.c
@@ -578,6 +578,11 @@ cursor_statistics(WT_SESSION *session)
"statistics:table:mytable",
NULL, "statistics=(all,clear)", &cursor));
/*! [Statistics cursor clear configuration] */
+
+ /*! [Statistics cursor session] */
+ error_check(session->open_cursor(
+ session, "statistics:session", NULL, NULL, &cursor));
+ /*! [Statistics cursor session] */
}
static void
@@ -1352,6 +1357,26 @@ main(int argc, char *argv[])
}
{
+ /*! [Calculate a modify operation] */
+ WT_MODIFY mod[3];
+ int nmod = 3;
+ WT_ITEM prev, newv;
+ prev.data = "the quick brown fox jumped over the lazy dog. " \
+ "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. " \
+ "the quick brown fox jumped over the lazy dog. " \
+ "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. ";
+ prev.size = strlen(prev.data);
+ newv.data = "A quick brown fox jumped over the lazy dog. " \
+ "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. " \
+ "then a quick brown fox jumped over the lazy dog. " \
+ "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. " \
+ "then what?";
+ newv.size = strlen(newv.data);
+ error_check(wiredtiger_calc_modify(NULL, &prev, &newv, 20, mod, &nmod));
+ /*! [Calculate a modify operation] */
+ }
+
+ {
const char *buffer = "some string";
size_t len = strlen(buffer);
/*! [Checksum a buffer] */