From a564f1afee1e1f5f74a5852882e8c582cf0ae97d Mon Sep 17 00:00:00 2001
From: Girish Joshi
Date: Sun, 31 Mar 2024 00:17:34 +0530
Subject: [PATCH] manual: scripts/documented.sh updated
References for linuxthreads are removed from scripts/documented.sh.
Fixed the steps to retrive undocumented functions
Also removed the individual email address from the html output.
Signed-off-by: Girish Joshi
---
scripts/documented.sh | 41 ++++++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 13 deletions(-)
mode change 100644 => 100755 scripts/documented.sh
diff --git a/scripts/documented.sh b/scripts/documented.sh
old mode 100644
new mode 100755
index 24bb7b3e54..372a28ebf0
--- a/scripts/documented.sh
+++ b/scripts/documented.sh
@@ -1,9 +1,15 @@
#!/bin/sh
bindir=$1
-VERSION=1.0
+# usage: scripts/documented.sh
+# for example:
+# scripts/documented.sh $HOME/build/glibc
-grep -E -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
+VERSION=1.1
+
+# Collect the documented functions from manual/*.texi files.
+
+grep -E -h @deftypefu?nx? manual/*.texi |
sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
@@ -12,12 +18,14 @@ sed -e '/^__fwriting$/d' -e '/^__fwritable$/d' -e '/^__fsetlocking$/d' |
sed -e '/^__freading$/d' -e '/^__freadable$/d' -e '/^__fpurge$/d' |
sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
sed -e '/^alloca$/d' |
+sed -r '/^\s*$/d' |
sort -u > DOCUMENTED
-nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/login/libutil.so |
+# extract the exported symbols from the libraries.
+nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/nptl/libpthread.so $bindir/dlfcn/libdl.so $bindir/login/libutil.so |
grep -E " [TW] ([[:alpha:]]|_[[:alpha:]])" |
sed 's/\(@.*\)//' |
-cut -b 12- |
+cut -b 20- |
sed -e '/^_IO/d' -e '/^_dl/d' -e '/^_pthread/d' -e '/^_obstack/d' |
sed -e '/^_argp/d' -e '/^_authenticate$/d' -e '/^_environ$/d' |
sed -e '/^_errno$/d' -e '/^_h_errno$/d' -e '/^_longjmp$/d' |
@@ -39,9 +47,7 @@ cat <
+ starting to work.
A few comments:
@@ -52,15 +58,22 @@ cat <Similarly for the LFS functions (those ending in 64).
- The function sombody already volunteered to document are marked
- with a reference to the person.
EOF
n=0
-diff -y --width=60 --suppress-common-lines DOCUMENTED AVAILABLE |
-expand | cut -b 33- | sed '/^[[:space:]]*$/d' |
+# get the list of undocumented functions
+grep -Fvx -f DOCUMENTED AVAILABLE> UNDOCUMENTED_WITHOUT_OFFSET
+
+# get undocumented functions with offset info
+for func in `cat UNDOCUMENTED_WITHOUT_OFFSET`
+do
+ grep "$func$" AVAILABLE >> UNDOCUMENTED
+done
+
+diff -y --width=120 --suppress-common-lines DOCUMENTED UNDOCUMENTED |
+expand | cut -b 61- | sed '/^[[:space:]]*$/d' |
while read name; do
line="$line
$name | "
@@ -95,8 +108,10 @@ cat <
- Ulrich Drepper
-Generated on $(date) with documented.sh version $VERSION
+ Generated on $(date) with documented.sh version $VERSION