#!/bin/sh

INCLUDE_DIR=/usr/include

hfdir () {
    /bin/ls $1 2> /dev/null | while read n
    do
        if   [ -d "$1/$n" ]
        then
            hfdir $1/$n $2
        elif [ -r "$1/$n" ]
        then
            case $n in
                *.h) if grep ' '$2' ' $1/$n > /dev/null
                     then
                        echo $1/$n
                     fi;;
            esac
        fi
    done
}

if test $# -ne 2
then
    echo "usage: $0 DIR NAME" > /dev/stderr
    exit 1
fi

hfdir $1 $2
exit 0
