code: def generate_lib_from_c_declarations(cpp_objects, c_declarations):
      """returns a lib from given cpp_object names
  
      a lib is a dict grouping functions by family (onset,pitch...)
          each eement is itself a dict of functions grouped by puposes as :
          struct, new, del, do, get, set and other
      """
      lib = {}
  
      for o in cpp_objects:
          shortname = o
          if o[:6] == "aubio_":
              shortname = o[6:-2]  # without aubio_ prefix and _t suffix
  
          lib[shortname] = {
              "struct": [],
              "new": [],
              "del": [],
              "do": [],
              "rdo": [],
              "get": [],
              "set": [],
              "other": [],
          }
          lib[shortname]["longname"] = o
          lib[shortname]["shortname"] = shortname
  
          fullshortname = o[:-2]  # name without _t suffix
  
          for fn in c_declarations:
              func_name = fn.split("(")[0].strip().split(" ")[-1]
              if func_name.startswith(
                  fullshortname + "_"
              ) or func_name.endswith(fullshortname):
                  # print "found", shortname, "in", fn
                  if "typedef struct " in fn:
                      lib[shortname]["struct"].append(fn)
                  elif "_do" in fn:
                      lib[shortname]["do"].append(fn)
                  elif "_rdo" in fn:
                      lib[shortname]["rdo"].append(fn)
                  elif "new_" in fn:
                      lib[shortname]["new"].append(fn)
                  elif "del_" in fn:
                      lib[shortname]["del"].append(fn)
                  elif "_get_" in fn:
                      lib[shortname]["get"].append(fn)
                  elif "_set_" in fn:
                      lib[shortname]["set"].append(fn)
                  else:
                      # print "no idea what to do about", fn
                      lib[shortname]["other"].append(fn)
      return lib
  
file_path: aubio/python/lib/gen_external.py
imports: import distutils.ccompiler
  import sys
  import os
  import subprocess
  import glob
  from distutils.sysconfig import customize_compiler
  from gen_code import MappedObject
label_desc: Use image node_id 7 for calling a global function with example usage: generate_lib_from_c_declarations(cpp_objects, c_declarations) and returns: lib