#!/bin/sh
if [ -z "$1" ]; then
  echo "Usage: rzapi-list [modname]  # modname can be 'rz_asm', 'rz_bin' ..."
  exit 1
fi

MOD=$1
cat librz/include/${MOD}.h | \
  grep ^RZ_API | \
  sed -e 's,const ,,g' | \
  sed -e 's,struct ,,g' | \
  sed -e 's,\*,,g' | \
  cut -d '(' -f 1 | \
  awk '{ print $3 }' | \
  sed -e "s,^${MOD}_,,"
