summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-04-17 18:37:27 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-04-17 18:37:27 +1000
commitcf7ae1bf714278c6ff85fa4ead1fbb551873f52e (patch)
tree807a0eb70fe4249a7bce83d598d9f16cfdeb39a4
parent938b068b6d3496bec6a6ab4eb7a2e360da84a82c (diff)
downloadmongo-cf7ae1bf714278c6ff85fa4ead1fbb551873f52e.tar.gz
cleanup, move config values into dist/api_data.py
-rw-r--r--dist/api_data.py14
-rw-r--r--src/config/config_def.c8
-rw-r--r--src/cursor/cur_std.c2
-rw-r--r--src/include/wiredtiger.in17
-rw-r--r--src/utilities/util_dump.c4
5 files changed, 24 insertions, 21 deletions
diff --git a/dist/api_data.py b/dist/api_data.py
index 510d5e942d3..159cbfb1396 100644
--- a/dist/api_data.py
+++ b/dist/api_data.py
@@ -447,12 +447,14 @@ methods = {
checkpoint taken for the object). The cursor does not
support data modification'''),
Config('dump', '', r'''
- configure the cursor for dump format inputs and outputs:
- "hex" selects a simple hexadecimal format, "print"
- selects a format where only non-printing characters are
- hexadecimal encoded. The cursor dump format is compatible
- with the @ref util_dump and @ref util_load commands''',
- choices=['hex', 'print']),
+ configure the cursor for dump format inputs and outputs: "hex"
+ selects a simple hexadecimal format, "json" selects a JSON format
+ with each record formats as fields named by column names if
+ availabe, and "print" selects a format where only non-printing
+ characters are hexadecimal encoded, and "json" produces a JSON
+ encoding of the data. The "hex" and "print" dump format are
+ compatible with the @ref util_dump and @ref util_load commands''',
+ choices=['hex', 'json', 'print']),
Config('next_random', 'false', r'''
configure the cursor to return a pseudo-random record from
the object; valid only for row-store cursors. Cursors
diff --git a/src/config/config_def.c b/src/config/config_def.c
index 6001618eec8..6523f72b0df 100644
--- a/src/config/config_def.c
+++ b/src/config/config_def.c
@@ -183,7 +183,9 @@ static const WT_CONFIG_CHECK confchk_session_open_cursor[] = {
{ "append", "boolean", NULL, NULL},
{ "bulk", "string", NULL, NULL},
{ "checkpoint", "string", NULL, NULL},
- { "dump", "string", "choices=[\"hex\",\"json\",\"print\"]", NULL},
+ { "dump", "string",
+ "choices=[\"hex\",\"json\",\"print\"]",
+ NULL},
{ "next_random", "boolean", NULL, NULL},
{ "overwrite", "boolean", NULL, NULL},
{ "raw", "boolean", NULL, NULL},
@@ -390,8 +392,8 @@ static const WT_CONFIG_ENTRY config_entries[] = {
NULL
},
{ "session.open_cursor",
- "append=0,bulk=0,checkpoint=,dump=,json=0,next_random=0,overwrite="
- ",raw=0,statistics=,target=",
+ "append=0,bulk=0,checkpoint=,dump=,next_random=0,overwrite=,raw=0"
+ ",statistics=,target=",
confchk_session_open_cursor
},
{ "session.reconfigure",
diff --git a/src/cursor/cur_std.c b/src/cursor/cur_std.c
index afc6bc7779c..4c732ed2178 100644
--- a/src/cursor/cur_std.c
+++ b/src/cursor/cur_std.c
@@ -636,7 +636,7 @@ __wt_cursor_init(WT_CURSOR *cursor,
if (cval.len != 0) {
F_SET(cursor,
WT_STRING_MATCH("json", cval.str, cval.len) ?
- WT_CURSTD_DUMP_JSON :
+ WT_CURSTD_DUMP_JSON :
(WT_STRING_MATCH("print", cval.str, cval.len) ?
WT_CURSTD_DUMP_PRINT : WT_CURSTD_DUMP_HEX));
if (F_ISSET(cursor, WT_CURSTD_DUMP_JSON)) {
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 5405e37a694..56b6c7d5565 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -679,15 +679,14 @@ struct __wt_session {
* taken for the object). The cursor does not support data
* modification., a string; default empty.}
* @config{dump, configure the cursor for dump format inputs and
- * outputs: "hex" selects a simple hexadecimal format;, "json" selects
- * a JSON format with each key and value formatted as fields\, named
- * by column names if available; "print" selects
- * a format where only non-printing characters are hexadecimal encoded.
- * The cursor "hex" and "print" dump formats are compatible with
- * the @ref util_dump and @ref util_load commands.,
- * a string\, chosen from the following options: \c
- * "hex"\, \c "json"\, \c "print"; default empty.}
- * The cursor json format is used by the @ref util_jsondump commands.
+ * outputs: "hex" selects a simple hexadecimal format\, "json" selects a
+ * JSON format with each record formats as fields named by column names
+ * if availabe\, and "print" selects a format where only non-printing
+ * characters are hexadecimal encoded\, and "json" produces a JSON
+ * encoding of the data. The "hex" and "print" dump format are
+ * compatible with the @ref util_dump and @ref util_load commands., a
+ * string\, chosen from the following options: \c "hex"\, \c "json"\, \c
+ * "print"; default empty.}
* @config{next_random, configure the cursor to return a pseudo-random
* record from the object; valid only for row-store cursors. Cursors
* configured with \c next_random=true only support the WT_CURSOR::next
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c
index 7b7fe7eb7ef..5695ede49e9 100644
--- a/src/utilities/util_dump.c
+++ b/src/utilities/util_dump.c
@@ -663,7 +663,7 @@ dup_json_string(const char *str, char **result)
nchars += __unpack_json_char(*p, NULL, 0, 0);
q = malloc(nchars + 1);
if (q == NULL)
- return 1;
+ return (1);
*result = q;
left = nchars;
for (p = str; *p; p++, nchars++) {
@@ -672,7 +672,7 @@ dup_json_string(const char *str, char **result)
q += nchars;
}
*q = '\0';
- return 0;
+ return (0);
}
/*