Changeset 0b2643b


Ignore:
Timestamp:
May 30, 2017, 1:12:40 AM (3 years ago)
Author:
Martin Hermant <martin.hermant@gmail.com>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
2f5f1e4
Parents:
e717fae
Message:

gen_external.py :

fix wrong longname in generate_lib_from_c_declarations
simplify parsing

wscript.py : add _t suffix for added objects

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_external.py

    re717fae r0b2643b  
    175175
    176176    for o in cpp_objects:
    177         shortname = ''
     177        shortname = o
    178178        if o[:6] == 'aubio_':
    179             shortname = o[6:-2]  # without aubio_
    180             longname = o[:-2]  # without _t
    181         else:  # support object not starting with aubio_ (fvec...)
    182             shortname = o
    183             longname = shortname
     179            shortname = o[6:-2]  # without aubio_ prefix and _t suffix
    184180
    185181        if shortname in skip_objects:
    186182            continue
     183
    187184        lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}
    188         lib[shortname]['longname'] = longname
     185        lib[shortname]['longname'] = o
    189186        lib[shortname]['shortname'] = shortname
    190187
     188        fullshortname = o[:-2]  # name without _t suffix
     189
    191190        for fn in c_declarations:
    192             func_name = fn.split('(')[0].strip().split(' ')[1:]
    193             if func_name:
    194                 func_name = func_name[-1]
    195             else:
    196                 raise NameError('Warning : error while parsing : unexpected line %s' % fn)
    197             if func_name.startswith(longname + '_') or func_name.endswith(longname):
     191            func_name = fn.split('(')[0].strip().split(' ')[-1]
     192            if func_name.startswith(fullshortname + '_') or func_name.endswith(fullshortname):
    198193                # print "found", shortname, "in", fn
    199194                if 'typedef struct ' in fn:
  • wscript

    re717fae r0b2643b  
    243243        c_decls = get_c_declarations(usedouble=False) #emscripten can't use double
    244244        objects = get_cpp_objects_from_c_declarations(c_decls)
    245         objects+=['fvec']
     245        objects+=['fvec_t']
    246246        lib =  generate_lib_from_c_declarations(objects,c_decls)
    247247        exported_funcnames = get_all_func_names_from_lib(lib)
Note: See TracChangeset for help on using the changeset viewer.