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"`
327 func_module linebuffer
331 func_module readtokens
332 func_module strverscmp
335 element="Support for systems lacking ISO C 99"
339 element="Boolean type and values <stdbool.h>"
340 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
348 element="Numeric conversion functions <stdlib.h>"
349 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
358 element="Functions for greatest-width integer types <inttypes.h>"
359 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
364 func_module strtoimax
365 func_module strtoumax
368 element="Enhancements for ISO C 99 functions"
375 element="Extra functions based on ISO C 99"
379 element="Numeric conversion functions <stdlib.h>"
380 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
385 func_module xstrtoimax
386 func_module xstrtoumax
389 element="Support for systems lacking POSIX:2001"
396 func_module ftruncate
397 func_module getgroups
398 func_module gettimeofday
404 func_module nanosleep
411 element="Enhancements for POSIX:2001 functions"
418 func_module unistd-safer
420 func_module fnmatch-posix
421 func_module fnmatch-gnu
425 element="Extra functions based on POSIX:2001"
429 element="Numeric conversion functions"
430 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
438 element="File system functions"
439 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
445 func_module backupfile
448 func_module euidaccess
449 func_module file-type
450 func_module fileblocks
455 func_module modechange
456 func_module mountlist
457 func_module path-concat
463 func_module xreadlink
466 element="File descriptor based Input/Output"
467 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
472 func_module safe-read
473 func_module safe-write
474 func_module full-read
475 func_module full-write
478 element="File stream based Input/Output"
479 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
486 func_module stdio-safer
490 element="Users and groups"
491 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
496 func_module getugroups
497 func_module group-member
502 element="Date and time"
503 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
513 element="Networking functions"
514 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
519 func_module gethostname
520 func_module xgethostname
521 func_module canon-host
524 element="Internationalization functions"
525 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
532 func_module localcharset
533 func_module hard-locale
535 func_module memcasecmp
538 func_module unicodeio
543 element="Executing programs"
544 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
549 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
554 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
563 func_module getloadavg
564 func_module getpagesize
565 func_module getusershell
574 if test -n "$missed_modules"; then
576 element="Unclassified modules - please update MODULES.html.sh"
577 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
582 for module in $missed_modules; do
589 if test -n "$missed_files"; then
591 element="Lone files - please create new modules containing them"
592 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
602 element="Future developments"
603 element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
607 func_echo 'Ideally a module could consist of:'
609 func_echo '<LI>A header file: lib/<VAR>module</VAR>.h'
610 func_echo '<LI>One or more implementation files: lib/<VAR>module</VAR>.c et al.'
611 func_echo '<LI>One or more autoconf macro files: m4/<VAR>module</VAR>.m4 et al.'
612 func_echo '<LI>A configure.ac fragment, Makefile.am fragment, dependency list: modules/<VAR>module</VAR>'
613 func_echo '<LI>Some documentation'
614 func_echo '<LI>A POT file and some PO files'
615 func_echo '<LI>A testsuite'
619 func_echo 'Generated from <CODE>MODULES.html.sh</CODE> on '`LC_ALL=C date +"%e %B %Y"`.