Changeset 150ec2d
- Timestamp:
- May 29, 2017, 10:03:15 PM (7 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- 341585b
- Parents:
- 5674833
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/gen_external.py
r5674833 r150ec2d 76 76 return cpp_cmd 77 77 78 def get_cpp_objects(header=header, usedouble=False): 78 79 def get_c_declarations(header=header, usedouble=False): 80 ''' return a dense and preprocessed string of all c declarations implied by aubio.h 81 ''' 79 82 cpp_cmd = get_preprocessor() 80 83 … … 119 122 i += 1 120 123 121 typedefs = filter(lambda y: y.startswith ('typedef struct _aubio'), cpp_output) 122 124 return cpp_output 125 126 def get_cpp_objects_from_c_declarations(c_declarations): 127 typedefs = filter(lambda y: y.startswith ('typedef struct _aubio'), c_declarations) 123 128 cpp_objects = [a.split()[3][:-1] for a in typedefs] 124 125 return cpp_output, cpp_objects 126 127 128 def analyze_cpp_output(cpp_objects, cpp_output): 129 return cpp_objects 130 131 def analyze_c_declarations(cpp_objects, c_declarations): 129 132 lib = {} 130 133 … … 145 148 valid_funcname_part = ['_'+longname,longname+'_'] 146 149 147 for fn in c pp_output:150 for fn in c_declarations: 148 151 func_name = fn.split('(')[0].strip().split(' ')[1:] 149 152 if func_name: … … 170 173 return lib 171 174 172 def print_c pp_output_results(lib, cpp_output):173 for fn in c pp_output:175 def print_c_declarations_results(lib, c_declarations): 176 for fn in c_declarations: 174 177 found = 0 175 178 for o in lib: … … 194 197 elif not overwrite: return sorted(glob.glob(os.path.join(output_path, '*.c'))) 195 198 196 cpp_output, cpp_objects = get_cpp_objects(header, usedouble=usedouble) 197 198 lib = analyze_cpp_output(cpp_objects, cpp_output) 199 # print_cpp_output_results(lib, cpp_output) 199 c_declarations = get_c_declarations(header, usedouble=usedouble) 200 cpp_objects = get_cpp_objects_from_c_declarations(c_declarations) 201 202 lib = analyze_c_declarations(cpp_objects, c_declarations) 203 # print_c_declarations_results(lib, c_declarations) 200 204 201 205 sources_list = []
Note: See TracChangeset
for help on using the changeset viewer.