summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/dist/api_config.py
diff options
context:
space:
mode:
authorRamon Fernandez <ramon.fernandez@mongodb.com>2015-03-26 12:27:35 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-03-26 12:27:35 -0400
commit61d6d65a8b6c18f38465e2379b9897cab8f3f5e8 (patch)
tree89911163de7a4e1a1fcfe9deaa966d6d93840b5f /src/third_party/wiredtiger/dist/api_config.py
parent06b58e9c7c349ce81504cf6ce2823082205ab0f7 (diff)
downloadmongo-61d6d65a8b6c18f38465e2379b9897cab8f3f5e8.tar.gz
Import wiredtiger-wiredtiger-2.5.2-293-g3e37e1f.tar.gz from wiredtiger branch mongodb-3.0
Diffstat (limited to 'src/third_party/wiredtiger/dist/api_config.py')
-rw-r--r--src/third_party/wiredtiger/dist/api_config.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/dist/api_config.py b/src/third_party/wiredtiger/dist/api_config.py
index 83a57ad4e0d..5608933defb 100644
--- a/src/third_party/wiredtiger/dist/api_config.py
+++ b/src/third_party/wiredtiger/dist/api_config.py
@@ -165,9 +165,12 @@ w = textwrap.TextWrapper(width=64, break_on_hyphens=False)
w.wordsep_re = w.wordsep_simple_re = re.compile(r'(,)')
def checkstr(c):
- '''Generate the JSON string used by __wt_config_check to validate the
- config string'''
+ '''Generate the function reference and JSON string used by __wt_config_check
+ to validate the config string'''
checks = c.flags
+ cfunc = str(checks.get('func', ''))
+ if not cfunc:
+ cfunc = 'NULL';
cmin = str(checks.get('min', ''))
cmax = str(checks.get('max', ''))
choices = checks.get('choices', [])
@@ -180,9 +183,9 @@ def checkstr(c):
result.append('choices=' + '[' +
','.join('\\"' + s + '\\"' for s in choices) + ']')
if result:
- return '"' + ','.join(result) + '"'
+ return cfunc + ', "' + ','.join(result) + '"'
else:
- return 'NULL'
+ return cfunc + ', NULL'
def get_default(c):
t = gettype(c)
@@ -206,7 +209,7 @@ def add_subconfig(c):
tfile.write('''
static const WT_CONFIG_CHECK confchk_%(name)s_subconfigs[] = {
\t%(check)s
-\t{ NULL, NULL, NULL, NULL }
+\t{ NULL, NULL, NULL, NULL, NULL }
};
''' % {
'name' : c.name,
@@ -230,7 +233,7 @@ for name in sorted(api_data.methods.keys()):
tfile.write('''
static const WT_CONFIG_CHECK confchk_%(name)s[] = {
\t%(check)s
-\t{ NULL, NULL, NULL, NULL }
+\t{ NULL, NULL, NULL, NULL, NULL }
};
''' % {
'name' : name.replace('.', '_'),