#! /bin/sh
##
## Extract all builtins and interpreted functions

BASE="$1" #- could even have several ones, but must not use this 'if' then:
#> if [ ! -f $BASE ]
#> then
#> 	echo "error: $BASE library does not exist"
#> 	exit 1
#> fi
Names="$2"

(
## functions defined in  R  itself:--------------  '<-' or '-' assignment ---
##-- need perl 'anyway' ...
R-funs -nN $BASE/*

# 'internal' / primitive functions defined in C :
grep 'PP_' $Names | sed '
/	1[0-9],	/d
/,1[0-9],	/d
/\?/d
s/",.*//
s/"//
s/{ *//
/.*<-$/d
'
) | sed 's/^[ 	]*//' | sort -d -f | uniq