def METHOD_NAME(funcs):
    # parse each line and populate the api dict
    api = {}
    for func in funcs:
        func = func.replace("*", "* ").replace(';', '')
        print(func)
        # split at the (
        leftside, rightside = func.split('(', 1)
        # handle the left side
        parts = [x for x in leftside.split(' ') if len(x)]
        funcname = parts.pop()
        rettype = ' '.join(parts)
        # handle the args (rightside)
        rightside = rightside.replace(')','')
        args = rightside.split(',')
        argchunks = [arg.split(' ') for arg in args]
        argout = []
        if argchunks != [['void']]:     # skip "(void)" entries
            for chunk in argchunks:
                chunk = [foo.strip() for foo in chunk if len(foo.strip())]
                if len(chunk):
                    if chunk[-1].endswith(')') or len(chunk) == 1:
                        aname = None
                    else:
                        aname = chunk.pop()
                    # handle variadic args (...):
                    if len(chunk) and chunk[-1] in ('...', b'\xe2\x80\xa6'.decode('utf8')):
                        atype = 'variadic'
                        aname = ''
                    else:
                        atype = ' '.join(chunk)
                    argout.append((atype, aname))
                else:
                    input("FIXME: lost args at the end")
        if 'printf' in func:
            #import envi.interactive as ei; ei.dbg_interact(locals(), globals())
            pass
        cconv = cconvs.get(funcname, 'cdecl')
        api['plt_%s' % funcname] = (rettype, None, cconv, '*.%s' % funcname, tuple(argout))
    return api