#!/bin/sh

HEADER=$1
awk '
# skip non-function defs
/^#/ { next; }
/^ / { next; }
/^$/ { next; }
/^\// { next; }
/^extern/ { next; }
/^typedef/ { next; }
/^enum/ { next; }

# print every function name
{
        sub("\\*", "");
        sub("\\(.*", "");

        # delete prefix _ for e.g. _acos in r.c
        sub("^_", "", $2);
        print $2
}
' $HEADER.h |
xargs -n 1 -J _ misc/audit_use_using ${HEADER} _
