#! /bin/bash 
# Last edited on 2013-10-01 12:39:41 by stolfilocal

# Reads a list of ".c" and ".h" files, outputs a list of all function names
# one per line. Assumes that function headers start on column 1.


egrep -h -e '^[a-zA-Z]' "$@" \
  | egrep -v -e '^typedef' \
  | sed \
     -e 's:[(].*$::g' \
     -e 's:[ ]*$::g' \
     -e 's:^.*[ *]\([A-Za-z0-9_][A-Za-z0-9_]*\)$:\1:g' \
  | sort | uniq
  
  