3 # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # Usage: MODULES.html.sh > MODULES.html
22 PATH=`dirname $0`:$PATH; export PATH
26 sed_escape_dot='s,\.,\\.,g'
27 sed_escape_slash='s,/,\\/,g'
31 missed_modules=`gnulib-tool --list`
32 missed_files=`ls -d lib/* m4/* | sed -e /CVS/d -e /README/d -e /ChangeLog/d -e /Makefile/d -e /TODO/d -e '/~$/d'`
35 # outputs line with indentation.
42 # increases the indentation.
49 # decreases the indentation.
52 indent=`echo "$indent" | sed -e 's/ $//'`
55 # func_begin tag [attribute...]
71 # func_wrap tag [attribute...]
72 # encloses $element in a HTML tag, without line breaks.
75 element="<$*>${element}</$1>"
83 func_echo "<TH ALIGN=LEFT>lib/"
84 func_echo "<TH ALIGN=LEFT>lib/"
85 func_echo "<TH ALIGN=LEFT>m4/"
86 func_echo "<TH ALIGN=LEFT> "
89 func_echo "<TH ALIGN=LEFT>Header"
90 func_echo "<TH ALIGN=LEFT>Implementation"
91 func_echo "<TH ALIGN=LEFT>Autoconf macro"
92 func_echo "<TH ALIGN=LEFT>Depends on"
101 sed_remove_trailing_empty_line='${
105 element=`gnulib-tool --extract-include-directive $1 | sed -e "$sed_lt" -e "$sed_gt" -e "$sed_remove_trailing_empty_line" | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
106 test -n "$element" || element='---'
107 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
109 sed_choose_unconditional_nonstandard_include='s,^#include "\(.*\)"$,\1,p'
110 includefile=`gnulib-tool --extract-include-directive $1 | sed -n -e "$sed_choose_unconditional_nonstandard_include" | sed -e "$sed_escape_dot" | tr -d "$trnl"`
111 sed_choose_lib_files='s,^lib/\(.*\)$,\1,p'
112 element=`gnulib-tool --extract-filelist $1 | sed -e '/^$/d' | sed -n -e "$sed_choose_lib_files" | sed -e '/^'"${includefile}"'$/d' | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
113 test -n "$element" || element='---'
114 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
116 sed_choose_m4_files='s,^m4/\(.*\)$,\1,p'
117 element=`(gnulib-tool --extract-filelist $1 | sed -e "$sed_remove_trailing_empty_line" | sed -n -e "$sed_choose_m4_files" | sed -e '/^onceonly/d'; gnulib-tool --extract-autoconf-snippet $1 | sed -e "$sed_remove_trailing_empty_line") | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
118 test -n "$element" || element='---'
119 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
121 element=`gnulib-tool --extract-dependencies $1 | sed -e "$sed_remove_trailing_empty_line" | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
122 test -n "$element" || element='---'
123 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
127 missed_modules=`echo "$missed_modules" | sed -e '/^'"$1"'$/d'`
129 files=`gnulib-tool --extract-filelist $1`
130 sed_removal_prefix='s,^,/^,'
131 sed_removal_suffix='s,$,\$/d,'
132 sed_remove_files=`echo '{'; for file in $files; do echo $file | sed -e "$sed_escape_dot" -e "$sed_escape_slash" | sed -e "$sed_removal_prefix" -e "$sed_removal_suffix"; done; echo '}'`
133 missed_files=`echo "$missed_files" | sed -e "$sed_remove_files"`
143 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">'
148 element="Gnulib Module List"
152 modules=`gnulib-tool --list`
153 modules=`for m in $modules; do printf "%s, " $m; done | sed -e 's/, $//'`
154 func_echo '<META NAME="keywords" CONTENT="'"${modules}"'">'
162 element="Gnulib Module List"
166 func_echo 'This is a list of the modules which make up gnulib, with dependencies.'
168 element="Support for systems lacking ANSI C 89"
191 func_echo 'These modules are not listed among dependencies below, for simplicity.'
193 element="Enhancements for ANSI C 89 functions"
197 element="Memory management functions <stdlib.h>"
198 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
207 element="Date and time <time.h>"
208 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
216 element="Extra functions based on ANSI C 89"
220 element="Memory management functions <stdlib.h>"
221 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
228 func_module bumpalloc
231 element="Integer arithmetic functions <stdlib.h>"
232 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
240 element="Environment variables <stdlib.h>"
241 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
250 element="Character handling <ctype.h>"
251 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
255 element="String handling <string.h>"
256 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
270 element="Numeric conversion functions <stdlib.h>"
271 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
280 element="Date and time <time.h>"
281 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
289 element="Input/Output <stdio.h>"
290 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
295 func_module unlocked-io
298 element="Command-line arguments"
299 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
305 func_module version-etc
306 func_module long-options
309 element="Cryptographic computations"
310 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
320 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
328 func_module linebuffer
332 func_module readtokens
333 func_module strverscmp
336 element="Support for systems lacking ISO C 99"
340 element="Boolean type and values <stdbool.h>"
341 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
349 element="Numeric conversion functions <stdlib.h>"
350 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
359 element="Functions for greatest-width integer types <inttypes.h>"
360 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
365 func_module strtoimax
366 func_module strtoumax
369 element="Enhancements for ISO C 99 functions"
376 element="Extra functions based on ISO C 99"
380 element="Numeric conversion functions <stdlib.h>"
381 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
386 func_module xstrtoimax
387 func_module xstrtoumax
390 element="Support for systems lacking POSIX:2001"
397 func_module ftruncate
398 func_module getgroups
399 func_module gettimeofday
405 func_module nanosleep
412 element="Enhancements for POSIX:2001 functions"
419 func_module unistd-safer
421 func_module fnmatch-posix
422 func_module fnmatch-gnu
426 element="Extra functions based on POSIX:2001"
430 element="Numeric conversion functions"
431 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
439 element="File system functions"
440 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
446 func_module backupfile
449 func_module euidaccess
450 func_module file-type
451 func_module fileblocks
456 func_module modechange
457 func_module mountlist
458 func_module path-concat
464 func_module xreadlink
467 element="File descriptor based Input/Output"
468 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
473 func_module safe-read
474 func_module safe-write
475 func_module full-read
476 func_module full-write
479 element="File stream based Input/Output"
480 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
487 func_module stdio-safer
491 element="Users and groups"
492 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
497 func_module getugroups
498 func_module group-member
503 element="Date and time"
504 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
514 element="Networking functions"
515 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
520 func_module gethostname
521 func_module xgethostname
522 func_module canon-host
525 element="Internationalization functions"
526 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
533 func_module localcharset
534 func_module hard-locale
536 func_module memcasecmp
539 func_module unicodeio
544 element="Executing programs"
545 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
550 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
555 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
564 func_module getloadavg
565 func_module getpagesize
566 func_module getusershell
575 if test -n "$missed_modules"; then
577 element="Unclassified modules - please update MODULES.html.sh"
578 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
583 for module in $missed_modules; do
590 if test -n "$missed_files"; then
592 element="Lone files - please create new modules containing them"
593 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
603 element="Future developments"
604 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
608 func_echo 'Ideally a module could consist of:'
610 func_echo '<LI>A header file: lib/<VAR>module</VAR>.h'
611 func_echo '<LI>One or more implementation files: lib/<VAR>module</VAR>.c et al.'
612 func_echo '<LI>One or more autoconf macro files: m4/<VAR>module</VAR>.m4 et al.'
613 func_echo '<LI>A configure.ac fragment, Makefile.am fragment, dependency list: modules/<VAR>module</VAR>'
614 func_echo '<LI>Some documentation'
615 func_echo '<LI>A POT file and some PO files'
616 func_echo '<LI>A testsuite'
620 func_echo 'Generated from <CODE>MODULES.html.sh</CODE> on '`LC_ALL=C date +"%e %B %Y"`.