3 # extractor.py: extract function names from declarations in header files
5 # ====================================================================
6 # Copyright (c) 2000-2006 CollabNet. All rights reserved.
8 # This software is licensed as described in the file COPYING, which
9 # you should have received as part of this distribution. The terms
10 # are also available at http://subversion.tigris.org/license-1.html.
11 # If newer versions of this license are posted there, you may use a
12 # newer version instead, at your option.
14 # This software consists of voluntary contributions made by many
15 # individuals. For exact contribution history, see the revision
16 # history and logs, available at http://subversion.tigris.org/.
17 # ====================================================================
25 # This parses the following two types of declarations:
30 # void svn_foo_bar (args)
32 _funcs
= re
.compile(r
'^(?:(?:(?:\w+|\*) )+\*?)?((?:svn|apr)_[a-z_0-9]+)\s*\(', re
.M
)
34 def extract_funcs(fname
):
36 for name
in _funcs
.findall(open(fname
).read()):
37 if name
not in _filter_names
:
42 'svn_boolean_t', # svn_config_enumerator_t looks like (to our regex) a
43 # function declaration for svn_boolean_t
44 'svn_auth_get_keychain_simple_provider', # Not available on Windows
47 if __name__
== '__main__':
48 # run the extractor over each file mentioned
51 for fname
in sys
.argv
[1:]:
52 for func
in extract_funcs(fname
):
54 if os
.path
.basename(fname
) == 'svn_ctype.h':
55 print 'svn_ctype_table = svn_ctype_table_internal CONSTANT'