History

gen_external.py : support parsing of non aubio_ function : fvec and stuffs

Martin Hermant committed 9 years ago

Commit 56748331 parent 15a43e01 file · +17 −5Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/gen_external.py+17−5
@@ -129,17 +129,29 @@ def analyze_cpp_output(cpp_objects, cpp_output): · 128 unmodified lines
129 lib = {}129 lib = {}
130 130
131 for o in cpp_objects:131 for o in cpp_objects:
132 if o[:6] != 'aubio_':132 shortname = ''
133 continue133 if o[:6] == 'aubio_':
134 shortname = o[6:-2]134 shortname = o[6:-2] # without aubio_
135 longname = o[:-2] # without _t
136 else: # support object not starting with aubio_ (fvec...)
137 shortname = o
138 longname = shortname
139
135 if shortname in skip_objects:140 if shortname in skip_objects:
136 continue141 continue
137 lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}142 lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}
138 lib[shortname]['longname'] = o143 lib[shortname]['longname'] = o
139 lib[shortname]['shortname'] = shortname144 lib[shortname]['shortname'] = shortname
145 valid_funcname_part = ['_'+longname,longname+'_']
146
140 for fn in cpp_output:147 for fn in cpp_output:
141 if o[:-1] in fn:148 func_name = fn.split('(')[0].strip().split(' ')[1:]
142 #print "found", o[:-1], "in", fn149 if func_name:
150 func_name = func_name[-1]
151 else:
152 raise NameError('Warning : error while parsing : unexpected line %s' % fn)
153 if any(x in func_name for x in valid_funcname_part):
154 # print "found", shortname, "in", fn
143 if 'typedef struct ' in fn:155 if 'typedef struct ' in fn:
144 lib[shortname]['struct'].append(fn)156 lib[shortname]['struct'].append(fn)
145 elif '_do' in fn:157 elif '_do' in fn:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t