#! /bin/bash 
# Last edited on 2015-04-20 00:20:40 by stolfilocal

# Creates skeleton ".h" and ".c" files for a buch of functions.
# The files are created in a directory "fns" 

funcs=( "$@" )

fndir="fns"
mkdir -p ${fndir}

for f in "${funcs[@]}" ; do 
  hfile="${fndir}/${f}.h"
  cfile="${fndir}/${f}.c"
  
  cat <<EOF > ${hfile}
#ifndef ${f}_H
#define ${f}_H

/* . */
/* Last edited on DATE TIME by USER */


#endif
EOF

  cat <<EOF > ${cfile}
/* See {${f}.h} */
/* Last edited on DATE TIME by USER */

#define _GNU_SOURCE

#include <${f}.h>

EOF

done
