shithub: aubio

Download patch

ref: b1f93c4f28870a164c7bd9c665b810b73d3e3e8a
parent: 415e36042aef9140e56123ba7475fc1189c24499
author: Martin Hermant <martin.hermant@gmail.com>
date: Mon May 29 14:23:37 EDT 2017

gen_external.py : fix func_name to long_name resolving (example : aubio_pitch was getting functions like aubio_pitchyin)

--- a/python/lib/gen_external.py
+++ b/python/lib/gen_external.py
@@ -152,7 +152,6 @@
         lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}
         lib[shortname]['longname'] = longname
         lib[shortname]['shortname'] = shortname
-        valid_funcname_part = ['_'+longname,longname+'_']
 
         for fn in c_declarations:
             func_name = fn.split('(')[0].strip().split(' ')[1:]
@@ -160,7 +159,7 @@
                 func_name = func_name[-1]
             else:
                 raise NameError('Warning : error while parsing : unexpected line %s' % fn)
-            if any(x in func_name for x in valid_funcname_part):
+            if func_name.startswith(longname + '_') or func_name.endswith(longname):
                 # print "found", shortname, "in", fn
                 if 'typedef struct ' in fn:
                     lib[shortname]['struct'].append(fn)