[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guile-scripts/scan-api available
From: |
Thien-Thi Nguyen |
Subject: |
Re: guile-scripts/scan-api available |
Date: |
Fri, 15 Feb 2002 16:06:10 -0800 |
From: Neil Jerram <address@hidden>
Date: 15 Feb 2002 23:06:51 +0000
How does it find Scheme-defined procedures in a library?
see below for full text of scan-api.
thi
____________________________________________
#!/bin/sh
# Usage: scan-api guile sofile
# The output is an alist: ((scheme ...) (C ...))
guile=$1
sofile=$2
scheme ()
{
$guile -c '(use-modules (ice-9 session)) (apropos ".")' \
| grep ^.guile \
| sed 's/^.*: //g' \
| sort \
| awk '{print "(" $1 " " "\"" $2 "\"" ")"}'
}
C ()
{
# lowercase => locals
# A => absolute
# U => undefined
nm $sofile \
| grep ' [A-Z] ' \
| grep -v ' [AU] ' \
| sed 's/^........ //g' \
| awk '{print "(" $2 " " $1 ")"}' \
| sort
}
echo ';; Generated' `date` 'by guile-scripts/scan-api -- do not edit!'
echo ';; guile:' $guile
echo ';; sofile:' $sofile
echo
echo '('
echo '(scheme' ; scheme ; echo ') ;; end of scheme'
echo '(C ' ; C ; echo ') ;; end of C'
echo ')'
# scan-api ends here