#! /bin/sh

GMP_OBJ=/var/tmp/gmp-obj/shell-64
GMP_SRC=$HOME/prec/gmp-snap

DOC_FILE=$GMP_SRC/gmp-h.in
DOC_FILE=$GMP_SRC/doc/gmp.texi

strings $GMP_OBJ/.libs/libgmp.a | sort | uniq | grep '^__gmp[a-zA-Z0-9_]*$' >gmp-func-list

for i in `cat gmp-func-list`
  do
    x=`echo $i | sed 's;__g;;'`
    printf "%-40s" $i
    if grep -q "$x " $GMP_SRC/doc/gmp.texi
      then printf "doc "
      else printf "    "
      fi
    if grep -q "$x " $GMP_SRC/gmp-h.in
      then printf "decl"
      else printf "    "
      fi
    printf "\n"
  done >gmp-func-list2

mv gmp-func-list2 gmp-func-list
