def find_prototypes(code):
 prots = []
 lines = code.split('\n')
 for line in lines:
  m = re.match(('\\s*' + re_func_prot), line)
  if (m is not None):
   (rtype, name, args) = m.groups()[:3]
   if ((args == 'void') or (args.strip() == '')):
    args = []
   else:
    args = [tuple(arg.strip().split(' ')) for arg in args.split(',')]
   prots.append((name, args, rtype))
 return prots

def find_prototypes ( code ) : prots = [ ] lines = code . split ( '\n' ) for line in lines : m = re . match ( ( '\\s*' + re_func_prot ) , line ) if ( m is not None ) : ( rtype , name , args ) = m . groups ( ) [ : 3 ] if ( ( args == 'void' ) or ( args . strip ( ) == '' ) ) : args = [ ] else : args = [ tuple ( arg . strip ( ) . split ( ' ' ) ) for arg in args . split ( ',' ) ] prots . append ( ( name , args , rtype ) ) return prots
return a list of signatures for each function prototype declared in *code* .