#!/bin/sh
# for lib4th/test4th, 6/2000 by h-peter recktenwald <phpr@snafu.de>

# collect marked ":ok:" labels in lib4th.asm to <tests-ok>
# and list system calls from lib4thasm to <syscalls-in-f8>

cd ..

# system calls
echo -e "\n \"lib4thasm\" v$(. ./relse.sh), system calls\n"> doc/syscalls-in-f8
# checked words
echo -e "\n \"lib4thasm\" v$(. ./relse.sh), tested words\n"	>doc/tests-ok

find ./src \( -name \*\.asm -o -name \*\.inc \) -print|while read i
do
    k=
    grep -n "[ACMK]\;\:ok\:\|[ACMK]\; [CM]\:ok\:" ${i}|grep -v "\:A\;"|cut -d: -f1-2|while read f
    do [ -n "${k}" ]||{ k=${i};echo -e "\nFile $(basename ${i})"; };echo "	${f}";done >> ./doc/tests-ok
    k=
    grep -n "\<sys_" ${i}|grep -v ";[;\:-]"|cut -d\; -f1|cut -d\% -f1|grep "[^/]\<sys_"|sort -bdfi -k2,2|while read f
    do [ -n "${k}" ]||{ k=${f};echo -e "\nFile $(basename ${i})"; };echo "	${f}";done>>doc/syscalls-in-f8
done
