2 # Usage: MODULES.html.sh > MODULES.html
6 sed_escape_dot='s,\.,\\.,g'
7 sed_escape_slash='s,/,\\/,g'
11 missed_modules=`gnulib-tool --list`
12 missed_files=`ls lib/* m4/* | sed -e /CVS/d -e /README/d -e /ChangeLog/d -e /Makefile/d -e /TODO/d`
15 # outputs line with indentation.
22 # increases the indentation.
29 # decreases the indentation.
32 indent=`echo "$indent" | sed -e 's/ $//'`
35 # func_begin tag [attribute...]
51 # func_wrap tag [attribute...]
52 # encloses $element in a HTML tag, without line breaks.
55 element="<$*>${element}</$1>"
63 func_echo "<TH ALIGN=LEFT>lib/"
64 func_echo "<TH ALIGN=LEFT>lib/"
65 func_echo "<TH ALIGN=LEFT>m4/"
66 func_echo "<TH ALIGN=LEFT> "
69 func_echo "<TH ALIGN=LEFT>Header"
70 func_echo "<TH ALIGN=LEFT>Implementation"
71 func_echo "<TH ALIGN=LEFT>Autoconf macro"
72 func_echo "<TH ALIGN=LEFT>Depends on"
81 element=`gnulib-tool --extract-include-directive $1 | sed -e "$sed_lt" -e "$sed_gt" -e '${/^$/d}' | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
82 test -n "$element" || element='---'
83 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
85 sed_choose_unconditional_nonstandard_include='s,^#include "\(.*\)"$,\1,p'
86 includefile=`gnulib-tool --extract-include-directive $1 | sed -n -e "$sed_choose_unconditional_nonstandard_include" | sed -e "$sed_escape_dot" | tr -d "$trnl"`
87 sed_choose_lib_files='s,^lib/\(.*\)$,\1,p'
88 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>$//'`
89 test -n "$element" || element='---'
90 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
92 sed_choose_m4_files='s,^m4/\(.*\)$,\1,p'
93 element=`(gnulib-tool --extract-filelist $1 | sed -e '${/^$/d}' | sed -n -e "$sed_choose_m4_files" | sed -e '/^onceonly/d'; gnulib-tool --extract-autoconf-snippet $1 | sed -e '${/^$/d}') | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
94 test -n "$element" || element='---'
95 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
97 element=`gnulib-tool --extract-dependencies $1 | sed -e '${/^$/d}' | sed -e 's/$/<BR>/' | tr -d "$trnl" | sed -e 's/<BR>$//'`
98 test -n "$element" || element='---'
99 func_echo "<TD ALIGN=LEFT VALIGN=TOP>$element"
103 missed_modules=`echo "$missed_modules" | sed -e '/^'"$1"'$/d'`
105 files=`gnulib-tool --extract-filelist $1`
106 sed_removal_prefix='s,^,/^,'
107 sed_removal_suffix='s,$,\$/d,'
108 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 '}'`
109 missed_files=`echo "$missed_files" | sed -e "$sed_remove_files"`
119 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">'
124 element="Gnulib Module List"
128 modules=`gnulib-tool --list`
129 modules=`for m in $modules; do printf "%s, " $m; done | sed -e 's/, $//'`
130 func_echo '<META NAME="keywords" CONTENT="'"${modules}"'">'
138 element="Gnulib Module List"
142 func_echo 'This is a list of the modules which make up gnulib, with dependencies.'
144 element="Support for systems lacking ANSI C 89"
167 func_echo 'These modules are not listed among dependencies below, for simplicity.'
169 element="Enhancements for ANSI C 89 functions"
173 element="Memory management functions <stdlib.h>"
174 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
183 element="Date and time <time.h>"
184 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
192 element="Extra functions based on ANSI C 89"
196 element="Memory management functions <stdlib.h>"
197 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
204 func_module bumpalloc
207 element="Integer arithmetic functions <stdlib.h>"
208 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
216 element="Environment variables <stdlib.h>"
217 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
226 element="Character handling <ctype.h>"
227 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
231 element="String handling <string.h>"
232 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
246 element="Numeric conversion functions <stdlib.h>"
247 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
256 element="Date and time <time.h>"
257 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
265 element="Input/Output <stdio.h>"
266 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
271 func_module unlocked-io
274 element="Command-line arguments"
275 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
281 func_module version-etc
282 func_module long-options
285 element="Cryptographic computations"
286 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
296 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
304 func_module linebuffer
308 func_module readtokens
309 func_module strverscmp
312 element="Support for systems lacking ISO C 99"
316 element="Boolean type and values <stdbool.h>"
317 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
325 element="Numeric conversion functions <stdlib.h>"
326 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
335 element="Functions for greatest-width integer types <inttypes.h>"
336 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
341 func_module strtoimax
342 func_module strtoumax
345 element="Enhancements for ISO C 99 functions"
352 element="Extra functions based on ISO C 99"
356 element="Numeric conversion functions <stdlib.h>"
357 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
362 func_module xstrtoimax
363 func_module xstrtoumax
366 element="Support for systems lacking POSIX:2001"
373 func_module ftruncate
374 func_module getgroups
375 func_module gettimeofday
381 func_module nanosleep
388 element="Enhancements for POSIX:2001 functions"
395 func_module unistd-safer
397 func_module fnmatch-posix
398 func_module fnmatch-gnu
402 element="Extra functions based on POSIX:2001"
406 element="Numeric conversion functions"
407 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
415 element="File system functions"
416 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
422 func_module backupfile
425 func_module euidaccess
426 func_module file-type
427 func_module fileblocks
432 func_module modechange
433 func_module mountlist
434 func_module path-concat
440 func_module xreadlink
443 element="File descriptor based Input/Output"
444 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
449 func_module safe-read
450 func_module safe-write
451 func_module full-read
452 func_module full-write
455 element="File stream based Input/Output"
456 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
463 func_module stdio-safer
467 element="Users and groups"
468 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
473 func_module getugroups
474 func_module group-member
479 element="Date and time"
480 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
490 element="Networking functions"
491 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
496 func_module gethostname
497 func_module xgethostname
498 func_module canon-host
501 element="Internationalization functions"
502 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
509 func_module localcharset
510 func_module hard-locale
512 func_module memcasecmp
515 func_module unicodeio
520 element="Executing programs"
521 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
526 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
531 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
540 func_module getloadavg
541 func_module getpagesize
542 func_module getusershell
551 if test -n "$missed_modules"; then
553 element="Unclassified modules - please update MODULES.html.sh"
554 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
559 for module in $missed_modules; do
566 if test -n "$missed_files"; then
568 element="Lone files - please create new modules containing them"
569 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
579 element="Future developments"
580 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
584 func_echo 'Ideally a module could consist of:'
586 func_echo '<LI>A header file: lib/<VAR>module</VAR>.h'
587 func_echo '<LI>One or more implementation files: lib/<VAR>module</VAR>.c et al.'
588 func_echo '<LI>One or more autoconf macro files: m4/<VAR>module</VAR>.m4 et al.'
589 func_echo '<LI>A configure.ac fragment, Makefile.am fragment, dependency list: modules/<VAR>module</VAR>'
590 func_echo '<LI>Some documentation'
591 func_echo '<LI>A POT file and some PO files'
592 func_echo '<LI>A testsuite'
596 func_echo 'Generated from <CODE>MODULES.html.sh</CODE> on '`LC_ALL=C date +"%e %B %Y"`.