documented.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/sh
  2. bindir=$1
  3. VERSION=1.0
  4. egrep -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
  5. sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
  6. sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
  7. sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
  8. sed -e '/^pthread_cleanup/d' -e '/^IFTODT$/d' -e '/^DTTOIF$/d' |
  9. sed -e '/^__fwriting$/d' -e '/^__fwritable$/d' -e '/^__fsetlocking$/d' |
  10. sed -e '/^__freading$/d' -e '/^__freadable$/d' -e '/^__fpurge$/d' |
  11. sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
  12. sed -e '/^alloca$/d' |
  13. sort -u > DOCUMENTED
  14. nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
  15. egrep " [TW] ([[:alpha:]]|_[[:alpha:]])" |
  16. sed 's/\(@.*\)//' |
  17. cut -b 12- |
  18. sed -e '/^_IO/d' -e '/^_dl/d' -e '/^_pthread/d' -e '/^_obstack/d' |
  19. sed -e '/^_argp/d' -e '/^_authenticate$/d' -e '/^_environ$/d' |
  20. sed -e '/^_errno$/d' -e '/^_h_errno$/d' -e '/^_longjmp$/d' |
  21. sed -e '/^_mcleanup$/d' -e '/^_rpc_dtablesize$/d' -e '/^_seterr_reply$/d' |
  22. sed -e '/^_nss/d' -e '/^_setjmp$/d' |
  23. sort -u > AVAILABLE
  24. cat <<EOF
  25. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  26. <html>
  27. <head>
  28. <title>Undocumented glibc functions</title>
  29. </head>
  30. <body>
  31. <center><h1>Undocumented <tt>glibc</tt> functions</h1></center>
  32. <p>The following table includes names of the function in glibc
  33. which are not yet documented in the manual. This list is
  34. automatically created and therefore might contain errors. Please
  35. check the latest manual (available from the CVS archive) before
  36. starting to work. It might also be good to let me know in
  37. advanace on which functions you intend to work to avoid
  38. duplication.</p>
  39. <p>A few comments:</p>
  40. <ul>
  41. <li>Some functions in the list are much less important than
  42. others. Please prioritize.</li>
  43. <li>Similarly for the LFS functions (those ending in 64).</li>
  44. </ul>
  45. <p>The function sombody already volunteered to document are marked
  46. with a reference to the person.</p>
  47. <center><table>
  48. EOF
  49. n=0
  50. diff -y --width=60 --suppress-common-lines DOCUMENTED AVAILABLE |
  51. expand | cut -b 33- | sed '/^[[:space:]]*$/d' |
  52. while read name; do
  53. line="$line
  54. <td><tt>$name</tt></td>"
  55. n=$(expr $n + 1)
  56. if [ $n -eq 4 ]; then
  57. echo "<tr>
  58. $line
  59. </tr>"
  60. line=""
  61. n=0
  62. fi
  63. done
  64. if [ $n -gt 0 ]; then
  65. if [ $n -eq 1 ]; then
  66. line="$line
  67. <td></td>"
  68. fi
  69. if [ $n -eq 2 ]; then
  70. line="$line
  71. <td></td>"
  72. fi
  73. if [ $n -eq 3 ]; then
  74. line="$line
  75. <td></td>"
  76. fi
  77. echo "<tr>
  78. $line
  79. </tr>"
  80. fi
  81. cat <<EOF
  82. </table></center>
  83. <hr>
  84. <address><a href="mailto:drepper@redhat.com">Ulrich Drepper</a></address>
  85. Generated on $(date) with documented.sh version $VERSION
  86. </body>
  87. </html>
  88. EOF