Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -152,7 +152,6 @@ def analyze_c_declarations(cpp_objects, c_declarations): · 151 unmodified lines | |||
| 152 | lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []} | 152 | lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []} |
| 153 | lib[shortname]['longname'] = longname | 153 | lib[shortname]['longname'] = longname |
| 154 | lib[shortname]['shortname'] = shortname | 154 | lib[shortname]['shortname'] = shortname |
| 155 | valid_funcname_part = ['_'+longname,longname+'_'] | ||
| 156 | 155 | ||
| 157 | for fn in c_declarations: | 156 | for fn in c_declarations: |
| 158 | func_name = fn.split('(')[0].strip().split(' ')[1:] | 157 | func_name = fn.split('(')[0].strip().split(' ')[1:] |
| @@ -160,7 +159,7 @@ def analyze_c_declarations(cpp_objects, c_declarations): · 1 unmodified line | |||
| 160 | func_name = func_name[-1] | 159 | func_name = func_name[-1] |
| 161 | else: | 160 | else: |
| 162 | raise NameError('Warning : error while parsing : unexpected line %s' % fn) | 161 | raise NameError('Warning : error while parsing : unexpected line %s' % fn) |
| 163 | if any(x in func_name for x in valid_funcname_part): | 162 | if func_name.startswith(longname + '_') or func_name.endswith(longname): |
| 164 | # print "found", shortname, "in", fn | 163 | # print "found", shortname, "in", fn |
| 165 | if 'typedef struct ' in fn: | 164 | if 'typedef struct ' in fn: |
| 166 | lib[shortname]['struct'].append(fn) | 165 | lib[shortname]['struct'].append(fn) |