def build_ffi_for_binding(module_name, module_prefix, modules, libraries=[], extra_compile_args=[], extra_link_args=[]):
 types = []
 includes = []
 functions = []
 macros = []
 customizations = []
 for name in modules:
  __import__((module_prefix + name))
  module = sys.modules[(module_prefix + name)]
  types.append(module.TYPES)
  macros.append(module.MACROS)
  functions.append(module.FUNCTIONS)
  includes.append(module.INCLUDES)
  customizations.append(module.CUSTOMIZATIONS)
 verify_source = '\n'.join(((includes + functions) + customizations))
 ffi = build_ffi(module_name, cdef_source='\n'.join(((types + functions) + macros)), verify_source=verify_source, libraries=libraries, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args)
 return ffi

def build_ffi_for_binding ( module_name , module_prefix , modules , libraries = [ ] , extra_compile_args = [ ] , extra_link_args = [ ] ) : types = [ ] includes = [ ] functions = [ ] macros = [ ] customizations = [ ] for name in modules : __import__ ( ( module_prefix + name ) ) module = sys . modules [ ( module_prefix + name ) ] types . append ( module . TYPES ) macros . append ( module . MACROS ) functions . append ( module . FUNCTIONS ) includes . append ( module . INCLUDES ) customizations . append ( module . CUSTOMIZATIONS ) verify_source = '\n' . join ( ( ( includes + functions ) + customizations ) ) ffi = build_ffi ( module_name , cdef_source = '\n' . join ( ( ( types + functions ) + macros ) ) , verify_source = verify_source , libraries = libraries , extra_compile_args = extra_compile_args , extra_link_args = extra_link_args ) return ffi
modules listed in modules should have the following attributes: * includes: a string containing c includes .