2013-02-19 17:06:41 +11:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
# This program pulls the function names from wiredtiger.in and generates
|
|
|
|
|
# an input file for Java SWIG that adds doxygen copydoc comments to functions.
|
|
|
|
|
|
|
|
|
|
import os, re, sys
|
|
|
|
|
import api_data
|
|
|
|
|
from dist import compare_srcfile
|
|
|
|
|
|
|
|
|
|
# Temporary file.
|
|
|
|
|
tmp_file = '__tmp'
|
|
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
|
# Update wiredtiger.in with doxygen comments
|
|
|
|
|
#####################################################################
|
|
|
|
|
f='../src/include/wiredtiger.in'
|
|
|
|
|
o='../lang/java/java_doc.i'
|
|
|
|
|
tfile = open(tmp_file, 'w')
|
|
|
|
|
|
|
|
|
|
tfile.write('''/* DO NOT EDIT: automatically built by dist/java_doc.py. */
|
|
|
|
|
|
|
|
|
|
''')
|
|
|
|
|
|
|
|
|
|
cclass_re = re.compile('^struct __([a-z_]*) {')
|
|
|
|
|
cfunc_re = re.compile('\t.*? __F\(([a-z_]*)\)')
|
|
|
|
|
|
|
|
|
|
curr_class = ""
|
|
|
|
|
for line in open(f, 'r'):
|
|
|
|
|
|
2014-12-03 20:43:47 -05:00
|
|
|
m = cclass_re.match(line)
|
|
|
|
|
if m:
|
|
|
|
|
curr_class = m.group(1)
|
2013-02-19 17:06:41 +11:00
|
|
|
|
2014-12-03 20:43:47 -05:00
|
|
|
if curr_class == "":
|
|
|
|
|
continue
|
2013-02-19 17:06:41 +11:00
|
|
|
|
2014-12-03 20:43:47 -05:00
|
|
|
m = cfunc_re.match(line)
|
|
|
|
|
if m:
|
|
|
|
|
tfile.write('COPYDOC(__' + curr_class.lower() + ', ' +
|
|
|
|
|
curr_class.upper() + ', ' + m.group(1) + ')\n')
|
2013-02-19 17:06:41 +11:00
|
|
|
|
|
|
|
|
tfile.close()
|
|
|
|
|
compare_srcfile(tmp_file, o)
|