From 7f561e857137cc9a9d7746a394498544b5c93f2c Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 23 Aug 2020 09:07:16 -0400 Subject: [PATCH] tools/function-table.sh #905 --- tools/function-table.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 tools/function-table.sh diff --git a/tools/function-table.sh b/tools/function-table.sh new file mode 100755 index 000000000..2b3522bcb --- /dev/null +++ b/tools/function-table.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Extract a list of the public API, both shared object functions and those +# static inline functions in the public headers. + +usage () { echo "usage: `basename $0` notcurses-dir" ; } + +[ $# -eq 1 ] || { usage >&2 ; exit 1 ; } +NCDIR="$1" +[ -d "$NCDIR" ] || { usage >&2 ; exit 1 ; } + +generate_lists () { + grep -h ^API "$1"/include/notcurses/*.h + grep -h -A1 ^static\ inline "$1"/include/notcurses/*.h | \ + sed -e '/^--$/d' -e 'N;s/\n/ /' -e 's/\(.*\){$/\1;/' +} + +generate_lists "$NCDIR" | sed -e 's/RESTRICT/restrict/g' | sort