diff options
author | 2006-07-17 16:12:35 +0000 | |
---|---|---|
committer | 2006-07-17 16:12:35 +0000 | |
commit | 1076333c323c9f213f0d653fc52002328f47dbe9 (patch) | |
tree | 199043ea450e9dda74533f51d465dec04d041204 | |
parent | import texinfo 4.8 into the tree. (diff) | |
download | wireguard-openbsd-1076333c323c9f213f0d653fc52002328f47dbe9.tar.xz wireguard-openbsd-1076333c323c9f213f0d653fc52002328f47dbe9.zip |
conflict resolution
69 files changed, 25495 insertions, 14390 deletions
diff --git a/gnu/usr.bin/texinfo/Makefile.am b/gnu/usr.bin/texinfo/Makefile.am index c98b9256ebe..5ba6d9692eb 100644 --- a/gnu/usr.bin/texinfo/Makefile.am +++ b/gnu/usr.bin/texinfo/Makefile.am @@ -1,5 +1,5 @@ # Makefile.am for texinfo. -# $Id: Makefile.am,v 1.4 2002/06/10 13:51:01 espie Exp $ +# $Id: Makefile.am,v 1.5 2006/07/17 16:12:35 espie Exp $ # Process this file with automake to produce Makefile.in in all directories. # # This file is free software; as a special exception the author gives @@ -11,24 +11,45 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # Be sure we're using the right version of Automake. -AUTOMAKE_OPTIONS = 1.4 readme-alpha +AUTOMAKE_OPTIONS = 1.8 readme-alpha # Additional files to distribute. -EXTRA_DIST = COPYING.DOC INTRODUCTION config.rpath dir-example djgpp +EXTRA_DIST = ChangeLog.46 INSTALL.generic INTRODUCTION README.dev \ + config.rpath \ + djgpp/README djgpp/config.bat djgpp/config.sed djgpp/config.site # This is to prevent texinfo.tex from being included in the top-level # distribution directory. TEXINFO_TEX = doc/texinfo.tex -# All subdirectories. -# Do intl, m4, and lib first since the C programs depend on them. -# Do doc last so makeinfo will be built when we get there. -# Others are alphabetical. -SUBDIRS = intl m4 lib info makeinfo po util doc +if TOOLS_ONLY + # Build native tools only. + SUBDIRS = lib info makeinfo util +else + # All subdirectories. + # Do intl, m4, and lib first since the C programs depend on them. + # Do doc last so makeinfo will be built when we get there. + # Others are alphabetical. + SUBDIRS = $(native_tools) intl m4 lib info makeinfo po util doc +endif # for gettext. ACLOCAL_AMFLAGS = -I m4 -# One special target for them to use by hand. +# In case TEXINFO_MAINT is set during make distcheck; in this case, the +# simple doc-related files generated in info/ make distcleancheck fail. +distcleancheck_listfiles = \ + find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';' + +# One special target for installers to use by hand if desired. install-tex: cd doc && $(MAKE) TEXMF=$(TEXMF) install-tex + +distclean-local: + -test -d "$(native_tools)" && rm -rf "$(native_tools)" + +# Don't install native tools for cross compile. +if TOOLS_ONLY +install: + +endif diff --git a/gnu/usr.bin/texinfo/Makefile.in b/gnu/usr.bin/texinfo/Makefile.in index cc7ea920039..750a39f8b21 100644 --- a/gnu/usr.bin/texinfo/Makefile.in +++ b/gnu/usr.bin/texinfo/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,7 +15,7 @@ @SET_MAKE@ # Makefile.am for texinfo. -# $Id: Makefile.in,v 1.11 2002/08/29 16:45:57 todd Exp $ +# $Id: Makefile.in,v 1.12 2006/07/17 16:12:35 espie Exp $ # Process this file with automake to produce Makefile.in in all directories. # # This file is free software; as a special exception the author gives @@ -25,143 +25,258 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SHELL = @SHELL@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ +build_triplet = @build@ host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.in \ + $(top_srcdir)/configure $(top_srcdir)/intl/Makefile.in \ + ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS TODO \ + config.guess config.rpath config.sub depcomp install-sh \ + missing mkinstalldirs +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = intl/Makefile +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = @native_tools@ intl m4 lib info makeinfo po util doc +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ -HAVE_LIB = @HAVE_LIB@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HELP2MAN = @HELP2MAN@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_WARNINGS_FALSE = @INSTALL_WARNINGS_FALSE@ +INSTALL_WARNINGS_TRUE = @INSTALL_WARNINGS_TRUE@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ +LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LTLIB = @LTLIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ TERMLIBS = @TERMLIBS@ +TOOLS_ONLY_FALSE = @TOOLS_ONLY_FALSE@ +TOOLS_ONLY_TRUE = @TOOLS_ONLY_TRUE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +native_tools = @native_tools@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ # Be sure we're using the right version of Automake. -AUTOMAKE_OPTIONS = 1.4 readme-alpha +AUTOMAKE_OPTIONS = 1.8 readme-alpha # Additional files to distribute. -EXTRA_DIST = COPYING.DOC INTRODUCTION config.rpath dir-example djgpp +EXTRA_DIST = ChangeLog.46 INSTALL.generic INTRODUCTION README.dev \ + config.rpath \ + djgpp/README djgpp/config.bat djgpp/config.sed djgpp/config.site + # This is to prevent texinfo.tex from being included in the top-level # distribution directory. TEXINFO_TEX = doc/texinfo.tex - -# All subdirectories. -# Do intl, m4, and lib first since the C programs depend on them. -# Do doc last so makeinfo will be built when we get there. -# Others are alphabetical. -SUBDIRS = intl m4 lib info makeinfo po util doc +@TOOLS_ONLY_FALSE@SUBDIRS = $(native_tools) intl m4 lib info makeinfo po util doc +@TOOLS_ONLY_TRUE@SUBDIRS = lib info makeinfo util # for gettext. ACLOCAL_AMFLAGS = -I m4 -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = intl/Makefile -DIST_SOURCES = -RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ - uninstall-info-recursive all-recursive install-data-recursive \ - install-exec-recursive installdirs-recursive install-recursive \ - uninstall-recursive check-recursive installcheck-recursive -DIST_COMMON = README ABOUT-NLS AUTHORS COPYING COPYING.DOC ChangeLog \ - INSTALL Makefile.am Makefile.in NEWS TODO acinclude.m4 \ - aclocal.m4 config.guess config.in config.rpath config.sub \ - configure configure.ac depcomp install-sh missing mkinstalldirs -DIST_SUBDIRS = $(SUBDIRS) +# In case TEXINFO_MAINT is set during make distcheck; in this case, the +# simple doc-related files generated in info/ make distcleancheck fail. +distcleancheck_listfiles = \ + find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';' + all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) - -$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): configure.ac acinclude.m4 m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/progtest.m4 +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @@ -173,17 +288,15 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h - -$(srcdir)/config.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) - #touch $(srcdir)/config.in + rm -f stamp-h1 + touch $@ distclean-hdr: - -rm -f config.h + -rm -f config.h stamp-h1 intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ -.PHONY install-info: install-info-recursive -install-info-am: uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -193,7 +306,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $(MAKEFLAGS); amf=$$2; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -213,7 +326,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -240,11 +353,10 @@ tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done - -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -254,14 +366,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ @@ -270,8 +391,24 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -280,51 +417,49 @@ GTAGS: && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = . -distdir = $(PACKAGE)-$(VERSION) - -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } - -GZIP_ENV = --best -distcleancheck_listfiles = find . -type f -print + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkinstalldirs) $(distdir)/intl $(distdir)/po - @for file in $(DISTFILES); do \ + $(mkdir_p) $(distdir)/djgpp $(distdir)/intl $(distdir)/m4 $(distdir)/po + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir)$$dir \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done - list='$(SUBDIRS)'; for subdir in $$list; do \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -335,26 +470,54 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - $(am__remove_distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/=build - mkdir $(distdir)/=inst + mkdir $(distdir)/_build + mkdir $(distdir)/_inst chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ - && cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ --with-included-gettext \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -363,32 +526,48 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - find $$dc_install_base -type f -print ; \ - exit 1; } >&2 ) \ - && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ - && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) - @echo "$(distdir).tar.gz is ready for distribution" | \ - sed 'h;s/./=/g;p;x;p;x' + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 distcleancheck: distclean - if test '$(srcdir)' = . ; then \ + @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi - test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after distclean:" ; \ + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ - true; } >&2 + exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: - -install: install-recursive +@TOOLS_ONLY_FALSE@install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -399,7 +578,7 @@ install-am: all-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -407,7 +586,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -417,13 +596,17 @@ clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive - -rm -f config.status config.cache config.log -distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-local \ + distclean-tags dvi: dvi-recursive dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -432,41 +615,65 @@ install-data-am: install-exec-am: +install-info: install-info-recursive + install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive - + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ - clean-generic clean-recursive dist dist-all dist-gzip distcheck \ - distclean distclean-generic distclean-hdr distclean-recursive \ - distclean-tags distcleancheck distdir dvi dvi-am dvi-recursive \ - info info-am info-recursive install install-am install-data \ - install-data-am install-data-recursive install-exec \ - install-exec-am install-exec-recursive install-info-am \ - install-info-recursive install-man install-recursive \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am installdirs-recursive maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive mostlyclean \ - mostlyclean-generic mostlyclean-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - - -# One special target for them to use by hand. +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-recursive ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ + dist-tarZ dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-local distclean-recursive \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + + +@TOOLS_ONLY_TRUE@ # Build native tools only. +@TOOLS_ONLY_FALSE@ # All subdirectories. +@TOOLS_ONLY_FALSE@ # Do intl, m4, and lib first since the C programs depend on them. +@TOOLS_ONLY_FALSE@ # Do doc last so makeinfo will be built when we get there. +@TOOLS_ONLY_FALSE@ # Others are alphabetical. + +# One special target for installers to use by hand if desired. install-tex: cd doc && $(MAKE) TEXMF=$(TEXMF) install-tex + +distclean-local: + -test -d "$(native_tools)" && rm -rf "$(native_tools)" + +# Don't install native tools for cross compile. +@TOOLS_ONLY_TRUE@install: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gnu/usr.bin/texinfo/config.guess b/gnu/usr.bin/texinfo/config.guess index 01706da0bde..cea7b49e94e 100644 --- a/gnu/usr.bin/texinfo/config.guess +++ b/gnu/usr.bin/texinfo/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2002-03-20' +timestamp='2004-11-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -88,30 +88,42 @@ if test $# != 0; then exit 1 fi +trap 'exit 1' 1 2 15 -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. -# CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c ; +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -142,6 +154,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; @@ -167,7 +180,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. @@ -177,68 +201,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - cat <<EOF >$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - eval $set_cc_for_build - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? @@ -261,6 +284,12 @@ EOF *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -278,6 +307,13 @@ EOF NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -346,6 +382,9 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -384,15 +423,20 @@ EOF exit (-1); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -465,8 +509,7 @@ EOF exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -564,11 +607,21 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) @@ -602,8 +655,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -661,21 +713,26 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -697,14 +754,17 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix + echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin @@ -716,17 +776,34 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit 0 ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -747,8 +824,26 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -784,6 +879,9 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -810,7 +908,7 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; @@ -841,9 +939,11 @@ EOF LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; @@ -861,6 +961,26 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -882,22 +1002,19 @@ EOF UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -921,9 +1038,15 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; - M68*:*:R3V[567]*:*) + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -940,9 +1063,6 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1014,6 +1134,9 @@ EOF SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; @@ -1021,7 +1144,12 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1034,7 +1162,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1057,11 +1185,6 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; @@ -1080,11 +1203,21 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix exit 0 ;; esac @@ -1206,8 +1339,7 @@ main () } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. diff --git a/gnu/usr.bin/texinfo/config.sub b/gnu/usr.bin/texinfo/config.sub index 2598200c2a2..0f84ac2c51e 100644 --- a/gnu/usr.bin/texinfo/config.sub +++ b/gnu/usr.bin/texinfo/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2002-03-07' +timestamp='2004-11-30' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -118,7 +118,8 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -144,7 +145,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) + -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; @@ -228,31 +229,45 @@ case $basic_machine in | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ - | d10v | d30v | dsp16xx \ - | fr30 \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el | mips64vr4300 \ - | mips64vr4300el | mips64vr5000 | mips64vr5000el \ - | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 | mipsisa64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic80 | tron \ + | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -281,38 +296,55 @@ case $basic_machine in | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armv*-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c54x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | fx80-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | m32r-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ - | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ - | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ - | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -332,6 +364,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -411,12 +446,27 @@ case $basic_machine in basic_machine=j90-cray os=-unicos ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -439,6 +489,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -617,10 +671,6 @@ case $basic_machine in mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -712,6 +762,10 @@ case $basic_machine in basic_machine=or32-unknown os=-coff ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -734,49 +788,55 @@ case $basic_machine in pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2) + pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; + pentium4) + basic_machine=i786-pc + ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumii-* | pentium2-*) + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown - ;; + ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown - ;; + ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; @@ -807,6 +867,16 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; sequent) basic_machine=i386-sequent ;; @@ -814,6 +884,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh64) + basic_machine=sh64-unknown + ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks @@ -872,7 +945,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -880,10 +953,6 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; t3e) basic_machine=alphaev5-cray os=-unicos @@ -896,6 +965,14 @@ case $basic_machine in basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -909,6 +986,10 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -930,8 +1011,8 @@ case $basic_machine in os=-vms ;; vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -952,11 +1033,11 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt + xbox) + basic_machine=i686-pc + os=-mingw32 ;; - xps | xps100) + xps | xps100) basic_machine=xps100-honeywell ;; ymp) @@ -986,6 +1067,9 @@ case $basic_machine in romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1002,16 +1086,16 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; - sparc | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -1026,10 +1110,6 @@ case $basic_machine in pmac | pmac-mpw) basic_machine=powerpc-apple ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; @@ -1085,18 +1165,20 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova*) + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1108,8 +1190,10 @@ case $os in ;; esac ;; + -nto-qnx*) + ;; -nto*) - os=-nto-qnx + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ @@ -1118,6 +1202,9 @@ case $os in -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1130,6 +1217,9 @@ case $os in -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1151,6 +1241,9 @@ case $os in -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1161,7 +1254,7 @@ case $os in os=-rtmk-nova ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 ;; -nsk*) os=-nsk @@ -1173,6 +1266,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1200,8 +1296,17 @@ case $os in -xenix) os=-xenix ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe ;; -none) ;; @@ -1234,11 +1339,14 @@ case $basic_machine in arm*-semi) os=-aout ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; - pdp11-*) + pdp11-*) os=-none ;; *-dec | vax-*) @@ -1280,6 +1388,9 @@ case $basic_machine in *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; @@ -1331,19 +1442,19 @@ case $basic_machine in *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) @@ -1412,10 +1523,16 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; - -vxsim* | -vxworks*) + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) diff --git a/gnu/usr.bin/texinfo/configure b/gnu/usr.bin/texinfo/configure index e6be42470db..f38ef266cb1 100644 --- a/gnu/usr.bin/texinfo/configure +++ b/gnu/usr.bin/texinfo/configure @@ -1,19 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for GNU Texinfo 4.2. +# Generated by GNU Autoconf 2.59 for GNU Texinfo 4.8. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -22,46 +13,57 @@ fi if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# NLS nuisances. # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -72,6 +74,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -82,15 +85,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -138,6 +141,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -210,13 +215,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -226,7 +238,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH # Name of the host. @@ -240,6 +252,7 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local +ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -254,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU Texinfo' PACKAGE_TARNAME='texinfo' -PACKAGE_VERSION='4.2' -PACKAGE_STRING='GNU Texinfo 4.2' +PACKAGE_VERSION='4.8' +PACKAGE_STRING='GNU Texinfo 4.8' PACKAGE_BUGREPORT='' ac_unique_file="makeinfo/makeinfo.c" @@ -296,6 +309,9 @@ ac_includes_default="\ # include <unistd.h> #endif" +gl_header_list= +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP RANLIB ac_ct_RANLIB HELP2MAN ALLOCA LIBOBJS build build_cpu build_vendor build_os native_tools TOOLS_ONLY_TRUE TOOLS_ONLY_FALSE TERMLIBS host host_cpu host_vendor host_os INSTALL_WARNINGS_TRUE INSTALL_WARNINGS_FALSE MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE GLIBC21 HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -653,7 +669,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -693,10 +709,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -719,6 +735,9 @@ if test ! -r $srcdir/$ac_unique_file; then { (exit 1); exit 1; }; } fi fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -760,7 +779,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Texinfo 4.2 to adapt to many kinds of systems. +\`configure' configures GNU Texinfo 4.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -785,9 +804,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -826,25 +845,30 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Texinfo 4.2:";; + short | recursive ) echo "Configuration of GNU Texinfo 4.8:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking Speeds up one-time builds - --enable-dependency-tracking Do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-multiplatform put executables in bin/PLATFORM + --disable-install-warnings omit make install warnings about TeX files --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-included-gettext use the GNU gettext library included here - --with-libintl-prefix=DIR search for libintl in DIR/include and DIR/lib + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: @@ -892,12 +916,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -908,7 +965,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else @@ -921,11 +978,10 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -GNU Texinfo configure 4.2 -generated by GNU Autoconf 2.53 +GNU Texinfo configure 4.8 +generated by GNU Autoconf 2.59 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -936,8 +992,8 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Texinfo $as_me 4.2, which was -generated by GNU Autoconf 2.53. Invocation command line was +It was created by GNU Texinfo $as_me 4.8, which was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -989,27 +1045,54 @@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= +ac_configure_args0= +ac_configure_args1= ac_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1020,6 +1103,7 @@ trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo + cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1032,16 +1116,45 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1049,14 +1162,14 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1136,7 +1249,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1153,13 +1266,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1190,6 +1303,9 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +gl_header_list="$gl_header_list fcntl.h" +gl_header_list="$gl_header_list sys/time.h" +gl_header_list="$gl_header_list unistd.h" @@ -1215,12 +1331,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Add the stamp file to the list of files AC keeps track of, -# along with our hook. -ac_config_headers="$ac_config_headers config.h:config.in" + ac_config_headers="$ac_config_headers config.h:config.in" +# Keep filename to 8.3 for MS-DOS. - -am__api_version="1.6" +am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -1257,6 +1371,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -1273,6 +1388,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1280,20 +1396,20 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -1381,7 +1497,6 @@ _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed - # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -1395,6 +1510,39 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -1435,15 +1583,15 @@ fi test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` @@ -1464,7 +1612,16 @@ echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi - # test to see if srcdir already configured +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 @@ -1472,9 +1629,19 @@ echo "$as_me: error: source directory already configured; run \"make distclean\" { (exit 1); exit 1; }; } fi +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + # Define the identity of the package. - PACKAGE=texinfo - VERSION=4.2 + PACKAGE='texinfo' + VERSION='4.8' cat >>confdefs.h <<_ACEOF @@ -1488,13 +1655,13 @@ _ACEOF # Some tools Automake needs. -ACLOCAL=${ACLOCAL-"${am_missing_run}"aclocal-${am__api_version}""} +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} -AUTOMAKE=${AUTOMAKE-"${am_missing_run}"automake-${am__api_version}""} +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} @@ -1502,9 +1669,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -AMTAR=${AMTAR-"${am_missing_run}tar"} - install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user @@ -1597,20 +1761,46 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + -if test -n "$TEXINFO_MAINT"; then - TEXINFO_MAINT_TRUE= - TEXINFO_MAINT_FALSE='#' +# When the Texinfo source is imported into other repositories +# (NetBSD and TeX Live), timestamps are generally not preserved. This +# causes lots of annoyance, so --enable-maintainer-mode. Sorry. +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' else - TEXINFO_MAINT_TRUE='#' - TEXINFO_MAINT_FALSE= + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= fi + MAINT=$MAINTAINER_MODE_TRUE + + +# Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1815,9 +2005,7 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$as_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi @@ -1922,8 +2110,10 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. @@ -1947,15 +2137,12 @@ ac_compiler=`set X $ac_compile; echo $2` (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1965,12 +2152,12 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -1984,26 +2171,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi @@ -2030,9 +2230,11 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi @@ -2040,7 +2242,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -2060,18 +2262,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. -for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2088,15 +2293,12 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2113,16 +2315,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2138,15 +2343,12 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2160,11 +2362,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2173,10 +2385,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -2192,15 +2405,12 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2211,11 +2421,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2224,10 +2444,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -2246,6 +2467,121 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide @@ -2257,19 +2593,28 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include <stdlib.h>' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -2277,16 +2622,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <stdlib.h> +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +#include <stdlib.h> int main () { @@ -2297,11 +2639,21 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2310,20 +2662,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2334,11 +2684,21 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2347,9 +2707,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -2360,32 +2721,25 @@ fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -rm -f .deps 2>/dev/null -mkdir .deps 2>/dev/null -if test -d .deps; then - DEPDIR=.deps -else - # MS-DOS does not allow filenames that begin with a dot. - DEPDIR=_deps -fi -rmdir .deps 2>/dev/null +DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" + ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' -doit: +am__doit: @echo done +.PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 @@ -2400,7 +2754,7 @@ echo "include confinc" > confmf # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU @@ -2460,18 +2814,34 @@ else # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. - echo '#include "conftest.h"' > conftest.c - echo 'int i;' > conftest.h - echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) @@ -2489,13 +2859,25 @@ else # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=conftest.c object=conftest.o \ - depfile=conftest.Po tmpdepfile=conftest.TPo \ - $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && - grep conftest.h conftest.Po > /dev/null 2>&1 && + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - am_cv_CC_dependencies_compiler_type=$depmode - break + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi fi done @@ -2512,6 +2894,18 @@ CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2535,24 +2929,34 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <assert.h> - Syntax error +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2563,7 +2967,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2572,20 +2977,24 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2597,7 +3006,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2626,24 +3036,34 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <assert.h> - Syntax error +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2654,7 +3074,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -2663,20 +3084,24 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2688,7 +3113,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -2701,8 +3127,10 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2713,6 +3141,21 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 @@ -2721,13 +3164,16 @@ if test "${ac_cv_prog_gcc_traditional+set}" = set; then else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sgtty.h> Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no @@ -2737,13 +3183,16 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <termio.h> Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "$ac_pattern" >/dev/null 2>&1; then + $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* @@ -2768,6 +3217,7 @@ fi # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -2784,6 +3234,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2791,20 +3242,20 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -2834,6 +3285,35 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -2915,17 +3395,22 @@ else fi +HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} + - echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 -echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 -if test "${ac_cv_lib_cposix_strerror+set}" = set; then +echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcposix $LIBS" + ac_func_search_save_LIBS=$LIBS +ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -2934,12 +3419,61 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_strerror" = no; then + for ac_lib in cposix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); int main () { @@ -2950,32 +3484,45 @@ strerror (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_cposix_strerror=yes + ac_cv_search_strerror="-l$ac_lib" +break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_cposix_strerror=no +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done fi -echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 -echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 -if test $ac_cv_lib_cposix_strerror = yes; then - LIBS="$LIBS -lcposix" +LIBS=$ac_func_search_save_LIBS fi +echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6 +if test "$ac_cv_search_strerror" != no; then + test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" - +fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 @@ -2983,49 +3530,68 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> +int +main () +{ + + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3037,13 +3603,16 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3058,16 +3627,20 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3078,7 +3651,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3098,11 +3671,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3127,7 +3701,7 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -3136,19 +3710,32 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3157,10 +3744,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3187,18 +3775,31 @@ else echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <minix/config.h> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3207,10 +3808,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3218,20 +3820,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <minix/config.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3242,7 +3848,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3250,19 +3857,36 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 @@ -3308,49 +3932,73 @@ if test "${ac_cv_func_sigblock+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define sigblock to an innocuous variant, in case <limits.h> declares sigblock. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define sigblock innocuous_sigblock + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sigblock (); below. */ -#include <assert.h> + which can conflict with char sigblock (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef sigblock + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sigblock (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sigblock) || defined (__stub___sigblock) choke me #else -f = sigblock; +char (*f) () = sigblock; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != sigblock; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3359,10 +4007,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_func_sigblock=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_sigblock=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sigblock" >&5 echo "${ECHO_T}$ac_cv_func_sigblock" >&6 @@ -3378,8 +4028,11 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -3388,12 +4041,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sigblock (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3404,11 +4051,21 @@ sigblock (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3417,10 +4074,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_lib_bsd_sigblock=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_bsd_sigblock=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_sigblock" >&5 @@ -3437,130 +4096,18 @@ fi fi -if test "x$termlib" = xncurses; then - -for ac_header in ncurses/termcap.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -fi +# Checks for header files. echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> @@ -3590,7 +4137,7 @@ You lose. _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "You lose" >/dev/null 2>&1; then + $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no @@ -3614,49 +4161,68 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> +int +main () +{ + + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3668,13 +4234,16 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3689,16 +4258,20 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3709,7 +4282,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -3729,11 +4302,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3765,7 +4339,7 @@ fi for ac_header in fcntl.h io.h limits.h pwd.h string.h strings.h \ termcap.h termio.h termios.h unistd.h \ - sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h + sys/fcntl.h sys/file.h sys/stream.h sys/time.h sys/ttold.h sys/wait.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -3781,18 +4355,31 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3801,10 +4388,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -3812,20 +4400,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3836,7 +4428,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3844,26 +4437,43 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -3878,23 +4488,88 @@ fi done + +# sys/ptem.h requires sys/stream.h for mblk_t on Solaris. + +for ac_header in sys/ptem.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if HAVE_SYS_STREAM_H +#include <sys/stream.h> +#endif + + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + echo "$as_me:$LINENO: checking POSIX termios" >&5 echo $ECHO_N "checking POSIX termios... $ECHO_C" >&6 if test "${ac_cv_sys_posix_termios+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <unistd.h> #include <termios.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif + int main () { @@ -3906,11 +4581,21 @@ main () _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3919,23 +4604,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_sys_posix_termios=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_sys_posix_termios=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_sys_posix_termios" >&5 echo "${ECHO_T}$ac_cv_sys_posix_termios" >&6 -if test $ac_cv_sys_posix_termios = yes; then - echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 +echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether termios.h defines TIOCGWINSZ... $ECHO_C" >&6 if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <termios.h> #ifdef TIOCGWINSZ @@ -3944,7 +4633,7 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_termios_h=yes else ac_cv_sys_tiocgwinsz_in_termios_h=no @@ -3955,7 +4644,6 @@ fi echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_termios_h" >&6 -fi if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then echo "$as_me:$LINENO: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether sys/ioctl.h defines TIOCGWINSZ... $ECHO_C" >&6 @@ -3963,8 +4651,11 @@ if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/ioctl.h> #ifdef TIOCGWINSZ @@ -3973,7 +4664,7 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then + $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no @@ -3994,21 +4685,19 @@ _ACEOF fi +# Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4022,11 +4711,21 @@ if (sizeof (off_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4035,10 +4734,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_off_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 @@ -4058,8 +4758,11 @@ if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <signal.h> #ifdef signal @@ -4071,12 +4774,6 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4087,11 +4784,21 @@ int i; _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4100,10 +4807,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_signal=int fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 @@ -4113,118 +4821,18 @@ cat >>confdefs.h <<_ACEOF _ACEOF -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4281,11 +4889,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4294,10 +4912,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_const=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 @@ -4315,17 +4934,14 @@ if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <time.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4336,11 +4952,21 @@ struct tm *tp; tp->tm_sec; _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4349,10 +4975,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_struct_tm=sys/time.h fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 @@ -4365,645 +4992,164 @@ _ACEOF fi - - headers=' -#include <stdio.h> -#ifdef HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#else -# ifdef HAVE_STRINGS_H -# include <strings.h> -# endif -#endif -#ifdef HAVE_STDLIB_H -# include <stdlib.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif -' - - if test x = y; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_STRERROR 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_STRCASECMP 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_STRNCASECMP 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_STRCOLL 1 -_ACEOF - - fi - - - for jm_func in strerror strcasecmp strncasecmp strcoll - do - - test -z "$ac_cv_header_memory_h" && -for ac_header in memory.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +# Checks for function declarations. +echo "$as_me:$LINENO: checking whether memchr is declared" >&5 +echo $ECHO_N "checking whether memchr is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_memchr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +int +main () +{ +#ifndef memchr + char *p = (char *) memchr; +#endif + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - test -z "$ac_cv_header_string_h" && -for ac_header in string.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_have_decl_memchr=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +ac_cv_have_decl_memchr=no fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +echo "$as_me:$LINENO: result: $ac_cv_have_decl_memchr" >&5 +echo "${ECHO_T}$ac_cv_have_decl_memchr" >&6 +if test $ac_cv_have_decl_memchr = yes; then -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - test -z "$ac_cv_header_strings_h" && -for ac_header in strings.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_includes_default -#include <$ac_header> +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MEMCHR 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_DECL_MEMCHR 0 _ACEOF -fi -done - - test -z "$ac_cv_header_stdlib_h" && -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +echo "$as_me:$LINENO: checking whether strcoll is declared" >&5 +echo $ECHO_N "checking whether strcoll is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strcoll+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +int +main () +{ +#ifndef strcoll + char *p = (char *) strcoll; +#endif + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - test -z "$ac_cv_header_unistd_h" && -for ac_header in unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_have_decl_strcoll=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +ac_cv_have_decl_strcoll=no fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strcoll" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strcoll" >&6 +if test $ac_cv_have_decl_strcoll = yes; then -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRCOLL 1 +_ACEOF -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then + +else cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_DECL_STRCOLL 0 _ACEOF -fi -done - - echo "$as_me:$LINENO: checking whether $jm_func is declared" >&5 -echo $ECHO_N "checking whether $jm_func is declared... $ECHO_C" >&6 - if eval "test \"\${jm_cv_func_decl_$jm_func+set}\" = set"; then +fi +echo "$as_me:$LINENO: checking whether strerror is declared" >&5 +echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$headers -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default int main () { - -#ifndef $jm_func -char *(*pfn) = (char *(*)) $jm_func +#ifndef strerror + char *p = (char *) strerror; #endif ; @@ -5012,43 +5158,55 @@ char *(*pfn) = (char *(*)) $jm_func _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "jm_cv_func_decl_$jm_func=yes" + ac_cv_have_decl_strerror=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "jm_cv_func_decl_$jm_func=no" +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_strerror=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6 +if test $ac_cv_have_decl_strerror = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR 1 +_ACEOF - if eval "test \"`echo '$jm_cv_func_decl_'$jm_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` - cat >>confdefs.h <<_ACEOF -#define $jm_tr_func 1 +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR 0 _ACEOF - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - done + +fi +# Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 @@ -5057,15 +5215,12 @@ if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <alloca.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5076,11 +5231,21 @@ char *p = (char *) alloca (2 * sizeof (int)); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5089,10 +5254,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_working_alloca_h=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 @@ -5110,8 +5277,11 @@ if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -5133,12 +5303,6 @@ char *alloca (); # endif #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5149,11 +5313,21 @@ char *p = (char *) alloca (1); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5162,10 +5336,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_alloca_works=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 @@ -5195,8 +5371,11 @@ if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else @@ -5205,7 +5384,7 @@ wenotbecray _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no @@ -5224,49 +5403,73 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5275,10 +5478,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -5303,8 +5508,11 @@ else ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int find_stack_direction () { @@ -5340,11 +5548,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 @@ -5366,15 +5575,12 @@ else ac_cv_func_strcoll_works=no else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5400,11 +5606,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_strcoll_works=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strcoll_works" >&5 @@ -5427,49 +5634,73 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5478,10 +5709,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -5496,49 +5729,73 @@ if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define _doprnt innocuous__doprnt + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _doprnt (); below. */ -#include <assert.h> + which can conflict with char _doprnt (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef _doprnt + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else -f = _doprnt; +char (*f) () = _doprnt; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5547,10 +5804,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func__doprnt=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 @@ -5566,6 +5825,10 @@ fi done +# in theory only pre-sysvr3 systems needed this and it's not likely +# that anyone compiling new texinfo still has such a thing? we'll see. +# AC_FUNC_SETVBUF_REVERSED + @@ -5573,7 +5836,8 @@ done -for ac_func in setvbuf getcwd memset bzero strchr sigprocmask sigsetmask +for ac_func in bzero getcwd memset setvbuf sigaction sigprocmask \ + sigsetmask strchr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -5582,49 +5846,178 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif + int main () { +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +for ac_func in memcpy memmove strdup strerror +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5633,10 +6026,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -5645,16 +6040,25 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF +else + case $LIBOBJS in + "$ac_func.$ac_objext" | \ + *" $ac_func.$ac_objext" | \ + "$ac_func.$ac_objext "* | \ + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; +esac + fi done +# strcasecmp and strncasecmp, gnulib-style. - -for ac_func in memcpy memmove strdup strcasecmp strerror strncasecmp +for ac_func in strcasecmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -5663,49 +6067,192 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif + int main () { +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case $LIBOBJS in + "$ac_func.$ac_objext" | \ + *" $ac_func.$ac_objext" | \ + "$ac_func.$ac_objext "* | \ + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; +esac + +fi +done + + + if test $ac_cv_func_strcasecmp = no; then + + : + + fi + + + +for ac_func in strncasecmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5714,10 +6261,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -5727,12 +6276,28 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + case $LIBOBJS in + "$ac_func.$ac_objext" | \ + *" $ac_func.$ac_objext" | \ + "$ac_func.$ac_objext "* | \ + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; +esac + fi done + if test $ac_cv_func_strncasecmp = no; then + + : + + fi + + +# We want to recognize djgpp to avoid the useless warning about no +# term library. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 @@ -5766,6 +6331,53 @@ build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +# We need to run some of our own binaries, most notably makedoc, but as +# long as we have this process, we also use our own makeinfo and +# install-info. +# +# This means that if we are cross compiling, we have to configure the +# package twice: once with the native compiler (this is done in a +# subdirectory $native_tools), and once with the cross compiler. +# The former is invoked automatically here, with --host=$build. +# $native_tools is also added to SUBDIRS in the main Makefile.am, +# so that make compiles the native tools first. +# +if test "$cross_compiling" = no; then + native_tools= +else + native_tools=tools + test -d "$native_tools" || mkdir "$native_tools" + confdir=`(cd "$srcdir";pwd)` + # Make sure the secondary configure won't fail with + # "error: source directory already configured". + rm -f config.status + { echo "$as_me:$LINENO: Doing configure of native tools (${build})." >&5 +echo "$as_me: Doing configure of native tools (${build})." >&6;} + cd "$native_tools" || exit 1 + # Run secondary configure in alternate environment or + # it gets the wrong CC etc. env -i gives this build host configure + # a clean environment. + env -i CC="${BUILD_CC}" AR="${BUILD_AR}" RANLIB="${BUILD_RANLIB}" \ + PATH="${PATH}" \ + tools_only=1 \ + ${confdir}/configure --build=${build} --host=${build} \ + --disable-rpath --disable-nls + cd .. || exit 1 + { echo "$as_me:$LINENO: Continuing with main configure (${host})." >&5 +echo "$as_me: Continuing with main configure (${host})." >&6;} +fi + + + +if test "x$tools_only" = x1; then + TOOLS_ONLY_TRUE= + TOOLS_ONLY_FALSE='#' +else + TOOLS_ONLY_TRUE='#' + TOOLS_ONLY_FALSE= +fi + + # Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but # rather ncurses. So we check for it. TERMLIBS= @@ -5781,8 +6393,11 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-l${termlib} $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -5791,12 +6406,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char tgetent (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5807,11 +6416,21 @@ tgetent (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5820,10 +6439,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Lib=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 @@ -5840,6 +6461,7 @@ if test -z "$TERMLIBS" && echo "$build" | grep -v djgpp >/dev/null; then echo "$as_me: WARNING: probably need a terminal library, one of: ${TERMLIB_VARIANTS}" >&2;} fi +# Checks for variables. # HP-UX 9 (at least) needs -lncurses which defines termcap variables PC etc. echo "$as_me:$LINENO: checking for library with termcap variables" >&5 echo $ECHO_N "checking for library with termcap variables... $ECHO_C" >&6 @@ -5854,15 +6476,12 @@ for trylib in $termlib ${TERMLIB_VARIANTS}; do LIBS="$oldLIBS -l$termlib" fi cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -5880,35 +6499,46 @@ short ospeed; #endif #endif /* Make sure all variables actually exist. AIX 4.3 has ospeed but no BC. - --Andreas Ley <andy@rz.uni-karlsruhe.de> + --Andreas Ley <andy@rz.uni-karlsruhe.de> 24 Aug 2000. */ +BC++; +UP++; +PC++; +return ospeed != 0; + ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - 24 Aug 2000. */ -BC++; -UP++ -PC++; -return ospeed != 0; - + ac_cv_var_ospeed=$trylib; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_var_ospeed=$trylib; break +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext done LIBS=$oldLIBS @@ -5920,21 +6550,1224 @@ if test -n "$ac_cv_var_ospeed" \ && test "x$termlib" != "x$ac_cv_var_ospeed"; then TERMLIBS="${TERMLIBS} -l${ac_cv_var_ospeed}" fi +# + +# Do not use <ncurses/termcap.h> unless we're linking with ncurses. +# Must come after the termlib tests. +if test "x$termlib" = xncurses; then + # Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined. + +for ac_header in ncurses/termcap.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +fi + +# gnulib. + + + + + +for ac_header in $gl_header_list +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + + + + + + + + + echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getenv + char *p = (char *) getenv; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getenv=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 +if test $ac_cv_have_decl_getenv = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF + + +fi + + + + + echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 +if test "${gl_cv_header_inttypes_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <inttypes.h> +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_inttypes_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gl_cv_header_inttypes_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6 + if test $gl_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for stdint.h" >&5 +echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 +if test "${gl_cv_header_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <stdint.h> +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_header_stdint_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gl_cv_header_stdint_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_header_stdint_h" >&6 + if test $gl_cv_header_stdint_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +unsigned long long ull = 1ULL; int i = 63; +int +main () +{ +unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_unsigned_long_long=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 + if test $ac_cv_type_unsigned_long_long = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 1 +_ACEOF + + fi + + + + + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then + + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF + + else + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UINTMAX_T 1 +_ACEOF + + fi + + +for ac_func in mkstemp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case $LIBOBJS in + "$ac_func.$ac_objext" | \ + *" $ac_func.$ac_objext" | \ + "$ac_func.$ac_objext "* | \ + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; +esac + +fi +done + + + if test $ac_cv_func_mkstemp = no; then + gl_cv_func_mkstemp_limitations=yes + else + echo "$as_me:$LINENO: checking for mkstemp limitations" >&5 +echo $ECHO_N "checking for mkstemp limitations... $ECHO_C" >&6 +if test "${gl_cv_func_mkstemp_limitations+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + gl_cv_func_mkstemp_limitations=yes + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# include <stdlib.h> + int main () + { + int i; + for (i = 0; i < 70; i++) + { + char template[] = "conftestXXXXXX"; + int fd = mkstemp (template); + if (fd == -1) + exit (1); + close (fd); + } + exit (0); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mkstemp_limitations=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mkstemp_limitations=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +echo "$as_me:$LINENO: result: $gl_cv_func_mkstemp_limitations" >&5 +echo "${ECHO_T}$gl_cv_func_mkstemp_limitations" >&6 + fi + + if test $gl_cv_func_mkstemp_limitations = yes; then + case $LIBOBJS in + "mkstemp.$ac_objext" | \ + *" mkstemp.$ac_objext" | \ + "mkstemp.$ac_objext "* | \ + *" mkstemp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; +esac + + case $LIBOBJS in + "tempname.$ac_objext" | \ + *" tempname.$ac_objext" | \ + "tempname.$ac_objext "* | \ + *" tempname.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS tempname.$ac_objext" ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define mkstemp rpl_mkstemp +_ACEOF + + + + + + + : + + + + + + + + + + + + +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_func in __secure_getenv gettimeofday +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + : + + + + + + + + fi + + +# For teTeX and TeX Live. +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# Check whether --enable-multiplatform or --disable-multiplatform was given. +if test "${enable_multiplatform+set}" = set; then + enableval="$enable_multiplatform" + +fi; +# if enable_multiplatform is set in the environment, use that. +test "x$enable_multiplatform" = xyes \ +&& test "x$bindir" = 'x${exec_prefix}/bin' \ +&& bindir="$bindir/$host" + +# Taken from the example in +# http://www.gnu.org/software/automake/manual/html_node/Conditionals.html. +# Check whether --enable-install-warnings or --disable-install-warnings was given. +if test "${enable_install_warnings+set}" = set; then + enableval="$enable_install_warnings" + case "${enableval}" in + yes) install_warnings=true ;; + no) install_warnings=false ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-install-warnings" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-install-warnings" >&2;} + { (exit 1); exit 1; }; } ;; + esac +else + install_warnings=true +fi; + + +if test x"$install_warnings" = xtrue || test x"$install_warnings" = xyes; then + INSTALL_WARNINGS_TRUE= + INSTALL_WARNINGS_FALSE='#' +else + INSTALL_WARNINGS_TRUE='#' + INSTALL_WARNINGS_FALSE= +fi + + +# i18n support. To update to a new version of gettext, run: +# gettextize -f -c --intl MKINSTALLDIRS= if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$SHELL $ac_aux_dir/mkinstalldirs" + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac fi if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="$SHELL \$(top_srcdir)/mkinstalldirs" + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 + + - # Extract the first word of "msgfmt", so it can be a program name with args. + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -5942,24 +7775,27 @@ if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; + ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" @@ -6012,7 +7848,36 @@ echo "${ECHO_T}no" >&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -6020,24 +7885,27 @@ if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; + ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" @@ -6051,7 +7919,36 @@ fi rm -f messages.po - # Extract the first word of "msgmerge", so it can be a program name with args. + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -6059,23 +7956,26 @@ if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in - /*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then - ac_cv_path_MSGMERGE="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; + ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" @@ -6101,8 +8001,8 @@ echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 fi if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 @@ -6112,30 +8012,70 @@ echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 rm -f messages.po fi - ac_config_commands="$ac_config_commands default-1" + ac_config_commands="$ac_config_commands default-1" -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then + + echo "$as_me:$LINENO: checking for signed" >&5 +echo $ECHO_N "checking for signed... $ECHO_C" >&6 +if test "${bh_cv_c_signed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +signed char x; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + bh_cv_c_signed=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +bh_cv_c_signed=no fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $bh_cv_c_signed" >&5 +echo "${ECHO_T}$bh_cv_c_signed" >&6 + if test $bh_cv_c_signed = no; then +cat >>confdefs.h <<\_ACEOF +#define signed +_ACEOF + + fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 @@ -6145,21 +8085,35 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef __cplusplus -static $ac_kw int static_foo () {return 0; } -$ac_kw int foo () {return 0; } +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6168,25 +8122,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 + + case $ac_cv_c_inline in inline | yes) ;; - no) -cat >>confdefs.h <<\_ACEOF -#define inline -_ACEOF - ;; - *) cat >>confdefs.h <<_ACEOF -#define inline $ac_cv_c_inline + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif _ACEOF - ;; + ;; esac echo "$as_me:$LINENO: checking for size_t" >&5 @@ -6195,15 +8154,12 @@ if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -6217,11 +8173,21 @@ if (sizeof (size_t)) _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6230,10 +8196,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_size_t=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 @@ -6248,6 +8215,427 @@ _ACEOF fi + echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +long long ll = 1LL; int i = 63; +int +main () +{ +long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 + if test $ac_cv_type_long_long = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for long double" >&5 +echo $ECHO_N "checking for long double... $ECHO_C" >&6 +if test "${gt_cv_c_long_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$GCC" = yes; then + gt_cv_c_long_double=yes + else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* The Stardent Vistra knows sizeof(long double), but does not support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + int array [2*(sizeof(long double) >= sizeof(double)) - 1]; + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_long_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_c_long_double=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 +echo "${ECHO_T}$gt_cv_c_long_double" >&6 + if test $gt_cv_c_long_double = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_DOUBLE 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for wchar_t" >&5 +echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6 +if test "${gt_cv_c_wchar_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> + wchar_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_wchar_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_c_wchar_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 +echo "${ECHO_T}$gt_cv_c_wchar_t" >&6 + if test $gt_cv_c_wchar_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WCHAR_T 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for wint_t" >&5 +echo $ECHO_N "checking for wint_t... $ECHO_C" >&6 +if test "${gt_cv_c_wint_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <wchar.h> + wint_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_wint_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_c_wint_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 +echo "${ECHO_T}$gt_cv_c_wint_t" >&6 + if test $gt_cv_c_wint_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WINT_T 1 +_ACEOF + + fi + + + + + echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 +if test "${gt_cv_c_intmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif + +int +main () +{ +intmax_t x = -1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_c_intmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_c_intmax_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 +echo "${ECHO_T}$gt_cv_c_intmax_t" >&6 + if test $gt_cv_c_intmax_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INTMAX_T 1 +_ACEOF + + fi + + + + echo "$as_me:$LINENO: checking whether printf() supports POSIX/XSI format strings" >&5 +echo $ECHO_N "checking whether printf() supports POSIX/XSI format strings... $ECHO_C" >&6 +if test "${gt_cv_func_printf_posix+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ + notposix +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "notposix" >/dev/null 2>&1; then + gt_cv_func_printf_posix="guessing no" +else + gt_cv_func_printf_posix="guessing yes" +fi +rm -f conftest* + + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdio.h> +#include <string.h> +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_func_printf_posix=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gt_cv_func_printf_posix=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:$LINENO: result: $gt_cv_func_printf_posix" >&5 +echo "${ECHO_T}$gt_cv_func_printf_posix" >&6 + case $gt_cv_func_printf_posix in + *yes) + +cat >>confdefs.h <<\_ACEOF +#define HAVE_POSIX_PRINTF 1 +_ACEOF + + ;; + esac + + for ac_header in stdlib.h unistd.h do @@ -6265,18 +8653,31 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6285,10 +8686,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -6296,20 +8698,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -6320,7 +8726,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -6328,26 +8735,43 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -6372,49 +8796,73 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6423,10 +8871,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -6447,8 +8897,11 @@ else ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc @@ -6551,9 +9004,9 @@ main () data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); - data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) + MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) @@ -6591,11 +9044,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 @@ -6616,8 +9070,11 @@ if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <features.h> #ifdef __GNU_LIBRARY__ @@ -6628,7 +9085,7 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "Lucky GNU user" >/dev/null 2>&1; then + $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no @@ -6645,6 +9102,1624 @@ echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 + + echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 +echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6 +if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + + # Guess based on the CPU. + case "$host_cpu" in + alpha* | i3456786 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; + esac + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdlib.h> +#include <signal.h> + +static void +#ifdef __cplusplus +sigfpe_handler (int sig) +#else +sigfpe_handler (sig) int sig; +#endif +{ + /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ + exit (sig != SIGFPE); +} + +int x = 1; +int y = 0; +int z; +int nan; + +int main () +{ + signal (SIGFPE, sigfpe_handler); +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) + signal (SIGTRAP, sigfpe_handler); +#endif +/* Linux/SPARC yields signal SIGILL. */ +#if defined (__sparc__) && defined (__linux__) + signal (SIGILL, sigfpe_handler); +#endif + + z = x / y; + nan = y / y; + exit (1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_int_divbyzero_sigfpe=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gt_cv_int_divbyzero_sigfpe=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 +echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6 + case "$gt_cv_int_divbyzero_sigfpe" in + *yes) value=1;; + *) value=0;; + esac + +cat >>confdefs.h <<_ACEOF +#define INTDIV0_RAISES_SIGFPE $value +_ACEOF + + + + echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 +if test "${gt_cv_header_inttypes_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <inttypes.h> +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_header_inttypes_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_header_inttypes_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6 + if test $gt_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H 1 +_ACEOF + + fi + + + + if test $gt_cv_header_inttypes_h = yes; then + echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 +echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6 +if test "${gt_cv_inttypes_pri_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_inttypes_pri_broken=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_inttypes_pri_broken=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 +echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6 + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +cat >>confdefs.h <<_ACEOF +#define PRI_MACROS_BROKEN 1 +_ACEOF + + fi + + + +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 +echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6 + result= + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then + result=yes +fi +rm -f conftest* + + if test -z "$result"; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 / 10) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 / 10) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 / 10) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 / 10) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 / 10) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) res_hi=$ac_lo;; +'') result=? ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +long longval () { return ~(size_t)0 / 10; } +unsigned long ulongval () { return ~(size_t)0 / 10; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if ((~(size_t)0 / 10) < 0) + { + long i = longval (); + if (i != (~(size_t)0 / 10)) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != (~(size_t)0 / 10)) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + res_hi=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +result=? +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 % 10) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 % 10) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 % 10) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 % 10) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((~(size_t)0 % 10) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) res_lo=$ac_lo;; +'') result=? ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +long longval () { return ~(size_t)0 % 10; } +unsigned long ulongval () { return ~(size_t)0 % 10; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if ((~(size_t)0 % 10) < 0) + { + long i = longval (); + if (i != (~(size_t)0 % 10)) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != (~(size_t)0 % 10)) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + res_lo=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +result=? +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) fits_in_uint=$ac_lo;; +'') result=? ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> +long longval () { return sizeof (size_t) <= sizeof (unsigned int); } +unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) + { + long i = longval (); + if (i != (sizeof (size_t) <= sizeof (unsigned int))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != (sizeof (size_t) <= sizeof (unsigned int))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + fits_in_uint=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +result=? +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val + if test "$fits_in_uint" = 1; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + fits_in_uint=0 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test -z "$result"; then + if test "$fits_in_uint" = 1; then + result="$res_hi$res_lo"U + else + result="$res_hi$res_lo"UL + fi + else + result='~(size_t)0' + fi + fi + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + if test "$result" != yes; then + +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $result +_ACEOF + + fi + + + + +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else @@ -6668,6 +10743,19 @@ if test "${with_gnu_ld+set}" = set; then else with_gnu_ld=no fi; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. @@ -6719,11 +10807,12 @@ else # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac fi done IFS="$ac_save_ifs" @@ -6749,11 +10838,12 @@ if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - acl_cv_prog_gnu_ld=yes -else - acl_cv_prog_gnu_ld=no -fi +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes ;; +*) + acl_cv_prog_gnu_ld=no ;; +esac fi echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 @@ -6783,9 +10873,13 @@ echo "${ECHO_T}$acl_cv_rpath" >&6 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" - sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" - sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" - + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; @@ -6926,7 +11020,7 @@ fi; if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then - if test "X$found_dir" = "X/usr/lib"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= @@ -7096,6 +11190,31 @@ fi; fi fi ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; @@ -7145,148 +11264,78 @@ fi; fi - am_save_CPPFLAGS="$CPPFLAGS" - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 -if test "${am_cv_func_iconv+set}" = set; then + + echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 +echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 +if test "${ac_cv_type_ptrdiff_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <stdlib.h> -#include <iconv.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default int main () { -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); +if ((ptrdiff_t *) 0) + return 0; +if (sizeof (ptrdiff_t)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - am_cv_func_iconv=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include <stdlib.h> -#include <iconv.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - am_cv_lib_iconv=yes - am_cv_func_iconv=yes + ac_cv_type_ptrdiff_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_ptrdiff_t=no fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 - if test "$am_cv_func_iconv" = yes; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 +echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 +if test $ac_cv_type_ptrdiff_t = yes; then + : +else cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 +#define ptrdiff_t long _ACEOF - fi - if test "$am_cv_lib_iconv" = yes; then - echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6 - else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - - - +fi @@ -7315,18 +11364,31 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7335,10 +11397,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -7346,20 +11409,24 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -7370,7 +11437,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -7378,26 +11446,43 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to the GNU Texinfo lists. ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -7433,9 +11518,12 @@ done -for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ -geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ -strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next + + +for ac_func in asprintf fwprintf getcwd getegid geteuid getgid getuid \ +mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ +strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ +__fsetlocking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7444,49 +11532,73 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7495,10 +11607,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -7512,6 +11626,539 @@ done + echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 +echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl__snprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ + +#ifndef _snprintf + char *p = (char *) _snprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl__snprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl__snprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6 + if test $ac_cv_have_decl__snprintf = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF $gt_value +_ACEOF + + + + echo "$as_me:$LINENO: checking whether _snwprintf is declared" >&5 +echo $ECHO_N "checking whether _snwprintf is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl__snwprintf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ + +#ifndef _snwprintf + char *p = (char *) _snwprintf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl__snwprintf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl__snwprintf=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl__snwprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl__snwprintf" >&6 + if test $ac_cv_have_decl__snwprintf = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNWPRINTF $gt_value +_ACEOF + + + + + echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 +echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ + +#ifndef feof_unlocked + char *p = (char *) feof_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_feof_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_feof_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 + if test $ac_cv_have_decl_feof_unlocked = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED $gt_value +_ACEOF + + + + echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ + +#ifndef fgets_unlocked + char *p = (char *) fgets_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fgets_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fgets_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 + if test $ac_cv_have_decl_fgets_unlocked = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED $gt_value +_ACEOF + + + + echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ + +#ifndef getc_unlocked + char *p = (char *) getc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 + if test $ac_cv_have_decl_getc_unlocked = yes; then + gt_value=1 + else + gt_value=0 + fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED $gt_value +_ACEOF + + + + case $gt_cv_func_printf_posix in + *yes) HAVE_POSIX_PRINTF=1 ;; + *) HAVE_POSIX_PRINTF=0 ;; + esac + + if test "$ac_cv_func_asprintf" = yes; then + HAVE_ASPRINTF=1 + else + HAVE_ASPRINTF=0 + fi + + if test "$ac_cv_func_snprintf" = yes; then + HAVE_SNPRINTF=1 + else + HAVE_SNPRINTF=0 + fi + + if test "$ac_cv_func_wprintf" = yes; then + HAVE_WPRINTF=1 + else + HAVE_WPRINTF=0 + fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + if test "$am_cv_func_iconv" = yes; then echo "$as_me:$LINENO: checking for iconv declaration" >&5 @@ -7521,8 +12168,11 @@ echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> #include <iconv.h> @@ -7536,12 +12186,6 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si size_t iconv(); #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7552,11 +12196,21 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7565,10 +12219,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + am_cv_proto_iconv_arg1="const" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi @@ -7591,15 +12246,12 @@ if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <langinfo.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7610,11 +12262,21 @@ char* cs = nl_langinfo(CODESET); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7623,10 +12285,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + am_cv_langinfo_codeset=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 @@ -7640,21 +12304,19 @@ _ACEOF fi if test $ac_cv_header_locale_h = yes; then - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 + + echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 if test "${am_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <locale.h> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7665,11 +12327,21 @@ return LC_MESSAGES _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7678,20 +12350,23 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 am_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + am_cv_val_LC_MESSAGES=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 - if test $am_cv_val_LC_MESSAGES = yes; then + if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF - fi + fi + fi for ac_prog in bison @@ -7765,6 +12440,9 @@ echo "${ECHO_T}$ac_prog_version" >&6 + + + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. @@ -7779,6 +12457,7 @@ echo "${ECHO_T}$USE_NLS" >&6 + BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no @@ -7816,17 +12495,14 @@ if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <libintl.h> extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -7838,11 +12514,21 @@ return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7851,10 +12537,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gt_cv_func_gnugettext1_libc=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 @@ -7996,7 +12684,7 @@ fi; if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then - if test "X$found_dir" = "X/usr/lib"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= @@ -8166,6 +12854,31 @@ fi; fi fi ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; @@ -8224,38 +12937,44 @@ else gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <libintl.h> extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { bindtextdomain ("", ""); -return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings + *_nl_expand_alias (0) +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8264,45 +12983,53 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gt_cv_func_gnugettext1_libintl=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <libintl.h> extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { bindtextdomain ("", ""); -return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings + *_nl_expand_alias (0) +return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8314,9 +13041,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" @@ -8327,7 +13056,8 @@ echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ - && test "$PACKAGE" != gettext; }; then + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= @@ -8342,8 +13072,7 @@ echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 fi if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - BUILD_INCLUDED_LIBINTL=yes + BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" @@ -8368,6 +13097,26 @@ _ACEOF fi fi + echo "$as_me:$LINENO: checking whether to use NLS" >&5 +echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 + if test "$USE_NLS" = "yes"; then + echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 +echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + echo "$as_me:$LINENO: result: $gt_source" >&5 +echo "${ECHO_T}$gt_source" >&6 + fi + if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then @@ -8417,7 +13166,7 @@ _ACEOF fi - if test "$PACKAGE" = gettext; then + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi @@ -8425,7 +13174,6 @@ _ACEOF - nls_cv_header_intl= nls_cv_header_libgt= @@ -8438,6 +13186,11 @@ _ACEOF GENCAT=gencat + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + + INTL_LIBTOOL_SUFFIX_PREFIX= @@ -8450,7 +13203,7 @@ _ACEOF -ac_config_files="$ac_config_files Makefile doc/Makefile info/Makefile intl/Makefile lib/Makefile m4/Makefile makeinfo/Makefile makeinfo/tests/Makefile po/Makefile.in util/Makefile" + ac_config_files="$ac_config_files Makefile doc/Makefile info/Makefile intl/Makefile lib/Makefile m4/Makefile makeinfo/Makefile makeinfo/tests/Makefile po/Makefile.in util/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8462,7 +13215,7 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overriden when +# `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. @@ -8480,13 +13233,13 @@ _ACEOF # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -8497,7 +13250,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -8516,22 +13269,37 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H -if test -z "${TEXINFO_MAINT_TRUE}" && test -z "${TEXINFO_MAINT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"TEXINFO_MAINT\" was never defined. +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"TEXINFO_MAINT\" was never defined. +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -8542,6 +13310,27 @@ echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${TOOLS_ONLY_TRUE}" && test -z "${TOOLS_ONLY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"TOOLS_ONLY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"TOOLS_ONLY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${INSTALL_WARNINGS_TRUE}" && test -z "${INSTALL_WARNINGS_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"INSTALL_WARNINGS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"INSTALL_WARNINGS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -8556,11 +13345,12 @@ cat >$CONFIG_STATUS <<_ACEOF # configure, is in config.log if it exists. debug=false +ac_cs_recheck=false +ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -8569,46 +13359,57 @@ cat >>$CONFIG_STATUS <<\_ACEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# NLS nuisances. # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -8619,6 +13420,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -8629,15 +13431,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -8686,6 +13488,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -8759,13 +13563,20 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -8775,7 +13586,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH exec 6>&1 @@ -8791,8 +13602,8 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by GNU Texinfo $as_me 4.2, which was -generated by GNU Autoconf 2.53. Invocation command line was +This file was extended by GNU Texinfo $as_me 4.8, which was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8832,12 +13643,13 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + instantiate the configuration header FILE Configuration files: $config_files @@ -8853,12 +13665,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -GNU Texinfo config.status 4.2 -configured by $0, generated by GNU Autoconf 2.53, +GNU Texinfo config.status 4.8 +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -8875,25 +13686,25 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift ;; - -*);; *) # This is not an option, so the user has probably given explicit # arguments. + ac_option=$1 ac_need_defaults=false;; esac - case $1 in + case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -8908,13 +13719,16 @@ Try \`$0 --help' for more information." >&2;} --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -8929,6 +13743,20 @@ Try \`$0 --help' for more information." >&2;} shift done +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + _ACEOF cat >>$CONFIG_STATUS <<_ACEOF @@ -8937,10 +13765,10 @@ cat >>$CONFIG_STATUS <<_ACEOF # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -# Capture the value of obsolete $ALL_LINGUAS because we need it to compute - # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. - eval 'ALL_LINGUAS''="$ALL_LINGUAS"' + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -8983,6 +13811,9 @@ if $ac_need_defaults; then test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -8991,17 +13822,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } @@ -9052,6 +13883,7 @@ s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t @@ -9059,15 +13891,20 @@ s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t -s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t -s,@TEXINFO_MAINT_TRUE@,$TEXINFO_MAINT_TRUE,;t t -s,@TEXINFO_MAINT_FALSE@,$TEXINFO_MAINT_FALSE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t @@ -9082,42 +13919,56 @@ s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@HELP2MAN@,$HELP2MAN,;t t s,@ALLOCA@,$ALLOCA,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t +s,@native_tools@,$native_tools,;t t +s,@TOOLS_ONLY_TRUE@,$TOOLS_ONLY_TRUE,;t t +s,@TOOLS_ONLY_FALSE@,$TOOLS_ONLY_FALSE,;t t s,@TERMLIBS@,$TERMLIBS,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@INSTALL_WARNINGS_TRUE@,$INSTALL_WARNINGS_TRUE,;t t +s,@INSTALL_WARNINGS_FALSE@,$INSTALL_WARNINGS_FALSE,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@USE_NLS@,$USE_NLS,;t t s,@MSGFMT@,$MSGFMT,;t t s,@GMSGFMT@,$GMSGFMT,;t t s,@XGETTEXT@,$XGETTEXT,;t t s,@MSGMERGE@,$MSGMERGE,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t s,@GLIBC21@,$GLIBC21,;t t +s,@HAVE_POSIX_PRINTF@,$HAVE_POSIX_PRINTF,;t t +s,@HAVE_ASPRINTF@,$HAVE_ASPRINTF,;t t +s,@HAVE_SNPRINTF@,$HAVE_SNPRINTF,;t t +s,@HAVE_WPRINTF@,$HAVE_WPRINTF,;t t s,@LIBICONV@,$LIBICONV,;t t s,@LTLIBICONV@,$LTLIBICONV,;t t s,@INTLBISON@,$INTLBISON,;t t -s,@USE_NLS@,$USE_NLS,;t t s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t s,@CATOBJEXT@,$CATOBJEXT,;t t -s,@INTLOBJS@,$INTLOBJS,;t t s,@DATADIRNAME@,$DATADIRNAME,;t t s,@INSTOBJEXT@,$INSTOBJEXT,;t t s,@GENCAT@,$GENCAT,;t t +s,@INTLOBJS@,$INTLOBJS,;t t s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t s,@INTLLIBS@,$INTLLIBS,;t t s,@LIBINTL@,$LIBINTL,;t t s,@LTLIBINTL@,$LTLIBINTL,;t t s,@POSUB@,$POSUB,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -9147,9 +13998,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -9167,46 +14018,51 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. @@ -9233,12 +14089,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac case $INSTALL in @@ -9260,7 +14149,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -9269,24 +14158,24 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } _ACEOF @@ -9328,12 +14217,12 @@ cat >>$CONFIG_STATUS <<\_ACEOF # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' @@ -9342,11 +14231,11 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac @@ -9360,28 +14249,29 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF @@ -9404,9 +14294,9 @@ s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times @@ -9420,13 +14310,13 @@ rm -f confdef2sed.sed # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail @@ -9435,7 +14325,7 @@ do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS @@ -9450,7 +14340,7 @@ do mv conftest.tail conftest.defines done rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS +echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size @@ -9462,7 +14352,7 @@ do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS @@ -9490,41 +14380,46 @@ cat >>$CONFIG_STATUS <<\_ACEOF cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file @@ -9533,13 +14428,29 @@ done; } cat $tmp/config.h rm -f $tmp/config.h fi - # Run the commands associated with the file. - case $ac_file in - config.h ) # update the timestamp -echo 'timestamp for config.h:config.in' >"./stamp-h1" - ;; +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -9551,16 +14462,41 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. if test "$ac_dir" != .; then @@ -9586,12 +14522,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 @@ -9600,13 +14569,19 @@ echo "$as_me: executing $ac_dest commands" >&6;} depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` - if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -9616,61 +14591,60 @@ echo X"$mf" | else continue fi - grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case $dirpart/$fdir in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy=$dirpart/$fdir -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create $dirpart/$fdir" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" @@ -9701,31 +14675,44 @@ done rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. - if test -n "$ALL_LINGUAS"; then + if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= - GMOFILES= UPDATEPOFILES= DUMMYPOFILES= + GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. @@ -9760,7 +14747,7 @@ done done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in @@ -9795,8 +14782,11 @@ ac_clean_files=$ac_clean_files_save # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. diff --git a/gnu/usr.bin/texinfo/doc/Makefile.am b/gnu/usr.bin/texinfo/doc/Makefile.am index 26fade8312a..36f0d920d69 100644 --- a/gnu/usr.bin/texinfo/doc/Makefile.am +++ b/gnu/usr.bin/texinfo/doc/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.4 2002/06/10 13:51:02 espie Exp $ +# $Id: Makefile.am,v 1.5 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/doc. # Run automake in .. to produce Makefile.in from this. # @@ -14,26 +14,28 @@ info_TEXINFOS = texinfo.txi info-stnd.texi info.texi DISTCLEANFILES = texinfo texinfo-* info*.info* -man_MANS = info.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \ +man_MANS = info.1 infokey.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \ info.5 texinfo.5 -HELP2MAN = help2man -noinst_SCRIPTS = $(HELP2MAN) -# Use the programs built in our distribution. -MAKEINFO = ../makeinfo/makeinfo -INSTALL_INFO = ../util/install-info +# Use the programs built in our distribution, taking account of possible +# cross-compiling. +MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo +INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \ - txi-nl.tex txi-no.tex txi-pt.tex + txi-it.tex txi-nl.tex txi-no.tex txi-pl.tex txi-pt.tex txi-tr.tex # Include our texinfo.tex, not Automake's. EXTRA_DIST = epsf.tex pdfcolor.tex texinfo.tex \ - fdl.texi macro.texi userdoc.texi \ - $(man_MANS) $(noinst_SCRIPTS) $(TXI_XLATE) + fdl.texi \ + $(man_MANS) $(TXI_XLATE) +if INSTALL_WARNINGS install-data-local: @echo - @echo "WARNING: You must install texinfo.tex and txi-??.tex manually," + @echo "WARNING: If your texmf tree does not already contain" + @echo " up-to-date versions, you must install" + @echo " texinfo.tex and txi-??.tex manually," @echo " perhaps in TEXMF/tex/texinfo/," @echo " where TEXMF is a root of your TeX tree." @echo " See doc/README for some considerations." @@ -43,6 +45,7 @@ install-data-local: @echo " use pdftex) pdfcolor.tex in TEXMF/tex/generic/dvips" @echo " and TEXMF/pdftex/plain/misc/pdfcolor.tex respectively," @echo " if your TeX installation did not include them." +endif texmf_texinfo = $(TEXMF)/tex/texinfo texmf_dvips = $(TEXMF)/tex/generic/dvips @@ -56,26 +59,22 @@ install-tex: for f in $(TXI_XLATE); do \ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(texmf_texinfo)/$$f; done -# Don't want to run help2man at every installation. -if TEXINFO_MAINT -info.1: ../info/ginfo $(HELP2MAN) - $(HELP2MAN) --name="read Info documents" $< >$@ -install-info.1: $(INSTALL_INFO) $(HELP2MAN) - $(HELP2MAN) --name="update info/dir entries" $< >$@ -makeinfo.1: $(MAKEINFO) $(HELP2MAN) - $(HELP2MAN) --name="translate Texinfo documents" $< >$@ -texi2dvi.1: ../util/texi2dvi $(HELP2MAN) - $(HELP2MAN) --name="print Texinfo documents" $< >$@ -texindex.1: ../util/texindex $(HELP2MAN) - $(HELP2MAN) --name="sort Texinfo index files" $< >$@ +# The man pages depend on the --help strings and the version number. +if MAINTAINER_MODE +common_mandeps = $(top_srcdir)/configure.ac +info.1: $(top_srcdir)/info/info.c $(common_mandeps) + $(HELP2MAN) --name="read Info documents" `basename $@ .1` >$@ +infokey.1: $(top_srcdir)/info/infokey.c $(common_mandeps) + $(HELP2MAN) --name="compile customizations for Info" `basename $@ .1` >$@ +install-info.1: $(top_srcdir)/util/install-info.c $(common_mandeps) + $(HELP2MAN) --name="update info/dir entries" `basename $@ .1` >$@ +makeinfo.1: $(top_srcdir)/makeinfo/makeinfo.c $(common_mandeps) + $(HELP2MAN) --name="translate Texinfo documents" `basename $@ .1` >$@ +texi2dvi.1: $(top_srcdir)/util/texi2dvi $(common_mandeps) + $(HELP2MAN) --name="print Texinfo documents" `basename $@ .1` >$@ +texindex.1: $(top_srcdir)/util/texindex.c $(common_mandeps) + $(HELP2MAN) --name="sort Texinfo index files" `basename $@ .1` >$@ endif -# Do not create info files for distribution, but do create man pages. +# Do not create info files for distribution. dist-info: - -# Do not try to build the info files in $(srcdir), -# since we don't distribute them. -.texi.info: - $(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'` -texinfo: $(srcdir)/texinfo.txi - $(MAKEINFO) -I$(srcdir) texinfo.txi diff --git a/gnu/usr.bin/texinfo/doc/Makefile.in b/gnu/usr.bin/texinfo/doc/Makefile.in index 8c8ed983bd3..c6aab4a4468 100644 --- a/gnu/usr.bin/texinfo/doc/Makefile.in +++ b/gnu/usr.bin/texinfo/doc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.6 2002/06/15 23:36:40 espie Exp $ +# $Id: Makefile.in,v 1.7 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/doc. # Run automake in .. to produce Makefile.in from this. # @@ -25,149 +25,297 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SHELL = @SHELL@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ +build_triplet = @build@ host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ +subdir = doc +DIST_COMMON = README $(info_TEXINFOS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/stamp-1 $(srcdir)/stamp-vti \ + $(srcdir)/version-stnd.texi $(srcdir)/version.texi mdate-sh \ + texinfo.tex +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +INFO_DEPS = texinfo info-stnd.info info.info +am__TEXINFO_TEX_DIR = $(srcdir) +DVIS = texinfo.dvi info-stnd.dvi info.dvi +PDFS = texinfo.pdf info-stnd.pdf info.pdf +PSS = texinfo.ps info-stnd.ps info.ps +HTMLS = texinfo.html info-stnd.html info.html +TEXINFOS = texinfo.txi info-stnd.texi info.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man5dir)" +man1dir = $(mandir)/man1 +man5dir = $(mandir)/man5 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ -HAVE_LIB = @HAVE_LIB@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HELP2MAN = @HELP2MAN@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_WARNINGS_FALSE = @INSTALL_WARNINGS_FALSE@ +INSTALL_WARNINGS_TRUE = @INSTALL_WARNINGS_TRUE@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ +LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LTLIB = @LTLIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ + +# Use the programs built in our distribution, taking account of possible +# cross-compiling. +MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ TERMLIBS = @TERMLIBS@ +TOOLS_ONLY_FALSE = @TOOLS_ONLY_FALSE@ +TOOLS_ONLY_TRUE = @TOOLS_ONLY_TRUE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +native_tools = @native_tools@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ # Put texinfo.txi first because that's the most important. info_TEXINFOS = texinfo.txi info-stnd.texi info.texi DISTCLEANFILES = texinfo texinfo-* info*.info* - -man_MANS = info.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \ +man_MANS = info.1 infokey.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \ info.5 texinfo.5 -HELP2MAN = help2man -noinst_SCRIPTS = $(HELP2MAN) - -# Use the programs built in our distribution. -MAKEINFO = ../makeinfo/makeinfo -INSTALL_INFO = ../util/install-info - +INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \ - txi-nl.tex txi-no.tex txi-pt.tex + txi-it.tex txi-nl.tex txi-no.tex txi-pl.tex txi-pt.tex txi-tr.tex # Include our texinfo.tex, not Automake's. EXTRA_DIST = epsf.tex pdfcolor.tex texinfo.tex \ - fdl.texi macro.texi userdoc.texi \ - $(man_MANS) $(noinst_SCRIPTS) $(TXI_XLATE) - + fdl.texi \ + $(man_MANS) $(TXI_XLATE) texmf_texinfo = $(TEXMF)/tex/texinfo texmf_dvips = $(TEXMF)/tex/generic/dvips texmf_pdftex_misc = $(TEXMF)/pdftex/plain/misc -subdir = doc -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SCRIPTS = $(noinst_SCRIPTS) - -DIST_SOURCES = -INFO_DEPS = texinfo info-stnd.info info.info -DVIS = texinfo.dvi info-stnd.dvi info.dvi -TEXINFOS = texinfo.txi info-stnd.texi info.texi -NROFF = nroff -MANS = $(man_MANS) -DIST_COMMON = README $(info_TEXINFOS) Makefile.am Makefile.in mdate-sh \ - stamp-1 stamp-vti texinfo.tex version-stnd.texi version.texi +# The man pages depend on the --help strings and the version number. +@MAINTAINER_MODE_TRUE@common_mandeps = $(top_srcdir)/configure.ac all: all-am .SUFFIXES: -.SUFFIXES: .dvi .info .ps .texi .txi -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +.SUFFIXES: .dvi .ps +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +texinfo: texinfo.txi $(srcdir)/version.texi + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ `test -f 'texinfo.txi' || echo '$(srcdir)/'`texinfo.txi; \ + then \ + rc=0; \ + else \ + rc=$$?; \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +texinfo.dvi: texinfo.txi $(srcdir)/version.texi + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) -o $@ `test -f 'texinfo.txi' || echo '$(srcdir)/'`texinfo.txi -$(srcdir)/version.texi: #$(srcdir)/stamp-vti - @: -$(srcdir)/stamp-vti: texinfo.txi $(top_srcdir)/configure.ac - @(set `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/texinfo.txi`; \ +texinfo.pdf: texinfo.txi $(srcdir)/version.texi + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) -o $@ `test -f 'texinfo.txi' || echo '$(srcdir)/'`texinfo.txi + +texinfo.html: texinfo.txi $(srcdir)/version.texi + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) `test -f 'texinfo.txi' || echo '$(srcdir)/'`texinfo.txi; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +$(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-vti +$(srcdir)/stamp-vti: texinfo.txi $(top_srcdir)/configure + @(dir=.; test -f ./texinfo.txi || dir=$(srcdir); \ + set `$(SHELL) $(srcdir)/mdate-sh $$dir/texinfo.txi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ @@ -182,15 +330,51 @@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: - -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi +@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi -texinfo: texinfo.txi $(srcdir)/version.texi -texinfo.dvi: texinfo.txi $(srcdir)/version.texi +info-stnd.info: info-stnd.texi $(srcdir)/version-stnd.texi + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ `test -f 'info-stnd.texi' || echo '$(srcdir)/'`info-stnd.texi; \ + then \ + rc=0; \ + else \ + rc=$$?; \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +info-stnd.dvi: info-stnd.texi $(srcdir)/version-stnd.texi + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) -o $@ `test -f 'info-stnd.texi' || echo '$(srcdir)/'`info-stnd.texi -$(srcdir)/version-stnd.texi: #$(srcdir)/stamp-1 - @: -$(srcdir)/stamp-1: info-stnd.texi $(top_srcdir)/configure.ac - @(set `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/info-stnd.texi`; \ +info-stnd.pdf: info-stnd.texi $(srcdir)/version-stnd.texi + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) -o $@ `test -f 'info-stnd.texi' || echo '$(srcdir)/'`info-stnd.texi + +info-stnd.html: info-stnd.texi $(srcdir)/version-stnd.texi + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) `test -f 'info-stnd.texi' || echo '$(srcdir)/'`info-stnd.texi; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +$(srcdir)/version-stnd.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-1 +$(srcdir)/stamp-1: info-stnd.texi $(top_srcdir)/configure + @(dir=.; test -f ./info-stnd.texi || dir=$(srcdir); \ + set `$(SHELL) $(srcdir)/mdate-sh $$dir/info-stnd.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ @@ -205,113 +389,94 @@ mostlyclean-1: -rm -f 1.tmp maintainer-clean-1: - -rm -f $(srcdir)/stamp-1 $(srcdir)/version-stnd.texi - -info-stnd.info: info-stnd.texi $(srcdir)/version-stnd.texi -info-stnd.dvi: info-stnd.texi $(srcdir)/version-stnd.texi +@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-1 $(srcdir)/version-stnd.texi info.info: info.texi $(info_TEXINFOS) -info.dvi: info.texi $(info_TEXINFOS) - -.texi.dvi: - TEXINPUTS="$(srcdir)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< - -.texi: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ - `echo $< | sed 's,.*/,,'` - -.txi.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ - `echo $< | sed 's,.*/,,'` - -.txi.dvi: - TEXINPUTS="$(srcdir)$(PATH_SEPARATOR)$$TEXINPUTS" \ + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ `test -f 'info.texi' || echo '$(srcdir)/'`info.texi; \ + then \ + rc=0; \ + else \ + rc=$$?; \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +info.dvi: info.texi $(info_TEXINFOS) + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) $< + $(TEXI2DVI) -o $@ `test -f 'info.texi' || echo '$(srcdir)/'`info.texi -.txi: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ - `echo $< | sed 's,.*/,,'` -TEXI2DVI = texi2dvi -DVIPS = dvips +info.pdf: info.texi $(info_TEXINFOS) + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) -o $@ `test -f 'info.texi' || echo '$(srcdir)/'`info.texi + +info.html: info.texi $(info_TEXINFOS) + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) `test -f 'info.texi' || echo '$(srcdir)/'`info.texi; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi .dvi.ps: - $(DVIPS) $< -o $@ - -install-info: install-info-am -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - d=.; \ - for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \ - if test -f $$ifile; then \ - relfile=`expr "$$ifile" : "$$d/\(.*\)"`; \ - echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \ - $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if (install-info --version && \ - install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ - done; \ - else : ; fi + $(DVIPS) -o $@ $< uninstall-info-am: $(PRE_UNINSTALL) @if (install-info --version && \ - install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \ - install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ - (if cd $(DESTDIR)$(infodir); then \ - echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \ - rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if cd "$(DESTDIR)$(infodir)"; then \ + echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done mostlyclean-aminfo: - -rm -f texinfo.aux texinfo.cp texinfo.cps texinfo.dvi texinfo.fn texinfo.fns \ - texinfo.ky texinfo.log texinfo.op texinfo.pg texinfo.ps \ - texinfo.toc texinfo.tp texinfo.vr info-stnd.aux info-stnd.cp \ - info-stnd.cps info-stnd.dvi info-stnd.fn info-stnd.ky \ - info-stnd.log info-stnd.pg info-stnd.ps info-stnd.toc \ - info-stnd.tp info-stnd.vr info.aux info.cp info.cps info.dvi \ - info.fn info.ky info.log info.pg info.ps info.toc info.tp \ - info.vr + -rm -rf texinfo.aux texinfo.cp texinfo.cps texinfo.fn texinfo.fns texinfo.ky \ + texinfo.kys texinfo.log texinfo.op texinfo.pg texinfo.tmp \ + texinfo.toc texinfo.tp texinfo.tps texinfo.vr texinfo.dvi \ + texinfo.pdf texinfo.ps texinfo.html info-stnd.aux \ + info-stnd.cp info-stnd.cps info-stnd.fn info-stnd.ky \ + info-stnd.log info-stnd.pg info-stnd.pgs info-stnd.tmp \ + info-stnd.toc info-stnd.tp info-stnd.tps info-stnd.vr \ + info-stnd.dvi info-stnd.pdf info-stnd.ps info-stnd.html \ + info.aux info.cp info.cps info.fn info.ky info.log info.pg \ + info.pgs info.tmp info.toc info.tp info.tps info.vr info.dvi \ + info.pdf info.ps info.html maintainer-clean-aminfo: - cd $(srcdir) && \ - for i in $(INFO_DEPS); do \ - rm -f $$i; \ - if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ - rm -f $$i-[0-9]*; \ - fi; \ + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done - -man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man1dir) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ @@ -323,11 +488,15 @@ install-man1: $(man1_MANS) $(man_MANS) if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @@ -340,17 +509,19 @@ uninstall-man1: done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done - -man5dir = $(mandir)/man5 install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man5dir) + test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ @@ -362,11 +533,15 @@ install-man5: $(man5_MANS) $(man_MANS) if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @@ -379,33 +554,44 @@ uninstall-man5: done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ - rm -f $(DESTDIR)$(man5dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done tags: TAGS TAGS: -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ctags: CTAGS +CTAGS: -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir)$$dir \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ @@ -413,15 +599,15 @@ distdir: $(DISTFILES) fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="${top_distdir}" distdir="$(distdir)" \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am -all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(MANS) - +all-am: Makefile $(INFO_DEPS) $(MANS) installdirs: - $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) - + for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -433,7 +619,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -441,24 +627,29 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@INSTALL_WARNINGS_FALSE@install-data-local: clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am - + -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) +html: html-am + +html-am: $(HTMLS) + info: info-am info-am: $(INFO_DEPS) @@ -467,12 +658,44 @@ install-data-am: install-data-local install-info-am #install-man install-exec-am: +#install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi install-man: install-man1 install-man5 installcheck-am: maintainer-clean: maintainer-clean-am - + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-1 \ maintainer-clean-aminfo maintainer-clean-generic \ maintainer-clean-vti @@ -482,35 +705,45 @@ mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-1 mostlyclean-aminfo mostlyclean-generic \ mostlyclean-vti +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man1 uninstall-man5 .PHONY: all all-am check check-am clean clean-generic dist-info \ - distclean distclean-generic distdir dvi dvi-am info info-am \ - install install-am install-data install-data-am \ - install-data-local install-exec install-exec-am install-info-am \ - install-man install-man1 install-man5 install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-1 maintainer-clean-aminfo \ + distclean distclean-generic distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-data-local install-exec install-exec-am install-info \ + install-info-am install-man install-man1 install-man5 \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-1 maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-1 mostlyclean-aminfo mostlyclean-generic \ - mostlyclean-vti uninstall uninstall-am uninstall-info-am \ - uninstall-man uninstall-man1 uninstall-man5 - - -install-data-local: - @echo - @echo "WARNING: You must install texinfo.tex and txi-??.tex manually," - @echo " perhaps in TEXMF/tex/texinfo/," - @echo " where TEXMF is a root of your TeX tree." - @echo " See doc/README for some considerations." - @echo " You can run make TEXMF=/your/texmf install-tex to do this." - @echo - @echo " You may also need to install epsf.tex and (if you" - @echo " use pdftex) pdfcolor.tex in TEXMF/tex/generic/dvips" - @echo " and TEXMF/pdftex/plain/misc/pdfcolor.tex respectively," - @echo " if your TeX installation did not include them." + mostlyclean-vti pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am uninstall-man uninstall-man1 uninstall-man5 + + +@INSTALL_WARNINGS_TRUE@install-data-local: +@INSTALL_WARNINGS_TRUE@ @echo +@INSTALL_WARNINGS_TRUE@ @echo "WARNING: If your texmf tree does not already contain" +@INSTALL_WARNINGS_TRUE@ @echo " up-to-date versions, you must install" +@INSTALL_WARNINGS_TRUE@ @echo " texinfo.tex and txi-??.tex manually," +@INSTALL_WARNINGS_TRUE@ @echo " perhaps in TEXMF/tex/texinfo/," +@INSTALL_WARNINGS_TRUE@ @echo " where TEXMF is a root of your TeX tree." +@INSTALL_WARNINGS_TRUE@ @echo " See doc/README for some considerations." +@INSTALL_WARNINGS_TRUE@ @echo " You can run make TEXMF=/your/texmf install-tex to do this." +@INSTALL_WARNINGS_TRUE@ @echo +@INSTALL_WARNINGS_TRUE@ @echo " You may also need to install epsf.tex and (if you" +@INSTALL_WARNINGS_TRUE@ @echo " use pdftex) pdfcolor.tex in TEXMF/tex/generic/dvips" +@INSTALL_WARNINGS_TRUE@ @echo " and TEXMF/pdftex/plain/misc/pdfcolor.tex respectively," +@INSTALL_WARNINGS_TRUE@ @echo " if your TeX installation did not include them." install-tex: test -n "$(TEXMF)" || (echo "TEXMF must be set." >&2; exit 1) $(mkinstalldirs) $(DESTDIR)$(texmf_texinfo) $(DESTDIR)$(texmf_dvips) $(DESTDIR)$(texmf_pdftex_misc) @@ -519,28 +752,21 @@ install-tex: $(INSTALL_DATA) $(srcdir)/pdfcolor.tex $(DESTDIR)$(texmf_pdftex_misc)/pdfcolor.tex for f in $(TXI_XLATE); do \ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(texmf_texinfo)/$$f; done - -# Don't want to run help2man at every installation. -@TEXINFO_MAINT_TRUE@info.1: ../info/ginfo $(HELP2MAN) -@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="read Info documents" $< >$@ -@TEXINFO_MAINT_TRUE@install-info.1: $(INSTALL_INFO) $(HELP2MAN) -@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="update info/dir entries" $< >$@ -@TEXINFO_MAINT_TRUE@makeinfo.1: $(MAKEINFO) $(HELP2MAN) -@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="translate Texinfo documents" $< >$@ -@TEXINFO_MAINT_TRUE@texi2dvi.1: ../util/texi2dvi $(HELP2MAN) -@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="print Texinfo documents" $< >$@ -@TEXINFO_MAINT_TRUE@texindex.1: ../util/texindex $(HELP2MAN) -@TEXINFO_MAINT_TRUE@ $(HELP2MAN) --name="sort Texinfo index files" $< >$@ - -# Do not create info files for distribution, but do create man pages. +@MAINTAINER_MODE_TRUE@info.1: $(top_srcdir)/info/info.c $(common_mandeps) +@MAINTAINER_MODE_TRUE@ $(HELP2MAN) --name="read Info documents" `basename $@ .1` >$@ +@MAINTAINER_MODE_TRUE@infokey.1: $(top_srcdir)/info/infokey.c $(common_mandeps) +@MAINTAINER_MODE_TRUE@ $(HELP2MAN) --name="compile customizations for Info" `basename $@ .1` >$@ +@MAINTAINER_MODE_TRUE@install-info.1: $(top_srcdir)/util/install-info.c $(common_mandeps) +@MAINTAINER_MODE_TRUE@ $(HELP2MAN) --name="update info/dir entries" `basename $@ .1` >$@ +@MAINTAINER_MODE_TRUE@makeinfo.1: $(top_srcdir)/makeinfo/makeinfo.c $(common_mandeps) +@MAINTAINER_MODE_TRUE@ $(HELP2MAN) --name="translate Texinfo documents" `basename $@ .1` >$@ +@MAINTAINER_MODE_TRUE@texi2dvi.1: $(top_srcdir)/util/texi2dvi $(common_mandeps) +@MAINTAINER_MODE_TRUE@ $(HELP2MAN) --name="print Texinfo documents" `basename $@ .1` >$@ +@MAINTAINER_MODE_TRUE@texindex.1: $(top_srcdir)/util/texindex.c $(common_mandeps) +@MAINTAINER_MODE_TRUE@ $(HELP2MAN) --name="sort Texinfo index files" `basename $@ .1` >$@ + +# Do not create info files for distribution. dist-info: - -# Do not try to build the info files in $(srcdir), -# since we don't distribute them. -.texi.info: - $(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'` -texinfo: $(srcdir)/texinfo.txi - $(MAKEINFO) -I$(srcdir) texinfo.txi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gnu/usr.bin/texinfo/doc/info-stnd.texi b/gnu/usr.bin/texinfo/doc/info-stnd.texi index db5a3c57b76..cccbdc1d165 100644 --- a/gnu/usr.bin/texinfo/doc/info-stnd.texi +++ b/gnu/usr.bin/texinfo/doc/info-stnd.texi @@ -1,5 +1,8 @@ -\input texinfo @c -*-texinfo-*- -@comment $Id: info-stnd.texi,v 1.4 2002/06/10 13:51:02 espie Exp $ +\input texinfo.tex @c -*-texinfo-*- +@comment $Id: info-stnd.texi,v 1.5 2006/07/17 16:12:36 espie Exp $ +@c We must \input texinfo.tex instead of texinfo, otherwise make +@c distcheck in the Texinfo distribution fails, because the texinfo Info +@c file is made first, and texi2dvi must include . first in the path. @comment %**start of header @setfilename info-stnd.info @include version-stnd.texi @@ -14,8 +17,8 @@ This manual is for GNU Info (version @value{VERSION}, @value{UPDATED}), a program for viewing documents in Info format (usually created from Texinfo source files). -Copyright @copyright{} 1992, 93, 96, 97, 98, 99, 2001, 02 -Free Software Foundation, Inc. +Copyright @copyright{} 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, +2003, 2004 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -73,8 +76,7 @@ first, as it includes more background information and a thorough tutorial. * Printing Nodes:: How to print out the contents of a node. * Miscellaneous Commands:: A few commands that defy categories. * Variables:: How to change the default behavior of Info. -* Custom Key Bindings:: How to define your own key-to-command - bindings. +* Custom Key Bindings:: How to define your own key-to-command bindings. * Copying This Manual:: The GNU Free Documentation License. * Index:: Global index containing keystrokes, command names, variable names, @@ -202,7 +204,7 @@ Produces a relatively brief description of the available Info options. @cindex index search, selecting from the command line @cindex online help, using Info as After processing all command-line arguments, go to the index in the Info -file and search for index entries which matche @var{string}. If such an +file and search for index entries which match @var{string}. If such an entry is found, the Info session begins with displaying the node pointed to by the first matching index entry; press @kbd{,} to step through the rest of the matching entries. If no such entry exists, print @samp{no @@ -236,17 +238,17 @@ Each node that Info visits will be output to @var{filename} instead of interactively viewed. A value of @code{-} for @var{filename} specifies the standard output. -@cindex colors in man pages -@cindex ANSI escape sequences in man pages +@cindex colors in documents +@cindex ANSI escape sequences in documents @item --raw-escapes +@itemx --no-raw-escapes @itemx -R -Do not remove ANSI escape sequences from man pages. Some versions of +Do not remove ANSI escape sequences from documents. Some versions of Groff, the GNU document formatter, produce man pages with ANSI escape sequences for bold, italics, and underlined characters, and for -colorized text. By default, Info removes those escape sequences -before it displays the man page. If your terminal supports these -escapes, use @code{--raw-escapes} to let the terminal handle them and -display the man pages with those attributes. +colorized text. By default, Info lets those escape sequences pass +through directly to the terminal. If your terminal does not support +these escapes, use @code{--no-raw-escapes} to make Info remove them. @cindex replaying recorded keystrokes @item --restore=@var{dribble-file} @@ -300,6 +302,14 @@ modeled after Emacs. (@xref{Custom Key Bindings}, for a more general way of altering GNU Info's key bindings.) +@cindex Info manual location +@cindex Where is an Info manual? +@item --where +@itemx --location +@itemx -w +Show the filename that would be read and exit, instead of actually +reading it and starting Info. + @item @var{menu-item} @cindex menu, following @anchor{command-line menu items} @@ -338,19 +348,19 @@ following all the menu items given on the command line. This is so @cindex moving the cursor Many people find that reading screens of text page by page is made -easier when one is able to indicate particular pieces of text with some -kind of pointing device. Since this is the case, GNU Info (both the -Emacs and standalone versions) have several commands which allow you to -move the cursor about the screen. The notation used in this manual to -describe keystrokes is identical to the notation used within the Emacs -manual, and the GNU Readline manual. @xref{Characters, , Character -Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the -notation@footnote{ -Here's a short summary. @kbd{C-@var{x}} means press the @kbd{CTRL} key -and the key @var{x}. @kbd{M-@var{x}} means press the @kbd{META} key and -the key @var{x}. On many terminals th @kbd{META} key is known as the -@kbd{ALT} key. @kbd{SPC} is the space bar. The other keys are usually -called by the names imprinted on them.}. +easier when one is able to indicate particular pieces of text with +some kind of pointing device. Since this is the case, GNU Info (both +the Emacs and standalone versions) have several commands which allow +you to move the cursor about the screen. The notation used in this +manual to describe keystrokes is identical to the notation used within +the Emacs manual, and the GNU Readline manual. @xref{User Input,,, +emacs, the GNU Emacs Manual}, if you are unfamiliar with the +notation.@footnote{Here's a short summary. @kbd{C-@var{x}} means +press the @kbd{CTRL} key and the key @var{x}. @kbd{M-@var{x}} means +press the @kbd{META} key and the key @var{x}. On many terminals th +@kbd{META} key is known as the @kbd{ALT} key. @kbd{SPC} is the space +bar. The other keys are usually called by the names imprinted on +them.} The following table lists the basic cursor movement commands in Info. Each entry consists of the key sequence you should type to execute the @@ -465,7 +475,7 @@ commands detailed in this section are used to shift which part of the current node is visible on the screen. Scrolling commands are bound differently when @samp{--vi-keys} operation -(@pxref{--vi-keys}) is in effect. These key bindings are designated +is in effect (@pxref{--vi-keys}). These key bindings are designated with ``vi-like operation''. @table @asis @@ -700,7 +710,7 @@ Select the `Up' node. @end table You can easily select a node that you have already viewed in this window -by using the @samp{l} command -- this name stands for "last", and +by using the @samp{l} command---this name stands for ``last'', and actually moves backwards through the history of visited nodes for this window. This is handy when you followed a reference to another node, possibly to read about a related issue, and would like then to resume @@ -978,7 +988,7 @@ is case-sensitive; otherwise Info ignores the letter case. @cindex index, searching @cindex searching, in the indices Look up a string in the indices for this Info file, and select a node -where the found index entry points to. +to which the found index entry points. @item @key{,} (@code{next-index-match}) @kindex , @@ -1029,9 +1039,10 @@ has all of its important concepts indexed, so the @samp{i} command lets you use a manual as a reference. If you don't know what manual documents something, try the @kbd{M-x -index-apropos}. It prompts for a string and then looks up that string -in all the indices of all the Info documents installed on your system. -It can also be invoked from the command line; see @ref{--apropos}. +index-apropos} command. It prompts for a string and then looks up +that string in all the indices of all the Info documents installed on +your system. It can also be invoked from the command line; see +@ref{--apropos}. @node Xref Commands @@ -1048,7 +1059,7 @@ different node, perhaps in another Info file. Such pointers are called * Selecting Xrefs:: Commands for selecting menu or note items. @end menu -@node Parts of an Xref, Selecting Xrefs, , Xref Commands +@node Parts of an Xref @section Parts of an Xref Cross references have two major parts: the first part is called the @@ -1096,7 +1107,7 @@ documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo Manual}, for more information on creating your own texinfo cross references. -@node Selecting Xrefs, , Parts of an Xref, Xref Commands +@node Selecting Xrefs @section Selecting Xrefs The following table lists the Info commands which operate on menu items. @@ -1207,7 +1218,7 @@ windows. * The Echo Area:: Used for displaying errors and reading input. @end menu -@node The Mode Line, Basic Windows, , Window Commands +@node The Mode Line @section The Mode Line A @dfn{mode line} is a line of inverse video which appears at the bottom @@ -1257,7 +1268,7 @@ showing possible completions: -----Info: *Completions*, 7 lines --All--------------------------------- @end example -@node Basic Windows, The Echo Area, The Mode Line, Window Commands +@node Basic Windows @section Window Commands It can be convenient to view more than one node at a time. To allow @@ -1291,8 +1302,7 @@ Split the current window into two windows, both showing the same node. Each window is one half the size of the original window, and the cursor remains in the original window. The variable @code{automatic-tiling} can cause all of the windows on the screen to be resized for you -automatically, please @pxref{Variables, , automatic-tiling} for more -information. +automatically (@pxref{Variables, , automatic-tiling}). @item @kbd{C-x @key{0}} (@code{delete-window}) @cindex windows, deleting @@ -1312,7 +1322,7 @@ Delete all of the windows excepting the current one. @findex scroll-other-window Scroll the other window, in the same fashion that @samp{C-v} might scroll the current window. Given a negative argument, scroll the -"other" window backward. +``other'' window backward. @item @kbd{C-x @key{^}} (@code{grow-window}) @kindex C-x ^ @@ -1332,7 +1342,7 @@ its contents. The variable @code{automatic-tiling} can cause @xref{Variables, , @code{automatic-tiling}}. @end table -@node The Echo Area, , Basic Windows, Window Commands +@node The Echo Area @section The Echo Area @cindex echo area @@ -1465,9 +1475,9 @@ Transpose the characters at the cursor. The next group of commands deal with @dfn{killing}, and @dfn{yanking} text@footnote{ Some people are used to calling these operations @dfn{cut} and -@dfn{paste}, respectively.}. For an in depth discussion of killing and -yanking, @pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs -Manual} +@dfn{paste}, respectively.}. For an in-depth discussion of killing and +yanking, see @ref{Killing, , Killing and Deleting, emacs, the GNU Emacs +Manual}. @table @asis @item @key{M-d} (@code{echo-area-kill-word}) @@ -1568,7 +1578,7 @@ with @samp{fol}. @item @key{ESC C-v} (@code{echo-area-scroll-completions-window}) @kindex ESC C-v, in the echo area @findex echo-area-scroll-completions-window -Scroll the completions window, if that is visible, or the "other" +Scroll the completions window, if that is visible, or the ``other'' window if not. @end table @@ -1809,15 +1819,16 @@ Here is a list of the variables that you can set in Info. @table @code @item automatic-footnotes @vindex automatic-footnotes -When set to @code{On}, footnotes appear and disappear automatically. -This variable is @code{On} by default. When a node is selected, a -window containing the footnotes which appear in that node is created, -and the footnotes are displayed within the new window. The window that -Info creates to contain the footnotes is called @samp{*Footnotes*}. If -a node is selected which contains no footnotes, and a @samp{*Footnotes*} -window is on the screen, the @samp{*Footnotes*} window is deleted. -Footnote windows created in this fashion are not automatically tiled so -that they can use as little of the display as is possible. +When set to @code{On}, footnotes appear and disappear automatically; +else, they appear at the bottom of the node text. This variable is +@code{Off} by default. When a node is selected, a window containing +the footnotes which appear in that node is created, and the footnotes +are displayed within the new window. The window that Info creates to +contain the footnotes is called @samp{*Footnotes*}. If a node is +selected which contains no footnotes, and a @samp{*Footnotes*} window +is on the screen, the @samp{*Footnotes*} window is deleted. Footnote +windows created in this fashion are not automatically tiled so that +they can use as little of the display as is possible. @item automatic-tiling @vindex automatic-tiling @@ -1894,7 +1905,7 @@ nonzero value, Info attempts to scroll the node text by that many lines; if that is enough to bring the cursor back into the window, that is what is done. The default value of this variable is 0, thus placing the cursor (and the text it is attached to) in the center of the window. -Setting this variable to 1 causes a kind of "smooth scrolling" which +Setting this variable to 1 causes a kind of ``smooth scrolling'' which some people prefer. @item show-index-match diff --git a/gnu/usr.bin/texinfo/doc/info.texi b/gnu/usr.bin/texinfo/doc/info.texi index 8221c1f576f..014e9165087 100644 --- a/gnu/usr.bin/texinfo/doc/info.texi +++ b/gnu/usr.bin/texinfo/doc/info.texi @@ -1,4 +1,7 @@ -\input texinfo @c -*-texinfo-*- +\input texinfo.tex @c -*-texinfo-*- +@c We must \input texinfo.tex instead of texinfo, otherwise make +@c distcheck in the Texinfo distribution fails, because the texinfo Info +@c file is made first, and texi2dvi must include . first in the path. @comment %**start of header @setfilename info.info @settitle Info @@ -6,21 +9,15 @@ @syncodeindex vr cp @syncodeindex ky cp @comment %**end of header -@comment $Id: info.texi,v 1.4 2002/06/10 13:51:02 espie Exp $ -@dircategory Texinfo documentation system -@direntry -* Info: (info). How to use the documentation browsing system. -@end direntry - -@ifinfo +@copying This file describes how to use Info, the on-line, menu-driven GNU documentation system. -Copyright (C) 1989, 92, 96, 97, 98, 99, 2000, 2001, 2002 +Copyright (C) 1989, 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - +@quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no @@ -37,7 +34,13 @@ This document is part of a collection distributed under the GNU Free Documentation License. If you want to distribute this document separately from the collection, you can do so by adding a copy of the license to the document, as described in section 6 of the license. -@end ifinfo +@end quotation +@end copying + +@dircategory Texinfo documentation system +@direntry +* Info: (info). How to use the documentation browsing system. +@end direntry @titlepage @title Info @@ -46,62 +49,47 @@ license to the document, as described in section 6 of the license. @author and the GNU Texinfo community @page @vskip 0pt plus 1filll -Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99, 2000, 2001 -Free Software Foundation, Inc. -@sp 2 -Published by the Free Software Foundation @* -59 Temple Place - Suite 330 @* -Boston, MA 02111-1307, USA. - -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or -any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU -Manual'', and with the Back-Cover Texts as in (a) below. A copy of the -license is included in the section entitled ``GNU Free Documentation -License'' in the Emacs manual. - -(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -this GNU Manual, like GNU software. Copies published by the Free -Software Foundation raise funds for GNU development.'' - -This document is part of a collection distributed under the GNU Free -Documentation License. If you want to distribute this document -separately from the collection, you can do so by adding a copy of the -license to the document, as described in section 6 of the license. +@insertcopying @end titlepage +@contents + @ifnottex @node Top @top Info: An Introduction -Info is a program, which you are using now, for reading documentation of -computer programs. The GNU Project distributes most of its on-line -manuals in the Info format, so you need a program called @dfn{Info -reader} to read the manuals. One of such programs you are using now. +The GNU Project distributes most of its on-line manuals in the +@dfn{Info format}, which you read using an @dfn{Info reader}. You are +probably using an Info reader to read this now. + +There are two primary Info readers: @code{info}, a stand-alone program +designed just to read Info files, and the @code{info} package in GNU +Emacs, a general-purpose editor. At present, only the Emacs reader +supports using a mouse. @ifinfo -If you are new to Info and want to learn how to use it, type the -command @kbd{h} now. It brings you to a programmed instruction -sequence. +If you are new to the Info reader and want to learn how to use it, +type the command @kbd{h} now. It brings you to a programmed +instruction sequence. -To learn advanced Info commands, type @kbd{n} twice. This brings you to -@cite{Info for Experts}, skipping over the `Getting Started' chapter. +To read about expert-level Info commands, type @kbd{n} twice. This +brings you to @cite{Info for Experts}, skipping over the `Getting +Started' chapter. @end ifinfo @end ifnottex @menu * Getting Started:: Getting started using an Info reader. -* Advanced Info:: Advanced commands within Info. +* Expert Info:: Info commands for experts. * Creating an Info File:: How to make your own Info file. * Index:: An index of topics, commands, and variables. @end menu -@node Getting Started, Advanced Info, Top, Top +@node Getting Started, Expert Info, Top, Top @comment node-name, next, previous, up @chapter Getting Started -This first part of the Info manual describes how to get around inside +This first part of this Info manual describes how to get around inside of Info. The second part of the manual describes various advanced Info commands, and how to write an Info as distinct from a Texinfo file. The third part briefly explains how to generate Info files from @@ -128,7 +116,7 @@ stand-alone program designed just to read Info files. @item Type @code{emacs} at the command line; then type @kbd{C-h i} (@kbd{Control-h}, followed by @kbd{i}). This approach uses the Info -mode of the Emacs program, an editor with many other capabilities. +mode of the Emacs editor. @end enumerate In either case, then type @kbd{mInfo} (just the letters), followed by @@ -142,14 +130,15 @@ the screen. @end ifnotinfo @menu -* Help-Small-Screen:: Starting Info on a Small Screen -* Help:: How to use Info -* Help-P:: Returning to the Previous node +* Help-Small-Screen:: Starting Info on a Small Screen. +* Help:: How to use Info. +* Help-P:: Returning to the Previous node. * Help-^L:: The Space, DEL, B and ^L commands. -* Help-M:: Menus -* Help-Xref:: Following cross-references -* Help-Int:: Some intermediate Info commands -* Help-Q:: Quitting Info +* Help-Inv:: Invisible text in Emacs Info. +* Help-M:: Menus. +* Help-Xref:: Following cross-references. +* Help-Int:: Some intermediate Info commands. +* Help-Q:: Quitting Info. @end menu @node Help-Small-Screen @@ -223,8 +212,8 @@ This is line 59 If you have managed to get here, go back to the beginning with @kbd{DEL} (or @key{BACKSPACE}), and come back here again, then you understand the about the @samp{Space} and @samp{Backspace} keys. So -now type an @kbd{n} ---just one character; don't type the quotes and -don't type the Return key afterward--- to get to the normal start of +now type an @kbd{n}---just one character; don't type the quotes and +don't type the Return key afterward---to get to the normal start of the course. @end ifinfo @@ -234,6 +223,10 @@ the course. You are talking to the program Info, for reading documentation. + There are two ways to use Info: from within Emacs or as a +stand-alone reader that you can invoke from a shell using the command +@command{info}. + @cindex node, in Info documents Right now you are looking at one @dfn{Node} of Information. A node contains text describing a specific topic at a specific @@ -241,18 +234,17 @@ level of detail. This node's topic is ``how to use Info''. The mode line says that this is node @samp{Help} in the file @file{info}. @cindex header of Info node - The top line of a node is its @dfn{header}. This node's header (look at -it now) says that the @samp{Next} node after this one is the node -called @samp{Help-P}. An advanced Info command lets you go to any node -whose name you know. In the stand-alone Info reader program, the -header line shows the names of this node and the info file as well. -In Emacs, the header line is displayed in a special typeface, and it -doesn't scroll off the screen when you scroll the display. The names -of this node and of its Info file are omitted by Emacs from the header -line. - - Besides a @samp{Next}, a node can have a @samp{Previous} or an -@samp{Up} links, or both. As you can see, this node has all of these + The top line of a node is its @dfn{header}. This node's header +(look at it now) says that the @samp{Next} node after this one is the +node called @samp{Help-P}. An advanced Info command lets you go to +any node whose name you know. In the stand-alone Info reader program, +the header line shows the names of this node and the info file as +well. In Emacs, the header line is duplicated in a special typeface, +and the duplicate remains at the top of the window all the time even +if you scroll through the node. + + Besides a @samp{Next}, a node can have a @samp{Previous} link, or an +@samp{Up} link, or both. As you can see, this node has all of these links. @kindex n @r{(Info mode)} @@ -267,9 +259,9 @@ links. @samp{>>} in the margin means it is really time to try a command. @format ->> If you have a mouse, and if you already practiced typing @kbd{n} - to get to the next node, click now with the right mouse button on - the @samp{Next} link to do the same ``the mouse way''. +>> If you are in Emacs and have a mouse, and if you already practiced + typing @kbd{n} to get to the next node, click now with the middle + mouse button on the @samp{Next} link to do the same ``the mouse way''. @end format @node Help-P, Help-^L, Help, Getting Started @@ -280,40 +272,40 @@ links. This node is called @samp{Help-P}. The @samp{Previous} node, as you see, is @samp{Help}, which is the one you just came from using the @kbd{n} command. Another @kbd{n} command now would take you to the next -node, @samp{Help-^L}. In Emacs, @kbd{n} runs the Emacs command -@code{Info-next}, and @kbd{p} runs @code{Info-prev}. +node, @samp{Help-^L}. @format ->> But do not type @kbd{n} yet. First, try the @kbd{p} command, - or click the mouse on the @samp{Prev} link, which takes you to the - @samp{Previous} node. When you get there, you can do an @kbd{n} - again to return here. +>> But do not type @kbd{n} yet. First, try the @kbd{p} command, or + (in Emacs) click the middle mouse button on the @samp{Prev} link. + That takes you to the @samp{Previous} node. Then use @kbd{n} to + return here. @end format If you read this in Emacs, you will see an @samp{Info} item in the -menu bar, close to its right edge. Clicking your mouse on the +menu bar, close to its right edge. Clicking the mouse on the @samp{Info} menu-bar item opens a menu of commands which include @samp{Next} and @samp{Prev} (and also some others which you didn't yet learn about). - This all probably seems insultingly simple so far, but @emph{do not} be -led into skimming. Things will get more complicated soon. Also, -do not try a new command until you are told it is time to. Otherwise, -you may make Info skip past an important warning that was coming up. + This all probably seems insultingly simple so far, but @emph{please +don't} start skimming. Things will get complicated soon enough! +Also, please do not try a new command until you are told it is time +to. You could make Info skip past an important warning that was +coming up. @format ->> Now do an @kbd{n}, or click the mouse on the @samp{Next} link, to - get to the node @samp{Help-^L} and learn more. +>> Now do an @kbd{n}, or (in Emacs) click the middle mouse button on + the @samp{Next} link, to get to the node @samp{Help-^L} and learn more. @end format -@node Help-^L, Help-M, Help-P, Getting Started +@node Help-^L, Help-Inv, Help-P, Getting Started @comment node-name, next, previous, up -@section The Space, DEL, B and ^L commands. +@section The Space, DEL, B and ^L commands - This node's mode line tells you that you are now at node @samp{Help-^L}, -and the header line tells you that @kbd{p} would get you back to -@samp{Help-P}. The node's title is underlined; it says what the node -is about (most nodes have titles). + This node's mode line tells you that you are now at node +@samp{Help-^L}, and the header line tells you that @kbd{p} would get +you back to @samp{Help-P}. The node's title is highlighted and may be +underlined as well; it says what the node is about. This is a big node and it does not all fit on your display screen. You can tell that there is more that is not visible because you @@ -336,9 +328,7 @@ allow you to ``move around'' in a node that does not all fit on the screen at once. @key{SPC} moves forward, to show what was below the bottom of the screen. @key{DEL} or @key{BACKSPACE} moves backward, to show what was above the top of the screen (there is not anything above -the top until you have typed some spaces). In Emacs, @key{SPC} runs -the command @code{Info-scroll-up}, while @key{BACKSPACE} runs -@code{Info-scroll-down}. +the top until you have typed some spaces). @format >> Now try typing a @key{SPC} (afterward, type a @key{BACKSPACE} to @@ -354,35 +344,38 @@ lines above them they may not make it all the way to the bottom. If you are reading this in Emacs, note that the header line is always visible, never scrolling off the display. That way, you can always see the @samp{Next}, @samp{Prev}, and @samp{Up} links, and you -can conveniently go to one of these links from anywhere in the node by -clicking the mouse on one of these links. +can conveniently go to one of these links at any time by +clicking the middle mouse button on the link. @cindex reading Info documents top to bottom @cindex Info documents as tutorials @key{SPC} and @key{DEL} not only move forward and backward through -the current node. When these keys hit the beginning or the end of the -current node, they move to preceding or subsequent nodes. -Specifically, they scroll through all the nodes in an Info file as a -single logical sequence. In this sequence, a node's subnodes appear -following their parent. If a node has a menu, @key{SPC} takes you -into the subnodes listed in the menu, one by one. Once you reach the -end of a node, and have seen all of its subnodes, @key{SPC} takes you -to the next node or to the parent's next node. This is so you could -read the entire manual top to bottom by just typing @key{SPC}. +the current node. They also move between nodes. @key{SPC} at the end +of a node moves to the next node; @key{DEL} (or @key{BACKSPACE}) at +the beginning of a node moves to the previous node. In effect, these +commands scroll through all the nodes in an Info file as a single +logical sequence. You can read an entire manual top to bottom by just +typing @key{SPC}, and move backward through the entire manual from +bottom to top by typing @key{DEL} (or @key{BACKSPACE}). + + In this sequence, a node's subnodes appear following their parent. +If a node has a menu, @key{SPC} takes you into the subnodes listed in +the menu, one by one. Once you reach the end of a node, and have seen +all of its subnodes, @key{SPC} takes you to the next node or to the +parent's next node. @kindex PAGEUP @r{(Info mode)} @kindex PAGEDOWN @r{(Info mode)} Many keyboards nowadays have two scroll keys labeled @samp{PageUp} and @samp{PageDown} (or maybe @samp{Prior} and @samp{Next}). If your keyboard has these keys, you can use them to move forward and backward -through the text, like with @key{SPC} and @key{BACKSPACE}. However, -unlike @key{SPC} and @key{BACKSPACE}, @key{PAGEUP} and @key{PAGEDOWN} -keys will never scroll beyond the beginning or the end of the current -node. +through the text of one node, like @key{SPC} and @key{BACKSPACE} (or +@key{DEL}). However, @key{PAGEUP} and @key{PAGEDOWN} keys never +scroll beyond the beginning or the end of the current node. @kindex C-l @r{(Info mode)} If your screen is ever garbaged, you can tell Info to display it -again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down +again by typing @kbd{C-l} (@kbd{Control-L}---that is, hold down @key{CTRL} and type @kbd{L} or @kbd{l}). @format @@ -391,18 +384,19 @@ again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down @kindex b @r{(Info mode)} To move back to the beginning of the node you are on, you can type -a lot of @key{BACKSPACE} keys. You can also type simply @kbd{b} for -beginning. +the @key{BACKSPACE} key (or @key{DEL}) many times. You can also type +@kbd{b} just once. @kbd{b} stands for ``beginning.'' @format >> Try that now. (We have put in enough verbiage to push this past the first screenful, but screens are so big nowadays that perhaps it isn't enough. You may need to shrink your Emacs or Info window.) - Then come back, with @key{SPS}s. + Then come back, by typing @key{SPC} one or more times. @end format - If your screen is very tall, all of this node might fit at once. -In that case, @kbd{b} won't do anything. Sorry; what can we do? + If your screen is very tall, all of this node might fit at once. In +that case, @kbd{b} won't do anything. But you could observe the +effect of the @kbd{b} key if you use a smaller window. @kindex ? @r{(Info mode)} @findex Info-summary @@ -414,14 +408,14 @@ the list, make it go away by typing a @key{SPC} repeatedly. @format >> Type a @key{?} now. Press @key{SPC} to see consecutive screenfuls of - the list until finished. Then type @key{SPC} several times, until - it goes away. + the list until finished. Then type @key{SPC} several times. If + you are using Emacs, the help will then go away automatically. @end format (If you are using the stand-alone Info reader, type @kbd{C-x 0} to return here, that is---press and hold @key{CTRL}, type an @kbd{x}, -then release @key{CTRL} and @kbd{x}, and press @kbd{0}---a zero, not -the letter ``o''.) +then release @key{CTRL} and @kbd{x}, and press @kbd{0}; that's a zero, +not the letter ``o''.) From now on, you will encounter large nodes without warning, and will be expected to know how to use @key{SPC} and @key{BACKSPACE} to @@ -429,43 +423,120 @@ move around in them without being told. Since not all terminals have the same size screen, it would be impossible to warn you anyway. @format ->> Now type @kbd{n}, or click the mouse on the @samp{Next} link, to - see the description of the @kbd{m} command. +>> Now type @kbd{n}, or click the middle mouse button on the @samp{Next} link, + to visit the next node. @end format -@node Help-M, Help-Xref, Help-^L, Getting Started +@node Help-Inv, Help-M, Help-^L, Getting Started +@comment node-name, next, previous, up +@section Invisible text in Emacs Info + + Before discussing menus, we need to make some remarks that are only +relevant to users reading Info using Emacs. Users of the stand-alone +version can skip this node by typing @kbd{]} now. + +@cindex invisible text in Emacs + In Emacs, certain text that appears in the stand-alone version is +normally hidden, technically because it has the @samp{invisibility} +property. Invisible text is really a part of the text. It becomes +visible (by default) after killing and yanking, it appears in printed +output, it gets saved to file just like any other text, and so on. +Thus it is useful to know it is there. + +@findex visible-mode +You can make invisible text visible by using the command @kbd{M-x +visible-mode}. Visible mode is a minor mode, so using the command a +second time will make the text invisible again. Watch the effects of +the command on the ``menu'' below and the top line of this node. + +If you prefer to @emph{always} see the invisible text, you can set +@code{Info-hide-note-references} to @code{nil}. Enabling Visible mode +permanently is not a real alternative, because Emacs Info also uses +(although less extensively) another text property that can change the +text being displayed, the @samp{display} property. Only the +invisibility property is affected by Visible mode. When, in this +tutorial, we refer to the @samp{Emacs} behavior, we mean the +@emph{default} Emacs behavior. + +Now type @kbd{]}, to learn about the @kbd{]} and @kbd{[} commands. + +@menu +* ]: Help-]. Node telling about ]. +* stuff: Help-]. Same node. +* Help-]:: Yet again, same node. +@end menu + +@node Help-], , , Help-Inv +@subsection The @kbd{]} and @kbd{[} commands + +If you type @kbd{n} now, you get an error message saying that this +node has no next node. Similarly, if you type @kbd{p}, the error +message tells you that there is no previous node. (The exact message +depends on the Info reader you use.) This is because @kbd{n} and +@kbd{p} carry you to the next and previous node @emph{at the same +level}. The present node is contained in a menu (see next) of the +node you came from, and hence is considered to be at a lower level. +It is the only node in the previous node's menu (even though it was +listed three times). Hence it has no next or previous node that +@kbd{n} or @kbd{p} could move to. + +If you systematically move through a manual by typing @kbd{n}, you run +the risk of skipping many nodes. You do not run this risk if you +systematically use @kbd{@key{SPC}}, because, when you scroll to the +bottom of a node and type another @kbd{@key{SPC}}, then this carries +you to the following node in the manual @emph{regardless of level}. +If you immediately want to go to that node, without having to scroll +to the bottom of the screen first, you can type @kbd{]}. + +Similarly, @kbd{@key{BACKSPACE}} carries you to the preceding node +regardless of level, after you scrolled to the beginning of the +present node. If you want to go to the preceding node immediately, +you can type @kbd{[}. + +For instance, typing this sequence will come back here in three steps: +@kbd{[ n [}. To do the same backward, type @kbd{] p ]}. + +Now type @kbd{]} to go to the next node and learn about menus. + +@node Help-M, Help-Xref, Help-Inv, Getting Started @comment node-name, next, previous, up @section Menus and the @kbd{m} command @cindex menus in an Info document @cindex Info menus - With only the @kbd{n} (next) and @kbd{p} (previous) commands for -moving between nodes, nodes are restricted to a linear sequence. -Menus allow a branching structure. A menu is a list of other nodes -you can move to. It is actually just part of the text of the node -formatted specially so that Info can interpret it. The beginning of a -menu is always identified by a line which starts with @samp{* Menu:}. -A node contains a menu if and only if it has a line in it which starts -that way. The only menu you can use at any moment is the one in the -node you are in. To use a menu in any other node, you must move to -that node first. + With only the @kbd{n} (next), @kbd{p} (previous), @kbd{@key{SPC}}, +@kbd{@key{BACKSPACE}}, @kbd{]} and @kbd{[} commands for moving between +nodes, nodes are restricted to a linear sequence. Menus allow a +branching structure. A menu is a list of other nodes you can move to. +It is actually just part of the text of the node formatted specially +so that Info can interpret it. The beginning of a menu is always +identified by a line which starts with @w{@samp{* Menu:}}. A node +contains a menu if and only if it has a line in it which starts that +way. The only menu you can use at any moment is the one in the node +you are in. To use a menu in any other node, you must move to that +node first. After the start of the menu, each line that starts with a @samp{*} -identifies one subtopic. The line usually contains a brief name -for the subtopic (followed by a @samp{:}), the name of the node that talks -about that subtopic, and optionally some further description of the +identifies one subtopic. The line usually contains a brief name for +the subtopic (followed by a @samp{:}, normally hidden in Emacs), the +name of the node that talks about that subtopic (again, normally +hidden in Emacs), and optionally some further description of the subtopic. Lines in the menu that do not start with a @samp{*} have no special meaning---they are only for the human reader's benefit and do not define additional subtopics. Here is an example: @example -* Foo: Node about FOO This tells about FOO +* Foo: Node about FOO. This tells about FOO. @end example The subtopic name is Foo, and the node describing it is @samp{Node about FOO}. The rest of the line is just for the reader's Information. [[ But this line is not a real menu item, simply because -there is no line above it which starts with @samp{* Menu:}.]] +there is no line above it which starts with @w{@samp{* Menu:}}. Also, +in a real menu item, the @samp{*} would appear at the very start of +the line. This is why the ``normally hidden'' text in Emacs, namely +@samp{: Node about FOO.}, is actually visible in this example, even +when Visible mode is off.]] When you use a menu to go to another node (in a way that will be described soon), what you specify is the subtopic name, the first @@ -479,12 +550,12 @@ and so both it and the subtopic name are the same. There is an abbreviation for this: @example -* Foo:: This tells about FOO +* Foo:: This tells about FOO. @end example @noindent This means that the subtopic name and node name are the same; they are -both @samp{Foo}. +both @samp{Foo}. (The @samp{::} is normally hidden in Emacs.) @format >> Now use @key{SPC} to find the menu in this node, then come back to @@ -494,26 +565,33 @@ both @samp{Foo}. @kbd{m} command is not available. @end format +If you keep typing @key{SPC} once the menu appears on the screen, it +will move to another node (the first one in the menu). If that +happens, type @key{BACKSPACE} to come back. + @kindex m @r{(Info mode)} - The command to go to one of the subnodes is @kbd{m}---but @emph{do -not do it yet!} Before you use @kbd{m}, you need to learn about -commands which prompt you for more input. So far, you have learned -several commands that do not need additional input; when you typed -one, Info processed it and was instantly ready for another command. -The @kbd{m} command is different: it is incomplete without the -@dfn{name of the subtopic}. Once you have typed @kbd{m}, Info tries -to read the subtopic name. - - Now look for the line containing many dashes near the bottom of the -screen. There is one more line beneath that one, but usually it is -blank. If it is empty, Info is ready for a command, such as @kbd{n} -or @kbd{b} or @key{SPC} or @kbd{m}. If that line contains text ending -in a colon, it means Info is trying to read more input for the last -command. At such times, commands do not work, because Info tries to -use them as the input it needs. You must either type your response and -finish the command you started, or type @kbd{Control-g} to cancel the -command. When you have done one of those things, the line becomes -blank again. + The command to go to one of the subnodes is @kbd{m}. This is very +different from the commands you have used: it is a command that +prompts you for more input. + + The Info commands you know do not need additional input; when you +type one of them, Info processes it instantly and then is ready for +another command. The @kbd{m} command is different: it needs to know +the @dfn{name of the subtopic}. Once you have typed @kbd{m}, Info +tries to read the subtopic name. + + Now, in the stand-alone Info, look for the line containing many +dashes near the bottom of the screen. (This is the stand-alone +equivalent for the mode line in Emacs.) There is one more line +beneath that one, but usually it is blank. (In Emacs, this is the +echo area.) When it is blank, Info is ready for a command, such as +@kbd{n} or @kbd{b} or @key{SPC} or @kbd{m}. If that line contains +text ending in a colon, it means Info is reading more input for the +last command. You can't type an Info command then, because Info is +trying to read input, not commands. You must either give the input +and finish the command you started, or type @kbd{Control-g} to cancel +the command. When you have done one of those things, the input entry +line becomes blank again. Then you can type Info commands again. @findex Info-menu The command to go to a subnode via a menu is @kbd{m}. After you type @@ -532,24 +610,27 @@ item name, except for one space where a space appears in the item in the menu. @cindex completion of Info node names - You can also use the @dfn{completion} feature to help enter the subtopic -name. If you type the @key{TAB} key after entering part of a name, it will -magically fill in more of the name---as much as follows uniquely from -what you have entered. + You can also use the @dfn{completion} feature to help enter the +subtopic name. If you type the @key{TAB} key after entering part of a +name, it will fill in more of the name---as much as Info can deduce +from the part you have entered. If you move the cursor to one of the menu subtopic lines, then you do not need to type the argument: you just type a @key{RET}, and it -stands for the subtopic of the line you are on. +stands for the subtopic of the line you are on. You can also click +the middle mouse button directly on the subtopic line to go there. Here is a menu to give you a chance to practice. This menu gives you three ways of going to one place, Help-FOO: @menu * Foo: Help-FOO. A node you can visit for fun. -* Bar: Help-FOO. Strange! two ways to get to the same place. +* Bar: Help-FOO. We have made two ways to get to the same place. * Help-FOO:: And yet another! @end menu +(Turn Visible mode on if you are using Emacs.) + @format >> Now type just an @kbd{m} and see what happens: @end format @@ -606,32 +687,25 @@ somewhere between the beginning @samp{*} and the colon @samp{:} which ends the subtopic's brief name. You will see the subtopic's name change its appearance (usually, its background color will change), and the shape of the mouse pointer will change if your platform supports -that. After a while, if you leave the mouse on that spot, a tooltip -will pop up saying ``Mouse-2: go to that node''. (If the tooltips are -turned off or unavailable, this message is displayed in the @dfn{echo -area}, the bottom screen line where you typed the menu subtopics in -response to the prompt.) @kbd{Mouse-2} is the second button of your -mouse counting from the left---the rightmost button for two-button -mice, the middle button for 3-button mice. So pressing @kbd{Mouse-2} -while the mouse pointer is on a menu subtopic goes to that subtopic. +that. After a while, if you leave the mouse on that spot, a small +window will pop up, saying ``Mouse-2: go to that node'', or the same +message may appear at the bottom of the screen. + + @kbd{Mouse-2} is the second button of your mouse counting from the +left---the middle button on a 3-button mouse. (On a 2-button mouse, +you may have to press both buttons together to ``press the middle +button''.) The message tells you pressing @kbd{Mouse-2} with the +current position of the mouse pointer (on subtopic in the menu) will +go to that subtopic. @findex Info-mouse-follow-nearest-node - More generally, @kbd{Mouse-2} in an Info buffer runs the Emacs -command @code{Info-mouse-follow-nearest-node}, which finds the nearest + More generally, @kbd{Mouse-2} in an Info buffer finds the nearest link to another node and goes there. For example, near a cross reference it acts like @kbd{f}, in a menu it acts like @kbd{m}, on the node's header line it acts like @kbd{n}, @kbd{p}, or @kbd{u}, etc. At end of the node's text @kbd{Mouse-2} moves to the next node, or up if there's no next node. - Here is another way to get to Help-FOO, a menu. You can ignore this -if you want, or else try it by typing @key{TAB} and then @key{RET}, or -clicking @kbd{Mouse-2} on it (but then please come back to here). - -@menu -* Help-FOO:: -@end menu - @format >> Type @kbd{n} to see more commands. @end format @@ -655,8 +729,8 @@ get back to where you were reading you have to type some @key{SPC}s. (Some Info readers, such as the one built into Emacs, put you at the same place where you were reading in @samp{Help-M}.) - Another way to go Up is to click on the @samp{Up} pointer shown in -the header line (provided that you have a mouse). + Another way to go Up is to click @kbd{Mouse-2} on the @samp{Up} +pointer shown in the header line (provided that you have a mouse). @format >> Now type @kbd{u} to move back up to @samp{Help-M}. @@ -670,7 +744,8 @@ the header line (provided that you have a mouse). In Info documentation, you will see many @dfn{cross references}. Cross references look like this: @xref{Help-Cross, Cross}. That text is a real, live cross reference, whose name is @samp{Cross} and which -points to the node named @samp{Help-Cross}. +points to the node named @samp{Help-Cross}. (The node name is hidden +in Emacs. Do @kbd{M-x visible-mode} to show or hide it.) @kindex f @r{(Info mode)} @findex Info-follow-reference @@ -713,6 +788,48 @@ to cancel the @kbd{f}. The @key{TAB} and @kbd{M-@key{TAB}} key, which move between menu items in a menu, also move between cross references outside of menus. + Sometimes a cross reference (or a node) can lead to another file (in +other words another ``manual''), or, on occasion, even a file on a +remote machine (although Info files distributed with Emacs or the +stand-alone Info avoid using remote links). Such a cross reference +looks like this: @xref{Top,, Overview of Texinfo, texinfo, Texinfo: +The GNU Documentation Format}. (After following this link, type +@kbd{l} to get back to this node.) Here the name @samp{texinfo} +between parentheses (shown in the stand-alone version) refers to the +file name. This file name appears in cross references and node names +if it differs from the current file. In Emacs, the file name is +hidden (along with other text). (Use @kbd{M-x visible-mode} to show +or hide it.) + + The remainder of this node applies only to the Emacs version. If +you use the stand-alone version, you can type @kbd{n} immediately. + + To some users, switching manuals is a much bigger switch than +switching sections. These users like to know that they are going to +be switching to another manual (and which one) before actually doing +so, especially given that, if one does not notice, Info commands like +@kbd{t} (see the next node) can have confusing results. + + If you put your mouse over the cross reference and if the cross +reference leads to a different manual, then the information appearing +in a separate box (tool tip) or in the echo area, will mention the +file the cross reference will carry you to (between parentheses). +This is also true for menu subtopic names. If you have a mouse, just +leave it over the @samp{Overview} cross reference above and watch what +happens. + + If you always like to have that information available without having +to move your mouse over the cross reference, set +@code{Info-hide-note-references} to a value other than t (@pxref{Emacs +Info Variables}). You might also want to do that if you have a lot of +cross references to files on remote machines and have non-permanent or +slow access, since otherwise you might not be able to distinguish +between local and remote links. + +@format +>> Now type @kbd{n} to learn more commands. +@end format + @node Help-Int, Help-Q, Help-Xref, Getting Started @comment node-name, next, previous, up @section Some intermediate Info commands @@ -720,12 +837,16 @@ items in a menu, also move between cross references outside of menus. The introductory course is almost over; please continue a little longer to learn some intermediate-level commands. - Most Info files have an index, which is actually a large node that -contains nothing but a menu. The menu has one menu item for each -topic listed in the index. You can find the index node from the main -menu of the file, with the @kbd{m} command; then you can use the -@kbd{m} command again in the index node to go to the node that -describes the topic. + Most Info files have an index, which is actually a large node +containing little but a menu. The menu has one menu item for each +topic listed in the index. (As a special feature, menus for indices +may also include the line number within the node of the index entry. +This allows Info readers to go to the exact line of an entry, not just +the start of the containing node.) + + You can get to the index from the main menu of the file with the +@kbd{m} command; then you can use the @kbd{m} command again in the +index node to go to the node that describes the topic you want. There is also a short-cut Info command, @kbd{i}, which does all of that for you. It searches the index for a given topic (a string) and @@ -742,23 +863,17 @@ records the nodes where you have been in a special history list. The @kbd{l} command revisits nodes in the history list; each successive @kbd{l} command moves one step back through the history. - If you have been following directions, ad @kbd{l} command now will get -you back to @samp{Help-M}. Another @kbd{l} command would undo the -@kbd{u} and get you back to @samp{Help-FOO}. Another @kbd{l} would undo -the @kbd{m} and get you back to @samp{Help-M}. - In Emacs, @kbd{l} runs the command @code{Info-last}. @format ->> Try typing three @kbd{l}'s, pausing in between to see what each - @kbd{l} does. Then follow directions again and you will end up - back here. +>> Try typing @kbd{p p n} and then three @kbd{l}'s, pausing in between +to see what each @kbd{l} does. You should wind up right back here. @end format Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to where @emph{you} last were, whereas @kbd{p} always moves to the node which the header says is the @samp{Previous} node (from this node, the -@samp{Prev} link leads to @samp{Help-M}). +@samp{Prev} link leads to @samp{Help-Xref}). @kindex d @r{(Info mode)} @findex Info-directory @@ -792,27 +907,28 @@ underlying text and the mouse pointer change in response. >> Now type @kbd{n} to see the last node of the course. @end format - @xref{Advanced Info}, for more advanced Info features. + @xref{Expert Info}, for more advanced Info features. @c If a menu appears at the end of this node, remove it. @c It is an accident of the menu updating command. -@node Advanced Info +@node Expert Info @chapter Info for Experts - This chapter describes various advanced Info commands. (If you are -using a stand-alone Info reader, there are additional commands + This chapter describes various Info commands for experts. (If you +are using a stand-alone Info reader, there are additional commands specific to it, which are documented in several chapters of @ref{Top,, GNU Info, info-stnd, GNU Info}.) This chapter also explains how to write an Info as distinct from a Texinfo file. (However, in most cases, writing a Texinfo file is -better, since you can use it @emph{both} to generate an Info file and -to make a printed manual. @xref{Top,, Overview of Texinfo, texinfo, -Texinfo: The GNU Documentation Format}.) +better, since you can use it to make a printed manual or produce other +formats, such as HTML and DocBook, as well as for generating Info +files.) @xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU +Documentation Format}. @menu -* Expert:: Advanced Info commands: g, s, e, and 1 - 5. +* Advanced:: Advanced Info commands: g, e, and 1 - 9. * Info Search:: How to search Info documents for specific subjects. * Add:: Describes how to add new nodes to the hierarchy. Also tells what nodes look like. @@ -823,13 +939,13 @@ Texinfo: The GNU Documentation Format}.) * Emacs Info Variables:: Variables modifying the behavior of Emacs Info. @end menu -@node Expert, Info Search, , Advanced Info +@node Advanced, Info Search, , Expert Info @comment node-name, next, previous, up @section Advanced Info Commands Here are some more Info commands that make it easier to move around. -@unnumberedsubsec @kbd{g} goes to a node by name +@subheading @kbd{g} goes to a node by name @kindex g @r{(Info mode)} @findex Info-goto-node @@ -837,7 +953,7 @@ Here are some more Info commands that make it easier to move around. If you know a node's name, you can go there by typing @kbd{g}, the name, and @key{RET}. Thus, @kbd{gTop@key{RET}} would go to the node called @samp{Top} in this file. (This is equivalent to @kbd{t}, see -@ref{Help-Int}.) @kbd{gExpert@key{RET}} would come back here. +@ref{Help-Int}.) @kbd{gAdvanced@key{RET}} would come back here. @kbd{g} in Emacs runs the command @code{Info-goto-node}. Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations. @@ -855,7 +971,7 @@ the node @samp{Top} in the Info file @file{dir}. Likewise, all of the current file by typing @kbd{g*@key{RET}} or all of any other file with @kbd{g(@var{filename})@key{RET}}. -@unnumberedsubsec @kbd{1} -- @kbd{9} choose a menu subtopic by its number +@subheading @kbd{1}--@kbd{9} choose a menu subtopic by its number @kindex 1 @r{through} 9 @r{(Info mode)} @findex Info-nth-menu-item @@ -869,17 +985,18 @@ In the stand-alone reader, @kbd{0} goes through the last menu item; this is so you need not count how many entries are there. In Emacs, the digit keys run the command @code{Info-nth-menu-item}. - If your display supports multiple fonts, and you are using Emacs' -Info mode to read Info files, the @samp{*} for the fifth menu item -stands out, either in color or in some other attribute, such as -underline, and so is the @samp{*} for the ninth item; this makes it -easy to see at a glance which number to use for an item. + If your display supports multiple fonts, colors or underlining, and +you are using Emacs' Info mode to read Info files, the third, sixth +and ninth menu items have a @samp{*} that stands out, either in color +or in some other attribute, such as underline; this makes it easy to +see at a glance which number to use for an item. - Some terminals don't support colors or underlining. If you need to -actually count items, it is better to use @kbd{m} instead, and specify -the name, or use @key{TAB} to quickly move between menu items. + Some terminals don't support either multiple fonts, colors or +underlining. If you need to actually count items, it is better to use +@kbd{m} instead, and specify the name, or use @key{TAB} to quickly +move between menu items. -@unnumberedsubsec @kbd{e} makes Info document editable +@subheading @kbd{e} makes Info document editable @kindex e @r{(Info mode)} @findex Info-edit @@ -894,7 +1011,24 @@ only if the variable @code{Info-enable-edit} is non-@code{nil}. edit the Info file, so typing @kbd{e} there goes to the end of the current node. -@node Info Search, Add, Expert, Advanced Info +@subheading @kbd{M-n} creates a new independent Info buffer in Emacs + +@kindex M-n @r{(Info mode)} +@findex clone-buffer +@cindex multiple Info buffers + If you are reading Info in Emacs, you can select a new independent +Info buffer in another window by typing @kbd{M-n}. The new buffer +starts out as an exact copy of the old one, but you will be able to +move independently between nodes in the two buffers. (In Info mode, +@kbd{M-n} runs the Emacs command @code{clone-buffer}.) + + In Emacs Info, you can also produce new Info buffers by giving a +numeric prefix argument to the @kbd{m} and @kbd{g} commands. @kbd{C-u +m} and @kbd{C-u g} go to a new node in exactly the same way that +@kbd{m} and @kbd{g} do, but they do so in a new Info buffer which they +select in another window. + +@node Info Search, Add, Advanced, Expert Info @comment node-name, next, previous, up @section How to search Info documents for specific subjects @@ -927,7 +1061,7 @@ you typed @emph{as a substring}. For each match, Info shows in the echo area the full index entry it found. Often, the text of the full index entry already gives you enough information to decide whether it is relevant to what you are looking for, so we recommend that you read -what Emacs shows in the echo are before looking at the node it +what Info shows in the echo area before looking at the node it displays. Since @kbd{i} looks for a substring, you can search for subjects even @@ -942,12 +1076,18 @@ options, and key sequences that the program provides. If you are looking for a description of a command, an option, or a key, just type their names when @kbd{i} prompts you for a topic. For example, if you want to read the description of what the @kbd{C-f} key does, type -@kbd{iC-f@key{RET}}. Here @kbd{C-f} are 3 literal characters +@kbd{i C - f @key{RET}}. Here @kbd{C-f} are 3 literal characters @samp{C}, @samp{-}, and @samp{f}, not the ``Control-f'' command key you type inside Emacs to run the command bound to @kbd{C-f}. In Emacs, @kbd{i} runs the command @code{Info-index}. +@findex info-apropos +If you don't know what manual documents something, try the @kbd{M-x +info-apropos} command. It prompts for a string and then looks up that +string in all the indices of all the Info documents installed on your +system. + @kindex s @r{(Info mode)} @findex Info-search The @kbd{s} command allows you to search a whole file for a string. @@ -970,7 +1110,7 @@ kind of search command. Both @kbd{s} and @kbd{M-s} run in Emacs the command @code{Info-search}. -@node Add, Menus, Info Search, Advanced Info +@node Add, Menus, Info Search, Expert Info @comment node-name, next, previous, up @section Adding a new node to Info @@ -985,8 +1125,11 @@ Put that topic in the menu in the directory. @xref{Menus, Menu}. Usually, the way to create the nodes is with Texinfo (@pxref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation Format}); -this has the advantage that you can also make a printed manual from -them. However, if you want to edit an Info file, here is how. +this has the advantage that you can also make a printed manual or HTML +from them. You would use the @samp{@@dircategory} and +@samp{@@direntry} commands to put the manual into the Info directory. +However, if you want to edit an Info file manually and install it +manually, here is how. @cindex node delimiters The new node can live in an existing documentation file, or in a new @@ -1000,12 +1143,11 @@ page boundary as well is to put a @samp{^L} @emph{right after} the @samp{^_}.} The @samp{^_} starting a node must be followed by a newline or a -@samp{^L} newline, after which comes the node's header line. The header -line must give the node's name (by which Info finds it), and state the -names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if there -are any). As you can see, this node's @samp{Up} node is the node -@samp{Top}, which points at all the documentation for Info. The -@samp{Next} node is @samp{Menus}. +@samp{^L} newline, after which comes the node's header line. The +header line must give the node's name (by which Info finds it), and +state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} +nodes (if there are any). As you can see, this node's @samp{Up} node +is the node @samp{Expert Info}. The @samp{Next} node is @samp{Menus}. @cindex node header line format @cindex format of node headers @@ -1051,7 +1193,7 @@ node is in the same file, it was not necessary to use one. line. The file names are ignored by Info, but they serve as comments to help identify the node for the user. -@node Menus, Cross-refs, Add, Advanced Info +@node Menus, Cross-refs, Add, Expert Info @comment node-name, next, previous, up @section How to Create Menus @@ -1060,15 +1202,15 @@ The @kbd{m} command searches the current node's menu for the topic which it reads from the terminal. @cindex menu and menu entry format - A menu begins with a line starting with @samp{* Menu:}. The rest of the -line is a comment. After the starting line, every line that begins -with a @samp{* } lists a single topic. The name of the topic--what -the user must type at the @kbd{m}'s command prompt to select this -topic---comes right after the star and space, and is followed by a -colon, spaces and tabs, and the name of the node which discusses that -topic. The node name, like node names following @samp{Next}, @samp{Previous} -and @samp{Up}, may be terminated with a tab, comma, or newline; it may also -be terminated with a period. + A menu begins with a line starting with @w{@samp{* Menu:}}. The +rest of the line is a comment. After the starting line, every line +that begins with a @samp{* } lists a single topic. The name of the +topic---what the user must type at the @kbd{m}'s command prompt to +select this topic---comes right after the star and space, and is +followed by a colon, spaces and tabs, and the name of the node which +discusses that topic. The node name, like node names following +@samp{Next}, @samp{Previous} and @samp{Up}, may be terminated with a +tab, comma, or newline; it may also be terminated with a period. If the node name and topic name are the same, then rather than giving the name twice, the abbreviation @samp{* @var{name}::} may be @@ -1107,7 +1249,7 @@ collector, nothing terrible happens if a substructure is not pointed to, but such a substructure is rather useless since nobody can ever find out that it exists. -@node Cross-refs, Tags, Menus, Advanced Info +@node Cross-refs, Tags, Menus, Expert Info @comment node-name, next, previous, up @section Creating Cross References @@ -1166,7 +1308,7 @@ as new users should do when they learn a new package. Another set of Info commands is useful when you need to find something quickly in a manual---that is, when you need to use a manual -as a reference rather than as a tutorial. We urge you to make learn +as a reference rather than as a tutorial. We urge you to learn these search commands as well. If you want to do that now, follow this cross reference to @ref{Info Search}. @@ -1182,7 +1324,7 @@ manner. @end format -@node Tags, Checking, Cross-refs, Advanced Info +@node Tags, Checking, Cross-refs, Expert Info @comment node-name, next, previous, up @section Tags Tables for Info Files @@ -1227,7 +1369,7 @@ a @samp{DEL} character, and the character position in the file of the beginning of the node. -@node Checking, Emacs Info Variables, Tags, Advanced Info +@node Checking, Emacs Info Variables, Tags, Expert Info @section Checking an Info File When creating an Info file, it is easy to forget the name of a node when @@ -1246,7 +1388,7 @@ usually few. To check an Info file, do @kbd{M-x Info-validate} while looking at any node of the file with Emacs Info mode. -@node Emacs Info Variables, , Checking, Advanced Info +@node Emacs Info Variables, , Checking, Expert Info @section Emacs Info-mode Variables The following variables may modify the behavior of Info-mode in Emacs; @@ -1276,10 +1418,10 @@ These directories are not searched for merging the @file{dir} file. @item Info-fontify When set to a non-@code{nil} value, enables highlighting of Info files. The default is @code{t}. You can change how the highlighting -looks by customizing the faces @code{info-node}, @code{info-menu-5}, -@code{info-xref}, @code{info-header-xref}, @code{info-header-node}, -@code{info-title-@var{n}-face} (where @var{n} is the level of the -section, a number between 1 and 4), and @code{info-menu-header}. To +looks by customizing the faces @code{info-node}, @code{info-xref}, +@code{info-header-xref}, @code{info-header-node}, @code{info-menu-5}, +@code{info-menu-header}, and @code{info-title-@var{n}-face} (where +@var{n} is the level of the section, a number between 1 and 4). To customize a face, type @kbd{M-x customize-face @key{RET} @var{face} @key{RET}}, where @var{face} is one of the face names listed here. @@ -1289,6 +1431,14 @@ the @samp{Next}, @samp{Prev}, and @samp{Up} links. A header line does not scroll with the rest of the buffer, making these links always visible. +@item Info-hide-note-references +As explained in earlier nodes, the Emacs version of Info normally +hides some text in menus and cross-references. You can completely +disable this feature, by setting this option to @code{nil}. Setting +it to a value that is neither @code{nil} nor @code{t} produces an +intermediate behavior, hiding a limited amount of text, but showing +all text that could potentially be useful. + @item Info-scroll-prefer-subnodes If set to a non-@code{nil} value, @key{SPC} and @key{BACKSPACE} (or @key{DEL}) keys in a menu visit subnodes of the current node before @@ -1297,7 +1447,7 @@ node's menu appears on the screen, the next @key{SPC} moves to a subnode indicated by the following menu item. Setting this option to @code{nil} results in behavior similar to the stand-alone Info reader program, which visits the first subnode from the menu only when you -hit the end of the current node. The default is @code{t}. +hit the end of the current node. The default is @code{nil}. @item Info-enable-active-nodes When set to a non-@code{nil} value, allows Info to execute Lisp code @@ -1342,3 +1492,7 @@ topics discussed in this document. @printindex cp @bye + +@ignore + arch-tag: 965c1638-01d6-4156-9227-b10418b9d8e8 +@end ignore diff --git a/gnu/usr.bin/texinfo/doc/infokey.1 b/gnu/usr.bin/texinfo/doc/infokey.1 index 6a9e9f27b14..8cbf7b354f7 100644 --- a/gnu/usr.bin/texinfo/doc/infokey.1 +++ b/gnu/usr.bin/texinfo/doc/infokey.1 @@ -227,3 +227,44 @@ Default binary file for customizations. .Xr info 1 .Sh BUGS bug-texinfo@gnu.org +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.34. +.TH INFOKEY "1" "December 2004" "infokey 4.8" "User Commands" +.SH NAME +infokey \- compile customizations for Info +.SH SYNOPSIS +.B infokey +[\fIOPTION\fR]... [\fIINPUT-FILE\fR] +.SH DESCRIPTION +Compile infokey source file to infokey file. Reads INPUT\-FILE (default +$HOME/.infokey) and writes compiled key file to (by default) $HOME/.info. +.SH OPTIONS +.TP +\fB\-\-output\fR FILE +output to FILE instead of $HOME/.info +.TP +\fB\-\-help\fR +display this help and exit. +.TP +\fB\-\-version\fR +display version information and exit. +.SH "REPORTING BUGS" +Email bug reports to bug\-texinfo@gnu.org, +general questions and discussion to help\-texinfo@gnu.org. +Texinfo home page: http://www.gnu.org/software/texinfo/ +.SH COPYRIGHT +Copyright \(co 2003 Free Software Foundation, Inc. +There is NO warranty. You may redistribute this software +under the terms of the GNU General Public License. +For more information about these matters, see the files named COPYING. +.SH "SEE ALSO" +The full documentation for +.B infokey +is maintained as a Texinfo manual. If the +.B info +and +.B infokey +programs are properly installed at your site, the command +.IP +.B info infokey +.PP +should give you access to the complete manual. diff --git a/gnu/usr.bin/texinfo/doc/texinfo.tex b/gnu/usr.bin/texinfo/doc/texinfo.tex index df62a127bb7..c93912a055b 100644 --- a/gnu/usr.bin/texinfo/doc/texinfo.tex +++ b/gnu/usr.bin/texinfo/doc/texinfo.tex @@ -3,10 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2002-03-26.08} +\def\texinfoversion{2004-11-25.16} % -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, -% 2000, 01, 02 Free Software Foundation, Inc. +% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software +% Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -23,24 +24,17 @@ % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % -% In other words, you are welcome to use, share and improve this program. -% You are forbidden to forbid anyone else to use, share and improve -% what you give them. Help stamp out software-hoarding! +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% ftp://ftp.gnu.org/gnu/texinfo.tex -% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) -% ftp://texinfo.org/texinfo/texinfo.tex +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex -% (and all CTAN mirrors, see http://www.ctan.org), -% and /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% -% The texinfo.tex in any given Texinfo distribution could well be out +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. -% -% Texinfo has a small home page at http://texinfo.org/ and also -% http://www.gnu.org/software/texinfo. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the @@ -58,8 +52,12 @@ % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % -% It is possible to adapt texinfo.tex for other languages. You can get -% the existing language-specific files from the full Texinfo distribution. +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + \message{Loading texinfo [version \texinfoversion]:} @@ -69,7 +67,14 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -% Save some parts of plain tex whose names we will redefine. +\message{Basics,} +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c @@ -79,23 +84,35 @@ \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ \let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert \let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ \let\ptexrbrace=\} +\let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t -% We never want plain's outer \+ definition in Texinfo. -% For @tex, we can use \tabalign. -\let\+ = \relax - -\message{Basics,} -\chardef\other=12 - % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi @@ -134,48 +151,111 @@ \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi -\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi + +% In some macros, we cannot use the `\? notation---the left quote is +% in some cases the escape char. +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\questChar = `\? +\chardef\semiChar = `\; +\chardef\underChar = `\_ + +\chardef\spaceChar = `\ % +\chardef\spacecat = 10 +\def\spaceisspace{\catcode\spaceChar=\spacecat} % Ignore a token. % \def\gobble#1{} -\hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{eshell} -\hyphenation{white-space} +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} % Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset -\newdimen \normaloffset +\newdimen\bindingoffset +\newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, -% since that produces some useless output on the terminal. +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\ifx\eTeXversion\undefined -\def\loggingall{\tracingcommands2 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \showboxbreadth\maxdimen\showboxdepth\maxdimen -}% -\else -\def\loggingall{\tracingcommands3 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \tracingscantokens1 \tracingassigns1 \tracingifs1 - \tracinggroups1 \tracingnesting2 - \showboxbreadth\maxdimen\showboxdepth\maxdimen +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\undefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 }% -\fi % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. -% +% \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount @@ -228,7 +308,7 @@ % the page break happens to be in the middle of an example. \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. - \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize @@ -276,7 +356,7 @@ \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox - }% end of group with \turnoffactive + }% end of group with \normalturnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } @@ -309,143 +389,162 @@ % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % -\def\parsearg#1{% - \let\next = #1% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\next{#2}% \begingroup \obeylines - \futurelet\temp\parseargx -} - -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. } -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% + \argremovecomment #1\comment\ArgTerm% }% } -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., % @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. -% -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. -% -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % We cannot use \next here, as it holds the macro to run; + % thus we reuse \temp. + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm } -% Change the active space to expand to nothing. +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \next. +% (Similarily, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. % -\begingroup +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment; press RETURN to continue} -\endgroup\fi} % This is not perfect, but it should reduce lossage +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as enviroments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Press RETURN to continue.} -\outer\def\begin{\parsearg\beginxxx} +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} -% @end foo executes the definition of \Efoo. -% -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname + \badenverr \fi } -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% +% Evironment mismatch, #1 expected: +\def\badenverr{% \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi } -% Define the control sequence \E#1 to give an unmatched @end error. +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv % -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi } +\newhelp\EMsimple{Press RETURN to continue.} -% Single-spacing is done by various environments (specifically, in -% \nonfillstart and \quotations). -\newskip\singlespaceskip \singlespaceskip = 12.5pt -\def\singlespace{% - % Why was this kern here? It messes up equalizing space above and below - % environments. --karl, 6may93 - %{\advance \baselineskip by -\singlespaceskip - %\kern \baselineskip}% - \setleading\singlespaceskip -} %% Simple single-character @ commands @@ -466,16 +565,22 @@ \let\{=\mylbrace \let\}=\myrbrace \begingroup - % Definitions to produce actual \{ & \} command in an index. - \catcode`\{ = 12 \catcode`\} = 12 + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux file. + \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 - \catcode`\@ = 0 \catcode`\\ = 12 - @gdef@lbracecmd[\{]% - @gdef@rbracecmd[\}]% -@endgroup + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent -% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} @@ -483,10 +588,12 @@ \let\ubaraccent = \b \let\udotaccent = \d -% Other special characters: @questiondown @exclamdown -% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} @@ -499,6 +606,25 @@ \fi\fi } +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and @@ -517,6 +643,9 @@ % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} +% @/ allows a line break. +\let\/=\allowbreak + % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } @@ -539,47 +668,24 @@ % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % -\def\group{\begingroup - \ifnum\catcode13=\active \else +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi + \startsavinginserts % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - \endgroup % End the \group. - }% - % - \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % + \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after @@ -589,6 +695,32 @@ \comment } % +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % @@ -601,10 +733,8 @@ where each line of input produces a line of output.} \newdimen\mil \mil=0.001in -\def\need{\parsearg\needx} - % Old definition--didn't work. -%\def\needx #1{\par % +%\parseargdef\need{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% @@ -612,7 +742,7 @@ where each line of input produces a line of output.} %\prevdepth=-1000pt %}} -\def\needx#1{% +\parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par @@ -651,37 +781,11 @@ where each line of input produces a line of output.} \fi } -% @br forces paragraph break +% @br forces paragraph break (and is undocumented). \let\br = \par -% @dots{} output an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in a typewriter -% font as three actual period characters. -% -\def\dots{% - \leavevmode - \hbox to 1.5em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% -} - -% @enddots{} is an end-of-sentence ellipsis. -% -\def\enddots{% - \leavevmode - \hbox to 2em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% - \spacefactor=3000 -} - - -% @page forces the start of a new page +% @page forces the start of a new page. % \def\page{\par\vfill\supereject} @@ -693,13 +797,11 @@ where each line of input produces a line of output.} \newskip\exdentamount % This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion @@ -730,10 +832,10 @@ where each line of input produces a line of output.} % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). -% +% \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. - \setbox0 = \hbox{\ignorespaces #2}% + \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% @@ -751,37 +853,71 @@ where each line of input produces a line of output.} } % @include file insert text of that file as input. -% Allow normal characters that we make active in the argument (a file name). -\def\include{\begingroup - \catcode`\\=12 - \catcode`~=12 - \catcode`^=12 - \catcode`_=12 - \catcode`|=12 - \catcode`<=12 - \catcode`>=12 - \catcode`+=12 - \parsearg\includezzz} -% Restore active chars for included file. -\def\includezzz#1{\endgroup\begingroup - % Read the included file in a group so nested @include's work. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack \def\thisfile{#1}% - \input\thisfile -\endgroup} + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other +} -\def\thisfile{} +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} -% @center line outputs that line, centered +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} -\def\center{\parsearg\centerzzz} -\def\centerzzz #1{{\advance\hsize by -\leftskip -\advance\hsize by -\rightskip -\centerline{#1}}} +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\vskip #1\baselineskip} +\parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment @@ -796,13 +932,13 @@ where each line of input produces a line of output.} % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. -% We cannot implement @paragraphindent asis, though. -% +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % -\def\paragraphindent{\parsearg\doparagraphindent} -\def\doparagraphindent#1{% +\parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -819,8 +955,7 @@ where each line of input produces a line of output.} % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. -\def\exampleindent{\parsearg\doexampleindent} -\def\doexampleindent#1{% +\parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -832,51 +967,138 @@ where each line of input produces a line of output.} \fi } +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. -% We don't use $'s directly in the definition of \math because we need -% to set catcodes according to plain TeX first, to allow for subscripts, -% superscripts, special math chars, etc. -% -% @math does not do math typesetting in section titles, index -% entries, and other such contexts where the catcodes are set before -% @math gets a chance to work. This could perhaps be fixed, but for now -% at least we can have real math in the main text, where it's needed most. -% -\let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make -% _ within @math be active (mathcode "8000), and distinguish by seeing -% if the current family is \slfam, which is what @var uses. -% -{\catcode95 = \active % 95 = _ -\gdef\mathunderscore{% - \catcode95=\active - \def_{\ifnum\fam=\slfam \_\else\sb\fi}% -}} -% +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode\underChar = \active + \gdef\mathunderscore{% + \catcode\underChar=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} % Another complication: we want \\ (and @\) to output a \ character. % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not % otherwise define @\. -% +% % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex - \mathcode`\_="8000 \mathunderscore + \mathunderscore \let\\ = \mathbackslash - \implicitmath\finishmath} -\def\finishmath#1{#1\implicitmath\Etex} + \mathactive + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + } +} % @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil + .\hfil.\hfil.% + \hskip 0pt plus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=3000 +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , % @refill is a no-op. \let\refill=\relax @@ -892,20 +1114,20 @@ where each line of input produces a line of output.} % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks - \readauxfile + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. - % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf - \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi - \closein1 - \temp + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 % \comment % Ignore the actual filename. } @@ -941,17 +1163,23 @@ where each line of input produces a line of output.} \newif\ifpdf \newif\ifpdfmakepagedest +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. \ifx\pdfoutput\undefined - \pdffalse - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\linkcolor = \relax - \let\pdfmakeoutlines = \relax \else - \pdftrue - \pdfoutput = 1 + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi +% +\ifpdf \input pdfcolor + \pdfcatalog{/PageMode /UseOutlines}% \def\dopdfimage#1#2#3{% \def\imagewidth{#2}% \def\imageheight{#3}% @@ -965,14 +1193,20 @@ where each line of input produces a line of output.} \ifx\empty\imagewidth\else width \imagewidth \fi \ifx\empty\imageheight\else height \imageheight \fi \ifnum\pdftexversion<13 - #1.pdf% + #1.pdf% \else {#1.pdf}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} - \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code in a section title + % aren't expanded. + \atdummies + \normalturnoffactive + \pdfdest name{#1} xyz% + }} \def\pdfmkpgn#1{#1} \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} @@ -981,49 +1215,94 @@ where each line of input produces a line of output.} \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax - \advance\tempnum by1 + \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} - \def\pdfmakeoutlines{{% - \openin 1 \jobname.toc - \ifeof 1\else\begingroup - \closein 1 - \indexnofonts - \def\tt{} - \let\_ = \normalunderscore - % Thanh's hack / proper braces in bookmarks + % + % #1 is the section text. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node + % text, which might be empty if this toc entry had no + % corresponding node. #4 is the page number. + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worthwhile, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % - \def\chapentry ##1##2##3{} - \let\appendixentry = \chapentry - \def\unnumbchapentry ##1##2{} - \def\secentry ##1##2##3##4{\advancenumber{chap##2}} - \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} - \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} - \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} - \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} - \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% \input \jobname.toc - \def\chapentry ##1##2##3{% - \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} - \let\appendixentry = \chapentry - \def\unnumbchapentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\secentry ##1##2##3##4{% - \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} - \def\unnumbsecentry ##1##2##3{% - \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} - \def\subsecentry ##1##2##3##4##5{% - \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} - \def\unnumbsubsecentry ##1##2##3##4{% - \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} - \def\subsubsecentry ##1##2##3##4##5##6{% - \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} - \def\unnumbsubsubsecentry ##1##2##3##4##5{% - \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. + \indexnofonts + \turnoffactive \input \jobname.toc - \endgroup\fi - }} + \endgroup + } + % \def\makelinks #1,{% \def\params{#1}\def\E{END}% \ifx\params\E @@ -1032,7 +1311,7 @@ where each line of input produces a line of output.} \let\nextmakelinks=\makelinks \ifnum\lnkcount>0,\fi \picknum{#1}% - \startlink attr{/Border [0 0 0]} + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{\the\pgn}}% \linkcolor #1% \advance\lnkcount by 1% @@ -1054,7 +1333,6 @@ where each line of input produces a line of output.} \def\ppn#1{\pgn=#1\gobble} \def\ppnn{\pgn=\first} \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces @@ -1072,22 +1350,21 @@ where each line of input produces a line of output.} \def\pdfurl#1{% \begingroup \normalturnoffactive\def\@{@}% - \let\value=\expandablevalue + \makevalueexpandable \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - % #1 \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS| + \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else @@ -1103,20 +1380,44 @@ where each line of input produces a line of output.} \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % \ifx\pdfoutput +\else + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput \message{fonts,} -% Font-change commands. + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. +% So we set up a \sf. \newfam\sffam -\def\sf{\fam=\sffam \tensf} +\def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. -% We don't need math for this one. -\def\ttsl{\tenttsl} +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} % Default leading. \newdimen\textleading \textleading = 13.2pt @@ -1167,20 +1468,11 @@ where each line of input produces a line of output.} \def\scshape{csc} \def\scbshape{csc} -\newcount\mainmagstep -\ifx\bigger\relax - % not really supported. - \let\mainmagstep=\magstep1 - \setfont\textrm\rmshape{12}{1000} - \setfont\texttt\ttshape{12}{1000} -\else - \mainmagstep=\magstephalf - \setfont\textrm\rmshape{10}{\mainmagstep} - \setfont\texttt\ttshape{10}{\mainmagstep} -\fi -% Instead of cmb10, you many want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10. +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep} +\setfont\texttt\ttshape{10}{\mainmagstep} \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} @@ -1190,12 +1482,14 @@ where each line of input produces a line of output.} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep -% A few fonts for @defun, etc. -\setfont\defbf\bxshape{10}{\magstep1} %was 1314 +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1} \setfont\deftt\ttshape{10}{\magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} +\setfont\defttsl\ttslshape{10}{\magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000} \setfont\smalltt\ttshape{9}{1000} \setfont\smallbf\bfshape{10}{900} @@ -1208,6 +1502,7 @@ where each line of input produces a line of output.} \font\smallsy=cmsy9 % Fonts for small examples (8pt). +\def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000} \setfont\smallertt\ttshape{8}{1000} \setfont\smallerbf\bfshape{10}{800} @@ -1219,7 +1514,8 @@ where each line of input produces a line of output.} \font\smalleri=cmmi8 \font\smallersy=cmsy8 -% Fonts for title page: +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} @@ -1231,8 +1527,10 @@ where each line of input produces a line of output.} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} +\def\authortt{\sectt} % Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} @@ -1245,6 +1543,7 @@ where each line of input produces a line of output.} \font\chapsy=cmsy10 scaled \magstep3 % Section fonts (14.4pt). +\def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1} \setfont\secit\itbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2} @@ -1257,6 +1556,7 @@ where each line of input produces a line of output.} \font\secsy=cmsy10 scaled \magstep2 % Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} @@ -1264,11 +1564,22 @@ where each line of input produces a line of output.} \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{\magstep1} +\setfont\ssecsc\scbshape{10}{1315} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000} +\setfont\reducedtt\ttshape{10}{1000} +\setfont\reducedbf\bfshape{10}{1000} +\setfont\reducedit\itshape{10}{1000} +\setfont\reducedsl\slshape{10}{1000} +\setfont\reducedsf\sfshape{10}{1000} +\setfont\reducedsc\scshape{10}{1000} +\setfont\reducedttsl\ttslshape{10}{1000} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since @@ -1283,56 +1594,104 @@ where each line of input produces a line of output.} } % The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam -% \tenbf}, for example. By redefining \tenbf, we obviate the need to -% redefine \bf itself. +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} -\let\smallexamplefonts = \smallerfonts + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% +% I wish the USA used A4 paper. +% --karl, 24jan03. + % Set up the default fonts, so we can use them for creating boxes. % -\textfonts +\textfonts \rm % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -1343,27 +1702,41 @@ where each line of input produces a line of output.} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bxshape{12}{1000} +\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000} +\setfont\shortconttt\ttshape{12}{1000} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} -\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} +\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} \let\i=\smartitalic +\let\slanted=\smartslanted \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic -\let\cite=\smartslanted +% @b, explicit bold. \def\b#1{{\bf #1}} \let\strong=\b +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. @@ -1371,11 +1744,21 @@ where each line of input produces a line of output.} \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\frenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + } +\catcode`@=\other + \def\t#1{% {\tt \rawbackslash \frenchspacing #1}% \null } -\let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} \setfont\keyrm\rmshape{8}{1000} \font\keysy=cmsy9 @@ -1416,7 +1799,7 @@ where each line of input produces a line of output.} \null } -% We *must* turn on hyphenation at `-' and `_' in \code. +% We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. @@ -1434,10 +1817,6 @@ where each line of input produces a line of output.} \catcode`\_=\active \let_\codeunder \codex } - % - % If we end up with any active - characters when handling the index, - % just treat them as a normal -. - \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} @@ -1461,8 +1840,7 @@ where each line of input produces a line of output.} % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). -\def\kbdinputstyle{\parsearg\kbdinputstylexxx} -\def\kbdinputstylexxx#1{% +\parseargdef\kbdinputstyle{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% @@ -1470,15 +1848,17 @@ where each line of input produces a line of output.} \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\arg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle option `\arg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} -% Default is kbdinputdistinct. (Too much of a hassle to call the macro, -% the catcodes are wrong for parsearg to work.) -\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} +% Default is `distinct.' +\kbdinputstyle distinct \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% @@ -1486,8 +1866,8 @@ where each line of input produces a line of output.} \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} -% For @url, @env, @command quotes seem unnecessary, so use \code. -\let\url=\code +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code \let\env=\code \let\command=\code @@ -1519,9 +1899,13 @@ where each line of input produces a line of output.} \endlink \endgroup} +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. -% +% %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} @@ -1560,12 +1944,101 @@ where each line of input produces a line of output.} \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font -% @acronym downcases the argument and prints in smallcaps. -\def\acronym#1{{\smallcaps \lowercase{#1}}} +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\frenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} -% @pounds{} is a sterling sign. +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% \def\pounds{{\it\$}} +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbold don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + \message{page headings,} @@ -1584,86 +2057,103 @@ where each line of input produces a line of output.} \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefonts\rm ##1} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% \iffinishedtitlepage\else - \finishtitlepage + \finishtitlepage \fi - \oldpage \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} + \page + \null + }% } \def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - % - % Need this before the \...aftertitlepage checks so that if they are - % in effect the toc pages will come out with page numbers. - \HEADINGSon - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi } \def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines + \let\tt=\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% } +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi +} + + %%% Set up page headings and footings. \let\thispage=\folio @@ -1673,7 +2163,7 @@ where each line of input produces a line of output.} \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make Tex use those variables +% Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -1687,32 +2177,27 @@ where each line of input produces a line of output.} % @evenfooting @thisfile|| % @oddfooting ||@thisfile -\def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} - -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume @@ -1721,9 +2206,8 @@ where each line of input produces a line of output.} \global\advance\vsize by -\baselineskip } -\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} -% -}% unbind the catcode of @. +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. @@ -1737,7 +2221,7 @@ where each line of input produces a line of output.} \def\headings #1 {\csname HEADINGS#1\endcsname} -\def\HEADINGSoff{ +\def\HEADINGSoff{% \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff @@ -1746,7 +2230,7 @@ where each line of input produces a line of output.} % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. -\def\HEADINGSdouble{ +\def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1758,7 +2242,7 @@ where each line of input produces a line of output.} % For single-sided printing, chapter title goes across top left of page, % page number on top right. -\def\HEADINGSsingle{ +\def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1805,12 +2289,11 @@ where each line of input produces a line of output.} % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} +\def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). +% Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in @@ -1822,7 +2305,7 @@ where each line of input produces a line of output.} % used internally for \itemindent minus \itemmargin \newdimen\itemmax -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). @@ -1834,22 +2317,10 @@ where each line of input produces a line of output.} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% + \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % @@ -1873,10 +2344,14 @@ where each line of input produces a line of output.} % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % - % Stop a page break at the \parskip glue coming up. Unfortunately - % we can't prevent a possible page break at the following - % \baselineskip glue. - \nobreak + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else @@ -1895,97 +2370,106 @@ where each line of input produces a line of output.} \fi } -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -% Contains a kludge to get @end[description] to work. -\def\description{\tablez{\dontindex}{1}{}{}{}{}} +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Necessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley } +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno -\def\itemize{\parsearg\itemizezzz} +\envdef\itemize{\parsearg\doitemize} -\def\itemizezzz #1{% - \begingroup % ended by the @end itemize - \itemizey {#1}{\Eitemize} +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=\itemizeitem } -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} - -% Set sfcode to normal for the chars that usually have another value. -% These are `.?!:;,' -\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 - \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. @@ -1996,11 +2480,8 @@ where each line of input produces a line of output.} % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi @@ -2071,13 +2552,13 @@ where each line of input produces a line of output.} }% } -% Call itemizey, adding a period to the first argument and supplying the +% Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr + \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg @@ -2088,16 +2569,6 @@ where each line of input produces a line of output.} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{In hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 @@ -2124,24 +2595,14 @@ where each line of input produces a line of output.} % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. -% -% For those who want to use more than one line's worth of words in -% the preamble, break the line within one argument and it -% will parse correctly, i.e., -% -% @multitable {Column 1 template} {Column 2 template} {Column 3 -% template} -% Not: -% @multitable {Column 1 template} {Column 2 template} -% {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. -% @item, @tab, @multitable or @end multitable do not need to be on their -% own lines, but it will not hurt if they are. +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. % Sample multitable: @@ -2185,13 +2646,12 @@ where each line of input produces a line of output.} \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -% #1 is the part of the @columnfraction before the decimal point, which -% is presumably either 0 or the empty string (but we don't check, we -% just throw it away). #2 is the decimal part, which we use as the -% percent of \hsize for this column. -\def\pickupwholefraction#1.#2 {% +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% \global\advance\colcount by 1 - \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } @@ -2208,8 +2668,8 @@ where each line of input produces a line of output.} \let\go\pickupwholefraction \else \global\advance\colcount by 1 - \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; - % typically that is always in the input, anyway. + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi @@ -2224,18 +2684,33 @@ where each line of input produces a line of output.} \go } -% This used to have \hskip1sp. But then the space in a template line is -% not enough. That is bad. So let's go back to just & until we -% encounter the problem it was intended to solve again. -% --karl, nathan@acm.org, 20apr99. -\def\tab{&} +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % -\def\multitable{\parsearg\dotable} -\def\dotable#1{\bgroup +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% \vskip\parskip - \let\item\crcr + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % \tolerance=9500 \hbadness=9500 \setmultitablespacing @@ -2243,81 +2718,93 @@ where each line of input produces a line of output.} \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 - \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - \everycr{\noalign{% - % - % \filbreak%% keeps underfull box messages off when table breaks over pages. - % Maybe so, but it also creates really weird page breaks when the table - % breaks over pages. Wouldn't \vfil be better? Wait until the problem - % manifests itself, so it can be fixed for real --karl. - \global\colcount=0\relax}}% - % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax - \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. - \rightskip=0pt - \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip - \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace - \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively marking - % characters. - \noindent\ignorespaces##\unskip\multistrut}\cr -} - -\def\setmultitablespacing{% test to see if user has set \multitablelinespace. -% If so, do nothing. If not, give it an appropriate dimension based on -% current baselineskip. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 -%% strut to put in table in case some entry doesn't have descenders, -%% to keep lines equally spaced -\let\multistrut = \strut -\else -%% FIXME: what is \box0 supposed to be? -\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 -width0pt\relax} \fi +\fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. @@ -2334,294 +2821,172 @@ width0pt\relax} \fi \message{conditionals,} -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% - \let\chapter=\relax - \let\unnumbered=\relax - \let\top=\relax - \let\unnumberedsec=\relax - \let\unnumberedsection=\relax - \let\unnumberedsubsec=\relax - \let\unnumberedsubsection=\relax - \let\unnumberedsubsubsec=\relax - \let\unnumberedsubsubsection=\relax - \let\section=\relax - \let\subsec=\relax - \let\subsubsec=\relax - \let\subsection=\relax - \let\subsubsection=\relax - \let\appendix=\relax - \let\appendixsec=\relax - \let\appendixsection=\relax - \let\appendixsubsec=\relax - \let\appendixsubsection=\relax - \let\appendixsubsubsec=\relax - \let\appendixsubsubsection=\relax - \let\contents=\relax - \let\smallbook=\relax - \let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -\def\ignoremorecommands{% - \let\defcodeindex = \relax - \let\defcv = \relax - \let\deffn = \relax - \let\deffnx = \relax - \let\defindex = \relax - \let\defivar = \relax - \let\defmac = \relax - \let\defmethod = \relax - \let\defop = \relax - \let\defopt = \relax - \let\defspec = \relax - \let\deftp = \relax - \let\deftypefn = \relax - \let\deftypefun = \relax - \let\deftypeivar = \relax - \let\deftypeop = \relax - \let\deftypevar = \relax - \let\deftypevr = \relax - \let\defun = \relax - \let\defvar = \relax - \let\defvr = \relax - \let\ref = \relax - \let\xref = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\settitle = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\everyheading = \relax - \let\evenheading = \relax - \let\oddheading = \relax - \let\everyfooting = \relax - \let\evenfooting = \relax - \let\oddfooting = \relax - \let\headings = \relax - \let\include = \relax - \let\lowersections = \relax - \let\down = \relax - \let\raisesections = \relax - \let\up = \relax - \let\set = \relax - \let\clear = \relax - \let\item = \relax -} - -% Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, -% @direntry, and @documentdescription. + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. % -\def\ignore{\doignore{ignore}} +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} -\def\ifplaintext{\doignore{ifplaintext}} \def\ifnottex{\doignore{ifnottex}} -\def\html{\doignore{html}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} -\def\direntry{\doignore{direntry}} -\def\documentdescription{\doignore{documentdescription}} -\def\documentdescriptionword{documentdescription} +\def\xml{\doignore{xml}} -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory = \comment - -% Ignore text until a line `@end #1'. +% Ignore text until a line `@end #1', keeping track of nested conditionals. % +% A count to remember the depth of nesting. +\newcount\doignorecount + \def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - % This @ is a catcode 12 token (that is the normal catcode of @ in - % this texinfo.tex file). We change the catcode of @ below to match. - \long\def\doignoretext##1@end #1{\enddoignore}% + % Scan in ``verbatim'' mode: + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode32 = 10 + \spaceisspace % - % Ignore braces, too, so mismatched braces don't cause trouble. - \catcode`\{ = 9 - \catcode`\} = 9 + % Count number of #1's that we've seen. + \doignorecount = 0 % - % We must not have @c interpreted as a control sequence. - \catcode`\@ = 12 - % - \def\ignoreword{#1}% - \ifx\ignoreword\documentdescriptionword - % The c kludge breaks documentdescription, since - % `documentdescription' contains a `c'. Means not everything will - % be ignored inside @documentdescription, but oh well... - \else - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 - \fi - % - % And now expand the command defined above. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{WARNING: for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% } -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the change of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook: make the current font be a dummy font. +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because not all sites - % might have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. % - \nullfont - \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont - \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont - \let\tensf=\nullfont - % Similarly for index fonts. - \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont - \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont - \let\smallsf=\nullfont - % Similarly for smallexample fonts. - \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont - \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont - \let\smallersf=\nullfont + % Define a command to find the next `@end #1', which must be on a line + % by itself. + \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}% + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex - \def\tex{\doignore{tex}}% - % Do not execute macro definitions. - % `c' is a comment character, so the word `macro' will get cut off. - \def\macro{\doignore{ma}}% + % And now expand that command. + \obeylines % + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. } +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +\def\enddoignore{\endgroup\ignorespaces} + + % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we -% didn't need it. Make sure the catcode of space is correct to avoid -% losing inside @example, for instance. +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. % -\def\set{\begingroup\catcode` =10 - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} +\parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - \endgroup + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% } -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} % @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} { - \catcode`\_ = \active + \catcode`\- = \active \catcode`\_ = \active % - % We might end up with active _ or - characters in the argument if - % we're called from @code, as @code{@value{foo-bar_}}. So \let any - % such active characters to their normal equivalents. - \gdef\value{\begingroup - \catcode`\-=12 \catcode`\_=12 - \indexbreaks \let_\normalunderscore - \valuexxx} + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } } -\def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's -% properly in indexes (we \let\value to this in \indexdummies). Ones -% whose names contain - or _ still won't work, but we can't do anything -% about that. The command has to be fully expandable, since the result -% winds up in the index file. This means that if the variable's value -% contains other Texinfo commands, it's almost certain it will fail -% (although perhaps we could fix that with sufficient work to do a -% one-level expansion on the result, instead of complete). +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi @@ -2630,68 +2995,36 @@ width0pt\relax} \fi % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % -\def\ifset{\parsearg\ifsetxxx} -\def\ifsetxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifsetfail - \else - \expandafter\ifsetsucceed - \fi +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next } -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} +\def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % -\def\ifclear{\parsearg\ifclearxxx} -\def\ifclearxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifclearsucceed - \else - \expandafter\ifclearfail - \fi -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we -% read the text following, through the first @end iftex (etc.). Make -% `@end iftex' (etc.) valid only after an @iftex. -% -\def\iftex{\conditionalsucceed{iftex}} -\def\ifnothtml{\conditionalsucceed{ifnothtml}} -\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} -\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} -\defineunmatchedend{iftex} -\defineunmatchedend{ifnothtml} -\defineunmatchedend{ifnotinfo} -\defineunmatchedend{ifnotplaintext} - -% We can't just want to start a group at @iftex (etc.) and end it at -% @end iftex, since then @set commands inside the conditional have no -% effect (they'd get reverted at the end of the group). So we must -% define \Eiftex to redefine itself to be its previous value. (We can't -% just define it to fail again with an ``unmatched end'' error, since -% the @ifset might be nested.) -% -\def\conditionalsucceed#1{% - \edef\temp{% - % Remember the current value of \E#1. - \let\nece{prevE#1} = \nece{E#1}% - % - % At the `@end #1', redefine \E#1 to be its previous value. - \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% - }% - \temp -} - -% We need to expand lots of \csname's, but we don't want to expand the -% control sequences after we've constructed them. +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. % -\def\nece#1{\expandafter\noexpand\csname#1\endcsname} +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment @@ -2701,9 +3034,8 @@ width0pt\relax} \fi % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite -% except not \outer, so it can be used within \newindex. -{\catcode`\@=11 -\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that @@ -2742,10 +3074,10 @@ width0pt\relax} \fi % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -% +% % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -% +% \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} @@ -2784,284 +3116,404 @@ width0pt\relax} \fi \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} -% Take care of texinfo commands likely to appear in an index entry. -% (Must be a way to avoid doing expansion at all, and thus not have to -% laboriously list every single command here.) -% +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% \def\indexdummies{% -\def\ { }% -\def\@{@}% change to @@ when we switch to @ as escape char in aux files. -% Need these in case \tex is in effect and \{ is a \delimiter again. -% But can't use \lbracecmd and \rbracecmd because texindex assumes -% braces and backslashes are used only as delimiters. -\let\{ = \mylbrace -\let\} = \myrbrace -\def\_{{\realbackslash _}}% -\normalturnoffactive -% -% Take care of the plain tex accent commands. -\def\,##1{\realbackslash ,{##1}}% -\def\"{\realbackslash "}% -\def\`{\realbackslash `}% -\def\'{\realbackslash '}% -\def\^{\realbackslash ^}% -\def\~{\realbackslash ~}% -\def\={\realbackslash =}% -\def\b{\realbackslash b}% -\def\c{\realbackslash c}% -\def\d{\realbackslash d}% -\def\u{\realbackslash u}% -\def\v{\realbackslash v}% -\def\H{\realbackslash H}% -\def\dotless##1{\realbackslash dotless {##1}}% -% Take care of the plain tex special European modified letters. -\def\AA{\realbackslash AA}% -\def\AE{\realbackslash AE}% -\def\L{\realbackslash L}% -\def\OE{\realbackslash OE}% -\def\O{\realbackslash O}% -\def\aa{\realbackslash aa}% -\def\ae{\realbackslash ae}% -\def\l{\realbackslash l}% -\def\oe{\realbackslash oe}% -\def\o{\realbackslash o}% -\def\ss{\realbackslash ss}% -% -% Although these internals commands shouldn't show up, sometimes they do. -\def\bf{\realbackslash bf }% -\def\gtr{\realbackslash gtr}% -\def\hat{\realbackslash hat}% -\def\less{\realbackslash less}% -%\def\rm{\realbackslash rm }% -\def\sf{\realbackslash sf}% -\def\sl{\realbackslash sl }% -\def\tclose##1{\realbackslash tclose {##1}}% -\def\tt{\realbackslash tt}% -% -\def\b##1{\realbackslash b {##1}}% -\def\i##1{\realbackslash i {##1}}% -\def\sc##1{\realbackslash sc {##1}}% -\def\t##1{\realbackslash t {##1}}% -\def\r##1{\realbackslash r {##1}}% -% -\def\TeX{\realbackslash TeX}% -\def\acronym##1{\realbackslash acronym {##1}}% -\def\cite##1{\realbackslash cite {##1}}% -\def\code##1{\realbackslash code {##1}}% -\def\command##1{\realbackslash command {##1}}% -\def\dfn##1{\realbackslash dfn {##1}}% -\def\dots{\realbackslash dots }% -\def\emph##1{\realbackslash emph {##1}}% -\def\env##1{\realbackslash env {##1}}% -\def\file##1{\realbackslash file {##1}}% -\def\kbd##1{\realbackslash kbd {##1}}% -\def\key##1{\realbackslash key {##1}}% -\def\math##1{\realbackslash math {##1}}% -\def\option##1{\realbackslash option {##1}}% -\def\samp##1{\realbackslash samp {##1}}% -\def\strong##1{\realbackslash strong {##1}}% -\def\uref##1{\realbackslash uref {##1}}% -\def\url##1{\realbackslash url {##1}}% -\def\var##1{\realbackslash var {##1}}% -\def\w{\realbackslash w }% -% -% These math commands don't seem likely to be used in index entries. -\def\copyright{\realbackslash copyright}% -\def\equiv{\realbackslash equiv}% -\def\error{\realbackslash error}% -\def\expansion{\realbackslash expansion}% -\def\point{\realbackslash point}% -\def\print{\realbackslash print}% -\def\result{\realbackslash result}% -% -% Handle some cases of @value -- where the variable name does not -% contain - or _, and the value does not contain any -% (non-fully-expandable) commands. -\let\value = \expandablevalue -% -\unsepspaces -% Turn off macro expansion -\turnoffmacros -} - -% If an index command is used in an @example environment, any spaces -% therein should become regular spaces in the raw index file, not the -% expansion of \tie (\leavevmode \penalty \@M \ ). -{\obeyspaces - \gdef\unsepspaces{\obeyspaces\let =\space}} - -% \indexnofonts no-ops all font-change commands. -% This is used when outputting the strings to sort the index by. -\def\indexdummyfont#1{#1} -\def\indexdummytex{TeX} -\def\indexdummydots{...} + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ = \mylbrace + \let\} = \myrbrace + % + % \definedummyword defines \#1 as \realbackslash #1\space, thus + % effectively preventing its expansion. This is used only for control + % words, not control letters, because the \space would be incorrect + % for control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword##1{% + \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% + }% + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% + }% + \let\definedummyaccent\definedummyletter + % + % Do the redefinitions. + \commondummies +} + +% For the aux file, @ is the escape character. So we want to redefine +% everything using @ instead of \realbackslash. When everything uses +% @, this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % (See comments in \indexdummies.) + \def\definedummyword##1{% + \expandafter\def\csname ##1\endcsname{@##1\space}% + }% + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{@##1}% + }% + \let\definedummyaccent\definedummyletter + % + % Do the redefinitions. + \commondummies +} + +% Called from \indexdummies and \atdummies. \definedummyword and +% \definedummyletter must be defined first. +% +\def\commondummies{% + % + \normalturnoffactive + % + \commondummiesnofonts + % + \definedummyletter{_}% + % + % Non-English letters. + \definedummyword{AA}% + \definedummyword{AE}% + \definedummyword{L}% + \definedummyword{OE}% + \definedummyword{O}% + \definedummyword{aa}% + \definedummyword{ae}% + \definedummyword{l}% + \definedummyword{oe}% + \definedummyword{o}% + \definedummyword{ss}% + \definedummyword{exclamdown}% + \definedummyword{questiondown}% + \definedummyword{ordf}% + \definedummyword{ordm}% + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword{bf}% + \definedummyword{gtr}% + \definedummyword{hat}% + \definedummyword{less}% + \definedummyword{sf}% + \definedummyword{sl}% + \definedummyword{tclose}% + \definedummyword{tt}% + % + \definedummyword{LaTeX}% + \definedummyword{TeX}% + % + % Assorted special characters. + \definedummyword{bullet}% + \definedummyword{comma}% + \definedummyword{copyright}% + \definedummyword{registeredsymbol}% + \definedummyword{dots}% + \definedummyword{enddots}% + \definedummyword{equiv}% + \definedummyword{error}% + \definedummyword{euro}% + \definedummyword{expansion}% + \definedummyword{minus}% + \definedummyword{pounds}% + \definedummyword{point}% + \definedummyword{print}% + \definedummyword{result}% + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable + % + % Normal spaces, not active ones. + \unsepspaces + % + % No macro expansion. + \turnoffmacros +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +% Better have this without active chars. +{ + \catcode`\~=\other + \gdef\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter{!}% + \definedummyaccent{"}% + \definedummyaccent{'}% + \definedummyletter{*}% + \definedummyaccent{,}% + \definedummyletter{.}% + \definedummyletter{/}% + \definedummyletter{:}% + \definedummyaccent{=}% + \definedummyletter{?}% + \definedummyaccent{^}% + \definedummyaccent{`}% + \definedummyaccent{~}% + \definedummyword{u}% + \definedummyword{v}% + \definedummyword{H}% + \definedummyword{dotaccent}% + \definedummyword{ringaccent}% + \definedummyword{tieaccent}% + \definedummyword{ubaraccent}% + \definedummyword{udotaccent}% + \definedummyword{dotless}% + % + % Texinfo font commands. + \definedummyword{b}% + \definedummyword{i}% + \definedummyword{r}% + \definedummyword{sc}% + \definedummyword{t}% + % + % Commands that take arguments. + \definedummyword{acronym}% + \definedummyword{cite}% + \definedummyword{code}% + \definedummyword{command}% + \definedummyword{dfn}% + \definedummyword{emph}% + \definedummyword{env}% + \definedummyword{file}% + \definedummyword{kbd}% + \definedummyword{key}% + \definedummyword{math}% + \definedummyword{option}% + \definedummyword{samp}% + \definedummyword{strong}% + \definedummyword{tie}% + \definedummyword{uref}% + \definedummyword{url}% + \definedummyword{var}% + \definedummyword{verb}% + \definedummyword{w}% + } +} +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% \def\indexnofonts{% -\def\@{@}% -% how to handle braces? -\def\_{\normalunderscore}% -% -\let\,=\indexdummyfont -\let\"=\indexdummyfont -\let\`=\indexdummyfont -\let\'=\indexdummyfont -\let\^=\indexdummyfont -\let\~=\indexdummyfont -\let\==\indexdummyfont -\let\b=\indexdummyfont -\let\c=\indexdummyfont -\let\d=\indexdummyfont -\let\u=\indexdummyfont -\let\v=\indexdummyfont -\let\H=\indexdummyfont -\let\dotless=\indexdummyfont -% Take care of the plain tex special European modified letters. -\def\AA{AA}% -\def\AE{AE}% -\def\L{L}% -\def\OE{OE}% -\def\O{O}% -\def\aa{aa}% -\def\ae{ae}% -\def\l{l}% -\def\oe{oe}% -\def\o{o}% -\def\ss{ss}% -% -% Don't no-op \tt, since it isn't a user-level command -% and is used in the definitions of the active chars like <, >, |, etc. -% Likewise with the other plain tex font commands. -%\let\tt=\indexdummyfont -% -\let\b=\indexdummyfont -\let\i=\indexdummyfont -\let\r=\indexdummyfont -\let\sc=\indexdummyfont -\let\t=\indexdummyfont -% -\let\TeX=\indexdummytex -\let\acronym=\indexdummyfont -\let\cite=\indexdummyfont -\let\code=\indexdummyfont -\let\command=\indexdummyfont -\let\dfn=\indexdummyfont -\let\dots=\indexdummydots -\let\emph=\indexdummyfont -\let\env=\indexdummyfont -\let\file=\indexdummyfont -\let\kbd=\indexdummyfont -\let\key=\indexdummyfont -\let\math=\indexdummyfont -\let\option=\indexdummyfont -\let\samp=\indexdummyfont -\let\strong=\indexdummyfont -\let\uref=\indexdummyfont -\let\url=\indexdummyfont -\let\var=\indexdummyfont -\let\w=\indexdummyfont -} - -% To define \realbackslash, we must make \ not be an escape. -% We must first make another character (@) an escape -% so we do not become unable to do a definition. - -{\catcode`\@=0 \catcode`\\=\other - @gdef@realbackslash{\}} + % Accent commands should become @asis. + \def\definedummyaccent##1{% + \expandafter\let\csname ##1\endcsname\asis + }% + % We can just ignore other control letters. + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{}% + }% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + % how to handle braces? + \def\_{\normalunderscore}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% + \def\l{l}% + \def\oe{oe}% + \def\o{o}% + \def\ss{ss}% + \def\exclamdown{!}% + \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\result{=>}% + % + % Don't write macro names. + \emptyusermacros +} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? -% For \ifx comparisons. -\def\emptymacro{\empty} - % Most index entries go through here, but \dosubind is the general case. -% -\def\doind#1#2{\dosubind{#1}{#2}\empty} +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% \empty if called from \doind, as we usually are. The main exception -% is with defuns, which call us directly. +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). % \def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \ifvmode + \dosubindsanitize + \else + \dosubindwrite + \fi + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi - {% - \count255=\lastpenalty - {% - \indexdummies % Must do this here, since \bf, etc expand at this stage - \escapechar=`\\ - {% - \let\folio = 0% We will expand all macros now EXCEPT \folio. - \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - \def\thirdarg{#3}% - % - % If third arg is present, precede it with space in sort key. - \ifx\thirdarg\emptymacro - \let\subentry = \empty - \else - \def\subentry{ #3}% - \fi - % - % First process the index entry with all font commands turned - % off to get the string to sort by. - {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% - % - % Now the real index entry with the fonts. - \toks0 = {#2}% - % - % If the third (subentry) arg is present, add it to the index - % line to write. - \ifx\thirdarg\emptymacro \else - \toks0 = \expandafter{\the\toks0{#3}}% - \fi - % - % Set up the complete index entry, with both the sort key and - % the original text, including any font commands. We write - % three arguments to \entry to the .?? file (four in the - % subentry case), texindex reduces to two when writing the .??s - % sorted result. - \edef\temp{% - \write\csname#1indfile\endcsname{% - \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% - }% - % - % If a skip is the last thing on the list now, preserve it - % by backing up by \lastskip, doing the \write, then inserting - % the skip again. Otherwise, the whatsit generated by the - % \write will make \lastskip zero. The result is that sequences - % like this: - % @end defun - % @tindex whatever - % @defun ... - % will have extra space inserted, because the \medbreak in the - % start of the @defun won't see the skip inserted by the @end of - % the previous defun. - % - % But don't do any of this if we're not in vertical mode. We - % don't want to do a \vskip and prematurely end a paragraph. - % - % Avoid page breaks due to these extra skips, too. - % - \iflinks - \ifvmode - \skip0 = \lastskip - \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi - \fi - % - \temp % do the write - % - % - \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi - \fi - }% - }% - \penalty\count255 + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% + \temp +} + +% Take care of unwanted page breaks: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write will make \lastskip zero. The result is that sequences +% like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +% ..., ready, GO: +% +\def\dosubindsanitize{% + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \skip0 = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \count255 = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\skip0 glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\skip0 + \fi + % + \dosubindwrite + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\count255>9999 \penalty\count255 \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\skip0 + \fi } % The index entry written in the file actually looks like @@ -3099,13 +3551,12 @@ width0pt\relax} \fi % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % -\def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{\begingroup +\parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 - \indexbreaks + \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains @@ -3132,7 +3583,7 @@ width0pt\relax} \fi % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\rawbackslashxx}% + \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns @@ -3154,7 +3605,10 @@ width0pt\relax} \fi \removelastskip % % We like breaks before the index initials, so insert a bonus. - \penalty -300 + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -3164,80 +3618,100 @@ width0pt\relax} \fi % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% - \vskip .33\baselineskip plus .1\baselineskip - % % Do our best not to break after the initial. \nobreak + \vskip .33\baselineskip plus .1\baselineskip }} -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. % -\def\entry#1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing columns. - \vskip 0pt plus1pt - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#1}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd + \ % \else - \ #2% The page number ends the paragraph. + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi \fi - \fi% - \par -\endgroup} + \par + \endgroup +} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders @@ -3348,7 +3822,7 @@ width0pt\relax} \fi \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } -% +% % All done with double columns. \def\enddoublecolumns{% \output = {% @@ -3406,6 +3880,12 @@ width0pt\relax} \fi \message{sectioning,} % Chapters, sections, etc. +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 @@ -3413,9 +3893,12 @@ width0pt\relax} \fi % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ +% % \def\appendixletter{\char\the\appendixno} -% We do the following for the sake of pdftex, which needs the actual +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. +% \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% @@ -3453,11 +3936,12 @@ width0pt\relax} \fi % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. +% However, they are not reliable, because we don't use marks. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raise/lowersections modify this count +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} @@ -3467,288 +3951,246 @@ width0pt\relax} \fi \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 \else - \numberedsubsubseczzz{#2} + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi \fi -\fi -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi \else - \appendixsubsubseczzz{#2} + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi \fi -\fi -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi \else - \unnumberedsubsubseczzz{#2} + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi \fi -\fi + \suppressfirstparagraphindent } -% @chapter, @appendix, @unnumbered. -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% -\chapmacro {#1}{\the\chapno}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -% We don't substitute the actual chapter name into \thischapter -% because we don't want its macros evaluated now. -\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% - {\the\chapno}}}% -\temp -\donoderef -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec -} - -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 -\message{\putwordAppendix\space \appendixletter}% -\chapmacro {#1}{\putwordAppendix{} \appendixletter}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% - {\appendixletter}}}% -\temp -\appendixnoderef -\global\let\section = \appendixsec -\global\let\subsection = \appendixsubsec -\global\let\subsubsection = \appendixsubsubsec +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the<toks register> to achieve this: TeX expands \the<toks> only once, + % simply yielding the contents of <toks register>. (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. -\outer\def\centerchap{\parsearg\centerchapyyy} -\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} % @top is like @unnumbered. -\outer\def\top{\parsearg\unnumberedyyy} - -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{% -\secno=0 \subsecno=0 \subsubsecno=0 -% -% This used to be simply \message{#1}, but TeX fully expands the -% argument to \message. Therefore, if #1 contained @-commands, TeX -% expanded them. For example, in `@unnumbered The @cite{Book}', TeX -% expanded @cite (which turns out to cause errors because \cite is meant -% to be executed, not expanded). -% -% Anyway, we don't want the fully-expanded definition of @cite to appear -% as a result of the \message, we just want `@cite' itself. We use -% \the<toks register> to achieve this: TeX expands \the<toks> only once, -% simply yielding the contents of <toks register>. (We also do this for -% the toc entries.) -\toks0 = {#1}\message{(\the\toks0)}% -% -\unnumbchapmacro {#1}% -\gdef\thischapter{#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% -\temp -\unnumbnoderef -\global\let\section = \unnumberedsec -\global\let\subsection = \unnumberedsubsec -\global\let\subsubsection = \unnumberedsubsubsec -} +\let\top\unnumbered % Sections. -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% - {\the\chapno}{\the\secno}}}% -\temp -\donoderef -\nobreak -} - -\outer\def\appendixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% - {\appendixletter}{\the\secno}}}% -\temp -\appendixnoderef -\nobreak -} - -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{% -\plainsecheading {#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% - {\the\toks0}{\the\chapno}}}% -\temp -\unnumbnoderef -\nobreak +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% - {\the\chapno}{\the\secno}{\the\subsecno}}}% -\temp -\donoderef -\nobreak -} - -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% - {\appendixletter}{\the\secno}{\the\subsecno}}}% -\temp -\appendixnoderef -\nobreak -} - -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{% -\plainsubsecheading {#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% - {\the\toks0}{\the\chapno}{\the\secno}}}% -\temp -\unnumbnoderef -\nobreak +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% -\temp -\donoderef -\nobreak -} - -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% -\temp -\appendixnoderef -\nobreak -} - -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{% -\plainsubsubsecheading {#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% - {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% -\temp -\unnumbnoderef -\nobreak -} - -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading @@ -3761,23 +4203,27 @@ width0pt\relax} \fi % if justification is not attempted. Hence \raggedright. -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% -{\advance\chapheadingskip by 10pt \chapbreak }% -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} % @heading, @subheading, @subsubheading. -\def\heading{\parsearg\plainsecheading} -\def\subheading{\parsearg\plainsubsecheading} -\def\subsubheading{\parsearg\plainsubsubsecheading} +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), @@ -3786,8 +4232,6 @@ width0pt\relax} \fi %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) @@ -3810,7 +4254,7 @@ width0pt\relax} \fi \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} -\def\CHAPPAGodd{ +\def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage @@ -3818,107 +4262,193 @@ width0pt\relax} \fi \CHAPPAGon -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain -\global\let\centerchapmacro=\centerchfplain} - -% Plain chapter opening. -% #1 is the text, #2 the chapter number or empty if unnumbered. -\def\chfplain#1#2{% +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% \pchapsepmacro {% \chapfonts \rm - \def\chapnum{#2}% - \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + % + % Have to define \thissection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\thissection{#1}% + \gdef\thischaptername{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \def\thischapter{#1}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \xdef\thischapter{}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + % We don't substitute the actual chapter name into \thischapter + % because we don't want its macros evaluated now. And we don't + % use \thissection because that changes with each section. + % + \xdef\thischapter{\putwordAppendix{} \appendixletter: + \noexpand\thischaptername}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \xdef\thischapter{\putwordChapter{} \the\chapno: + \noexpand\thischaptername}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 \centerparametersmaybe + \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } -% Plain opening for unnumbered. -\def\unnchfplain#1{\chfplain{#1}{}} - % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax -\def\centerchfplain#1{{% - \def\centerparametersmaybe{% - \advance\rightskip by 3\rightskip - \leftskip = \rightskip - \parfillskip = 0pt - }% - \chfplain{#1}{}% -}} +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} -\CHAPFplain % The default +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } - \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } - \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } - -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen -\global\let\centerchapmacro=\centerchfopen} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} -% Section titles. +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% \newskip\secheadingskip -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} -\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} -\def\plainsecheading#1{\sectionheading{sec}{}{#1}} +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. -\newskip \subsecheadingskip -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} -\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} -\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. -\let\subsubsecheadingskip = \subsecheadingskip -\let\subsubsecheadingbreak = \subsecheadingbreak -\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} -\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} -% Print any size section title. +% Print any size, any type, section title. % -% #1 is the section type (sec/subsec/subsubsec), #2 is the section -% number (maybe empty), #3 the text. -\def\sectionheading#1#2#3{% - {% - \expandafter\advance\csname #1headingskip\endcsname by \parskip - \csname #1headingbreak\endcsname - }% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. - \csname #1fonts\endcsname \rm + \csname #2fonts\endcsname \rm + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Only insert the space after the number if we have a section number. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\thissection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \thissection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\thissection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\thissection{#1}% + \fi\fi\fi % - % Only insert the separating space if we have a section number. - \def\secnum{#2}% - \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % Write the toc entry (before \donoderef). See comments in \chfplain. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chfplain. + \donoderef{#3}% + % + % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 % zero if no section number - \unhbox0 #3}% + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% }% - \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint between: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 } @@ -3927,112 +4457,152 @@ width0pt\relax} \fi \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. -% Called from @chapter, etc. We supply {\folio} at the end of the -% argument, which will end up as the last argument to the \...entry macro. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. % -% We open the .toc file here instead of at @setfilename or any other -% fixed time so that @contents can be put in the document anywhere. +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. % \newif\iftocfileopened -\def\writetocentry#1{% - \iftocfileopened\else - \immediate\openout\tocfile = \jobname.toc - \global\tocfileopenedtrue +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + \toks0 = {#2}% + \toks2 = \expandafter{\lastnode}% + \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}% + {\the\toks2}{\noexpand\folio}}}% + \temp + \fi \fi - \iflinks \write\tocfile{#1{\folio}}\fi % - % Tell \shipout to create a page destination if we're doing pdf, which - % will be the target of the links in the table of contents. We can't - % just do it on every page because the title pages are numbered 1 and - % 2 (the page numbers aren't printed), and so are the first two pages - % of the document. Thus, we'd have two destinations named `1', and - % two named `2'. - \ifpdf \pdfmakepagedesttrue \fi + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 -% Finish up the main text and prepare to read what we've written -% to \tocfile. +% Prepare to read what we've written to \tocfile. % \def\startcontents#1{% - % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund <tege@matematik.su.se> - \contentsalignmacro - \immediate\closeout\tocfile - % - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \savepageno = \pageno - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - % We can't do this, because then an actual ^ in a section - % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. - %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - % - % Roman numerals for page numbers. - \ifnum \pageno>0 \pageno = \lastnegativepageno \fi + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund <tege@matematik.su.se> + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \def\thischapter{}% + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% - \startcontents{\putwordTOC}% - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \pdfmakeoutlines - \endgroup - \lastnegativepageno = \pageno - \pageno = \savepageno + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% - \startcontents{\putwordShortTOC}% - % - \let\chapentry = \shortchapentry - \let\appendixentry = \shortappendixentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl - \rm - \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\unnumbsecentry ##1##2##3{} - \def\subsecentry ##1##2##3##4##5{} - \def\unnumbsubsecentry ##1##2##3##4{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \def\unnumbsubsubsecentry ##1##2##3##4##5{} - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \endgroup - \lastnegativepageno = \pageno - \pageno = \savepageno + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } \let\shortcontents = \summarycontents -\ifpdf - \pdfcatalog{/PageMode /UseOutlines}% -\fi +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. @@ -4040,57 +4610,46 @@ width0pt\relax} \fi % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. -\def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} -% -% Appendices, in the short toc. -\let\shortappendixentry = \shortchapentry - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. +% Need the word Appendix, and a fixed-size box. % -\newdimen\shortappendixwidth +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\shortchaplabel#1{% - % This space should be enough, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % But use \hss just in case. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) - \dimen0 = 1em - \hbox to \dimen0{#1\hss}% -} +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. -\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} -\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}} +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. @@ -4121,17 +4680,8 @@ width0pt\relax} \fi \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -\def\tocentry#1#2{\begingroup - \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - % Do not use \turnoffactive in these arguments. Since the toc is - % typeset in cmr, characters such as _ would come out wrong; we - % have to do the usual translation tricks. - \entry{#1}{#2}% -\endgroup} +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} @@ -4141,15 +4691,15 @@ width0pt\relax} \fi \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. -% +% % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % @@ -4161,7 +4711,7 @@ width0pt\relax} \fi % The @error{} command. % Adapted from the TeXbook's \boxit. -% +% \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. @@ -4169,10 +4719,10 @@ width0pt\relax} \fi % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} % -\global\setbox\errorbox=\hbox to \dimen0{\hfil +\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. - \vbox{ + \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. @@ -4186,17 +4736,16 @@ width0pt\relax} \fi % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. -\def\tex{\begingroup +\envdef\tex{% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 - \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 - \catcode 43=12 % plus - \catcode`\"=12 - \catcode`\==12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other \escapechar=`\\ % \let\b=\ptexb @@ -4208,19 +4757,23 @@ width0pt\relax} \fi \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace + \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% -\let\Etex=\endgroup} +} +% There is no need to define \Etex. % Define @lisp ... @end lisp. -% @lisp does a \begingroup so it can rebind things, +% @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. @@ -4231,34 +4784,25 @@ width0pt\relax} \fi % have any width. \def\lisppar{\null\endgraf} -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the -% start of the next paragraph will insert \parskip +% start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% - \ifnum\lastpenalty < 10000 + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip - \penalty-50 + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi @@ -4290,54 +4834,54 @@ width0pt\relax} \fi % \newskip\lskip\newskip\rskip -\long\def\cartouche{% -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char, and rule thickness - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} \def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak - \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. - \singlespace \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt @@ -4348,115 +4892,99 @@ width0pt\relax} \fi \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax \fi + \let\exdent=\nofillexdent } -% Define the \E... control sequence only if we are inside the particular -% environment, so the error checking in \end will work. +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp % -% To end an @example-like environment, we first end the paragraph (via -% \afterenvbreak's vertical glue), and then the group. That way we keep -% the zero \parskip that the environments set -- \parskip glue will be -% inserted at the beginning of the next paragraph in the document, after -% the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup} +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \smallexamplefonts \rm + \fi +} -% @lisp: indented, narrowed, typewriter font. -\def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. - \gobble % eat return +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } -% @example: Same as @lisp. -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} -% @small... is usually equivalent to the non-small (@smallbook -% redefines). We must call \example (or whatever) last in the -% definition, since it reads the return following the @example (or -% whatever) command. +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. % -% This actually allows (for example) @end display inside an -% @smalldisplay. Too bad, but makeinfo will catch the error anyway. -% -\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} -\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} -\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} - -% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. +% @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. -\def\smalllispx{\begingroup - \def\Esmalllisp{\nonfillfinish\endgroup}% - \def\Esmallexample{\nonfillfinish\endgroup}% - \smallexamplefonts - \lisp +% +\maketwodispenvs {lisp}{example}{% + \nonfillstart + \tt + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return } -% @display: same as @lisp except keep current font. +% @display/@smalldisplay: same as @lisp except keep current font. % -\def\display{\begingroup +\makedispenv {display}{% \nonfillstart - \let\Edisplay = \nonfillfinish \gobble } -% -% @smalldisplay (when @smallbook): @display plus smaller fonts. -% -\def\smalldisplayx{\begingroup - \def\Esmalldisplay{\nonfillfinish\endgroup}% - \smallexamplefonts \rm - \display -} -% @format: same as @display except don't narrow margins. +% @format/@smallformat: same as @display except don't narrow margins. % -\def\format{\begingroup - \let\nonarrowing = t +\makedispenv{format}{% + \let\nonarrowing = t% \nonfillstart - \let\Eformat = \nonfillfinish \gobble } -% -% @smallformat (when @smallbook): @format plus smaller fonts. -% -\def\smallformatx{\begingroup - \def\Esmallformat{\nonfillfinish\endgroup}% - \smallexamplefonts \rm - \format -} -% @flushleft (same as @format). -% -\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak % @flushright. % -\def\flushright{\begingroup - \let\nonarrowing = t +\envdef\flushright{% + \let\nonarrowing = t% \nonfillstart - \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } +\let\Eflushright = \afterenvbreak % @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. % -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body +\envdef\quotation{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \singlespace \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax @@ -4465,24 +4993,49 @@ width0pt\relax} \fi \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi } % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} -% If we want to allow any <char> as delimiter, +% If we want to allow any <char> as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % -% [Knuth] p. 344; only we need to do '@' too +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. \def\dospecials{% - \do\ \do\\\do\@\do\{\do\}\do\$\do\&% - \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% +} % % [Knuth] p. 380 \def\uncatcodespecials{% - \def\do##1{\catcode`##1=12}\dospecials} + \def\do##1{\catcode`##1=\other}\dospecials} % % [Knuth] pp. 380,381,391 % Disable Spanish ligatures ?` and !` of \tt font @@ -4530,6 +5083,8 @@ width0pt\relax} \fi } \endgroup \def\setupverbatim{% + \nonfillstart + \advance\leftskip by -\defbodyindent % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% @@ -4543,15 +5098,15 @@ width0pt\relax} \fi \everypar{\starttabbox}% } -% Do the @verb magic: verbatim text is quoted by unique -% delimiter characters. Before first delimiter expect a +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'<char>#1<char>'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup - \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % @@ -4563,634 +5118,395 @@ width0pt\relax} \fi % % \def\doverbatim#1@end verbatim{#1} % -% For Texinfo it's a lot easier than for LaTeX, +% For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': -% we need not redefine '\', '{' and '}' +% we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] -%% Include LaTeX hack for completeness -- never know -%% \begingroup -%% \catcode`|=0 \catcode`[=1 -%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active -%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ -%% #1|endgroup|def|Everbatim[]|end[verbatim]] -%% |endgroup +% \begingroup \catcode`\ =\active - \gdef\doverbatim#1@end verbatim{#1\end{verbatim}} + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. \endgroup % -\def\verbatim{% - \def\Everbatim{\nonfillfinish\endgroup}% - \begingroup - \nonfillstart - \advance\leftskip by -\defbodyindent - \begingroup\setupverbatim\doverbatim +\envdef\verbatim{% + \setupverbatim\doverbatim } +\let\Everbatim = \afterenvbreak + % @verbatiminclude FILE - insert text of file in verbatim environment. % -% Allow normal characters that we make active in the argument (a file name). -\def\verbatiminclude{% - \begingroup - \catcode`\\=12 - \catcode`~=12 - \catcode`^=12 - \catcode`_=12 - \catcode`|=12 - \catcode`<=12 - \catcode`>=12 - \catcode`+=12 - \parsearg\doverbatiminclude -} -\def\setupverbatiminclude{% - \begingroup - \nonfillstart - \advance\leftskip by -\defbodyindent - \begingroup\setupverbatim -} +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% - % Restore active chars for included file. - \endgroup - \begingroup - \def\thisfile{#1}% - \expandafter\expandafter\setupverbatiminclude\input\thisfile - \endgroup\nonfillfinish\endgroup + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% } % @copying ... @end copying. % Save the text away for @insertcopying later. -% -\newbox\copyingbox % -\def\copying{\begingroup - \parindent = 0pt % looks wrong on title page - \def\Ecopying{\egroup\endgroup}% - \global\setbox\copyingbox = \vbox\bgroup +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup } -% @insertcopying. -% -\def\insertcopying{\unvcopy\copyingbox} - - \message{defuns,} % @defun etc. -% Allow user to change definition object font (\df) internally -\def\setdeffont #1 {\csname DEF#1\endcsname} - \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt -\newskip\deftypemargin \deftypemargin=12pt \newskip\deflastargmargin \deflastargmargin=18pt -\newcount\parencount -% define \functionparens, which makes ( and ) and & do special things. -% \functionparens affects the group it is contained in. -\def\activeparens{% -\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active -\catcode`\[=\active \catcode`\]=\active} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested - \global\advance\parencount by 1 -} -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - % also in that case restore the outer-level definition of (. - \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - \global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } -\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } -\let\ampnr = \& -\def\lbrb{{\bf\char`\[}} -\def\rbrb{{\bf\char`\]}} - -% Active &'s sneak into the index arguments, so make sure it's defined. -{ - \catcode`& = 13 - \global\let& = \ampnr -} - -% First, defname, which formats the header line itself. -% #1 should be the function name. -% #2 should be the type of definition, such as "Function". - -\def\defname #1#2{% -% Get the values of \leftskip and \rightskip as they were -% outside the @def... -\dimen2=\leftskip -\advance\dimen2 by -\defbodyindent -\noindent -\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% -\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line -\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 -% Now output arg 2 ("Function" or some such) -% ending at \deftypemargin from the right margin, -% but stuck inside a box of width 0 so it does not interfere with linebreaking -{% Adjust \hsize to exclude the ambient margins, -% so that \rightline will obey them. -\advance \hsize by -\dimen2 -\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% -% Make all lines underfull and no complaints: -\tolerance=10000 \hbadness=10000 -\advance\leftskip by -\defbodyindent -\exdentamount=\defbodyindent -{\df #1}\enskip % Generate function name -} - -% Actually process the body of a definition -% #1 should be the terminating control sequence, such as \Edefun. -% #2 should be the "another name" control sequence, such as \defunx. -% #3 should be the control sequence that actually processes the header, -% such as \defunheader. - -\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % 61 is `=' -\obeylines\activeparens\spacesplit#3} - -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by the space, is the class name. -% -\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} - -% Used for @deftypemethod and @deftypeivar. -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by a space, is the class name. -% #5 is the method's return type. -% -\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} - -% Used for @deftypeop. The change from \deftypemethparsebody is an -% extra argument at the beginning which is the `category', instead of it -% being the hardwired string `Method' or `Instance Variable'. We have -% to account for this both in the \...x definition and in parsing the -% input at hand. Thus also need a control sequence (passed as #5) for -% the \E... definition to assign the category name to. -% -\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 ##2 ##3 {% - \def#4{##1}% - \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} - -\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} - -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. - -\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % -\obeylines\spacesplit#3} - -% This is used for \def{tp,vr}parsebody. It could probably be used for -% some of the others, too, with some judicious conditionals. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV % - \medbreak % - % Define the end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \defargscommonending, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + \ifnum\lastpenalty=10002 \penalty2000 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent - \begingroup\obeylines } -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{#3{#4}}% +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% } +\def\gobbledefun#1\startdefun{} -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody -% -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. +% \printdefunline \deffnheader{text} % -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{\parsetpheaderline{#3{#4}}}\empty +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty 10002 % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup } -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does. -% -\def\removeemptybraces\empty#1\relax{#1} +\def\Edefun{\endgraf\medbreak} -% After \spacesplit has done its work, this is called -- #1 is the final -% thing to call, #2 the type name (which starts with \empty), and #3 -% (which might be empty) the arguments. +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. % -\def\parsetpheaderline#1#2#3{% - #1{\removeemptybraces#2\relax}{#3}% -}% - -\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\spacesplit{#3{#5}}} +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} -% Split up #2 at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} -{\obeylines -\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% -\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% -\ifx\relax #3% -#1{#2}{}\else #1{#2}{#3#4}\fi}} +%%% Untyped functions: -% So much for the things common to all kinds of definitions. +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} -% Define @defun. +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} -% First, define the processing that is wanted for arguments of \defun -% Use this to expand the args and terminate the paragraph they make up +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } -\def\defunargs#1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Set the font temporarily and use \font in case \setfont made \tensl a macro. -{\tensl\hyphenchar\font=0}% -#1% -{\tensl\hyphenchar\font=45}% -\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\nobreak\vskip -\parskip\nobreak +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\nobreak\vskip -\parskip\nobreak -} +%%% Typed functions: -% Do complete processing of one @defun or @defunx line already parsed. +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} -% @deffn Command forward-char nchars +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } -% @defun == @deffn Function +%%% Typed variables: -\def\defun{\defparsebody\Edefun\defunx\defunheader} +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDeffunc}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} -% @deftypefun int foobar (int @var{foo}, float @var{bar}) +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} - -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% -\deftypefunargs {#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} +%%% Untyped variables: -% \defheaderxcond#1\relax$.$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} - -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$.$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } -% @defmac == @deffn Macro +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefmac}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% } -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefspec}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defop CATEGORY CLASS OPERATION ARG... +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. % -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} +% We are followed by (but not passed) the arguments, if any. % -\def\defopheader#1#2#3{% -\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index -\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% -\defunargs {#3}\endgroup % +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. } -% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. % -\def\deftypeop #1 {\def\deftypeopcategory{#1}% - \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader - \deftypeopcategory} -% -% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. -\def\deftypeopheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3} - {\deftypeopcategory\ \putwordon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=\ttslanted + #1% + \sl\hyphenchar\font=45 } -% @deftypemethod CLASS TYPE METHOD ARG... -% -\def\deftypemethod{% - \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} +% We want ()&[] to print specially on the defun line. % -% #1 is the class name, #2 the data type, #3 the method name, #4 the args. -\def\deftypemethodheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active } -% @deftypeivar CLASS TYPE VARNAME -% -\def\deftypeivar{% - \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} -% -% #1 is the class name, #2 the data type, #3 the variable name. -\def\deftypeivarheader#1#2#3{% - \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3} - {\putwordInstanceVariableof\ \code{#1}}% - \defvarargs{#3}% - \endgroup -} +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) -% @defmethod == @defop Method -% -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} -% -% #1 is the class name, #2 the method name, #3 the args. -\def\defmethodheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{#2}{\putwordMethodon\ \code{#1}}% - \defunargs{#3}% - \endgroup -} +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& -% @defcv {Class Option} foo-class foo-flag + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} +\newcount\parencount -\def\defcvarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index -\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% -\defvarargs {#3}\endgroup % +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi } - -% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME -% -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} -% -\def\defivarheader#1#2#3{% - \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index - \begingroup - \defname{#2}{\putwordInstanceVariableof\ #1}% - \defvarargs{#3}% - \endgroup +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi } +\def\bfafterword#1 {#1 \bf} -% @defvar -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% -\interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak} - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefvar}% -\defvarargs {#2}\endgroup % +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword } - -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefopt}% -\defvarargs {#2}\endgroup % +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 } -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name, perhaps followed by text that -% is actually part of the data type, which should not be put into the index. -\def\deftypevarheader #1#2{% -\dovarind#2 \relax% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% -\interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak -\endgroup} -\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} - -% @deftypevr {Global Flag} int enable - -\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - -\def\deftypevrheader #1#2#3{\dovarind#3 \relax% -\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} -\interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak -\endgroup} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} -% These definitions are used if you use @defunx (etc.) -% anywhere other than immediately after a @defun or @defunx. -% -\def\defcvx#1 {\errmessage{@defcvx in invalid context}} -\def\deffnx#1 {\errmessage{@deffnx in invalid context}} -\def\defivarx#1 {\errmessage{@defivarx in invalid context}} -\def\defmacx#1 {\errmessage{@defmacx in invalid context}} -\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\defopx#1 {\errmessage{@defopx in invalid context}} -\def\defspecx#1 {\errmessage{@defspecx in invalid context}} -\def\deftpx#1 {\errmessage{@deftpx in invalid context}} -\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} -\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} -\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} -\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} -\def\defunx#1 {\errmessage{@defunx in invalid context}} -\def\defvarx#1 {\errmessage{@defvarx in invalid context}} -\def\defvrx#1 {\errmessage{@defvrx in invalid context}} +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +\def\badparencount{% + \errmessage{Unbalanced parentheses in @def}% + \global\parencount=0 +} +\def\badbrackcount{% + \errmessage{Unbalanced square braces in @def}% + \global\brackcount=0 +} \message{macros,} @@ -5199,28 +5515,42 @@ width0pt\relax} \fi % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scanmacro#1{% - \begingroup \newlinechar`\^^M - % Undo catcode changes of \startcontents and \doprintindex - \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ - % Append \endinput to make sure that TeX does not see the ending newline. - \toks0={#1\endinput}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{\the\toks0}% - \immediate\closeout\macscribble - \let\xeatspaces\eatspaces - \input \jobname.tmp - \endgroup -} -\else -\def\scanmacro#1{% -\begingroup \newlinechar`\^^M -% Undo catcode changes of \startcontents and \doprintindex -\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ -\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } \fi +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? @@ -5228,13 +5558,15 @@ width0pt\relax} \fi % \do\macro1\do\macro2... % Utility routines. -% Thisdoes \let #1 = #2, except with \csnames. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% \def\cslet#1#2{% -\expandafter\expandafter -\expandafter\let -\expandafter\expandafter -\csname#1\endcsname -\csname#2\endcsname} + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). @@ -5247,7 +5579,7 @@ width0pt\relax} \fi } % Trim a single trailing ^^M off a string. -{\catcode`\^^M=12\catcode`\Q=3% +{\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% @@ -5261,30 +5593,36 @@ width0pt\relax} \fi % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. +\def\scanctxt{% + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + \def\macrobodyctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\{=12 - \catcode`\}=12 - \catcode`\@=12 - \catcode`\^^M=12 - \usembodybackslash} + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} \def\macroargctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\@=12 - \catcode`\\=12} + \scanctxt + \catcode`\\=\other +} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -5325,32 +5663,32 @@ width0pt\relax} \fi \else \expandafter\parsemacbody \fi} -\def\unmacro{\parsearg\unmacroxxx} -\def\unmacroxxx#1{% +\parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% - % Remove the macro name from \macrolist + % Remove the macro name from \macrolist: \begingroup - \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% - \def\do##1{% - \def\tempb{##1}% - \ifx\tempa\tempb - % remove this - \else - \toks0 = \expandafter{\newmacrolist\do}% - \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% - \fi}% - \def\newmacrolist{}% - % Execute macro list to define \newmacrolist - \macrolist - \global\let\macrolist\newmacrolist + \expandafter\let\csname#1\endcsname \relax + \let\do\unmacrodo + \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx#1\relax + % remove this + \else + \noexpand\do \noexpand #1% + \fi +} + % This makes use of the obscure feature that if the last token of a % <parameter list> is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. @@ -5466,25 +5804,41 @@ width0pt\relax} \fi \expandafter\parsearg \fi \next} -% We mant to disable all macros during \shipout so that they are not +% We want to disable all macros during \shipout so that they are not % expanded by \write. \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% \edef\next{\macrolist}\expandafter\endgroup\next} +% For \indexnofonts, we need to get rid of all macros, leaving only the +% arguments (if present). Of course this is not nearly correct, but it +% is the best we can do for now. makeinfo does not expand macros in the +% argument to @deffn, which ends up writing an index entry, and texindex +% isn't prepared for an index sort entry that starts with \. +% +% Since macro invocations are followed by braces, we can just redefine them +% to take a single TeX argument. The case of a macro invocation that +% goes to end-of-line is not handled. +% +\def\emptyusermacros{\begingroup + \def\do##1{\let\noexpand##1=\noexpand\asis}% + \edef\next{\macrolist}\expandafter\endgroup\next} + % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. -\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} +\def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} -\def\aliasyyy #1=#2\relax{\ignoreactivespaces -\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% - \expandafter\noexpand\csname#2\endcsname}% -\expandafter\endgroup\next} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} \message{cross references,} -% @xref etc. \newwrite\auxfile @@ -5496,56 +5850,70 @@ width0pt\relax} \fi \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} -% @node's job is to define \lastnode. -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + \let\nwnode=\node -\let\lastnode=\relax - -% The sectioning commands (@chapter, etc.) call these. -\def\donoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Ysectionnumberandtype}% - \global\let\lastnode=\relax - \fi -} -\def\unnumbnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% - \global\let\lastnode=\relax - \fi -} -\def\appendixnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Yappendixletterandtype}% - \global\let\lastnode=\relax +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty \fi } - % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister -\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} -\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} -\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} - -% \setref{NAME}{SNT} defines a cross-reference point NAME, namely -% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have -% to set \indexdummies so commands such as @code in a section title -% aren't expanded. It would be nicer not to expand the titles in the -% first place, but there's so many layers that that is hard to do. -% -\def\setref#1#2{{% - \indexdummies +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \thissection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% \pdfmkdest{#1}% - \dosetq{#1-title}{Ytitle}% - \dosetq{#1-pg}{Ypagenumber}% - \dosetq{#1-snt}{#2}% -}} + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \turnoffactive + \otherbackslash + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\thissection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \writexrdef{pg}{\folio}% will be written later, during \shipout + }% + \fi +} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed @@ -5558,137 +5926,156 @@ width0pt\relax} \fi \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}{}}% + \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. + % Make link in pdf output. \ifpdf \leavevmode \getfilename{#4}% - {\normalturnoffactive + {\turnoffactive \otherbackslash \ifnum\filenamelength>0 \startlink attr{/Border [0 0 0]}% goto file{\the\filename.pdf} name{#1}% \else \startlink attr{/Border [0 0 0]}% - goto name{#1}% + goto name{\pdfmkpgn{#1}}% \fi }% \linkcolor \fi % - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \otherbackslash + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\normalturnoffactive - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% - % [mynode], - [\printednodename],\space - % page 3 - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive \otherbackslash + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% + \fi \fi \endlink \endgroup} -% \dosetq is the interface for calls from other macros - -% Use \normalturnoffactive so that punctuation chars such as underscore -% and backslash work in node names. (\turnoffactive doesn't do \.) -\def\dosetq#1#2{% - {\let\folio=0% - \normalturnoffactive - \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% - \iflinks - \next - \fi - }% -} - -% \internalsetq {foo}{page} expands into -% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} -% When the aux file is read, ' is the escape character - -\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} - -% Things to be expanded by \internalsetq - -\def\Ypagenumber{\folio} - -\def\Ytitle{\thissection} - -\def\Ynothing{} - -\def\Ysectionnumberandtype{% -\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % -\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\def\Yappendixletterandtype{% -\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% -\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\gdef\xreftie{'tie} +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. +% Things referred to by \setref. % -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Non-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. - +% \def\refx#1#2{% - \expandafter\ifx\csname X#1\endcsname\relax + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks @@ -5703,21 +6090,49 @@ width0pt\relax} \fi \fi \else % It's defined, so just use it. - \csname X#1\endcsname + \thisrefX \fi #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. % -\def\xrdef#1{\begingroup - % Reenable \ as an escape while reading the second argument. - \catcode`\\ = 0 - \afterassignment\endgroup - \expandafter\gdef\csname X#1\endcsname +\def\xrdef#1#2{% + \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR#1\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% + \fi } % Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readauxfile + \global\havexrefstrue + \fi + \closein 1 +} + \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other @@ -5746,9 +6161,7 @@ width0pt\relax} \fi \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other - \catcode`\@=\other - \catcode`\^=\other - % It was suggested to define this as 7, which would allow ^^e4 etc. + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ @@ -5761,6 +6174,9 @@ width0pt\relax} \fi % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other @@ -5772,8 +6188,19 @@ width0pt\relax} \fi \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other + \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off - % Make the characters 128-255 be printing characters + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. {% \count 1=128 \def\loop{% @@ -5782,31 +6209,18 @@ width0pt\relax} \fi \ifnum \count 1<256 \loop \fi }% }% - % The aux file uses ' as the escape (for now). - % Turn off \ as an escape so we do not lose on - % entries which were dumped with control sequences in their names. - % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ - % Reference to such entries still does not work the way one would wish, - % but at least they do not bomb out when the aux file is read in. + % + % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 - \catcode`\%=\other - \catcode`\'=0 - \catcode`\\=\other + \catcode`\@=0 % - \openin 1 \jobname.aux - \ifeof 1 \else - \closein 1 - \input \jobname.aux - \global\havexrefstrue - \global\warnedobstrue - \fi - % Open the new aux file. TeX will close it automatically at exit. - \openout\auxfile=\jobname.aux + \input \jobname.aux \endgroup} -% Footnotes. +\message{insertions,} +% including footnotes. \newcount \footnoteno @@ -5820,37 +6234,39 @@ width0pt\relax} \fi % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment -\let\ptexfootnote=\footnote - {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf - \footnotezzz + \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % -% Oh yes, they do; otherwise, @ifset and anything else that uses -% \parseargline fail inside footnotes because the tokens are fixed when +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % -\long\gdef\footnotezzz{\insert\footins\bgroup +\gdef\dofootnote{% + \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. + \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox @@ -5880,48 +6296,68 @@ width0pt\relax} \fi \footstrut \futurelet\next\fo@t } -\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t - \else\let\next\f@t\fi \next} -\def\f@@t{\bgroup\aftergroup\@foot\let\next} -\def\f@t#1{#1\@foot} -\def\@foot{\strut\par\egroup} - }%end \catcode `\@=11 -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarily, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. % -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi } -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % -\def\finalout{\overfullrule=0pt} +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. @@ -5931,12 +6367,12 @@ width0pt\relax} \fi % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else - \closein 1 - % Do not bother showing banner with post-v2.7 epsf.tex (available in - % doc/epsf.tex until it shows up on ctan). + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi +\closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf @@ -5972,7 +6408,7 @@ width0pt\relax} \fi \nobreak\bigskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space - % above and below. + % above and below. \nobreak\vskip\parskip \nobreak \line\bgroup\hss @@ -5992,6 +6428,269 @@ width0pt\relax} \fi \endgroup} +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \thissection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\thissection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies \turnoffactive \otherbackslash + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \thissection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + \message{localization,} % and i18n. @@ -6000,19 +6699,17 @@ width0pt\relax} \fi % properly. Single argument is the language abbreviation. % It would be nice if we could set up a hyphenation file here. % -\def\documentlanguage{\parsearg\dodocumentlanguage} -\def\dodocumentlanguage#1{% +\parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. - \openin 1 txi-#1.tex - \ifeof1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% - \let\temp = \relax - \else - \def\temp{\input txi-#1.tex }% - \fi - \temp + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 \endgroup } \newhelp\nolanghelp{The given language definition file cannot be found or @@ -6058,11 +6755,13 @@ should work if nowhere else does.} } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; -% 4) hoffset; 5) binding offset; 6) topskip. We also call -% \setleading{\textleading}, so the caller should define \textleading. -% The caller should also set \parskip. +% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) +% physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. % -\def\internalpagesizes#1#2#3#4#5#6{% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip @@ -6081,28 +6780,27 @@ should work if nowhere else does.} \normaloffset = #4\relax \bindingoffset = #5\relax % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + \fi + % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } -% Use `small' versions. -% -\def\smallenvironments{% - \let\smalldisplay = \smalldisplayx - \let\smallexample = \smalllispx - \let\smallformat = \smallformatx - \let\smalllisp = \smalllispx -} - % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. - \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% + \internalpagesizes{46\baselineskip}{6in}% + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.5 (or so) format. @@ -6110,26 +6808,42 @@ should work if nowhere else does.} \parskip = 2pt plus 1pt \textleading = 12pt % - \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + \internalpagesizes{7.5in}{5in}% + {\voffset}{.25in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt - \deftypemargin = 0pt \defbodyindent = .5cm - \smallenvironments }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt - \textleading = 12pt + \textleading = 13.2pt % - \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{51\baselineskip}{160mm} + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. @@ -6139,44 +6853,46 @@ should work if nowhere else does.} \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % - \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt - \contentsrightmargin = 0mm - \deftypemargin = 0pt + \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm - % - \smallenvironments }} -% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin -% 29mm, hence bottom margin 28mm, nominal side margin 3cm. +% A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 - \textleading = 13.6pt - % \afourpaper - \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% % - % Must explicitly reset to 0 because we call \afourpaper, apparently, - % although this does not entirely make sense. + % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} -% Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{% +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 \afourpaper - \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% -} + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % -\def\pagesizes{\parsearg\pagesizesxxx} -\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 @@ -6184,7 +6900,16 @@ should work if nowhere else does.} \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % - \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% + \dimen0 = #1 + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% }} % Set default to letter. @@ -6214,8 +6939,8 @@ should work if nowhere else does.} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print @@ -6248,7 +6973,7 @@ should work if nowhere else does.} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} % Subroutine for the previous macro. -\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} @@ -6262,15 +6987,6 @@ should work if nowhere else does.} \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix -%\catcode 27=\active -%\def^^[{$\diamondsuit$} - -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. @@ -6280,44 +6996,48 @@ should work if nowhere else does.} \catcode`\@=0 -% \rawbackslashxx output one backslash character in current font -\global\chardef\rawbackslashxx=`\\ -%{\catcode`\\=\other -%@gdef@rawbackslashxx{\}} +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work -% \rawbackslash redefines \ as input to do \rawbackslashxx. +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. {\catcode`\\=\active -@gdef@rawbackslash{@let\=@rawbackslashxx }} + @gdef@rawbackslash{@let\=@backslashcurfont} + @gdef@otherbackslash{@let\=@realbackslash} +} + +% \realbackslash is an actual character `\' with catcode other. +{\catcode`\\=\other @gdef@realbackslash{\}} % \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} +\def\normalbackslash{{\tt\backslashcurfont}} -% \catcode 17=0 % Define control-q \catcode`\\=\active % Used sometimes to turn off (effectively) the active characters % even after parsing them. -@def@turnoffactive{@let"=@normaldoublequote -@let\=@realbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus -@let$=@normaldollar}%$ font-lock fix - -@def@normalturnoffactive{@let"=@normaldoublequote -@let\=@normalbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus -@let$=@normaldollar}%$ font-lock fix +@def@turnoffactive{% + @let"=@normaldoublequote + @let\=@realbackslash + @let~=@normaltilde + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let<=@normalless + @let>=@normalgreater + @let+=@normalplus + @let$=@normaldollar %$ font-lock fix + @unsepspaces +} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. (Thus, \ is not expandable when this is in +% effect.) +% +@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @@ -6345,15 +7065,11 @@ should work if nowhere else does.} % Say @foo, not \foo, in error messages. @escapechar = `@@ -% These look ok in all fonts, so just make them not special. +% These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other -@c Set initial fonts. -@textfonts -@rm - @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @@ -6362,3 +7078,9 @@ should work if nowhere else does.} @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/gnu/usr.bin/texinfo/doc/texinfo.txi b/gnu/usr.bin/texinfo/doc/texinfo.txi index 5c1dd91962d..964e74c8d1d 100644 --- a/gnu/usr.bin/texinfo/doc/texinfo.txi +++ b/gnu/usr.bin/texinfo/doc/texinfo.txi @@ -1,6 +1,6 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $ -@c Ordinarily Texinfo files have the extension .texi. But texinfo.texi +@c $Id: texinfo.txi,v 1.6 2006/07/17 16:12:36 espie Exp $ +@c Ordinarily, Texinfo files have the extension .texi. But texinfo.texi @c clashes with texinfo.tex on 8.3 filesystems, so we use texinfo.txi. @c Everything between the start/end of header lines will be passed by @@ -10,7 +10,7 @@ @c makeinfo and texinfo.tex ignore all text before @setfilename. @c -@c Ordinarily the setfilename argument ends with .info. But +@c Ordinarily, the setfilename argument ends with .info. But @c texinfo.info-13 is too long for 14-character filesystems. @setfilename texinfo @@ -27,7 +27,6 @@ @syncodeindex vr cp @syncodeindex pg cp -@footnotestyle separate @paragraphindent 2 @c finalout @@ -38,8 +37,8 @@ This manual is for GNU Texinfo (version @value{VERSION}, @value{UPDATED}), a documentation system that can produce both online information and a printed manual from a single source. -Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99, 2000, 01, 02 -Free Software Foundation, Inc. +Copyright (C) 1988, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1998, +1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -60,6 +59,7 @@ Software Foundation raise funds for GNU development.'' * Texinfo: (texinfo). The GNU documentation format. * install-info: (texinfo)Invoking install-info. Update info/dir entries. * texi2dvi: (texinfo)Format with texi2dvi. Print Texinfo documents. +* texi2pdf: (texinfo)PDF Output. PDF output for Texinfo. * texindex: (texinfo)Format with tex/texindex. Sort Texinfo index files. * makeinfo: (texinfo)Invoking makeinfo. Translate Texinfo source. @end direntry @@ -82,7 +82,7 @@ Software Foundation raise funds for GNU development.'' @c nwnode (Same as node, but no warnings; for `makeinfo'.) -@shorttitlepage Texinfo +@shorttitlepage GNU Texinfo @titlepage @title Texinfo @@ -99,6 +99,7 @@ Software Foundation raise funds for GNU development.'' @vskip 0pt plus 1filll @insertcopying +@sp 1 Published by the Free Software Foundation @* 59 Temple Place Suite 330 @* Boston, MA 02111-1307 @* @@ -106,8 +107,9 @@ USA @* ISBN 1-882114-67-1 @c for version 4.0, September 1999. @c ISBN 1-882114-65-5 is for version 3.12, March 1998. @c ISBN 1-882114-64-7 is for edition 2.24 of November 1996. -@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995 +@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995. +@sp 1 Cover art by Etienne Suvasa. @end titlepage @@ -129,44 +131,41 @@ the menu lists all the lower level nodes in the document. @end ifnottex @menu -* Copying Conditions:: Your rights. -* Overview:: Texinfo in brief. -* Texinfo Mode:: How to use Texinfo mode. -* Beginning a File:: What is at the beginning of a Texinfo file? -* Ending a File:: What is at the end of a Texinfo file? -* Structuring:: How to create chapters, sections, subsections, - appendices, and other parts. -* Nodes:: How to write nodes. -* Menus:: How to write menus. -* Cross References:: How to write cross references. -* Marking Text:: How to mark words and phrases as code, - keyboard input, meta-syntactic - variables, and the like. -* Quotations and Examples:: How to write quotations, examples, etc. -* Lists and Tables:: How to write lists and tables. -* Indices:: How to create indices. -* Insertions:: How to insert @@-signs, braces, etc. -* Breaks:: How to force and prevent line and page breaks. -* Definition Commands:: How to describe functions and the like - in a uniform manner. -* Conditionals:: How to specify text for either @TeX{} or Info. -* Internationalization:: -* Defining New Texinfo Commands:: -* Hardcopy:: How to convert a Texinfo file to a file - for printing and how to print that file. -* Creating and Installing Info Files:: -* Command List:: All the Texinfo @@-commands. -* Tips:: Hints on how to write a Texinfo document. -* Sample Texinfo Files:: Complete examples, including full texts. -* Include Files:: How to incorporate other Texinfo files. -* Headings:: How to write page headings and footings. -* Catching Mistakes:: How to find formatting mistakes. -* Refilling Paragraphs:: All about paragraph refilling. -* Command Syntax:: A description of @@-Command syntax. -* Obtaining TeX:: How to Obtain @TeX{}. -* Copying This Manual:: The GNU Free Documentation License. -* Command and Variable Index:: A menu containing commands and variables. -* Concept Index:: A menu covering many topics. +* Copying Conditions:: Your rights. +* Overview:: Texinfo in brief. +* Texinfo Mode:: Using the GNU Emacs Texinfo mode. +* Beginning a File:: What is at the beginning of a Texinfo file? +* Ending a File:: What is at the end of a Texinfo file? +* Structuring:: Creating chapters, sections, appendices, etc. +* Nodes:: Writing nodes, the basic unit of Texinfo. +* Menus:: Writing menus. +* Cross References:: Writing cross references. +* Marking Text:: Marking words and phrases as code, + keyboard input, meta-syntactic + variables, and the like. +* Quotations and Examples:: Block quotations, examples, etc. +* Lists and Tables:: Itemized or numbered lists, and tables. +* Special Displays:: Floating figures and footnotes. +* Indices:: Creating indices. +* Insertions:: Inserting @@-signs, braces, etc. +* Breaks:: Forcing or preventing line and page breaks. +* Definition Commands:: Describing functions and the like uniformly. +* Conditionals:: Specifying text for only some output cases. +* Internationalization:: Supporting languages other than English. +* Defining New Texinfo Commands:: User-defined macros and aliases. +* Hardcopy:: Output for paper, with @TeX{}. +* Creating and Installing Info Files:: Details on Info output. +* Generating HTML:: Details on HTML output. + +* Command List:: All the Texinfo @@-commands. +* Tips:: Hints on how to write a Texinfo document. +* Sample Texinfo Files:: Complete examples, including full texts. +* Include Files:: How to incorporate other Texinfo files. +* Headings:: How to write page headings and footings. +* Catching Mistakes:: How to find formatting mistakes. +* Copying This Manual:: The GNU Free Documentation License. +* Command and Variable Index:: A menu containing commands and variables. +* Concept Index:: A menu covering many topics. @detailmenu --- The Detailed Node Listing --- @@ -175,6 +174,7 @@ Overview of Texinfo * Reporting Bugs:: Submitting effective bug reports. * Using Texinfo:: Create printed or online output. +* Output Formats:: Overview of the supported output formats. * Info Files:: What is an Info file? * Printed Books:: Characteristics of a printed book or manual. * Formatting Commands:: @@-commands are used for formatting. @@ -209,13 +209,14 @@ Updating Nodes and Menus Beginning a Texinfo File * Sample Beginning:: A sample beginning for a Texinfo file. -* Texinfo File Header:: -* Document Permissions:: +* Texinfo File Header:: The first lines. +* Document Permissions:: Ensuring your manual is free. * Titlepage & Copyright Page:: Creating the title and copyright pages. +* Contents:: How to create a table of contents. * The Top Node:: Creating the `Top' node and master menu. -* Global Document Commands:: +* Global Document Commands:: Affecting formatting throughout. * Software Copying Permissions:: Ensure that you and others continue to - have the right to use and share software. + have the right to use and share software. Texinfo File Header @@ -234,33 +235,33 @@ Title and Copyright Pages * titlepage:: Create a title for the printed document. * titlefont center sp:: The @code{@@titlefont}, @code{@@center}, - and @code{@@sp} commands. + and @code{@@sp} commands. * title subtitle author:: The @code{@@title}, @code{@@subtitle}, - and @code{@@author} commands. + and @code{@@author} commands. * Copyright:: How to write the copyright notice and - include copying permissions. + include copying permissions. * end titlepage:: Turn on page headings after the title and - copyright pages. + copyright pages. * headings on off:: An option for turning headings on and off - and double or single sided printing. + and double or single sided printing. The `Top' Node and Master Menu -* Top Node Example:: -* Master Menu Parts:: +* Top Node Example:: +* Master Menu Parts:: Global Document Commands * documentdescription:: Document summary for the HTML output. * setchapternewpage:: Start chapters on right-hand pages. * paragraphindent:: Specify paragraph indentation. +* firstparagraphindent:: Suppress indentation of the first paragraph. * exampleindent:: Specify environment indentation. Ending a Texinfo File * Printing Indices & Menus:: How to print an index in hardcopy and - generate index menus in Info. -* Contents:: How to create a table of contents. + generate index menus in Info. * File End:: How to mark the end of a file. Chapter Structuring @@ -268,20 +269,20 @@ Chapter Structuring * Tree Structuring:: A manual is like an upside down tree @dots{} * Structuring Command Types:: How to divide a manual into parts. * makeinfo top:: The @code{@@top} command, part of the `Top' node. -* chapter:: -* unnumbered & appendix:: -* majorheading & chapheading:: -* section:: -* unnumberedsec appendixsec heading:: -* subsection:: -* unnumberedsubsec appendixsubsec subheading:: +* chapter:: +* unnumbered & appendix:: +* majorheading & chapheading:: +* section:: +* unnumberedsec appendixsec heading:: +* subsection:: +* unnumberedsubsec appendixsubsec subheading:: * subsubsection:: Commands for the lowest level sections. * Raise/lower sections:: How to change commands' hierarchical level. Nodes * Two Paths:: Different commands to structure - Info output and printed output. + Info output and printed output. * Node Menu Illustration:: A diagram, and sample nodes and menus. * node:: Creating nodes, in detail. * makeinfo Pointer Creation:: Letting makeinfo determine node pointers. @@ -298,7 +299,7 @@ The @code{@@node} Command Menus -* Menu Location:: Put a menu in a short node. +* Menu Location:: Menus go at the ends of short nodes. * Writing a Menu:: What is a menu? * Menu Parts:: A menu entry has three parts. * Less Cluttered Menu Entry:: Two part menu entry. @@ -345,8 +346,9 @@ Indicating Definitions, Commands, etc. * option:: Indicating option names. * dfn:: Specifying definitions. * cite:: Referring to books not in the Info system. +* abbr:: Indicating abbreviations. * acronym:: Indicating acronyms. -* url:: Indicating a World Wide Web reference. +* indicateurl:: Indicating a World Wide Web reference. * email:: Indicating an electronic mail address. Emphasizing Text @@ -363,12 +365,13 @@ Quotations and Examples * verbatim:: Writing a verbatim example. * verbatiminclude:: Including a file verbatim. * lisp:: Illustrating Lisp code. -* small:: Forms for @code{@@smallbook}. +* small:: Examples in a smaller font. * display:: Writing an example in the current font. * format:: Writing an example without narrowed margins. * exdent:: Undo indentation on a line. * flushleft & flushright:: Pushing text flush left or flush right. * noindent:: Preventing paragraph indentation. +* indent:: Forcing paragraph indentation. * cartouche:: Drawing rounded rectangles around examples. Lists and Tables @@ -385,16 +388,38 @@ Making a Two-column Table * ftable vtable:: Automatic indexing for two-column tables. * itemx:: How to put more entries in the first column. -Multi-column Tables +@code{@@multitable}: Multi-column Tables * Multitable Column Widths:: Defining multitable column widths. * Multitable Rows:: Defining multitable rows, with examples. +Special Displays + +* Floats:: Figures, tables, and the like. +* Images:: Including graphics and images. +* Footnotes:: Writing footnotes. + +Floats + +* float:: Producing floating material. +* caption shortcaption:: Specifying descriptions for floats. +* listoffloats:: A table of contents for floats. + +Inserting Images + +* Image Syntax:: +* Image Scaling:: + +Footnotes + +* Footnote Commands:: How to write a footnote in Texinfo. +* Footnote Styles:: Controlling how footnotes appear in Info. + Indices * Index Entries:: Choose different words for index entries. * Predefined Indices:: Use different indices for different kinds - of entry. + of entries. * Indexing Commands:: How to make an index entry. * Combining Indices:: How to combine indices. * New Indices:: How to define your own indices. @@ -402,31 +427,31 @@ Indices Combining Indices * syncodeindex:: How to merge two indices, using @code{@@code} - font for the merged-from index. + font for the merged-from index. * synindex:: How to merge two indices, using the - default font of the merged-to index. + default font of the merged-to index. Special Insertions -* Braces Atsigns:: How to insert braces, @samp{@@}. +* Atsign Braces Comma:: Inserting @@ and @{@} and ,. * Inserting Space:: How to insert the right amount of space - within a sentence. + within a sentence. * Inserting Accents:: How to insert accents and special characters. * Dots Bullets:: How to insert dots and bullets. * TeX and copyright:: How to insert the @TeX{} logo - and the copyright symbol. + and the copyright symbol. +* euro:: How to insert the Euro currency symbol. * pounds:: How to insert the pounds currency symbol. * minus:: How to insert a minus sign. * math:: How to format a mathematical expression. * Glyphs:: How to indicate results of evaluation, - expansion of macros, errors, etc. -* Footnotes:: How to include footnotes. -* Images:: How to include graphics. + expansion of macros, errors, etc. -Inserting @@ and Braces +Inserting @@ and @{@} and @comma{} -* Inserting An Atsign:: How to insert @samp{@@}. -* Inserting Braces:: How to insert @samp{@{} and @samp{@}}. +* Inserting an Atsign:: +* Inserting Braces:: +* Inserting a Comma:: Inserting Space @@ -440,14 +465,15 @@ Inserting Ellipsis and Bullets * dots:: How to insert dots @dots{} * bullet:: How to insert a bullet. -Inserting @TeX{} and the Copyright Symbol +Inserting @TeX{} and Legal Symbols: @copyright{}, @registeredsymbol{} -* tex:: How to insert the @TeX{} logo. -* copyright symbol:: How to use @code{@@copyright}@{@}. +* tex:: The @TeX{} logos. +* copyright symbol:: The copyright symbol (c in a circle). +* registered symbol:: The registered symbol (R in a circle). Glyphs for Examples -* Glyphs Summary:: +* Glyphs Summary:: * result:: How to show the result of expression. * expansion:: How to indicate an expansion. * Print Glyph:: How to indicate printed output. @@ -464,31 +490,27 @@ Glyphs Summary * Equivalence:: * Point Glyph:: -Footnotes - -* Footnote Commands:: How to write a footnote in Texinfo. -* Footnote Styles:: Controlling how footnotes appear in Info. +Forcing and Preventing Breaks -Making and Preventing Breaks - -* Break Commands:: Cause and prevent splits. -* Line Breaks:: How to force a single line to use two lines. -* - and hyphenation:: How to tell @TeX{} about hyphenation points. -* w:: How to prevent unwanted line breaks. -* sp:: How to insert blank lines. -* page:: How to force the start of a new page. -* group:: How to prevent unwanted page breaks. +* Break Commands:: Summary of break-related commands. +* Line Breaks:: Forcing line breaks. +* - and hyphenation:: Helping @TeX{} with hyphenation points. +* w:: Preventing unwanted line breaks in text. +* tie:: Inserting an unbreakable but varying space. +* sp:: Inserting blank lines. +* page:: Forcing the start of a new page. +* group:: Preventing unwanted page breaks. * need:: Another way to prevent unwanted page breaks. Definition Commands -* Def Cmd Template:: How to structure a description using a - definition command. -* Optional Arguments:: How to handle optional and repeated arguments. -* deffnx:: How to group two or more `first' lines. -* Def Cmds in Detail:: All the definition commands. +* Def Cmd Template:: Writing descriptions using definition commands. +* Def Cmd Continuation Lines:: Continuing the heading over source lines. +* Optional Arguments:: Handling optional and repeated arguments. +* deffnx:: Group two or more `first' lines. +* Def Cmds in Detail:: Reference for all the definition commands. * Def Cmd Conventions:: Conventions for writing definitions. -* Sample Function Definition:: +* Sample Function Definition:: An example. The Definition Commands @@ -496,17 +518,21 @@ The Definition Commands * Variables Commands:: Commands for variables and similar entities. * Typed Functions:: Commands for functions in typed languages. * Typed Variables:: Commands for variables in typed languages. -* Abstract Objects:: Commands for object-oriented programming. * Data Types:: The definition command for data types. +* Abstract Objects:: Commands for object-oriented programming. + +Object-Oriented Programming + +* Variables: Object-Oriented Variables. +* Methods: Object-Oriented Methods. Conditionally Visible Text -* Conditional Commands:: Specifying text for HTML, Info, or @TeX{}. -* Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}. -* Raw Formatter Commands:: Using raw @TeX{} or HTML commands. -* set clear value:: Designating which text to format (for - all output formats); and how to set a - flag to a string that you can insert. +* Conditional Commands:: Text for a given format. +* Conditional Not Commands:: Text for any format other than a given one. +* Raw Formatter Commands:: Using raw formatter commands. +* set clear value:: Variable tests and substitutions. +* Conditional Nesting:: Using conditionals inside conditionals. @code{@@set}, @code{@@clear}, and @code{@@value} @@ -523,7 +549,7 @@ Defining New Texinfo Commands * Defining Macros:: Defining and undefining new commands. * Invoking Macros:: Using a macro, once you've defined it. -* Macro Details:: Beyond basic macro usage. +* Macro Details:: Limitations of Texinfo macros. * alias:: Command aliases. * definfoenclose:: Customized highlighting. @@ -542,14 +568,15 @@ Formatting and Printing Hardcopy * smallbook:: How to print small format books and manuals. * A4 Paper:: How to print on A4 or A5 paper. * pagesizes:: How to print with customized page sizes. -* Cropmarks and Magnification:: How to print marks to indicate the size - of pages and how to print scaled up output. +* Cropmarks and Magnification:: How to print marks to indicate the size + of pages and how to print scaled up output. * PDF Output:: Portable Document Format output. +* Obtaining TeX:: How to Obtain @TeX{}. Creating and Installing Info Files -* Creating an Info File:: -* Installing an Info File:: +* Creating an Info File:: +* Installing an Info File:: Creating an Info File @@ -559,38 +586,62 @@ Creating an Info File * Pointer Validation:: How to check that pointers point somewhere. * makeinfo in Emacs:: How to run @code{makeinfo} from Emacs. * texinfo-format commands:: Two Info formatting commands written - in Emacs Lisp are an alternative - to @code{makeinfo}. + in Emacs Lisp are an alternative + to @code{makeinfo}. * Batch Formatting:: How to format for Info in Emacs Batch mode. * Tag and Split Files:: How tagged and split files help Info - to run better. -* makeinfo html:: Generating HTML output. + to run better. Installing an Info File * Directory File:: The top level menu for all Info files. * New Info File:: Listing a new Info file. * Other Info Directories:: How to specify Info files that are - located in other directories. + located in other directories. * Installing Dir Entries:: How to specify what menu entry to add - to the Info directory. + to the Info directory. * Invoking install-info:: @code{install-info} options. +Generating HTML + +* HTML Translation:: Details of the HTML output. +* HTML Splitting:: How HTML output is split. +* HTML CSS:: Influencing HTML output with Cascading Style Sheets. +* HTML Xref:: Cross-references in HTML output. + +HTML Cross-references + +* Link Basics: HTML Xref Link Basics. +* Node Expansion: HTML Xref Node Name Expansion. +* Command Expansion: HTML Xref Command Expansion. +* 8-bit Expansion: HTML Xref 8-bit Character Expansion. +* Mismatch: HTML Xref Mismatch. + +@@-Command List + +* Command Syntax:: General syntax for varieties of @@-commands. + Sample Texinfo Files -* Short Sample Texinfo File:: -* GNU Sample Texts:: +* Short Sample Texinfo File:: +* GNU Sample Texts:: +* Verbatim Copying License:: +* All-permissive Copying License:: + +Copying This Manual + +* GNU Free Documentation License:: License for copying this manual. Include Files * Using Include Files:: How to use the @code{@@include} command. * texinfo-multiple-files-update:: How to create and update nodes and - menus when using included files. -* Include File Requirements:: What @code{texinfo-multiple-files-update} expects. + menus when using included files. +* Include Files Requirements:: @code{texinfo-multiple-files-update} needs. * Sample Include File:: A sample outer file with included files - within it; and a sample included file. + within it; and a sample included file. * Include Files Evolution:: How use of the @code{@@include} command - has changed over time. + has changed over time. Page Headings @@ -694,6 +745,7 @@ that one document. @menu * Reporting Bugs:: Submitting effective bug reports. * Using Texinfo:: Create printed or online output. +* Output Formats:: Overview of the supported output formats. * Info Files:: What is an Info file? * Printed Books:: Characteristics of a printed book or manual. * Formatting Commands:: @@-commands are used for formatting. @@ -735,9 +787,9 @@ better to include too much than to leave out something important. @cindex Patches, contributing Patches are most welcome; if possible, please make them with -@samp{@w{diff -c}} (@pxref{Top,, Overview, diffutils, Comparing and -Merging Files}) and include @file{ChangeLog} entries (@pxref{Change -Log,,, emacs, The GNU Emacs Manual}). +@samp{@w{diff -c}} (@pxref{Top,, Overview, diff, Comparing and Merging +Files}) and include @file{ChangeLog} entries (@pxref{Change Log,,, +emacs, The GNU Emacs Manual}). When sending patches, if possible please do not encode or split them in any way; it's much easier to deal with one plain text message, however @@ -753,62 +805,27 @@ for email. @cindex Texinfo, introduction to @cindex Introduction to Texinfo -Using Texinfo, you can create a printed document with the normal -features of a book, including chapters, sections, cross references, and -indices. From the same Texinfo source file, you can create a -menu-driven, online Info file with nodes, menus, cross references, and -indices. You can also create from that same source file an HTML output -file suitable for use with a web browser, or an XML file. @cite{The GNU -Emacs Manual} is a good example of a Texinfo file, as is this manual. - -To make a printed document, you process a Texinfo source file with the -@TeX{} typesetting program (but the Texinfo language is very different -and much stricter than @TeX{}'s usual language, plain @TeX{}). This -creates a DVI file that you can typeset and print as a book or report -(@pxref{Hardcopy}). - -@pindex makeinfo -To output an Info file, process your Texinfo source with the -@code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command. -You can install the result in your Info tree (@pxref{Installing an Info -File}). - -To output an HTML file, run @code{makeinfo --html} on your Texinfo -source. You can (for example) install the result on your web site. - -@cindex Docbook, converting to Texinfo -@cindex Conversion, from Docbook to Texinfo -To output an XML file, run @code{makeinfo --xml} on your Texinfo source. -To output DocBook (a particular form of XML), run @code{makeinfo ---docbook}. If you want to convert from Docbook @emph{to} Texinfo, -please see @uref{http://docbook2X.sourceforge.net/}. - -@cindex Output formats, supporting more -@cindex SGML-tools output format -If you are a programmer and would like to contribute to the GNU project -by implementing additional output formats for Texinfo, that would be -excellent. But please do not write a separate translator texi2foo for -your favorite format foo! That is the hard way to do the job, and makes -extra work in subsequent maintenance, since the Texinfo language is -continually being enhanced and updated. Instead, the best approach is -modify @code{makeinfo} to generate the new format, as it does now for -Info, plain text, HTML, XML, and DocBook. +Using Texinfo, you can create a printed document (via the @TeX{} +typesetting system) the normal features of a book, including chapters, +sections, cross references, and indices. From the same Texinfo source +file, you can create an Info file with special features to make +documentation browsing easy. You can also create from that same +source file an HTML output file suitable for use with a web browser, +or an XML file. See the next section (@pxref{Output Formats}) for +details and the exact commands to generate output from the source. @TeX{} works with virtually all printers; Info works with virtually all computer terminals; the HTML output works with virtually all web browsers. Thus Texinfo can be used by almost any computer user. -@cindex Source file -A Texinfo source file is a plain @sc{ascii} file containing text and -@dfn{@@-commands} (words preceded by an @samp{@@}) that tell the -typesetting and formatting programs what to do. You may edit a Texinfo -file with any text editor; but it is especially convenient to use GNU -Emacs since that editor has a special mode, called Texinfo mode, that -provides various Texinfo-related features. (@xref{Texinfo Mode}.) - -Before writing a Texinfo source file, you should learn about nodes, -menus, cross references, and the rest, for example by reading this -manual. +@cindex Source file format +A Texinfo source file is a plain @sc{ascii} file containing text +interspersed with @dfn{@@-commands} (words preceded by an @samp{@@}) +that tell the typesetting and formatting programs what to do. You can +edit a Texinfo file with any text editor, but it is especially +convenient to use GNU Emacs since that editor has a special mode, +called Texinfo mode, that provides various Texinfo-related features. +(@xref{Texinfo Mode}.) You can use Texinfo to create both online help and printed manuals; moreover, Texinfo is freely redistributable. For these reasons, Texinfo @@ -816,30 +833,138 @@ is the official documentation format of the GNU project. More information is available at the @uref{http://www.gnu.org/doc/, GNU documentation web page}. + +@node Output Formats +@section Output Formats +@cindex Output formats +@cindex Back-end output formats + +Here is a brief overview of the output formats currently supported by +Texinfo. + +@table @asis +@item Info +@cindex Info output +(Generated via @command{makeinfo}.) This format is essentially a +plain text transliteration of the Texinfo source. It adds a few +control characters to separate nodes and provide navigational +information for menus, cross-references, indices, and so on. See the +next section (@pxref{Info Files}) for more details on this format. +The Emacs Info subsystem (@pxref{Top,,Getting Started,info, Info}), +and the standalone @command{info} program (@pxref{Top +,, Info Standalone, info-stnd, GNU Info}), among others, can read these +files. @xref{Creating and Installing Info Files}. + +@item Plain text +@cindex Plain text output +(Generated via @command{makeinfo --no-headers}.) This is almost the +same as Info output, except the navigational control characters are +omitted. Also, standard output is used by default. + +@item HTML +@cindex HTML output +@cindex W3 consortium +@cindex Mozilla +@cindex Lynx +@cindex Emacs-W3 +(Generated via @command{makeinfo --html}.) This is the Hyper Text +Markup Language that has become the most commonly used language for +writing documents on the World Wide Web. Web browsers, such as +Mozilla, Lynx, and Emacs-W3, can render this language online. There +are many versions of HTML; @command{makeinfo} tries to use a subset +of the language that can be interpreted by any common browser. For +details of the HTML language and much related information, see +@uref{http://www.w3.org/MarkUp/}. @xref{Generating HTML}. + +@item DVI +@cindex DVI output +@pindex dvips +@pindex xdvi +(Generated via @command{texi2dvi}.) This DeVice Independent binary +format is output by the @TeX{} typesetting program +(@uref{http://tug.org}). This is then read by a DVI `driver', which +writes the actual device-specific commands that can be viewed or +printed, notably Dvips for translation to PostScript (@pxref{Invoking +Dvips,,, dvips, Dvips}) and Xdvi for viewing on an X display +(@uref{http://sourceforge.net/projects/xdvi/}). @xref{Hardcopy}. + +Be aware that the Texinfo language is very different from and much +stricter than @TeX{}'s usual languages, plain @TeX{} and @LaTeX{}. +For more information on @TeX{} in general, please see the book +@cite{@TeX{} for the Impatient}, available from +@uref{http://savannah.gnu.org/projects/teximpatient}. + +@item PDF +@cindex PDF output +@cindex Beebe, Nelson +@pindex pdftex +(Generated via @command{texi2dvi --pdf} or @command{texi2pdf}.) This +was developed by Adobe Systems for portable document interchange, +based on their previous PostScript language. It can represent the exact +appearance of a document, including fonts, and supporting arbitrary +scaling. It is intended to be platform-independent and easily +viewable, among other design goals; for a discussion, see +@uref{http://tug.org/TUGboat/Articles/tb22-3/tb72beebeI.pdf}. Texinfo +uses the @command{pdftex} program, a variant of @TeX{}, to output PDF; +see @uref{http://tug.org/applications/pdftex}. @xref{PDF Output}. + +@item XML +@cindex XML output +@cindex DTD, for Texinfo XML +@pindex texinfo.dtd +(Generated via @command{makeinfo --xml}.) XML is a generic syntax +specification usable for any sort of content (see, for example, +@uref{http://www.w3.org/XML/}). The @command{makeinfo} xml output, +unlike all the formats above, interprets very little of the Texinfo +source. Rather, it merely translates the Texinfo markup commands into +XML syntax, for processing by further XML tools. The particular +syntax output is defined in the file @file{texinfo.dtd} included in +the Texinfo source distribution. + +@item Docbook +@cindex Docbook output +(Generated via @command{makeinfo --docbook}.) This is an XML-based +format developed some years ago, primarily for technical +documentation. It therefore bears some resemblance, in broad +outlines, to Texinfo. See @uref{http://www.docbook.org}. If you want +to convert from Docbook @emph{to} Texinfo, please see +@uref{http://docbook2X.sourceforge.net}. + +@end table + @cindex Man page output, not supported From time to time, proposals are made to generate traditional Unix man -pages from Texinfo source. This is not likely to ever be supported, -because man pages have a very strict conventional format. Merely -enhancing @command{makeinfo} to output troff format would be -insufficient. Generating a good man page therefore requires a +pages from Texinfo source. However, because man pages have a very +strict conventional format, generating a good man page requires a completely different source than the typical Texinfo applications of -writing a good user tutorial or a good reference manual. This makes -generating man pages incompatible with the Texinfo design goal of not -having to document the same information in different ways for different -output formats. You might as well just write the man page directly. +writing a good user tutorial and/or a good reference manual. This +makes generating man pages incompatible with the Texinfo design goal +of not having to document the same information in different ways for +different output formats. You might as well just write the man page +directly. -@pindex help2man +@pindex help2man @cindex O'Dea, Brendan -Man pages still have their place, and if you wish to support them, the -program @command{help2man} may be useful; it generates a traditional man -page from the @samp{--help} output of a program. In fact, this is -currently used to generate man pages for the Texinfo programs -themselves. It is GNU software written by Brendan O'Dea, available from -@uref{ftp://ftp.gnu.org/gnu/help2man/}. +Man pages still have their place, and if you wish to support them, you +may find the program @command{help2man} to be useful; it generates a +traditional man page from the @samp{--help} output of a program. In +fact, this is currently used to generate man pages for the programs in +the Texinfo distribution. It is GNU software written by Brendan +O'Dea, available from @uref{ftp://ftp.gnu.org/gnu/help2man/}. + +@cindex Output formats, supporting more +@cindex SGML-tools output format +If you are a programmer and would like to contribute to the GNU project +by implementing additional output formats for Texinfo, that would be +excellent. But please do not write a separate translator texi2foo for +your favorite format foo! That is the hard way to do the job, and makes +extra work in subsequent maintenance, since the Texinfo language is +continually being enhanced and updated. Instead, the best approach is +modify @code{makeinfo} to generate the new format. @node Info Files -@section Info files +@section Info Files @cindex Info files An Info file is a Texinfo file formatted so that the Info documentation @@ -854,9 +979,7 @@ which are identified by their names. The Info program displays one node at a time, and provides commands with which the user can move to other related nodes. -@ifinfo -@inforef{Top, info, info}, for more information about using Info. -@end ifinfo +@xref{Top,,, info, GNU Info}, for more information about using Info. Each node of an Info file may have any number of child nodes that describe subtopics of the node's topic. The names of child @@ -912,7 +1035,7 @@ the command line (@pxref{Top,,, info, Info}). If you want to read through an Info file in sequence, as if it were a printed manual, you can hit @key{SPC} repeatedly, or you get the whole -file with the advanced Info command @kbd{g *}. (@inforef{Expert, +file with the advanced Info command @kbd{g *}. (@inforef{Advanced, Advanced Info commands, info}.)@refill @c !!! dir file may be located in one of many places: @@ -975,7 +1098,7 @@ file @file{texinfo.tex} that contains information (definitions or to @TeX{} commands, which @TeX{} can then process to create the typeset document.) @file{texinfo.tex} contains the specifications for printing a document. You can get the latest version of @file{texinfo.tex} from -@uref{ftp://ftp.gnu.org/gnu/texinfo.tex}. +@uref{ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex}. In the United States, documents are most often printed on 8.5 inch by 11 inch pages (216@dmn{mm} by 280@dmn{mm}); this is the default size. But @@ -1020,9 +1143,8 @@ by @samp{@@}; they are called @dfn{@@-commands}. For example, @code{@@node} is the command to indicate a node and @code{@@chapter} is the command to indicate the start of a chapter.@refill -@quotation -@strong{Please note:} All the @@-commands, with the exception of the -@code{@@TeX@{@}} command, must be written entirely in lower case. +@quotation Note +Almost all @@ command names are entirely lower case. @end quotation The Texinfo @@-commands are a strictly limited set of constructs. The @@ -1047,10 +1169,9 @@ sentences: @itemize @bullet @item -Write a command such as @code{@@noindent} at the beginning of a line as -the only text on the line. (@code{@@noindent} prevents the beginning of -the next line from being indented as the beginning of a -paragraph.)@refill +Write a command such as @code{@@quotation} at the beginning of a line as +the only text on the line. (@code{@@quotation} begins an indented +environment.) @item Write a command such as @code{@@chapter} at the beginning of a line @@ -1070,7 +1191,7 @@ marks text as being code.)@refill @item Write a command such as @code{@@example} on a line of its own; write the body-text on following lines; and write the matching @code{@@end} -command, @code{@@end example} in this case, at the on a line of its own +command, @code{@@end example} in this case, on a line of its own after the body-text. (@code{@@example} @dots{} @code{@@end example} indents and typesets body-text as an example.) It's usually ok to indent environment commands like this, but in complicated and @@ -1087,9 +1208,9 @@ they do not need braces.@refill As you gain experience with Texinfo, you will rapidly learn how to write the different commands: the different ways to write commands -make it easier to write and read Texinfo files than if all commands -followed exactly the same syntax. (For details about @@-command -syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill +actually make it easier to write and read Texinfo files than if all +commands followed exactly the same syntax. @xref{Command Syntax, , +@@-Command Syntax}, for all the details. @node Conventions @@ -1097,11 +1218,13 @@ syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill @cindex General syntactic conventions @cindex Syntactic conventions @cindex Conventions, syntactic +@cindex Characters, basic input This section describes the general conventions used in all Texinfo documents. @itemize @bullet @item +@cindex Source files, characters used All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and @samp{@}} can appear in a Texinfo file and stand for themselves. @samp{@@} is the escape character which introduces commands, while @@ -1111,50 +1234,68 @@ an @samp{@@} character in front of it, like this: @samp{@@@@}, @samp{@@@{}, and @samp{@@@}}. @item -It is customary in @TeX{} to use doubled single-quote characters to -begin and end quotations: @w{@t{`@w{}`@dots{}'@w{}'}}. This -convention should be followed in Texinfo files. @TeX{} converts -two single quotes to left- and right-hand doubled -quotation marks, -@c this comes out as "like this" in Info, of course, which is just confusing. +@cindex Paragraph separator +@cindex Blank lines, as paragraph separator +@cindex Newlines, as blank lines +Separate paragraphs with one or more blank lines. Currently Texinfo +only recognizes newline characters as end of line, not the CRLF +sequence used on some systems; so a @dfn{blank line} means exactly two +consecutive newlines. Sometimes blank lines are useful or convenient +in other cases as well; you can use the @code{@@noindent} to inhibit +paragraph indentation if required (@pxref{noindent,,@code{@@noindent}}). + +@item +@cindex Quotation characters (`'), in source +Use doubled single-quote characters to begin and end quotations: +@w{@t{`@w{}`@dots{}'@w{}'}}. @TeX{} converts two single quotes to +left- and right-hand doubled quotation marks, +@c this comes out as "like this" in Info, which is just confusing. @iftex -``like this'', +``like this'', @end iftex and Info converts doubled single-quote characters to @sc{ascii} double-quotes: @w{@t{`@w{}`@dots{}'@w{}'}} becomes @w{@t{"@dots{}"}}. -@item -Use three hyphens in a row, @samp{---}, for a dash---like this. In -@TeX{}, a single or double hyphen produces a printed dash that is -shorter than the usual typeset dash. Info reduces three hyphens to two -for display on the screen. +You may occasionally need to produce two consecutive single quotes; +for example, in documenting a computer language such as Maxima where +@t{'@w{}'} is a valid command. You can do this with the input +@t{'@@w@{@}'}; the empty @code{@@w} command stops the combination into +the double-quote characters. -@item -To prevent a paragraph from being indented in the printed manual, put -the command @code{@@noindent} on a line by itself before the -paragraph. +@cindex Unicode quotation characters +@cindex Grave accent, vs.@: left quote +The left quote character (@t{`}, ASCII code 96) used in Texinfo is a +grave accent in ANSI and ISO character set standards. We use it as a +quote character because that is how @TeX{} is set up, by default. We +hope to eventually support the various quotation characters in +Unicode. @item -If you mark off a region of the Texinfo file with the @code{@@iftex} -and @w{@code{@@end iftex}} commands, that region will appear only in -the printed copy; in that region, you can use certain commands -borrowed from plain @TeX{} that you cannot use in Info. Conversely, -text surrounded by @code{@@ifnottex} and @code{@@end ifnottex} will -appear in all output formats @emph{except} @TeX{}. - -Each of the other output formats (@code{html}, @code{info}, -@code{plaintext}) have an analogous pair of commands. @xref{Conditionals}. -@end itemize +@cindex Multiple dashes in source +@cindex Dashes in source +@cindex Hyphens in source, two or three in a row +@cindex Em dash, producing +@cindex En dash, producing +Use three hyphens in a row, @samp{---}, to produce a long dash---like +this (called an @dfn{em dash}), used for punctuation in sentences. +Use two hyphens, @samp{--}, to produce a medium dash (called an +@dfn{en dash}), used primarily for numeric ranges, as in ``June +25--26''. Use a single hyphen, @samp{-}, to produce a standard hyphen +used in compound words. For display on the screen, Info reduces three +hyphens to two and two hyphens to one (not transitively!). Of course, +any number of hyphens in the source remain as they are in literal +contexts, such as @code{@@code} and @code{@@example}. +@item @cindex Tabs; don't use! -@quotation -@strong{Caution:} Do not use tab characters in a Texinfo file (except in -verbatim modes)! @TeX{} uses variable-width fonts, which means that it -is impractical at best to define a tab to work in all circumstances. -Consequently, @TeX{} treats tabs like single spaces, and that is not -what they look like. Furthermore, @code{makeinfo} does nothing special -with tabs, and thus a tab character in your input file may appear -differently in the output, for example, in indented text. +@strong{Caution:} Last and most important, do not use tab characters +in a Texinfo file (except in verbatim modes)! @TeX{} uses +variable-width fonts, which means that it is impractical at best to +define a tab to work in all circumstances. Consequently, @TeX{} +treats tabs like single spaces, and that is not what they look like in +the source. Furthermore, @code{makeinfo} does nothing special with +tabs, and thus a tab character in your input file will usually appear +differently in the output. @noindent To avoid this problem, Texinfo mode causes GNU Emacs to insert multiple @@ -1162,9 +1303,9 @@ spaces when you press the @key{TAB} key. @noindent Also, you can run @code{untabify} in Emacs to convert tabs in a region -to multiple spaces. -@end quotation +to multiple spaces, or use the @code{unexpand} command from the shell. +@end itemize @node Comments @section Comments @@ -1350,7 +1491,8 @@ boilerplate; when writing a manual, you simply change the names as appropriate. @xref{Beginning a File}, for full documentation on the commands listed -here. @xref{GNU Sample Texts}, for the full texts to be used in GNU manuals. +here. @xref{GNU Sample Texts}, for the full texts to be used in GNU +manuals. In the following, the sample text is @emph{indented}; comments on it are not. The complete file, without interspersed comments, is shown in @@ -1384,7 +1526,7 @@ which it is distributed. @xref{GNU Sample Texts}. @@copying This is a short example of a complete Texinfo file, version 1.0. -Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. +Copyright @@copyright@{@} 2004 Free Software Foundation, Inc. @@end copying @end group @end example @@ -1419,24 +1561,23 @@ writing it out again; it is output on the back of the title page. The @subheading Part 4: `Top' Node and Master Menu @noindent -The `Top' node contains the master menu for the Info file. Since a -printed manual uses a table of contents rather than a menu, the master -menu appears only in online output. We also include the copying text -again for the benefit of online readers. And since the copying text -begins with a brief description of the manual, no other text is needed. +The `Top' node contains the master menu for the Info file. Since the +printed manual uses a table of contents rather than a menu, it +excludes the `Top' node. We also include the copying text again for +the benefit of online readers. Since the copying text begins with +a brief description of the manual, no other text is needed in this +case. The @samp{@@top} command itself helps @command{makeinfo} +determine the relationships between nodes. @example -@group @@ifnottex @@node Top -@@end ifnottex -@end group -@end example +@@top Short Sample -@example -@group @@insertcopying +@@end ifnottex +@group @@menu * First Chapter:: The first chapter is the only chapter in this sample. @@ -1608,14 +1749,11 @@ chapters which describe the Texinfo formatting language in detail. * Texinfo Mode Summary:: Summary of all the Texinfo mode commands. @end menu -@node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode -@ifinfo -@heading Texinfo Mode Overview -@end ifinfo +@node Texinfo Mode Overview +@section Texinfo Mode Overview -Texinfo mode provides special features for working with Texinfo -files. -You can:@refill +Texinfo mode provides special features for working with Texinfo files. +You can: @itemize @bullet @item @@ -1647,7 +1785,7 @@ Typeset and print part or all of a file.@refill Perhaps the two most helpful features are those for inserting frequently used @@-commands and for creating node pointers and menus.@refill -@node Emacs Editing, Inserting, Texinfo Mode Overview, Texinfo Mode +@node Emacs Editing @section The Usual GNU Emacs Editing Commands In most cases, the usual Text mode commands work the same in Texinfo @@ -1688,7 +1826,7 @@ mode as you wish. In particular, the keybindings are very easy to change. The keybindings described here are the default or standard ones.@refill -@node Inserting, Showing the Structure, Emacs Editing, Texinfo Mode +@node Inserting @comment node-name, next, previous, up @section Inserting Frequently Used Commands @cindex Inserting frequently used commands @@ -1830,7 +1968,7 @@ whole job. You must edit the inserted text since a title tends to use the same words as a node name but a useful description uses different words.@refill -@node Showing the Structure, Updating Nodes and Menus, Inserting, Texinfo Mode +@node Showing the Structure @comment node-name, next, previous, up @section Showing the Section Structure of a File @cindex Showing the section structure of a file @@ -1893,7 +2031,7 @@ commands to move forward and backward by chapter, and to use the @xref{Pages, , , emacs, The GNU Emacs Manual}, for more information about the page commands.@refill -@node Updating Nodes and Menus, Info Formatting, Showing the Structure, Texinfo Mode +@node Updating Nodes and Menus @comment node-name, next, previous, up @section Updating Nodes and Menus @cindex Updating nodes and menus @@ -1920,10 +2058,8 @@ node pointers by hand, which is a tedious task.@refill nodes in sequence. @end menu -@node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus -@ifinfo -@subheading The Updating Commands -@end ifinfo +@node Updating Commands +@subsection The Updating Commands You can use the updating commands to:@refill @@ -2076,11 +2212,10 @@ This updates all the nodes and menus.@refill The @code{texinfo-column-for-description} variable specifies the column to which menu descriptions are indented. By default, the value is 32 although it is often useful to reduce it to as low as 24. You -can set the variable with the @kbd{M-x edit-options} command -(@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs -Manual}) or with the @kbd{M-x set-variable} command (@pxref{Examining, -, Examining and Setting Variables, emacs, The GNU Emacs -Manual}).@refill +can set the variable via customization (@pxref{Changing an Option,,, +emacs, The GNU Emacs Manual}) or with the @kbd{M-x set-variable} +command (@pxref{Examining, , Examining and Setting Variables, emacs, +The GNU Emacs Manual}). Also, the @code{texinfo-indent-menu-description} command may be used to indent existing menu descriptions to a specified column. Finally, if @@ -2203,13 +2338,7 @@ update all the menus and all the `Next', `Previous', and `Up' pointers of all the included files before creating and inserting a master menu in the outer file. The @code{texinfo-multiple-files-update} command is described in the appendix on @code{@@include} files. -@ifinfo -@xref{texinfo-multiple-files-update}.@refill -@end ifinfo -@iftex -@xref{texinfo-multiple-files-update, , -@code{texinfo-multiple-files-update}}.@refill -@end iftex +@xref{texinfo-multiple-files-update}. @item M-x texinfo-indent-menu-description @findex texinfo-indent-menu-description @@ -2235,7 +2364,7 @@ interactive), the @code{texinfo-sequential-node-update} command sequentially updates all the nodes in the region.@refill @end table -@node Info Formatting, Printing, Updating Nodes and Menus, Texinfo Mode +@node Info Formatting @comment node-name, next, previous, up @section Formatting for Info @cindex Formatting for Info @@ -2294,9 +2423,9 @@ include a line that has @code{@@setfilename} in its header. @xref{Creating an Info File}, for details about Info formatting.@refill -@node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode +@node Printing @comment node-name, next, previous, up -@section Formatting and Printing +@section Printing @cindex Formatting for printing @cindex Printing a region or buffer @cindex Region formatting and printing @@ -2358,7 +2487,7 @@ end-of-header lines.)@refill @xref{Hardcopy}, for a description of the other @TeX{} related commands, such as @code{tex-show-print-queue}.@refill -@node Texinfo Mode Summary, , Printing, Texinfo Mode +@node Texinfo Mode Summary @comment node-name, next, previous, up @section Texinfo Mode Summary @@ -2388,8 +2517,8 @@ C-c C-c @} @r{Move out of enclosing braces.} @group C-c C-c C-d @r{Insert a node's section title} - @r{in the space for the description} - @r{in a menu entry line.} + @r{in the space for the description} + @r{in a menu entry line.} @end group @end example @@ -2412,13 +2541,13 @@ be used to update every node and menu in a file as well.@refill @group C-c C-u m M-x texinfo-master-menu - @r{Create or update a master menu.} + @r{Create or update a master menu.} @end group @group C-u C-c C-u m @r{With @kbd{C-u} as a prefix argument, first} - @r{create or update all nodes and regular} - @r{menus, and then create a master menu.} + @r{create or update all nodes and regular} + @r{menus, and then create a master menu.} @end group @end example @@ -2446,13 +2575,13 @@ C-c C-u C-m @r{Make or update a menu.} @group C-c C-u C-a @r{Make or update all} - @r{menus in a buffer.} + @r{menus in a buffer.} @end group @group C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,} - @r{first create or update all nodes and} - @r{then create or update all menus.} + @r{first create or update all nodes and} + @r{then create or update all menus.} @end group @end example @@ -2515,27 +2644,27 @@ they are rarely used. @example @group M-x texinfo-insert-node-lines - @r{Insert missing @code{@@node} lines in region.} - @r{With @kbd{C-u} as a prefix argument,} - @r{use section titles as node names.} + @r{Insert missing @code{@@node} lines in region.} + @r{With @kbd{C-u} as a prefix argument,} + @r{use section titles as node names.} @end group @group M-x texinfo-multiple-files-update - @r{Update a multi-file document.} - @r{With @kbd{C-u 2} as a prefix argument,} - @r{create or update all nodes and menus} - @r{in all included files first.} + @r{Update a multi-file document.} + @r{With @kbd{C-u 2} as a prefix argument,} + @r{create or update all nodes and menus} + @r{in all included files first.} @end group @group M-x texinfo-indent-menu-description - @r{Indent descriptions.} + @r{Indent descriptions.} @end group @group M-x texinfo-sequential-node-update - @r{Insert node pointers in strict sequence.} + @r{Insert node pointers in strict sequence.} @end group @end example @@ -2548,27 +2677,36 @@ M-x texinfo-sequential-node-update Certain pieces of information must be provided at the beginning of a Texinfo file, such as the name for the output file(s), the title of the -document, and the Top node. +document, and the Top node. A table of contents is also generally +produced here. This chapter expands on the minimal complete Texinfo source file -previously given (@pxref{Six Parts}). +previously given (@pxref{Six Parts}). It describes the numerous +commands for handling the traditional frontmatter items in Texinfo. + +@cindex Frontmatter, text in +Straight text outside of any command before the Top node should be +avoided. Such text is treated differently in the different output +formats: visible in @TeX{} and HTML, by default not shown in Info +readers, and so on. @menu * Sample Beginning:: A sample beginning for a Texinfo file. * Texinfo File Header:: The first lines. * Document Permissions:: Ensuring your manual is free. * Titlepage & Copyright Page:: Creating the title and copyright pages. +* Contents:: How to create a table of contents. * The Top Node:: Creating the `Top' node and master menu. * Global Document Commands:: Affecting formatting throughout. * Software Copying Permissions:: Ensure that you and others continue to - have the right to use and share software. + have the right to use and share software. @end menu @node Sample Beginning @section Sample Texinfo File Beginning -@cindex Example beginning of Texinfo file +@cindex Example beginning of Texinfo file The following sample shows what is needed. The elements given here are explained in more detail in the following sections. Other commands are @@ -2615,7 +2753,7 @@ Permission is granted to @dots{} Published by @dots{} @@end titlepage -@@c So the toc is printed in the right place. +@@c So the toc is printed at the start. @@contents @@ifnottex @@ -2629,7 +2767,7 @@ Published by @dots{} @@menu * First Chapter:: Getting started @dots{} * Second Chapter:: @dots{} - @dots{} + @dots{} * Copying:: Your rights and freedoms. @@end menu @end group @@ -2824,20 +2962,20 @@ anything on the line after the command is considered part of the title, including what would otherwise be a comment. The @code{@@settitle} command should precede everything that generates -actual output in @TeX{}. +actual output. The best place for it is right after the +@code{@@setfilename} command (see the previous section). @cindex <title> HTML tag -In the HTML file produced by @command{makeinfo}, @var{title} also serves -as the document @samp{<title>} and the default document description in -the @samp{<head>} part; see @ref{documentdescription}, for how to change -that. +In the HTML file produced by @command{makeinfo}, @var{title} serves as +the document @samp{<title>}. It also becomes the default document +description in the @samp{<head>} part (@pxref{documentdescription}). The title in the @code{@@settitle} command does not affect the title as it appears on the title page. Thus, the two do not need not match exactly. A practice we recommend is to include the version or edition number of the manual in the @code{@@settitle} title; on the title page, the version number generally appears as a @code{@@subtitle} so it would -be omitted from the @code{@@title}. (@xref{titlepage}.) +be omitted from the @code{@@title}. @xref{titlepage}. Conventionally, when @TeX{} formats a Texinfo file for double-sided output, the title is printed in the left-hand (even-numbered) page @@ -2886,25 +3024,26 @@ this text once, and another command (@code{@@insertcopying}) to insert the text at appropriate points. @menu -* copying:: Declare the document's copying permissions. -* insertcopying:: Where to insert the permissions. +* copying:: Declare the document's copying permissions. +* insertcopying:: Where to insert the permissions. @end menu @node copying -@subsection @code{@@copying}: Declare copying permissions +@subsection @code{@@copying}: Declare Copying Permissions @findex copying The @code{@@copying} command should be given very early in the document; -right after the header material (@pxref{Texinfo File Header}) is the -recommended location. It conventionally consists of a sentence or two -about what the program is, the legal copyright line, and the copying -permissions. Here is a skeletal example: +the recommended location is right after the header material +(@pxref{Texinfo File Header}). It conventionally consists of a sentence +or two about what the program is, identification of the documentation +itself, the legal copyright line, and the copying permissions. Here is +a skeletal example: @example @@copying -This manual is for @var{program} (version @var{version}), -which @dots{} +This manual is for @var{program} (version @var{version}, updated +@var{date}), which @dots{} Copyright @@copyright@{@} @var{years} @var{copyright-owner}. @@ -2919,7 +3058,8 @@ readability in some contexts. @xref{GNU Sample Texts}, for the full text to be used in GNU manuals. @xref{GNU Free Documentation License}, for the license itself under -which GNU and other free manuals are distributed. +which GNU and other free manuals are distributed. You need to include +the license as an appendix to your document. The text of @code{@@copying} is output as a comment at the beginning of Info, HTML, and XML output files. It is @emph{not} output implicitly in @@ -2927,10 +3067,10 @@ plain text or @TeX{}; it's up to you to use @code{@@insertcopying} to emit the copying information. See the next section for details. @findex copyright -In output formats that support it (print and HTML), the -@code{@@copyright@{@}} command generates a @samp{c} inside a circle. In -Info and plain text, it generates @samp{(C)}. The copyright notice -itself has the following legally defined sequence: +The @code{@@copyright@{@}} command generates a @samp{c} inside a circle +in output formats that support this (print and HTML). In the other +formats (Info and plain text), it generates @samp{(C)}. The copyright +notice itself has the following legally defined sequence: @example Copyright @copyright{} @var{years} @var{copyright-owner}. @@ -2938,26 +3078,33 @@ Copyright @copyright{} @var{years} @var{copyright-owner}. @cindex Copyright word, always in English The word `Copyright' must always be written in English, even if the -manual is otherwise in another language. This is due to international -law. +document is otherwise written in another language. This is due to +international law. @cindex Years, in copyright line The list of years should include all years in which a version was completed (even if it was released in a subsequent year). Ranges are -not allowed, each year must be written out individually, separated by -commas. +not allowed; each year must be written out individually and in full, +separated by commas. -@cindex Copyright owner for FSF works +@cindex Copyright holder for FSF works +@cindex Holder of copyright for FSF works +@cindex Owner of copyright for FSF works The copyright owner (or owners) is whoever holds legal copyright on the work. In the case of works assigned to the FSF, the owner is `Free Software Foundation, Inc.'. +The copyright `line' may actually be split across multiple +lines, both in the source document and in the output. This often +happens for documents with a long history, having many different years +of publication. + @xref{Copyright Notices,,,maintain,GNU Maintenance Instructions}, for additional information. @node insertcopying -@subsection @code{@@insertcopying}: Include permissions text +@subsection @code{@@insertcopying}: Include Permissions Text @findex insertcopying @cindex Copying text, including @cindex Permissions text, including @@ -2970,13 +3117,13 @@ itself, like this: @@insertcopying @end example -It inserts the text previously defined by @code{@@copying}. Legally, it -must be used on the copyright page in the printed manual -(@pxref{Copyright}). +This inserts the text previously defined by @code{@@copying}. To meet +legal requirements, it must be used on the copyright page in the printed +manual (@pxref{Copyright}). -Although it's not a legal requirement, we also strongly recommend using -@code{@@insertcopying} in the Top node of your manual (@pxref{The Top -Node}). Here's why: +We also strongly recommend using @code{@@insertcopying} in the Top node +of your manual (@pxref{The Top Node}), although it is not required +legally. Here's why: The @code{@@copying} command itself causes the permissions text to appear in an Info file @emph{before} the first node. The text is also @@ -3021,15 +3168,15 @@ an @code{@@insertcopying}. @menu * titlepage:: Create a title for the printed document. * titlefont center sp:: The @code{@@titlefont}, @code{@@center}, - and @code{@@sp} commands. + and @code{@@sp} commands. * title subtitle author:: The @code{@@title}, @code{@@subtitle}, - and @code{@@author} commands. + and @code{@@author} commands. * Copyright:: How to write the copyright notice and - include copying permissions. + include copying permissions. * end titlepage:: Turn on page headings after the title and - copyright pages. + copyright pages. * headings on off:: An option for turning headings on and off - and double or single sided printing. + and double or single sided printing. @end menu @@ -3088,8 +3235,8 @@ the sections below. @findex shorttitlepage @cindex Bastard title page @cindex Title page, bastard -For extremely simple applications, and for the bastard title page in -traditional book front matter, Texinfo also provides a command +For extremely simple documents, and for the bastard title page in +traditional book frontmatter, Texinfo also provides a command @code{@@shorttitlepage} which takes the rest of the line as the title. The argument is typeset on a page by itself and followed by a blank page. @@ -3109,6 +3256,11 @@ Use the @code{@@titlefont} command to select a large font suitable for the title itself. You can use @code{@@titlefont} more than once if you have an especially long title. +For HTML output, each @code{@@titlefont} command produces an +@code{<h1>} heading, but the HTML document @code{<title>} is not +affected. For that, you must put an @code{@@settitle} command before +the @code{@@titlefont} command (@pxref{settitle}). + @need 700 For example: @@ -3156,6 +3308,9 @@ A template for this method looks like this: The spacing of the example fits an 8.5 by 11 inch manual. +You can in fact use these commands anywhere, not just on a title page, +but since they are not logical markup commands, we don't recommend +them. @node title subtitle author @subsection @code{@@title}, @code{@@subtitle}, and @code{@@author} @@ -3171,7 +3326,8 @@ needed to adjust vertical spacing. Write the @code{@@title}, @code{@@subtitle}, or @code{@@author} commands at the beginning of a line followed by the title, subtitle, -or author. +or author. These commands are only effective in @TeX{} output; it's +an error to use them anywhere except within @code{@@titlepage}. The @code{@@title} command produces a line in which the title is set flush to the left-hand side of the page in a larger than normal font. @@ -3313,9 +3469,11 @@ Cover art by @dots{} @cindex Titlepage end starts headings @cindex End titlepage starts headings -The @code{@@end titlepage} command must be written on a line by itself. -It not only marks the end of the title and copyright pages, but also -causes @TeX{} to start generating page headings and page numbers. +Like all @code{@@end} commands (@pxref{Quotations and Examples}), the @code{@@end titlepage} command +must be written at the beginning of a line by itself, with only one +space between the @code{@@end} and the @code{titlepage}. It not only +marks the end of the title and copyright pages, but also causes @TeX{} +to start generating page headings and page numbers. To repeat what is said elsewhere, Texinfo has two standard page heading formats, one for documents which are printed on one side of each sheet of paper @@ -3412,6 +3570,89 @@ You can also specify your own style of page heading and footing. @xref{Headings, , Page Headings}, for more information.@refill +@node Contents +@section Generating a Table of Contents +@cindex Table of contents +@cindex Contents, Table of +@cindex Short table of contents +@findex contents +@findex summarycontents +@findex shortcontents + +The @code{@@chapter}, @code{@@section}, and other structuring commands +(@pxref{Structuring}) supply the information to make up a +table of contents, but they do not cause an actual table to appear in +the manual. To do this, you must use the @code{@@contents} and/or +@code{@@summarycontents} command(s). + +@table @code +@item @@contents +Generates a table of contents in a printed manual, including all +chapters, sections, subsections, etc., as well as appendices and +unnumbered chapters. Headings generated by @code{@@majorheading}, +@code{@@chapheading}, and the other @code{@@@dots{}heading} commands +do not appear in the table of contents (@pxref{Structuring Command +Types}). + +@item @@shortcontents +@itemx @@summarycontents +(@code{@@summarycontents} is a synonym for @code{@@shortcontents}.) + +Generates a short or summary table of contents that lists only the +chapters, appendices, and unnumbered chapters. Sections, subsections +and subsubsections are omitted. Only a long manual needs a short +table of contents in addition to the full table of contents. + +@end table + +Both contents commands should be written on a line by themselves, and +are best placed near the beginning of the file, after the @code{@@end +titlepage} (@pxref{titlepage}). The contents commands automatically +generate a chapter-like heading at the top of the first table of +contents page, so don't include any sectioning command such as +@code{@@unnumbered} before them. + +Since an Info file uses menus instead of tables of contents, the Info +formatting commands ignore the contents commands. But the contents are +included in plain text output (generated by @code{makeinfo +--no-headers}), unless @code{makeinfo} is writing its output to standard +output. + +When @code{makeinfo} writes a short table of contents while producing +html output, the links in the short table of contents point to +corresponding entries in the full table of contents rather than the text +of the document. The links in the full table of contents point to the +main text of the document. + +In the past, the contents commands were sometimes placed at the end of +the file, after any indices and just before the @code{@@bye}, but we +no longer recommend this. + +@findex setcontentsaftertitlepage +@findex setshortcontentsaftertitlepage +@cindex Contents, after title page +@cindex Table of contents, after title page +However, since many existing Texinfo documents still do have the +@code{@@contents} at the end of the manual, if you are a user printing +a manual, you may wish to force the contents to be printed after the +title page. You can do this by specifying +@code{@@setcontentsaftertitlepage} and/or +@code{@@setshortcontentsaftertitlepage}. The first prints only the +main contents after the @code{@@end titlepage}; the second prints both +the short contents and the main contents. In either case, any +subsequent @code{@@contents} or @code{@@shortcontents} is ignored +(unless, erroneously, no @code{@@end titlepage} is ever encountered). + +You need to include the @code{@@set@dots{}contentsaftertitlepage} +commands early in the document (just after @code{@@setfilename}, for +example). We recommend using @command{texi2dvi} (@pxref{Format with +texi2dvi}) to specify this without altering the source file at all. For +example: +@example +texi2dvi --texinfo=@@setcontentsaftertitlepage foo.texi +@end example + + @node The Top Node @section The `Top' Node and Master Menu @cindex Top node @@ -3439,8 +3680,8 @@ strictly speaking, you are not required to enclose these parts between so. @xref{Conditionals, , Conditionally Visible Text}.) @menu -* Top Node Example:: -* Master Menu Parts:: +* Top Node Example:: +* Master Menu Parts:: @end menu @@ -3523,12 +3764,12 @@ For example, the master menu for this manual looks like the following @end group @group * Command and Variable Index:: -* Concept Index:: +* Concept Index:: @end group @group @@detailmenu - --- The Detailed Node Listing --- +--- The Detailed Node Listing --- Overview of Texinfo @@ -3559,12 +3800,13 @@ generally all given before the Top node, if they are given at all. * documentdescription:: Document summary for the HTML output. * setchapternewpage:: Start chapters on right-hand pages. * paragraphindent:: Specify paragraph indentation. +* firstparagraphindent:: Suppress indentation of the first paragraph. * exampleindent:: Specify environment indentation. @end menu @node documentdescription -@subsection @code{@@documentdescription}: Summary text +@subsection @code{@@documentdescription}: Summary Text @cindex Document description @cindex Description of document @cindex Summary of document @@ -3597,7 +3839,7 @@ the document. @node setchapternewpage -@subsection @code{@@setchapternewpage}: +@subsection @code{@@setchapternewpage}: @cindex Starting chapters @cindex Pages, starting odd @findex setchapternewpage @@ -3670,7 +3912,7 @@ you want. @node paragraphindent -@subsection Paragraph Indenting +@subsection @code{@@paragraphindent}: Paragraph Indenting @cindex Indenting paragraphs, control of @cindex Paragraph indentation control @findex paragraphindent @@ -3712,7 +3954,49 @@ Header}. A peculiarity of the @code{texinfo-format-buffer} and @code{texinfo-format-region} commands is that they do not indent (nor fill) paragraphs that contain @code{@@w} or @code{@@*} commands. -@xref{Refilling Paragraphs}, for further information. + + +@node firstparagraphindent +@subsection @code{@@firstparagraphindent}: Indenting After Headings +@cindex First paragraph, suppressing indentation of +@cindex Suppressing first paragraph indentation +@cindex Preventing first paragraph indentation +@cindex Indenting, suppressing of first paragraph +@cindex Headings, indentation after +@findex firstparagraphindent + +As you can see in the present manual, the first paragraph in any +section is not indented by default. Typographically, indentation is a +paragraph separator, which means that it is unnecessary when a new +section begins. This indentation is controlled with the +@code{@@firstparagraphindent} command: + +@example +@@firstparagraphindent @var{word} +@end example + +The first paragraph after a heading is indented according to the value +of @var{word}: + +@table @asis +@item @code{none} +Prevents the first paragraph from being indented (default). +This option is ignored by @command{makeinfo} if +@code{@@paragraphindent asis} is in effect. + +@item @code{insert} +Include normal paragraph indentation. This respects the paragraph +indentation set by a @code{@@paragraphindent} command +(@pxref{paragraphindent}). +@end table + +For HTML and XML output, the @code{@@firstparagraphindent} setting is +ignored. + +It is best to write the @code{@@paragraphindent} command before the +end-of-header line at the beginning of a Texinfo file, so the region +formatting commands indent paragraphs as specified. @xref{Start of +Header}. @node exampleindent @@ -3731,7 +4015,8 @@ beginning of a line followed by either @samp{asis} or a number: @@exampleindent @var{indent} @end example -The indentation is according to the value of @var{indent}: +@code{@@exampleindent} is ignored for HTML output. Otherwise, the +indentation is according to the value of @var{indent}: @table @asis @item @code{asis} @@ -3746,8 +4031,9 @@ Indent environments by @var{n} space characters in Info output, by @end table -The default value of @var{indent} is 5. @code{@@exampleindent} is -ignored for HTML output. +The default value of @var{indent} is 5 spaces in Info, and 0.4@dmn{in} +in @TeX{}, which is somewhat less. (The reduction is to help @TeX{} +fit more characters onto physical lines.) It is best to write the @code{@@exampleindent} command before the end-of-header line at the beginning of a Texinfo file, so the region @@ -3787,12 +4073,9 @@ information, although sometimes people put it earlier in the document. @cindex File ending @findex bye -The end of a Texinfo file should include commands to create indices and -(perhaps) to generate both the full and summary tables of contents. -Finally, it must include the @code{@@bye} command that marks the last -line to be processed. +The end of a Texinfo file should include commands to create indices, +and the @code{@@bye} command to mark the last line to be processed. -@need 700 For example: @example @@ -3801,23 +4084,18 @@ For example: @@printindex cp -@@shortcontents -@@contents - @@bye @end example @menu * Printing Indices & Menus:: How to print an index in hardcopy and - generate index menus in Info. -* Contents:: How to create a table of contents. + generate index menus in Info. * File End:: How to mark the end of a file. @end menu @node Printing Indices & Menus @section Printing Indices and Menus -@findex printindex @cindex Printing an index @cindex Indices, printing and menus @cindex Generating menus with indices @@ -3834,39 +4112,25 @@ process of creating a printed manual, you must run a program called sorted index file. The sorted index file is what is actually used to print the index. -Texinfo offers six separate types of predefined index, each with a -two-letter abbreviation, as illustrated in the following table. -However, you may merge indices (@pxref{Combining Indices}) or define -your own indices (@pxref{New Indices}). - -Here are the predefined indices, their abbreviations, and the -corresponding index entry commands: - -@table @samp -@item cp -concept index (@code{@@cindex}) -@item fn -function index (@code{@@findex}) -@item vr -variable index (@code{@@index}) -@item ky -key index (@code{@@kindex}) -@item pg -program index (@code{@@pindex}) -@item tp -data type index (@code{@@tindex}) -@end table - -The @code{@@printindex} command takes a two-letter index abbreviation, -reads the corresponding sorted index file and formats it appropriately -into an index. +Texinfo offers six separate types of predefined index, which suffice +in most cases. @xref{Indices}, for information on this, as well +defining your own new indices, combining indices, and, most +importantly advice on writing the actual index entries. This section +focuses on printing indices, which is done with the +@code{@@printindex} command. -The @code{@@printindex} command does not generate a chapter heading for -the index. Consequently, you should precede the @code{@@printindex} -command with a suitable section or chapter command (usually -@code{@@appendix} or @code{@@unnumbered}) to supply the chapter heading -and put the index into the table of contents. Precede the -@code{@@unnumbered} command with an @code{@@node} line. +@findex printindex +@code{@@printindex} takes one argument, a two-letter index +abbreviation. It reads the corresponding sorted index file (for +printed output), and formats it appropriately into an index. + +The @code{@@printindex} command does not generate a chapter heading +for the index, since different manuals have different needs. +Consequently, you should precede the @code{@@printindex} command with +a suitable section or chapter command (usually @code{@@appendix} or +@code{@@unnumbered}) to supply the chapter heading and put the index +into the table of contents. Precede the chapter heading with an +@code{@@node} line as usual. For example: @@ -3886,105 +4150,53 @@ For example: @end group @end smallexample -@noindent - -We recommend placing the concept index last, since that makes it easiest -to find. We also recommend having a single index whenever possible, -since then readers have only one place to look (@pxref{Combining Indices}). - - -@node Contents -@section Generating a Table of Contents -@cindex Table of contents -@cindex Contents, Table of -@cindex Short table of contents -@findex contents -@findex summarycontents -@findex shortcontents - -The @code{@@chapter}, @code{@@section}, and other structuring commands -supply the information to make up a table of contents, but they do not -cause an actual table to appear in the manual. To do this, you must use -the @code{@@contents} and/or @code{@@summarycontents} command(s). - -@table @code -@item @@contents -Generate a table of contents in a printed manual, including all -chapters, sections, subsections, etc., as well as appendices and -unnumbered chapters. Headings generated by the @code{@@heading} -series of commands do not appear in the table of contents. +If you have more than one index, we recommend placing the concept index last. -@item @@shortcontents -@itemx @@summarycontents -(@code{@@summarycontents} is a synonym for @code{@@shortcontents}.) +@itemize +@item +In printed output, @code{@@printindex} produces a traditional +two-column index, with dot leaders between the index terms and page +numbers. -Generate a short or summary table of contents that lists only the -chapters, appendices, and unnumbered chapters. Sections, subsections -and subsubsections are omitted. Only a long manual needs a short table -of contents in addition to the full table of contents. +@item +In Info output, @code{@@printindex} produces a special menu containing +the line number of the entry, relative to the start of the node. Info +readers can use this to go to the exact line of an entry, not just the +containing node. (Older Info readers will just go to the node.) +Here's an example: -@end table +@smallexample +* First index entry: Top. (line 7) +@end smallexample -Both contents commands should be written on a line by themselves. -The contents commands automatically generate a chapter-like heading at -the top of the first table of contents page, so don't include any -sectioning command such as @code{@@unnumbered} before them. +@noindent The actual number of spaces is variable, to right-justify +the line number; it's been reduced here to make the line fit in the +printed manual. -Since an Info file uses menus instead of tables of contents, the Info -formatting commands ignore the contents commands. But the contents are -included in plain text output (generated by @code{makeinfo ---no-headers}), unless @code{makeinfo} is writing its output to standard -output. +@item +In plain text output, @code{@@printindex} produces the same menu, but +the line numbers are relative to the start of the file, since that's +more convenient for that format. -When @code{makeinfo} writes a short table of contents while producing -html output, the links in the short table of contents point to -corresponding entries in the full table of contents rather than the text -of the document. The links in the full table of contents point to the -main text of the document. +@item +In HTML and Docbook output, @code{@@printindex} produces links +to the index entries. -The contents commands can be placed either at the very end of the file, -after any indices (see the previous section) and just before the -@code{@@bye} (see the next section), or near the beginning of the file, -after the @code{@@end titlepage} (@pxref{titlepage}). The advantage to -the former is that then the contents output is always up to date, -because it reflects the processing just done. The advantage to the -latter is that the contents are printed in the proper place, thus you do -not need to rearrange the DVI file with @command{dviselect} or shuffle -paper. +@item +In XML output, it simply records the index to be printed. +@end itemize -@findex setcontentsaftertitlepage -@findex setshortcontentsaftertitlepage -@cindex Contents, after title page -@cindex Table of contents, after title page -As an author, you can put the contents commands wherever you prefer. -But if you are a user simply printing a manual, you may wish to print -the contents after the title page even if the author put the contents -commands at the end of the document (as is the case in most existing -Texinfo documents, at this writing). You can do this by specifying -@code{@@setcontentsaftertitlepage} and/or -@code{@@setshortcontentsaftertitlepage}. The first prints only the main -contents after the @code{@@end titlepage}; the second prints both the -short contents and the main contents. In either case, any subsequent -@code{@@contents} or @code{@@shortcontents} is ignored (unless no -@code{@@end titlepage} is ever encountered). - -You need to include the @code{@@set@dots{}contentsaftertitlepage} -commands early in the document (just after @code{@@setfilename}, for -example). We recommend using @command{texi2dvi} (@pxref{Format with -texi2dvi}) to specify this without altering the source file at all. For -example: -@example -texi2dvi --texinfo=@@setcontentsaftertitlepage foo.texi -@end example +It's not possible to generate an index when writing to standard +output; @command{makeinfo} generates a warning in this case. @node File End @section @code{@@bye} File Ending @findex bye -An @code{@@bye} command terminates @TeX{} or Info formatting. None of -the formatting commands reading anything following @code{@@bye}. The -@code{@@bye} command should be on a line by itself. +An @code{@@bye} command terminates Texinfo processing. None of the +formatters read anything following @code{@@bye}. The @code{@@bye} +command should be on a line by itself. If you wish, you may follow the @code{@@bye} line with notes. These notes will not be formatted and will not appear in either Info or a @@ -4023,13 +4235,13 @@ heading at the top of each node---but you don't need to.@refill * Tree Structuring:: A manual is like an upside down tree @dots{} * Structuring Command Types:: How to divide a manual into parts. * makeinfo top:: The @code{@@top} command, part of the `Top' node. -* chapter:: -* unnumbered & appendix:: -* majorheading & chapheading:: -* section:: -* unnumberedsec appendixsec heading:: -* subsection:: -* unnumberedsubsec appendixsubsec subheading:: +* chapter:: +* unnumbered & appendix:: +* majorheading & chapheading:: +* section:: +* unnumberedsec appendixsec heading:: +* subsection:: +* unnumberedsubsec appendixsubsec subheading:: * subsubsection:: Commands for the lowest level sections. * Raise/lower sections:: How to change commands' hierarchical level. @end menu @@ -4050,16 +4262,16 @@ each of which has two sections.@refill @example @group - Top - | - ------------------------------------- - | | | - Chapter 1 Chapter 2 Chapter 3 - | | | - -------- -------- -------- - | | | | | | - Section Section Section Section Section Section - 1.1 1.2 2.1 2.2 3.1 3.2 + Top + | + ------------------------------------- + | | | + Chapter 1 Chapter 2 Chapter 3 + | | | + -------- -------- -------- + | | | | | | +Section Section Section Section Section Section + 1.1 1.2 2.1 2.2 3.1 3.2 @end group @end example @@ -4106,17 +4318,20 @@ its table of contents.@refill The @code{@@unnumbered} series of commands produce unnumbered entries both in the body of a printed work and in its table of contents. The @code{@@top} command, which has a special use, is a member of this -series (@pxref{makeinfo top, , @code{@@top}}).@refill +series (@pxref{makeinfo top, , @code{@@top}}). An @code{@@unnumbered} +section should be associated with a node and be a normal part of the +document structure. @item -The @code{@@heading} series of commands produce unnumbered headings -that do not appear in a table of contents. The heading commands never -start a new page.@refill +The @code{@@heading} series of commands produce simple unnumbered +headings that do not appear in a table of contents, are not associated +with nodes, and cannot be cross-referenced. The heading commands +never start a new page. @item -The @code{@@majorheading} command produces results similar to using -the @code{@@chapheading} command but generates a larger vertical -whitespace before the heading.@refill +The @code{@@majorheading} command is similar to @code{@@chapheading}, +except that it generates a larger vertical whitespace before the +heading. @item When an @code{@@setchapternewpage} command says to do so, the @@ -4134,7 +4349,7 @@ Here are the four groups of chapter structuring commands: @multitable @columnfractions .19 .30 .29 .22 @item @tab @tab @tab No new page @item @i{Numbered} @tab @i{Unnumbered} @tab @i{Lettered/numbered} @tab @i{Unnumbered} -@item In contents @tab In contents @tab In contents @tab Omitted from@*contents +@item In contents @tab In contents @tab In contents @tab Not in contents @item @tab @code{@@top} @tab @tab @code{@@majorheading} @item @code{@@chapter} @tab @code{@@unnumbered} @tab @code{@@appendix} @tab @code{@@chapheading} @item @code{@@section} @tab @code{@@unnumberedsec} @tab @code{@@appendixsec} @tab @code{@@heading} @@ -4153,7 +4368,7 @@ The @code{@@top} command is a special sectioning command that you use only after an @samp{@@node Top} line at the beginning of a Texinfo file. The @code{@@top} command tells the @code{makeinfo} formatter which node is the `Top' node, so it can use it as the root of the node tree if your -manual uses implicit pointers. It has the same typesetting effect as +manual uses implicit node pointers. It has the same typesetting effect as @code{@@unnumbered} (@pxref{unnumbered & appendix, , @code{@@unnumbered} and @code{@@appendix}}). For detailed information, see @ref{makeinfo top command, , The @code{@@top} Command}. @@ -4163,7 +4378,7 @@ an @code{@@ifnottex} conditional so that it will appear only in Info and HTML output, not @TeX{}. -@node chapter, unnumbered & appendix, makeinfo top, Structuring +@node chapter @comment node-name, next, previous, up @section @code{@@chapter} @findex chapter @@ -4220,7 +4435,7 @@ line and follow it on the same line by the title, as you would if you were creating a chapter.@refill -@node majorheading & chapheading, section, unnumbered & appendix, Structuring +@node majorheading & chapheading @section @code{@@majorheading}, @code{@@chapheading} @findex majorheading @findex chapheading @@ -4234,7 +4449,7 @@ or an entry in the table of contents; and neither command causes In @TeX{}, an @code{@@majorheading} command generates a larger vertical whitespace before the heading than an @code{@@chapheading} command but -is otherwise the same.@refill +is otherwise the same. In Info, the @code{@@majorheading} and @@ -4242,7 +4457,8 @@ the @code{@@majorheading} and @code{@@chapter}: the title is printed on a line by itself with a line of asterisks underneath. (@xref{chapter, , @code{@@chapter}}.)@refill -@node section, unnumberedsec appendixsec heading, majorheading & chapheading, Structuring + +@node section @comment node-name, next, previous, up @section @code{@@section} @findex section @@ -4282,7 +4498,8 @@ This is a section @noindent in Info. -@node unnumberedsec appendixsec heading, subsection, section, Structuring + +@node unnumberedsec appendixsec heading @comment node-name, next, previous, up @section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading} @findex unnumberedsec @@ -4314,7 +4531,8 @@ You may use the @code{@@heading} command anywhere you wish for a section-style heading that will not appear in the table of contents.@refill @end table -@node subsection, unnumberedsubsec appendixsubsec subheading, unnumberedsec appendixsec heading, Structuring + +@node subsection @comment node-name, next, previous, up @section The @code{@@subsection} Command @findex subsection @@ -4340,7 +4558,7 @@ This is a subsection In a printed manual, subsections are listed in the table of contents and are numbered three levels deep.@refill -@node unnumberedsubsec appendixsubsec subheading, subsubsection, subsection, Structuring +@node unnumberedsubsec appendixsubsec subheading @comment node-name, next, previous, up @section The @code{@@subsection}-like Commands @cindex Subsection-like commands @@ -4363,8 +4581,7 @@ subsection-like heading labelled with a letter and numbers; both of these commands produce headings that appear in the table of contents.@refill -@node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring -@comment node-name, next, previous, up +@node subsubsection @section The `subsub' Commands @cindex Subsub commands @findex subsubsection @@ -4418,66 +4635,29 @@ This is a subsubsection @end group @end example -@node Raise/lower sections, , subsubsection, Structuring -@comment node-name, next, previous, up + +@node Raise/lower sections @section @code{@@raisesections} and @code{@@lowersections} @findex raisesections @findex lowersections @cindex Raising and lowering sections +@cindex Lowering and raising sections @cindex Sections, raising and lowering -The @code{@@raisesections} and @code{@@lowersections} commands raise and -lower the hierarchical level of chapters, sections, subsections and the -like. The @code{@@raisesections} command changes sections to chapters, -subsections to sections, and so on. The @code{@@lowersections} command -changes chapters to sections, sections to subsections, and so on. - -@cindex Include files, and section levels -An @code{@@lowersections} command is useful if you wish to include text -that is written as an outer or standalone Texinfo file in another -Texinfo file as an inner, included file. If you write the command at -the beginning of the file, all your @code{@@chapter} commands are -formatted as if they were @code{@@section} commands, all your -@code{@@section} command are formatted as if they were -@code{@@subsection} commands, and so on. - -@need 1000 -@code{@@raisesections} raises a command one level in the chapter -structuring hierarchy:@refill - -@example -@group - @r{Change} @r{To} - -@@subsection @@section, -@@section @@chapter, -@@heading @@chapheading, - @r{etc.} -@end group -@end example - -@need 1000 -@code{@@lowersections} lowers a command one level in the chapter -structuring hierarchy:@refill - -@example -@group - @r{Change} @r{To} - -@@chapter @@section, -@@subsection @@subsubsection, -@@heading @@subheading, - @r{etc.} -@end group -@end example +The @code{@@raisesections} and @code{@@lowersections} commands +implicitly raise and lower the hierarchical level of following +chapters, sections and the other sectioning commands. -An @code{@@raisesections} or @code{@@lowersections} command changes only -those structuring commands that follow the command in the Texinfo file. -Write an @code{@@raisesections} or @code{@@lowersections} command on a -line of its own. +That is, the @code{@@raisesections} command changes sections to +chapters, subsections to sections, and so on. Conversely, the +@code{@@lowersections} command changes chapters to sections, sections +to subsections, and so on. Thus, an @code{@@lowersections} command +cancels an @code{@@raisesections} command, and vice versa. -An @code{@@lowersections} command cancels an @code{@@raisesections} -command, and vice versa. Typically, the commands are used like this: +@cindex Include files, and section levels +You can use @code{@@lowersections} to include text written as an outer +or standalone Texinfo file in another Texinfo file as an inner, +included file. Typical usage looks like this: @example @@lowersections @@ -4485,31 +4665,55 @@ command, and vice versa. Typically, the commands are used like this: @@raisesections @end example -Without the @code{@@raisesections}, all the subsequent sections in your -document will be lowered. +@noindent (Without the @code{@@raisesections}, all the subsequent +sections in the document would be lowered.) -Repeated use of the commands continue to raise or lower the hierarchical -level a step at a time. +If the included file being lowered has a @code{@@top} node, you'll +need to conditionalize its inclusion with a flag (@pxref{set value}). + +Another difficulty can arise with documents that use the (recommended) +feature of @command{makeinfo} for implicitly determining node +pointers. Since @command{makeinfo} must assume a hierarchically +organized document to determine the pointers, you cannot just +arbitrarily sprinkle @code{@@raisesections} and @code{@@lowersections} +commands in the document. The final result has to have menus that +take the raising and lowering into account. Therefore, as a practical +matter, you generally only want to raise or lower large chunks, +usually in external files as shown above. + +Repeated use of the commands continue to raise or lower the +hierarchical level a step at a time. An attempt to raise above +`chapter' reproduces chapter commands; an attempt to lower below +`subsubsection' reproduces subsubsection commands. Also, lowered +subsubsections and raised chapters will not work with +@command{makeinfo}'s feature of implicitly determining node pointers, +since the menu structure won't be correct. + +Write each @code{@@raisesections} and @code{@@lowersections} command +on a line of its own. -An attempt to raise above `chapters' reproduces chapter commands; an -attempt to lower below `subsubsections' reproduces subsubsection -commands. @node Nodes @chapter Nodes @dfn{Nodes} are the primary segments of a Texinfo file. They do not -themselves impose a hierarchical or any other kind of structure on a file. -Nodes contain @dfn{node pointers} that name other nodes, and can contain -@dfn{menus} which are lists of nodes. In Info, the movement commands -can carry you to a pointed-to node or to a node listed in a menu. Node -pointers and menus provide structure for Info files just as chapters, -sections, subsections, and the like, provide structure for printed -books.@refill +in and of themselves impose a hierarchical or any other kind of +structure on a file. Nodes contain @dfn{node pointers} that name +other nodes, and can contain @dfn{menus} which are lists of nodes. In +Info, the movement commands can carry you to a pointed-to node or to a +node listed in a menu. + +Node pointers and menus provide structure for Info files just as +chapters, sections, subsections, and the like, provide structure for +printed books. + +Because node names are used in cross-references, it is not desirable +to casually change them. Such name changes invalidate references from +other manuals, from mail archives, and so on. @menu * Two Paths:: Different commands to structure - Info output and printed output. + Info output and printed output. * Node Menu Illustration:: A diagram, and sample nodes and menus. * node:: Creating nodes, in detail. * makeinfo Pointer Creation:: Letting makeinfo determine node pointers. @@ -4563,16 +4767,16 @@ root.@refill @example @group - Top - | - ------------------------------------- - | | | - Chapter 1 Chapter 2 Chapter 3 - | | | - -------- -------- -------- - | | | | | | - Section Section Section Section Section Section - 1.1 1.2 2.1 2.2 3.1 3.2 + Top + | + ------------------------------------- + | | | + Chapter 1 Chapter 2 Chapter 3 + | | | + -------- -------- -------- + | | | | | | +Section Section Section Section Section Section + 1.1 1.2 2.1 2.2 3.1 3.2 @end group @end example @@ -4593,7 +4797,7 @@ This @code{@@node} line says that the name of this node is ``Chapter hierarchically organized (@pxref{makeinfo Pointer Creation}), but the pointer relationships still obtain. -@quotation +@quotation Note @strong{Please Note:} `Next' refers to the next node at the same hierarchical level in the manual, not necessarily to the next node within the Texinfo file. In the Texinfo file, the subsequent node may @@ -4611,10 +4815,10 @@ before the beginning of Section 2.1, like this:@refill @example @group - @@menu - * Sect. 2.1:: Description of this section. - * Sect. 2.2:: - @@end menu + @@menu + * Sect. 2.1:: Description of this section. + * Sect. 2.2:: + @@end menu @end group @end example @@ -4622,8 +4826,8 @@ Write the node for Sect. 2.1 like this:@refill @example @group - @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2 - @@comment node-name, next, previous, up + @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2 + @@comment node-name, next, previous, up @end group @end example @@ -4673,7 +4877,7 @@ the @code{@@node} line. On the other hand, in printed output nodes are used only for cross references, so a chapter or section may contain any number of nodes. Indeed, a chapter usually contains several nodes, one for each section, subsection, and -subsubsection.@refill +subsubsection. To create a node, write an @code{@@node} command at the beginning of a line, and follow it with up to four arguments, separated by commas, on @@ -4684,20 +4888,20 @@ if your Texinfo document is hierarchically organized (@pxref{makeinfo Pointer Creation}). You may insert spaces before each name if you wish; the spaces are -ignored. You must write the name of the node and the names of the -`Next', `Previous', and `Up' pointers all on the same line. Otherwise, -the formatters fail. (@inforef{Top, info, info}, for more information -about nodes in Info.) +ignored. You must write the name of the node and (if present) the names +of the `Next', `Previous', and `Up' pointers all on the same line. +Otherwise, the formatters fail. (@inforef{Top, info, info}, for more +information about nodes in Info.) Usually, you write one of the chapter-structuring command lines immediately after an @code{@@node} line---for example, an @code{@@section} or @code{@@subsection} line. (@xref{Structuring Command Types}.) -@quotation -@strong{Please note:} The GNU Emacs Texinfo mode updating commands work +@quotation Note +The GNU Emacs Texinfo mode updating commands work only with Texinfo files in which @code{@@node} lines are followed by chapter -structuring lines. @xref{Updating Requirements}.@refill +structuring lines. @xref{Updating Requirements}. @end quotation @TeX{} uses @code{@@node} lines to identify the names to use for cross @@ -4705,7 +4909,7 @@ references. For this reason, you must write @code{@@node} lines in a Texinfo file that you intend to format for printing, even if you do not intend to format it for Info. (Cross references, such as the one at the end of this sentence, are made with @code{@@xref} and related commands; -see @ref{Cross References}.)@refill +see @ref{Cross References}.) @menu * Node Names:: How to choose node and pointer names. @@ -4722,23 +4926,23 @@ see @ref{Cross References}.)@refill @cindex Node names, choosing The name of a node identifies the node. The pointers enable -you to reach other nodes and consist of the names of those nodes.@refill +you to reach other nodes and consist simply of the names of those nodes. Normally, a node's `Up' pointer contains the name of the node whose menu mentions that node. The node's `Next' pointer contains the name of the node that follows that node in that menu and its `Previous' pointer contains the name of the node that precedes it in that menu. When a node's `Previous' node is the same as its `Up' node, both node pointers -name the same node.@refill +name the same node. Usually, the first node of a Texinfo file is the `Top' node, and its `Up' and `Previous' pointers point to the @file{dir} file, which -contains the main menu for all of Info.@refill +contains the main menu for all of Info. The `Top' node itself contains the main or master menu for the manual. Also, it is helpful to include a brief description of the manual in the `Top' node. @xref{First Node}, for information on how to write the -first node of a Texinfo file.@refill +first node of a Texinfo file. Even when you explicitly specify all pointers, that does not mean you can write the nodes in the Texinfo source file in an arbitrary order! @@ -4823,7 +5027,7 @@ capitalized; others are not.@refill @end itemize -@node Node Line Requirements, First Node, Node Line Tips, node +@node Node Line Requirements @subsection @code{@@node} Line Requirements @cindex Node line requirements @@ -4834,7 +5038,7 @@ Here are several requirements for @code{@@node} lines: @cindex Unique nodename requirement @cindex Node name must be unique @item -All the node names for a single Info file must be unique.@refill +All the node names for a single Info file must be unique. Duplicates confuse the Info movement commands. This means, for example, that if you end every chapter with a summary, you must name @@ -4842,10 +5046,10 @@ each summary node differently. You cannot just call each one ``Summary''. You may, however, duplicate the titles of chapters, sections, and the like. Thus you can end each chapter in a book with a section called ``Summary'', so long as the node names for those sections are all -different.@refill +different. @item -A pointer name must be the name of a node.@refill +A pointer name must be the name of a node. The node to which a pointer points may come before or after the node containing the pointer. @@ -4853,50 +5057,34 @@ node containing the pointer. @cindex @@-commands in nodename @cindex Node name, should not contain @@-commands @item -@w{@@-commands} used in node names generally confuse Info, so you -should avoid them. This includes punctuation characters that are -escaped with a @samp{@@}, such as @code{@@} and @code{@{}. For a few -rare cases when this is useful, Texinfo has limited support for using -@w{@@-commands} in node names; see @ref{Pointer Validation}. - -@need 750 -Thus, the beginning of the section called @code{@@chapter} looks like -this:@refill - -@smallexample -@group -@@node chapter, unnumbered & appendix, makeinfo top, Structuring -@@comment node-name, next, previous, up -@@section @@code@{@@@@chapter@} -@@findex chapter -@end group -@end smallexample - -@item -@cindex Parentheses in nodename -You cannot use parentheses in node names, because a node name such as -@samp{(foo)bar} is interpreted by the Info readers as a node -@samp{bar} in an Info file @file{foo}. +@@-commands in node names are not allowed. This includes punctuation +characters that are escaped with a @samp{@@}, such as @code{@@} and +@code{@{}, and accent commands such as @samp{@@'}. (For a few cases +when this is useful, Texinfo has limited support for using +@w{@@-commands} in node names; see @ref{Pointer Validation}.) Perhaps +this limitation will be removed some day. @item -@cindex Apostrophe in nodename @cindex Colon in nodename @cindex Comma in nodename +@cindex Parentheses in nodename @cindex Period in nodename @cindex Characters, invalid in node name @cindex Invalid characters in node names -Unfortunately, you cannot use periods, commas, colons or apostrophes -within a node name; these confuse @TeX{} or the Info formatters. +@cindex Node names, invalid characters in +Unfortunately, you cannot use periods, commas, colons or parentheses +within a node name; these confuse the Texinfo processors. Perhaps +this limitation will be removed some day, too. @need 700 -For example, the following is a section title: +For example, the following is a section title in this manual: @smallexample @@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@} @end smallexample @noindent -The corresponding node name is: +But the corresponding node name lacks the commas and the @@'s: @smallexample unnumberedsec appendixsec heading @@ -4904,7 +5092,22 @@ unnumberedsec appendixsec heading @cindex Case in node name @item -Case is significant. +Case is significant in node names. + +@cindex White space in node name +@cindex Spaces in node name +Spaces before and after names on the @samp{@@node} line are ignored, +but spaces ``inside'' a name are significant. For example: + +@example +@@node foo bar, +@@node foo bar , +@@node foo bar , +@end example + +@noindent all define the same node, @samp{foo bar}. References to the +node should all use that name, without the leading or trailing spaces, +but with the internal spaces. @end itemize @@ -4932,7 +5135,7 @@ menu that leads to this file. Specify the file name in parentheses. Usually, all Info files are installed in the same Info directory tree; in this case, use @samp{(dir)} as the parent of the Top node; this is short for @samp{(dir)top}, and specifies the Top node in the @file{dir} -file, which contains the main menu for the Info system as a whole. +file, which contains the main menu for the Info system as a whole. @item @cindex Previous node of Top node @@ -5002,8 +5205,8 @@ Thus, in practice, a Top node starts like this: @cindex Pointer creation with @code{makeinfo} @cindex Automatic pointer creation with @code{makeinfo} -The @code{makeinfo} program has a feature for automatically defining -node pointers for a hierarchically organized file. +The @code{makeinfo} program has a feature for automatically determining +node pointers for a hierarchically organized document. When you take advantage of this feature, you do not need to write the `Next', `Previous', and `Up' pointers after the name of a node. @@ -5019,15 +5222,18 @@ Finally, you must write the name of each node (except for the `Top' node) in a menu that is one or more hierarchical levels above the node's hierarchical level. -This node pointer insertion feature in @code{makeinfo} relieves you from -the need to update menus and pointers manually or with Texinfo mode -commands. (@xref{Updating Nodes and Menus}.) +This implicit node pointer insertion feature in @code{makeinfo} +relieves you from the need to update menus and pointers manually or +with Texinfo mode commands. (@xref{Updating Nodes and Menus}.) In most cases, you will want to take advantage of this feature and not redundantly specify node pointers. However, Texinfo documents are not -required to be organized hierarchically or in fact contain sectioning -commands at all. For example, if you never intend the document to be -printed. In those cases, you will need to explicitly specify the pointers. +required to be organized hierarchically or in fact to contain +sectioning commands at all (for example, if you never intend the +document to be printed). The special procedure for handling the short +text before a menu (@pxref{Menus}) also disables this +feature, for that group of nodes. In those cases, you will need to +explicitly specify the pointers. @node anchor @@ -5080,25 +5286,19 @@ an argument. (@xref{goto-node,,,info-stnd,GNU Info}.) @cindex Menus @findex menu -@dfn{Menus} contain pointers to subordinate nodes.@footnote{Menus can -carry you to any node, regardless of the hierarchical structure; even to -nodes in a different Info file. However, the GNU Emacs Texinfo mode -updating commands work only to create menus of subordinate nodes. -Conventionally, cross references are used to refer to other nodes.} In -Info, you use menus to go to such nodes. Menus have no effect in -printed manuals and do not appear in them. - -By convention, a menu is put at the end of a node since a reader who -uses the menu may not see text that follows it. Furthermore, a node -that has a menu should not contain much text. If you have a lot of text -and a menu, move most of the text into a new subnode---all but a few -lines. Otherwise, a reader with a terminal that displays only a few -lines may miss the menu and its associated text. As a practical matter, -you should locate a menu within 20 lines of the beginning of the -node. +@dfn{Menus} contain pointers to subordinate nodes. In online output, +you use menus to go to such nodes. Menus have no effect in printed +manuals and do not appear in them. + +A node with a menu should not contain much text. If you find yourself +writing a lot of before a menu, we generally recommend moving most of +the text into a new subnode---all but a paragraph or two. Otherwise, +a reader with a terminal that displays only a few lines may miss the +menu and its associated text. As a practical matter, it is best to +locate a menu within 20 or so lines of the beginning of the node. @menu -* Menu Location:: Put a menu in a short node. +* Menu Location:: Menus go at the ends of short nodes. * Writing a Menu:: What is a menu? * Menu Parts:: A menu entry has three parts. * Less Cluttered Menu Entry:: Two part menu entry. @@ -5107,59 +5307,53 @@ node. @end menu -@node Menu Location, Writing a Menu, Menus, Menus -@ifinfo -@heading Menus Need Short Nodes -@end ifinfo +@node Menu Location +@section Menu Location @cindex Menu location @cindex Location of menus -@cindex Nodes for menus are short -@cindex Short nodes for menus - -The short text before a menu may look awkward in a printed manual. To -avoid this, you can write a menu near the beginning of its node and -follow the menu by an @code{@@node} line, and then an @code{@@heading} -line located within @code{@@ifinfo} and @code{@@end ifinfo}. This way, -the menu, @code{@@node} line, and title appear only in the Info file, -not the printed document. - -For example, the preceding two paragraphs follow an Info-only menu, -@code{@@node} line, and heading, and look like this: - -@example -@group -@@menu -* Menu Location:: Put a menu in a short node. -* Writing a Menu:: What is a menu? -* Menu Parts:: A menu entry has three parts. -* Less Cluttered Menu Entry:: Two part menu entry. -* Menu Example:: Two and three part entries. -* Other Info Files:: How to refer to a different - Info file. -@@end menu - -@@node Menu Location, Writing a Menu, , Menus -@@ifinfo -@@heading Menus Need Short Nodes -@@end ifinfo -@end group -@end example -The Texinfo file for this document contains a number of -examples of this procedure; one is at the beginning of this chapter. - - -@node Writing a Menu, Menu Parts, Menu Location, Menus +A menu must be located at the end of a node, without any regular text +or additional commands between the @code{@@end menu} and the beginning +of the next node. (As a consequence, there may be at most one menu in +a node.) + +@cindex Info format, and menus +This is actually a useful restriction, since a reader who uses the +menu could easily miss any such text. Technically, it is necessary +because in Info format, there is no marker for the end of a menu, so +Info-reading programs would have no way to know when the menu ends and +normal text resumes. + +@cindex Hierarchical documents, and menus +Technically, menus can carry you to any node, regardless of the +structure of the document; even to nodes in a different Info file. +However, we do not recommend ever making use of this, because the +@command{makeinfo} implicit pointer creation feature (@pxref{makeinfo +Pointer Creation}) and GNU Emacs Texinfo mode updating commands work +only to create menus of subordinate nodes in a hierarchically +structured document. Instead, use cross references to refer to +arbitrary nodes. + +In the past, we recommended using a @samp{@@heading} command within an +@code{@@ifinfo} conditional instead of the normal sectioning commands +after a very short node with a menu. This had the advantage of making +the printed output look better, because there was no very short text +between two headings on the page. But aside from not working with +@command{makeinfo}'s implicit pointer creation, it also makes the XML +output incorrect, since it does not reflect the true document +structure. So, unfortunately we can no longer recommend this. + + +@node Writing a Menu @section Writing a Menu @cindex Writing a menu @cindex Menu writing -A menu consists of an @code{@@menu} command on a line by -itself followed by menu entry lines or menu comment lines -and then by an @code{@@end menu} command on a line by -itself.@refill +A menu consists of an @code{@@menu} command on a line by itself +followed by menu entry lines or menu comment lines and then by an +@code{@@end menu} command on a line by itself. -A menu looks like this:@refill +A menu looks like this: @example @group @@ -5168,7 +5362,7 @@ Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing - several files at once. + several files at once. @@end menu @end group @end example @@ -5184,7 +5378,7 @@ entries. Space characters in a menu are preserved as-is; this allows you to format the menu as you wish. -@node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus +@node Menu Parts @section The Parts of a Menu @cindex Parts of a menu @cindex Menu parts @@ -5225,7 +5419,7 @@ authors prefer to indent the second line while others prefer to align it with the first (and all others). It's up to you. -@node Less Cluttered Menu Entry, Menu Example, Menu Parts, Menus +@node Less Cluttered Menu Entry @comment node-name, next, previous, up @section Less Cluttered Menu Entry @cindex Two part menu entry @@ -5256,7 +5450,7 @@ instead of You should use the node name for the menu entry name whenever possible, since it reduces visual clutter in the menu.@refill -@node Menu Example, Other Info Files, Less Cluttered Menu Entry, Menus +@node Menu Example @comment node-name, next, previous, up @section A Menu Example @cindex Menu example @@ -5296,7 +5490,7 @@ Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing - several files at once. + several files at once. @@end menu @end group @end example @@ -5312,7 +5506,7 @@ Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing - several files at once. + several files at once. @end group @end example @@ -5326,7 +5520,7 @@ Since no file name is specified with either @samp{Files} or @samp{Buffers}, they must be the names of nodes in the same Info file (@pxref{Other Info Files, , Referring to Other Info Files}).@refill -@node Other Info Files, , Menu Example, Menus +@node Other Info Files @comment node-name, next, previous, up @section Referring to Other Info Files @cindex Referring to other Info files @@ -5361,9 +5555,9 @@ menu like this:@refill @group @@menu * Outlining: (emacs)Outline Mode. The major mode for - editing outlines. + editing outlines. * Rebinding: (emacs)Rebinding. How to redefine the - meaning of a key. + meaning of a key. @@end menu @end group @end example @@ -5382,7 +5576,7 @@ For example: @group * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting - text editor. + text editor. @end group @end example @@ -5418,10 +5612,8 @@ places to which cross references can refer. * uref:: How to refer to a uniform resource locator. @end menu -@node References, Cross Reference Commands, Cross References, Cross References -@ifinfo -@heading What References Are For -@end ifinfo +@node References +@section What References Are For Often, but not always, a printed document should be designed so that it can be read sequentially. People tire of flipping back and forth @@ -5441,9 +5633,9 @@ In a printed manual, a cross reference results in a page reference, unless it is to another manual altogether, in which case the cross reference names that manual.@refill -In Info, a cross reference results in an entry that you can follow using -the Info @samp{f} command. (@inforef{Help-Adv, Some advanced Info -commands, info}.)@refill +In Info, a cross reference results in an entry that you can follow +using the Info @samp{f} command. (@inforef{Help-Xref, Following +cross-references, info}.) The various cross reference commands use nodes (or anchors, @pxref{anchor,,@code{@@anchor}}) to define cross reference locations. @@ -5457,7 +5649,7 @@ printed, and will not be used online, you must nonetheless write references.@refill @need 800 -@node Cross Reference Commands, Cross Reference Parts, References, Cross References +@node Cross Reference Commands @comment node-name, next, previous, up @section Different Cross Reference Commands @cindex Different cross reference commands @@ -5489,7 +5681,7 @@ manual.@refill manuals for which there is no corresponding Info file and, therefore, no node to which to point. @xref{cite, , @code{@@cite}}.)@refill -@node Cross Reference Parts, xref, Cross Reference Commands, Cross References +@node Cross Reference Parts @comment node-name, next, previous, up @section Parts of a Cross Reference @cindex Cross reference parts @@ -5602,7 +5794,7 @@ how Info and @TeX{} format the output of each of the various commands: write @code{@@xref} at the beginning of a sentence; write @code{@@pxref} only within parentheses, and so on.@refill -@node xref, Top Node Naming, Cross Reference Parts, Cross References +@node xref @comment node-name, next, previous, up @section @code{@@xref} @findex xref @@ -5624,10 +5816,8 @@ manual.@refill * Four and Five Arguments:: @code{@@xref} with four and five arguments. @end menu -@node Reference Syntax, One Argument, xref, xref -@ifinfo -@subheading What a Reference Looks Like and Requires -@end ifinfo +@node Reference Syntax +@subsection What a Reference Looks Like and Requires Most often, an Info cross reference looks like this:@refill @@ -5662,8 +5852,8 @@ You must write that period or comma yourself; otherwise, Info will not recognize the end of the reference. (The @code{@@pxref} command works differently. @xref{pxref, , @code{@@pxref}}.)@refill -@quotation -@strong{Please note:} A period or comma @strong{must} follow the closing +@quotation Caution +A period or comma @strong{must} follow the closing brace of an @code{@@xref}. It is required to terminate the cross reference. This period or comma will appear in the output, both in the Info file and in the printed manual.@refill @@ -5679,13 +5869,13 @@ A cross reference requires only the name of a node; but it may contain up to four additional arguments. Each of these variations produces a cross reference that looks somewhat different.@refill -@quotation -@strong{Please note:} Commas separate arguments in a cross reference; +@quotation Note +Commas separate arguments in a cross reference; avoid including them in the title or other part lest the formatters mistake them for separators.@refill @end quotation -@node One Argument, Two Arguments, Reference Syntax, xref +@node One Argument @subsection @code{@@xref} with One Argument The simplest form of @code{@@xref} takes one argument, the name of @@ -5743,7 +5933,7 @@ See Section 3.1 [Tropical Storms], page 24, for more info. (Note that in the preceding example the closing brace is followed by a comma, and then by the clause, which is followed by a period.)@refill -@node Two Arguments, Three Arguments, One Argument, xref +@node Two Arguments @subsection @code{@@xref} with Two Arguments With two arguments, the second is used as the name of the Info cross @@ -5807,7 +5997,7 @@ See Section 5.2 [Electrical Effects], page 57, for more info. (Note that in the preceding example the closing brace is followed by a comma, and then by the clause, which is followed by a period.)@refill -@node Three Arguments, Four and Five Arguments, Two Arguments, xref +@node Three Arguments @subsection @code{@@xref} with Three Arguments A third argument replaces the node name in the @TeX{} output. The third @@ -5901,11 +6091,11 @@ Here are several examples from @cite{The GNU Awk User's Guide}:@refill @@xref@{Glossary@}. @@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}. @@xref@{Close Output, , Closing Output Files and Pipes@}, - for more information. + for more information. @@xref@{Regexp, , Regular Expressions as Patterns@}. @end smallexample -@node Four and Five Arguments, , Three Arguments, xref +@node Four and Five Arguments @subsection @code{@@xref} with Four and Five Arguments In a cross reference, a fourth argument specifies the name of another @@ -6019,7 +6209,7 @@ incorporated into the same @TeX{} run but make separate Info files. In this case, you need to specify only the fourth argument, and not the fifth.@refill -@node Top Node Naming, ref, xref, Cross References +@node Top Node Naming @section Naming a `Top' Node @cindex Naming a `Top' Node in references @cindex @samp{@r{Top}} node naming for references @@ -6058,9 +6248,10 @@ See section ``Overview'' in @i{The GNU Make Manual}. @noindent In this example, @samp{Top} is the name of the first node, and -@samp{Overview} is the name of the first section of the manual.@refill -@node ref, pxref, Top Node Naming, Cross References -@comment node-name, next, previous, up +@samp{Overview} is the name of the first section of the manual. + + +@node ref @section @code{@@ref} @cindex Cross references using @code{@@ref} @cindex References using @code{@@ref} @@ -6068,75 +6259,59 @@ In this example, @samp{Top} is the name of the first node, and @code{@@ref} is nearly the same as @code{@@xref} except that it does not generate a `See' in the printed output, just the reference itself. -This makes it useful as the last part of a sentence.@refill +This makes it useful as the last part of a sentence. -@need 700 -@noindent -For example, +@noindent For example, @cindex Hurricanes @example For more information, see @@ref@{Hurricanes@}. @end example -@noindent -produces +@noindent produces (in Info): @example For more information, see *Note Hurricanes::. @end example -@noindent -and +@noindent and (in printed output): @quotation For more information, see Section 8.2 [Hurricanes], page 123. @end quotation -The @code{@@ref} command sometimes leads writers to express themselves -in a manner that is suitable for a printed manual but looks awkward -in the Info format. Bear in mind that your audience will be using -both the printed and the Info format.@refill - -@need 800 -@noindent -For example, +The @code{@@ref} command sometimes tempts writers to express +themselves in a manner that is suitable for a printed manual but looks +awkward in the Info format. Bear in mind that your audience will be +using both the printed and the Info format. For example: @cindex Sea surges @example -@group Sea surges are described in @@ref@{Hurricanes@}. -@end group @end example -@need 800 -@noindent -produces +@noindent looks ok in the printed output: @quotation Sea surges are described in Section 6.7 [Hurricanes], page 72. @end quotation -@need 800 -@noindent -in a printed document, and the following in Info: +@noindent but is awkward to read in Info: @example Sea surges are described in *Note Hurricanes::. @end example -@quotation -@strong{Caution:} You @emph{must} write a period, comma, or right -parenthesis immediately after an @code{@@ref} command with two or more -arguments. Otherwise, Info will not find the end of the cross reference -entry and its attempt to follow the cross reference will fail. As a -general rule, you should write a period or comma after every -@code{@@ref} command. This looks best in both the printed and the Info -output.@refill -@end quotation +As a general rule, you should write a period or comma immediately +after an @code{@@ref} command with two or more arguments. -@node pxref, inforef, ref, Cross References -@comment node-name, next, previous, up +If there is no such following punctuation, @command{makeinfo} will +generate a (grammatically incorrect) period in the Info output; +otherwise, the cross-reference would fail completely, due to the +current syntax of Info format. + + +@node pxref @section @code{@@pxref} @cindex Cross references using @code{@@pxref} @cindex References using @code{@@pxref} @@ -6144,9 +6319,9 @@ output.@refill The parenthetical reference command, @code{@@pxref}, is nearly the same as @code{@@xref}, but you use it @emph{only} inside parentheses -and you do @emph{not} type a comma or period after the command's -closing brace. The command differs from @code{@@xref} in two -ways:@refill +and you do @emph{not} type a comma or period (or anything else) after +the command's closing brace. The command differs from @code{@@xref} +in two ways: @enumerate @item @@ -6161,8 +6336,9 @@ closing colon or period.@refill Because one type of formatting automatically inserts closing punctuation and the other does not, you should use @code{@@pxref} @emph{only} inside parentheses as part of another sentence. Also, you -yourself should not insert punctuation after the reference, as you do -with @code{@@xref}.@refill +yourself should not insert punctuation after the reference (or any +other text), as you do with @code{@@xref}. In the Info +output, such text would follow a period, which is grammatically wrong. @code{@@pxref} is designed so that the output looks right and works right between parentheses both in printed output and in an Info file. @@ -6224,27 +6400,30 @@ and @code{@@pxref} can be used with up to five arguments just like @code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill -@quotation -@strong{Please note:} Use @code{@@pxref} only as a parenthetical +@quotation Caution +Use @code{@@pxref} only as a parenthetical reference. Do not try to use @code{@@pxref} as a clause in a sentence. It will look bad in either the Info file, the printed output, or both.@refill - -Also, parenthetical cross references look best at the ends of sentences. -Although you may write them in the middle of a sentence, that location -breaks up the flow of text.@refill @end quotation -@node inforef, uref, pxref, Cross References +Parenthetical cross references look best at the ends of sentences. +Although they technically work in the middle of a sentence, that +location breaks up the flow of reading. + + +@node inforef @section @code{@@inforef} @cindex Cross references using @code{@@inforef} @cindex References using @code{@@inforef} @findex inforef -@code{@@inforef} is used for cross references to Info files for which -there are no printed manuals. Even in a printed manual, -@code{@@inforef} generates a reference directing the user to look in -an Info file.@refill +@code{@@inforef} is used for making cross references to Info +documents---even from a printed manual. This might be because you +want to refer to conditional @code{@@ifinfo} text +(@pxref{Conditionals}), or because printed output is not available +(perhaps because there is no Texinfo source), among other +possibilities. The command takes either two or three arguments, in the following order:@refill @@ -6274,67 +6453,44 @@ The template is: @need 800 @noindent -Thus, +For example, @example @group -@@inforef@{Expert, Advanced Info commands, info@}, +@@inforef@{Advanced, Advanced Info commands, info@}, for more information. @end group @end example @need 800 @noindent -produces +produces (in Info): @example @group -*Note Advanced Info commands: (info)Expert, +*Note Advanced Info commands: (info)Advanced, for more information. @end group @end example @need 800 @noindent -and +and (in the printed output): @quotation -See Info file @file{info}, node @samp{Expert}, for more information. +See Info file @file{info}, node @samp{Advanced}, for more information. @end quotation -@need 800 -@noindent -Similarly, - -@example -@group -@@inforef@{Expert, , info@}, for more information. -@end group -@end example - -@need 800 -@noindent -produces - -@example -*Note (info)Expert::, for more information. -@end example - -@need 800 -@noindent -and - -@quotation -See Info file @file{info}, node @samp{Expert}, for more information. -@end quotation +(This particular example is not realistic, since the Info manual is +written in Texinfo, so all formats are available.) The converse of @code{@@inforef} is @code{@@cite}, which is used to refer to printed works for which no Info form exists. @xref{cite, , -@code{@@cite}}.@refill +@code{@@cite}}. @node uref -@section @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}} +@section @code{@@url}, @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}} @findex uref @cindex Uniform resource locator, referring to @cindex URL, referring to @@ -6345,18 +6501,30 @@ It takes one mandatory argument, the url, and two optional arguments which control the text that is displayed. In HTML output, @code{@@uref} produces a link you can follow. +@code{@@url} is a synonym for @code{@@uref}. Originally, @code{@@url} +had the meaning of @code{@@indicateurl} +(@pxref{indicateurl,,@code{@@indicateurl}}), but in actual practice it +was misused the vast majority of the time. So we've changed the +definitions. + The second argument, if specified, is the text to display (the default is the url itself); in Info and DVI output, but not in HTML output, the url is also output. @cindex Man page, reference to -The third argument, on the other hand, if specified is also the text to -display, but the url is @emph{not} output in any format. This is useful -when the text is already sufficiently referential, as in a man page. If +The third argument, if specified, is the text to display, but in this +case the url is @emph{not} output in any format. This is useful when +the text is already sufficiently referential, as in a man page. If the third argument is given, the second argument is ignored. -The simple one argument form, where the url is both the target and the -text of the link: +If the url is long enough to cause problems with line breaking, you +may find it useful to insert @code{@@/} at places where a line break +would be acceptable (after @samp{/} characters, for instance). This +tells @TeX{} to allow (but not force) a line break at those places. +@xref{Line Breaks}. + +Here is an example of the simple one argument form, where the url is +both the target and the text of the link: @example The official GNU ftp site is @@uref@{ftp://ftp.gnu.org/gnu@}. @@ -6409,7 +6577,7 @@ The <a href="/man.cgi/1/ls">ls(1)</a> program @dots{} @end example To merely indicate a url without creating a link people can follow, use -@code{@@url} (@pxref{url, @code{@@url}}). +@code{@@indicateurl} (@pxref{indicateurl, @code{@@indicateurl}}). Some people prefer to display url's in the unambiguous format: @@ -6418,11 +6586,11 @@ Some people prefer to display url's in the unambiguous format: @end display @noindent -@cindex <URL convention, not used +@cindex <URL: convention, not used You can use this form in the input file if you wish. We feel it's not -necessary to clutter up the output with the extra @samp{<URL:} and -@samp{>}, since any software that tries to detect url's in text already -has to detect them without the @samp{<URL:} to be useful. +necessary to include the @samp{<URL:} and @samp{>} in the output, +since any software that tries to detect url's in text already has to +detect them without the @samp{<URL:} to be useful. @node Marking Text @@ -6446,7 +6614,7 @@ program. Also, you can emphasize text, in several different ways. @end menu -@node Indicating, Emphasis, Marking Text, Marking Text +@node Indicating @section Indicating Definitions, Commands, etc. @cindex Highlighting text @cindex Indicating commands, definitions, etc. @@ -6474,25 +6642,24 @@ not something else that should not be changed.@refill * code:: Indicating program code. * kbd:: Showing keyboard input. * key:: Specifying keys. -* samp:: A literal sequence of characters. -* verb:: A verbatim sequence of characters. +* samp:: Indicating a literal sequence of characters. +* verb:: Indicating a verbatim sequence of characters. * var:: Indicating metasyntactic variables. * env:: Indicating environment variables. * file:: Indicating file names. * command:: Indicating command names. * option:: Indicating option names. * dfn:: Specifying definitions. -* cite:: Referring to books not in the Info system. +* cite:: Referring to books not in the Info system. +* abbr:: Indicating abbreviations. * acronym:: Indicating acronyms. -* url:: Indicating a World Wide Web reference. +* indicateurl:: Indicating an example URL. * email:: Indicating an electronic mail address. @end menu -@node Useful Highlighting, code, Indicating, Indicating -@ifinfo -@subheading Highlighting Commands are Useful -@end ifinfo +@node Useful Highlighting +@subsection Highlighting Commands are Useful The highlighting commands can be used to extract useful information from the file, such as lists of functions or file names. It is @@ -6506,46 +6673,68 @@ The commands serve a variety of purposes:@refill @table @code @item @@code@{@var{sample-code}@} -Indicate text that is a literal example of a piece of a program.@refill +Indicate text that is a literal example of a piece of a program. +@xref{code,,@code{@@code}}. @item @@kbd@{@var{keyboard-characters}@} -Indicate keyboard input.@refill +Indicate keyboard input. +@xref{kbd,,@code{@@kbd}}. @item @@key@{@var{key-name}@} -Indicate the conventional name for a key on a keyboard.@refill +Indicate the conventional name for a key on a keyboard. +@xref{key,,@code{@@key}}. @item @@samp@{@var{text}@} -Indicate text that is a literal example of a sequence of characters.@refill +Indicate text that is a literal example of a sequence of characters. +@xref{samp,,@code{@@samp}}. + +@item @@verb@{@var{text}@} +Write a verbatim sequence of characters. +@xref{verb,,@code{@@verb}}. @item @@var@{@var{metasyntactic-variable}@} -Indicate a metasyntactic variable.@refill +Indicate a metasyntactic variable. +@xref{var,,@code{@@var}}. @item @@env@{@var{environment-variable}@} -Indicate an environment variable.@refill +Indicate an environment variable. +@xref{env,,@code{@@kenv}}. @item @@file@{@var{file-name}@} -Indicate the name of a file.@refill +Indicate the name of a file. +@xref{file,,@code{@@file}}. @item @@command@{@var{command-name}@} -Indicate the name of a command.@refill +Indicate the name of a command. +@xref{command,,@code{@@command}}. @item @@option@{@var{option}@} -Indicate a command-line option.@refill +Indicate a command-line option. +@xref{option,,@code{@@option}}. @item @@dfn@{@var{term}@} -Indicate the introductory or defining use of a term.@refill +Indicate the introductory or defining use of a term. +@xref{dfn,,@code{@@dfn}}. @item @@cite@{@var{reference}@} -Indicate the name of a book.@refill +Indicate the name of a book. +@xref{cite,,@code{@@cite}}. + +@item @@abbr@{@var{abbreviation}@} +Indicate an abbreviation. @item @@acronym@{@var{acronym}@} -Indicate an acronym.@refill +Indicate an acronym. +@xref{acronym,,@code{@@acronym}}. -@item @@url@{@var{uniform-resource-locator}@} -Indicate a uniform resource locator for the World Wide Web. +@item @@indicateurl@{@var{uniform-resource-locator}@} +Indicate an example (that is, nonfunctional) uniform resource locator. +@xref{indicateurl,,@code{@@indicateurl}}. (Use @code{@@url} +(@pxref{uref,,@code{@@url}}) for live url's.) @item @@email@{@var{email-address}[, @var{displayed-text}]@} Indicate an electronic mail address. +@xref{email,,@code{@@email}}. @ignore @item @@ctrl@{@var{ctrl-char}@} @@ -6663,26 +6852,31 @@ long-standing manuals do so. @cindex Keyboard input Use the @code{@@kbd} command for characters of input to be typed by -users. For example, to refer to the characters @kbd{M-a}, -write@refill +users. For example, to refer to the characters @kbd{M-a}, write: @example @@kbd@{M-a@} @end example @noindent -and to refer to the characters @kbd{M-x shell}, write@refill +and to refer to the characters @kbd{M-x shell}, write: @example @@kbd@{M-x shell@} @end example -@cindex user input -@cindex slanted typewriter font, for @code{@@kbd} -The @code{@@kbd} command has the same effect as @code{@@code} in Info, -but by default produces a different font (slanted typewriter instead of -normal typewriter) in the printed manual, so users can distinguish the -characters they are supposed to type from those the computer outputs. +@cindex User input +@cindex Slanted typewriter font, for @code{@@kbd} +By default, the @code{@@kbd} command produces a different font +(slanted typewriter instead of normal typewriter) in the printed +manual, so users can distinguish the characters that they are supposed +to type from those that the computer outputs. + +In Info output, @code{@@kbd} is usually the same as @code{@@code}, +producing `quotes' around its argument. However, in typewriter-like +contexts such as the @code{@@example} environment (@pxref{example}) +and @code{@@code} command itself, the quotes are omitted, since Info +format cannot use distinguishing fonts. @findex kbdinputstyle Since the usage of @code{@@kbd} varies from manual to manual, you can @@ -6690,9 +6884,10 @@ control the font switching with the @code{@@kbdinputstyle} command. This command has no effect on Info output. Write this command at the beginning of a line with a single word as an argument, one of the following: -@vindex distinct@r{, arg to @@kbdinputstyle} -@vindex example@r{, arg to @@kbdinputstyle} -@vindex code@r{, arg to @@kbdinputstyle} + +@vindex distinct@r{, value for @code{@@kbdinputstyle}} +@vindex example@r{, value for @code{@@kbdinputstyle}} +@vindex code@r{, value for @code{@@kbdinputstyle}} @table @samp @item code Always use the same font for @code{@@kbd} as @code{@@code}. @@ -6705,18 +6900,19 @@ and similar environments. You can embed another @@-command inside the braces of an @code{@@kbd} command. Here, for example, is the way to describe a command that -would be described more verbosely as ``press an @samp{r} and then -press the @key{RET} key'':@refill +would be described more verbosely as ``press the @samp{r} key and then +press the @key{RETURN} key'': @example @@kbd@{r @@key@{RET@}@} @end example @noindent -This produces: @kbd{r @key{RET}} +This produces: @kbd{r @key{RET}}. (The present manual accepts the +default for @code{@@kbdinputstyle}.) You also use the @code{@@kbd} command if you are spelling out the letters -you type; for example:@refill +you type; for example: @example To give the @@code@{logout@} command, @@ -6732,11 +6928,11 @@ type the characters @kbd{l o g o u t @key{RET}}. @end quotation (Also, this example shows that you can add spaces for clarity. If you -really want to mention a space character as one of the characters of +explicitly want to mention a space character as one of the characters of input, write @kbd{@@key@{SPC@}} for it.)@refill -@node key, samp, kbd, Indicating +@node key @comment node-name, next, previous, up @subsection @code{@@key}@{@var{key-name}@} @findex key @@ -6866,11 +7062,11 @@ In English, the vowels are @samp{a}, @samp{e}, @findex verb @cindex Verbatim in-line text -@cindex Delimiter character, for verbatim +@cindex Delimiter character, for verbatim Use the @code{@@verb} command to print a verbatim sequence of characters. -Like La@TeX{}'s @code{\verb} command, the verbatim text can be quoted using +Like @LaTeX{}'s @code{\verb} command, the verbatim text can be quoted using any unique delimiter character. Enclose the verbatim text, including the delimiters, in braces. Text is printed in a fixed-width font: @@ -6887,10 +7083,16 @@ How many @verb{|@|}-escapes does one need to print this @verb{.@a @b @c.} string or these @verb{+@'e?`{}!`\+} this? @end example -This is in contrast to @code{@@samp} (see the previous -section), whose argument is normal Texinfo text, where the characters -@code{@@@{@}} are special; with @code{@@verb}, nothing is special except -the delimiter character you choose. +This is in contrast to @code{@@samp} (see the previous section), +@code{@@code}, and similar commands; in those cases, the argument is +normal Texinfo text, where the three characters @code{@@@{@}} are +special. With @code{@@verb}, nothing is special except the delimiter +character you choose. + +It is not reliable to use @code{@@verb} inside other Texinfo +constructs. In particular, it does not work to use @code{@@verb} in +anything related to cross-referencing, such as section titles or +figure captions. @node var @@ -6914,7 +7116,7 @@ is correct for them (see the next section). The effect of @code{@@var} in the Info file is to change the case of the argument to all upper case. In the printed manual and HTML output, the -argument is printed in slanted type. +argument is printed in slanted type. @need 700 For example, @@ -7161,46 +7363,145 @@ identify that control character: an uparrow followed by the character @end ignore +@node abbr +@subsection @code{@@abbr}@{@var{abbreviation}[, @var{meaning}]@} +@findex abbr + +@cindex Abbreviations, tagging +You can use the @code{@@abbr} command for general abbreviations. The +abbreviation is given as the single argument in braces, as in +@samp{@@abbr@{Comput.@}}. As a matter of style, or for particular +abbreviations, you may prefer to omit periods, as in +@samp{@@abbr@{Mr@} Stallman}. + +@code{@@abbr} accepts an optional second argument, intended to be used +for the meaning of the abbreviation. + +If the abbreviation ends with a lowercase letter and a period, and is +not at the end of a sentence, and has no second argument, remember to +use the @code{@@.} command (@pxref{Not Ending a +Sentence}) to get the correct spacing. However, you do not have to +use @code{@@.} within the abbreviation itself; Texinfo automatically +assumes periods within the abbreivation do not end a sentence. + +@cindex <abbr> tag +In @TeX{} and in the Info output, the first argument is printed as-is; +if the second argument is present, it is printed in parentheses after +the abbreviation. In HTML and XML, the @code{<abbr>} tag is +used; in Docbook, the @code{<abbrev>} tag is used. For instance: + +@example +@@abbr@{Comput. J., Computer Journal@} +@end example + +@noindent produces: + +@display +@abbr{Comput. J., Computer Journal} +@end display + +For abbreviations consisting of all capital letters, you may prefer to +use the @code{@@acronym} command instead. See the next section for +more on the usage of these two commands. + + @node acronym -@subsection @code{@@acronym}@{@var{acronym}@} +@subsection @code{@@acronym}@{@var{acronym}[, @var{meaning}]@} @findex acronym @cindex NASA, as acronym -@cindex F.B.I., as acronym -@cindex Abbreviations, tagging @cindex Acronyms, tagging Use the @code{@@acronym} command for abbreviations written in all capital letters, such as `@acronym{NASA}'. The abbreviation is given as the single argument in braces, as in @samp{@@acronym@{NASA@}}. As -a matter of style, or for particular abbreviations, you may prefer to -use periods, as in @samp{@@acronym@{F.B.I.@}}. +a matter of style, or for particular acronyms, you may prefer to +use periods, as in @samp{@@acronym@{N.A.S.A.@}}. + +@code{@@acronym} accepts an optional second argument, intended to be +used for the meaning of the acronym. + +If the acronym is at the end of a sentence, and if there is no second +argument, remember to use the @code{@@.} or similar command +(@pxref{Ending a Sentence}) to get the correct spacing. + +@cindex <acronym> tag +In @TeX{}, the acronym is printed in slightly smaller font. In the +Info output, the argument is printed as-is. In either format, if the +second argument is present, it is printed in parentheses after the +acronym. In HTML, Docbook, and XML, the @code{<acronym>} tag is +used. + +For instance (since GNU is a recursive acronym, we use +@code{@@acronym} recursively): + +@example +@@acronym@{GNU, @@acronym@{GNU@}'s Not Unix@} +@end example + +@noindent produces: -In @TeX{} and HTML, the argument is printed in a slightly smaller font -size. In Info or plain text output, this command changes nothing. +@display +@acronym{GNU, @acronym{GNU}'s Not Unix} +@end display +In some circumstances, it is conventional to print family names in all +capitals. Don't use @code{@@acronym} for this, since a name is not an +acronym. Use @code{@@sc} instead (@pxref{Smallcaps}). + +@code{@@abbr} and @code{@@acronym} are closely related commands: they +both signal to the reader that a shortened form is being used, and +possibly give a meaning. When choosing whether to use these two +commands, please bear the following in mind. + +@itemize @minus +@item +In standard English usage, acronyms are a subset of abbreviations: +they include pronounceable words like `@acronym{NATO}', `radar', and +`snafu', and some sources also include syllable acronyms like +`Usenet', hybrids like `@acronym{SIGGRAPH}', and unpronounceable +initialisms like `@acronym{FBI}'. -@node url -@subsection @code{@@url}@{@var{uniform-resource-locator}@} -@findex url +@item +In Texinfo, an acronym (but not an abbreviation) should consist only +of capital letters and periods, no lowercase. + +@item +In @TeX{}, an acronym (but not an abbreviation) is printed in a +slightly smaller font. + +@item +Some browsers place a dotted bottom border under abbreviations but not +acronyms. + +@item +It's not essential to use these commands for all abbreviations. Text +is perfectly readable without them, and for common abbreviations like +`etc.@:', we consider them to be overkill. + +@end itemize + + +@node indicateurl +@subsection @code{@@indicateurl}@{@var{uniform-resource-locator}@} +@findex indicateurl @cindex Uniform resource locator, indicating @cindex URL, indicating -Use the @code{@@url} command to indicate a uniform resource locator on -the World Wide Web. This is analogous to @code{@@file}, @code{@@var}, -etc., and is purely for markup purposes. It does not produce a link you -can follow in HTML output (use the @code{@@uref} command for that, -@pxref{uref,, @code{@@uref}}). It is useful for url's which do -not actually exist. For example: +Use the @code{@@indicateurl} command to indicate a uniform resource +locator on the World Wide Web. This is analogous to @code{@@file}, +@code{@@var}, etc., and is purely for markup purposes. It does not +produce a link you can follow in HTML output (use the @code{@@uref} +command for that, @pxref{uref,, @code{@@uref}}). It is useful for +url's which do not actually exist. For example: -@c Two lines because one is too long for smallbook format. @example -For example, the url might be @@url@{http://example.org/path@}. +For example, the url might be @@indicateurl@{http://example.org/path@}. @end example @noindent which produces: @display -For example, the url might be @url{http://example.org/path}. +For example, the url might be @indicateurl{http://example.org/path}. @end display @@ -7212,11 +7513,11 @@ Use the @code{@@email} command to indicate an electronic mail address. It takes one mandatory argument, the address, and one optional argument, the text to display (the default is the address itself). -@cindex mailto link -In Info and @TeX{}, the address is shown in angle brackets, preceded by -the text to display if any. In HTML output, @code{@@email} produces a -@samp{mailto} link that usually brings up a mail composition window. -For example: +@cindex Mailto link +In Info, the address is shown in angle brackets, preceded by the text +to display if any. In @TeX{}, the angle brackets are omitted. In +HTML output, @code{@@email} produces a @samp{mailto} link that usually +brings up a mail composition window. For example: @example Send bug reports to @@email@{bug-texinfo@@@@gnu.org@}, @@ -7259,38 +7560,29 @@ The @code{@@emph} and @code{@@strong} commands are for emphasis; @code{@@strong} is stronger. In printed output, @code{@@emph} produces @emph{italics} and @code{@@strong} produces @strong{bold}. -@need 800 For example, @example @group -@@quotation -@@strong@{Caution:@} @@samp@{rm * .[^.]*@} removes @@emph@{all@} -files in the directory. -@@end quotation +@@strong@{Caution:@} @@samp@{rm * .[^.]*@} +removes @@emph@{all@} files in the directory. @end group @end example -@iftex @noindent -produces the following in printed output: +produces the following in printed output and HTML: @quotation -@strong{Caution}: @samp{rm * .[^.]*} removes @emph{all} -files in the directory. +@strong{Caution}: @samp{rm * .[^.]*} +removes @emph{all} files in the directory. @end quotation @noindent and the following in Info: -@end iftex -@ifinfo -@noindent -produces: -@end ifinfo @example - *Caution*: `rm * .[^.]*' removes _all_ - files in the directory. +*Caution:* `rm * .[^.]*' removes _all_ +files in the directory. @end example The @code{@@strong} command is seldom used except to mark what is, in @@ -7300,10 +7592,12 @@ preceding example. In the Info output, @code{@@emph} surrounds the text with underscores (@samp{_}), and @code{@@strong} puts asterisks around the text. -@quotation -@strong{Caution:} Do not use @code{@@strong} with the word @samp{Note}; -Info will mistake the combination for a cross reference. Use a phrase -such as @strong{Please note} or @strong{Caution} instead. +@quotation Caution +Do not use @code{@@strong} with the word @samp{Note}; Info will +mistake the combination for a cross reference. (It's usually +redundant, anyway.) Use a phrase such as @strong{Please notice} or +@strong{Caution} instead, or the optional argument to +@code{@@quotation}---@samp{Note} is allowable there. @end quotation @@ -7312,68 +7606,103 @@ such as @strong{Please note} or @strong{Caution} instead. @cindex Small caps font @findex sc @r{(small caps font)} -Use the @samp{@@sc} command to set text in the printed and the HTML -output in @sc{a small caps font} and set text in the Info file in upper -case letters. Write the text you want to be in small caps (where -possible) between braces in lower case, like this: +Use the @samp{@@sc} command to set text in @sc{a small caps font} +(where possible). Write the text you want to be in small caps between +braces in lower case, like this: @example -The @@sc@{acm@} and @@sc@{ieee@} are technical societies. +Richard @@sc@{Stallman@} founded @@acronym@{GNU@}. @end example @noindent This produces: @display -The @sc{acm} and @sc{ieee} are technical societies. +Richard @sc{Stallman} founded @acronym{GNU}. @end display -@TeX{} typesets the small caps font in a manner that prevents the -letters from `jumping out at you on the page'. This makes small caps -text easier to read than text in all upper case---but it's usually -better to use regular mixed case anyway. The Info formatting commands -set all small caps text in upper case. In HTML, the text is upper-cased -and a smaller font is used to render it. +As shown here, we recommend using @code{@@acronym} for actual +acronyms (@pxref{acronym}), and reserving @code{@@sc} for special +cases where you want small caps. The output is not the same +(@code{@@acronym} prints in a smaller text font, not the small caps +font), but more importantly it describes the actual text more +accurately. + +Family names are one case where small capitals are sometimes desirable, +also as shown here. -If the text between the braces of an @code{@@sc} command is uppercase, -@TeX{} typesets in FULL-SIZE CAPITALS. Use full-size capitals -sparingly, if ever, and since it's redundant to mark all-uppercase text -with @code{@@sc}, @command{makeinfo} warns about such usage. +@cindex <small> tag +@TeX{} typesets any uppercase letters between the braces of an +@code{@@sc} command in full-size capitals; only lowercase letters are +printed in the small caps font. In the Info output, the argument to +@code{@@sc} is printed in all upper case. In HTML, the argument is +uppercased and the output marked with the @code{<small>} tag to reduce +the font size. -You may also use the small caps font for a jargon word such as -@sc{ato} (a @sc{nasa} word meaning `abort to orbit'). +Since it's redundant to mark all-uppercase text with @code{@@sc}, +@command{makeinfo} warns about such usage. -There are subtleties to using the small caps font with a jargon word -such as @sc{cdr}, a word used in Lisp programming. In this case, you -should use the small caps font when the word refers to the second and -subsequent elements of a list (the @sc{cdr} of the list), but you -should use @samp{@@code} when the word refers to the Lisp function of -the same spelling. +We recommend using regular mixed case wherever possible. @node Fonts @subsection Fonts for Printing, Not Info -@cindex Fonts for printing, not for Info -@findex i @r{(italic font)} +@cindex Fonts for printing, not Info + +Texinfo provides a number of font commands that specify font changes +in the printed manual and (where possible) in the HTML output, but +have no effect in the Info file. All the commands apply to an +argument that follows, surrounded by braces. + +@table @code +@item @@b @findex b @r{(bold font)} +@cindex Bold font +selects @b{bold} face; + +@item @@i +@findex i @r{(italic font)} +@cindex Italic font +selects an @i{italic} font; + +@item @@r +@findex r @r{(roman font)} +@cindex Roman font +@cindex Default font +selects a @r{roman} font, which is the usual font in which text is +printed. It may or may not be seriffed. + +@item @@sansserif +@findex sansserif @r{(sans serif font)} +@cindex Sans serif font +selects a @sansserif{sans serif} font; + +@item @@slanted +@findex slanted @r{(slanted font)} +@cindex Slanted font +@cindex Oblique font +rselects a @slanted{slanted} font; + +@item @@t @findex t @r{(typewriter font)} -@findex r @r{(Roman font)} - -Texinfo provides four font commands that specify font changes in the -printed manual but have no effect in the Info file. @code{@@i} -requests @i{italic} font (in some versions of @TeX{}, a slanted font -is used), @code{@@b} requests @b{bold} face, @code{@@t} requests the -@t{fixed-width}, typewriter-style font used by @code{@@code}, and @code{@@r} requests a -@r{roman} font, which is the usual font in which text is printed. All -four commands apply to an argument that follows, surrounded by -braces.@refill - -Only the @code{@@r} command has much use: in example programs, you -can use the @code{@@r} command to convert code comments from the -fixed-width font to a roman font. This looks better in printed -output.@refill +@cindex Monospace font +@cindex Fixed-width font +@cindex Typewriter font +selects the @t{fixed-width}, typewriter-style font used by @code{@@code}; + +@end table + +(The commands with longer names were invented much later than the +others, when it did not seem desirable to use very short names for +such an infrequently needed feature.) + +@cindex <lineannotation> Docbook tag +Only the @code{@@r} command has much use: in example-like +environments, you can use the @code{@@r} command to write comments in +the standard roman font instead of the fixed-width font. This looks +better in printed output, and produces a @code{<lineannotation>} tag +in Docbook output. -@need 700 For example, @example @@ -7391,9 +7720,9 @@ produces (+ 2 2) ; @r{Add two plus two.} @end lisp -If possible, you should avoid using the other three font commands. If -you need to use one, it probably indicates a gap in the Texinfo -language. +In general, you should avoid using the other font commands. Some of +them are only useful when documenting functionality with specific font +effects, such as in \TeX\ and related packages. @node Quotations and Examples @@ -7401,16 +7730,17 @@ language. Quotations and examples are blocks of text consisting of one or more whole paragraphs that are set off from the bulk of the text and -treated differently. They are usually indented.@refill +treated differently. They are usually indented in the output. +@findex end In Texinfo, you always begin a quotation or example by writing an @@-command at the beginning of a line by itself, and end it by writing an @code{@@end} command that is also at the beginning of a line by itself. For instance, you begin an example by writing @code{@@example} by itself at the beginning of a line and end the example by writing @code{@@end example} on a line by itself, at the beginning of that -line. -@findex end +line, and with only one space between the @code{@@end} and the +@code{example}. @menu * Block Enclosing Commands:: Different constructs for different purposes. @@ -7419,12 +7749,13 @@ line. * verbatim:: Writing a verbatim example. * verbatiminclude:: Including a file verbatim. * lisp:: Illustrating Lisp code. -* small:: Forms for @code{@@smallbook}. +* small:: Examples in a smaller font. * display:: Writing an example in the current font. * format:: Writing an example without narrowed margins. * exdent:: Undo indentation on a line. * flushleft & flushright:: Pushing text flush left or flush right. * noindent:: Preventing paragraph indentation. +* indent:: Forcing paragraph indentation. * cartouche:: Drawing rounded rectangles around examples. @end menu @@ -7437,18 +7768,18 @@ following sections: @table @code @item @@quotation -Indicate text that is quoted. The text is filled, indented, and -printed in a roman font by default. +Indicate text that is quoted. The text is filled, indented (from both +margins), and printed in a roman font by default. @item @@example Illustrate code, commands, and the like. The text is printed in a fixed-width font, and indented but not filled. @item @@verbatim -Mark a piece of text that is to be printed verbatim; no character +Mark a piece of text that is to be printed verbatim; no character substitutions are made and all commands are ignored, until the next -@code{@@end verbatim}. The text is printed in a fixed-width font, -and not indented or filled. Extra spaces and blank lines are +@code{@@end verbatim}. The text is printed in a fixed-width font, +and not indented or filled. Extra spaces and blank lines are significant, and tabs are expanded. @item @@smallexample @@ -7487,47 +7818,50 @@ The @code{@@noindent} command may be used after one of the above constructs to prevent the following text from being indented as a new paragraph. -You can use the @code{@@cartouche} command within one of the above +You can use the @code{@@cartouche} environment around one of the above constructs to highlight the example or quotation by drawing a box with rounded corners around it. @xref{cartouche, , Drawing Cartouches Around Examples}. @node quotation -@section @code{@@quotation} +@section @code{@@quotation}: Block quotations @cindex Quotations @findex quotation -The text of a quotation is processed normally except that: +The text of a quotation is processed normally (regular font, text is +filled) except that: @itemize @bullet @item the margins are closer to the center of the page, so the whole of the -quotation is indented;@refill +quotation is indented; @item -the first lines of paragraphs are indented no more than other -lines;@refill +and the first lines of paragraphs are indented no more than other lines. -@item -in the printed output, interparagraph spacing is reduced.@refill @end itemize @quotation This is an example of text written between an @code{@@quotation} command and an @code{@@end quotation} command. An @code{@@quotation} command is most often used to indicate text that is excerpted from -another (real or hypothetical) printed work.@refill +another (real or hypothetical) printed work. @end quotation Write an @code{@@quotation} command as text on a line by itself. This line will disappear from the output. Mark the end of the quotation with a line beginning with and containing only @code{@@end quotation}. The @code{@@end quotation} line will likewise disappear from the -output. Thus, the following,@refill +output. + +@code{@@quotation} takes one optional argument, given on the remainder +of the line. This text, if present, is included at the beginning of +the quotation in bold or otherwise emphasized, and followed with a +@samp{:}. For example: @example -@@quotation +@@quotation Note This is a foo. @@end quotation @@ -7536,10 +7870,23 @@ a foo. @noindent produces -@quotation -This is a foo. +@quotation Note +This is +a foo. @end quotation +If the @code{@@quotation} argument is exactly one of these words: + +@example +Caution Important Note Tip Warning +@end example + +@cindex <note> Docbook tag +@cindex <blockquote> HTML tag +@noindent then the Docbook output uses corresponding special tags +(@code{<note>}, etc.) instead of the default @code{<blockquote>}. +HTML output always uses @code{<blockquote>}. + @node example @section @code{@@example}: Example Text @@ -7547,36 +7894,31 @@ This is a foo. @cindex Formatting examples @findex example -The @code{@@example} command is used to indicate an example that is -not part of the running text, such as computer input or output. - -@example -@group -This is an example of text written between an -@code{@@example} command -and an @code{@@end example} command. -The text is indented but not filled. -@end group - -@group -In the printed manual, the text is typeset in a -fixed-width font, and extra spaces and blank lines are -significant. In the Info file, an analogous result is -obtained by indenting each line with five spaces. -@end group -@end example - -Write an @code{@@example} command at the beginning of a line by itself. -Mark the end of the example -with an @code{@@end example} command, also written at the beginning of a -line by itself.@refill +The @code{@@example} environment is used to indicate an example that +is not part of the running text, such as computer input or output. +Write an @code{@@example} command at the beginning of a line by +itself. Mark the end of the example with an @code{@@end example} +command, also written at the beginning of a line by itself. + +An @code{@@example} environment has the following characteristics: + +@itemize +@item Each line in the input file is a line in the output; that is, +the source text is not filled as it normally is. +@item Extra spaces and blank lines are significant. +@item The output is indented. +@item The output uses a fixed-width font. +@item Texinfo commands @emph{are} expanded; if you want the output to +be the input verbatim, use the @code{@@verbatim} environment instead +(@pxref{verbatim,,@code{@@verbatim}}). +@end itemize -@need 700 For example, @example @@example -mv foo bar +cp foo @@var@{dest1@}; \ + cp foo @@var@{dest2@} @@end example @end example @@ -7584,37 +7926,36 @@ mv foo bar produces @example -mv foo bar +cp foo @var{dest1}; \ + cp foo @var{dest2} @end example -The lines containing @code{@@example} and @code{@@end example} -will disappear from the output. -To make the output look good, -you should put a blank line before the -@code{@@example} and another blank line after the @code{@@end example}. -Note that blank lines inside the beginning -@code{@@example} and the ending @code{@@end example} will appear in -the output.@refill +The lines containing @code{@@example} and @code{@@end example} will +disappear from the output. To make the output look good, you should +put a blank line before the @code{@@example} and another blank line +after the @code{@@end example}. Blank lines inside the beginning +@code{@@example} and the ending @code{@@end example}, on the other +hand, do appear in the output. -@quotation -@strong{Caution:} Do not use tabs in the lines of an example or anywhere -else in Texinfo (except in verbatim environments)! The @TeX{} -implementation of Texinfo treats tabs as single spaces, and that is not -what they look like. (If necessary, in Emacs, you can use @kbd{M-x -untabify} to convert tabs in a region to multiple spaces.)@refill +@quotation Caution +Do not use tabs in the lines of an example! (Or anywhere else in +Texinfo, except in verbatim environments.) @TeX{} treats tabs as +single spaces, and that is not what they look like. In Emacs, you can +use @kbd{M-x untabify} to convert tabs in a region to multiple spaces. @end quotation Examples are often, logically speaking, ``in the middle'' of a -paragraph, and the text that continues after an example should not be -indented. The @code{@@noindent} command prevents a piece of text from -being indented as if it were a new paragraph. -@ifinfo -(@xref{noindent}.) -@end ifinfo +paragraph, and the text that continues afterwards should not be +indented, as in the example above. The @code{@@noindent} command +prevents a piece of text from being indented as if it were a new +paragraph (@pxref{noindent,,@code{@@noindent}}. -(The @code{@@code} command is used for examples of code that are -embedded within sentences, not set off from preceding and following -text. @xref{code, , @code{@@code}}.) +If you want to embed code fragments within sentences, instead of +displaying them, use the @code{@@code} command or its relatives +(@pxref{code,,@code{@@code}}). + +If you wish to write a ``comment'' on a line of an example in the +normal roman font, you can use the @code{@@r} command (@pxref{Fonts}). @node verbatim @@ -7650,12 +7991,12 @@ For example: @c oops, got to trick this a bit: can't use @end verbatim inside @verbatim @example -@exdent @@verbatim -@exdent @{ -@exdent <tab>@@command with strange characters: @@'e -@exdent expand<tab>me -@exdent @} -@exdent @@end verbatim +@exdent @t{@@verbatim} +@exdent @t{@{} +@exdent @key{TAB}@t{@@command with strange characters: @@'e} +@exdent @t{expand@key{TAB}me} +@exdent @t{@}} +@exdent @t{@@end verbatim} @end example @noindent @@ -7663,16 +8004,18 @@ produces @verbatim { - @command with strange characters: @'e + @command with strange characters: @'e expand me } @end verbatim Since the lines containing @code{@@verbatim} and @code{@@end verbatim} -produce no output, tyically you should put a blank line before the +produce no output, typically you should put a blank line before the @code{@@verbatim} and another blank line after the @code{@@end -verbatim}. Blank lines between the beginning @code{@@verbatim} and the -ending @code{@@end verbatim} will appear in the output. +verbatim}. Blank lines between the beginning @code{@@verbatim} and +the ending @code{@@end verbatim} will appear in the output. + +It is not reliable to use @code{@@verbatim} inside other Texinfo constructs. @node verbatiminclude @@ -7690,7 +8033,22 @@ You can include the exact contents of a file in the document with the The contents of @var{filename} is printed in a verbatim environment (@pxref{verbatim,,@code{@@verbatim}}). Generally, the file is printed -exactly as it is, with all special characters and white space retained. +exactly as it is, with all special characters and white space +retained. No indentation is added; if you want indentation, enclose +the @code{@@verbatiminclude} within @code{@@example} +(@pxref{example,,@code{@@example}}). + +The name of the file is taken literally, with a single exception: +@code{@@value@{@var{var}@}} references are expanded. This makes it +possible to reliably include files in other directories in a +distribution, for instance: + +@example +@@include @@value@{top_srcdir@}/NEWS +@end example + +@noindent (You still have to get @code{top_srcdir} defined in the +first place.) @node lisp @@ -7714,7 +8072,7 @@ library.@footnote{It would be straightforward to extend Texinfo to work in a similar fashion for C, Fortran, or other languages.} Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by -itself.@refill +itself. @node small @@ -7732,65 +8090,37 @@ Texinfo has ``small'' example-style commands. These are @code{@@smalldisplay}, @code{@@smallexample}, @code{@@smallformat}, and @code{@@smalllisp}. -In @TeX{}, the @code{@@small@dots{}} commands typeset text in a smaller -font than the non-small example commands. Consequently, many examples -containing long lines fit on a page without needing to be shortened. - In Info, the @code{@@small@dots{}} commands are equivalent to their non-small companion commands. +In @TeX{}, however, the @code{@@small@dots{}} commands typeset text in +a smaller font than the non-small example commands. Consequently, +many examples containing long lines fit on a page without needing to +be shortened. + Mark the end of an @code{@@small@dots{}} block with a corresponding @code{@@end small@dots{}}. For example, pair @code{@@smallexample} with @code{@@end smallexample}. -@iftex -Here is an example written in the small font used by the -@code{@@smallexample} and @code{@@smalllisp} commands: +Here is an example of the font used by the @code{@@small@dots{}} +commands (in Info, the output will be the same as usual): -@ifclear smallbook -@display -@tex -% Remove extra vskip; this is a kludge to counter the effect of display -\vskip-3\baselineskip -{\smalltt -\dots{} to make sure that you have the freedom to +@smallexample +@dots{} to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free -programs; and that you know you can do these things.} -@end tex -@end display -@end ifclear -@end iftex -@ifset smallbook -@iftex -@smallexample -This is an example of text written between @code{@@smallexample} and -@code{@@end smallexample}. In Info this text appears in its normal size; -but in printed manuals, this text appears in a smaller font. -@end smallexample -@end iftex -@end ifset -@ifinfo -@smallexample -This is an example of text written between @code{@@smallexample} and -@code{@@end smallexample}. In Info this text appears in its normal size; -but in a 7 by 9.25 inch manual, this text appears in a smaller font. +programs; and that you know you can do these things. @end smallexample -@end ifinfo The @code{@@small@dots{}} commands make it easier to prepare manuals without forcing you to edit examples by hand to fit them onto narrower pages. -As a general rule, a printed document looks better if you use only one -of (for example) @code{@@example} or in @code{@@smallexample} -consistently within a chapter. Only occasionally should you mix the two -formats. - -@xref{smallbook, , Printing ``Small'' Books}, for more information -about the @code{@@smallbook} command. +As a general rule, a printed document looks much better if you use +only one of (for instance) @code{@@example} or @code{@@smallexample} +consistently within a chapter. @node display @@ -7798,13 +8128,13 @@ about the @code{@@smallbook} command. @cindex Display formatting @findex display -The @code{@@display} command begins a kind of example. It is like the -@code{@@example} command -except that, in -a printed manual, @code{@@display} does not select the fixed-width -font. In fact, it does not specify the font at all, so that the text -appears in the same font it would have appeared in without the -@code{@@display} command.@refill +The @code{@@display} command begins a kind of example, where each line +of input produces a line of output, and the output is indented. It is +thus like the @code{@@example} command except that, in a printed +manual, @code{@@display} does not select the fixed-width font. In +fact, it does not specify the font at all, so that the text appears in +the same font it would have appeared in without the @code{@@display} +command. @display This is an example of text written between an @code{@@display} command @@ -7817,6 +8147,11 @@ Texinfo also provides a command @code{@@smalldisplay}, which is like @code{@@display} but uses a smaller font in @code{@@smallbook} format. @xref{small}. +The @code{@@table} command (@pxref{table}) does not work inside +@code{@@display}. Since @code{@@display} is line-oriented, it doesn't +make sense to use them together. If you want to indent a table, try +@code{@@quotation} (@pxref{quotation}). + @node format @section @code{@@format} and @code{@@smallformat} @@ -7885,8 +8220,8 @@ returning the page to its normal width.@refill @section @code{@@flushleft} and @code{@@flushright} @findex flushleft @findex flushright -@cindex ragged right -@cindex ragged left +@cindex Ragged right +@cindex Ragged left The @code{@@flushleft} and @code{@@flushright} commands line up the ends of lines on the left and right margins of a page, @@ -7945,13 +8280,22 @@ left end ragged. @node noindent @section @code{@@noindent}: Omitting Indentation +@cindex Omitting indentation +@cindex Suppressing indentation +@cindex Indentation, omitting @findex noindent An example or other inclusion can break a paragraph into segments. Ordinarily, the formatters indent text that follows an example as a new -paragraph. However, you can prevent this by writing @code{@@noindent} -at the beginning of a line by itself preceding the continuation -text.@refill +paragraph. You can prevent this on a case-by-case basis by writing +@code{@@noindent} at the beginning of a line, preceding the continuation +text. You can also disable indentation for all paragraphs globally with +@code{@@paragraphindent} (@pxref{paragraphindent, Paragraph Indenting}). + +It is best to write @code{@@noindent} on a line by itself, since in most +environments, spaces following the command will not be ignored. It's ok +to use it at the beginning of a line, with text following, outside of +any environment. @need 1500 For example: @@ -7970,35 +8314,60 @@ that follows after it. (This whole example is between @end group @end example -@noindent -produces +@noindent produces: @display + @example This is an example @end example -@tex -% Remove extra vskip; this is a kludge to counter the effect of display -\vskip-3.5\baselineskip -@end tex @noindent This line is not indented. As you can see, the beginning of the line is fully flush left with the line that follows after it. (This whole example is between @code{@@display} and @code{@@end display}.) + @end display To adjust the number of blank lines properly in the Info file output, remember that the line containing @code{@@noindent} does not generate a -blank line, and neither does the @code{@@end example} line.@refill +blank line, and neither does the @code{@@end example} line. In the Texinfo source file for this manual, each line that says -`produces' is preceded by a line containing @code{@@noindent}.@refill +`produces' is preceded by @code{@@noindent}. Do not put braces after an @code{@@noindent} command; they are not necessary, since @code{@@noindent} is a command used outside of -paragraphs (@pxref{Command Syntax}).@refill +paragraphs (@pxref{Command Syntax}). + + +@node indent +@section @code{@@indent}: Forcing Indentation +@cindex Forcing indentation +@cindex Inserting indentation +@cindex Indentation, forcing +@findex indent + +@indent +To complement the @code{@@noindent} command (see the previous +section), Texinfo provides the @code{@@indent} command that forces a +paragraph to be indented. This paragraph, for instance, is indented +using an @code{@@indent} command. The first paragraph of a section is +the most likely place to use @code{@@indent}, to override the normal +behavior of no indentation there (@pxref{paragraphindent}). + +It is best to write @code{@@indent} on a line by itself, since in most +environments, spaces following the command will not be ignored. The +@code{@@indent} line will not generate a blank line in the Info output +within an environment. + +However, it is ok to use it at the beginning of a line, with text +following, outside of any environment. + +Do not put braces after an @code{@@indent} command; they are not +necessary, since @code{@@indent} is a command used outside of +paragraphs (@pxref{Command Syntax}). @node cartouche @@ -8008,45 +8377,44 @@ paragraphs (@pxref{Command Syntax}).@refill @cindex Rounded rectangles, around examples In a printed manual, the @code{@@cartouche} command draws a box with -rounded corners around its contents. You can use this command to -further highlight an example or quotation. For instance, you could -write a manual in which one type of example is surrounded by a cartouche -for emphasis. +rounded corners around its contents. In HTML, a normal rectangle is +drawn (that's the best HTML can do). @code{@@cartouche} has no effect +in Info output. -@code{@@cartouche} affects only the printed manual; it has no effect in -other output files. +You can use this command to further highlight an example or quotation. +For instance, you could write a manual in which one type of example is +surrounded by a cartouche for emphasis. -@need 1500 For example, @example -@group -@@example @@cartouche +@@example % pwd /usr/local/share/emacs -@@end cartouche @@end example -@end group +@@end cartouche @end example @noindent surrounds the two-line example with a box with rounded corners, in the printed manual. -@iftex -In a printed manual, the example looks like this:@refill +The output from the example looks like this (if you're reading this in +Info, you'll see the @code{@@cartouche} had no effect): -@example -@group @cartouche +@example % pwd -/usr/local/lib/emacs/info -@end cartouche -@end group +/usr/local/info @end example -@end iftex +@end cartouche +For proper output in HTML, it's necessary to put the +@code{@@cartouche} around the @code{@@example}, and not the other way +around. This limitation of @command{makeinfo} may be removed one day. + +@code{@@cartouche} also implies @code{@@group} (@pxref{group}). @node Lists and Tables @chapter Lists and Tables @@ -8066,10 +8434,8 @@ the first column; multi-column tables are also supported. * Multi-column Tables:: How to construct generalized tables. @end menu -@node Introducing Lists, itemize, Lists and Tables, Lists and Tables -@ifinfo -@heading Introducing Lists -@end ifinfo +@node Introducing Lists +@section Introducing Lists Texinfo automatically indents the text in lists or tables, and numbers an enumerated list. This last feature is useful if you modify the @@ -8166,9 +8532,9 @@ Write the text of the indented paragraphs themselves after the itemize}.@refill @findex item -Before each paragraph for which a mark in the margin is desired, write a -line that says just @code{@@item}. It is ok to have text following the -@code{@@item}. +At the beginning of each paragraph for which a mark in the margin is +desired, write a line that starts with @code{@@item}. It is ok to +have text following the @code{@@item}. Usually, you should put a blank line before an @code{@@item}. This puts a blank line in the Info file. (@TeX{} inserts the proper @@ -8268,10 +8634,10 @@ list with the number @samp{1}. With a numeric argument, such as or lower case letter, such as @samp{a} or @samp{A}, the command starts the list with that letter. -Write the text of the enumerated list in the same way you write an -itemized list: put @code{@@item} on a line of its own before the start -of each paragraph that you want enumerated. Do not write any other text -on the line beginning with @code{@@item}. +Write the text of the enumerated list in the same way as an itemized +list: write a line starting with @code{@@item} at the beginning of +each paragraph that you want enumerated. It is ok to have text +following the @code{@@item}. You should put a blank line between entries in the list. This generally makes it easier to read the Info file. @@ -8367,7 +8733,7 @@ a letter, beginning with that lower case letter.@refill You can also nest enumerated lists, as in an outline.@refill -@node Two-column Tables, Multi-column Tables, enumerate, Lists and Tables +@node Two-column Tables @section Making a Two-column Table @cindex Tables, making two-column @findex table @@ -8384,35 +8750,35 @@ exhibits, and command-line option summaries. * itemx:: How to put more entries in the first column. @end menu -@node table, ftable vtable, Two-column Tables, Two-column Tables -@ifinfo -@subheading Using the @code{@@table} Command +@node table +@subsection Using the @code{@@table} Command -Use the @code{@@table} command to produce two-column tables.@refill -@end ifinfo +@cindex Definition lists, typesetting +Use the @code{@@table} command to produce two-column tables. It is +usually listed for ``definition lists'' of various sorts, where you +have a list of terms and a brief text with each one. -Write the @code{@@table} command at the beginning of a line and follow -it on the same line with an argument that is a Texinfo ``indicating'' -command such as @code{@@code}, @code{@@samp}, @code{@@var}, or -@code{@@kbd} (@pxref{Indicating}). Although these commands are usually -followed by arguments in braces, in this case you use the command name -without an argument because @code{@@item} will supply the argument. -This command will be applied to the text that goes into the first column -of each item and determines how it will be highlighted. For example, -@code{@@code} will cause the text in the first column to be highlighted -with an @code{@@code} command. (We recommend @code{@@code} for -@code{@@table}'s of command-line options.) +Write the @code{@@table} command at the beginning of a line, after a +blank line, and follow it on the same line with an argument that is a +Texinfo ``indicating'' command such as @code{@@code}, @code{@@samp}, +@code{@@var}, @code{@@option}, or @code{@@kbd} (@pxref{Indicating}). + +This command will be applied to the text that goes into the first +column of each item and thus determines how it will be highlighted. +For example, @code{@@table @@code} will cause the text in the first +column to be output as if it @code{@@code} command. @findex asis -You may also choose to use the @code{@@asis} command as an argument to +You may also use the @code{@@asis} command as an argument to @code{@@table}. @code{@@asis} is a command that does nothing; if you -use this command after @code{@@table}, @TeX{} and the Info formatting -commands output the first column entries without added highlighting -(``as is'').@refill +use this command after @code{@@table}, the first column entries are +output without added highlighting (``as is''). -(The @code{@@table} command may work with other commands besides those -listed here. However, you can only use commands that normally take -arguments in braces.)@refill +The @code{@@table} command works with other commands besides those +explicitly mentioned here. However, you can only use commands that +normally take arguments in braces. (In this case, however, you use +the command name without an argument, because the subsequent +@code{@@item}'s will supply the argument.) @findex item Begin each table entry with an @code{@@item} command at the beginning @@ -8421,16 +8787,20 @@ of a line. Write the first column text on the same line as the following the @code{@@item} line and on subsequent lines. (You do not need to type anything for an empty second column entry.) You may write as many lines of supporting text as you wish, even several -paragraphs. But only text on the same line as the @code{@@item} will -be placed in the first column, including any footnote. +paragraphs. But only the text on the same line as the @code{@@item} +will be placed in the first column (including any footnotes). Normally, you should put a blank line before an @code{@@item} line. -This puts a blank like in the Info file. Except when the entries are -very brief, a blank line looks better.@refill +This puts a blank line in the Info file. Except when the entries are +very brief, a blank line looks better. + +End the table with a line consisting of @code{@@end table}, followed +by a blank line. @TeX{} will always start a new paragraph after the +table, so the blank line is needed for the Info output to be analogous. @need 1500 The following table, for example, highlights the text in the first -column with an @code{@@samp} command:@refill +column with an @code{@@samp} command: @example @group @@ -8457,8 +8827,7 @@ Text for @samp{bar}. @end table If you want to list two or more named items with a single block of -text, use the @code{@@itemx} command. (@xref{itemx, , -@code{@@itemx}}.)@refill +text, use the @code{@@itemx} command. (@xref{itemx,,@code{@@itemx}}.) @node ftable vtable @@ -8494,10 +8863,16 @@ See the example for @code{@@table} in the previous section. Use the @code{@@itemx} command inside a table when you have two or more first column entries for the same item, each of which should appear on a -line of its own. Use @code{@@itemx} for all but the first entry; -@code{@@itemx} should always follow an @code{@@item} command. The -@code{@@itemx} command works exactly like @code{@@item} except that it -does not generate extra vertical space above the first column text. +line of its own. + +Use @code{@@item} for the first entry, and @code{@@itemx} for all +subsequent entries; @code{@@itemx} must always follow an @code{@@item} +command, with no blank line intervening. + +The @code{@@itemx} command works exactly like @code{@@item} except +that it does not generate extra vertical space above the first column +text. If you have multiple consecutive @code{@@itemx} commands, do +not insert any blank lines between them. For example, @@ -8529,8 +8904,8 @@ case) character or string.@refill a two-column table.)@refill -@node Multi-column Tables, , Two-column Tables, Lists and Tables -@section Multi-column Tables +@node Multi-column Tables +@section @code{@@multitable}: Multi-column Tables @cindex Tables, making multi-column @findex multitable @@ -8564,15 +8939,15 @@ entirely on the same line as the @code{@@multitable} command. @cindex Line length, column widths as fraction of To specify column widths as fractions of the line length, write @code{@@columnfractions} and the decimal numbers (presumably less than -1) after the @code{@@multitable} command, as in: +1; a leading zero is allowed and ignored) after the +@code{@@multitable} command, as in: @example @@multitable @@columnfractions .33 .33 .33 @end example -@noindent The fractions need not add up exactly to 1.0, as these do -not. This allows you to produce tables that do not need the full line -length. You can use a leading zero if you wish. +The fractions need not add up exactly to 1.0, as these do not. This +allows you to produce tables that do not need the full line length. @item @cindex Prototype row, column widths defined by @@ -8596,7 +8971,7 @@ particularly likely to be useful. @end enumerate -@node Multitable Rows, , Multitable Column Widths, Multi-column Tables +@node Multitable Rows @subsection Multitable Rows @cindex Multitable rows @cindex Rows, of a multitable @@ -8609,13 +8984,20 @@ with @code{@@item}, and separate the column entries with @code{@@tab}. Line breaks are not special within the table body, and you may break input lines in your source file as necessary. +@findex headitem +@cindex Heading row, in table +@cindex <thead> HTML tag +You can also use @code{@@headitem} instead of @code{@@item} to produce +a @dfn{heading row}. The @TeX{} output for such a row is in bold, and +the HTML, XML, and Docbook output uses the @code{<thead>} tag. + Here is a complete example of a multi-column table (the text is from @cite{The GNU Emacs Manual}, @pxref{Split Window,, Splitting Windows, emacs, The GNU Emacs Manual}): @example @@multitable @@columnfractions .15 .45 .4 -@@item Key @@tab Command @@tab Description +@@headitem Key @@tab Command @@tab Description @@item C-x 2 @@tab @@code@{split-window-vertically@} @@tab Split the selected window into two windows, @@ -8634,7 +9016,7 @@ split that window. @noindent produces: @multitable @columnfractions .15 .45 .4 -@item Key @tab Command @tab Description +@headitem Key @tab Command @tab Description @item C-x 2 @tab @code{split-window-vertically} @tab Split the selected window into two windows, @@ -8650,8 +9032,561 @@ split that window. @end multitable -@node Indices, Insertions, Lists and Tables, Top -@comment node-name, next, previous, up +@node Special Displays +@chapter Special Displays +@cindex Special displays + +The commands in this chapter allow you to write text that is specially +displayed (output format permitting), outside of the normal document +flow. + +One set of such commands is for creating ``floats'', that is, figures, +tables, and the like, set off from the main text, possibly numbered, +captioned, and/or referred to from elsewhere in the document. Images +are often included in these displays. + +Another group of commands is for creating footnotes in Texinfo. + +@menu +* Floats:: Figures, tables, and the like. +* Images:: Including graphics and images. +* Footnotes:: Writing footnotes. +@end menu + + +@node Floats +@section Floats +@cindex Floats, in general + +A @dfn{float} is a display which is set off from the main text. It is +typically labelled as being a ``Figure'', ``Table'', ``Example'', or +some similar type. + +@cindex Floating, not yet implemented +A float is so-named because, in principle, it can be moved to the +bottom or top of the current page, or to a following page, in the +printed output. (Floating does not make sense in other output +formats.) In the present version of Texinfo, however, this floating +is unfortunately not yet implemented. Instead, the floating material +is simply output at the current location, more or less as if it were +an @code{@@group} (@pxref{group,,@code{@@group}}). + +@menu +* float:: Producing floating material. +* caption shortcaption:: Specifying descriptions for floats. +* listoffloats:: A table of contents for floats. +@end menu + + +@node float +@subsection @code{@@float} [@var{type}][,@var{label}]: Floating material +@findex float +@cindex Float environment + +To produce floating material, enclose the material you want to be +displayed separate between @code{@@float} and @code{@@end float} +commands, on lines by themselves. + +Floating material uses @code{@@image} to display an already-existing +graphic (@pxref{Images}), or @code{@@multitable} to display a table +(@pxref{Multi-column Tables}). However, the contents of the float can +be anything. Here's an example with simple text: + +@example +@@float Figure,fig:ex1 +This is an example float. +@@end float +@end example + +@noindent And the output: + +@float Figure,fig:ex1 +This is an example float. +@end float + +As shown in the example, @code{@@float} takes two arguments (separated +by a comma), @var{type} and @var{label}. Both are optional. + +@table @var +@item type +Specifies the sort of float this is; typically a word such as +``Figure'', ``Table'', etc. If not given, and @var{label} is, any +cross-referencing will simply use a bare number. + +@item label +Specifies a cross-reference label for this float. If given, this +float is automatically given a number, and will appear in any +@code{@@listofloats} output (@pxref{listoffloats}). Cross-references +to @var{label} are allowed. + +@cindex Floats, making unnumbered +@cindex Unnumbered float, creating +On the other hand, if @var{label} is not given, then the float will +not be numbered and consequently will not appear in the +@code{@@listoffloats} output or be cross-referenceable. +@end table + +@noindent Normally, you specify both @var{type} and @var{label}, to get a +labeled and numbered float. + +@cindex Floats, numbering of +@cindex Numbering of floats +In Texinfo, all floats are numbered the same way: with the chapter +number (or appendix letter), a period, and the float number, which +simply counts 1, 2, 3, @dots{}, and is reset at each chapter. Each +float type is counted independently. + +Floats within an @code{@@unnumbered} are numbered, or outside of any +chapter, are simply numbered consecutively from 1. + +These numbering conventions are not, at present, changeable. + + +@node caption shortcaption +@subsection @code{@@caption} & @code{@@shortcaption} +@findex caption +@findex shortcaption +@cindex Captions, for floats +@cindex Short captions, for lists of floats + +You may write an @code{@@caption} anywhere within a @code{@@float} +environment, to define a caption for the float. It is not allowed in +any other context. @code{@@caption} takes a single argument, enclosed +in braces. Here's an example: + +@example +@@float +An example float, with caption. +@@caption@{Caption for example float.@} +@@end float +@end example + +@noindent The output is: + +@float +An example float, with caption. +@caption{Caption for example float.} +@end float + +@code{@@caption} can appear anywhere within the float; it is not +processed until the @code{@@end float}. The caption text is usually a +sentence or two, but may consist of several paragraphs if necessary. + +In the output, the caption always appears below the float; this is not +currently changeable. It is preceded by the float type and/or number, +as specified to the @code{@@float} command (see the previous section). + +The @code{@@shortcaption} command likewise may be used only within +@code{@@float}, and takes a single argument in braces. The short +caption text is used instead of the caption text in a list of floats +(see the next section). Thus, you can write a long caption for the +main document, and a short title to appear in the list of floats. For +example: + +@example +@@float +... as above ... +@@shortcaption@{Text for list of floats.@} +@@end float +@end example + +The text for @code{@@caption} and @code{@@shortcaption} may not +contain comments (@code{@@c}), verbatim text (@code{@@verb}), +environments such as @code{@@example}, or other complex constructs. + + +@node listoffloats +@subsection @code{@@listoffloats}: Tables of contents for floats +@findex listoffloats +@cindex List of floats +@cindex Floats, list of +@cindex Table of contents, for floats + +You can write a @code{@@listoffloats} command to generate a list of +floats for a given float type (@pxref{float}), analogous to the +document's overall table of contents. Typically, it is written in its +own @code{@@unnumbered} node to provide a heading and structure, +rather like @code{@@printindex} (@pxref{Printing Indices & Menus}). + +@code{@@listoffloats} takes one optional argument, the float type. +Here's an example: + +@example +@@node List of Figures +@@unnumbered List of Figures +@@listoffloats Figure +@end example + +@noindent And the output from @code{@@listoffloats}: + +@display +@listoffloats Figure +@end display + +Without any argument, @code{@@listoffloats} generates a list of +floats for which no float type was specified, i.e., no first argument +to the @code{@@float} command (@pxref{float}). + +Each line in the list of floats contains the float type (if any), +the float number, and the caption, if any---the @code{@@shortcaption} +argument, if it was specified, else the @code{@@caption} argument. +In Info, the result is a menu where each float can be selected. In +HTML, each line is a link to the float. In printed output, the page +number is included. + +Unnumbered floats (those without cross-reference labels) are omitted +from the list of floats. + + +@node Images +@section Inserting Images + +@cindex Images, inserting +@cindex Pictures, inserting +@findex image + +You can insert an image given in an external file with the +@code{@@image} command. Although images can be used anywhere, +including the middle of a paragraph, we describe them in this chapter +since they are most often part of a displayed figure or example. + +@menu +* Image Syntax:: +* Image Scaling:: +@end menu + + +@node Image Syntax +@subsection Image Syntax + +Here is the basic synopsis of the @code{@@image} command: + +@example +@@image@{@var{filename}@r{[,} @var{width}@r{[,} @var{height}@r{[,} @var{alttext}@r{[, }@var{extension}@r{]]]]}@} +@end example + +@cindex Formats for images +@cindex Image formats +The @var{filename} argument is mandatory, and must not have an +extension, because the different processors support different formats: + +@itemize @bullet +@item +@TeX{} reads the file @file{@var{filename}.eps} (Encapsulated PostScript +format). +@item +@pindex pdftex@r{, and images} +PDF@TeX{} reads @file{@var{filename}.pdf} (Adobe's Portable Document Format). +@item +@code{makeinfo} includes @file{@var{filename}.txt} verbatim for +Info output (more or less as if it was an @code{@@example}). +@item +@code{makeinfo} uses the optional fifth argument @var{extension} to +@code{@@image} for the filename extension, if it is specified. For example: + +@pindex XPM image format +@example +@@image@{foo,,,,.xpm@} +@end example + +@noindent +will cause @code{makeinfo} to look for @file{foo.xpm} before any others. + +@end itemize + +The @var{width} and @var{height} arguments are described in the next +section. + +For @TeX{} output, if an image is the first thing in a paragraph, for +example if you want two images side-by-side, you must precede it with +@code{@@noindent} (@pxref{noindent,,@code{@@noindent}}). Otherwise it +will be displayed on a line by itself. If you want it centered, +use @code{@@center} (@pxref{titlefont center sp,,@code{@@titlefont +@@center @@sp}}). + +@cindex Alt attribute for images +@cindex Images, alternate text for +When producing html, @code{makeinfo} sets the @dfn{alt attribute} for +inline images to the optional @var{alttext} (fourth) argument to +@code{@@image}, if supplied. If not supplied, @code{makeinfo} uses +the full file name of the image being displayed. If you want an empty +@code{alt} string, use @code{@@-}. The @var{alttext} is taken as +Texinfo text, so special characters such as @samp{"} and @samp{<} and +@samp{&} are escaped in the HTML and XML output. + +@cindex GIF images, unsupported due to patents +@cindex PNG image format +@cindex JPG image format +If you do not supply the optional @var{extension} (fifth) argument, +@code{makeinfo} first tries @file{@var{filename}.png}; if that does +not exist, it tries @file{@var{filename}.jpg}. If that does not exist +either, it complains. (We cannot support GIF format directly due to +software patents.) + +In Info output, @code{makeinfo} writes a reference to the binary image +file (trying @var{filename} suffixed with @file{@var{extension}}, +@file{@var{.extension}}, @file{.png}, or @file{.jpg}, in that order) +if one exists. It also literally includes the @file{.txt} file if one +exists. This way, Info readers which can display images (such as the +Emacs Info browser, running under X) can do so, whereas Info readers +which can only use text (such as the standalone Info reader) can +display the textual version. + +The implementation of this is to put the following construct into the +Info output: + +@example +^@@^H[image src="@var{binaryfile}" text="@var{txtfile}" + alt="@var{alttext} ... ^@@^H] +@end example + +@noindent where @samp{^@@} and @samp{^H} stand for the actual null and +backspace control characters. If one of the files is not present, the +corresponding argument is omitted. + +The reason for mentioning this here is that older Info browsers (this +feature was introduced in Texinfo version 4.6) will display the above +literally, which, although not pretty, should not be harmful. + + +@node Image Scaling +@subsection Image Scaling + +@cindex Images, scaling +@cindex Scaling images +@cindex Width of images +@cindex Height of images +@cindex Aspect ratio of images +@cindex Distorting images +The optional @var{width} and @var{height} arguments to the +@code{@@image} command (see the previous section) specify the size to +scale the image to. They are ignored for Info output. If neither is +specified, the image is presented in its natural size (given in the +file); if only one is specified, the other is scaled proportionately; +and if both are specified, both are respected, thus possibly distorting +the original image by changing its aspect ratio. + +@cindex Dimensions and image sizes +The @var{width} and @var{height} may be specified using any valid @TeX{} +dimension, namely: + +@table @asis +@item pt +@cindex Points (dimension) +point (72.27pt = 1in) +@item pc +@cindex Picas +pica (1pc = 12pt) +@item bp +@cindex Big points +big point (72bp = 1in) +@item in +@cindex Inches +inch +@item cm +@cindex Centimeters +centimeter (2.54cm = 1in) +@item mm +@cindex Millimeters +millimeter (10mm = 1cm) +@item dd +@cindex Did@^ot points +did@^ot point (1157dd = 1238pt) +@item cc +@cindex Ciceros +cicero (1cc = 12dd) +@item sp +@cindex Scaled points +scaled point (65536sp = 1pt) +@end table + +@pindex ridt.eps +For example, the following will scale a file @file{ridt.eps} to one +inch vertically, with the width scaled proportionately: + +@example +@@image@{ridt,,1in@} +@end example + +@pindex epsf.tex +For @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be +installed somewhere that @TeX{} can find it. (The standard location is +@file{@var{texmf}/tex/generic/dvips/epsf.tex}, where @var{texmf} is a +root of your @TeX{} directory tree.) This file is included in the +Texinfo distribution and is also available from +@uref{ftp://tug.org/tex/epsf.tex}, among other places. + +@code{@@image} can be used within a line as well as for displayed +figures. Therefore, if you intend it to be displayed, be sure to leave +a blank line before the command, or the output will run into the +preceding text. + +Image scaling is presently implemented only in @TeX{}, not in HTML or +any other sort of output. + + +@node Footnotes +@section Footnotes +@cindex Footnotes +@findex footnote + +A @dfn{footnote} is for a reference that documents or elucidates the +primary text.@footnote{A footnote should complement or expand upon +the primary text, but a reader should not need to read a footnote to +understand the primary text. For a thorough discussion of footnotes, +see @cite{The Chicago Manual of Style}, which is published by the +University of Chicago Press.} Footnotes are distracting; use them +sparingly, if at all. Standard bibliographical references are better +placed in a bibliography at the end of a document than in footnotes +throughout. + +@menu +* Footnote Commands:: How to write a footnote in Texinfo. +* Footnote Styles:: Controlling how footnotes appear in Info. +@end menu + + +@node Footnote Commands +@subsection Footnote Commands + +In Texinfo, footnotes are created with the @code{@@footnote} command. +This command is followed immediately by a left brace, then by the text +of the footnote, and then by a terminating right brace. Footnotes may +be of any length (they will be broken across pages if necessary), but +are usually short. The template is: + +@example +ordinary text@@footnote@{@var{text of footnote}@} +@end example + +As shown here, the @code{@@footnote} command should come right after the +text being footnoted, with no intervening space; otherwise, the footnote +marker might end up starting a line. + +For example, this clause is followed by a sample footnote@footnote{Here +is the sample footnote.}; in the Texinfo source, it looks like +this: + +@example +@dots{}a sample footnote@@footnote@{Here is the sample +footnote.@}; in the Texinfo source@dots{} +@end example + +As you can see, the source includes two punctuation marks next to each +other; in this case, @samp{.@};} is the sequence. This is normal (the +first ends the footnote and the second belongs to the sentence being +footnoted), so don't worry that it looks odd. + +In a printed manual or book, the reference mark for a footnote is a +small, superscripted number; the text of the footnote appears at the +bottom of the page, below a horizontal line. + +In Info, the reference mark for a footnote is a pair of parentheses +with the footnote number between them, like this: @samp{(1)}. The +reference mark is followed by a cross-reference link to the footnote's +text. + +In the HTML output, footnote references are marked with a small, +superscripted number which is rendered as a hypertext link to the +footnote text. + +By the way, footnotes in the argument of an @code{@@item} command for a +@code{@@table} must be on the same line as the @code{@@item} +(as usual). @xref{Two-column Tables}. + + +@node Footnote Styles +@subsection Footnote Styles + +Info has two footnote styles, which determine where the text of the +footnote is located: + +@itemize @bullet +@cindex @samp{@r{End}} node footnote style +@item +In the `End' node style, all the footnotes for a single node +are placed at the end of that node. The footnotes are separated from +the rest of the node by a line of dashes with the word +@samp{Footnotes} within it. Each footnote begins with an +@samp{(@var{n})} reference mark. + +@need 700 +@noindent +Here is an example of a single footnote in the end of node style:@refill + +@example +@group +--------- Footnotes --------- + +(1) Here is a sample footnote. +@end group +@end example + +@cindex @samp{@r{Separate}} footnote style +@item +In the `Separate' node style, all the footnotes for a single +node are placed in an automatically constructed node of +their own. In this style, a ``footnote reference'' follows +each @samp{(@var{n})} reference mark in the body of the +node. The footnote reference is actually a cross reference +which you use to reach the footnote node. + +The name of the node with the footnotes is constructed +by appending @w{@samp{-Footnotes}} to the name of the node +that contains the footnotes. (Consequently, the footnotes' +node for the @file{Footnotes} node is +@w{@file{Footnotes-Footnotes}}!) The footnotes' node has an +`Up' node pointer that leads back to its parent node. + +@noindent +Here is how the first footnote in this manual looks after being +formatted for Info in the separate node style: + +@smallexample +@group +File: texinfo.info Node: Overview-Footnotes, Up: Overview + +(1) The first syllable of "Texinfo" is pronounced like "speck", not +"hex". @dots{} +@end group +@end smallexample +@end itemize + +Unless your document has long and important footnotes (as in, say, +Gibbon's @cite{Decline and Fall @dots{}}), we recommend the @samp{end} +style, as it is simpler for readers to follow. + +@findex footnotestyle +Use the @code{@@footnotestyle} command to specify an Info file's +footnote style. Write this command at the beginning of a line followed +by an argument, either @samp{end} for the end node style or +@samp{separate} for the separate node style. + +@need 700 +For example, + +@example +@@footnotestyle end +@end example +@noindent +or +@example +@@footnotestyle separate +@end example + +Write an @code{@@footnotestyle} command before or shortly after the +end-of-header line at the beginning of a Texinfo file. (If you +include the @code{@@footnotestyle} command between the start-of-header +and end-of-header lines, the region formatting commands will format +footnotes as specified.)@refill + +If you do not specify a footnote style, the formatting commands use +their default style. Currently, @code{texinfo-format-buffer} and +@code{texinfo-format-region} use the `separate' style and +@code{makeinfo} uses the `end' style. + + +@node Indices @chapter Indices @cindex Indices @@ -8660,24 +9595,27 @@ collate entries manually. In an index, the entries are listed in alphabetical order, together with information on how to find the discussion of each entry. In a printed manual, this information consists of page numbers. In an Info file, this information is a menu -entry leading to the first node referenced.@refill +entry leading to the first node referenced. Texinfo provides several predefined kinds of index: an index for functions, an index for variables, an index for concepts, and so on. You can combine indices or use them for other than their -canonical purpose. If you wish, you can define your own indices.@refill +canonical purpose. Lastly, you can define your own new indices. + +@xref{Printing Indices & Menus}, for information on how to print +indices. @menu * Index Entries:: Choose different words for index entries. * Predefined Indices:: Use different indices for different kinds - of entry. + of entries. * Indexing Commands:: How to make an index entry. * Combining Indices:: How to combine indices. * New Indices:: How to define your own indices. @end menu -@node Index Entries, Predefined Indices, Indices, Indices -@comment node-name, next, previous, up + +@node Index Entries @section Making Index Entries @cindex Index entries, making @cindex Entries, making index @@ -8701,45 +9639,65 @@ need to do it yourself.@refill @xref{Printing Indices & Menus}, for information about printing an index at the end of a book or creating an index menu in an Info file.@refill -@node Predefined Indices, Indexing Commands, Index Entries, Indices -@comment node-name, next, previous, up + +@node Predefined Indices @section Predefined Indices -Texinfo provides six predefined indices:@refill +Texinfo provides six predefined indices. Here are their nominal +meanings, abbreviations, and the corresponding index entry commands: -@itemize @bullet -@item -A @dfn{concept index} listing concepts that are discussed.@refill - -@item -A @dfn{function index} listing functions (such as entry points of -libraries).@refill +@table @samp +@item cp +@cindex @code{cp} (concept) index +(@code{@@cindex}) concept index, for general concepts. +@item fn +@cindex @code{fn} (function) index +(@code{@@findex}) function index, for function and function-like +names (such as entry points of libraries). +@item ky +@cindex @code{ky} (keystroke) index +(@code{@@kindex}) keystroke index, for keyboard commands. +@item pg +@cindex @code{pg} (program) index +(@code{@@pindex}) program index, for names of programs. +@item tp +@cindex @code{tp} (data type) index +(@code{@@tindex}) data type index, for type names (such as structures +defined in header files). +@item vr +@cindex @code{vr} (variable) index +(@code{@@vindex}) variable index, for variable names (such as global +variables of libraries). +@end table -@item -A @dfn{variables index} listing variables (such as global variables -of libraries).@refill +@noindent +Not every manual needs all of these, and most manuals use only two or +three at most. The present manual, for example, has two indices: a +concept index and an @@-command index (that is actually the function +index but is called a command index in the chapter heading). -@item -A @dfn{keystroke index} listing keyboard commands.@refill +You are not required to use the predefined indices strictly for their +canonical purposes. For example, suppose you wish to index some C +preprocessor macros. You could put them in the function index along +with actual functions, just by writing @code{@@findex} commands for +them; then, when you print the ``Function Index'' as an unnumbered +chapter, you could give it the title `Function and Macro Index' and +all will be consistent for the reader. -@item -A @dfn{program index} listing names of programs.@refill +On the other hand, it is best not to stray too far from the meaning of +the predefined indices. Otherwise, in the event that your text is +combined with other text from other manuals, the index entries will +not match up. Instead, define your own new index (@pxref{New +Indices}). -@item -A @dfn{data type index} listing data types (such as structures defined in -header files).@refill -@end itemize +We recommend having a single index in the final document whenever +possible, however many source indices you use, since then readers have +only one place to look. Two or more source indices can be combined +into one output index using the @code{@@synindex} or +@code{@@syncodeindex} commands (@pxref{Combining Indices}). -@noindent -Not every manual needs all of these, and most manuals use two or three -of them. This manual has two indices: a -concept index and an @@-command index (that is actually the function -index but is called a command index in the chapter heading). Two or -more indices can be combined into one using the @code{@@synindex} or -@code{@@syncodeindex} commands. @xref{Combining Indices}.@refill -@node Indexing Commands, Combining Indices, Predefined Indices, Indices -@comment node-name, next, previous, up +@node Indexing Commands @section Defining the Entries of an Index @cindex Defining indexing entries @cindex Index entries @@ -8760,7 +9718,7 @@ the concept index:@refill @example @@cindex Defining indexing entries -@@cindex Index entries +@@cindex Index entries, defining @@cindex Entries for an index @@cindex Specifying index entries @@cindex Creating index entries @@ -8768,7 +9726,7 @@ the concept index:@refill Each predefined index has its own indexing command---@code{@@cindex} for the concept index, @code{@@findex} for the function index, and so -on.@refill +on, as listed in the previous section. @cindex Writing index entries @cindex Index entry writing @@ -8793,90 +9751,49 @@ Entries in indices other than the concept index are symbol names in programming languages, or program names; these names are usually case-sensitive, so use upper and lower case as required for them. +@cindex Index font types By default, entries for a concept index are printed in a small roman font and entries for the other indices are printed in a small @code{@@code} font. You may change the way part of an entry is printed with the usual Texinfo commands, such as @code{@@file} for -file names and @code{@@emph} for emphasis (@pxref{Marking -Text}).@refill -@cindex Index font types - -@cindex Predefined indexing commands -@cindex Indexing commands, predefined -The six indexing commands for predefined indices are: - -@table @code -@item @@cindex @var{concept} -@findex cindex -Make an entry in the concept index for @var{concept}.@refill - -@item @@findex @var{function} -@findex findex -Make an entry in the function index for @var{function}.@refill - -@item @@vindex @var{variable} -@findex vindex -Make an entry in the variable index for @var{variable}.@refill - -@item @@kindex @var{keystroke} -@findex kindex -Make an entry in the key index for @var{keystroke}.@refill - -@item @@pindex @var{program} -@findex pindex -Make an entry in the program index for @var{program}.@refill - -@item @@tindex @var{data type} -@findex tindex -Make an entry in the data type index for @var{data type}.@refill -@end table - -@quotation -@strong{Caution:} Do not use a colon in an index entry. In Info, a -colon separates the menu entry name from the node name, so a colon in -the entry itself confuses Info. @xref{Menu Parts, , The Parts of a -Menu}, for more information about the structure of a menu entry. +file names (@pxref{Marking Text}), and @code{@@r} for the normal roman +font (@pxref{Fonts}). + +@quotation Caution +Do not use a colon in an index entry. In Info, a colon separates the +menu entry name from the node name, so a colon in the entry itself +confuses Info. @xref{Menu Parts}, for more information about the +structure of a menu entry. @end quotation -You are not actually required to use the predefined indices for their -canonical purposes. For example, suppose you wish to index some C -preprocessor macros. You could put them in the function index along -with actual functions, just by writing @code{@@findex} commands for -them; then, when you print the ``Function Index'' as an unnumbered -chapter, you could give it the title `Function and Macro Index' and -all will be consistent for the reader. Or you could put the macros in -with the data types by writing @code{@@tindex} commands for them, and -give that index a suitable title so the reader will understand. -(@xref{Printing Indices & Menus}.)@refill -@node Combining Indices, New Indices, Indexing Commands, Indices -@comment node-name, next, previous, up +@node Combining Indices @section Combining Indices @cindex Combining indices @cindex Indices, combining them -Sometimes you will want to combine two disparate indices such as functions -and concepts, perhaps because you have few enough of one of them that -a separate index for them would look silly.@refill +Sometimes you will want to combine two disparate indices such as +functions and concepts, perhaps because you have few enough entries +that a separate index would look silly. You could put functions into the concept index by writing @code{@@cindex} commands for them instead of @code{@@findex} commands, and produce a consistent manual by printing the concept index with the title `Function and Concept Index' and not printing the `Function Index' at all; but this is not a robust procedure. It works only if -your document is never included as part of another -document that is designed to have a separate function index; if your -document were to be included with such a document, the functions from -your document and those from the other would not end up together. -Also, to make your function names appear in the right font in the -concept index, you would need to enclose every one of them between -the braces of @code{@@code}.@refill +your document is never included as part of another document that is +designed to have a separate function index; if your document were to +be included with such a document, the functions from your document and +those from the other would not end up together. Also, to make your +function names appear in the right font in the concept index, you +would need to enclose every one of them between the braces of +@code{@@code}. @menu * syncodeindex:: How to merge two indices, using @code{@@code} - font for the merged-from index. + font for the merged-from index. * synindex:: How to merge two indices, using the - default font of the merged-to index. + default font of the merged-to index. @end menu @node syncodeindex @@ -8887,7 +9804,6 @@ When you want to combine functions and concepts into one index, you should index the functions with @code{@@findex} and index the concepts with @code{@@cindex}, and use the @code{@@syncodeindex} command to redirect the function index entries into the concept index.@refill -@findex syncodeindex The @code{@@syncodeindex} command takes two arguments; they are the name of the index to redirect, and the name of the index to redirect it to. @@ -8949,7 +9865,7 @@ now directed. This way, if you direct function names from a function index into a concept index, all the function names are printed in the @code{@@code} font as you would expect.@refill -@node synindex, , syncodeindex, Combining Indices +@node synindex @subsection @code{@@synindex} @findex synindex @@ -8962,7 +9878,8 @@ merge a concept index into a function index.@refill @xref{Printing Indices & Menus}, for information about printing an index at the end of a book or creating an index menu in an Info file.@refill -@node New Indices, , Combining Indices, Indices + +@node New Indices @section Defining New Indices @cindex Defining new indices @cindex Indices, defining new @@ -8973,15 +9890,15 @@ at the end of a book or creating an index menu in an Info file.@refill In addition to the predefined indices, you may use the @code{@@defindex} and @code{@@defcodeindex} commands to define new indices. These commands create new indexing @@-commands with which -you mark index entries. The @code{@@defindex }command is used like -this:@refill +you mark index entries. The @code{@@defindex} command is used like +this: @example @@defindex @var{name} @end example The name of an index should be a two letter word, such as @samp{au}. -For example:@refill +For example: @example @@defindex au @@ -8989,11 +9906,11 @@ For example:@refill This defines a new index, called the @samp{au} index. At the same time, it creates a new indexing command, @code{@@auindex}, that you -can use to make index entries. Use the new indexing command just as -you would use a predefined indexing command.@refill +can use to make index entries. Use this new indexing command just as +you would use a predefined indexing command. For example, here is a section heading followed by a concept index -entry and two @samp{au} index entries.@refill +entry and two @samp{au} index entries. @example @@section Cognitive Semantics @@ -9004,29 +9921,30 @@ entry and two @samp{au} index entries.@refill @noindent (Evidently, @samp{au} serves here as an abbreviation for ``author''.) -Texinfo constructs the new indexing command by concatenating the name -of the index with @samp{index}; thus, defining an @samp{au} index -leads to the automatic creation of an @code{@@auindex} command.@refill + +In general, Texinfo constructs the new indexing command by +concatenating the name of the index with @samp{index}; thus, defining +an @samp{xy} index leads to the automatic creation of an +@code{@@xyindex} command. Use the @code{@@printindex} command to print the index, as you do with -the predefined indices. For example:@refill +the predefined indices. For example: @example @group -@@node Author Index, Subject Index, , Top +@@node Author Index @@unnumbered Author Index @@printindex au @end group @end example -The @code{@@defcodeindex} is like the @code{@@defindex} command, except -that, in the printed output, it prints entries in an @code{@@code} font -instead of a roman font. Thus, it parallels the @code{@@findex} command -rather than the @code{@@cindex} command.@refill +The @code{@@defcodeindex} is like the @code{@@defindex} command, +except that, in the printed output, it prints entries in an +@code{@@code} font by default instead of a roman font. -You should define new indices within or right after the end-of-header -line of a Texinfo file, before any @code{@@synindex} or +You should define new indices before the end-of-header line of a +Texinfo file, and (of course) before any @code{@@synindex} or @code{@@syncodeindex} commands (@pxref{Texinfo File Header}). @@ -9043,7 +9961,7 @@ elements that do not correspond to simple characters you can type. These are: @itemize @bullet -@item Braces and @samp{@@}. +@item @samp{@@} and braces and commas. @item Whitespace within and around a sentence. @item Accents. @item Dots and bullets. @@ -9058,28 +9976,25 @@ These are: @end iftex @menu -* Braces Atsigns:: How to insert braces, @samp{@@}. +* Atsign Braces Comma:: Inserting @@ and @{@} and ,. * Inserting Space:: How to insert the right amount of space - within a sentence. + within a sentence. * Inserting Accents:: How to insert accents and special characters. * Dots Bullets:: How to insert dots and bullets. * TeX and copyright:: How to insert the @TeX{} logo - and the copyright symbol. + and the copyright symbol. +* euro:: How to insert the Euro currency symbol. * pounds:: How to insert the pounds currency symbol. * minus:: How to insert a minus sign. * math:: How to format a mathematical expression. * Glyphs:: How to indicate results of evaluation, - expansion of macros, errors, etc. -* Footnotes:: How to include footnotes. -* Images:: How to include graphics. + expansion of macros, errors, etc. @end menu -@node Braces Atsigns, Inserting Space, Insertions, Insertions -@section Inserting @@ and Braces -@cindex Inserting @@, braces -@cindex Braces, inserting -@cindex Special characters, commands to insert +@node Atsign Braces Comma +@section Inserting @@ and @{@} and @comma{} +@cindex Special characters, inserting @cindex Commands to insert special characters @samp{@@} and curly braces are special characters in Texinfo. To insert @@ -9087,17 +10002,20 @@ these characters so they appear in text, you must put an @samp{@@} in front of these characters to prevent Texinfo from misinterpreting them. -Do not put braces after any of these commands; they are not -necessary. +The comma `,' is a special character only in one uncommon context: +it separates arguments to commands that take multiple arguments. @menu -* Inserting An Atsign:: How to insert @samp{@@}. -* Inserting Braces:: How to insert @samp{@{} and @samp{@}}. +* Inserting an Atsign:: +* Inserting Braces:: +* Inserting a Comma:: @end menu -@node Inserting An Atsign, Inserting Braces, Braces Atsigns, Braces Atsigns -@subsection Inserting @samp{@@} with @@@@ + +@node Inserting an Atsign +@subsection Inserting `@@' with @code{@@@@} @findex @@ @r{(literal @samp{@@})} +@cindex Inserting @@ @r{(literal @samp{@@})} @code{@@@@} stands for a single @samp{@@} in either printed or Info output. @@ -9106,7 +10024,8 @@ Do not put braces after an @code{@@@@} command. @node Inserting Braces -@subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@} +@subsection Inserting `@{' and `@}' with @code{@@@{} and @code{@@@}} +@cindex Braces, inserting @findex @{ @r{(literal @samp{@{})} @findex @} @r{(literal @samp{@}})} @@ -9117,7 +10036,35 @@ output. output. Do not put braces after either an @code{@@@{} or an @code{@@@}} -command. +command.ppp + + +@node Inserting a Comma +@subsection Inserting `,' with @code{@@comma@{@}} +@cindex Commas, inserting +@findex comma + +Ordinarily, a comma `,' is a normal character that can be simply typed +in your input where you need it. + +However, Texinfo uses the comma as a special character in one uncommon +context: some commands, such as @code{@@acronym} (@pxref{acronym}) and +@code{@@xref} (@pxref{Cross References}), as well as user-defined +macros (@pxref{Defining Macros}), can take more than one argument. In +these cases, the comma character is used to separate arguments. + +Since a comma chacter would confuse Texinfo's parsing for these +commands, you must use the command @samp{@comma{}} instead if you want +to have an actual comma in the output. Here are some examples: + +@example +@@acronym@{ABC, A Bizarre @@comma@{@}@} +@@xref@{Comma,, The @@comma@{@} symbol@} +@@mymac@{One argument@@comma@{@} containing a comma@} +@end example + +Although @comma{} can be used anywhere, there is no need for it +anywhere except in this unusual case. @node Inserting Space @@ -9152,7 +10099,7 @@ use the special commands; you just enter a period as you would if you were using a typewriter, which means you put two spaces after the period, question mark, or exclamation mark that ends a sentence. -@findex <colon> @r{(suppress widening)} +@findex <colon> @r{(suppress end-of-sentence space)} Use the @code{@@:}@: command after a period, question mark, exclamation mark, or colon that should not be followed by extra space. For example, use @code{@@:}@: after periods that end abbreviations @@ -9166,13 +10113,13 @@ The s.o.p. has three parts @dots{} @end example @noindent -@ifinfo +@ifnottex produces -@end ifinfo +@end ifnottex @iftex produces the following. If you look carefully at this printed output, -you will see a little more whitespace after @samp{s.o.p.} in the second -line.@refill +you will see a little extraneous space after @samp{s.o.p.} in the second +line. @end iftex @quotation @@ -9184,11 +10131,16 @@ The s.o.p. has three parts @dots{} (Incidentally, @samp{s.o.p.} is an abbreviation for ``Standard Operating Procedure''.) -@code{@@:} has no effect on the Info output. Do not put braces after -@code{@@:}. +@code{@@:} has no effect on the Info and HTML output. In Docbook and +XML, the previous punctuation character (.?!:) is output as an entity +instead of as the normal character: @samp{. ? ! +:}. This gives further processors a chance to notice and not +add the usual extra space. +Do not put braces after @code{@@:} (or any non-alphabetic command). -@node Ending a Sentence, Multiple Spaces, Not Ending a Sentence, Inserting Space + +@node Ending a Sentence @subsection Ending a Sentence @cindex Ending a Sentence @@ -9199,7 +10151,7 @@ Procedure''.) @findex ? @r{(end of sentence)} Use @code{@@.}@: instead of a period, @code{@@!}@: instead of an exclamation point, and @code{@@?}@: instead of a question mark at the end -of a sentence that ends with a single capital letter. Otherwise, @TeX{} +of a sentence that ends with a capital letter. Otherwise, @TeX{} will think the letter is an abbreviation and will not insert the correct end-of-sentence spacing. Here is an example: @@ -9209,9 +10161,9 @@ Give it to M.I.B. and to M.E.W. Also, give it to R.J.C. @end example @noindent -@ifinfo +@ifnottex produces -@end ifinfo +@end ifnottex @iftex produces the following. If you look carefully at this printed output, you will see a little more whitespace after the @samp{W} in the first @@ -9233,15 +10185,15 @@ emacs, The GNU Emacs Manual}). Do not put braces after any of these commands. -@node Multiple Spaces, dmn, Ending a Sentence, Inserting Space +@node Multiple Spaces @subsection Multiple Spaces @cindex Multiple spaces @cindex Whitespace, inserting @cindex Space, inserting horizontal -@findex (space) -@findex (tab) -@findex (newline) +@findex <space> +@findex <tab> +@findex <newline> Ordinarily, @TeX{} collapses multiple whitespace characters (space, tab, and newline) into a single space. Info output, on the other hand, @@ -9278,7 +10230,7 @@ Other possible uses of @code{@@@kbd{SPACE}} have been subsumed by Do not follow any of these commands with braces. -To produce a non-breakable space, see @ref{w, non-breakable space}. +To produce a non-breakable space, see @ref{tie, @code{@@tie}}. @node dmn @@ -9333,6 +10285,10 @@ braces around their argument (which is taken to be the next character). This is so as to make the source as convenient to type and read as possible, since accented characters are very common in some languages. +To get the true accented characters output in Info, and not just the +ASCII transliterations, you can use the @option{--enable-encoding} +option to @command{makeinfo} (@pxref{makeinfo options}). + @findex " @r{(umlaut accent)} @cindex Umlaut accent @findex ' @r{(umlaut accent)} @@ -9362,8 +10318,10 @@ possible, since accented characters are very common in some languages. @findex udotaccent @cindex Underdot accent @findex v @r{(check accent)} +@cindex Hacek accent @cindex Check accent -@multitable {@@questiondown@{@}} {Output} {macron/overbar accent} +@cindex Caron accent +@multitable {@@questiondown@{@}} {Output} {hacek/check/caron accent} @item Command @tab Output @tab What @item @t{@@"o} @tab @"o @tab umlaut accent @item @t{@@'o} @tab @'o @tab acute accent @@ -9379,7 +10337,7 @@ possible, since accented characters are very common in some languages. @item @t{@@u@{o@}} @tab @u{o} @tab breve accent @item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent @item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent -@item @t{@@v@{o@}} @tab @v{o} @tab hacek or check accent +@item @t{@@v@{o@}} @tab @v{o} @tab hacek/check/caron accent @end multitable This table lists the Texinfo commands for inserting other characters @@ -9398,8 +10356,8 @@ commonly used in languages other than English. @findex AE @cindex @AE{} @findex dotless -@cindex @dotless{i} -@cindex @dotless{j} +@cindex @dotless{i} (dotless i) +@cindex @dotless{j} (dotless j) @cindex Dotless i, j @findex l @cindex @l{} @@ -9413,21 +10371,30 @@ commonly used in languages other than English. @cindex @oe{} @findex OE @cindex @OE{} +@cindex Romance ordinals +@cindex Ordinals, Romance +@cindex Feminine ordinal +@findex ordf +@cindex @ordf{} +@cindex Masculine ordinal +@findex ordm +@cindex @ordm{} @findex ss @cindex @ss{} @cindex Es-zet @cindex Sharp S @cindex German S -@multitable {x@@questiondown@{@}} {oe,OE} {es-zet or sharp S} +@multitable {x@@questiondown@{@}} {oe OE} {es-zet or sharp S} @item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down ! @item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ? -@item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab a,A with circle -@item @t{@@ae@{@},@@AE@{@}} @tab @ae{},@AE{} @tab ae,AE ligatures +@item @t{@@aa@{@} @@AA@{@}} @tab @aa{} @AA{} @tab a,A with circle +@item @t{@@ae@{@} @@AE@{@}} @tab @ae{} @AE{} @tab ae,AE ligatures @item @t{@@dotless@{i@}} @tab @dotless{i} @tab dotless i @item @t{@@dotless@{j@}} @tab @dotless{j} @tab dotless j -@item @t{@@l@{@},@@L@{@}} @tab @l{},@L{} @tab suppressed-L,l -@item @t{@@o@{@},@@O@{@}} @tab @o{},@O{} @tab O,o with slash -@item @t{@@oe@{@},@@OE@{@}} @tab @oe{},@OE{} @tab oe,OE ligatures +@item @t{@@l@{@} @@L@{@}} @tab @l{} @L{} @tab suppressed-L,l +@item @t{@@o@{@} @@O@{@}} @tab @o{} @O{} @tab O,o with slash +@item @t{@@oe@{@} @@OE@{@}} @tab @oe{} @OE{} @tab oe,OE ligatures +@item @t{@@ordf@{@} @@ordm@{@}} @tab @ordf{} @ordm{} @tab Spanish ordinals @item @t{@@ss@{@}} @tab @ss{} @tab es-zet or sharp S @end multitable @@ -9465,13 +10432,14 @@ the braces, the formatters would be confused. @xref{Command Syntax, , @cindex Dots, inserting Use the @code{@@dots@{@}} command to generate an ellipsis, which is -three dots in a row, appropriately spaced, like this: `@dots{}'. Do +three dots in a row, appropriately spaced @dots{} like so. Do not simply write three periods in the input file; that would work for the Info file output, but would produce the wrong amount of space between the periods in the printed manual. Similarly, the @code{@@enddots@{@}} command generates an -end-of-sentence ellipsis (four dots) @enddots{} +end-of-sentence ellipsis, which has different spacing afterwards, +@enddots{} Look closely to see the difference. @iftex Here is an ellipsis: @dots{} @@ -9496,57 +10464,100 @@ type the braces, because @code{@@itemize} supplies them. (@xref{itemize, , @code{@@itemize}}.)@refill -@node TeX and copyright, pounds, Dots Bullets, Insertions -@section Inserting @TeX{} and the Copyright Symbol +@node TeX and copyright +@section Inserting @TeX{} and Legal Symbols: @copyright{}, @registeredsymbol{} The logo `@TeX{}' is typeset in a special fashion and it needs an -@@-command. The copyright symbol, `@copyright{}', is also special. -Each of these commands is followed by a pair of braces, @samp{@{@}}, -without any whitespace between the name of the command and the -braces.@refill +@@-command. The copyright and registered symbols, `@copyright{}' and +`@registeredsymbol{}', is also special. Each of these commands is +followed by a pair of braces, @samp{@{@}}, without any whitespace +between the name of the command and the braces. @menu -* tex:: How to insert the @TeX{} logo. -* copyright symbol:: How to use @code{@@copyright}@{@}. +* tex:: The @TeX{} logos. +* copyright symbol:: The copyright symbol (c in a circle). +* registered symbol:: The registered symbol (R in a circle). @end menu @node tex -@subsection @code{@@TeX}@{@} (@TeX{}) -@findex tex (command) +@subsection @code{@@TeX}@{@} (@TeX{}) and @code{@@LaTeX}@{@} (@LaTeX{}) +@findex TeX +@findex LaTeX Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed manual, this is a special logo that is different from three ordinary -letters. In Info, it just looks like @samp{TeX}. The -@code{@@TeX@{@}} command is unique among Texinfo commands in that the -@samp{T} and the @samp{X} are in upper case.@refill +letters. In Info, it just looks like @samp{TeX}. + +Similarly, use the @code{@@LaTeX@{@}} command to generate `@LaTeX{}', +which is even more special in printed manuals (and different from the +incorrect @code{La@@TeX@{@}}. In Info, the result is just +@samp{LaTeX}. (@LaTeX{} is another macro package built on top of +@TeX{}, very loosely analogous to Texinfo in that it emphasizes +logical structure, but much (much) larger.) + +The spelling of these commands are unusual among Texinfo commands in +that they use both uppercase and lowercase letters. @node copyright symbol -@subsection @code{@@copyright}@{@} (@copyright{}) +@subsection @code{@@copyright@{@}} (@copyright{}) @findex copyright -Use the @code{@@copyright@{@}} command to generate `@copyright{}'. In -a printed manual, this is a @samp{c} inside a circle, and in Info, -this is @samp{(C)}.@refill +Use the @code{@@copyright@{@}} command to generate the copyright +symbol, `@copyright{}'. Where possible, this is a @samp{c} +inside a circle; in Info, this is @samp{(C)}. -@node pounds, minus, TeX and copyright, Insertions +@node registered symbol +@subsection @code{@@registeredsymbol@{@}} (@registeredsymbol{}) +@findex registeredsymbol + +Use the @code{@@registeredsymbol@{@}} command to generate the +registered symbol, `@registeredsymbol{}'. Where possible, this is an +@samp{R} inside a circle; in Info, this is @samp{(R)}. + + +@node euro +@section @code{@@euro}@{@} (@euro{}): Euro currency symbol +@findex euro + +Use the @code{@@euro@{@}} command to generate `@euro{}'. Where +possible, this is the symbol for the Euro currency, invented as part +of the European economic unification relatively recently. In plain +Info, it is the word @samp{Euro }. (The space is included in the text +transliteration since typically there would be no space after the +symbol, so it would be inappropriate to have a space in the source document.) + +Texinfo cannot magically synthesize support for the Euro symbol where +the underlying system (fonts, software, whatever) does not support +it. Therefore, in many cases it is preferable to use the word +``Euro''. (In banking circles, the abbreviation for the Euro is EUR.) + +@cindex ISO 8859-15 +@cindex Latin 9 +In order to get the Euro symbol in encoded Info output, for example, +it is necessary to specify @code{@@documentencoding ISO-8859-15}. +(@xref{documentencoding,,@code{@@documentencoding}}.) The Euro symbol +is in ISO 8859-15 (aka Latin@tie{}9), and is @emph{not} in the more +widely-used and supported ISO 8859-1 (Latin@tie{}1). + + +@node pounds @section @code{@@pounds}@{@} (@pounds{}): Pounds Sterling @findex pounds -Use the @code{@@pounds@{@}} command to generate `@pounds{}'. In a -printed manual, this is the symbol for the currency pounds sterling. -In Info, it is a @samp{#}. Other currency symbols are unfortunately not -available. +Use the @code{@@pounds@{@}} command to generate `@pounds{}'. Where +possible, this is the symbol for the currency pounds sterling. In +Info, it is a @samp{#}. -@node minus, math, pounds, Insertions +@node minus @section @code{@@minus}@{@} (@minus{}): Inserting a Minus Sign @findex minus -@cindex em-dash -@cindex hyphen +@cindex Em dash, compared to minus sign +@cindex Hyphen, compared to minus Use the @code{@@minus@{@}} command to generate a minus sign. In a fixed-width font, this is a single hyphen, but in a proportional font, the symbol is the customary length for a minus sign---a little longer @@ -9570,7 +10581,7 @@ fixed-width font they use. When you use @code{@@minus} to specify the mark beginning each entry in an itemized list, you do not need to type the braces -(@pxref{itemize, , @code{@@itemize}}.) +(@pxref{itemize, , @code{@@itemize}}). @node math @@ -9593,17 +10604,19 @@ command. Write the mathematical expression between braces, like this: @math{(a + b)(a + b) = a^2 + 2ab + b^2} @end display -@noindent and the following in Info: +@noindent and the following in other formats: @end iftex -@ifinfo -@noindent This produces the following in Info: -@end ifinfo +@ifnottex +@noindent This produces the following in Info and HTML: +@end ifnottex @example (a + b)(a + b) = a^2 + 2ab + b^2 @end example -Thus, the @code{@@math} command has no effect on the Info output. +Thus, the @code{@@math} command has no effect on the Info and HTML +output; @command{makeinfo} just reproduces the input, it does not try +to interpret the mathematics in any way. @code{@@math} implies @code{@@tex}. This not only makes it possible to write superscripts and subscripts (as in the above example), but also @@ -9638,7 +10651,7 @@ literal @samp{\}. @cindex Displayed equations @cindex Equations, displayed For displayed equations, you must at present use @TeX{} directly -(@pxref{Raw Formatter Commands}). +(@pxref{Raw Formatter Commands}). @node Glyphs @@ -9660,7 +10673,7 @@ most often they are. Every glyph-insertion command is followed by a pair of left- and right-hand braces.@refill @menu -* Glyphs Summary:: +* Glyphs Summary:: * result:: How to show the result of expression. * expansion:: How to indicate an expansion. * Print Glyph:: How to indicate printed output. @@ -9718,28 +10731,29 @@ Use the @code{@@result@{@}} command to indicate the result of evaluating an expression.@refill @iftex -The @code{@@result@{@}} command is displayed as @samp{=>} in Info and -as @samp{@result{}} in the printed output. +The @code{@@result@{@}} command is displayed as @samp{@result{}} in +the printed output and as @samp{=>} in other formats. @end iftex -@ifinfo -The @code{@@result@{@}} command is displayed as @samp{@result{}} in Info -and as a double stemmed arrow in the printed output.@refill -@end ifinfo +@ifnottex +The @code{@@result@{@}} command is displayed as @samp{@result{}} in +Info and HTML and as a true double stemmed arrow in the printed output. +@end ifnottex Thus, the following, @lisp (cdr '(1 2 3)) - @result{} (2 3) + @result{} (2 3) @end lisp @noindent may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''. -@node expansion, Print Glyph, result, Glyphs +@node expansion @subsection @code{@@expansion@{@}} (@expansion{}): Indicating an Expansion -@cindex Expansion, indicating it +@cindex Expansion, indicating +@cindex Macro expansion, indicating @findex expansion When an expression is a macro call, it expands into a new expression. @@ -9747,13 +10761,14 @@ You can indicate the result of the expansion with the @code{@@expansion@{@}} command.@refill @iftex -The @code{@@expansion@{@}} command is displayed as @samp{==>} in Info and -as @samp{@expansion{}} in the printed output. +The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}} +in the printed output. and as @samp{==>} in other formats. @end iftex -@ifinfo +@ifnottex The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}} -in Info and as a long arrow with a flat base in the printed output.@refill -@end ifinfo +in Info and HTML, and as a long arrow with a flat base in the printed +output. +@end ifnottex @need 700 For example, the following @@ -9762,8 +10777,8 @@ For example, the following @group @@lisp (third '(a b c)) - @@expansion@{@} (car (cdr (cdr '(a b c)))) - @@result@{@} c + @@expansion@{@} (car (cdr (cdr '(a b c)))) + @@result@{@} c @@end lisp @end group @end example @@ -9774,8 +10789,8 @@ produces @lisp @group (third '(a b c)) - @expansion{} (car (cdr (cdr '(a b c)))) - @result{} c + @expansion{} (car (cdr (cdr '(a b c)))) + @result{} c @end group @end lisp @@ -9789,13 +10804,12 @@ the result of evaluating the expression is @code{c}. @noindent Often, as in this case, an example looks better if the -@code{@@expansion@{@}} and @code{@@result@{@}} commands are indented -five spaces.@refill +@code{@@expansion@{@}} and @code{@@result@{@}} commands are indented. -@node Print Glyph, Error Glyph, expansion, Glyphs +@node Print Glyph @subsection @code{@@print@{@}} (@print{}): Indicating Printed Output -@cindex Printed output, indicating it +@cindex Printed output, indicating @findex print Sometimes an expression will print output during its execution. You @@ -9803,24 +10817,24 @@ can indicate the printed output with the @code{@@print@{@}} command.@refill @iftex The @code{@@print@{@}} command is displayed as @samp{-|} in Info and -as @samp{@print{}} in the printed output. +HTML and as @samp{@print{}} in the printed output. @end iftex -@ifinfo +@ifnottex The @code{@@print@{@}} command is displayed as @samp{@print{}} in Info -and similarly, as a horizontal dash butting against a vertical bar, in -the printed output.@refill -@end ifinfo +and HTML and (similarly) as a horizontal dash butting against a +vertical bar in the printed output. +@end ifnottex In the following example, the printed text is indicated with @samp{@print{}}, and the value of the expression follows on the -last line.@refill +last line. @lisp @group (progn (print 'foo) (print 'bar)) - @print{} foo - @print{} bar - @result{} bar + @print{} foo + @print{} bar + @result{} bar @end group @end lisp @@ -9831,17 +10845,17 @@ In a Texinfo source file, this example is written as follows: @group @@lisp (progn (print 'foo) (print 'bar)) - @@print@{@} foo - @@print@{@} bar - @@result@{@} bar + @@print@{@} foo + @@print@{@} bar + @@result@{@} bar @@end lisp @end group @end lisp -@node Error Glyph, Equivalence, Print Glyph, Glyphs +@node Error Glyph @subsection @code{@@error@{@}} (@error{}): Indicating an Error Message -@cindex Error message, indicating it +@cindex Error message, indicating @findex error A piece of code may cause an error when you evaluate it. You can @@ -9849,12 +10863,12 @@ designate the error message with the @code{@@error@{@}} command.@refill @iftex The @code{@@error@{@}} command is displayed as @samp{error-->} in Info -and as @samp{@error{}} in the printed output. +and HTML and as @samp{@error{}} in the printed output. @end iftex -@ifinfo +@ifnottex The @code{@@error@{@}} command is displayed as @samp{@error{}} in Info -and as the word `error' in a box in the printed output.@refill -@end ifinfo +and HTML and as the word `error' in a box in the printed output. +@end ifnottex @need 700 Thus, @@ -9885,9 +10899,9 @@ Wrong type argument: integer-or-marker-p, x @samp{@error{}} itself is not part of the error message. -@node Equivalence, Point Glyph, Error Glyph, Glyphs +@node Equivalence @subsection @code{@@equiv@{@}} (@equiv{}): Indicating Equivalence -@cindex Equivalence, indicating it +@cindex Equivalence, indicating @findex equiv Sometimes two expressions produce identical results. You can indicate the @@ -9895,12 +10909,13 @@ exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill @iftex The @code{@@equiv@{@}} command is displayed as @samp{==} in Info and -as @samp{@equiv{}} in the printed output. +HTML and as @samp{@equiv{}} in the printed output. @end iftex -@ifinfo +@ifnottex The @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info -and as a three parallel horizontal lines in the printed output.@refill -@end ifinfo +and HTML and as a standard mathematical equivalence sign (three +parallel horizontal lines) in the printed output. +@end ifnottex Thus, @@ -9939,12 +10954,13 @@ two characters where point is located.)@refill @iftex The @code{@@point@{@}} command is displayed as @samp{-!-} in Info and -as @samp{@point{}} in the printed output. +HTML and as @samp{@point{}} in the printed output. @end iftex -@ifinfo +@ifnottex The @code{@@point@{@}} command is displayed as @samp{@point{}} in Info -and as a small five pointed star in the printed output.@refill -@end ifinfo +and HTML and as a small five pointed star in the printed +output. +@end ifnottex The following example shows the contents of buffer @file{foo} before and after evaluating a Lisp command to insert the word @code{changed}.@refill @@ -9961,7 +10977,7 @@ This is the @point{}contents of foo. @example @group (insert "changed ") - @result{} nil + @result{} nil ---------- Buffer: foo ---------- This is the changed @point{}contents of foo. ---------- Buffer: foo ---------- @@ -9978,7 +10994,7 @@ This is the @@point@{@}contents of foo. ---------- Buffer: foo ---------- (insert "changed ") - @@result@{@} nil + @@result@{@} nil ---------- Buffer: foo ---------- This is the changed @@point@{@}contents of foo. ---------- Buffer: foo ---------- @@ -9986,331 +11002,9 @@ This is the changed @@point@{@}contents of foo. @end example -@node Footnotes -@section Footnotes -@cindex Footnotes -@findex footnote - -A @dfn{footnote} is for a reference that documents or elucidates the -primary text.@footnote{A footnote should complement or expand upon -the primary text, but a reader should not need to read a footnote to -understand the primary text. For a thorough discussion of footnotes, -see @cite{The Chicago Manual of Style}, which is published by the -University of Chicago Press.} - -@menu -* Footnote Commands:: How to write a footnote in Texinfo. -* Footnote Styles:: Controlling how footnotes appear in Info. -@end menu - - -@node Footnote Commands -@subsection Footnote Commands - -In Texinfo, footnotes are created with the @code{@@footnote} command. -This command is followed immediately by a left brace, then by the text -of the footnote, and then by a terminating right brace. Footnotes may -be of any length (they will be broken across pages if necessary), but -are usually short. The template is: - -@example -ordinary text@@footnote@{@var{text of footnote}@} -@end example - -As shown here, the @code{@@footnote} command should come right after the -text being footnoted, with no intervening space; otherwise, the footnote -marker might end up starting a line. - -For example, this clause is followed by a sample footnote@footnote{Here -is the sample footnote.}; in the Texinfo source, it looks like -this: - -@example -@dots{}a sample footnote@@footnote@{Here is the sample -footnote.@}; in the Texinfo source@dots{} -@end example - -As you can see, the source includes two punctuation marks next to each -other; in this case, @samp{.@};} is the sequence. This is normal (the -first ends the footnote and the second belongs to the sentence being -footnoted), so don't worry that it looks odd. - -In a printed manual or book, the reference mark for a footnote is a -small, superscripted number; the text of the footnote appears at the -bottom of the page, below a horizontal line. - -In Info, the reference mark for a footnote is a pair of parentheses -with the footnote number between them, like this: @samp{(1)}. The -reference mark is followed by a cross-reference link to the footnote's -text. - -In the HTML output, footnote references are marked with a small, -superscripted number which is rendered as a hypertext link to the -footnote text. - -By the way, footnotes in the argument of an @code{@@item} command for a -@code{@@table} must be on the same line as the @code{@@item} -(as usual). @xref{Two-column Tables}. - - -@node Footnote Styles -@subsection Footnote Styles - -Info has two footnote styles, which determine where the text of the -footnote is located:@refill - -@itemize @bullet -@cindex @samp{@r{End}} node footnote style -@item -In the `End' node style, all the footnotes for a single node -are placed at the end of that node. The footnotes are separated from -the rest of the node by a line of dashes with the word -@samp{Footnotes} within it. Each footnote begins with an -@samp{(@var{n})} reference mark.@refill - -@need 700 -@noindent -Here is an example of a single footnote in the end of node style:@refill - -@example -@group - --------- Footnotes --------- - -(1) Here is a sample footnote. -@end group -@end example - -@cindex @samp{@r{Separate}} footnote style -@item -In the `Separate' node style, all the footnotes for a single -node are placed in an automatically constructed node of -their own. In this style, a ``footnote reference'' follows -each @samp{(@var{n})} reference mark in the body of the -node. The footnote reference is actually a cross reference -which you use to reach the footnote node.@refill - -The name of the node with the footnotes is constructed -by appending @w{@samp{-Footnotes}} to the name of the node -that contains the footnotes. (Consequently, the footnotes' -node for the @file{Footnotes} node is -@w{@file{Footnotes-Footnotes}}!) The footnotes' node has an -`Up' node pointer that leads back to its parent node.@refill - -@noindent -Here is how the first footnote in this manual looks after being -formatted for Info in the separate node style:@refill - -@smallexample -@group -File: texinfo.info Node: Overview-Footnotes, Up: Overview - -(1) The first syllable of "Texinfo" is pronounced like "speck", not -"hex". @dots{} -@end group -@end smallexample -@end itemize - -A Texinfo file may be formatted into an Info file with either footnote -style.@refill - -@findex footnotestyle -Use the @code{@@footnotestyle} command to specify an Info file's -footnote style. Write this command at the beginning of a line followed -by an argument, either @samp{end} for the end node style or -@samp{separate} for the separate node style. - -@need 700 -For example, - -@example -@@footnotestyle end -@end example -@noindent -or -@example -@@footnotestyle separate -@end example - -Write an @code{@@footnotestyle} command before or shortly after the -end-of-header line at the beginning of a Texinfo file. (If you -include the @code{@@footnotestyle} command between the start-of-header -and end-of-header lines, the region formatting commands will format -footnotes as specified.)@refill - -If you do not specify a footnote style, the formatting commands use -their default style. Currently, @code{texinfo-format-buffer} and -@code{texinfo-format-region} use the `separate' style and -@code{makeinfo} uses the `end' style.@refill - -@c !!! note: makeinfo's --footnote-style option overrides footnotestyle -@ignore -If you use @code{makeinfo} to create the Info file, the -@samp{--footnote-style} option determines which style is used, -@samp{end} for the end of node style or @samp{separate} for the -separate node style. Thus, to format the Texinfo manual in the -separate node style, you would use the following shell command:@refill - -@example -makeinfo --footnote-style=separate texinfo.texi -@end example - -@noindent -To format the Texinfo manual in the end of node style, you would -type:@refill - -@example -makeinfo --footnote-style=end texinfo.texi -@end example -@end ignore -@ignore -If you use @code{texinfo-format-buffer} or -@code{texinfo-format-region} to create the Info file, the value of the -@code{texinfo-footnote-style} variable controls the footnote style. -It can be either @samp{"separate"} for the separate node style or -@samp{"end"} for the end of node style. (You can change the value of -this variable with the @kbd{M-x edit-options} command (@pxref{Edit -Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or -with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining -and Setting Variables, emacs, The GNU Emacs Manual}).@refill - -The @code{texinfo-footnote-style} variable also controls the style if -you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer} -command in Emacs.@refill -@end ignore -@ifinfo -This chapter contains two footnotes.@refill -@end ifinfo - - -@c this should be described with figures when we have them -@c perhaps in the quotation/example chapter. -@node Images -@section Inserting Images - -@cindex Images, inserting -@cindex Pictures, inserting -@findex image - -You can insert an image given in an external file with the -@code{@@image} command: - -@example -@@image@{@var{filename}, @r{[}@var{width}@r{]}, @r{[}@var{height}@r{]}, @r{[}@var{alttext}@r{]}, @r{[}@var{extension}@r{]}@} -@end example - -@cindex Formats for images -@cindex Image formats -The @var{filename} argument is mandatory, and must not have an -extension, because the different processors support different formats: -@itemize @bullet -@item -@TeX{} reads the file @file{@var{filename}.eps} (Encapsulated PostScript -format). -@item -@pindex pdftex@r{, and images} -PDF@TeX{} reads @file{@var{filename}.pdf} (Adobe's Portable Document Format). -@item -@code{makeinfo} uses @file{@var{filename}.txt} verbatim for -Info output (more or less as if it was an @code{@@example}). -@item -@code{makeinfo} -uses the optional fifth argument to @code{@@image} for the extension if -you supply it. For example: - -@pindex XPM image format -@example -@@image@{foo,,,,xpm@} -@end example - -@noindent -will cause @samp{makeinfo --html} to try @file{foo.xpm}. - -@cindex GIF, unsupported due to patents -@cindex PNG image format -@cindex JPG image format -If you do not supply the optional fifth argument, @samp{makeinfo ----html} first tries @file{@var{filename}.png}; if that does not exist, -it tries @file{@var{filename}.jpg}. If that does not exist either, it -complains. (We cannot support GIF format directly due to software -patents.) -@end itemize - -@cindex Width of images -@cindex Height of images -@cindex Aspect ratio of images -@cindex Distorting images -The optional @var{width} and @var{height} arguments specify the size to -scale the image to (they are ignored for Info output). If neither is -specified, the image is presented in its natural size (given in the -file); if only one is specified, the other is scaled proportionately; -and if both are specified, both are respected, thus possibly distorting -the original image by changing its aspect ratio. - -@cindex Dimensions and image sizes -The @var{width} and @var{height} may be specified using any valid @TeX{} -dimension, namely: - -@table @asis -@item pt -@cindex Points (dimension) -point (72.27pt = 1in) -@item pc -@cindex Picas -pica (1pc = 12pt) -@item bp -@cindex Big points -big point (72bp = 1in) -@item in -@cindex Inches -inch -@item cm -@cindex Centimeters -centimeter (2.54cm = 1in) -@item mm -@cindex Millimeters -millimeter (10mm = 1cm) -@item dd -@cindex Did@^ot points -did@^ot point (1157dd = 1238pt) -@item cc -@cindex Ciceros -cicero (1cc = 12dd) -@item sp -@cindex Scaled points -scaled point (65536sp = 1pt) -@end table - -@pindex ridt.eps -For example, the following will scale a file @file{ridt.eps} to one -inch vertically, with the width scaled proportionately: - -@example -@@image@{ridt,,1in@} -@end example - -@pindex epsf.tex -For @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be -installed somewhere that @TeX{} can find it. (The standard location is -@file{@var{texmf}/tex/generic/dvips/epsf.tex}, where @var{texmf} is a -root of your @TeX{} directory tree.) This file is included in the -Texinfo distribution and is also available from -@uref{ftp://tug.org/tex/epsf.tex}, among other places. - -@code{@@image} can be used within a line as well as for displayed -figures. Therefore, if you intend it to be displayed, be sure to leave -a blank line before the command, or the output will run into the -preceding text. - -@cindex alt attribute for images -@cindex alternate text for images -When producing html, @code{makeinfo} sets the @dfn{alt attribute} for -inline images to the optional fourth argument to @code{@@image}, if -supplied. If not supplied, @code{makeinfo} uses the full file name of -the image being displayed. - - @node Breaks -@chapter Making and Preventing Breaks +@chapter Forcing and Preventing Breaks +@cindex Forcing line and page breaks @cindex Making line and page breaks @cindex Preventing line and page breaks @@ -10332,30 +11026,29 @@ arise. When they do, use the break, break prevention, or pagination commands. @menu -* Break Commands:: Cause and prevent splits. -* Line Breaks:: How to force a single line to use two lines. -* - and hyphenation:: How to tell @TeX{} about hyphenation points. -* w:: How to prevent unwanted line breaks. -* sp:: How to insert blank lines. -* page:: How to force the start of a new page. -* group:: How to prevent unwanted page breaks. +* Break Commands:: Summary of break-related commands. +* Line Breaks:: Forcing line breaks. +* - and hyphenation:: Helping @TeX{} with hyphenation points. +* w:: Preventing unwanted line breaks in text. +* tie:: Inserting an unbreakable but varying space. +* sp:: Inserting blank lines. +* page:: Forcing the start of a new page. +* group:: Preventing unwanted page breaks. * need:: Another way to prevent unwanted page breaks. @end menu -@node Break Commands, Line Breaks, Breaks, Breaks -@ifinfo -@heading Break Commands -@end ifinfo +@node Break Commands +@section Break Commands -The break commands create or allow line and paragraph breaks:@refill +The break commands create or allow line and paragraph breaks: @table @code @item @@* Force a line break. @item @@sp @var{n} -Skip @var{n} blank lines.@refill +Skip @var{n} blank lines. @item @@- Insert a discretionary hyphen. @@ -10364,89 +11057,83 @@ Insert a discretionary hyphen. Define hyphen points in @var{hy-phen-a-ted words}. @end table -The line-break-prevention command holds text together all on one -line:@refill +These commands hold text together on a single line: @table @code @item @@w@{@var{text}@} -Prevent @var{text} from being split and hyphenated across two lines.@refill +Prevent @var{text} from being split and hyphenated across two lines. +@item @@tie@{@} +Insert a normal interword space at which a line break may not occur. @end table @iftex @sp 1 @end iftex The pagination commands apply only to printed output, since Info -files do not have pages.@refill +files do not have pages. @table @code @item @@page -Start a new page in the printed manual.@refill +Start a new page in the printed manual. @item @@group -Hold text together that must appear on one printed page.@refill +Hold text together that must appear on one printed page. @item @@need @var{mils} -Start a new printed page if not enough space on this one.@refill +Start a new printed page if not enough space on this one. @end table + @node Line Breaks -@section @code{@@*}: Generate Line Breaks +@section @code{@@*} and @code{@@/}: Generate and Allow Line Breaks @findex * @r{(force line break)} +@findex / @r{(allow line break)} @cindex Line breaks @cindex Breaks in a line +@cindex Force line break +@cindex Allow line break The @code{@@*} command forces a line break in both the printed manual and -in Info.@refill +in Info. The @code{@@/} command allows a line break (printed manual only). -@need 700 -For example, +Here is an example with @code{@@*}: @example This line @@* is broken @@*in two places. @end example -@noindent -produces +@noindent produces @example @group This line - is broken +is broken in two places. @end group @end example -@noindent -(Note that the space after the first @code{@@*} command is faithfully -carried down to the next line.)@refill - -@need 800 -The @code{@@*} command is often used in a file's copyright page:@refill +The @code{@@/} command can be useful within a url +(@pxref{uref,,@code{@@uref}}), which tend to be long and are otherwise +unbreakable. For example: @example -@group -This is edition 2.0 of the Texinfo documentation,@@* -and is for @dots{} -@end group +The official Texinfo home page is on the GNU web site: +@@uref@{http://www.gnu.org/@@/software/@@/gnu/@@/texinfo@}. @end example -@noindent -In this case, the @code{@@*} command keeps @TeX{} from stretching the -line across the whole page in an ugly manner.@refill +@noindent produces -@quotation -@strong{Please note:} Do not write braces after an @code{@@*} command; -they are not needed.@refill +@display +The official Texinfo home page is on the GNU web site: +@uref{http://www.gnu.org/@/software/@/gnu/@/texinfo}. +@end display -Do not write an @code{@@refill} command at the end of a paragraph -containing an @code{@@*} command; it will cause the paragraph to be -refilled after the line break occurs, negating the effect of the line -break.@refill -@end quotation +@noindent Without the @code{@@/} commands, @TeX{} would have nowhere to +break the line. @code{@@/} has no effect in the online output. @node - and hyphenation -@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} hyphenate +@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} Hyphenate @findex - @r{(discretionary hyphen)} @findex hyphenation @@ -10479,39 +11166,88 @@ words match exactly, so give all necessary variants. Info output is not hyphenated, so these commands have no effect there. + @node w @section @code{@@w}@{@var{text}@}: Prevent Line Breaks @findex w @r{(prevent line break)} @cindex Line breaks, preventing -@cindex Hyphenation, preventing @code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks -within @var{text}.@refill +within @var{text}, for both @TeX{} and @command{makeinfo}. -You can use the @code{@@w} command to prevent @TeX{} from automatically -hyphenating a long name or phrase that happens to fall near the end of a -line. For example: +@cindex Non-breakable space, fixed +@cindex Unbreakable space, fixed +Thus, you can use @code{@@w} to produce a non-breakable space, fixed at +the width of a normal interword space: @example -You can copy GNU software from @@w@{@@samp@{ftp.gnu.org@}@}. +@@w@{ @} @@w@{ @} @@w@{ @} indentation. @end example -@noindent -produces +@noindent produces: -@quotation -You can copy GNU software from @w{@samp{ftp.gnu.org}}. -@end quotation +@display +@w{ } @w{ } @w{ } indentation. +@end display -@cindex Non-breakable space -@cindex Unbreakable space +The space from @code{@@w@{@w{ }@}}, as well as being non-breakable, +also will not stretch or shrink. Sometimes that is what you want, for +instance if you're doing indenting manual. However, usually you want +a normal interword space that does stretch and shrink (in the printed +output); see the @code{@@tie} command in the next section. + +@cindex Hyphenation, preventing +You can also use the @code{@@w} command to prevent @TeX{} from +automatically hyphenating a long name or phrase that happens to fall +near the end of a line. @command{makeinfo} does not ever hyphenate +words. + +@cindex Keyword expansion, preventing +@cindex Version control keywords, preventing expansion of +@cindex $Id expansion, preventing +You can also use @code{@@w} to avoid unwanted keyword expansion in +source control systems. For example, to literally write @t{@w{$}Id$} +in your document, use @code{@@w@{$@}Id$}. + + +@node tie +@section @code{@@tie@{@}}: Inserting an Unbreakable Space +@findex tie @r{(unbreakable interword space)} @cindex Tied space -You can also use @code{@@w} to produce a non-breakable space: +@cindex Non-breakable space, variable +@cindex Unbreakable space, variable + +The @code{@@tie@{@}} command produces a normal interword space at which +a line break may not occur. Always write it with following (empty) +braces, as usual for commands used within a paragraph. Here's an +example: @example -None of the formatters will break at this@@w@{ @}space. +@@TeX@{@} was written by Donald E.@@tie@{@}Knuth. @end example +@noindent produces: + +@display +@TeX{} was written by Donald E.@tie{}Knuth. +@end display + +There are two important differences between @code{@@tie@{@}} and +@code{@@w@{@w{ }@}}: + +@itemize +@item +The space produced by @code{@@tie@{@}} will stretch and shrink slightly +along with the normal interword spaces in the paragraph; the space +produced by @code{@@w@{@w{ }@}} will not vary. + +@item +@code{@@tie@{@}} allows hyphenation of the surrounding words, while +@code{@@w@{@w{ }@}} inhibits hyphenation of those words (for @TeX{}nical +reasons, namely that it produces an @samp{\hbox}). + +@end itemize + @node sp @section @code{@@sp} @var{n}: Insert Blank Lines @@ -10586,7 +11322,7 @@ paginated. An @code{@@page} command is often used in the @code{@@titlepage} section of a Texinfo file to start the copyright page. -@node group, need, page, Breaks +@node group @comment node-name, next, previous, up @section @code{@@group}: Prevent Page Breaks @cindex Group (hold text together vertically) @@ -10643,7 +11379,7 @@ considerable text. It is a good rule of thumb to look for a missing @code{@@end group} if you get incomprehensible error messages in @TeX{}.@refill -@node need, , group, Breaks +@node need @comment node-name, next, previous, up @section @code{@@need @var{mils}}: Prevent Page Breaks @cindex Need space at page bottom @@ -10690,23 +11426,24 @@ output formats, the body of the definition is indented. Also, the name of the entity is entered into the appropriate index: @code{@@deffn} enters the name into the index of functions, @code{@@defvr} enters it into the index of variables, and so -on.@refill +on (@pxref{Predefined Indices}). A manual need not and should not contain more than one definition for a given name. An appendix containing a summary should use @code{@@table} rather than the definition commands.@refill @menu -* Def Cmd Template:: How to structure a description using a - definition command. -* Optional Arguments:: How to handle optional and repeated arguments. -* deffnx:: How to group two or more `first' lines. -* Def Cmds in Detail:: All the definition commands. +* Def Cmd Template:: Writing descriptions using definition commands. +* Def Cmd Continuation Lines:: Continuing the heading over source lines. +* Optional Arguments:: Handling optional and repeated arguments. +* deffnx:: Group two or more `first' lines. +* Def Cmds in Detail:: Reference for all the definition commands. * Def Cmd Conventions:: Conventions for writing definitions. -* Sample Function Definition:: +* Sample Function Definition:: An example. @end menu -@node Def Cmd Template, Optional Arguments, Definition Commands, Definition Commands + +@node Def Cmd Template @section The Template for a Definition @cindex Definition template @cindex Template for a definition @@ -10718,8 +11455,12 @@ and follow it on the same line by the category of the entity, the name of the entity itself, and its arguments (if any). Then write the body of the definition on succeeding lines. (You may embed examples in the body.) Finally, end the definition with an @code{@@end deffn} command -written on a line of its own. (The other definition commands follow -the same format.)@refill +written on a line of its own. + +The other definition commands follow the same format: a line with the +@code{@@def@dots{}} command and whatever arguments are appropriate for +that command; the body of the definition; and a corresponding +@code{@@end} line. The template for a definition looks like this: @@ -10756,7 +11497,7 @@ This function moves point forward @var{count} words Capitalize the category name like a title. If the name of the category contains spaces, as in the phrase `Interactive Command', -write braces around it. For example:@refill +enclose it in braces. For example: @example @group @@ -10768,68 +11509,91 @@ write braces around it. For example:@refill @noindent Otherwise, the second word will be mistaken for the name of the -entity.@refill +entity. As a general rule, when any of the arguments in the heading +line @emph{except} the last one are more than one word, you need to +enclose them in braces. Some of the definition commands are more general than others. The @code{@@deffn} command, for example, is the general definition command -for functions and the like---for entities that may take arguments. When -you use this command, you specify the category to which the entity -belongs. The @code{@@deffn} command possesses three predefined, -specialized variations, @code{@@defun}, @code{@@defmac}, and -@code{@@defspec}, that specify the category for you: ``Function'', -``Macro'', and ``Special Form'' respectively. (In Lisp, a special form -is an entity much like a function.) The @code{@@defvr} command also is -accompanied by several predefined, specialized variations for describing -particular kinds of variables.@refill +for functions and the like---for entities that may take arguments. +When you use this command, you specify the category to which the +entity belongs. Three predefined, specialized variations +(@code{@@defun}, @code{@@defmac}, and @code{@@defspec}) specify the +category for you: ``Function'', ``Macro'', and ``Special Form'' +respectively. (In Lisp, a special form is an entity much like a +function.) Similarly, the general @code{@@defvr} command is +accompanied by several specialized variations for describing +particular kinds of variables. + +@xref{Sample Function Definition}, for a detailed example of a +function definition, including the use of @code{@@example} inside the +definition. -The template for a specialized definition, such as @code{@@defun}, is -similar to the template for a generalized definition, except that you -do not need to specify the category:@refill +@cindex Macros in definition commands +Unfortunately, due to implementation difficulties, macros are not expanded +in @code{@@deffn} and all the other definition commands. -@example -@group -@@defun @var{name} @var{arguments}@dots{} -@var{body-of-definition} -@@end defun -@end group -@end example -@noindent -Thus, +@node Def Cmd Continuation Lines +@section Definition Command Continuation Lines +@cindex Continuation lines in definition commands +@cindex Definition command headings, continuing +@cindex @samp{@@} as continuation in definition commands + +The heading line of a definition command can get very long. +Therefore, Texinfo has a special syntax allowing them to be continued +over multiple lines of the source file: a lone @samp{@@} at the end of +each line to be continued. Here's an example: @example -@group -@@defun buffer-end flag -This function returns @@code@{(point-min)@} if @@var@{flag@} -is less than 1, @@code@{(point-max)@} otherwise. -@dots{} +@@defun fn-name @@ + arg1 arg2 arg3 +This is the basic continued defun. @@end defun -@end group @end example -@noindent -produces +@noindent produces: -@quotation -@defun buffer-end flag -This function returns @code{(point-min)} if @var{flag} is less than 1, -@code{(point-max)} otherwise. @dots{} +@defun fn-name @ + arg1 arg2 arg3 +This is the basic continued defun. @end defun -@end quotation @noindent -@xref{Sample Function Definition, Sample Function Definition, A Sample -Function Definition}, for a more detailed example of a function -definition, including the use of @code{@@example} inside the -definition.@refill +As you can see, the continued lines are combined, as if they had been +typed on one source line. -The other specialized commands work like @code{@@defun}.@refill +Although this example only shows a one-line continuation, +continuations may extend over any number of lines; simply put an +@code{@@} at the end of each line to be continued. + +The @code{@@} character does not have to be the last character on the +physical line: whitespace is allowed (and ignored) afterwards. + +@cindex Whitespace, collapsed around continuations +@cindex Collapsing whitespace around continuations +In general, any number of spaces or tabs around the @code{@@} +continuation character, both on the line with the @code{@@} and on the +continued line, are collapsed into a single space. There is one +exception: the Texinfo processors will not fully collapse whitespace +around a continuation inside braces. For example: + +@example +@@deffn @{Category @@ + Name@} @dots{} +@end example + +@noindent The output (not shown) has excess space between `Category' +and `Name'. In this case, simply elide any unwanted whitespace in +your input, or put the continuation @code{@@} outside braces. + +@code{@@} does not (currently) function as a continuation character in +@emph{any} other context. Ordinarily, @samp{@@} followed by a +whitespace character (space, tab, newline) produces a normal interword +space (@pxref{Multiple Spaces}). -@cindex Macros in definition commands -Note that, due to implementation difficulties, macros are not expanded -in @code{@@deffn} and all the other definition commands. -@node Optional Arguments, deffnx, Def Cmd Template, Definition Commands +@node Optional Arguments @section Optional and Repeated Arguments @cindex Optional and repeated arguments @cindex Repeated and optional arguments @@ -10841,34 +11605,20 @@ Some entities take optional or repeated arguments, which may be specified by a distinctive glyph that uses square brackets and ellipses. For @w{example}, a special form often breaks its argument list into separate arguments in more complicated ways than a -straightforward function.@refill +straightforward function. -@iftex -An argument enclosed within square brackets is optional. -Thus, the phrase -@samp{@code{@r{[}@var{optional-arg}@r{]}}} means that -@var{optional-arg} is optional. -An argument followed by an ellipsis is optional -and may be repeated more than once. @c This is consistent with Emacs Lisp Reference manual -Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments. -Parentheses are used when several arguments are grouped -into additional levels of list structure in Lisp. -@end iftex -@c The following looks better in Info (no `r', `samp' and `code'): -@ifinfo An argument enclosed within square brackets is optional. Thus, [@var{optional-arg}] means that @var{optional-arg} is optional. An argument followed by an ellipsis is optional and may be repeated more than once. @c This is consistent with Emacs Lisp Reference manual -Thus, @var{repeated-args}@dots{} stands for zero or more arguments. -Parentheses are used when several arguments are grouped +Thus, @var{repeated-args}@samp{@dots{}} stands for zero or more +arguments. Parentheses are used when several arguments are grouped into additional levels of list structure in Lisp. -@end ifinfo Here is the @code{@@defspec} line of an example of an imaginary -special form:@refill +special form: @quotation @defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{} @@ -10893,7 +11643,7 @@ example).@refill @example @group @@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@} - [@@var@{inc@}]]) @@var@{body@}@@dots@{@} + [@@var@{inc@}]]) @@var@{body@}@@dots@{@} @end group @end example @@ -10901,7 +11651,8 @@ example).@refill The function is listed in the Command and Variable Index under @samp{foobar}.@refill -@node deffnx, Def Cmds in Detail, Optional Arguments, Definition Commands + +@node deffnx @section Two or More `First' Lines @cindex Two `First' Lines for @code{@@deffn} @cindex Grouping two definitions together @@ -10937,9 +11688,10 @@ These two search commands are similar except @dots{} Each definition command has an `x' form: @code{@@defunx}, @code{@@defvrx}, @code{@@deftypefunx}, etc. -The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}. +The `x' forms work similarly to @code{@@itemx} (@pxref{itemx}). -@node Def Cmds in Detail, Def Cmd Conventions, deffnx, Definition Commands + +@node Def Cmds in Detail @section The Definition Commands Texinfo provides more than a dozen definition commands, all of which @@ -10959,11 +11711,11 @@ can be used for other programming languages.@refill * Variables Commands:: Commands for variables and similar entities. * Typed Functions:: Commands for functions in typed languages. * Typed Variables:: Commands for variables in typed languages. -* Abstract Objects:: Commands for object-oriented programming. * Data Types:: The definition command for data types. +* Abstract Objects:: Commands for object-oriented programming. @end menu -@node Functions Commands, Variables Commands, Def Cmds in Detail, Def Cmds in Detail +@node Functions Commands @subsection Functions and Similar Entities This section describes the commands for describing functions and similar @@ -10997,12 +11749,19 @@ Move point forward @@var@{nchars@} characters. This shows a rather terse definition for a ``command'' named @code{forward-char} with one argument, @var{nchars}. -@code{@@deffn} prints argument names such as @var{nchars} in italics or -upper case, as if @code{@@var} had been used, because we think of these -names as metasyntactic variables---they stand for the actual argument -values. Within the text of the description, write an argument name -explicitly with @code{@@var} to refer to the value of the argument. In -the example above, we used @samp{@@var@{nchars@}} in this way. +@code{@@deffn} and prints argument names such as @var{nchars} in slanted +type in the printed output, because we think of these names as +metasyntactic variables---they stand for the actual argument values. +Within the text of the description, however, write an argument name +explicitly with @code{@@var} to refer to the value of the argument. +In the example above, we used @samp{@@var@{nchars@}} in this way. + +In the unusual case when an argument name contains @samp{--}, or +another character sequence which is treated specially +(@pxref{Conventions}), use @code{@@var} around the argument. This +causes the name to be printed in slanted typewriter, instead of the +regular slanted font, exactly as input. +@c except for ?` and !`, but we won't explain that. The template for @code{@@deffn} is: @@ -11017,30 +11776,9 @@ The template for @code{@@deffn} is: @findex defun @item @@defun @var{name} @var{arguments}@dots{} The @code{@@defun} command is the definition command for functions. -@code{@@defun} is equivalent to @samp{@@deffn Function -@dots{}}.@refill - -@need 800 -@noindent -For example, - -@example -@group -@@defun set symbol new-value -Change the value of the symbol @@var@{symbol@} -to @@var@{new-value@}. -@@end defun -@end group -@end example - -@noindent -shows a rather terse definition for a function @code{set} whose -arguments are @var{symbol} and @var{new-value}. The argument names on -the @code{@@defun} line automatically appear in italics or upper case as -if they were enclosed in @code{@@var}. Terminate the definition with -@code{@@end defun} on a line of its own.@refill - -The template is: +@code{@@defun} is equivalent to @samp{@@deffn Function @dots{}}. +Terminate the definition with @code{@@end defun} on a line of its own. +Thus, the template is: @example @group @@ -11050,13 +11788,11 @@ The template is: @end group @end example -@code{@@defun} creates an entry in the index of functions. - @findex defmac @item @@defmac @var{name} @var{arguments}@dots{} The @code{@@defmac} command is the definition command for macros. @code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and -works like @code{@@defun}.@refill +works like @code{@@defun}. @findex defspec @item @@defspec @var{name} @var{arguments}@dots{} @@ -11064,10 +11800,13 @@ The @code{@@defspec} command is the definition command for special forms. (In Lisp, a special form is an entity much like a function, @pxref{Special Forms,,, elisp, GNU Emacs Lisp Reference Manual}.) @code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@} -@dots{}} and works like @code{@@defun}.@refill +@dots{}} and works like @code{@@defun}. @end table -@node Variables Commands, Typed Functions, Functions Commands, Def Cmds in Detail +All these commands create entries in the index of functions. + + +@node Variables Commands @subsection Variables and Similar Entities Here are the commands for defining variables and similar @@ -11151,11 +11890,12 @@ The @code{@@defopt} command is the definition command for @dfn{user options}, i.e., variables intended for users to change according to taste; Emacs has many such (@pxref{Variables,,, emacs, The GNU Emacs Manual}). @code{@@defopt} is equivalent to @samp{@@defvr @{User -Option@} @dots{}} and works like @code{@@defvar}.@refill +Option@} @dots{}} and works like @code{@@defvar}. It creates an entry +in the index of variables. @end table -@node Typed Functions, Typed Variables, Variables Commands, Def Cmds in Detail +@node Typed Functions @subsection Functions in Typed Languages The @code{@@deftypefn} command and its variations are for describing @@ -11179,7 +11919,7 @@ For example, @example @group @@deftypefn @{Library Function@} int foobar - (int @@var@{foo@}, float @@var@{bar@}) + (int @@var@{foo@}, float @@var@{bar@}) @dots{} @@end deftypefn @end group @@ -11212,12 +11952,15 @@ This means that @code{foobar} is a ``library function'' that returns an @code{int}, and its arguments are @var{foo} (an @code{int}) and @var{bar} (a @code{float}).@refill -The argument names that you write in @code{@@deftypefn} are not subject -to an implicit @code{@@var}---since the actual names of the arguments in -@code{@@deftypefn} are typically scattered among data type names and -keywords, Texinfo cannot find them without help. Instead, you must write -@code{@@var} explicitly around the argument names. In the example -above, the argument names are @samp{foo} and @samp{bar}.@refill +Since in typed languages, the actual names of the arguments are +typically scattered among data type names and keywords, Texinfo cannot +find them without help. You can either (a)@tie{}write everything +as straight text, and it will be printed in slanted type; (b)@tie{}use +@code{@@var} for the variable names, which will uppercase the +variable names in Info and use the slanted typewriter font in printed +output; (c)@tie{}use @code{@@var} for the variable names and +@code{@@code} for the type names and keywords, which will be dutifully +obeyed. The template for @code{@@deftypefn} is:@refill @@ -11236,25 +11979,22 @@ word then it must be enclosed in braces to make it a single argument.@refill If you are describing a procedure in a language that has packages, such as Ada, you might consider using @code{@@deftypefn} in a manner somewhat contrary to the convention described in the preceding -paragraphs.@refill - -@need 800 -@noindent -For example: +paragraphs. For example: @example @group -@@deftypefn stacks private push - (@@var@{s@}:in out stack; - @@var@{n@}:in integer) +@@deftypefn stacks private push @@ + (@@var@{s@}:in out stack; @@ + @@var@{n@}:in integer) @dots{} @@end deftypefn @end group @end example @noindent -(The @code{@@deftypefn} arguments are shown split into three lines, but -would be a single line in a real Texinfo file.) +(The @code{@@deftypefn} arguments are shown using continuations +(@pxref{Def Cmd Continuation Lines}), but could be on a single line in +a real Texinfo file.) In this instance, the procedure is classified as belonging to the package @code{stacks} rather than classified as a `procedure' and its @@ -11262,50 +12002,13 @@ data type is described as @code{private}. (The name of the procedure is @code{push}, and its arguments are @var{s} and @var{n}.)@refill @code{@@deftypefn} creates an entry in the index of functions for -@var{name}.@refill +@var{name}. @item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{} @findex deftypefun The @code{@@deftypefun} command is the specialized definition command for functions in typed languages. The command is equivalent to -@samp{@@deftypefn Function @dots{}}.@refill - -@need 800 -@noindent -Thus, - -@smallexample -@group -@@deftypefun int foobar (int @@var@{foo@}, float @@var@{bar@}) -@dots{} -@@end deftypefun -@end group -@end smallexample - -@noindent -produces the following in Info: - -@example -@group --- Function: int foobar (int FOO, float BAR) -@dots{} -@end group -@end example -@iftex - -@need 800 -@noindent -and the following in a printed manual: - -@quotation -@deftypefun int foobar (int @var{foo}, float @var{bar}) -@dots{} -@end deftypefun -@end quotation -@end iftex - -@need 800 -The template is: +@samp{@@deftypefn Function @dots{}}. The template is: @example @group @@ -11316,12 +12019,12 @@ The template is: @end example @code{@@deftypefun} creates an entry in the index of functions for -@var{name}.@refill +@var{name}. @end table -@node Typed Variables, Abstract Objects, Typed Functions, Def Cmds in Detail +@node Typed Variables @subsection Variables in Typed Languages Variables in typed languages are handled in a manner similar to @@ -11386,87 +12089,103 @@ The template is: @@end deftypevr @end example -@code{@@deftypevr} creates an entry in the index of variables for -@var{name}.@refill - @findex deftypevar @item @@deftypevar @var{data-type} @var{name} The @code{@@deftypevar} command is the specialized definition command for variables in typed languages. @code{@@deftypevar} is equivalent -to @samp{@@deftypevr Variable @dots{}}.@refill - -@need 800 -@noindent -For example: +to @samp{@@deftypevr Variable @dots{}}. The template is: @example @group -@@deftypevar int fubar -@dots{} +@@deftypevar @var{data-type} @var{name} +@var{body-of-description} @@end deftypevar @end group @end example +@end table -@noindent -produces the following in Info: +These commands create entries in the index of variables. + +@node Data Types +@subsection Data Types + +Here is the command for data types:@refill + +@table @code +@findex deftp +@item @@deftp @var{category} @var{name} @var{attributes}@dots{} +The @code{@@deftp} command is the generic definition command for data +types. The command is written at the beginning of a line and is +followed on the same line by the category, by the name of the type +(which is a word like @code{int} or @code{float}), and then by names of +attributes of objects of that type. Thus, you could use this command +for describing @code{int} or @code{float}, in which case you could use +@code{data type} as the category. (A data type is a category of +certain objects for purposes of deciding which operations can be +performed on them.)@refill + +In Lisp, for example, @dfn{pair} names a particular data +type, and an object of that type has two slots called the +@sc{car} and the @sc{cdr}. Here is how you would write the first line +of a definition of @code{pair}.@refill @example @group --- Variable: int fubar +@@deftp @{Data type@} pair car cdr @dots{} +@@end deftp @end group @end example -@iftex - -@need 800 -@noindent -and the following in a printed manual: -@quotation -@deftypevar int fubar -@dots{} -@end deftypevar -@end quotation -@end iftex - -@need 800 -@noindent +@need 950 The template is: @example @group -@@deftypevar @var{data-type} @var{name} -@var{body-of-description} -@@end deftypevar +@@deftp @var{category} @var{name-of-type} @var{attributes}@dots{} +@var{body-of-definition} +@@end deftp @end group @end example -@code{@@deftypevar} creates an entry in the index of variables for -@var{name}.@refill +@code{@@deftp} creates an entry in the index of data types. @end table + @node Abstract Objects @subsection Object-Oriented Programming +@cindex Object-oriented programming + Here are the commands for formatting descriptions about abstract objects, such as are used in object-oriented programming. A class is a defined type of abstract object. An instance of a class is a particular object that has the type of the class. An instance variable is a variable that belongs to the class but for which each -instance has its own value.@refill +instance has its own value. + +@menu +* Variables: Object-Oriented Variables. +* Methods: Object-Oriented Methods. +@end menu -In a definition, if the name of a class is truly a name defined in the -programming system for a class, then you should write an @code{@@code} -around it. Otherwise, it is printed in the usual text font.@refill + +@node Object-Oriented Variables +@subsubsection Object-Oriented Variables + +@cindex Variables, object-oriented + +These commands allow you to define different sorts of variables in +object-oriented programming languages. @table @code -@findex defcv @item @@defcv @var{category} @var{class} @var{name} +@findex defcv The @code{@@defcv} command is the general definition command for variables associated with classes in object-oriented programming. The @code{@@defcv} command is followed by three arguments: the category of thing being defined, the class to which it belongs, and its -name. Thus,@refill +name. For instance: @example @group @@ -11476,52 +12195,104 @@ name. Thus,@refill @end group @end example -@noindent -illustrates how you would write the first line of a definition of the -@code{border-pattern} class option of the class @code{Window}.@refill +@noindent produces: +@defcv {Class Option} Window border-pattern +@dots{} +@end defcv + +@code{@@defcv} creates an entry in the index of variables. + +@item @@deftypecv @var{category} @var{class} @var{data-type} @var{name} +@findex deftypecv +The @code{@@deftypecv} command is the definition command for typed +class variables in object-oriented programming. It is analogous to +@code{@@defcv} with the addition of the @var{data-type} parameter to +specify the type of the instance variable. Ordinarily, the data type +is a programming language construct that should be marked with +@code{@@code}. For instance: -The template is: @example @group -@@defcv @var{category} @var{class} @var{name} +@@deftypecv @{Class Option@} Window @@code@{int@} border-pattern @dots{} -@@end defcv +@@end deftypecv @end group @end example -@code{@@defcv} creates an entry in the index of variables. +@noindent produces: + +@deftypecv {Class Option} Window @code{int} border-pattern +@dots{} +@end deftypecv + +@code{@@deftypecv} creates an entry in the index of variables. -@findex defivar @item @@defivar @var{class} @var{name} +@findex defivar The @code{@@defivar} command is the definition command for instance variables in object-oriented programming. @code{@@defivar} is -equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill +equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}. For +instance: -The template is: @example @group -@@defivar @var{class} @var{instance-variable-name} -@var{body-of-definition} +@@defivar Window border-pattern +@dots{} @@end defivar @end group @end example +@noindent produces: + +@defivar Window border-pattern +@dots{} +@end defivar + @code{@@defivar} creates an entry in the index of variables. -@findex deftypeivar @item @@deftypeivar @var{class} @var{data-type} @var{name} +@findex deftypeivar The @code{@@deftypeivar} command is the definition command for typed -instance variables in object-oriented programming. It is similar to +instance variables in object-oriented programming. It is analogous to @code{@@defivar} with the addition of the @var{data-type} parameter to -specify the type of the instance variable. @code{@@deftypeivar} creates an -entry in the index of variables. +specify the type of the instance variable. Ordinarily, the data type +is a programming language construct that should be marked with +@code{@@code}. For instance: + +@example +@group +@@deftypeivar Window @@code@{int@} border-pattern +@dots{} +@@end deftypeivar +@end group +@end example + +@noindent produces: + +@deftypeivar Window @code{int} border-pattern +@dots{} +@end deftypeivar + +@code{@@deftypeivar} creates an entry in the index of variables. + +@end table + +@node Object-Oriented Methods +@subsubsection Object-Oriented Methods + +@cindex Methods, object-oriented + +These commands allow you to define different sorts of function-like +entities resembling methods in object-oriented programming languages. +These entities take arguments, as functions do, but are associated with +particular classes of objects. + +@table @code @findex defop @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{} -The @code{@@defop} command is the general definition command for -entities that may resemble methods in object-oriented programming. -These entities take arguments, as functions do, but are associated with -particular classes of objects.@refill +The @code{@@defop} command is the general definition command for these +method-like entities. For example, some systems have constructs called @dfn{wrappers} that are associated with classes as methods are, but that act more like @@ -11603,21 +12374,9 @@ For example: @noindent illustrates the definition for a method called @code{bar-method} of -the class @code{bar-class}. The method takes an argument.@refill - -The template is: - -@example -@group -@@defmethod @var{class} @var{method-name} @var{arguments}@dots{} -@var{body-of-definition} -@@end defmethod -@end group -@end example - -@code{@@defmethod} creates an entry, such as `@code{bar-method} on -@code{bar-class}', in the index of functions.@refill +the class @code{bar-class}. The method takes an argument. +@code{@@defmethod} creates an entry in the index of functions. @item @@deftypemethod @var{class} @var{data-type} @var{name} @var{arguments}@dots{} @findex defmethod @@ -11625,56 +12384,12 @@ The @code{@@deftypemethod} command is the definition command for methods in object-oriented typed languages, such as C++ and Java. It is similar to the @code{@@defmethod} command with the addition of the @var{data-type} parameter to specify the return type of the method. +@code{@@deftypemethod} creates an entry in the index of functions. @end table -@node Data Types -@subsection Data Types - -Here is the command for data types:@refill - -@table @code -@findex deftp -@item @@deftp @var{category} @var{name} @var{attributes}@dots{} -The @code{@@deftp} command is the generic definition command for data -types. The command is written at the beginning of a line and is -followed on the same line by the category, by the name of the type -(which is a word like @code{int} or @code{float}), and then by names of -attributes of objects of that type. Thus, you could use this command -for describing @code{int} or @code{float}, in which case you could use -@code{data type} as the category. (A data type is a category of -certain objects for purposes of deciding which operations can be -performed on them.)@refill - -In Lisp, for example, @dfn{pair} names a particular data -type, and an object of that type has two slots called the -@sc{car} and the @sc{cdr}. Here is how you would write the first line -of a definition of @code{pair}.@refill - -@example -@group -@@deftp @{Data type@} pair car cdr -@dots{} -@@end deftp -@end group -@end example - -@need 950 -The template is: - -@example -@group -@@deftp @var{category} @var{name-of-type} @var{attributes}@dots{} -@var{body-of-definition} -@@end deftp -@end group -@end example - -@code{@@deftp} creates an entry in the index of data types. -@end table - -@node Def Cmd Conventions, Sample Function Definition, Def Cmds in Detail, Definition Commands +@node Def Cmd Conventions @section Conventions for Writing Definitions @cindex Definition conventions @cindex Conventions for writing definitions @@ -11686,7 +12401,8 @@ to the @code{forward-word} function. Also, if the name of an argument contains the name of a type, such as @var{integer}, take care that the argument actually is of that type.@refill -@node Sample Function Definition, , Def Cmd Conventions, Definition Commands + +@node Sample Function Definition @section A Sample Function Definition @cindex Function definitions @cindex Command definitions @@ -11716,16 +12432,16 @@ do not make sense in @code{apply}. @example (setq f 'list) - @result{} list + @result{} list (apply f 'x 'y 'z) @error{} Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) - @result{} 10 + @result{} 10 (apply '+ '(1 2 3 4)) - @result{} 10 + @result{} 10 (apply 'append '((a b c) nil (x y z) nil)) - @result{} (a b c x y z) + @result{} (a b c x y z) @end example An interesting example of using @code{apply} is found in the description @@ -11758,16 +12474,16 @@ sense in @@code@{apply@}. @group @@example (setq f 'list) - @@result@{@} list + @@result@{@} list (apply f 'x 'y 'z) @@error@{@} Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) - @@result@{@} 10 + @@result@{@} 10 (apply '+ '(1 2 3 4)) - @@result@{@} 10 + @@result@{@} 10 (apply 'append '((a b c) nil (x y z) nil)) - @@result@{@} (a b c x y z) + @@result@{@} (a b c x y z) @@end example @end group @@ -11793,65 +12509,89 @@ that for functions except that variables do not take arguments. @cindex Visibility of conditional text @cindex If text conditionally visible -Sometimes it is good to use different text for different output formats. -For example, you can use the @dfn{conditional commands} to specify -different text for the printed manual and the Info output. - -Conditional commands may not be nested. +The @dfn{conditional commands} allow you to use different text for +different output formats, or for general conditions that you define. +For example, you can use them to specify different text for the +printed manual and the Info output. The conditional commands comprise the following categories. @itemize @bullet -@item Commands for HTML, Info, or @TeX{}. -@item Commands for not HTML, Info, or @TeX{}. -@item Raw @TeX{} or HTML commands. @item -Substituting text for all formats, and testing if a flag is set or clear. +Commands specific to an output format (Info, @TeX{}, HTML, @dots{}). + +@item +Commands specific to any output format @emph{other} than a given +one (not Info, not @TeX{}, @dots{}). + +@item +`Raw' formatter text for any output format, passed straight +through with no interpretation of @@-commands. + +@item +Format-independent variable substitutions, and testing if a variable +is set or clear. + @end itemize @menu -* Conditional Commands:: Specifying text for HTML, Info, or @TeX{}. -* Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}. -* Raw Formatter Commands:: Using raw @TeX{} or HTML commands. -* set clear value:: Designating which text to format (for - all output formats); and how to set a - flag to a string that you can insert. +* Conditional Commands:: Text for a given format. +* Conditional Not Commands:: Text for any format other than a given one. +* Raw Formatter Commands:: Using raw formatter commands. +* set clear value:: Variable tests and substitutions. +* Conditional Nesting:: Using conditionals inside conditionals. @end menu @node Conditional Commands @section Conditional Commands -Texinfo has a pair of commands for each output format, to allow -conditional inclusion of text for a particular output format. +Texinfo has an @code{@@if@var{format}} environment for each output +format, to allow conditional inclusion of text for a particular output +format. @findex ifinfo -@code{@@ifinfo} begins segments of text that should be ignored by @TeX{} -when it typesets the printed manual. The segment of text appears only -in the Info file and (for historical compatibility) the plain text -output. The @code{@@ifinfo} command should appear on a line by itself; -end the Info-only text with a line containing @code{@@end ifinfo} by -itself. +@code{@@ifinfo} begins segments of text that should be ignored by +@TeX{} when it typesets the printed manual, and by @command{makeinfo} +when not producing Info output. The segment of text appears only in +the Info file and, for historical compatibility, the plain text +output. -@findex iftex +@findex ifdocbook @findex ifhtml @findex ifplaintext -The @code{@@iftex} and @code{@@end iftex} commands are analogous to the -@code{@@ifinfo} and @code{@@end ifinfo} commands; they specify text that -will appear in the printed manual but not in the Info file. Likewise -for @code{@@ifhtml} and @code{@@end ifhtml}, which specify text to -appear only in HTML output. And for @code{@@ifplaintext} and -@code{@@end ifplaintext}, which specify text to appear only in plain -text output. +@findex iftex +@findex ifxml +The environments for the other formats are analogous: -For example, +@table @code +@item @@ifdocbook @dots{} @@end ifdocbook +Text to appear only in the Docbook output. + +@item @@ifhtml @dots{} @@end ifhtml +Text to appear only in the HTML output. + +@item @@ifplaintext @dots{} @@end ifplaintext +Text to appear only in the plain text output. + +@item @@iftex @dots{} @@end iftex +Text to appear only in the printed manual. + +@item @@ifxml @dots{} @@end ifxml +Text to appear only in the XML output. +@end table + +The @code{@@if@dots{}} and @code{@@end if@dots{}} commands must appear +on lines by themselves in your source file. + +Here is an example showing all these conditionals: @example @@iftex This text will appear only in the printed manual. @@end iftex @@ifinfo -However, this text will appear only in Info (or plain text). +However, this text will appear only in Info and plain text. @@end ifinfo @@ifhtml And this text will only appear in HTML. @@ -11859,15 +12599,22 @@ And this text will only appear in HTML. @@ifplaintext Whereas this text will only appear in plain text. @@end ifplaintext +@@ifxml +Notwithstanding that this will only appear in XML. +@@end ifxml +@@ifdocbook +Nevertheless, this will only appear in Docbook. +@@end ifdocbook @end example @noindent The preceding example produces the following line: + @iftex This text will appear only in the printed manual. @end iftex @ifinfo -However, this text will appear only in Info (or plain text). +However, this text will appear only in Info and plain text. @end ifinfo @ifhtml And this text will only appear in HTML. @@ -11875,6 +12622,12 @@ And this text will only appear in HTML. @ifplaintext Whereas this text will only appear in plain text. @end ifplaintext +@ifxml +Notwithstanding that this will only appear in XML. +@end ifxml +@ifdocbook +Nevertheless, this will only appear in Docbook. +@end ifdocbook @noindent Notice that you only see one of the input lines, depending on which @@ -11883,36 +12636,43 @@ version of the manual you are reading. @node Conditional Not Commands @section Conditional Not Commands +@findex ifnotdocbook @findex ifnothtml @findex ifnotinfo @findex ifnotplaintext @findex ifnottex +@findex ifnotxml You can specify text to be included in any output format @emph{other} -than some given one with the @code{@@ifnot@dots{}} commands: +than a given one with the @code{@@ifnot@dots{}} environments: + @example +@@ifnotdocbook @dots{} @@end ifnotdocbook @@ifnothtml @dots{} @@end ifnothtml @@ifnotinfo @dots{} @@end ifnotinfo @@ifnotplaintext @dots{} @@end ifnotplaintext @@ifnottex @dots{} @@end ifnottex +@@ifnotxml @dots{} @@end ifnotxml @end example + @noindent -(The @code{@@ifnot@dots{}} command and the @code{@@end} command must -appear on lines by themselves in your actual source file.) +The @code{@@ifnot@dots{}} command and the @code{@@end} command must +appear on lines by themselves in your actual source file. + +If the output file is being made in the given format, the +region is @emph{ignored}. Otherwise, it is included. -If the output file is @emph{not} being made for the given format, the -region is included. Otherwise, it is ignored. +There is one exception (for historical compatibility): +@code{@@ifnotinfo} text is omitted for both Info and plain text +output, not just Info. To specify text which appears only in Info and +not in plain text, use @code{@@ifnotplaintext}, like this: -With one exception (for historical compatibility): @code{@@ifnotinfo} -text is omitted for both Info and plain text output, not just Info. To -specify text which appears only in Info and not in plain text, use -@code{@@ifnotplaintext}, like this: @example -@ifinfo -@ifnotplaintext +@@ifinfo +@@ifnotplaintext This will be in Info, but not plain text. -@end ifnotplaintext -@end ifinfo +@@end ifnotplaintext +@@end ifinfo @end example The regions delimited by these commands are ordinary Texinfo source as @@ -11922,46 +12682,53 @@ with @code{@@iftex}, not raw formatter source as with @code{@@tex} @node Raw Formatter Commands @section Raw Formatter Commands -@cindex @TeX{} commands, using ordinary -@cindex HTML commands, using ordinary @cindex Raw formatter commands +@cindex @TeX{} commands, using ordinary @cindex Ordinary @TeX{} commands, using -@cindex Ordinary HTML commands, using @cindex Commands using raw @TeX{} -@cindex Commands using raw HTML -@cindex plain @TeX{} - -Inside a region delineated by @code{@@iftex} and @code{@@end iftex}, you -can embed some raw @TeX{} commands. Info will ignore these commands -since they are only in that part of the file which is seen by @TeX{}. -You can write the @TeX{} commands as you would write them in a normal -@TeX{} file, except that you must replace the @samp{\} used by @TeX{} -with an @samp{@@}. For example, in the @code{@@titlepage} section of a +@cindex Docbook, including raw +@cindex HTML, including raw +@cindex XML, including raw +@cindex Plain @TeX{} + +Inside a region delineated by @code{@@iftex} and @code{@@end iftex}, +you can embed some raw @TeX{} commands. The Texinfo processors will +ignore such a region unless @TeX{} output is being produced. You can +write the @TeX{} commands as you would write them in a normal @TeX{} +file, except that you must replace the @samp{\} used by @TeX{} with an +@samp{@@}. For example, in the @code{@@titlepage} section of a Texinfo file, you can use the @TeX{} command @code{@@vskip} to format the copyright page. (The @code{@@titlepage} command causes Info to ignore the region automatically, as it does with the @code{@@iftex} command.) -However, many features of plain @TeX{} will not work, as they are -overridden by Texinfo features. +However, most features of plain @TeX{} will not work within +@code{@@iftex}, as they are overridden by Texinfo features. The +purpose of @code{@@iftex} is to provide conditional processing for the +Texinfo source, not provide access to underlying formatting features. @findex tex You can enter plain @TeX{} completely, and use @samp{\} in the @TeX{} commands, by delineating a region with the @code{@@tex} and @code{@@end -tex} commands. (The @code{@@tex} command also causes Info to ignore the -region, like the @code{@@iftex} command.) The sole exception is that the +tex} commands. All plain @TeX{} commands and category codes are +restored within an @code{@@tex} region. The sole exception is that the @code{@@} character still introduces a command, so that @code{@@end tex} -can be recognized properly. +can be recognized properly. As with @code{@@iftex}, Texinfo +processors will ignore such a region unless @TeX{} output is being produced. + +@findex \gdef @r{within @code{@@tex}} +In complex cases, you may wish to define new @TeX{} macros within +@code{@@tex}. You must use @code{\gdef} to do this, not @code{\def}, +because @code{@@tex} regions are processed in a @TeX{} group. @cindex Mathematical expressions -For example, here is a mathematical expression written in -plain @TeX{}: +As an example, here is a mathematical expression written in plain @TeX{}: @example @@tex $$ \chi^2 = \sum_@{i=1@}^N - \left (y_i - (a + b x_i) - \over \sigma_i\right)^2 $$ + \left (y_i - (a + b x_i) + \over \sigma_i\right)^2 $$ @@end tex @end example @@ -11976,17 +12743,31 @@ this: @tex $$ \chi^2 = \sum_{i=1}^N - \left(y_i - (a + b x_i) - \over \sigma_i\right)^2 $$ + \left(y_i - (a + b x_i) + \over \sigma_i\right)^2 $$ @end tex @findex ifhtml @findex html Analogously, you can use @code{@@ifhtml @dots{} @@end ifhtml} to delimit a region to be included in HTML output only, and @code{@@html @dots{} -@@end html} for a region of raw HTML (again, except that @code{@@} is -still the escape character, so the @code{@@end} command can be -recognized.) +@@end html} for a region of raw HTML. + +@findex ifxml +@findex xml +Likewise, you can use @code{@@ifxml @dots{} @@end ifxml} to delimit +a region to be included in XML output only, and @code{@@xml @dots{} +@@end xml} for a region of raw XML. + +@findex ifdocbook +@findex docbook +Again likewise, you can use @code{@@ifdocbook @dots{} @@end ifdocbook} +to delimit a region to be included in Docbook output only, and +@code{@@docbook @dots{} @@end docbook} for a region of raw Docbook. + +In all cases, the exception to the raw processing is that @code{@@} is +still an escape character, so the @code{@@end} command can be +recognized. @node set clear value @@ -11994,9 +12775,10 @@ recognized.) You can direct the Texinfo formatting commands to format or ignore parts of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset}, -and @code{@@ifclear} commands.@refill +and @code{@@ifclear} commands. -Brief descriptions: +Here are brief descriptions of these commands, see the following +sections for more details: @table @code @item @@set @var{flag} [@var{value}] @@ -12027,12 +12809,13 @@ is ignored. If @var{flag} is clear, text through the following @subsection @code{@@set} and @code{@@value} @findex value -You use the @code{@@set} command to specify a value for a flag, which is -later expanded by the @code{@@value} command. +You use the @code{@@set} command to specify a value for a flag, which +is later expanded by the @code{@@value} command. -A @dfn{flag} is an identifier. In general, it is best to use only -letters and numerals in a flag name, not @samp{-} or @samp{_}---they -will work in some contexts, but not all, due to limitations in @TeX{}. +A @dfn{flag} (aka @dfn{variable}) is an identifier. It is best to use +only letters and numerals in a flag name, not @samp{-} or +@samp{_}---they will work in some contexts, but not all, due to +limitations in @TeX{}. The value is the remainder of the input line, and can contain anything. @@ -12072,10 +12855,10 @@ without specifying a string, the value of @code{foo} is the empty string. If you clear a previously set flag with @code{@@clear @var{flag}}, a subsequent @code{@@value@{flag@}} command will report an error. -For example, if you set @code{foo} as follows:@refill +For example, if you set @code{foo} as follows: @example -@@set how-much very, very, very +@@set howmuch very, very, very @end example @noindent @@ -12083,7 +12866,7 @@ then the formatters transform @example @group -It is a @@value@{how-much@} wet day. +It is a @@value@{howmuch@} wet day. @exdent @r{into} It is a very, very, very wet day. @end group @@ -12092,7 +12875,7 @@ It is a very, very, very wet day. If you write @example -@@clear how-much +@@clear howmuch @end example @noindent @@ -12100,9 +12883,9 @@ then the formatters transform @example @group -It is a @@value@{how-much@} wet day. +It is a @@value@{howmuch@} wet day. @exdent @r{into} -It is a @{No value for "how-much"@} wet day. +It is a @{No value for "howmuch"@} wet day. @end group @end example @@ -12131,7 +12914,7 @@ and @code{@@end ifset} commands, like this: For example, you can create one document that has two variants, such as a manual for a `large' and `small' model: -@cindex shrubbery +@cindex Shrubbery @example You can use this machine to dig up shrubs without hurting them. @@ -12181,13 +12964,13 @@ command looks like this: @node value Example @subsection @code{@@value} Example -You can use the @code{@@value} command to minimize the number of places -you need to change when you record an update to a manual. @xref{GNU -Sample Texts}, for an example of this same principle can work with -Automake distributions, and full texts. +You can use the @code{@@value} command to minimize the number of +places you need to change when you record an update to a manual. +@xref{GNU Sample Texts}, for the full text of an example of using this +to work with Automake distributions. -Here is an example adapted from @ref{Top,, Overview, make, The GNU Make -Manual}): +This example is adapted from @ref{Top,, Overview, make, The GNU Make +Manual}. @enumerate @item @@ -12271,6 +13054,53 @@ When you update the manual, you change only the values of the flags; you do not need to edit the three sections. +@node Conditional Nesting +@section Conditional Nesting +@cindex Conditionals, nested +@cindex Nesting conditionals + +Conditionals can be nested; however, the details are a little tricky. +The difficulty comes with failing conditionals, such as +@code{@@ifhtml} when HTML is not being produced, where the included +text is to be ignored. However, it is not to be @emph{completely} +ignored, since it is useful to have one @code{@@ifset} inside another, +for example---that is a way to include text only if two conditions are +met. Here's an example: + +@example +@@ifset somevar +@@ifset anothervar +Both somevar and anothervar are set. +@@end ifset +@@ifclear anothervar +Somevar is set, anothervar is not. +@@end ifclear +@@end ifset +@end example + +Technically, Texinfo requires that for a failing conditional, the +ignored text must be properly nested with respect to that failing +conditional. Unfortunately, it's not always feasible to check that +@emph{all} conditionals are properly nested, because then the +processors could have to fully interpret the ignored text, which +defeats the purpose of the command. Here's an example illustrating +these rules: + +@example +@@ifset a +@@ifset b +@@ifclear ok - ok, ignored +@@end junky - ok, ignored +@@end ifset +@@c WRONG - missing @@end ifset. +@end example + +Finally, as mentioned above, all conditional commands must be on lines +by themselves, with no text (even spaces) before or after. Otherwise, +the processors cannot reliably determine which commands to consider +for nesting purposes. + + @node Internationalization @chapter Internationalization @@ -12512,23 +13342,64 @@ Hereare the valid language codes, from ISO-639. @findex documentencoding @cindex Encoding, declaring @cindex Input encoding, declaring +@cindex Character set, declaring @cindex Document input encoding The @code{@@documentencoding} command declares the input document encoding. Write it on a line by itself, with a valid encoding -specification following, such as @samp{ISO-8859-1}. +specification following. + +At present, Texinfo supports only these encodings: + +@table @code +@item US-ASCII +This has no particular effect, but it's included for completeness. + +@itemx ISO-8859-1 +@itemx ISO-8859-15 +@item ISO-8859-2 +These specify the standard encodings for Western European (the first +two) and Eastern European languages (the third), respectively. ISO +8859-15 replaces some little-used characters from 8859-1 (e.g., +precomposed fractions) with more commonly needed ones, such as the +Euro symbol. + +A full description of the encodings is beyond our scope here; +one useful reference is @uref{http://czyborra.com/charsets/iso8859.html}. +@end table -@cindex http-equiv, and charset -@cindex meta HTML tag, and charset -At present, this is used only in HTML output from @code{makeinfo}. If a -document encoding @var{enc} is specified, it is used in a -@samp{<meta>} tag included in the @samp{<head>} of the output: +Specifying an encoding @var{enc} has the following effects: + +@opindex --enable-encoding +@cindex Local Variables: section, for encoding +@cindex Info output, and encoding +In Info output, if the option @option{--enable-encoding} is given +to @command{makeinfo}, a so-called `Local Variables' section +(@pxref{File Variables,,,emacs,The GNU Emacs Manual}) is output +including @var{enc}. This allows Info readers to set the encoding +appropriately. + +@example +Local Variables: +coding: @var{enc} +End: +@end example + +@cindex HTML output, and encodings +@cindex @code{http-equiv}, and charset specification +@cindex @code{<meta>} HTML tag, and charset specification +In HTML output, a @samp{<meta>} tag is output, in the @samp{<head>} +section of the HTML, that specifies @var{enc}. Web servers and +browsers cooperate to use this information so the correct encoding is +used to display the page, if supported by the system. @example <meta http-equiv="Content-Type" content="text/html; - charset=@var{enc}"> + charset=@var{enc}"> @end example +In all other cases, it is recognized but ignored. + @node Defining New Texinfo Commands @chapter Defining New Texinfo Commands @@ -12564,7 +13435,7 @@ customized output in the Info file. @menu * Defining Macros:: Defining and undefining new commands. * Invoking Macros:: Using a macro, once you've defined it. -* Macro Details:: Beyond basic macro usage. +* Macro Details:: Limitations of Texinfo macros. * alias:: Command aliases. * definfoenclose:: Customized highlighting. @end menu @@ -12588,8 +13459,15 @@ The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to arguments supplied when the macro is subsequently used in the document (described in the next section). -For a macro to work with @TeX{}, @var{macroname} must consist entirely -of letters: no digits, hyphens, underscores, or other special characters. +@cindex Macro names, valid characters in +@cindex Names of macros, valid characters of +For a macro to work consistently with @TeX{}, @var{macroname} must +consist entirely of letters: no digits, hyphens, underscores, or other +special characters. So, we recommend using only letters. However, +@command{makeinfo} will accept anything except @samp{@{@}_^=}; +@samp{_} and @samp{^} are excluded so that macros can be called in +@code{@@math} mode without a following space +(@pxref{math,,@code{@@math}}). If a macro needs no parameters, you can define it either with an empty list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro @@ -12750,31 +13628,91 @@ Twice: a,b & a,b. @node Macro Details -@section Macro Details +@section Macro Details and Caveats @cindex Macro details @cindex Details of macro usage +@cindex Caveats for macro usage -Due to unavoidable disparities in the @TeX{} and @command{makeinfo} -implementations, Texinfo macros have the following limitations. +Due to unavoidable limitations, certain macro-related constructs cause +problems with @TeX{}. If you get macro-related errors when producing +the printed version of a manual, try expanding the macros with +@command{makeinfo} by invoking @command{texi2dvi} with the @samp{-E} +option (@pxref{Format with texi2dvi}). @itemize @bullet @item -All macros are expanded inside at least one @TeX{} group. This means -that @code{@@set} and other such commands will have no effect inside a -macro. +As mentioned earlier, macro names must consist entirely of letters. + +@item +It is not advisable to redefine any @TeX{} primitive, plain, or +Texinfo command name as a macro. Unfortunately this is a very large +set of names, and the possible resulting errors are unpredictable. @item -Macros containing a command which must be on a line by itself, such as a -conditional, cannot be invoked in the middle of a line. +All macros are expanded inside at least one @TeX{} group. This means +that @code{@@set} and other such commands have no effect inside a +macro. @item Commas in macro arguments, even if escaped by a backslash, don't always work. @item -The @TeX{} implementation cannot construct macros that define macros in -the natural way. To do this, you must use conditionals and raw @TeX{}. -For example: +Macro arguments cannot cross lines. + +@item +It is (usually) best to avoid comments inside macro definitions, but +see the next item. + +@item +Macros containing a command which must be on a line by itself, such as +a conditional, cannot be invoked in the middle of a line. In general, +the interaction of newlines in the macro definitions and invocations +depends on the precise commands and context. You may be able to work +around some problems with judicious use of @code{@@c}. Suppose you +define a macro that is always intended to be used on a line by itself: + +@example +@@macro linemac +@@cindex whatever +@@c +@@end macro +... +foo +@@linemac +bar +@end example + +Without the @code{@@c}, there will be an unwanted blank line between +the @samp{@@cindex whatever} and the @samp{bar} (one newline comes +from the macro definition, one from after the invocation), causing a +paragraph break. + +On the other hand, you wouldn't want the @code{@@c} if the macro was +sometimes invoked in the middle of a line (the text after the +invocation would be treated as a comment). + +@item +In general, you can't arbitrarily substitute a macro call for Texinfo +command arguments, even when the text is the same. It might work with +some commands, it fails with others. Best not to do it at all. For +instance, this fails: + +@example +@@macro offmacro +off +@@end macro +@@headings @@offmacro +@end example + +@noindent +You would expect this to be equivalent to @code{@@headings off}, but +for @TeX{}nical reasons, it fails with a mysterious error message +(@code{Paragraph ended before @@headings was complete}). + +@item +Macros cannot define macros in the natural way. To do this, you must +use conditionals and raw @TeX{}. For example: @example @@ifnottex @@ -12790,15 +13728,35 @@ something involving \arg\ somehow @@end tex @end example +@end itemize + +The @command{makeinfo} implementation also has limitations: + +@itemize @item -It is best to avoid comments inside macro definitions. +@code{@@verbatim} and macros do not mix; for instance, you can't start +a verbatim block inside a macro and end it outside. +(@xref{verbatim}.) Starting any environment inside a macro and ending +it outside may or may not work, for that matter. + +@item +Macros that completely define macros are ok, but it's not possible to +have incorrectly nested macro definitions. That is, @code{@@macro} +and @code{@@end macro} (likewise for @code{@@rmacro}) must be +correctly paired. For example, you cannot start a macro definition +within a macro, and then end the nested definition outside the macro. + +@item +@code{@@rmacro} is a kludge. @end itemize -If some macro feature causes errors when producing the printed version -of a manual, try expanding the macros with @command{makeinfo} by -invoking @command{texi2dvi} with the @samp{-e} option; see @ref{Format -with texi2dvi}. +One more limitation is common to both implementations: white space is +ignored at the beginnings of lines. + +Future major revisions of Texinfo may ease some of these limitations +(by introducing a new macro syntax). + @node alias @section @samp{@@alias @var{new}=@var{existing}} @@ -12828,12 +13786,18 @@ You'd do this as follows: @@alias moviecite = cite @end example -Macros do not always have the same effect due to vagaries of argument -parsing. Also, aliases are much simpler to define than macros. So the -command is not redundant. (It was also heavily used in the Jargon File!) +Macros do not always have the same effect as aliases, due to vagaries +of argument parsing. Also, aliases are much simpler to define than +macros. So the command is not redundant. (It was also heavily used +in the Jargon File!) Aliases must not be recursive, directly or indirectly. +It is not advisable to redefine any @TeX{} primitive, plain, or +Texinfo command name as an alias. Unfortunately this is a very large +set of names, and the possible resulting errors are completely random. + + @node definfoenclose @section @samp{definfoenclose}: Customized Highlighting @cindex Highlighting, customized @@ -12845,7 +13809,7 @@ command for Info, but not for @TeX{}. A command defined using @code{@@definfoenclose} marks text by enclosing it in strings that precede and follow the text. You can use this to get closer control of your Info output. - + Presumably, if you define a command with @code{@@definfoenclose} for Info, you will create a corresponding command for @TeX{}, either in @file{texinfo.tex}, @file{texinfo.cnf}, or within an @samp{@@iftex} in @@ -12866,7 +13830,7 @@ you intended as the start delimiter string. If you do a @code{@@definfoenclose} on the name of a pre-defined macro (such as @code{@@emph}, @code{@@strong}, @code{@@t}, or @code{@@i}), the enclosure definition will override the built-in definition. - + An enclosure command defined this way takes one argument in braces; this is intended for new markup commands (@pxref{Marking Text}). @@ -12883,7 +13847,7 @@ formatting command that inserts `//' before and `\\' after the argument to @code{@@phoo}. You can then write @code{@@phoo@{bar@}} wherever you want `//bar\\' highlighted in Info. -Also, for @TeX{} formatting, you could write +Also, for @TeX{} formatting, you could write @example @@iftex @@ -12954,9 +13918,10 @@ print queue, and delete a job from the print queue. * smallbook:: How to print small format books and manuals. * A4 Paper:: How to print on A4 or A5 paper. * pagesizes:: How to print with customized page sizes. -* Cropmarks and Magnification:: How to print marks to indicate the size - of pages and how to print scaled up output. +* Cropmarks and Magnification:: How to print marks to indicate the size + of pages and how to print scaled up output. * PDF Output:: Portable Document Format output. +* Obtaining TeX:: How to Obtain @TeX{}. @end menu @node Use TeX @@ -12980,8 +13945,8 @@ File}). @cindex Formatting with @code{tex} and @code{texindex} @cindex DVI file -Format the Texinfo file with the shell command @code{tex} followed by -the name of the Texinfo file. For example: +You can format the Texinfo file with the shell command @code{tex} +followed by the name of the Texinfo file. For example: @example tex foo.texi @@ -12994,13 +13959,12 @@ any device (see the following sections). @pindex texindex The @code{tex} formatting command itself does not sort the indices; it -writes an output file of unsorted index data. (The @code{texi2dvi} -command automatically generates indices; @pxref{Format with texi2dvi,, -Format with @code{texi2dvi}}.) To generate a printed index after -running the @code{tex} command, you first need a sorted index to work -from. The @code{texindex} command sorts indices. (The source file -@file{texindex.c} comes as part of the standard Texinfo distribution, -among other places.)@refill +writes an output file of unsorted index data. To generate a printed +index after running the @command{tex} command, you first need a sorted +index to work from. The @command{texindex} command sorts indices. +(The source file @file{texindex.c} comes as part of the standard +Texinfo distribution, among other places.) (@command{texi2dvi} runs +@command{tex} and @command{texindex} as necessary.) @cindex Names of index files @cindex Index file names @@ -13038,9 +14002,9 @@ whose name is made by appending @samp{s} to the input file name. The (@pxref{Printing Indices & Menus}). @code{texindex} does not alter the raw index output file. -After you have sorted the indices, you need to rerun the @code{tex} -formatting command on the Texinfo file. This regenerates the DVI file, -this time with up-to-date index entries. +After you have sorted the indices, you need to rerun @code{tex} on the +Texinfo file. This regenerates the DVI file, this time with +up-to-date index entries. Finally, you may need to run @code{tex} one more time, to get the page numbers in the cross-references correct. @@ -13108,9 +14072,10 @@ your file would look approximately like this: @section Format with @code{texi2dvi} @pindex texi2dvi @r{(shell script)} -The @code{texi2dvi} command automatically runs both @code{tex} and -@code{texindex} as many times as necessary to produce a DVI file with -sorted indices and all cross-references resolved. It simplifies the +The @code{texi2dvi} command automatically runs both @TeX{} and +@command{texindex} as many times as necessary to produce a DVI file +with sorted indices and all cross-references resolved. It is +therefore simpler than manually executing the @code{tex}---@code{texindex}---@code{tex}---@code{tex} sequence described in the previous section. @@ -13128,7 +14093,7 @@ texi2dvi foo.texi} instead of relying on the operating system to invoke the shell on the @samp{texi2dvi} script. Perhaps the most useful option to @code{texi2dvi} is -@samp{--texinfo=@var{cmd}}. This inserts @var{cmd} on a line by itself +@samp{--command=@var{cmd}}. This inserts @var{cmd} on a line by itself after the @code{@@setfilename} in a temporary copy of the input file before running @TeX{}. With this, you can specify different printing formats, such as @code{@@smallbook} (@pxref{smallbook}), @@ -13137,6 +14102,21 @@ formats, such as @code{@@smallbook} (@pxref{smallbook}), (You can also do this on a site-wide basis with @file{texinfo.cnf}; @pxref{Preparing for TeX,,Preparing for @TeX{}}). +With the @option{--pdf} option, @command{texi2dvi} produces PDF output +instead of DVI (@pxref{PDF Output}), by running @command{pdftex} +instead of @command{tex}. Alternatively, the command +@command{texi2pdf} is an abbreviation for running @samp{texi2dvi --pdf}. + +@cindex @LaTeX{}, processing with @command{texi2dvi} +@command{texi2dvi} can also be used to process @LaTeX{} files; simply +run @samp{texi2dvi filename.ext}. + +@command{texi2dvi} will use @command{etex} (or @command{pdfetex}) if +they are available; these extended versions of @TeX{} are not +required, and the DVI (or PDF) output is identical, but they simplify +the @TeX{} programming in some cases, and provide additional tracing +information when debugging @file{texinfo.tex}. + For a list of other options, run @samp{texi2dvi --help}. @@ -13146,7 +14126,7 @@ For a list of other options, run @samp{texi2dvi --help}. The precise command to print a DVI file depends on your system installation. Two common ones are @samp{dvips foo.dvi -o} and @samp{lpr --d foo.dvi}. +-d foo.dvi}. For example, the following commands will (perhaps) suffice to sort the indices, format, and print the @cite{Bison Manual}: @@ -13201,7 +14181,7 @@ lpr -Qdvi -hprint.server.domain bison.dvi @end example @item Convert the DVI file to a Postscript or PCL file and send it to your -local printer. @xref{dvips invocation,,, dvips, Dvips}, and the man +local printer. @xref{Invoking Dvips,,, dvips, Dvips}, and the man pages for @code{dvilj}, for detailed description of these tools. Once the DVI file is converted to the format your local printer understands directly, just send it to the appropriate port, usually @samp{PRN}. @@ -13235,14 +14215,12 @@ texi2dvi gcc.texinfo lpr -d gcc.dvi @end group @end example -@ifinfo -@xref{Texinfo Mode Printing}, for more information about formatting -and printing in Texinfo mode.@refill -@end ifinfo +See the next section for more information about formatting +and printing in Texinfo mode. -@node Texinfo Mode Printing, Compile-Command, Within Emacs, Hardcopy +@node Texinfo Mode Printing @section Formatting and Printing in Texinfo Mode @cindex Region printing in Texinfo mode @cindex Format and print in Texinfo mode @@ -13328,7 +14306,7 @@ The default values are:@refill @example @group - @r{Variable} @r{Default value} + @r{Variable} @r{Default value} texinfo-texi2dvi-command "texi2dvi" texinfo-tex-command "tex" @@ -13343,11 +14321,10 @@ tex-show-queue-command "lpq" @end example You can change the values of these variables with the @kbd{M-x -edit-options} command (@pxref{Edit Options, , Editing Variable Values, -emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command -(@pxref{Examining, , Examining and Setting Variables, emacs, The GNU -Emacs Manual}), or with your @file{.emacs} initialization file -(@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill +set-variable} command (@pxref{Examining, , Examining and Setting +Variables, emacs, The GNU Emacs Manual}), or with your @file{.emacs} +initialization file (@pxref{Init File, , , emacs, The GNU Emacs +Manual}). @cindex Customize Emacs package (@t{Development/Docs/Texinfo}) Beginning with version 20, GNU Emacs offers a user-friendly interface, @@ -13421,13 +14398,14 @@ command, a title page, a copyright page, and permissions. Besides an contents. (And of course most manuals contain a body of text as well.) For more information, see: + @itemize @bullet -@item @ref{settitle, , @code{@@settitle}} -@item @ref{setchapternewpage, , @code{@@setchapternewpage}} -@item @ref{Headings, ,Page Headings} -@item @ref{Titlepage & Copyright Page} -@item @ref{Printing Indices & Menus} -@item @ref{Contents} +@item @ref{settitle, , @code{@@settitle}}. +@item @ref{setchapternewpage, , @code{@@setchapternewpage}}. +@item @ref{Headings, ,Page Headings}. +@item @ref{Titlepage & Copyright Page}. +@item @ref{Printing Indices & Menus}. +@item @ref{Contents}. @end itemize @@ -13435,8 +14413,6 @@ For more information, see: @section Preparing for @TeX{} @cindex Preparing for @TeX{} @cindex @TeX{} input initialization -@cindex @code{TEXINPUTS} environment variable -@vindex TEXINPUTS @cindex @b{.profile} initialization file @cindex @b{.cshrc} initialization file @cindex Initialization file for @TeX{} input @@ -13444,7 +14420,11 @@ For more information, see: @TeX{} needs to know where to find the @file{texinfo.tex} file that the @samp{\input texinfo} command on the first line reads. The @file{texinfo.tex} file tells @TeX{} how to handle @@-commands; it is -included in all standard GNU distributions. +included in all standard GNU distributions. The latest version is +always available from the Texinfo source repository: +@smalldisplay +@uref{http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/doc/texinfo.tex?rev=HEAD} +@end smalldisplay @pindex texinfo.tex@r{, installing} @@ -13477,6 +14457,7 @@ example, if @file{texinfo.cnf} contains the line @samp{@@afourpaper} that page size in effect. If you have nothing to put in @file{texinfo.cnf}, you do not need to create it. +@cindex Environment variable @code{TEXINPUTS} @vindex TEXINPUTS If neither of the above locations for these system files suffice for you, you can specify the directories explicitly. For @@ -13496,7 +14477,7 @@ In a @file{.cshrc} file, you could use the following @code{csh} command sequence: @example -setenv TEXINPUTS .:/home/me/mylib:/usr/lib/tex/macros +setenv TEXINPUTS .:/home/me/mylib: @end example @need 1000 @@ -13505,7 +14486,7 @@ sequence: @example @group -TEXINPUTS=.:/home/me/mylib:/usr/lib/tex/macros +TEXINPUTS=.:/home/me/mylib: export TEXINPUTS @end group @end example @@ -13516,19 +14497,20 @@ on these systems.}: @example @group -set TEXINPUTS=.;d:/home/me/mylib;c:/usr/lib/tex/macros +set TEXINPUTS=.;d:/home/me/mylib;c: @end group @end example @noindent It is customary for DOS/Windows users to put such commands in the -@file{autoexec.bat} file, or in the Windows Registry.@refill +@file{autoexec.bat} file, or in the Windows Registry. @noindent These settings would cause @TeX{} to look for @file{\input} file first in the current directory, indicated by the @samp{.}, then in a -hypothetical user's @file{me/mylib} directory, and finally in a system -directory @file{/usr/lib/tex/macros}. +hypothetical user @samp{me}'s @file{mylib} directory, and finally in +the system directories. (A leading, trailing, or doubled @samp{:} +indicates searching the system directories at that point.) @cindex Dumping a .fmt file @cindex Format file, dumping @@ -13638,7 +14620,8 @@ file, before the title page:@refill @noindent (Since many books are about 7 by 9.25 inches, this command might better have been called the @code{@@regularbooksize} command, but it came to be -called the @code{@@smallbook} command by comparison to the 8.5 by 11 inch format.) +called the @code{@@smallbook} command by comparison to the 8.5 by 11 +inch format.) If you write the @code{@@smallbook} command between the start-of-header and end-of-header lines, the Texinfo mode @TeX{} @@ -13689,7 +14672,7 @@ You may or may not prefer the formatting that results from the command wide format. @node pagesizes -@section @code{@@pagesizes} [@var{width}][, @var{height}]: Custom page sizes +@section @code{@@pagesizes} [@var{width}][, @var{height}]: Custom Page Sizes @findex pagesizes @cindex Custom page sizes @cindex Page sizes, customized @@ -13798,28 +14781,83 @@ magnifications. Be prepared to experiment. @cindex PDF output @pindex pdftex -You can generate a PDF output file from Texinfo source by using the -@command{pdftex} program to process your file instead of plain -@command{tex}. Just run @samp{pdftex foo.texi} instead of @samp{tex -foo.texi}, or give the @samp{--pdf} option to @command{texi2dvi}. +The simplest way to generate PDF output from Texinfo source is to run +the convenience script @command{texi2pdf}; this simply executes the +@command{texi2dvi} script with the @option{--pdf} option +(@pxref{Format with texi2dvi}). If for some reason you want to +process by hand, simply run the @command{pdftex} program instead of +plain @command{tex}. That is, run @samp{pdftex foo.texi} instead of +@samp{tex foo.texi}. @dfn{PDF} stands for `Portable Document Format'. It was invented by Adobe Systems some years ago for document interchange, based on their -PostScript language. A @uref{http://www.foolabs.com/xpdf/, PDF reader} -for the X window system is freely available, as is the -@uref{http://partners.adobe.com/asn/developer/technotes/, definition of -the file format}. Since PDF is a binary format, there are no -@samp{@@ifpdf} or @samp{@@pdf} commands as with the other output -formats. +PostScript language. Related links: + +@itemize +@item +GNU GV, a @uref{http://www.foolabs.com/xpdf/, Ghostscript-based PDF +reader}. (It can also preview PostScript documents.) + +@item +A freely available standalone @uref{http://www.foolabs.com/xpdf/, +PDF reader} for the X window system. + +@item +@uref{http://partners.adobe.com/asn/acrobat/sdk/public/docs/, PDF definition}. + +@end itemize + +At present, Texinfo does not provide +@samp{@@ifpdf} or @samp{@@pdf} commands as for the other output +formats, since PDF documents contain many internal links that would be +hard or impossible to get right at the Texinfo source level. + +PDF files require special software to be displayed, unlike the plain +ASCII formats (Info, HTML) that Texinfo supports. They also tend to +be much larger than the DVI files output by @TeX{} by default. +Nevertheless, a PDF file does define an actual typeset document in a +self-contained file, so it has its place. -Despite the `portable' in the name, PDF files are nowhere near as -portable in practice as the plain ASCII formats (Info, HTML) that -Texinfo supports (DVI portability is arguable). They also tend to be -much larger and do not support the bitmap fonts used by @TeX{} (by -default) very well. Nevertheless, a PDF file does preserve an actual -printed document on a screen as faithfully as possible, so it has its place. -PDF support in Texinfo is fairly rudimentary. +@node Obtaining TeX +@section How to Obtain @TeX{} +@cindex Obtaining @TeX{} +@cindex @TeX{}, how to obtain + +@c !!! Here is information about obtaining TeX. Update it whenever. +@c !!! Also consider updating TeX.README on ftp.gnu.org. +@c Updated by RJC on 1 March 1995, conversation with MacKay. +@c Updated by kb@cs.umb.edu on 29 July 1996. +@c Updated by kb@cs.umb.edu on 25 April 1997. +@c Updated by kb@cs.umb.edu on 27 February 1998. +@TeX{} is freely redistributable. You can obtain @TeX{} for Unix +systems via anonymous ftp or on physical media. The core material +consists of the Web2c @TeX{} distribution (@uref{http://tug.org/web2c}). + +Instructions for retrieval by anonymous ftp and information on other +available distributions: +@uref{http://tug.org/unixtex.ftp}. + +The Free Software Foundation provides a core distribution on its Source +Code CD-ROM suitable for printing Texinfo manuals. To order it, contact: + +@display +@group +Free Software Foundation, Inc. +59 Temple Place Suite 330 +Boston, MA @ @ 02111-1307 +USA +Telephone: @w{+1-617-542-5942} +Fax: (including Japan) @w{+1-617-542-2652} +Free Dial Fax (in Japan): +@w{ } @w{ } @w{ } 0031-13-2473 (KDD) +@w{ } @w{ } @w{ } 0066-3382-0158 (IDC) +Electronic mail: @code{gnu@@gnu.org} +@end group +@end display + +Many other @TeX{} distributions are available; see +@uref{http://tug.org/}. @node Creating and Installing Info Files @@ -13829,8 +14867,8 @@ This chapter describes how to create and install Info files. @xref{Info Files}, for general information about the file format itself. @menu -* Creating an Info File:: -* Installing an Info File:: +* Creating an Info File:: +* Installing an Info File:: @end menu @@ -13855,12 +14893,11 @@ For information on installing the Info file in the Info system, * Pointer Validation:: How to check that pointers point somewhere. * makeinfo in Emacs:: How to run @code{makeinfo} from Emacs. * texinfo-format commands:: Two Info formatting commands written - in Emacs Lisp are an alternative - to @code{makeinfo}. + in Emacs Lisp are an alternative + to @code{makeinfo}. * Batch Formatting:: How to format for Info in Emacs Batch mode. * Tag and Split Files:: How tagged and split files help Info - to run better. -* makeinfo html:: Generating HTML output. + to run better. @end menu @@ -13876,17 +14913,18 @@ that are too small to run Emacs. You can run @code{makeinfo} in any one of three ways: from an operating system shell, from a shell inside Emacs, or by typing the @kbd{C-c C-m C-r} or the @kbd{C-c C-m C-b} command in Texinfo mode in Emacs. -@refill The @code{texinfo-format-region} and the @code{texinfo-format-buffer} commands are useful if you cannot run @code{makeinfo}. Also, in some circumstances, they format short regions or buffers more quickly than -@code{makeinfo}.@refill +@code{makeinfo}. + @node Invoking makeinfo @subsection Running @code{makeinfo} from a Shell +@pindex makeinfo -To create an Info file from a Texinfo file, type @code{makeinfo} +To create an Info file from a Texinfo file, invoke @command{makeinfo} followed by the name of the Texinfo file. Thus, to create the Info file for Bison, type the following to the shell: @@ -13894,19 +14932,10 @@ file for Bison, type the following to the shell: makeinfo bison.texinfo @end example -(You can run a shell inside Emacs by typing @kbd{M-x shell}.)@refill - -@ifinfo -Sometimes you will want to specify options. For example, if you wish -to discover which version of @code{makeinfo} you are using, -type:@refill - -@example -makeinfo --version -@end example +(You can run a shell inside Emacs by typing @kbd{M-x shell}.) -@xref{makeinfo options}, for more information. -@end ifinfo +@command{makeinfo} has many options to control its actions and output; +see the next section. @node makeinfo options @@ -13914,15 +14943,17 @@ makeinfo --version @cindex @code{makeinfo} options @cindex Options for @code{makeinfo} -The @code{makeinfo} command takes a number of options. Most often, -options are used to set the value of the fill column and specify the -footnote style. Each command line option is a word preceded by -@samp{--} or a letter preceded by @samp{-}. You can use abbreviations -for the long option names as long as they are unique.@refill +The @command{makeinfo} program accepts many options. Perhaps the most +commonly needed are those that change the output format. By default, +@command{makeinfo} outputs Info files. + +Each command line option is a word preceded by @samp{--} or a letter +preceded by @samp{-}. You can use abbreviations for the long option +names as long as they are unique. For example, you could use the following shell command to create an Info file for @file{bison.texinfo} in which each line is filled to only 68 -columns:@refill +columns: @example makeinfo --fill-column=68 bison.texinfo @@ -13936,7 +14967,7 @@ makeinfo --no-split --fill-column=70 @dots{} @noindent This would keep the Info file together as one possibly very long -file and would also set the fill column to 70.@refill +file and would also set the fill column to 70. The options are: @@ -13955,9 +14986,22 @@ can probably never be implemented in @TeX{}. It also makes @samp{--no-validate} is used. @xref{Pointer Validation}, for more details. +@item --css-include=@var{file} +@opindex --css-include +Include the contents of @var{file}, which should contain cascading +style sheets specifications, in the @samp{<style>} block of the HTML +output. @xref{HTML CSS}. If @var{file} is @samp{-}, read standard +input. + @item --docbook @opindex --docbook -Generate DocBook output rather than Info. +Generate Docbook output rather than Info. + +@item --enable-encoding +@opindex --enable-encoding +Output accented and special characters in Info or plain text output +based on @samp{@@documentencoding}. +@xref{documentencoding,,@code{documentencoding}}, and @ref{Inserting Accents}. @item --error-limit=@var{limit} @itemx -e @var{limit} @@ -14006,10 +15050,10 @@ Print a usage message listing all available options, then exit successfully. @item --html @opindex --html -Generate HTML output rather than Info. @xref{makeinfo html}. By -default, the HTML output is split into one output file per source node, -and the split output is written into a subdirectory with the name of the -top-level info file. +Generate HTML output rather than Info. @xref{Generating HTML}. By +default, the HTML output is split into one output file per Texinfo +source node, and the split output is written into a subdirectory with +the name of the top-level info file. @item -I @var{dir} @opindex -I @var{dir} @@ -14021,35 +15065,85 @@ not given, the current directory @file{.} is appended. Note that usual path separator character (@samp{:} on Unix, @samp{;} on MS-DOS/MS-Windows). +@item --ifdocbook +@opindex --ifdocbook +@itemx --ifhtml +@opindex --ifhtml +@itemx --ifinfo +@opindex --ifinfo +@itemx --ifplaintext +@opindex --ifplaintext +@itemx --iftex +@opindex --iftex +@itemx --ifxml +@opindex --ifxml +For the specified format, process @samp{@@if@var{format}} and +@samp{@@@var{format}} commands even if not generating the given output +format. For instance, if @option{--iftex} is specified, then +@samp{@@iftex} and @samp{@@tex} blocks will be read. + @item --macro-expand=@var{file} @itemx -E @var{file} +@opindex --macro-expand=@var{file} +@opindex -E @var{file} Output the Texinfo source with all the macros expanded to the named file. Normally, the results of macro expansion are used internally by @code{makeinfo} and then discarded. This option is used by -@command{texi2dvi} if you are using an old version of @file{texinfo.tex} -that does not support @code{@@macro}. +@command{texi2dvi}. @item --no-headers +@item --plaintext @opindex --no-headers +@opindex --plaintext @cindex Plain text output @cindex ASCII text output @cindex Generating plain text files @cindex @file{INSTALL} file, generating @cindex Node separators, omitting @cindex Menus, omitting -For Info output, do not include menus or node separator lines in the -output. This results in a simple plain text file that you can (for -example) send in email without complications, or include in a -distribution (as in an @file{INSTALL} file). +Do not include menus or node separator lines in the output, and +implicitly @option{--enable-encoding} (see above). This results in a +simple plain text file that you can (for example) send in email +without complications, or include in a distribution (as in an +@file{INSTALL} file). @cindex Navigation links, omitting For HTML output, likewise omit menus. And if @samp{--no-split} is also specified, do not include a navigation links at the top of each node (these are never included in the default case of split output). -@xref{makeinfo html}. +@xref{Generating HTML}. + +In both cases, ignore @code{@@setfilename} and write to standard +output by default---can be overridden with @option{-o}. + +@item --no-ifdocbook +@opindex --no-ifdocbook +@itemx --no-ifhtml +@opindex --no-ifhtml +@itemx --no-ifinfo +@opindex --no-ifinfo +@itemx --no-ifplaintext +@opindex --no-ifplaintext +@itemx --no-iftex +@opindex --no-iftex +@itemx --no-ifxml +@opindex --no-ifxml +Do not process @samp{@@if@var{format}} and @samp{@@@var{format}} +commands, and do process @samp{@@ifnot@var{format}}, even if +generating the given format. For instance, if @option{--no-ifhtml} is +specified, then @samp{@@ifhtml} and @samp{@@html} blocks will not be +read, and @samp{@@ifnothtml} blocks will be. -In both cases, write to standard output by default (can still be -overridden by @option{-o}). +@item --no-number-footnotes +@opindex --no-number-footnotes +Suppress automatic footnote numbering. By default, @code{makeinfo} +numbers each footnote sequentially in a single node, resetting the +current footnote number to 1 at the start of each node. + +@item --no-number-sections +@opindex --no-number-sections +Do not output chapter, section, and appendix numbers. +You need to specify this if your manual is not hierarchically-structured. @item --no-split @opindex --no-split @@ -14058,35 +15152,28 @@ overridden by @option{-o}). Suppress the splitting stage of @code{makeinfo}. By default, large output files (where the size is greater than 70k bytes) are split into smaller subfiles. For Info output, each one is approximately 50k bytes. -For HTML output, each file contains one node (@pxref{makeinfo html}). +For HTML output, each file contains one node (@pxref{Generating HTML}). @item --no-pointer-validate @itemx --no-validate @opindex --no-pointer-validate @opindex --no-validate @cindex Pointer validation, suppressing -Suppress the pointer-validation phase of @code{makeinfo}. This can also -be done with the @code{@@novalidate} command (@pxref{Use TeX,,Use -@TeX{}}). Normally, after a Texinfo file is processed, some consistency -checks are made to ensure that cross references can be resolved, etc. -@xref{Pointer Validation}. +Suppress the pointer-validation phase of @code{makeinfo}---a dangerous +thing to do. This can also be done with the @code{@@novalidate} +command (@pxref{Use TeX,,Use @TeX{}}). Normally, after a Texinfo file +is processed, some consistency checks are made to ensure that cross +references can be resolved, etc. @xref{Pointer Validation}. @item --no-warn @opindex --no-warn -Suppress warning messages (but @emph{not} error messages). You might -want this if the file you are creating has examples of Texinfo cross -references within it, and the nodes that are referenced do not actually -exist. +Suppress warning messages (but @emph{not} error messages). @item --number-sections @opindex --number-sections Output chapter, section, and appendix numbers as in printed manuals. - -@item --no-number-footnotes -@opindex --no-number-footnotes -Suppress automatic footnote numbering. By default, @code{makeinfo} -numbers each footnote sequentially in a single node, resetting the -current footnote number to 1 at the start of each node. +This is the default. It works only with hierarchically-structured +manuals. @item --output=@var{file} @itemx -o @var{file} @@ -14097,7 +15184,7 @@ file name specified in the @code{@@setfilename} command found in the Texinfo source (@pxref{setfilename}). If @var{file} is @samp{-}, output goes to standard output and @samp{--no-split} is implied. For split HTML output, @var{file} is the name for the directory into which all -HTML nodes are written (@pxref{makeinfo html}). +HTML nodes are written (@pxref{Generating HTML}). @item -P @var{dir} @opindex -P @var{dir} @@ -14134,6 +15221,10 @@ Set the value of the number of references to a node that than this number of references in it, @code{makeinfo} will make the references but also report a warning. The default is 1000. +@item --split-size=@var{num} +@opindex --split-size=@var{num} +Keep Info files to at most @var{num} characters; default is 300,000. + @item -U @var{var} Cause @var{var} to be undefined. This is equivalent to @code{@@clear @var{var}} in the Texinfo file (@pxref{set clear value}). @@ -14152,10 +15243,22 @@ Print the version number, then exit successfully. @item --xml @opindex --xml -Generate XML output rather than Info. +Generate XML output rather than Info. @end table +@vindex TEXINFO_OUTPUT_FORMAT +@cindex Environment variable @code{TEXINFO_OUTPUT_FORMAT} +@command{makeinfo} also reads the environment variable +@env{TEXINFO_OUTPUT_FORMAT} to determine the output format, if not +overridden by a command line option. The possible values are: + +@example +docbook html info plaintext xml +@end example + +If not set, Info output is the default. + @node Pointer Validation @subsection Pointer Validation @@ -14203,7 +15306,8 @@ cross-reference.@refill @cindex @@-commands in @@node, limited support Some Texinfo documents might fail during the validation phase because they use commands like @code{@@value} and @code{@@definfoenclose} in -node definitions and cross-references inconsistently. Consider the +node definitions and cross-references inconsistently. (Your best bet +is to avoid using @@-commands in node names.) Consider the following example: @example @@ -14248,7 +15352,7 @@ option is given. @node makeinfo in Emacs -@subsection Running @code{makeinfo} inside Emacs +@subsection Running @code{makeinfo} Within Emacs @cindex Running @code{makeinfo} in Emacs @cindex @code{makeinfo} inside Emacs @cindex Shell, running @code{makeinfo} in @@ -14270,11 +15374,9 @@ Format the current buffer for Info.@refill @findex makeinfo-buffer @end table -When you invoke either @code{makeinfo-region} or -@code{makeinfo-buffer}, Emacs prompts for a file name, offering the -name of the visited file as the default. You can edit the default -file name in the minibuffer if you wish, before pressing @key{RET} to -start the @code{makeinfo} process.@refill +When you invoke @code{makeinfo-region} the output goes to a temporary +buffer. When you invoke @code{makeinfo-buffer} output goes to the +file set with @code{@@setfilename} (@pxref{setfilename}). The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands run the @code{makeinfo} program in a temporary shell buffer. If @@ -14316,41 +15418,38 @@ Printing}.)@refill You can specify options for @code{makeinfo} by setting the @code{makeinfo-options} variable with either the @kbd{M-x -edit-options} or the @kbd{M-x set-variable} command, or by setting the -variable in your @file{.emacs} initialization file.@refill +customize} or the @kbd{M-x set-variable} command, or by setting the +variable in your @file{.emacs} initialization file. For example, you could write the following in your @file{.emacs} file:@refill @example @group (setq makeinfo-options - "--paragraph-indent=0 --no-split - --fill-column=70 --verbose") + "--paragraph-indent=0 --no-split + --fill-column=70 --verbose") @end group @end example +@noindent @c If you write these three cross references using xref, you see @c three references to the same named manual, which looks strange. @iftex For more information, see @ref{makeinfo options, , Options for -@code{makeinfo}}, as well as ``Editing Variable Values,'' ``Examining +@code{makeinfo}}, as well as ``Easy Customization Interface,'' ``Examining and Setting Variables,'' and ``Init File'' in @cite{The GNU Emacs Manual}. @end iftex -@noindent -@ifinfo +@ifnottex For more information, see@* -@ref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual},@* +@ref{Easy Customization, , Easy Customization Interface, emacs, The GNU Emacs Manual},@* @ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@* @ref{Init File, , , emacs, The GNU Emacs Manual}, and@* @ref{makeinfo options, , Options for @code{makeinfo}}. -@end ifinfo +@end ifnottex @node texinfo-format commands -@comment node-name, next, previous, up @subsection The @code{texinfo-format@dots{}} Commands -@findex texinfo-format-region -@findex texinfo-format-buffer In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo file with the @code{texinfo-format-region} command. This formats the @@ -14367,13 +15466,13 @@ Texinfo file.@refill @table @kbd @item C-c C-e C-r @itemx @code{texinfo-format-region} -Format the current region for Info. @findex texinfo-format-region +Format the current region for Info. @item C-c C-e C-b @itemx @code{texinfo-format-buffer} -Format the current buffer for Info. @findex texinfo-format-buffer +Format the current buffer for Info. @end table The @code{texinfo-format-region} and @code{texinfo-format-buffer} @@ -14391,8 +15490,8 @@ provides better error checking (@pxref{makeinfo in Emacs}).@refill You can format Texinfo files for Info using @code{batch-texinfo-format} and Emacs Batch mode. You can run Emacs in Batch mode from any shell, -including a shell inside of Emacs. (@xref{Command Switches, , Command -Line Switches and Arguments, emacs, The GNU Emacs Manual}.)@refill +including a shell inside of Emacs. (@xref{Command Arguments,,, +emacs, The GNU Emacs Manual}.) Here is a shell command to format all the files that end in @file{.texinfo} in the current directory: @@ -14428,9 +15527,9 @@ a @dfn{tag table}, Info can jump to new nodes more quickly than it can otherwise.@refill @cindex Indirect subfiles -In addition, if the Texinfo file contains more than about 70,000 +In addition, if the Texinfo file contains more than about 300,000 bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the -large Info file into shorter @dfn{indirect} subfiles of about 50,000 +large Info file into shorter @dfn{indirect} subfiles of about 300,000 bytes each. Big files are split into smaller files so that Emacs does not need to make a large buffer to hold the whole of a large Info file; instead, Emacs allocates just enough memory for the small, split-off @@ -14501,60 +15600,7 @@ you may want to run the @code{Info-validate} command. (The need @code{Info-validate}.) However, you cannot run the @kbd{M-x Info-validate} node-checking command on indirect files. For information on how to prevent files from being split and how to -validate the structure of the nodes, see @ref{Using -Info-validate}.@refill - - -@node makeinfo html -@subsection Generating HTML -@cindex HTML - -Besides generating output in the Info format, you can use the -@samp{--html} option to generate output in HTML format, for installation -on a web site (for example). By default, the HTML output is split at -node level. - -When splitting, the HTML output files are written into a subdirectory. -The subdirectory is named according to the name from -@code{@@setfilename} with any extension removed; for example, HTML -output for @code{@@setfilename emacs.info} would be written into a -subdirectory named @samp{emacs}. If that directory cannot be created -for any reason, then @samp{.html} is appended to the directory name, as -in @samp{emacs.html} (this is necessary because sometimes the info file -is named without an extension, e.g., @samp{texinfo}). If the -@samp{@var{name}.html} directory can't be created either, -@code{makeinfo} gives up. In any case, the top-level output file within -the directory is always named @samp{index.html}. - -Monolithic output (@code{--no-split}) is named according to -@code{@@setfilename} or @code{--outfile}. Cross-document node -references are not supported in monolithic HTML. - -Texinfo input marked up with the @code{@@ifhtml} command will produce -output only with the @samp{--html} option supplied. Input marked up -with the @code{@@html} is passed literally to the output (suppressing -the normal escaping of input @samp{<}, @samp{>} and @samp{&} characters -which have special significance in HTML). - -The @samp{--footnote-style} option is currently ignored for HTML output; -footnotes are linked to the end of the output file. - -The HTML generated is mostly standard (i.e., HTML 2.0, RFC-1866). The -exception is that HTML 3.2 tables are generated from the -@code{@@multitable} command, but tagged to degrade as well as possible -in browsers without table support. The HTML 4 @samp{lang} attribute on -the @samp{<html>} attribute is also used. Please report output from an -error-free run of @code{makeinfo} which has browser portability problems -as a bug. - -Navigation bars are inserted at the start of nodes, similarly to Info -output. The @samp{--no-headers} option will suppress this if used with -@samp{--no-split}. Header @code{<link>} elements in split output can -support info-like navigation with browsers like Lynx and @w{Emacs W3} -which implement this @w{HTML 1.0} feature. @samp{@@xref} commands to -other documents are generated assuming the other document is available -in split HTML form, and installed in the same HTML documentation tree, -at @file{../<info-document>/}. +validate the structure of the nodes, see @ref{Using Info-validate}. @node Installing an Info File @@ -14571,9 +15617,9 @@ into Emacs. (@inforef{Top, info, info}, for an introduction to Info.) * Directory File:: The top level menu for all Info files. * New Info File:: Listing a new Info file. * Other Info Directories:: How to specify Info files that are - located in other directories. + located in other directories. * Installing Dir Entries:: How to specify what menu entry to add - to the Info directory. + to the Info directory. * Invoking install-info:: @code{install-info} options. @end menu @@ -14596,10 +15642,10 @@ this:@refill * Menu: * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting - text editor. + text editor. * Texinfo: (texinfo). With one source file, make - either a printed manual using - @@TeX@{@} or an Info file. + either a printed manual using + @@TeX@{@} or an Info file. @dots{} @end group @end example @@ -14712,8 +15758,8 @@ Alternatively, you could write the following in your @file{.emacs} file: @group (require 'info) (setq Info-directory-list - (cons (expand-file-name "/home/bob/info") - Info-directory-list)) + (cons (expand-file-name "/home/bob/info") + Info-directory-list)) @end group @end example @@ -14727,6 +15773,7 @@ file in @file{/home/bob/info}. Thus, Info will list the to recompose the @file{dir} file. @vindex INFOPATH +@cindex Environment variable @code{INFOPATH} Finally, you can tell Info where to look by setting the @code{INFOPATH} environment variable in your shell startup file, such as @file{.cshrc}, @file{.profile} or @file{autoexec.bat}. If you use a Bourne-compatible @@ -14775,7 +15822,7 @@ merges any files named @file{dir} in any directory listed in the @env{INFOPATH} variable into a single menu presented to you in the node called @samp{(dir)Top}. -@cindex colon, last in @env{INFOPATH} +@cindex Colon, last in @env{INFOPATH} However you set @env{INFOPATH}, if its last character is a colon@footnote{On MS-DOS/MS-Windows systems, use semi-colon instead.}, this is replaced by the default (compiled-in) path. This gives you a way to @@ -14848,28 +15895,39 @@ will not notice them. If you use @code{@@dircategory} more than once in the Texinfo source, each usage specifies the `current' category; any subsequent -@code{@@direntry} commands will add to that category. +@code{@@direntry} commands will add to that category. + +@cindex Free Software Directory +@cindex Dir categories, choosing +@cindex Categories, choosing +When choosing a category name for the @code{@@dircategory} command, we +recommend consulting the @uref{http://www.gnu.org/directory, +Free Software Directory}. If your program is not listed there, +or listed incorrectly or incompletely, please report the situation to +the directory maintainers (@email{bug-directory@@gnu.org}) so that the +category names can be kept in sync. -Here are some recommended @code{@@dircategory} categories: +Here are a few examples (see the @file{util/dir-example} file in the +Texinfo distribution for large sample @code{dir} file): @display -GNU packages -GNU programming tools -GNU programming documentation -GNU Emacs Lisp -GNU libraries -TeX -Individual utilities +Emacs +Localization +Printing +Software development +Software libraries +Text creation and manipulation @end display -The idea is to include the `Invoking' node for every program installed -by a package under `Individual utilities', and an entry for the manual -as a whole in the appropriate other category. +@cindex Invoking nodes, including in dir file +Each `Invoking' node for every program installed should have a +corresponding @code{@@direntry}. This lets users easily find the +documentation for the different programs they can run, as with the +traditional @command{man} system. @node Invoking install-info -@subsection Invoking install-info - +@subsection Invoking @command{install-info} @pindex install-info @code{install-info} inserts menu entries from an Info file into the @@ -14944,7 +16002,7 @@ Equivalent to using the @var{info-file} argument. @itemx -D @var{dir} @opindex --info-dir=@var{dir} @opindex -D @var{dir} -Specify the directory where @file{dir} resides. +Specify the directory where the directory file @file{dir} resides. Equivalent to @samp{--dir-file=@var{dir}/dir}. @item --item=@var{text} @@ -14975,12 +16033,619 @@ information in the Info file itself. @itemx -V @opindex --version @opindex -V -@cindex version number, finding +@cindex Version number, for install-info Display version information and exit successfully. @end table +@node Generating HTML +@chapter Generating HTML +@cindex HTML output + +@command{makeinfo} generates Info output by default, but given the +@option{--html} option, it will generate HTML, for web browsers and +other programs. This chapter gives some details on such HTML output. + + +@command{makeinfo} can also write in XML and Docbook format, but we do +not as yet describe these further. @xref{Output Formats}, for a brief +overview of all the output formats. + +@menu +* HTML Translation:: Details of the HTML output. +* HTML Splitting:: How HTML output is split. +* HTML CSS:: Influencing HTML output with Cascading Style Sheets. +* HTML Xref:: Cross-references in HTML output. +@end menu + + +@node HTML Translation +@section HTML Translation + +@command{makeinfo} will include segments of Texinfo source between +@code{@@ifhtml} and @code{@@end ifhtml} in the HTML output (but not +any of the other conditionals, by default). Source between +@code{@@html} and @code{@@end html} is passed without change to the +output (i.e., suppressing the normal escaping of input @samp{<}, +@samp{>} and @samp{&} characters which have special significance in +HTML). @xref{Conditional Commands}. + +@opindex --footnote-style@r{, ignored in HTML output} +The @option{--footnote-style} option is currently ignored for HTML output; +footnotes are always linked to the end of the output file. + +@cindex Navigation bar, in HTML output +By default, a navigation bar is inserted at the start of each node, +analogous to Info output. The @samp{--no-headers} option suppresses +this if used with @samp{--no-split}. Header @code{<link>} elements in +split output can support info-like navigation with browsers like Lynx +and @w{Emacs W3} which implement this HTML@tie{}1.0 feature. + +@cindex HTML output, browser compatibility of +The HTML generated is mostly standard (i.e., HTML@tie{}2.0, RFC-1866). +One exception is that HTML@tie{}3.2 tables are generated from the +@code{@@multitable} command, but tagged to degrade as well as possible +in browsers without table support. The HTML@tie{}4 @samp{lang} +attribute on the @samp{<html>} attribute is also used. (Please report +output from an error-free run of @code{makeinfo} which has browser +portability problems as a bug.) + + +@node HTML Splitting +@section HTML Splitting +@cindex Split HTML output +@cindex HTML output, split + +When splitting output (which is the default), @command{makeinfo} +writes HTML output into (generally) one output file per Texinfo source +@code{@@node}. + +The output file name is the node name with special characters replaced +by @samp{-}'s, so it can work as a filename. In the unusual case of +two different nodes having the same name after this treatment, they +are written consecutively to the same file, with HTML anchors so each +can be referred to separately. If @command{makeinfo} is run on a +system which does not distinguish case in filenames, nodes which are +the same except for case will also be folded into the same output +file. + +When splitting, the HTML output files are written into a subdirectory, +with the name chosen as follows: +@enumerate +@item +@command{makeinfo} first tries the subdirectory with the base name +from @code{@@setfilename} (that is, any extension is removed). For +example, HTML output for @code{@@setfilename gcc.info} would be +written into a subdirectory named @samp{gcc}. + +@item +If that directory cannot be created for any reason, then +@command{makeinfo} tries appending @samp{.html} to the directory name. +For example, output for @code{@@setfilename texinfo} would be written +to @samp{texinfo.html}. + +@item +If the @samp{@var{name}.html} directory can't be +created either, @code{makeinfo} gives up. + +@end enumerate + +@noindent In any case, the top-level output file within the directory +is always named @samp{index.html}. + +Monolithic output (@code{--no-split}) is named according to +@code{@@setfilename} (with any @samp{.info} extension is replaced with +@samp{.html}) or @code{--output} (the argument is used literally). + + +@node HTML CSS +@section HTML CSS +@cindex HTML, and CSS +@cindex CSS, and HTML output +@cindex Cascading Style Sheets, and HTML output + +Cascading Style Sheets (CSS for short) is an Internet standard for +influencing the display of HTML documents: see +@uref{http://www.w3.org/Style/CSS/}. + +By default, @command{makeinfo} includes a few simple CSS commands to +better implement the appearance of some of the environments. Here +are two of them, as an example: + +@example +pre.display @{ font-family:inherit @} +pre.smalldisplay @{ font-family:inherit; font-size:smaller @} +@end example + +A full explanation of CSS is (far) beyond this manual; please see the +reference above. In brief, however, this specification tells the web +browser to use a `smaller' font size for @code{@@smalldisplay} text, +and to use the `inherited' font (generally a regular roman typeface) +for both @code{@@smalldisplay} and @code{@@display}. By default, the +HTML @samp{<pre>} command uses a monospaced font. + +You can influence the CSS in the HTML output with the +@option{--css-include=@var{file}} option to @command{makeinfo}. This +includes the contents @var{file} in the HTML output, as you might +expect. However, the details are somewhat tricky, as described in the +following, to provide maximum flexibility. + +@cindex @@import specifications, in CSS files +The CSS file may begin with so-called @samp{@@import} directives, +which link to external CSS specifications for browsers to use when +interpreting the document. Again, a full description is beyond our +scope here, but we'll describe how they work syntactically, so we can +explain how @command{makeinfo} handles them. + +@cindex Comments, in CSS files +There can be more than one @samp{@@import}, but they have to come +first in the file, with only whitespace and comments interspersed, no +normal definitions. (Technical exception: an @samp{@@charset} +directive may precede the @samp{@@import}'s. This does not alter +@command{makeinfo}'s behavior, it just copies the @samp{@@charset} if +present.) Comments in CSS files are delimited by @samp{/* ... */}, as +in C. An @samp{@@import} directive must be in one of these two forms: + +@example +@@import url(http://example.org/foo.css); +@@import "http://example.net/bar.css"; +@end example + +As far as @command{makeinfo} is concerned, the crucial characters are +the @samp{@@} at the beginning and the semicolon terminating the +directive. When reading the CSS file, it simply copies any such +@samp{@@}-directive into the output, as follows: + +@itemize +@item If @var{file} contains only normal CSS declarations, it is +included after @command{makeinfo}'s default CSS, thus overriding it. + +@item If @var{file} begins with @samp{@@import} specifications (see +below), then the @samp{import}'s are included first (they have to come +first, according to the standard), and then @command{makeinfo}'s +default CSS is included. If you need to override @command{makeinfo}'s +defaults from an @samp{@@import}, you can do so with the @samp{!@: +important} CSS construct, as in: +@example +pre.smallexample @{ font-size: inherit ! important @} +@end example + +@item If @var{file} contains both @samp{@@import} and inline CSS +specifications, the @samp{@@import}'s are included first, then +@command{makeinfo}'s defaults, and lastly the inline CSS from +@var{file}. + +@item Any @@-directive other than @samp{@@import} and @samp{@@charset} +is treated as a CSS declaration, meaning @command{makeinfo} includes +its default CSS and then the rest of the file. + +@end itemize + +If the CSS file is malformed or erroneous, @command{makeinfo}'s output +is unspecified. @command{makeinfo} does not try to interpret the +meaning of the CSS file in any way; it just looks for the special +@samp{@@} and @samp{;} characters and blindly copies the text into the +output. Comments in the CSS file may or may not be included in the +output. + + +@node HTML Xref +@section HTML Cross-references +@cindex HTML cross-references +@cindex Cross-references, in HTML output + +Cross-references between Texinfo manuals in HTML format amount, in the +end, to a standard HTML @code{<a>} link, but the details are +unfortunately complex. This section describes the algorithm used in +detail, so that Texinfo can cooperate with other programs, such as +@command{texi2html}, by writing mutually compatible HTML files. + +This algorithm may or may not be used for links @emph{within} HTML +output for a Texinfo file. Since no issues of compatibility arise in +such cases, we do not need to specify this. + +We try to support references to such ``external'' manuals in both +monolithic and split forms. A @dfn{monolithic} (mono) manual is +entirely contained in one file, and a @dfn{split} manual has a file +for each node. (@xref{HTML Splitting}.) + +@cindex Dumas, Patrice +Acknowledgement: this algorithm was primarily devised by Patrice Dumas +in 2003--04. + +@menu +* Link Basics: HTML Xref Link Basics. +* Node Expansion: HTML Xref Node Name Expansion. +* Command Expansion: HTML Xref Command Expansion. +* 8-bit Expansion: HTML Xref 8-bit Character Expansion. +* Mismatch: HTML Xref Mismatch. +@end menu + + +@node HTML Xref Link Basics +@subsection HTML Cross-reference Link Basics +@cindex HTML cross-reference link basics + +For our purposes, an HTML link consists of four components: a host +name, a directory part, a file part, and a target part. We +always assume the @code{http} protocol. For example: + +@example +http://@var{host}/@var{dir}/@var{file}.html#@var{target} +@end example + +The information to construct a link comes from the node name and +manual name in the cross-reference command in the Texinfo source +(@pxref{Cross References}), and from @dfn{external information}, which +is currently simply hardwired. In the future, it may come from an +external data file. + +We now consider each part in turn. + +The @var{host} is hardwired to be the local host. This could either +be the literal string @samp{localhost}, or, according to the rules for +HTML links, the @samp{http://localhost/} could be omitted entirely. + +The @var{dir} and @var{file} parts are more complicated, and depend on +the relative split/mono nature of both the manual being processed and +the manual that the cross-reference refers to. The underlying idea is +that there is one directory for Texinfo manuals in HTML, and each +manual is either available as a monolithic file @file{manual.html}, or a +split subdirectory @file{manual/*.html}. Here are the cases: + +@itemize @bullet +@item +If the present manual is split, and the referent manual is also split, +the directory is @samp{../@var{referent/}} and the file is the +expanded node name (described later). + +@item +If the present manual is split, and the referent manual is mono, the +directory is @samp{../} and the file is @file{@var{referent}.html}. + +@item +If the present manual is mono, and the referent manual is split, the +directory is @file{@var{referent}/} and the file is the expanded node +name. + +@item +If the present manual is mono, and the referent manual is also mono, +the directory is @file{./} (or just the empty string), and the file is +@file{@var{referent}.html}. + +@end itemize + +One exception: the algorithm for node name expansion prefixes the +string @samp{g_t} when the node name begins with a non-letter. This +kludge (due to XHTML rules) is not necessary for filenames, and is +therefore omitted. + +Any directory part in the filename argument of the source +cross-reference command is ignored. Thus, @code{@@xref@{,,,../foo@}} +and @code{@@xref@{,,,foo@}} both use @samp{foo} as the manual name. +This is because any such attempted hardwiring of the directory is very +unlikely to be useful for both Info and HTML output. + +Finally, the @var{target} part is always the expanded node name. + +Whether the present manual is split or mono is determined by user +option; @command{makeinfo} defaults to split, with the +@option{--no-split} option overriding this. + +Whether the referent manual is split or mono is another bit of the +external information. For now, @command{makeinfo} simply assumes the +referent manual is the same as the present manual. + +There can be a mismatch between the format of the referent manual that +the generating software assumes, and the format it's actually present +in. @xref{HTML Xref Mismatch}. + + +@node HTML Xref Node Name Expansion +@subsection HTML Cross-reference Node Name Expansion +@cindex HTML cross-reference node name expansion +@cindex node name expansion, in HTML cross-references +@cindex expansion, of node names in HTML cross-references + +As mentioned in the previous section, the key part of the HTML +cross-reference algorithm is the conversion of node names in the +Texinfo source into strings suitable for XHTML identifiers and +filenames. The restrictions are similar for each: plain ASCII +letters, numbers, and the @samp{-} and @samp{_} characters are all +that can be used. (Although HTML anchors can contain most characters, +XHTML is more restrictive.) + +Cross-references in Texinfo can actually refer either to nodes or +anchors (@pxref{anchor}), but anchors are treated identically to nodes +in this context, so we'll continue to say ``node'' names for +simplicity. + +(@@-commands and 8-bit characters are not presently handled by +@command{makeinfo} for HTML cross-references. See the next section.) + +A special exception: the Top node (@pxref{The Top Node}) is always +mapped to the file @file{index.html}, to match web server software. +However, the HTML @emph{target} is @samp{Top}. Thus (in the split case): + +@example +@@xref@{Top, Introduction,, emacs, The GNU Emacs Manual@}. +@result{} <a href="emacs/index.html#Top"> +@end example + +@enumerate +@item +The standard ASCII letters (a-z and A-Z) are not modified. All other +characters are changed as specified below. + +@item +The standard ASCII numbers (0-9) are not modified except when a number +is the first character of the node name. In that case, see below. + +@item +Multiple consecutive space, tab and newline characters are transformed +into just one space. (It's not possible to have newlines in node +names with the current implementation, but we specify it anyway, just +in case.) + +@item +Leading and trailing spaces are removed. + +@item +After the above has been applied, each remaining space character is +converted into a @samp{-} character. + +@item +Other ASCII 7-bit characters are transformed into @samp{_00@var{xx}}, +where @var{xx} is the ASCII character code in (lowercase) hexadecimal. +This includes @samp{_}, which is mapped to @samp{_005f}. + +@item +If the node name does not begin with a letter, the literal string +@samp{g_t} is prefixed to the result. (Due to the rules above, that +string can never occur otherwise; it is an arbitrary choice, standing +for ``GNU Texinfo''.) This is necessary because XHTML requires that +identifiers begin with a letter. + +@end enumerate + +For example: + +@example +@@node A node --- with _'% +@result{} A-node-_002d_002d_002d-with-_005f_0027_0025 +@end example + +Notice in particular: + +@itemize @bullet +@item @samp{_} @result{} @samp{_005f} +@item @samp{-} @result{} @samp{_002d} +@item @samp{A node} @result{} @samp{A-node} +@end itemize + +On case-folding computer systems, nodes differing only by case will be +mapped to the same file. + +In particular, as mentioned above, Top always maps to the file +@file{index.html}. Thus, on a case-folding system, Top and a node +named `Index' will both be written to @file{index.html}. + +Fortunately, the targets serve to distinguish these cases, since HTML +target names are always case-sensitive, independent of operating +system. + + +@node HTML Xref Command Expansion +@subsection HTML Cross-reference Command Expansion +@cindex HTML cross-reference command expansion + +In standard Texinfo, node names may not contain @@-commands. +@command{makeinfo} has an option @option{--commands-in-node-names} +which partially supports it (@pxref{Invoking makeinfo}), but it is not +robust and not recommended. + +Thus, @command{makeinfo} also does not fully implement this part of +the HTML cross-reference algorithm, but it is documented here for the +sake of completeness. + +First, comments are removed. + +Next, any @code{@@value} commands (@pxref{set value}) and macro invocations +(@pxref{Invoking Macros}) are fully expanded. + +Then, for the following commands, the command name and braces are removed, +the text of the argument is recursively transformed: +@example +@@asis @@b @@cite @@code @@command @@dfn @@dmn @@dotless +@@emph @@env @@file @@indicateurl @@kbd @@key +@@samp @@sc @@slanted @@strong @@t @@var @@w +@end example + +@noindent For @code{@@sc}, any letters are capitalized. + +The following commands are replaced by constant text, as shown. If +any of these commands have non-empty arguments, as in +@code{@@TeX@{bad@}}, it is an error, and the result is unspecified. +`(space)' means a space character, `(nothing)' means the empty string, +etc. The notation `U+@var{xxxx}' means Unicode code point @var{xxxx}. +There are further transformations of many of these expansions for the +final file or target name, such as space characters to @samp{-}, etc., +according to the other rules. + +@multitable @columnfractions .3 .5 +@item @code{@@(newline)} @tab (space) +@item @code{@@(space)} @tab (space) +@item @code{@@(tab)} @tab (space) +@item @code{@@!} @tab @samp{!} +@item @code{@@*} @tab (space) +@item @code{@@-} @tab (nothing) +@item @code{@@.} @tab @samp{.} +@item @code{@@:} @tab (nothing) +@item @code{@@?} @tab @samp{?} +@item @code{@@@@} @tab @samp{@@} +@item @code{@@@{} @tab @samp{@{} +@item @code{@@@}} @tab @samp{@}} +@item @code{@@LaTeX} @tab @samp{LaTeX} +@item @code{@@TeX} @tab @samp{TeX} +@item @code{@@bullet} @tab U+2022 +@item @code{@@comma} @tab @samp{,} +@item @code{@@copyright} @tab U+00A9 +@item @code{@@dots} @tab U+2026 +@item @code{@@enddots} @tab @samp{...} +@item @code{@@equiv} @tab U+2261 +@item @code{@@error} @tab @samp{error-->} +@item @code{@@euro} @tab U+20AC +@item @code{@@exclamdown} @tab U+00A1 +@item @code{@@expansion} @tab U+2192 +@item @code{@@minus} @tab U+2212 +@item @code{@@ordf} @tab U+00AA +@item @code{@@ordm} @tab U+00BA +@item @code{@@point} @tab U+2217 +@item @code{@@pounds} @tab U+00A3 +@item @code{@@print} @tab @samp{-|} +@item @code{@@questiondown} @tab U+00BF +@item @code{@@registeredsymbol} @tab U+00AE +@item @code{@@result} @tab U+21D2 +@item @code{@@tie} @tab (space) +@end multitable + +An @code{@@acronym} or @code{@@abbr} command is replaced by the first +argument, followed by the second argument in parentheses, if present. +@xref{acronym}. + +An @code{@@email} command is replaced by the @var{text} argument if +present, else the address. @xref{email}. + +An @code{@@image} command is replaced by the filename (first) +argument. @xref{Images}. + +A @code{@@verb} command is replaced by its transformed argument. +@xref{verb}. + +Any other command is an error, and the result is unspecified. + + +@node HTML Xref 8-bit Character Expansion +@subsection HTML Cross-reference 8-bit Character Expansion +@cindex HTML cross-reference 8-bit character expansion +@cindex 8-bit characters, in HTML cross-references +@cindex Expansion of 8-bit characters in HTML cross-references + +Usually, characters other than plain 7-bit ASCII are transformed into +the corresponding Unicode code point(s) in Normalization Form C, which +uses precomposed characters where available. (This is the +normalization form recommended by the W3C and other bodies.) This +holds when that code point is 0xffff or less, as it almost always is. + +These will then be further transformed by the rules above into the +string @samp{_@var{xxxx}}, where @var{xxxx} is the code point in hex. + +For example, combining this rule and the previous section: + +@example +@@node @@b@{A@} @@TeX@{@} @@u@{B@} @@point@{@}@@enddots@{@} +@result{} A-TeX-B_0306-_2605_002e_002e_002e +@end example + +Notice: 1)@tie{}@code{@@enddots} expands to three periods which in +turn expands to three @samp{_002e}'s; 2)@tie{}@code{@@u@{B@}} is a `B' +with a breve accent, which does not exist as a pre-accented Unicode +character, therefore expands to @samp{B_0306} (B with combining +breve). + +When the Unicode code point is above 0xffff, the transformation is +@samp{__@var{xxxxxx}}, that is, two leading underscores followed by +six hex digits. Since Unicode has declared that their highest code +point is 0x10ffff, this is sufficient. (We felt it was better to +define this extra escape than to always use six hex digits, since the +first two would nearly always be zeros.) + +For the definition of Unicode Normalization Form C, see Unicode report +UAX#15, @uref{http://www.unicode.org/reports/tr15/}. Many related +documents and implementations are available elsewhere on the web. + + +@node HTML Xref Mismatch +@subsection HTML Cross-reference Mismatch +@cindex HTML cross-reference mismatch +@cindex Mismatched HTML cross-reference source and target + +As mentioned earlier (@pxref{HTML Xref Link Basics}), the generating +software has to guess whether a given manual being cross-referenced is +available in split or monolithic form---and, inevitably, it might +guess wrong. However, it is possible when the referent manual itself +is generated, it is possible to handle at least some mismatches. + +In the case where we assume the referent is split, but it is actually +available in mono, the only recourse would be to generate a +@file{manual/} subdirectory full of HTML files which redirect back to +the monolithic @file{manual.html}. Since this is essentially the same +as a split manual in the first place, it's not very appealing. + +On the other hand, in the case where we assume the referent is mono, +but it is actually available in split, it is possible to use +JavaScript to redirect from the putatively monolithic +@file{manual.html} to the different @file{manual/node.html} files. +Here's an example: + +@example +function redirect() @{ + switch (location.hash) @{ + case "#Node1": + location.replace("manual/Node1.html#Node1"); break; + case "#Node2" : + location.replace("manual/Node2.html#Node2"); break; + @dots{} + default:; + @} +@} +@end example + +Then, in the @code{<body>} tag of @file{manual.html}: + +@example +<body onLoad="redirect();"> +@end example + +Once again, this is something the software which generated the +@emph{referent} manual has to do in advance, it's not something the +software generating the actual cross-reference in the present manual +can control. + +Ultimately, we hope to allow for an external configuration file to +control which manuals are available from where, and how. + + +@ignore +-- not yet -- + +external information +-------------------- + +The information for the reference is searched in the file +`htmlxref.cnf' present in the following directories: +<srcdir>/.texinfo/, ~/.texinfo/, SYSCONFDIR/texinfo/, +DATADIR/texinfo/ +The first match should be used. + +The file is line-oriented, with the following format: + <manualname> <whitespace> <keyword> <whitespace> <urlprefix> +with <keyword> being "mono" or "split". Thus +texinfo split http://www.gnu.org/software/texinfo/manual/texinfo/html_node/ +texinfo mono http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html + +If the keyword is 'split', that is the target is split, the urlprefix gives +the directory and host name. +If the keyword is 'mono', that is the target is mono, the urlprefix gives +directory, host and file name. + +'#' followed by a space begins comments. '#' followed by another character +cannot begin comments as there are # in urls. + +@end ignore + + @node Command List @appendix @@-Command List @cindex Alphabetical @@-command list @@ -14992,6 +16657,13 @@ Here is an alphabetical list of the @@-commands in Texinfo. Square brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis, @samp{@dots{}}, indicates repeated text. +More specifics on the general syntax of different @@-commands are +given in the section below. + +@menu +* Command Syntax:: General syntax for varieties of @@-commands. +@end menu + @sp 1 @table @code @item @@@var{whitespace} @@ -15008,8 +16680,7 @@ Generate an umlaut or acute accent, respectively, over the next character, as in @"o and @'o. @xref{Inserting Accents}. @item @@* -Force a line break. Do not end a paragraph that uses @code{@@*} with -an @code{@@refill} command. @xref{Line Breaks}. +Force a line break. @xref{Line Breaks}. @item @@,@{@var{c}@} Generate a cedilla accent under @var{c}, as in @,{c}. @xref{Inserting @@ -15022,6 +16693,9 @@ Insert a discretionary hyphenation point. @xref{- and hyphenation}. Produce a period that really does end a sentence (usually after an end-of-sentence capital letter). @xref{Ending a Sentence}. +@item @@/ +Produces no output, but allows a line break. @xref{Line Breaks}. + @item @@: Indicate to @TeX{} that an immediately preceding period, question mark, exclamation mark, or colon does not end a sentence. Prevent @@ -15039,7 +16713,7 @@ an end-of-sentence capital letter). @xref{Ending a Sentence}. @item @@@@ Stands for an at sign, @samp{@@}. -@xref{Braces Atsigns, , Inserting @@ and braces}. +@xref{Atsign Braces Comma, , Inserting @@ and @{@} and @comma{}}. @item @@\ Stands for a backslash (@samp{\}) inside @code{@@math}. @@ -15053,11 +16727,11 @@ character, as in @^o and @`e. @item @@@{ Stands for a left brace, @samp{@{}. -@xref{Braces Atsigns, , Inserting @@ and braces}. +@xref{Atsign Braces Comma, , Inserting @@ and @{@} and @comma{}}. @item @@@} Stands for a right-hand brace, @samp{@}}.@* -@xref{Braces Atsigns, , Inserting @@ and braces}. +@xref{Atsign Braces Comma, , Inserting @@ and @{@} and @comma{}}. @item @@~ Generate a tilde accent over the next character, as in @~N. @@ -15068,9 +16742,13 @@ Generate a tilde accent over the next character, as in @~N. Generate the uppercase and lowercase Scandinavian A-ring letters, respectively: @AA{}, @aa{}. @xref{Inserting Accents}. -@item @@acronym@{@var{abbrev}@} -Tag @var{abbrev} as an acronym, that is, an abbreviation written in all -capital letters, such as `NASA'. @xref{acronym,, @code{acronym}}. +@item @@abbr@{@var{abbreviation}@} +Tag @var{abbreviation} as an abbreviation, such as `Comput.'. +@xref{abbr,, @code{abbr}}. + +@item @@acronym@{@var{acronym}@} +Tag @var{acronym} as an acronym, such as `NASA'. +@xref{acronym,, @code{acronym}}. @item @@AE@{@} @itemx @@ae@{@} @@ -15149,7 +16827,10 @@ file following an @code{@@bye} command. @xref{Ending a File}.@refill @item @@c @var{comment} Begin a comment in Texinfo. The rest of the line does not appear in either the Info file or the printed manual. A synonym for -@code{@@comment}. @xref{Comments, , Comments}.@refill +@code{@@comment}. @xref{Comments}. + +@item @@caption +Define the full caption for a @code{@@float}. @xref{caption shortcaption}. @item @@cartouche Highlight an example or quotation by drawing a box with rounded @@ -15195,6 +16876,10 @@ and @code{@@end ifset} commands, and preventing Highlight text that is an expression, a syntactically complete token of a program, or a program name. @xref{code, , @code{@@code}}.@refill +@item @@comma@{@} +Insert a comma `,' character; only needed when a literal comma would +be taken as an argument separator. @xref{Inserting a Comma}. + @item @@command@{@var{command-name}@} Indicate a command name, such as @command{ls}. @xref{command,, @code{@@command}}. @@ -15210,8 +16895,8 @@ menus instead. @xref{Contents, , Generating a Table of Contents}.@refill @item @@copyright@{@} -Generate a copyright symbol. @xref{copyright symbol, , -@code{@@copyright}}.@refill +Generate the copyright symbol @copyright{}. @xref{copyright symbol,, +@code{@@copyright@{@}}}. @ignore @item @@ctrl@{@var{ctrl-char}@} @@ -15294,6 +16979,11 @@ the category, the name of the type (which is a word like @samp{int} or @samp{float}), and then the names of attributes of objects of that type. @xref{Definition Commands}, and @ref{Data Types}. +@item @@deftypecv @var{category} @var{class} @var{data-type} @var{name} +@itemx @@deftypecvx @var{category} @var{class} @var{data-type} @var{name} +Format a description for a typed class variable in object-oriented programming. +@xref{Definition Commands}, and @ref{Abstract Objects}. + @item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{} @itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{} Format a description for a function or similar entity that may take @@ -15382,6 +17072,10 @@ Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a thin space before @var{dimension}. No effect in Info. @xref{dmn, , @code{@@dmn}}. +@item @@docbook +Enter Docbook completely. Pair with @code{@@end docbook}. @xref{Raw +Formatter Commands}. + @item @@documentdescription Set the document description text, included in the HTML output. Pair with @code{@@end documentdescription}. @xref{documentdescription,, @@ -15434,6 +17128,10 @@ Optionally, start list with @var{number-or-letter}. Pair with Indicate to the reader the exact equivalence of two forms with a glyph: @samp{@equiv{}}. @xref{Equivalence}.@refill +@item @@euro@{@} +Generate the Euro currency sign. +@xref{euro,,@code{@@euro@{@}}}. + @item @@error@{@} Indicate to the reader with a glyph that the following text is an error message: @samp{@error{}}. @xref{Error Glyph}.@refill @@ -15482,6 +17180,10 @@ over-wide lines. @xref{Overfull hboxes}.@refill Add @var{entry} to the index of functions. @xref{Index Entries, , Defining the Entries of an Index}.@refill +@item @@float +Environment to define floating material. Pair with @code{@@end float}. +@xref{Floats}. + @item @@flushleft @itemx @@flushright Left justify every line but leave the right end ragged. @@ -15548,28 +17250,30 @@ between @code{@@ifclear @var{flag}} and the following @code{@@end ifclear} command. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill -@item @@ifhtml +@item @@ifdocbook +@itemx @@ifhtml @itemx @@ifinfo -Begin a stretch of text that will be ignored by @TeX{} when it typesets -the printed manual. @code{@@ifhtml} text appears only in the HTML -output. @code{@@ifinfo} output appears in both Info and (for historical -compatibility) plain text output . Pair with @code{@@end ifhtml} -resp.@: @code{@@end ifinfo}. @xref{Conditionals}. - -@item @@ifnothtml +Begin text that will appear only in the given output format. +@code{@@ifinfo} output appears in both Info and (for historical +compatibility) plain text output. Pair with @code{@@end ifdocbook} +resp.@: @code{@@end ifhtml} resp.@: @code{@@end ifinfo}. +@xref{Conditionals}. + +@item @@ifnotdocbook +@itemx @@ifnothtml @itemx @@ifnotinfo @itemx @@ifnotplaintext @itemx @@ifnottex +@itemx @@ifnotxml Begin a stretch of text that will be ignored in one output format but not the others. The text appears in the formats not specified: @code{@@ifnothtml} text is omitted from html output, etc. The exception is @code{@@ifnotinfo} text, which is omitted from plain text output as -well as Info output. Pair with @code{@@end ifnothtml} resp.@: -@code{@@end ifnotinfo} resp.@: @code{@@end ifnotplaintext} resp.@: -@code{@@end ifnottex}. @xref{Conditionals}. +well as Info output. Pair with the corresponding @code{@@end +ifnot@var{format}}. @xref{Conditionals}. @item @@ifplaintext -Begin a stretch of text that appears only in the plain text output. +Begin text that will appear only in the plain text output. Pair with @code{@@end ifplaintext}. @xref{Conditionals}. @item @@ifset @var{flag} @@ -15579,14 +17283,17 @@ command. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @item @@iftex -Begin a stretch of text that will not appear in the Info file, but +Begin text that will not appear in the Info file or other output, but will be processed only by @TeX{}. Pair with @code{@@end iftex}. @xref{Conditionals, , Conditionally Visible Text}.@refill +@item @@ifxml +Begin text that will appear only in the XML output. Pair with +@code{@@end ifxml}. @xref{Conditionals}. + @item @@ignore -Begin a stretch of text that will not appear in either the Info file -or the printed output. Pair with @code{@@end ignore}. -@xref{Comments, , Comments and Ignored Text}.@refill +Begin text that will not appear in any output. Pair with @code{@@end +ignore}. @xref{Comments, , Comments and Ignored Text}. @item @@image@{@var{filename}, [@var{width}], [@var{height}], [@var{alt}], [@var{ext}]@} Include graphics image in external @var{filename} scaled to the given @@ -15597,6 +17304,10 @@ Include graphics image in external @var{filename} scaled to the given Incorporate the contents of the file @var{filename} into the Info file or printed document. @xref{Include Files}.@refill +@item @@indicateurl@{@var{indicateurl}@} +Indicate text that is a uniform resource locator for the World Wide +Web. @xref{indicateurl, , @code{@@indicateurl}}. + @item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@} Make a cross reference to an Info file for which there is no printed manual. @xref{inforef, , Cross references using @@ -15646,17 +17357,17 @@ Add @var{entry} to the index of keys. Generate the uppercase and lowercase Polish suppressed-L letters, respectively: @L{}, @l{}. -@c Possibly this can be tossed now that we have macros. --karl, 16sep96. -@c Yes, let's toss it, it's pretty weird. --karl, 15jun97. -@c @item @@global@@let@var{new-command}=@var{existing-command} -@c Equate a new highlighting command with an existing one. Only for -@c @TeX{}. Write definition inside of @code{@@iftex} @dots{} @code{@@end -@c iftex}. @xref{Customized Highlighting}.@refill +@item @@LaTeX@{@} +Insert the logo @LaTeX{}. @xref{tex, , @TeX{} and @LaTeX{}}. @item @@lisp Begin an example of Lisp code. Indent text, do not fill, and select fixed-width font. Pair with @code{@@end lisp}. @xref{lisp, , @code{@@lisp}}. +@item @@listoffloats +Produce a table-of-contents-like listing of @code{@@float}s. +@xref{listoffloats}. + @item @@lowersections Change subsequent chapters to sections, sections to subsections, and so on. @xref{Raise/lower sections, , @code{@@raisesections} and @@ -15670,8 +17381,7 @@ Macros}. @item @@majorheading @var{title} Print a chapter-like heading in the text, but not in the table of contents of a printed manual. Generate more vertical whitespace before -the heading than the @code{@@chapheading} command. In Info, the chapter -heading line is underlined with asterisks. @xref{majorheading & +the heading than the @code{@@chapheading} command. @xref{majorheading & chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill @item @@math@{@var{mathematical-expression}@} @@ -15772,7 +17482,7 @@ Generate an upside-down question mark. @xref{Inserting Accents}. @item @@quotation Narrow the margins to indicate text that is quoted from another real -or imaginary work. Write command on a line of its own. Pair with +or imaginary work. Takes optional argument of prefix text. Pair with @code{@@end quotation}. @xref{quotation, , @code{@@quotation}}.@refill @@ -15791,10 +17501,14 @@ with a `See'. Follow command with a punctuation mark. Only the first argument is mandatory. @xref{ref, , @code{@@ref}}.@refill @item @@refill -In Info, refill and indent the paragraph after all the other processing -has been done. No effect on @TeX{}, which always refills. This command -is no longer needed, since all formatters now automatically refill. -@xref{Refilling Paragraphs}.@refill +This command used to refill and indent the paragraph after all the +other processing has been done. It is no longer needed, since all +formatters now automatically refill as needed, but you may still see +it in the source to some manuals, as it does no harm. + +@item @@registeredsymbol@{@} +Generate the legal symbol @registeredsymbol{}. @xref{registered +symbol,, @code{@@registeredsymbol@{@}}}. @item @@result@{@} Indicate the result of an expression to the reader with a special @@ -15809,6 +17523,10 @@ Highlight @var{text} that is a literal example of a sequence of characters. Used for single characters, for statements, and often for entire shell commands. @xref{samp, , @code{@@samp}}.@refill +@item @@sansserif@{@var{text}@} +Print @var{text} in a @sansserif{sans serif} font if possible. No +effect in Info. @xref{Fonts}. + @item @@sc@{@var{text}@} Set @var{text} in a printed output in @sc{the small caps font} and set text in the Info file in uppercase letters. @@ -15851,6 +17569,9 @@ Provide a title for page headers in a printed manual, and the default document description for HTML @samp{<head>}. @xref{settitle, , @code{@@settitle}}.@refill +@item @@shortcaption +Define the short caption for a @code{@@float}. @xref{caption shortcaption}. + @item @@shortcontents Print a short table of contents. Not relevant to Info, which uses menus rather than tables of contents. A synonym for @@ -15860,6 +17581,10 @@ Contents}.@refill @item @@shorttitlepage @var{title} Generate a minimal title page. @xref{titlepage,,@code{@@titlepage}}. +@item @@slanted@{@var{text}@} +Print @var{text} in a @slanted{slanted} font if possible. No effect +in Info. @xref{Fonts}. + @item @@smallbook Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format rather than the regular 8.5 by 11 inch format. @xref{smallbook, , @@ -15959,8 +17684,7 @@ Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}}, and @ref{itemx, , @code{@@itemx}}.@refill @item @@TeX@{@} -Insert the logo @TeX{}. @xref{TeX and copyright, , Inserting @TeX{} -and @copyright{}}.@refill +Insert the logo @TeX{}. @xref{tex, , @TeX{} and @LaTeX{}}. @item @@tex Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Raw @@ -15977,6 +17701,10 @@ only, the filename, the current page number, and the title of the document, respectively. @xref{Custom Headings, , How to Make Your Own Headings}.@refill +@item @@tie@{@} +Generate a normal interword space at which a line break is not allowed. +@xref{tie,, @code{@@tie@{@}}}. + @item @@tieaccent@{@var{cc}@} Generate a tie-after accent over the next two characters @var{cc}, as in `@tieaccent{oo}'. @xref{Inserting Accents}. @@ -16054,12 +17782,9 @@ manual. In Info, the title is underlined with periods. @xref{subsubsection, , The `subsub' Commands}.@refill @item @@uref@{@var{url}[, @var{displayed-text}][, @var{replacement}@} +@itemx @@url@{@var{url}[, @var{displayed-text}][, @var{replacement}@} Define a cross reference to an external uniform resource locator for the -World Wide Web. @xref{uref, , @code{@@uref}}.@refill - -@item @@url@{@var{url}@} -Indicate text that is a uniform resource locator for the World Wide -Web. @xref{url, , @code{@@url}}.@refill +World Wide Web. @xref{uref, , @code{@@uref}}. @item @@v@{@var{c}@} Generate check accent over the character @var{c}, as in @v{o}. @@ -16107,10 +17832,13 @@ index of variables. Pair with @code{@@end vtable}. The same as @code{@@ftable} and @code{@@vtable}}.@refill @item @@w@{@var{text}@} -Prevent @var{text} from being split across two lines. Do not end a -paragraph that uses @code{@@w} with an @code{@@refill} command. +Prevent @var{text} from being split across two lines. @xref{w, , @code{@@w}}.@refill +@item @@xml +Enter XML completely. Pair with @code{@@end xml}. @xref{Raw +Formatter Commands}. + @item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@} Make a reference that starts with `See' in a printed manual. Follow command with a punctuation mark. Only the first argument is @@ -16118,6 +17846,72 @@ mandatory. @xref{xref, , @code{@@xref}}.@refill @end table +@node Command Syntax +@section @@-Command Syntax +@cindex @@-command syntax +@cindex Syntax, of @@-commands +@cindex Command syntax + +The character @samp{@@} is used to start special Texinfo commands. +(It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo +has four types of @@-command:@refill + +@table @asis +@item 1. Non-alphabetic commands. +These commands consist of an @@ followed by a punctuation mark or other +character that is not part of the alphabet. Non-alphabetic commands are +almost always part of the text within a paragraph, and never take any +argument. The two characters (@@ and the other one) are complete in +themselves; none is followed by braces. The non-alphabetic commands +are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@kbd{SPACE}}, +@code{@@@kbd{TAB}}, @code{@@@kbd{NL}}, @code{@@@@}, @code{@@@{}, and +@code{@@@}}.@refill + +@item 2. Alphabetic commands that do not require arguments. +These commands start with @@ followed by a word followed by left- and +right-hand braces. These commands insert special symbols in the +document; they do not require arguments. For example, +@code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}} +@result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}', +and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill + +@item 3. Alphabetic commands that require arguments within braces. +These commands start with @@ followed by a letter or a word, followed by an +argument within braces. For example, the command @code{@@dfn} indicates +the introductory or defining use of a term; it is used as follows: @samp{In +Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill + +@item 4. Alphabetic commands that occupy an entire line. +These commands occupy an entire line. The line starts with @@, +followed by the name of the command (a word); for example, @code{@@center} +or @code{@@cindex}. If no argument is needed, the word is followed by +the end of the line. If there is an argument, it is separated from +the command name by a space. Braces are not used.@refill +@end table + +@cindex Braces and argument syntax +Thus, the alphabetic commands fall into classes that have +different argument syntaxes. You cannot tell to which class a command +belongs by the appearance of its name, but you can tell by the +command's meaning: if the command stands for a glyph, it is in +class 2 and does not require an argument; if it makes sense to use the +command together with other text as part of a paragraph, the command +is in class 3 and must be followed by an argument in braces; +otherwise, it is in class 4 and uses the rest of the line as its +argument.@refill + +The purpose of having a different syntax for commands of classes 3 and +4 is to make Texinfo files easier to read, and also to help the GNU +Emacs paragraph and filling commands work properly. There is only one +exception to this rule: the command @code{@@refill}, which is always +used at the end of a paragraph immediately following the final period +or other punctuation character. @code{@@refill} takes no argument and +does @emph{not} require braces. @code{@@refill} never confuses the +Emacs paragraph commands because it cannot appear at the beginning of +a line. It is also no longer needed, since all formatters now refill +paragraphs automatically. + + @node Tips @appendix Tips and Hints @@ -16316,18 +18110,19 @@ typeset the name according to the wishes of Donald Knuth, who wrote @subsubheading Spaces Do not use spaces to format a Texinfo file, except inside of -@code{@@example} @dots{} @code{@@end example} and similar commands. +@code{@@example} @dots{} @code{@@end example} and other literal +environments and commands. @need 700 For example, @TeX{} fills the following: @example @group - @@kbd@{C-x v@} - @@kbd@{M-x vc-next-action@} - Perform the next logical operation - on the version-controlled file - corresponding to the current buffer. + @@kbd@{C-x v@} + @@kbd@{M-x vc-next-action@} + Perform the next logical operation + on the version-controlled file + corresponding to the current buffer. @end group @end example @@ -16337,23 +18132,24 @@ so it looks like this: @iftex @quotation - @kbd{C-x v} - @kbd{M-x vc-next-action} - Perform the next logical operation on the version-controlled file - corresponding to the current buffer. + @kbd{C-x v} + @kbd{M-x vc-next-action} + Perform the next logical operation on the version-controlled file + corresponding to the current buffer. @end quotation @end iftex -@ifinfo +@ifnottex @quotation `C-x v' `M-x vc-next-action' Perform the next logical operation on the version-controlled file corresponding to the current buffer. @end quotation -@end ifinfo +@end ifnottex @noindent In this case, the text should be formatted with @code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table. + @subsubheading @@code, @@samp, @@var, and @samp{---} @itemize @bullet @@ -16531,12 +18327,14 @@ Write notes for yourself at the very end of a Texinfo file after the @cindex Sample Texinfo files The first example is from the first chapter (@pxref{Short Sample}), -given here in its entirety, without commentary. The second sample +given here in its entirety, without commentary. The second includes the full texts to be used in GNU manuals. @menu -* Short Sample Texinfo File:: -* GNU Sample Texts:: +* Short Sample Texinfo File:: +* GNU Sample Texts:: +* Verbatim Copying License:: +* All-permissive Copying License:: @end menu @@ -16564,7 +18362,7 @@ it for a printed manual. @@copying This is a short example of a complete Texinfo file. -Copyright (C) 2002 Free Software Foundation, Inc. +Copyright (C) 2004 Free Software Foundation, Inc. @@end copying @@titlepage @@ -16579,13 +18377,14 @@ Copyright (C) 2002 Free Software Foundation, Inc. @@ifnottex @@node Top +@@top GNU Sample @@insertcopying @@end ifnottex @@menu * First Chapter:: The first chapter is the - only chapter in this sample. + only chapter in this sample. * Index:: Complete index. @@end menu @@ -16625,8 +18424,8 @@ This is the second item. @cindex Sample texts, GNU @cindex Full texts, GNU -Here is a sample Texinfo document with the full texts that should be -used in GNU manuals. +Following is a sample Texinfo document with the full texts that should +be used in GNU manuals. As well as the legal texts, it also serves as a practical example of how many elements in a GNU system can affect the manual. If you're not @@ -16643,28 +18442,41 @@ Here are some notes on the example: @itemize @bullet @item -@cindex $Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $ comment -@cindex CVS $Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $, in Texinfo -@cindex RCS $Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $, in Texinfo -The @samp{$Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $} comment is for CVS (@pxref{Top,, Overview, cvs, +@cindex $Id +@cindex CVS $Id +@cindex RCS $Id +@cindex Documentation identification +@cindex Identification of documentation +The @samp{$Id:} comment is for the CVS (@pxref{Top,, Overview, cvs, Concurrent Versions System}) or RCS (see rcsintro(1)) version control systems, which expand it into a string such as: @example -$Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $ +$Id: texinfo.txi,v 1.6 2006/07/17 16:12:36 espie Exp $ @end example (This is useful in all sources that use version control, not just manuals.) +You may wish to include the @samp{$Id:} comment in the @code{@@copying} +text, if you want a completely unambiguous reference to the +documentation version. + +If you want to literally write @t{@w{$}Id$}, use @code{@@w}: +@code{@@w@{$@}Id$}. @item @pindex automake@r{, and version info} +@vindex UPDATED @r{Automake variable} +@vindex VERSION @r{Automake variable} +@pindex time-stamp.el The @file{version.texi} in the @code{@@include} command is maintained automatically by Automake (@pxref{Top,, Introduction, automake, GNU Automake}). It sets the @samp{VERSION} and @samp{UPDATED} values used -elsewhere. If your distribution doesn't use Automake, you can mimic -these or equivalent settings. +elsewhere. If your distribution doesn't use Automake, but you do use +Emacs, you may find the time-stamp.el package helpful (@pxref{Time +Stamps,,,emacs,The GNU Emacs Manual}). @item -The @code{@@syncodeindex} command reflects the recommendation to use only -one index if at all possible, to make it easier for readers. +The @code{@@syncodeindex} command reflects the recommendation to use +only one index where possible, to make it easier for readers to look up +index entries. @item The @code{@@dircategory} is for constructing the Info directory. @@ -16677,12 +18489,14 @@ information about command-line usage of a given program. @xref{Manual Structure Details,,,standards, GNU Coding Standards}. @item +@cindex GNU Free Documentation License, including entire +@cindex Free Documentation License, including entire It is best to include the entire GNU Free Documentation License in a GNU manual, unless the manual is only a few pages long. Of course this sample is even shorter than that, but it includes the FDL anyway in -order to show one conventional way of doing so. The @file{fdl.texi} -file is available on the GNU machines (and in the Texinfo and other GNU -distributions). +order to show one conventional way to do so. The @file{fdl.texi} file +is available on the GNU machines and in the Texinfo and other GNU +source distributions. The FDL provides for omitting itself under certain conditions, but in that case the sample texts given here have to be modified. @xref{GNU @@ -16690,34 +18504,38 @@ Free Documentation License}. @item If your manual has invariant sections (again, see the license itself for -details), then don't forget to include them. +details), then don't forget to change the text here accordingly. + +@item +For documents that express your personal views, feelings or experiences, +it is more appropriate to use a license permitting only verbatim +copying, rather than the FDL. @xref{Verbatim Copying License}. + @end itemize Here is the sample document: -@c We do the first part of this with @example instead of @verbatim -@c because the literal @setfilename and @include confuse Automake. Argh. -@example -\input texinfo @@c -*-texinfo-*- -@@comment $Id: texinfo.txi,v 1.5 2003/03/15 19:16:10 deraadt Exp $ -@@comment %**start of header -@@setfilename sample.info -@@include version.texi -@@settitle GNU Sample @@value@{VERSION@} -@@syncodeindex pg cp -@@comment %**end of header -@@copying +@verbatim +\input texinfo @c -*-texinfo-*- +@comment $Id: texinfo.txi,v 1.6 2006/07/17 16:12:36 espie Exp $ +@comment %**start of header +@setfilename sample.info +@include version.texi +@settitle GNU Sample @value{VERSION} +@syncodeindex pg cp +@comment %**end of header +@copying This manual is for GNU Sample -(version @@value@{VERSION@}, @@value@{UPDATED@}), +(version @value{VERSION}, @value{UPDATED}), which is an example in the Texinfo documentation. -Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. +Copyright @copyright{} 2004 Free Software Foundation, Inc. -@@quotation +@quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no -Invariant Sections, with the Front-Cover texts being ``A GNU Manual,'' +Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled ``GNU Free Documentation License.'' @@ -16725,66 +18543,127 @@ License.'' (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.'' -@@end quotation -@@end copying +@end quotation +@end copying -@@dircategory Texinfo documentation system -@@direntry -* sample: (sample)Invoking sample. -@@end direntry +@dircategory Texinfo documentation system +@direntry +* sample: (sample)Invoking sample. +@end direntry -@@titlepage -@@title GNU Sample -@@subtitle for version @@value@{VERSION@}, @@value@{UPDATED@} -@@author A.U. Thor (@@email@{bug-texinfo@@@@gnu.org@}) -@@page -@@vskip 0pt plus 1filll -@@insertcopying -@@end titlepage +@titlepage +@title GNU Sample +@subtitle for version @value{VERSION}, @value{UPDATED} +@author A.U. Thor (@email{bug-texinfo@@gnu.org}) +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage -@@contents +@contents -@@ifnottex -@@node Top -@@top GNU Sample +@ifnottex +@node Top +@top GNU Sample -@@insertcopying -@@end ifnottex +@insertcopying +@end ifnottex -@@menu +@menu * Invoking sample:: * Copying This Manual:: * Index:: -@@end menu +@end menu -@@node Invoking sample -@@chapter Invoking sample +@node Invoking sample +@chapter Invoking sample -@@pindex sample -@@cindex invoking @@command@{sample@} +@pindex sample +@cindex invoking @command{sample} This is a sample manual. There is no sample program to invoke, but if there was, you could see its basic usage and command line options here. -@@node Copying This Manual -@@appendix Copying This Manual +@node Copying This Manual +@appendix Copying This Manual -@@menu +@menu * GNU Free Documentation License:: License for copying this manual. -@@end menu +@end menu -@@include fdl.texi +@include fdl.texi -@@node Index -@@unnumbered Index +@node Index +@unnumbered Index -@@printindex cp +@printindex cp -@@bye +@bye +@end verbatim + + +@node Verbatim Copying License +@section Verbatim Copying License + +@cindex Verbatim copying license +@cindex License for verbatim copying + +For software manuals and other documentation, it is important to use a +license permitting free redistribution and updating, so that when a free +program is changed, the documentation can be updated as well. + +On the other hand, for documents that express your personal views, +feelings or experiences, it is more appropriate to use a license +permitting only verbatim copying. + +Here is sample text for such a license permitting verbatim copying only. +This is just the license text itself. For a complete sample document, +see the previous sections. + +@verbatim +@copying +This document is a sample for allowing verbatim copying only. + +Copyright @copyright{} 2004 Free Software Foundation, Inc. + +@quotation +Permission is granted to make and distribute verbatim copies +of this entire document without royalty provided the +copyright notice and this permission notice are preserved. +@end quotation +@end copying +@end verbatim + + +@node All-permissive Copying License +@section All-permissive Copying License + +@cindex All-permissive copying license +@cindex License for all-permissive copying + +For software manuals and other documentation, it is important to use a +license permitting free redistribution and updating, so that when a free +program is changed, the documentation can be updated as well. + +On the other hand, for small supporting files, short manuals (under 300 +lines long) and rough documentation (README files, INSTALL files, etc.), +the full FDL would be overkill. They can use a simple all-permissive +license. + +Here is sample text for such an all-permissive license. This is just +the license text itself. For a complete sample document, see the +previous sections. + +@example +Copyright @copyright{} 2004 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. @end example @@ -16804,27 +18683,32 @@ conveniently small parts. @menu * Using Include Files:: How to use the @code{@@include} command. * texinfo-multiple-files-update:: How to create and update nodes and - menus when using included files. -* Include File Requirements:: What @code{texinfo-multiple-files-update} expects. + menus when using included files. +* Include Files Requirements:: @code{texinfo-multiple-files-update} needs. * Sample Include File:: A sample outer file with included files - within it; and a sample included file. + within it; and a sample included file. * Include Files Evolution:: How use of the @code{@@include} command - has changed over time. + has changed over time. @end menu -@node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files +@node Using Include Files @section How to Use Include Files @findex include To include another file within a Texinfo file, write the @code{@@include} command at the beginning of a line and follow it on -the same line by the name of a file to be included. For -example:@refill +the same line by the name of a file to be included. For example: @example @@include buffers.texi @end example +The name of the file is taken literally, with a single exception: +@code{@@value@{@var{var}@}} references are expanded. This makes it +possible to reliably include files in other directories in a +distribution. @xref{verbatiminclude,,@code{@@verbatiminclude}}, for +an example. + An included file should simply be a segment of text that you expect to be included as is into the overall or @dfn{outer} Texinfo file; it should not contain the standard beginning and end parts of a Texinfo @@ -16832,7 +18716,7 @@ file. In particular, you should not start an included file with a line saying @samp{\input texinfo}; if you do, that phrase is inserted into the output file as is. Likewise, you should not end an included file with an @code{@@bye} command; nothing after @code{@@bye} is -formatted.@refill +formatted. In the past, you were required to write an @code{@@setfilename} line at the beginning of an included file, but no longer. Now, it does not matter @@ -16853,7 +18737,15 @@ whole file. Either you must insert the menus and the `Next', Texinfo mode command, @code{texinfo-multiple-files-update}, that is designed for @code{@@include} files.@refill -@node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files +When an included file does not have any node lines in it, the +multiple files update command does not try to create a menu entry +for it. Consequently, you can include any file, such as a +version or an update file without node lines, not just files that +are chapters. Small includable files like this are created by +Automake (@pxref{GNU Sample Texts}). + + +@node texinfo-multiple-files-update @section @code{texinfo-multiple-files-update} @findex texinfo-multiple-files-update @@ -16930,9 +18822,9 @@ updates @strong{every} pointer and menu in @strong{all} the files and then inser master menu.@refill -@node Include File Requirements -@section Include File Requirements -@cindex Include file requirements +@node Include Files Requirements +@section Include Files Requirements +@cindex Include files requirements @cindex Requirements for include files If you plan to use the @code{texinfo-multiple-files-update} command, @@ -16956,58 +18848,40 @@ should @emph{not} contain any nodes besides the single `Top' node. The @code{texinfo-multiple-files-update} command will not process them.@refill -@node Sample Include File, Include Files Evolution, Include File Requirements, Include Files + +@node Sample Include File @section Sample File with @code{@@include} @cindex Sample @code{@@include} file @cindex Include file sample @cindex @code{@@include} file sample -Here is an example of a complete outer Texinfo file with @code{@@include} files +Here is an example of an outer Texinfo file with @code{@@include} files within it before running @code{texinfo-multiple-files-update}, which -would insert a main or master menu:@refill +would insert a main or master menu: @example @group \input texinfo @@c -*-texinfo-*- @c %**start of header -@@setfilename include-example.info +@@setfilename include-example.info @@settitle Include Example @c %**end of header @end group -@group -@@setchapternewpage odd -@@titlepage -@@sp 12 -@@center @@titlefont@{Include Example@} -@@sp 2 -@@center by Whom Ever -@end group - -@group -@@page -@@vskip 0pt plus 1filll -Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. -@@end titlepage -@end group +... @xref{Sample Texinfo Files}, for +examples of the rest of the frontmatter ... @group -@@ifinfo -@@node Top, First, , (dir) -@@top Master Menu -@@end ifinfo +@@ifnottex +@@node Top +@@top Include Example +@@end ifnottex @end group @group @@include foo.texinfo @@include bar.texinfo @@include concept-index.texinfo -@end group - -@group -@@summarycontents -@@contents - @@bye @end group @end example @@ -17016,7 +18890,7 @@ An included file, such as @file{foo.texinfo}, might look like this: @example @group -@@node First, Second, , Top +@@node First @@chapter First Chapter Contents of first chapter @dots{} @@ -17037,7 +18911,7 @@ The full contents of @file{concept-index.texinfo} might be as simple as this: The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference Manual} is named @file{elisp.texi}. This outer file contains a master menu with 417 entries and a list of 41 @code{@@include} -files.@refill +files. @node Include Files Evolution @@ -17100,10 +18974,8 @@ not paginated.)@refill * Custom Headings:: How to create your own headings and footings. @end menu -@node Headings Introduced, Heading Format, Headings, Headings -@ifinfo -@heading Headings Introduced -@end ifinfo +@node Headings Introduced +@section Headings Introduced Texinfo provides standard page heading formats for manuals that are printed on one side of each sheet of paper and for manuals that are @@ -17137,7 +19009,7 @@ blank. Text for the left part of a header or footer line is set flushleft; text for the middle part is centered; and, text for the right part is set flushright.@refill -@node Heading Format, Heading Choice, Headings Introduced, Headings +@node Heading Format @comment node-name, next, previous, up @section Standard Heading Formats @@ -17158,14 +19030,13 @@ A single-sided page looks like this: @example @group - _______________________ - | | - | chapter page number | - | | - | Start of text ... | - | ... | - | | - + _______________________ + | | + | chapter page number | + | | + | Start of text ... | + | ... | + | | @end group @end example @@ -17190,14 +19061,13 @@ Two pages, side by side as in an open book, look like this:@refill @example @group - _______________________ _______________________ - | | | | - | page number title | | chapter page number | - | | | | - | Start of text ... | | More text ... | - | ... | | ... | - | | | | - + _______________________ _______________________ + | | | | + | page number title | | chapter page number | + | | | | + | Start of text ... | | More text ... | + | ... | | ... | + | | | | @end group @end example @@ -17206,7 +19076,7 @@ The chapter name is preceded by the word ``Chapter'', the chapter number and a colon. This makes it easier to keep track of where you are in the manual.@refill -@node Heading Choice, Custom Headings, Heading Format, Headings +@node Heading Choice @comment node-name, next, previous, up @section Specifying the Type of Heading @@ -17243,7 +19113,7 @@ Specify the double-sided heading format, with chapters on new pages.@refill @noindent Texinfo lacks an @code{@@setchapternewpage even} command.@refill -@node Custom Headings, , Heading Choice, Headings +@node Custom Headings @comment node-name, next, previous, up @section How to Make Your Own Headings @@ -17315,7 +19185,6 @@ headers or footers.@refill @findex oddfooting @item @@evenheading @var{left} @@| @var{center} @@| @var{right} @itemx @@oddheading @var{left} @@| @var{center} @@| @var{right} - @itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right} @itemx @@oddfooting @var{left} @@| @var{center} @@| @var{right} @@ -17424,10 +19293,9 @@ command and you can use the @kbd{M-x Info-validate} command.@refill * Running Info-Validate:: How to find badly referenced nodes. @end menu -@node makeinfo Preferred, Debugging with Info, Catching Mistakes, Catching Mistakes -@ifinfo -@heading @code{makeinfo} Find Errors -@end ifinfo + +@node makeinfo Preferred +@section @code{makeinfo} Find Errors The @code{makeinfo} program does an excellent job of catching errors and reporting them---far better than @code{texinfo-format-region} or @@ -17443,7 +19311,7 @@ errors. This is the best way to work with Texinfo. But if you cannot use @code{makeinfo}, or your problem is very puzzling, then you may want to use the tools described in this appendix.@refill -@node Debugging with Info, Debugging with TeX, makeinfo Preferred, Catching Mistakes +@node Debugging with Info @comment node-name, next, previous, up @section Catching Errors with Info Formatting @cindex Catching errors with Info formatting @@ -17484,10 +19352,10 @@ occurs, or not long after it. The buffer will look like this:@refill * Menu: * Using texinfo-show-structure:: How to use - `texinfo-show-structure' - to catch mistakes. + `texinfo-show-structure' + to catch mistakes. * Running Info-Validate:: How to check for - unreferenced nodes. + unreferenced nodes. @@end menus @point{} ---------- Buffer: *Info Region* ---------- @@ -17599,21 +19467,21 @@ invoked the debugger. This is the backtrace it produced:@refill @example ---------- Buffer: *Backtrace* ---------- Signalling: (search-failed "[@},]") - re-search-forward("[@},]") - (while ...) - (let ...) - texinfo-format-parse-args() - (let ...) - texinfo-format-xref() - funcall(texinfo-format-xref) - (if ...) - (let ...) - (if ...) - (while ...) - texinfo-format-scan() - (save-excursion ...) - (let ...) - texinfo-format-region(103370 103631) + re-search-forward("[@},]") + (while ...) + (let ...) + texinfo-format-parse-args() + (let ...) + texinfo-format-xref() + funcall(texinfo-format-xref) + (if ...) + (let ...) + (if ...) + (while ...) + texinfo-format-scan() + (save-excursion ...) + (let ...) + texinfo-format-region(103370 103631) * call-interactively(texinfo-format-region) ---------- Buffer: *Backtrace* ---------- @end example @@ -17630,7 +19498,7 @@ not find the missing right-hand brace.@refill Manual}, for more information.@refill @end ignore -@node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes +@node Debugging with TeX @comment node-name, next, previous, up @section Catching Errors with @TeX{} Formatting @cindex Catching errors with @TeX{} formatting @@ -17668,7 +19536,7 @@ Runaway argument? indices.) @@refill @@ETC. ! Paragraph ended before @@xref was complete. <to be read again> - @@par + @@par l.27 ? @@ -17759,7 +19627,7 @@ again. (Note the use of the backslash, @samp{\}. @TeX{} uses @samp{\} instead of @samp{@@}; and in this circumstance, you are working directly with @TeX{}, not with Texinfo.)@refill -@node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes +@node Using texinfo-show-structure @comment node-name, next, previous, up @section Using @code{texinfo-show-structure} @cindex Showing the structure of a file @@ -17784,18 +19652,18 @@ produced by running @code{texinfo-show-structure} on this manual:@refill @example @group - Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\| - unnum\\|major\\|chapheading \\|heading \\|appendix\\)" - in buffer texinfo.texi. - @dots{} - 4177:@@chapter Nodes - 4198: @@heading Two Paths - 4231: @@section Node and Menu Illustration - 4337: @@section The @@code@{@@@@node@} Command - 4393: @@subheading Choosing Node and Pointer Names - 4417: @@subsection How to Write an @@code@{@@@@node@} Line - 4469: @@subsection @@code@{@@@@node@} Line Tips - @dots{} +Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\| +unnum\\|major\\|chapheading \\|heading \\|appendix\\)" +in buffer texinfo.texi. +@dots{} +4177:@@chapter Nodes +4198: @@heading Two Paths +4231: @@section Node and Menu Illustration +4337: @@section The @@code@{@@@@node@} Command +4393: @@subheading Choosing Node and Pointer Names +4417: @@subsection How to Write an @@code@{@@@@node@} Line +4469: @@subsection @@code@{@@@@node@} Line Tips +@dots{} @end group @end example @@ -17831,7 +19699,7 @@ You can remind yourself of the structure of a Texinfo file by looking at the list in the @samp{*Occur*} window; and if you have mis-named a node or left out a section, you can correct the mistake.@refill -@node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes +@node Using occur @comment node-name, next, previous, up @section Using @code{occur} @cindex Occurrences, listing with @code{@@occur} @@ -17871,7 +19739,7 @@ therefore have the same `Up' pointer.@refill @xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual}, for more information.@refill -@node Running Info-Validate, , Using occur, Catching Mistakes +@node Running Info-Validate @comment node-name, next, previous, up @section Finding Badly Referenced Nodes @findex Info-validate @@ -17901,7 +19769,7 @@ if you write an Info file from scratch.@refill * Splitting:: How to split a file manually. @end menu -@node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate +@node Using Info-validate @subsection Running @code{Info-validate} @cindex Running @code{Info-validate} @cindex Info validating a large file @@ -17958,7 +19826,7 @@ on a large file, you must run @code{texinfo-format-buffer} with an argument so that it does not split the Info file; and you must create a tag table for the unsplit file. -@node Unsplit, Tagifying, Using Info-validate, Running Info-Validate +@node Unsplit @comment node-name, next, previous, up @subsection Creating an Unsplit File @cindex Creating an unsplit file @@ -17967,7 +19835,7 @@ tag table for the unsplit file. You can run @code{Info-validate} only on a single Info file that has a tag table. The command will not work on the indirect subfiles that are generated when a master file is split. If you have a large file -(longer than 70,000 bytes or so), you need to run the +(longer than 300,000 bytes or so), you need to run the @code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such a way that it does not create indirect subfiles. You will also need to create a tag table for the Info file. After you have done this, @@ -17996,7 +19864,7 @@ a tag table for it. @refill @cindex Making a tag table manually @cindex Tag table, making manually -@node Tagifying, Splitting, Unsplit, Running Info-Validate +@node Tagifying @subsection Tagifying a File After creating an unsplit Info file, you must create a tag table for @@ -18033,7 +19901,7 @@ After you have validated the node structure, you can rerun tag table and split the file automatically, or you can make the tag table and split the file manually.@refill -@node Splitting, , Tagifying, Running Info-Validate +@node Splitting @comment node-name, next, previous, up @subsection Splitting a File Manually @cindex Splitting an Info file manually @@ -18085,6 +19953,10 @@ The primary file still functions as an Info file, but it contains just the tag table and a directory of subfiles.@refill +@ignore +The simple description in the command summary seems sufficient to me +these days, so ignore this appendix. --karl, 13mar04. + @node Refilling Paragraphs @appendix Refilling Paragraphs @cindex Refilling paragraphs @@ -18124,114 +19996,7 @@ paragraph that should be filled. They do not append @code{@@refill} to the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}} and therefore do not refill or indent them.@refill - -@node Command Syntax -@appendix @@-Command Syntax -@cindex @@-command syntax -@cindex Syntax, of @@-commands -@cindex Command syntax - -The character @samp{@@} is used to start special Texinfo commands. -(It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo -has four types of @@-command:@refill - -@table @asis -@item 1. Non-alphabetic commands. -These commands consist of an @@ followed by a punctuation mark or other -character that is not part of the alphabet. Non-alphabetic commands are -almost always part of the text within a paragraph, and never take any -argument. The two characters (@@ and the other one) are complete in -themselves; none is followed by braces. The non-alphabetic commands -are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@kbd{SPACE}}, -@code{@@@kbd{TAB}}, @code{@@@kbd{NL}}, @code{@@@@}, @code{@@@{}, and -@code{@@@}}.@refill - -@item 2. Alphabetic commands that do not require arguments. -These commands start with @@ followed by a word followed by left- and -right-hand braces. These commands insert special symbols in the -document; they do not require arguments. For example, -@code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}} -@result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}', -and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill - -@item 3. Alphabetic commands that require arguments within braces. -These commands start with @@ followed by a letter or a word, followed by an -argument within braces. For example, the command @code{@@dfn} indicates -the introductory or defining use of a term; it is used as follows: @samp{In -Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill - -@item 4. Alphabetic commands that occupy an entire line. -These commands occupy an entire line. The line starts with @@, -followed by the name of the command (a word); for example, @code{@@center} -or @code{@@cindex}. If no argument is needed, the word is followed by -the end of the line. If there is an argument, it is separated from -the command name by a space. Braces are not used.@refill -@end table - -@cindex Braces and argument syntax -Thus, the alphabetic commands fall into classes that have -different argument syntaxes. You cannot tell to which class a command -belongs by the appearance of its name, but you can tell by the -command's meaning: if the command stands for a glyph, it is in -class 2 and does not require an argument; if it makes sense to use the -command together with other text as part of a paragraph, the command -is in class 3 and must be followed by an argument in braces; -otherwise, it is in class 4 and uses the rest of the line as its -argument.@refill - -The purpose of having a different syntax for commands of classes 3 and -4 is to make Texinfo files easier to read, and also to help the GNU -Emacs paragraph and filling commands work properly. There is only one -exception to this rule: the command @code{@@refill}, which is always -used at the end of a paragraph immediately following the final period -or other punctuation character. @code{@@refill} takes no argument and -does @emph{not} require braces. @code{@@refill} never confuses the -Emacs paragraph commands because it cannot appear at the beginning of -a line.@refill - - -@node Obtaining TeX -@appendix How to Obtain @TeX{} -@cindex Obtaining @TeX{} -@cindex @TeX{}, how to obtain - -@c !!! Here is information about obtaining TeX. Update it whenever. -@c !!! Also consider updating TeX.README on ftp.gnu.org. -@c Updated by RJC on 1 March 1995, conversation with MacKay. -@c Updated by kb@cs.umb.edu on 29 July 1996. -@c Updated by kb@cs.umb.edu on 25 April 1997. -@c Updated by kb@cs.umb.edu on 27 February 1998. -@TeX{} is freely redistributable. You can obtain @TeX{} for Unix -systems via anonymous ftp or on physical media. The core material -consists of the Web2c @TeX{} distribution (@uref{http://tug.org/web2c}). - -Instructions for retrieval by anonymous ftp and information on other -available distributions: -@example -@uref{ftp://tug.org/tex/unixtex.ftp} -@uref{http://tug.org/unixtex.ftp} -@end example - -The Free Software Foundation provides a core distribution on its Source -Code CD-ROM suitable for printing Texinfo manuals. To order it, contact: - -@display -@group -Free Software Foundation, Inc. -59 Temple Place Suite 330 -Boston, MA @ @ 02111-1307 -USA -Telephone: @w{+1-617-542-5942} -Fax: (including Japan) @w{+1-617-542-2652} -Free Dial Fax (in Japan): -@w{ } @w{ } @w{ } 0031-13-2473 (KDD) -@w{ } @w{ } @w{ } 0066-3382-0158 (IDC) -Electronic mail: @code{gnu@@gnu.org} -@end group -@end display - -Many other @TeX{} distributions are available; see -@uref{http://tug.org/}. +@end ignore @c These are no longer ``new'', and the explanations @@ -18378,16 +20143,10 @@ Kill the @code{makeinfo} formatting job. @c subheading Typeset and Print @noindent -Typeset and print Texinfo documents from within Emacs.@refill +Typeset and print Texinfo documents from within Emacs. -@ifinfo @noindent @xref{Printing}. -@end ifinfo -@iftex -@noindent -@xref{Printing, , Formatting and Printing}. -@end iftex @table @kbd @item C-c C-t C-b @@ -18565,7 +20324,7 @@ Format blocks of text. @table @kbd @item @@cartouche -Draw rounded box surrounding text (not in Info). +Draw rounded box surrounding text (no effect in Info). @item @@enumerate @var{optional-arg} Enumerate a list with letters or numbers. @@ -18591,7 +20350,7 @@ For an example of Lisp code. @item @@smallexample @itemx @@smalllisp -Like @@table and @@lisp @r{but for} @@smallbook. +Like @@table and @@lisp, but for (originally) @@smallbook. @end table @c subheading Conditionals diff --git a/gnu/usr.bin/texinfo/info/Makefile.am b/gnu/usr.bin/texinfo/info/Makefile.am index 9d5d989089a..f75bfd08c73 100644 --- a/gnu/usr.bin/texinfo/info/Makefile.am +++ b/gnu/usr.bin/texinfo/info/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.4 2002/06/10 13:51:03 espie Exp $ +# $Id: Makefile.am,v 1.5 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/info. # Run automake in .. to produce Makefile.in from this. # @@ -10,37 +10,25 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -noinst_PROGRAMS = makedoc - # Use `ginfo' for building to avoid confusion with the standard `info' # target. Removes the `g' in the install rule before applying any # user-specified name transformations. bin_PROGRAMS = ginfo infokey -transform = s/ginfo/info/; @program_transform_name@ +transform = s/ginfo/info/; $(program_transform_name) localedir = $(datadir)/locale +infodir2 = $(datadir)/info # -I. for funs.h. # Automake puts -I.. and -I$(srcdir) into DEFS by default, but # we need to override it, so include them ourselves. INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir) -DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@ -LDADD = ../lib/libtxi.a @TERMLIBS@ @LIBINTL@ +DEFS += -DLOCALEDIR=\"$(localedir)\" -DINFODIR=\"$(infodir)\" \ + -DINFODIR2=\"$(infodir2)\" +LDADD = ../lib/libtxi.a $(TERMLIBS) $(LIBINTL) EXTRA_DIST = README pcterm.c -if TEXINFO_MAINT -# The files `doc.c' and `funs.h' are created by ./makedoc run over the source -# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file -# listing the functions found. `doc.c' is a structure containing pointers -# to those functions along with completable names and documentation strings. -BUILT_SOURCES = doc.c funs.h key.c -else -# don't make installers rebuild them. -generated_sources = doc.c funs.h key.c -endif - -makedoc_SOURCES = makedoc.c ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h \ echo-area.c echo-area.h \ filesys.c filesys.h footnotes.c footnotes.h gc.c gc.h \ @@ -48,9 +36,28 @@ ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h \ infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \ search.c search.h session.c session.h signals.c signals.h \ termdep.h terminal.c terminal.h tilde.c tilde.h \ - variables.c variables.h window.c window.h \ - $(BUILT_SOURCES) $(generated_sources) -infokey_SOURCES = infokey.c infokey.h key.c key.h + variables.c variables.h window.c window.h +nodist_ginfo_SOURCES = doc.c funs.h +infokey_SOURCES = infokey.c infokey.h key.h +nodist_infokey_SOURCES = key.c funs.h + +# The files `doc.c', `key.c' and `funs.h' are created by ./makedoc run over the +# source files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file +# listing the functions found. `doc.c' is a structure containing pointers +# to those functions along with completable names and documentation strings. +# +generated_sources = doc.c key.c funs.h + +# We need a linear ordering to prevent race condition in parallel make. +# See the node ``(automake)Multiple Outputs'' for an explanation. +doc.c: key.c +key.c: funs.h + +# These files are not distributed. +DISTCLEANFILES = $(generated_sources) + +noinst_PROGRAMS = makedoc +makedoc_SOURCES = makedoc.c # Files with Info commands defined that makedoc should read. cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \ @@ -58,9 +65,10 @@ cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \ $(srcdir)/footnotes.c $(srcdir)/variables.c # The $(EXEEXT) should be added by Automake, but isn't. Fine. -$(BUILT_SOURCES): makedoc$(EXEEXT) $(cmd_sources) -# This is insufficient. We really need them not to be in the -# distribution in the first place, but it seems Automake does not -# currently allow that. - rm -f $(BUILT_SOURCES) - ./makedoc $(cmd_sources) +$(generated_sources): makedoc$(EXEEXT) $(cmd_sources) + rm -f $(generated_sources) + $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources) + +# The following hack is necessary to hint make before the automatic +# dependencies are built. +BUILT_SOURCES = funs.h diff --git a/gnu/usr.bin/texinfo/info/Makefile.in b/gnu/usr.bin/texinfo/info/Makefile.in index e89ea582a08..cf84054351b 100644 --- a/gnu/usr.bin/texinfo/info/Makefile.in +++ b/gnu/usr.bin/texinfo/info/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.8 2002/06/10 13:51:03 espie Exp $ +# $Id: Makefile.in,v 1.9 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/info. # Run automake in .. to produce Makefile.in from this. # @@ -25,43 +25,21 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SHELL = @SHELL@ + +SOURCES = $(ginfo_SOURCES) $(nodist_ginfo_SOURCES) $(infokey_SOURCES) $(nodist_infokey_SOURCES) $(makedoc_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) NORMAL_INSTALL = : PRE_INSTALL = : @@ -69,76 +47,204 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ +build_triplet = @build@ host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -transform = s/ginfo/info/; @program_transform_name@ +bin_PROGRAMS = ginfo$(EXEEXT) infokey$(EXEEXT) +noinst_PROGRAMS = makedoc$(EXEEXT) +subdir = info +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am_ginfo_OBJECTS = dir.$(OBJEXT) display.$(OBJEXT) dribble.$(OBJEXT) \ + echo-area.$(OBJEXT) filesys.$(OBJEXT) footnotes.$(OBJEXT) \ + gc.$(OBJEXT) indices.$(OBJEXT) info-utils.$(OBJEXT) \ + info.$(OBJEXT) infodoc.$(OBJEXT) infomap.$(OBJEXT) \ + m-x.$(OBJEXT) man.$(OBJEXT) nodemenu.$(OBJEXT) nodes.$(OBJEXT) \ + search.$(OBJEXT) session.$(OBJEXT) signals.$(OBJEXT) \ + terminal.$(OBJEXT) tilde.$(OBJEXT) variables.$(OBJEXT) \ + window.$(OBJEXT) +nodist_ginfo_OBJECTS = doc.$(OBJEXT) +ginfo_OBJECTS = $(am_ginfo_OBJECTS) $(nodist_ginfo_OBJECTS) +ginfo_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +ginfo_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_infokey_OBJECTS = infokey.$(OBJEXT) +nodist_infokey_OBJECTS = key.$(OBJEXT) +infokey_OBJECTS = $(am_infokey_OBJECTS) $(nodist_infokey_OBJECTS) +infokey_LDADD = $(LDADD) +infokey_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_makedoc_OBJECTS = makedoc.$(OBJEXT) +makedoc_OBJECTS = $(am_makedoc_OBJECTS) +makedoc_LDADD = $(LDADD) +makedoc_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ginfo_SOURCES) $(nodist_ginfo_SOURCES) $(infokey_SOURCES) \ + $(nodist_infokey_SOURCES) $(makedoc_SOURCES) +DIST_SOURCES = $(ginfo_SOURCES) $(infokey_SOURCES) $(makedoc_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +transform = s/ginfo/info/; $(program_transform_name) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\" -DINFODIR=\"$(infodir)\" \ + -DINFODIR2=\"$(infodir2)\" DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ -HAVE_LIB = @HAVE_LIB@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HELP2MAN = @HELP2MAN@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_WARNINGS_FALSE = @INSTALL_WARNINGS_FALSE@ +INSTALL_WARNINGS_TRUE = @INSTALL_WARNINGS_TRUE@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ +LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LTLIB = @LTLIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ TERMLIBS = @TERMLIBS@ +TOOLS_ONLY_FALSE = @TOOLS_ONLY_FALSE@ +TOOLS_ONLY_TRUE = @TOOLS_ONLY_TRUE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ - -noinst_PROGRAMS = makedoc - -# Use `ginfo' for building to avoid confusion with the standard `info' -# target. Removes the `g' in the install rule before applying any -# user-specified name transformations. -bin_PROGRAMS = ginfo infokey - +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +native_tools = @native_tools@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ localedir = $(datadir)/locale +infodir2 = $(datadir)/info # -I. for funs.h. # Automake puts -I.. and -I$(srcdir) into DEFS by default, but # we need to override it, so include them ourselves. INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir) -DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@ -LDADD = ../lib/libtxi.a @TERMLIBS@ @LIBINTL@ - +LDADD = ../lib/libtxi.a $(TERMLIBS) $(LIBINTL) EXTRA_DIST = README pcterm.c - -# The files `doc.c' and `funs.h' are created by ./makedoc run over the source -# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file -# listing the functions found. `doc.c' is a structure containing pointers -# to those functions along with completable names and documentation strings. -@TEXINFO_MAINT_TRUE@BUILT_SOURCES = doc.c funs.h key.c -# don't make installers rebuild them. -@TEXINFO_MAINT_FALSE@generated_sources = doc.c funs.h key.c - -makedoc_SOURCES = makedoc.c ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h \ echo-area.c echo-area.h \ filesys.c filesys.h footnotes.c footnotes.h gc.c gc.h \ @@ -146,109 +252,85 @@ ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h \ infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \ search.c search.h session.c session.h signals.c signals.h \ termdep.h terminal.c terminal.h tilde.c tilde.h \ - variables.c variables.h window.c window.h \ - $(BUILT_SOURCES) $(generated_sources) + variables.c variables.h window.c window.h + +nodist_ginfo_SOURCES = doc.c funs.h +infokey_SOURCES = infokey.c infokey.h key.h +nodist_infokey_SOURCES = key.c funs.h -infokey_SOURCES = infokey.c infokey.h key.c key.h +# The files `doc.c', `key.c' and `funs.h' are created by ./makedoc run over the +# source files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file +# listing the functions found. `doc.c' is a structure containing pointers +# to those functions along with completable names and documentation strings. +# +generated_sources = doc.c key.c funs.h + +# These files are not distributed. +DISTCLEANFILES = $(generated_sources) +makedoc_SOURCES = makedoc.c # Files with Info commands defined that makedoc should read. cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \ $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \ $(srcdir)/footnotes.c $(srcdir)/variables.c -subdir = info -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = ginfo$(EXEEXT) infokey$(EXEEXT) -noinst_PROGRAMS = makedoc$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) - -@TEXINFO_MAINT_TRUE@am__objects_1 = doc.$(OBJEXT) key.$(OBJEXT) -@TEXINFO_MAINT_FALSE@am__objects_2 = doc.$(OBJEXT) key.$(OBJEXT) -am_ginfo_OBJECTS = dir.$(OBJEXT) display.$(OBJEXT) dribble.$(OBJEXT) \ - echo-area.$(OBJEXT) filesys.$(OBJEXT) footnotes.$(OBJEXT) \ - gc.$(OBJEXT) indices.$(OBJEXT) info-utils.$(OBJEXT) \ - info.$(OBJEXT) infodoc.$(OBJEXT) infomap.$(OBJEXT) \ - m-x.$(OBJEXT) man.$(OBJEXT) nodemenu.$(OBJEXT) nodes.$(OBJEXT) \ - search.$(OBJEXT) session.$(OBJEXT) signals.$(OBJEXT) \ - terminal.$(OBJEXT) tilde.$(OBJEXT) variables.$(OBJEXT) \ - window.$(OBJEXT) $(am__objects_1) $(am__objects_2) -ginfo_OBJECTS = $(am_ginfo_OBJECTS) -ginfo_LDADD = $(LDADD) -ginfo_DEPENDENCIES = ../lib/libtxi.a -ginfo_LDFLAGS = -am_infokey_OBJECTS = infokey.$(OBJEXT) key.$(OBJEXT) -infokey_OBJECTS = $(am_infokey_OBJECTS) -infokey_LDADD = $(LDADD) -infokey_DEPENDENCIES = ../lib/libtxi.a -infokey_LDFLAGS = -am_makedoc_OBJECTS = makedoc.$(OBJEXT) -makedoc_OBJECTS = $(am_makedoc_OBJECTS) -makedoc_LDADD = $(LDADD) -makedoc_DEPENDENCIES = ../lib/libtxi.a -makedoc_LDFLAGS = -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dir.Po ./$(DEPDIR)/display.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/doc.Po ./$(DEPDIR)/dribble.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/echo-area.Po ./$(DEPDIR)/filesys.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/footnotes.Po ./$(DEPDIR)/gc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/indices.Po ./$(DEPDIR)/info-utils.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/info.Po ./$(DEPDIR)/infodoc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/infokey.Po ./$(DEPDIR)/infomap.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/key.Po ./$(DEPDIR)/m-x.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/makedoc.Po ./$(DEPDIR)/man.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/nodemenu.Po ./$(DEPDIR)/nodes.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/search.Po ./$(DEPDIR)/session.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/signals.Po ./$(DEPDIR)/terminal.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/tilde.Po ./$(DEPDIR)/variables.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/window.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -DIST_SOURCES = $(ginfo_SOURCES) $(infokey_SOURCES) $(makedoc_SOURCES) -DIST_COMMON = README Makefile.am Makefile.in -SOURCES = $(ginfo_SOURCES) $(infokey_SOURCES) $(makedoc_SOURCES) +# The following hack is necessary to hint make before the automatic +# dependencies are built. +BUILT_SOURCES = funs.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu info/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu info/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ - p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \ - f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - f=`echo "$$f" | sed -e 's,^.*/,,'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @@ -267,7 +349,7 @@ makedoc$(EXEEXT): $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES) $(LINK) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -300,29 +382,21 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variables.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window.Po@am__quote@ -distclean-depend: - -rm -rf ./$(DEPDIR) - .c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` -CCDEPMODE = @CCDEPMODE@ -install-info-am: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -331,6 +405,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -342,8 +417,24 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -352,25 +443,29 @@ GTAGS: && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir)$$dir \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ @@ -378,13 +473,15 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) - -install: install-am + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -395,7 +492,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -403,7 +500,8 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -415,14 +513,17 @@ clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-tags + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -431,39 +532,53 @@ install-data-am: install-exec-am: install-binPROGRAMS +install-info: install-info-am + install-man: installcheck-am: maintainer-clean: maintainer-clean-am - + -rm -rf ./$(DEPDIR) + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + uninstall-am: uninstall-binPROGRAMS uninstall-info-am -.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-noinstPROGRAMS distclean distclean-compile \ - distclean-depend distclean-generic distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-exec install-exec-am \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-info-am +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-info-am + +# We need a linear ordering to prevent race condition in parallel make. +# See the node ``(automake)Multiple Outputs'' for an explanation. +doc.c: key.c +key.c: funs.h # The $(EXEEXT) should be added by Automake, but isn't. Fine. -$(BUILT_SOURCES): makedoc$(EXEEXT) $(cmd_sources) -# This is insufficient. We really need them not to be in the -# distribution in the first place, but it seems Automake does not -# currently allow that. - rm -f $(BUILT_SOURCES) - ./makedoc $(cmd_sources) +$(generated_sources): makedoc$(EXEEXT) $(cmd_sources) + rm -f $(generated_sources) + $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gnu/usr.bin/texinfo/info/dir.c b/gnu/usr.bin/texinfo/info/dir.c index f36a920126f..a42e77dec1f 100644 --- a/gnu/usr.bin/texinfo/info/dir.c +++ b/gnu/usr.bin/texinfo/info/dir.c @@ -1,7 +1,7 @@ /* dir.c -- how to build a special "dir" node from "localdir" files. - $Id: dir.c,v 1.3 2000/02/09 02:18:39 espie Exp $ + $Id: dir.c,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,11 @@ with the addition of the menus of every file named in the array dirs_to_add which are found in INFOPATH. */ -static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding (); +static void add_menu_to_file_buffer (char *contents, long int size, + FILE_BUFFER *fb); +static void insert_text_into_fb_at_binding (FILE_BUFFER *fb, + SEARCH_BINDING *binding, char *text, int textlen); +void maybe_build_dir_node (char *dirname); static char *dirs_to_add[] = { "dir", "localdir", (char *)NULL @@ -45,8 +49,7 @@ typedef struct } dir_file_list_entry_type; static int -new_dir_file_p (test) - struct stat *test; +new_dir_file_p (struct stat *test) { static unsigned dir_file_list_len = 0; static dir_file_list_entry_type *dir_file_list = NULL; @@ -70,8 +73,7 @@ new_dir_file_p (test) void -maybe_build_dir_node (dirname) - char *dirname; +maybe_build_dir_node (char *dirname) { int path_index, update_tags; char *this_dir; @@ -162,10 +164,7 @@ maybe_build_dir_node (dirname) to the menu found in FB->contents. Second argument SIZE is the total size of CONTENTS. */ static void -add_menu_to_file_buffer (contents, size, fb) - char *contents; - long size; - FILE_BUFFER *fb; +add_menu_to_file_buffer (char *contents, long int size, FILE_BUFFER *fb) { SEARCH_BINDING contents_binding, fb_binding; long contents_offset, fb_offset; @@ -271,11 +270,8 @@ add_menu_to_file_buffer (contents, size, fb) } static void -insert_text_into_fb_at_binding (fb, binding, text, textlen) - FILE_BUFFER *fb; - SEARCH_BINDING *binding; - char *text; - int textlen; +insert_text_into_fb_at_binding (FILE_BUFFER *fb, + SEARCH_BINDING *binding, char *text, int textlen) { char *contents; long start, end; diff --git a/gnu/usr.bin/texinfo/info/display.c b/gnu/usr.bin/texinfo/info/display.c index 8a557f36371..160cccac532 100644 --- a/gnu/usr.bin/texinfo/info/display.c +++ b/gnu/usr.bin/texinfo/info/display.c @@ -1,7 +1,7 @@ /* display.c -- How to display Info windows. - $Id: display.c,v 1.3 2002/06/10 13:51:03 espie Exp $ + $Id: display.c,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,15 +17,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #include "info.h" #include "display.h" -extern int info_any_buffered_input_p (); /* Found in session.c. */ +extern int info_any_buffered_input_p (void); /* Found in session.c. */ -static void free_display (); -static DISPLAY_LINE **make_display (); +static void free_display (DISPLAY_LINE **display); +static DISPLAY_LINE **make_display (int width, int height); + +void handle_tag (char *tag); +void handle_tag_start (char *tag); +void handle_tag_end (char *tag); /* An array of display lines which tell us what is currently visible on the display. */ @@ -36,8 +40,7 @@ int display_inhibited = 0; /* Initialize THE_DISPLAY to WIDTH and HEIGHT, with nothing in it. */ void -display_initialize_display (width, height) - int width, height; +display_initialize_display (int width, int height) { free_display (the_display); the_display = make_display (width, height); @@ -46,13 +49,11 @@ display_initialize_display (width, height) /* Clear all of the lines in DISPLAY making the screen blank. */ void -display_clear_display (display) - DISPLAY_LINE **display; +display_clear_display (DISPLAY_LINE **display) { register int i; - register DISPLAY_LINE *display_line; - for (i = 0; (display_line = display[i]); i++) + for (i = 0; display[i]; i++) { display[i]->text[0] = '\0'; display[i]->textlen = 0; @@ -66,8 +67,7 @@ int display_was_interrupted_p = 0; /* Update the windows pointed to by WINDOW in the_display. This actually writes the text on the screen. */ void -display_update_display (window) - WINDOW *window; +display_update_display (WINDOW *window) { register WINDOW *win; @@ -91,11 +91,36 @@ display_update_display (window) display_update_one_window (the_echo_area); } +void +handle_tag_start (char *tag) +{ + /* TODO really handle this tag. */ + return; +} + +void +handle_tag_end (char *tag) +{ + /* TODO really handle this tag. */ + return; +} + +void +handle_tag (char *tag) +{ + if (tag[0] == '/') + { + tag++; + handle_tag_end (tag); + } + else + handle_tag_start (tag); +} + /* Display WIN on the_display. Unlike display_update_display (), this function only does one window. */ void -display_update_one_window (win) - WINDOW *win; +display_update_one_window (WINDOW *win) { register char *nodetext; /* Current character to display. */ register char *last_node_char; /* Position of the last character in node. */ @@ -136,7 +161,7 @@ display_update_one_window (win) for (; nodetext < last_node_char; nodetext++) { - char *rep, *rep_carried_over, rep_temp[2]; + char *rep = NULL, *rep_carried_over, rep_temp[2]; int replen; if (isprint (*nodetext)) @@ -152,6 +177,43 @@ display_update_one_window (win) { replen = win->width - pl_index + pl_ignore; } + else if (*nodetext == '\0' + && (nodetext + 2) < last_node_char + && *(nodetext + 1) == '\b' + && *(nodetext + 2) == '[') + { + /* Found new style tag/cookie \0\b[ + Read until the closing tag \0\b] */ + int element_len = 0; + char *element; + + /* Skip the escapes. */ + nodetext += 3; + + while (!(*nodetext == '\0' + && *(nodetext + 1) == '\b' + && *(nodetext + 2) == ']')) + { + nodetext++; + element_len++; + } + + element = (char *) malloc (element_len + 1); + strncpy (element, nodetext - element_len, element_len); + + /* Skip the escapes. */ + nodetext += 2; + pl_ignore += element_len + 5; + /* Append string terminator. */ + element[element_len] = '\0'; + + handle_tag (element); + + /* Over and out */ + free (element); + + continue; + } else { rep = printed_representation (*nodetext, pl_index); @@ -211,7 +273,7 @@ display_update_one_window (win) to the next line. */ for (i = 0; pl_index < (win->width + pl_ignore - 1);) printed_line[pl_index++] = rep[i++]; - + rep_carried_over = rep + i; /* If printing the last character in this window couldn't @@ -233,8 +295,10 @@ display_update_one_window (win) entry = display[line_index + win->first_row]; /* If the screen line is inversed, then we have to clear - the line from the screen first. Why, I don't know. */ - if (entry->inverse + the line from the screen first. Why, I don't know. + (But don't do this if we have no visible entries, as can + happen if the window is shrunk very small.) */ + if ((entry && entry->inverse) /* Need to erase the line if it has escape sequences. */ || (raw_escapes_p && strchr (entry->text, '\033') != 0)) { @@ -272,7 +336,7 @@ display_update_one_window (win) fflush (stdout); /* Update the display text buffer. */ - if (strlen (printed_line) > screenwidth) + if (strlen (printed_line) > (unsigned int) screenwidth) /* printed_line[] can include more than screenwidth characters if we are under -R and there are escape sequences in it. However, entry->text was @@ -322,7 +386,7 @@ display_update_one_window (win) printed_line[0] = '\0'; begin = nodetext; - + while ((nodetext < last_node_char) && (*nodetext != '\n')) nodetext++; } @@ -384,8 +448,7 @@ display_update_one_window (win) for no scrolling to take place in the case that the terminal doesn't support it. This doesn't matter to us. */ void -display_scroll_display (start, end, amount) - int start, end, amount; +display_scroll_display (int start, int end, int amount) { register int i, last; DISPLAY_LINE *temp; @@ -455,10 +518,8 @@ display_scroll_display (start, end, amount) starts that used to appear in this window. OLD_COUNT is the number of lines that appear in the OLD_STARTS array. */ void -display_scroll_line_starts (window, old_pagetop, old_starts, old_count) - WINDOW *window; - int old_pagetop, old_count; - char **old_starts; +display_scroll_line_starts (WINDOW *window, int old_pagetop, + char **old_starts, int old_count) { register int i, old, new; /* Indices into the line starts arrays. */ int last_new, last_old; /* Index of the last visible line. */ @@ -530,8 +591,7 @@ display_scroll_line_starts (window, old_pagetop, old_starts, old_count) /* Move the screen cursor to directly over the current character in WINDOW. */ void -display_cursor_at_point (window) - WINDOW *window; +display_cursor_at_point (WINDOW *window) { int vpos, hpos; @@ -549,8 +609,7 @@ display_cursor_at_point (window) /* Make a DISPLAY_LINE ** with width and height. */ static DISPLAY_LINE ** -make_display (width, height) - int width, height; +make_display (int width, int height) { register int i; DISPLAY_LINE **display; @@ -570,8 +629,7 @@ make_display (width, height) /* Free the storage allocated to DISPLAY. */ static void -free_display (display) - DISPLAY_LINE **display; +free_display (DISPLAY_LINE **display) { register int i; register DISPLAY_LINE *display_line; diff --git a/gnu/usr.bin/texinfo/info/display.h b/gnu/usr.bin/texinfo/info/display.h index 4ddaa9e3725..e0e6ef0c9f0 100644 --- a/gnu/usr.bin/texinfo/info/display.h +++ b/gnu/usr.bin/texinfo/info/display.h @@ -1,10 +1,10 @@ /* display.h -- How the display in Info is done. - $Id: display.h,v 1.2 1999/01/11 16:38:07 espie Exp $ + $Id: display.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,33 +45,34 @@ extern int display_inhibited; extern int display_was_interrupted_p; /* Initialize THE_DISPLAY to WIDTH and HEIGHT, with nothing in it. */ -extern void display_initialize_display (); +extern void display_initialize_display (int width, int height); /* Clear all of the lines in DISPLAY making the screen blank. */ -extern void display_clear_display (); +extern void display_clear_display (DISPLAY_LINE **display); /* Update the windows pointed to by WINDOWS in THE_DISPLAY. This actually writes the text on the screen. */ -extern void display_update_display (); +extern void display_update_display (WINDOW *window); /* Display WIN on THE_DISPLAY. Unlike display_update_display (), this function only does one window. */ -extern void display_update_one_window (); +extern void display_update_one_window (WINDOW *win); /* Move the screen cursor to directly over the current character in WINDOW. */ -extern void display_cursor_at_point (); +extern void display_cursor_at_point (WINDOW *window); /* Scroll the region of the_display starting at START, ending at END, and moving the lines AMOUNT lines. If AMOUNT is less than zero, the lines are moved up in the screen, otherwise down. Actually, it is possible for no scrolling to take place in the case that the terminal doesn't support it. This doesn't matter to us. */ -extern void display_scroll_display (); +extern void display_scroll_display (int start, int end, int amount); /* Try to scroll lines in WINDOW. OLD_PAGETOP is the pagetop of WINDOW before having had its line starts recalculated. OLD_STARTS is the list of line starts that used to appear in this window. OLD_COUNT is the number of lines that appear in the OLD_STARTS array. */ -extern void display_scroll_line_starts (); +extern void display_scroll_line_starts (WINDOW *window, int old_pagetop, + char **old_starts, int old_count); #endif /* not INFO_DISPLAY_H */ diff --git a/gnu/usr.bin/texinfo/info/echo-area.c b/gnu/usr.bin/texinfo/info/echo-area.c index 0faad8942dd..e002b1bf2da 100644 --- a/gnu/usr.bin/texinfo/info/echo-area.c +++ b/gnu/usr.bin/texinfo/info/echo-area.c @@ -1,7 +1,8 @@ /* echo-area.c -- how to read a line in the echo area. - $Id: echo-area.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: echo-area.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2001, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,18 +50,19 @@ static int input_line_point; static int input_line_beg; static int input_line_end; static NODE input_line_node = { - (char *)NULL, (char *)NULL, (char *)NULL, input_line, EA_MAX_INPUT, 0 + (char *)NULL, (char *)NULL, (char *)NULL, input_line, + EA_MAX_INPUT, 0, N_IsInternal }; -static void echo_area_initialize_node (); -static void push_echo_area (), pop_echo_area (); -static int echo_area_stack_contains_completions_p (); +static void echo_area_initialize_node (void); +static void push_echo_area (void), pop_echo_area (void); +static int echo_area_stack_contains_completions_p (void); -static void ea_kill_text (); +static void ea_kill_text (int from, int to); /* Non-zero means we force the user to complete. */ static int echo_area_must_complete_p = 0; -static int completions_window_p (); +static int completions_window_p (WINDOW *window); /* If non-null, this is a window which was specifically created to display possible completions output. We remember it so we can delete it when @@ -76,8 +78,7 @@ static long calling_window_pagetop = 0; /* Remember the node and pertinent variables of the calling window. */ static void -remember_calling_window (window) - WINDOW *window; +remember_calling_window (WINDOW *window) { /* Only do this if the calling window is not the completions window, or, if it is the completions window and there is no other window. */ @@ -94,7 +95,7 @@ remember_calling_window (window) /* Restore the caller's window so that it shows the node that it was showing on entry to info_read_xxx_echo_area (). */ static void -restore_calling_window () +restore_calling_window (void) { register WINDOW *win, *compwin = (WINDOW *)NULL; @@ -124,7 +125,10 @@ restore_calling_window () !echo_area_stack_contains_completions_p ()) { WINDOW *next; - int pagetop, start, end, amount; + int pagetop = 0; + int start = 0; + int end = 0; + int amount = 0; next = compwin->next; if (next) @@ -156,8 +160,7 @@ restore_calling_window () /* Set up a new input line with PROMPT. */ static void -initialize_input_line (prompt) - char *prompt; +initialize_input_line (char *prompt) { input_line_prompt = prompt; if (prompt) @@ -169,7 +172,7 @@ initialize_input_line (prompt) } static char * -echo_area_after_read () +echo_area_after_read (void) { char *return_value; @@ -198,9 +201,7 @@ echo_area_after_read () active window, so that we can restore it when we need to. PROMPT, if non-null, is a prompt to print before reading the line. */ char * -info_read_in_echo_area (window, prompt) - WINDOW *window; - char *prompt; +info_read_in_echo_area (WINDOW *window, char *prompt) { char *line; @@ -246,11 +247,11 @@ info_read_in_echo_area (window, prompt) /* (re) Initialize the echo area node. */ static void -echo_area_initialize_node () +echo_area_initialize_node (void) { register int i; - for (i = input_line_end; i < sizeof (input_line); i++) + for (i = input_line_end; (unsigned int) i < sizeof (input_line); i++) input_line[i] = ' '; input_line[i - 1] = '\n'; @@ -262,7 +263,7 @@ echo_area_initialize_node () echo area node, but its primary purpose is to side effect the input line buffer contents. */ void -echo_area_prep_read () +echo_area_prep_read (void) { if (the_echo_area->node != &input_line_node) echo_area_initialize_node (); @@ -559,7 +560,7 @@ DECLARE_INFO_COMMAND (ea_yank, _("Yank back the contents of the last kill")) if (!kill_ring_index) { - inform_in_echo_area (_("Kill ring is empty")); + inform_in_echo_area ((char *) _("Kill ring is empty")); return; } @@ -576,8 +577,8 @@ DECLARE_INFO_COMMAND (ea_yank_pop, _("Yank back a previous kill")) { register int len; - if (((ea_last_executed_command != ea_yank) && - (ea_last_executed_command != ea_yank_pop)) || + if (((ea_last_executed_command != (VFunction *) ea_yank) && + (ea_last_executed_command != (VFunction *) ea_yank_pop)) || (kill_ring_index == 0)) return; @@ -670,8 +671,7 @@ DECLARE_INFO_COMMAND (ea_backward_kill_word, otherwise it is prepended. If the last command was not a kill command, then a new slot is made for this kill. */ static void -ea_kill_text (from, to) - int from, to; +ea_kill_text (int from, int to) { register int i, counter, distance; int killing_backwards, slot; @@ -776,7 +776,7 @@ static int completions_found_slots = 0; static REFERENCE *LCD_completion; /* Internal functions used by the user calls. */ -static void build_completions (), completions_must_be_rebuilt (); +static void build_completions (void), completions_must_be_rebuilt (void); /* Variable which holds the output of completions. */ static NODE *possible_completions_output_node = (NODE *)NULL; @@ -785,8 +785,7 @@ static char *compwin_name = "*Completions*"; /* Return non-zero if WINDOW is a window used for completions output. */ static int -completions_window_p (window) - WINDOW *window; +completions_window_p (WINDOW *window) { int result = 0; @@ -800,11 +799,8 @@ completions_window_p (window) /* Workhorse for completion readers. If FORCE is non-zero, the user cannot exit unless the line read completes, or is empty. */ char * -info_read_completing_internal (window, prompt, completions, force) - WINDOW *window; - char *prompt; - REFERENCE **completions; - int force; +info_read_completing_internal (WINDOW *window, char *prompt, + REFERENCE **completions, int force) { char *line; @@ -869,9 +865,9 @@ info_read_completing_internal (window, prompt, completions, force) if (i == completions_found_index) { if (!completions_found_index) - inform_in_echo_area (_("No completions")); + inform_in_echo_area ((char *) _("No completions")); else - inform_in_echo_area (_("Not complete")); + inform_in_echo_area ((char *) _("Not complete")); continue; } } @@ -897,10 +893,8 @@ info_read_completing_internal (window, prompt, completions, force) /* Read a line in the echo area with completion over COMPLETIONS. */ char * -info_read_completing_in_echo_area (window, prompt, completions) - WINDOW *window; - char *prompt; - REFERENCE **completions; +info_read_completing_in_echo_area (WINDOW *window, + char *prompt, REFERENCE **completions) { return (info_read_completing_internal (window, prompt, completions, 1)); } @@ -908,10 +902,8 @@ info_read_completing_in_echo_area (window, prompt, completions) /* Read a line in the echo area allowing completion over COMPLETIONS, but not requiring it. */ char * -info_read_maybe_completing (window, prompt, completions) - WINDOW *window; - char *prompt; - REFERENCE **completions; +info_read_maybe_completing (WINDOW *window, + char *prompt, REFERENCE **completions) { return (info_read_completing_internal (window, prompt, completions, 0)); } @@ -929,22 +921,23 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions")) if (!completions_found_index) { terminal_ring_bell (); - inform_in_echo_area (_("No completions")); + inform_in_echo_area ((char *) _("No completions")); } else if ((completions_found_index == 1) && (key != '?')) { - inform_in_echo_area (_("Sole completion")); + inform_in_echo_area ((char *) _("Sole completion")); } else { register int i, l; - int limit, count, max_label = 0; + int limit, iterations, max_label = 0; initialize_message_buffer (); printf_to_message_buffer (completions_found_index == 1 - ? _("One completion:\n") - : _("%d completions:\n"), - completions_found_index); + ? (char *) _("One completion:\n") + : (char *) _("%d completions:\n"), + (void *) (long) completions_found_index, + NULL, NULL); /* Find the maximum length of a label. */ for (i = 0; i < completions_found_index; i++) @@ -967,15 +960,15 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions")) limit = 1; /* How many iterations of the printing loop? */ - count = (completions_found_index + (limit - 1)) / limit; + iterations = (completions_found_index + (limit - 1)) / limit; /* Watch out for special case. If the number of completions is less than LIMIT, then just do the inner printing loop. */ if (completions_found_index < limit) - count = 1; + iterations = 1; /* Print the sorted items, up-and-down alphabetically. */ - for (i = 0; i < count; i++) + for (i = 0; i < iterations; i++) { register int j; @@ -990,17 +983,17 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions")) label = completions_found[l]->label; printed_length = strlen (label); - printf_to_message_buffer ("%s", label); + printf_to_message_buffer ("%s", label, NULL, NULL); if (j + 1 < limit) { for (k = 0; k < max_label - printed_length; k++) - printf_to_message_buffer (" "); + printf_to_message_buffer (" ", NULL, NULL, NULL); } } - l += count; + l += iterations; } - printf_to_message_buffer ("\n"); + printf_to_message_buffer ("\n", NULL, NULL, NULL); } /* Make a new node to hold onto possible completions. Don't destroy @@ -1028,7 +1021,7 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions")) { /* If we can split the window to display most of the completion items, then do so. */ - if (calling_window->height > (count * 2) + if (calling_window->height > (iterations * 2) && calling_window->height / 2 >= WINDOW_MIN_SIZE) { int start, pagetop; @@ -1046,7 +1039,7 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions")) window_make_window (possible_completions_output_node); active_window = the_echo_area; window_change_window_height - (compwin, -(compwin->height - (count + 2))); + (compwin, -(compwin->height - (iterations + 2))); window_adjust_pagetop (calling_window); remember_calling_window (calling_window); @@ -1105,7 +1098,7 @@ DECLARE_INFO_COMMAND (ea_complete, _("Insert completion")) return; } - if (ea_last_executed_command == ea_complete) + if (ea_last_executed_command == (VFunction *) ea_complete) { /* If the keypress is a SPC character, and we have already tried completing once, and there are several completions, then check @@ -1153,9 +1146,11 @@ DECLARE_INFO_COMMAND (ea_complete, _("Insert completion")) } /* Utility REFERENCE used to store possible LCD. */ -static REFERENCE LCD_reference = { (char *)NULL, (char *)NULL, (char *)NULL }; +static REFERENCE LCD_reference = { + (char *)NULL, (char *)NULL, (char *)NULL, 0, 0, 0 +}; -static void remove_completion_duplicates (); +static void remove_completion_duplicates (void); /* Variables which remember the state of the most recent call to build_completions (). */ @@ -1164,7 +1159,7 @@ static REFERENCE **last_completion_items = (REFERENCE **)NULL; /* How to tell the completion builder to reset internal state. */ static void -completions_must_be_rebuilt () +completions_must_be_rebuilt (void) { maybe_free (last_completion_request); last_completion_request = (char *)NULL; @@ -1174,7 +1169,7 @@ completions_must_be_rebuilt () /* Build a list of possible completions from echo_area_completion_items, and the contents of input_line. */ static void -build_completions () +build_completions (void) { register int i, len; register REFERENCE *entry; @@ -1222,7 +1217,8 @@ build_completions () if (!informed_of_lengthy_job && completions_found_index > 100) { informed_of_lengthy_job = 1; - window_message_in_echo_area (_("Building completions...")); + window_message_in_echo_area ((char *) _("Building completions..."), + NULL, NULL); } } @@ -1291,15 +1287,17 @@ build_completions () /* Function called by qsort. */ static int -compare_references (entry1, entry2) - REFERENCE **entry1, **entry2; +compare_references (const void *entry1, const void *entry2) { - return (strcasecmp ((*entry1)->label, (*entry2)->label)); + REFERENCE **e1 = (REFERENCE **) entry1; + REFERENCE **e2 = (REFERENCE **) entry2; + + return (strcasecmp ((*e1)->label, (*e2)->label)); } /* Prune duplicate entries from COMPLETIONS_FOUND. */ static void -remove_completion_duplicates () +remove_completion_duplicates (void) { register int i, j; REFERENCE **temp; @@ -1359,8 +1357,7 @@ DECLARE_INFO_COMMAND (ea_scroll_completions_window, _("Scroll the completions wi /* Function which gets called when an Info window is deleted while the echo area is active. WINDOW is the window which has just been deleted. */ void -echo_area_inform_of_deleted_window (window) - WINDOW *window; +echo_area_inform_of_deleted_window (WINDOW *window) { /* If this is the calling_window, forget what we remembered about it. */ if (window == calling_window) @@ -1400,7 +1397,7 @@ static int pushed_echo_areas_slots = 0; /* Pushing the echo_area has a side effect of zeroing the completion_items. */ static void -push_echo_area () +push_echo_area (void) { PUSHED_EA *pushed; @@ -1422,7 +1419,7 @@ push_echo_area () } static void -pop_echo_area () +pop_echo_area (void) { PUSHED_EA *popped; @@ -1460,7 +1457,7 @@ pop_echo_area () /* Returns non-zero if any of the prior stacked calls to read in the echo area produced a completions window. */ static int -echo_area_stack_contains_completions_p () +echo_area_stack_contains_completions_p (void) { register int i; @@ -1483,7 +1480,7 @@ echo_area_stack_contains_completions_p () #endif /* HAVE_SYS_TIME_H */ static void -pause_or_input () +pause_or_input (void) { #ifdef FD_SET struct timeval timer; @@ -1503,14 +1500,14 @@ pause_or_input () for input or a couple of seconds, whichever comes first. Then flush the informational message that was printed. */ void -inform_in_echo_area (message) - char *message; +inform_in_echo_area (const char *message) { - register int i; + int i; char *text; + int avail = EA_MAX_INPUT + 1 - input_line_end; text = xstrdup (message); - for (i = 0; text[i] && text[i] != '\n'; i++) + for (i = 0; text[i] && text[i] != '\n' && i < avail; i++) ; text[i] = 0; diff --git a/gnu/usr.bin/texinfo/info/echo-area.h b/gnu/usr.bin/texinfo/info/echo-area.h index dfac04dd91e..d4a98a8ba4d 100644 --- a/gnu/usr.bin/texinfo/info/echo-area.h +++ b/gnu/usr.bin/texinfo/info/echo-area.h @@ -1,10 +1,10 @@ /* echo-area.h -- Functions used in reading information from the echo area. - $Id: echo-area.h,v 1.2 1999/01/11 16:38:07 espie Exp $ + $Id: echo-area.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,32 +33,53 @@ extern int echo_area_is_active, info_aborted_echo_area; killed some text. */ extern int echo_area_last_command_was_kill; -extern void inform_in_echo_area (), echo_area_inform_of_deleted_window (); -extern void echo_area_prep_read (); +extern void inform_in_echo_area (const char *message); +extern void echo_area_inform_of_deleted_window (WINDOW *window); +extern void echo_area_prep_read (void); extern VFunction *ea_last_executed_command; +extern char * info_read_completing_internal (WINDOW *window, char *prompt, + REFERENCE **completions, int force); /* Read a line of text in the echo area. Return a malloc ()'ed string, or NULL if the user aborted out of this read. WINDOW is the currently active window, so that we can restore it when we need to. PROMPT, if non-null, is a prompt to print before reading the line. */ -extern char *info_read_in_echo_area (); +extern char *info_read_in_echo_area (WINDOW *window, char *prompt); /* Read a line in the echo area with completion over COMPLETIONS. Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */ -char *info_read_completing_in_echo_area (); +char *info_read_completing_in_echo_area (WINDOW *window, + char *prompt, REFERENCE **completions); /* Read a line in the echo area allowing completion over COMPLETIONS, but not requiring it. Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */ -extern char *info_read_maybe_completing (); - -extern void ea_insert (), ea_quoted_insert (); -extern void ea_beg_of_line (), ea_backward (), ea_delete (), ea_end_of_line (); -extern void ea_forward (), ea_abort (), ea_rubout (), ea_complete (); -extern void ea_newline (), ea_kill_line (), ea_transpose_chars (); -extern void ea_yank (), ea_tab_insert (), ea_possible_completions (); -extern void ea_backward_word (), ea_kill_word (), ea_forward_word (); -extern void ea_yank_pop (), ea_backward_kill_word (); -extern void ea_scroll_completions_window (); +extern char *info_read_maybe_completing (WINDOW *window, + char *prompt, REFERENCE **completions); + +extern void ea_insert (WINDOW *window, int count, unsigned char key); +extern void ea_quoted_insert (WINDOW *window, int count, unsigned char key); +extern void ea_beg_of_line (WINDOW *window, int count, unsigned char key); +extern void ea_backward (WINDOW *window, int count, unsigned char key); +extern void ea_delete (WINDOW *window, int count, unsigned char key); +extern void ea_end_of_line (WINDOW *window, int count, unsigned char key); +extern void ea_forward (WINDOW *window, int count, unsigned char key); +extern void ea_abort (WINDOW *window, int count, unsigned char key); +extern void ea_rubout (WINDOW *window, int count, unsigned char key); +extern void ea_complete (WINDOW *window, int count, unsigned char key); +extern void ea_newline (WINDOW *window, int count, unsigned char key); +extern void ea_kill_line (WINDOW *window, int count, unsigned char key); +extern void ea_backward_kill_line (WINDOW *window, int count, unsigned char key); +extern void ea_transpose_chars (WINDOW *window, int count, unsigned char key); +extern void ea_yank (WINDOW *window, int count, unsigned char key); +extern void ea_tab_insert (WINDOW *window, int count, unsigned char key); +extern void ea_possible_completions (WINDOW *window, int count, unsigned char key); +extern void ea_backward_word (WINDOW *window, int count, unsigned char key); +extern void ea_kill_word (WINDOW *window, int count, unsigned char key); +extern void ea_forward_word (WINDOW *window, int count, unsigned char key); +extern void ea_yank_pop (WINDOW *window, int count, unsigned char key); +extern void ea_backward_kill_word (WINDOW *window, int count, unsigned char key); +extern void ea_scroll_completions_window (WINDOW *window, int count, + unsigned char key); #endif /* not INFO_ECHO_AREA_H */ diff --git a/gnu/usr.bin/texinfo/info/filesys.c b/gnu/usr.bin/texinfo/info/filesys.c index 5cf455f22b1..b3cac992a29 100644 --- a/gnu/usr.bin/texinfo/info/filesys.c +++ b/gnu/usr.bin/texinfo/info/filesys.c @@ -1,7 +1,8 @@ /* filesys.c -- filesystem specific functions. - $Id: filesys.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: filesys.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 2000 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2000, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,9 +26,12 @@ #include "filesys.h" /* Local to this file. */ -static char *info_file_in_path (), *lookup_info_filename (); -static char *info_absolute_file (); -static void remember_info_filename (), maybe_initialize_infopath (); +static char *info_file_in_path (char *filename, char *path); +static char *lookup_info_filename (char *filename); +static char *info_absolute_file (char *fname); + +static void remember_info_filename (char *filename, char *expansion); +static void maybe_initialize_infopath (void); typedef struct { @@ -76,8 +80,7 @@ static char *local_temp_filename = (char *)NULL; static int local_temp_filename_size = 0; char * -info_find_fullpath (partial) - char *partial; +info_find_fullpath (char *partial) { int initial_character; char *temp; @@ -140,7 +143,7 @@ info_find_fullpath (partial) if (temp) { remember_info_filename (partial, temp); - if (strlen (temp) > local_temp_filename_size) + if (strlen (temp) > (unsigned int) local_temp_filename_size) local_temp_filename = (char *) xrealloc (local_temp_filename, (local_temp_filename_size = (50 + strlen (temp)))); @@ -156,8 +159,7 @@ info_find_fullpath (partial) one that is a regular file, return it as a new string. Otherwise, return a NULL pointer. */ static char * -info_file_in_path (filename, path) - char *filename, *path; +info_file_in_path (char *filename, char *path) { struct stat finfo; char *temp_dirname; @@ -254,8 +256,7 @@ info_file_in_path (filename, path) return a NULL pointer. We do it by taking the file name apart into its directory and basename parts, and calling info_file_in_path.*/ static char * -info_absolute_file (fname) - char *fname; +info_absolute_file (char *fname) { char *containing_dir = xstrdup (fname); char *base = filename_non_directory (containing_dir); @@ -266,43 +267,41 @@ info_absolute_file (fname) return info_file_in_path (filename_non_directory (fname), containing_dir); } -/* Given a string containing units of information separated by - the PATH_SEP character, return the next one pointed to by - IDX, or NULL if there are no more. - Advance IDX to the character after the colon. */ + +/* Given a string containing units of information separated by the + PATH_SEP character, return the next one after IDX, or NULL if there + are no more. Advance IDX to the character after the colon. */ + char * -extract_colon_unit (string, idx) - char *string; - int *idx; +extract_colon_unit (char *string, int *idx) { - register int i, start; + unsigned int i = (unsigned int) *idx; + unsigned int start = i; + + if (!string || i >= strlen (string)) + return NULL; - i = start = *idx; - if ((i >= strlen (string)) || !string) - return ((char *) NULL); + if (!string[i]) /* end of string */ + return NULL; + /* Advance to next PATH_SEP. */ while (string[i] && string[i] != PATH_SEP[0]) i++; - if (i == start) - { - return ((char *) NULL); - } - else - { - char *value; - - value = (char *) xmalloc (1 + (i - start)); - strncpy (value, &string[start], (i - start)); - value[i - start] = '\0'; - if (string[i]) - ++i; - *idx = i; - return (value); - } + + { + char *value = xmalloc ((i - start) + 1); + strncpy (value, &string[start], (i - start)); + value[i - start] = 0; + + i++; /* move past PATH_SEP */ + *idx = i; + return value; + } } /* A structure which associates a filename with its expansion. */ -typedef struct { +typedef struct +{ char *filename; char *expansion; } FILENAME_LIST; @@ -315,8 +314,7 @@ static int names_and_files_slots = 0; /* Find the result for having already called info_find_fullpath () with FILENAME. */ static char * -lookup_info_filename (filename) - char *filename; +lookup_info_filename (char *filename) { if (filename && names_and_files) { @@ -332,8 +330,7 @@ lookup_info_filename (filename) /* Add a filename and its expansion to our list. */ static void -remember_info_filename (filename, expansion) - char *filename, *expansion; +remember_info_filename (char *filename, char *expansion) { FILENAME_LIST *new; @@ -357,7 +354,7 @@ remember_info_filename (filename, expansion) } static void -maybe_initialize_infopath () +maybe_initialize_infopath (void) { if (!infopath_size) { @@ -371,9 +368,7 @@ maybe_initialize_infopath () /* Add PATH to the list of paths found in INFOPATH. 2nd argument says whether to put PATH at the front or end of INFOPATH. */ void -info_add_path (path, where) - char *path; - int where; +info_add_path (char *path, int where) { int len; @@ -407,7 +402,7 @@ info_add_path (path, where) /* Make INFOPATH have absolutely nothing in it. */ void -zap_infopath () +zap_infopath (void) { if (infopath) free (infopath); @@ -432,9 +427,7 @@ zap_infopath () FIXME: is it a good idea to show the EOL type on the modeline? */ long -convert_eols (text, textlen) - char *text; - long textlen; +convert_eols (char *text, long int textlen) { register char *s = text; register char *d = text; @@ -458,11 +451,8 @@ convert_eols (text, textlen) If the file turns out to be compressed, set IS_COMPRESSED to non-zero. If the file cannot be read, return a NULL pointer. */ char * -filesys_read_info_file (pathname, filesize, finfo, is_compressed) - char *pathname; - long *filesize; - struct stat *finfo; - int *is_compressed; +filesys_read_info_file (char *pathname, long int *filesize, + struct stat *finfo, int *is_compressed) { long st_size; @@ -471,7 +461,7 @@ filesys_read_info_file (pathname, filesize, finfo, is_compressed) if (compressed_filename_p (pathname)) { *is_compressed = 1; - return (filesys_read_compressed (pathname, filesize, finfo)); + return (filesys_read_compressed (pathname, filesize)); } else { @@ -523,10 +513,7 @@ filesys_read_info_file (pathname, filesize, finfo, is_compressed) #define FILESYS_PIPE_BUFFER_SIZE (16 * BASIC_PIPE_BUFFER) char * -filesys_read_compressed (pathname, filesize, finfo) - char *pathname; - long *filesize; - struct stat *finfo; +filesys_read_compressed (char *pathname, long int *filesize) { FILE *stream; char *command, *decompressor; @@ -552,7 +539,7 @@ filesys_read_compressed (pathname, filesize, finfo) temp = (char *)xmalloc (5 + strlen (command)); sprintf (temp, "%s...", command); - message_in_echo_area ("%s", temp); + message_in_echo_area ("%s", temp, NULL); free (temp); } #endif /* !BUILDING_LIBRARY */ @@ -614,8 +601,7 @@ filesys_read_compressed (pathname, filesize, finfo) /* Return non-zero if FILENAME belongs to a compressed file. */ int -compressed_filename_p (filename) - char *filename; +compressed_filename_p (char *filename) { char *decompressor; @@ -631,8 +617,7 @@ compressed_filename_p (filename) /* Return the command string that would be used to decompress FILENAME. */ char * -filesys_decompressor_for_file (filename) - char *filename; +filesys_decompressor_for_file (char *filename) { register int i; char *extension = (char *)NULL; @@ -675,9 +660,7 @@ static char *errmsg_buf = (char *)NULL; static int errmsg_buf_size = 0; char * -filesys_error_string (filename, error_num) - char *filename; - int error_num; +filesys_error_string (char *filename, int error_num) { int len; char *result; @@ -700,8 +683,7 @@ filesys_error_string (filename, error_num) in combination. */ int -is_dir_name (filename) - char *filename; +is_dir_name (char *filename) { unsigned i; diff --git a/gnu/usr.bin/texinfo/info/filesys.h b/gnu/usr.bin/texinfo/info/filesys.h index 2c8501665ac..361428afd75 100644 --- a/gnu/usr.bin/texinfo/info/filesys.h +++ b/gnu/usr.bin/texinfo/info/filesys.h @@ -1,7 +1,7 @@ /* filesys.h -- external declarations for filesys.c. - $Id: filesys.h,v 1.3 2000/02/09 02:18:39 espie Exp $ + $Id: filesys.h,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,11 +28,11 @@ extern char *infopath; /* Make INFOPATH have absolutely nothing in it. */ -extern void zap_infopath (); +extern void zap_infopath (void); /* Add PATH to the list of paths found in INFOPATH. 2nd argument says whether to put PATH at the front or end of INFOPATH. */ -extern void info_add_path (); +extern void info_add_path (char *path, int where); /* Defines that are passed along with the pathname to info_add_path (). */ #define INFOPATH_PREPEND 0 @@ -41,27 +41,29 @@ extern void info_add_path (); /* Expand the filename in PARTIAL to make a real name for this operating system. This looks in INFO_PATHS in order to find the correct file. If it can't find the file, it returns NULL. */ -extern char *info_find_fullpath (); +extern char *info_find_fullpath (char *partial); /* Given a chunk of text and its length, convert all CRLF pairs at the EOLs into a single Newline character. Return the length of produced text. */ -long convert_eols (); +long convert_eols (char *text, long textlen); /* Read the contents of PATHNAME, returning a buffer with the contents of that file in it, and returning the size of that buffer in FILESIZE. FINFO is a stat struct which has already been filled in by the caller. If the file cannot be read, return a NULL pointer. */ -extern char *filesys_read_info_file (); -extern char *filesys_read_compressed (); +extern char *filesys_read_info_file (char *pathname, long int *filesize, + struct stat *finfo, int *is_compressed); + +extern char *filesys_read_compressed (char *pathname, long int *filesize); /* Return the command string that would be used to decompress FILENAME. */ -extern char *filesys_decompressor_for_file (); -extern int compressed_filename_p (); +extern char *filesys_decompressor_for_file (char *filename); +extern int compressed_filename_p (char *filename); /* A function which returns a pointer to a static buffer containing an error message for FILENAME and ERROR_NUM. */ -extern char *filesys_error_string (); +extern char *filesys_error_string (char *filename, int error_num); /* The number of the most recent file system error. */ extern int filesys_error_number; @@ -69,10 +71,10 @@ extern int filesys_error_number; /* Given a string containing units of information separated by colons, return the next one pointed to by IDX, or NULL if there are no more. Advance IDX to the character after the colon. */ -extern char *extract_colon_unit (); +extern char *extract_colon_unit (char *string, int *idx); /* Return true if FILENAME is `dir', with a possible compression suffix. */ -extern int is_dir_name (); +extern int is_dir_name (char *filename); /* The default value of INFOPATH. */ #if !defined (DEFAULT_INFOPATH) diff --git a/gnu/usr.bin/texinfo/info/footnotes.c b/gnu/usr.bin/texinfo/info/footnotes.c index 03e40054c6f..1b2a5883c30 100644 --- a/gnu/usr.bin/texinfo/info/footnotes.c +++ b/gnu/usr.bin/texinfo/info/footnotes.c @@ -1,7 +1,8 @@ /* footnotes.c -- Some functions for manipulating footnotes. - $Id: footnotes.c,v 1.3 2000/02/09 02:18:39 espie Exp $ + $Id: footnotes.c,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2002, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,21 +18,23 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #include "info.h" -/* Non-zero means attempt to show footnotes when displaying a new window. */ -int auto_footnotes_p = 1; +/* Nonzero means attempt to show footnotes when displaying a new window. */ +int auto_footnotes_p = 0; static char *footnote_nodename = "*Footnotes*"; +NODE * make_footnotes_node (NODE *node); + #define FOOTNOTE_HEADER_FORMAT \ - "*** Footnotes appearing in the node \"%s\" ***\n" + "*** Footnotes appearing in the node `%s' ***\n" /* Find the window currently showing footnotes. */ static WINDOW * -find_footnotes_window () +find_footnotes_window (void) { WINDOW *win; @@ -48,8 +51,7 @@ find_footnotes_window () return the manufactured node. If NODE has no footnotes, return a NULL pointer. */ NODE * -make_footnotes_node (node) - NODE *node; +make_footnotes_node (NODE *node) { NODE *fn_node, *result = (NODE *)NULL; long fn_start; @@ -160,8 +162,7 @@ make_footnotes_node (node) in WINDOW's node. Returns FN_UNABLE if there were footnotes, but the window to show them couldn't be made. */ int -info_get_or_remove_footnotes (window) - WINDOW *window; +info_get_or_remove_footnotes (WINDOW *window) { WINDOW *fn_win; NODE *new_footnotes; @@ -209,7 +210,7 @@ info_get_or_remove_footnotes (window) /* If we are hacking automatic footnotes, and there are footnotes but we couldn't display them, print a message to that effect. */ if (auto_footnotes_p) - inform_in_echo_area (_("Footnotes could not be displayed")); + inform_in_echo_area ((char *) _("Footnotes could not be displayed")); return (FN_UNABLE); } } @@ -256,11 +257,11 @@ DECLARE_INFO_COMMAND (info_show_footnotes, switch (result) { case FN_UNFOUND: - info_error (msg_no_foot_node); + info_error ((char *) msg_no_foot_node, NULL, NULL); break; case FN_UNABLE: - info_error (msg_win_too_small); + info_error ((char *) msg_win_too_small, NULL, NULL); break; } } diff --git a/gnu/usr.bin/texinfo/info/footnotes.h b/gnu/usr.bin/texinfo/info/footnotes.h index c9ed1448485..73f696c04d7 100644 --- a/gnu/usr.bin/texinfo/info/footnotes.h +++ b/gnu/usr.bin/texinfo/info/footnotes.h @@ -1,7 +1,7 @@ /* footnotes.h -- Some functions for manipulating footnotes. - $Id: footnotes.h,v 1.3 2000/02/09 02:18:39 espie Exp $ + $Id: footnotes.h,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ and displayed. Returns FN_UNFOUND if there were no footnotes found in WINDOW's node. Returns FN_UNABLE if there were footnotes, but the window to show them couldn't be made. */ -extern int info_get_or_remove_footnotes (); +extern int info_get_or_remove_footnotes (WINDOW *window); /* Non-zero means attempt to show footnotes when displaying a new window. */ extern int auto_footnotes_p; diff --git a/gnu/usr.bin/texinfo/info/gc.h b/gnu/usr.bin/texinfo/info/gc.h index 3f62a14dcbe..1ac10178dad 100644 --- a/gnu/usr.bin/texinfo/info/gc.h +++ b/gnu/usr.bin/texinfo/info/gc.h @@ -1,10 +1,10 @@ /* gc.h -- Functions for garbage collecting unused node contents. - $Id: gc.h,v 1.2 1999/01/11 16:38:08 espie Exp $ + $Id: gc.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,10 +28,10 @@ /* Add POINTER to the list of garbage collectible pointers. A pointer is not actually garbage collected until no info window contains a node whose contents member is equal to the pointer. */ -extern void add_gcable_pointer (); +extern void add_gcable_pointer (char *pointer); /* Grovel the list of info windows and gc-able pointers finding those node->contents which are collectible, and free them. */ -extern void gc_pointers (); +extern void gc_pointers (void); #endif /* not INFO_GC_H */ diff --git a/gnu/usr.bin/texinfo/info/indices.c b/gnu/usr.bin/texinfo/info/indices.c index e292b859618..34776b9407a 100644 --- a/gnu/usr.bin/texinfo/info/indices.c +++ b/gnu/usr.bin/texinfo/info/indices.c @@ -1,7 +1,8 @@ /* indices.c -- deal with an Info file index. - $Id: indices.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: indices.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99, 2002 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #include "info.h" #include "indices.h" @@ -54,9 +55,7 @@ static int index_nodenames_slots = 0; /* Add the name of NODE, and the range of the associated index elements (passed in ARRAY) to index_nodenames. */ static void -add_index_to_index_nodenames (array, node) - REFERENCE **array; - NODE *node; +add_index_to_index_nodenames (REFERENCE **array, NODE *node) { register int i, last; INDEX_NAME_ASSOC *assoc; @@ -87,8 +86,7 @@ add_index_to_index_nodenames (array, node) indices are concatenated and the result returned. If WINDOW's info file doesn't have any indices, a NULL pointer is returned. */ REFERENCE ** -info_indices_of_window (window) - WINDOW *window; +info_indices_of_window (WINDOW *window) { FILE_BUFFER *fb; @@ -98,8 +96,7 @@ info_indices_of_window (window) } REFERENCE ** -info_indices_of_file_buffer (file_buffer) - FILE_BUFFER *file_buffer; +info_indices_of_file_buffer (FILE_BUFFER *file_buffer) { register int i; REFERENCE **result = (REFERENCE **)NULL; @@ -180,10 +177,7 @@ DECLARE_INFO_COMMAND (info_index_search, /* Look up SEARCH_STRING in the index for this file. If SEARCH_STRING is NULL, prompt user for input. */ void -do_info_index_search (window, count, search_string) - WINDOW *window; - int count; - char *search_string; +do_info_index_search (WINDOW *window, int count, char *search_string) { FILE_BUFFER *fb; char *line; @@ -202,14 +196,15 @@ do_info_index_search (window, count, search_string) (FILENAME_CMP (initial_index_filename, fb->filename) != 0)) { info_free_references (index_index); - window_message_in_echo_area (_("Finding index entries...")); + window_message_in_echo_area ((char *) _("Finding index entries..."), + NULL, NULL); index_index = info_indices_of_file_buffer (fb); } /* If there is no index, quit now. */ if (!index_index) { - info_error (_("No indices found.")); + info_error ((char *) _("No indices found."), NULL, NULL); return; } @@ -219,7 +214,7 @@ do_info_index_search (window, count, search_string) line = xstrdup (search_string); else { - line = info_read_maybe_completing (window, _("Index entry: "), + line = info_read_maybe_completing (window, (char *) _("Index entry: "), index_index); window = active_window; @@ -282,9 +277,7 @@ do_info_index_search (window, count, search_string) } int -index_entry_exists (window, string) - WINDOW *window; - char *string; +index_entry_exists (WINDOW *window, char *string) { register int i; FILE_BUFFER *fb; @@ -339,14 +332,14 @@ DECLARE_INFO_COMMAND (info_next_index_match, yet. */ if (!index_search) { - info_error (_("No previous index search string.")); + info_error ((char *) _("No previous index search string."), NULL, NULL); return; } /* If there is no index, that is an error. */ if (!index_index) { - info_error (_("No index entries.")); + info_error ((char *) _("No index entries."), NULL, NULL); return; } @@ -379,8 +372,8 @@ DECLARE_INFO_COMMAND (info_next_index_match, /* If that failed, print an error. */ if ((i < 0) || (!index_index[i])) { - info_error (_("No %sindex entries containing \"%s\"."), - index_offset > 0 ? _("more ") : "", index_search); + info_error ((char *) _("No %sindex entries containing `%s'."), + index_offset > 0 ? (char *) _("more ") : "", index_search); return; } @@ -390,7 +383,7 @@ DECLARE_INFO_COMMAND (info_next_index_match, /* Report to the user on what we have found. */ { register int j; - char *name = _("CAN'T SEE THIS"); + const char *name = _("CAN'T SEE THIS"); char *match; for (j = 0; index_nodenames[j]; j++) @@ -409,26 +402,27 @@ DECLARE_INFO_COMMAND (info_next_index_match, if (partial && show_index_match) { - int j, ls, start, upper; + int k, ls, start, upper; ls = strlen (index_search); start = partial - ls; upper = isupper (match[start]) ? 1 : 0; - for (j = 0; j < ls; j++) + for (k = 0; k < ls; k++) if (upper) - match[j + start] = info_tolower (match[j + start]); + match[k + start] = info_tolower (match[k + start]); else - match[j + start] = info_toupper (match[j + start]); + match[k + start] = info_toupper (match[k + start]); } { char *format; format = replace_in_documentation - (_("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)")); + ((char *) _("Found `%s' in %s. (`\\[next-index-match]' tries to find next.)"), + 0); - window_message_in_echo_area (format, match, name); + window_message_in_echo_area (format, match, (char *) name); } free (match); @@ -439,7 +433,7 @@ DECLARE_INFO_COMMAND (info_next_index_match, if (!node) { - info_error (msg_cant_file_node, + info_error ((char *) msg_cant_file_node, index_index[i]->filename, index_index[i]->nodename); return; } @@ -470,9 +464,7 @@ DECLARE_INFO_COMMAND (info_next_index_match, /* For every menu item in DIR, search the indices of that file for SEARCH_STRING. */ REFERENCE ** -apropos_in_all_indices (search_string, inform) - char *search_string; - int inform; +apropos_in_all_indices (char *search_string, int inform) { register int i, dir_index; REFERENCE **all_indices = (REFERENCE **)NULL; @@ -546,7 +538,8 @@ apropos_in_all_indices (search_string, inform) } if (this_fb && inform) - message_in_echo_area (_("Scanning indices of \"%s\"..."), files_name); + message_in_echo_area ((char *) _("Scanning indices of `%s'..."), + files_name, NULL); this_index = info_indices_of_file_buffer (this_fb); free (this_node); @@ -600,20 +593,17 @@ apropos_in_all_indices (search_string, inform) } #define APROPOS_NONE \ - N_("No available info files have \"%s\" in their indices.") + N_("No available info files have `%s' in their indices.") void -info_apropos (string) - char *string; +info_apropos (char *string) { REFERENCE **apropos_list; apropos_list = apropos_in_all_indices (string, 0); if (!apropos_list) - { - info_error (_(APROPOS_NONE), string); - } + info_error ((char *) _(APROPOS_NONE), string, NULL); else { register int i; @@ -633,7 +623,7 @@ DECLARE_INFO_COMMAND (info_index_apropos, { char *line; - line = info_read_in_echo_area (window, _("Index apropos: ")); + line = info_read_in_echo_area (window, (char *) _("Index apropos: ")); window = active_window; @@ -653,9 +643,7 @@ DECLARE_INFO_COMMAND (info_index_apropos, apropos_list = apropos_in_all_indices (line, 1); if (!apropos_list) - { - info_error (_(APROPOS_NONE), line); - } + info_error ((char *) _(APROPOS_NONE), line, NULL); else { register int i; @@ -663,7 +651,8 @@ DECLARE_INFO_COMMAND (info_index_apropos, initialize_message_buffer (); printf_to_message_buffer - (_("\n* Menu: Nodes whoses indices contain \"%s\":\n"), line); + ((char *) _("\n* Menu: Nodes whose indices contain `%s':\n"), + line, NULL, NULL); line_buffer = (char *)xmalloc (500); for (i = 0; apropos_list[i]; i++) @@ -677,7 +666,7 @@ DECLARE_INFO_COMMAND (info_index_apropos, len = pad_to (40, line_buffer); sprintf (line_buffer + len, "(%s)%s.", apropos_list[i]->filename, apropos_list[i]->nodename); - printf_to_message_buffer ("%s\n", line_buffer); + printf_to_message_buffer ("%s\n", line_buffer, NULL, NULL); } free (line_buffer); } @@ -744,4 +733,3 @@ DECLARE_INFO_COMMAND (info_index_apropos, if (!info_error_was_printed) window_clear_echo_area (); } - diff --git a/gnu/usr.bin/texinfo/info/indices.h b/gnu/usr.bin/texinfo/info/indices.h index bd0a7273cf9..61893a75368 100644 --- a/gnu/usr.bin/texinfo/info/indices.h +++ b/gnu/usr.bin/texinfo/info/indices.h @@ -1,10 +1,10 @@ /* indices.h -- Functions defined in indices.c. - $Id: indices.h,v 1.2 1999/01/11 16:38:08 espie Exp $ + $Id: indices.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,15 +28,18 @@ /* User-visible variable controls the output of info-index-next. */ extern int show_index_match; -extern REFERENCE **info_indices_of_window (), **info_indices_of_file_buffer (); -extern void info_apropos (); +extern REFERENCE **info_indices_of_window (WINDOW *window); +extern REFERENCE **info_indices_of_file_buffer (FILE_BUFFER *file_buffer); +extern void info_apropos (char *string); /* For every menu item in DIR, search the indices of that file for STRING. */ -REFERENCE **apropos_in_all_indices (); +REFERENCE **apropos_in_all_indices (char *search_string, int inform); /* User visible functions declared in indices.c. */ -extern void info_index_search (), info_next_index_match (); -extern void do_info_index_search (); -extern int index_intry_exists (); +extern void info_index_search (WINDOW *window, int count, unsigned char key); +extern void info_next_index_match (WINDOW *window, int count, unsigned char key); +extern void info_index_apropos (WINDOW *window, int count, unsigned char key); +extern void do_info_index_search (WINDOW *window, int count, char *search_string); +extern int index_entry_exists (WINDOW *window, char *string); #endif /* not INFO_INDICES_H */ diff --git a/gnu/usr.bin/texinfo/info/info-utils.h b/gnu/usr.bin/texinfo/info/info-utils.h index c259da8f2be..8e20a3adcf0 100644 --- a/gnu/usr.bin/texinfo/info/info-utils.h +++ b/gnu/usr.bin/texinfo/info/info-utils.h @@ -1,7 +1,8 @@ /* info-utils.h -- Exported functions and variables from info-utils.c. - $Id: info-utils.h,v 1.3 2000/02/09 02:18:39 espie Exp $ + $Id: info-utils.h,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 96, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1998, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +35,7 @@ typedef struct { char *filename; /* File where this node can be found. */ char *nodename; /* Name of the node. */ int start, end; /* Offsets within the containing node of LABEL. */ + int line_number; /* Specific line number a menu item points to. */ } REFERENCE; /* When non-zero, various display and input functions handle ISO Latin @@ -53,69 +55,73 @@ extern char *info_parsed_nodename; INFO_PARSED_FILENAME to NULL. If second argument NEWLINES_OKAY is non-zero, it says to allow the nodename specification to cross a newline boundary (i.e., only `,', `.', or `TAB' can end the spec). */ -void info_parse_node (); +void info_parse_node (char *string, int newlines_okay); /* Return a NULL terminated array of REFERENCE * which represents the menu found in NODE. If there is no menu in NODE, just return a NULL pointer. */ -extern REFERENCE **info_menu_of_node (); +extern REFERENCE **info_menu_of_node (NODE *node); /* Return a NULL terminated array of REFERENCE * which represents the cross refrences found in NODE. If there are no cross references in NODE, just return a NULL pointer. */ -extern REFERENCE **info_xrefs_of_node (); +extern REFERENCE **info_xrefs_of_node (NODE *node); /* Glean cross references from BINDING->buffer + BINDING->start until BINDING->end. Return an array of REFERENCE * that represents each cross reference in this range. */ -extern REFERENCE **info_xrefs (); +extern REFERENCE **info_xrefs (SEARCH_BINDING *binding); /* Get the entry associated with LABEL in REFERENCES. Return a pointer to the reference if found, or NULL. */ -extern REFERENCE *info_get_labeled_reference (); +extern REFERENCE *info_get_labeled_reference (char *label, + REFERENCE **references); /* Glean menu entries from BINDING->buffer + BINDING->start until we have looked at the entire contents of BINDING. Return an array of REFERENCE * that represents each menu item in this range. */ -extern REFERENCE **info_menu_items (); +extern REFERENCE **info_menu_items (SEARCH_BINDING *binding); /* A utility function for concatenating REFERENCE **. Returns a new REFERENCE ** which is the concatenation of REF1 and REF2. The REF1 and REF2 arrays are freed, but their contents are not. */ -REFERENCE **info_concatenate_references (); +REFERENCE **info_concatenate_references (REFERENCE **ref1, REFERENCE **ref2); + +/* Copy an existing reference into new memory. */ +extern REFERENCE *info_copy_reference (REFERENCE *src); /* Free the data associated with REFERENCES. */ -extern void info_free_references (); +extern void info_free_references (REFERENCE **references); /* Search for sequences of whitespace or newlines in STRING, replacing all such sequences with just a single space. Remove whitespace from start and end of string. */ -void canonicalize_whitespace (); +void canonicalize_whitespace (char *string); /* Return a pointer to a string which is the printed representation of CHARACTER if it were printed at HPOS. */ -extern char *printed_representation (); +extern char *printed_representation (unsigned char character, int hpos); /* Return a pointer to the part of PATHNAME that simply defines the file. */ -extern char *filename_non_directory (); +extern char *filename_non_directory (char *pathname); /* Return non-zero if NODE is one especially created by Info. */ -extern int internal_info_node_p (); +extern int internal_info_node_p (NODE *node); /* Make NODE appear to be one especially created by Info, and give it NAME. */ -extern void name_internal_node (); +extern void name_internal_node (NODE *node, char *name); /* Return the window displaying NAME, the name of an internally created Info window. */ -extern WINDOW *get_internal_info_window (); +extern WINDOW *get_internal_info_window (char *name); /* Return a window displaying the node NODE. */ -extern WINDOW *get_window_of_node (); +extern WINDOW *get_window_of_node (NODE *node); /* Return the node addressed by LABEL in NODE (usually one of "Prev:", "Next:", "Up:", "File:", or "Node:". After a call to this function, the globals `info_parsed_nodename' and `info_parsed_filename' contain the information. */ -extern void info_parse_label (/* label, node */); +extern void info_parse_label (char *label, NODE *node); #define info_file_label_of_node(n) info_parse_label (INFO_FILE_LABEL, n) #define info_next_label_of_node(n) info_parse_label (INFO_NEXT_LABEL, n) diff --git a/gnu/usr.bin/texinfo/info/info.c b/gnu/usr.bin/texinfo/info/info.c index 15d4a0a6798..44f9cb8c169 100644 --- a/gnu/usr.bin/texinfo/info/info.c +++ b/gnu/usr.bin/texinfo/info/info.c @@ -1,8 +1,8 @@ /* info.c -- Display nodes of Info files in multiple windows. - $Id: info.c,v 1.8 2003/10/03 23:39:58 deraadt Exp $ + $Id: info.c,v 1.9 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 96, 97, 98, 99, 2000, 01, 02 - Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,8 +77,11 @@ int dump_subnodes = 0; /* Non-zero means make default keybindings be loosely modeled on vi(1). */ int vi_keys_p = 0; -/* Non-zero means don't remove ANSI escape sequences from man pages. */ -int raw_escapes_p = 0; +/* Non-zero means don't remove ANSI escape sequences. */ +int raw_escapes_p = 1; + +/* Non-zero means print the absolute location of the file to be loaded. */ +static int print_where_p = 0; #ifdef __MSDOS__ /* Non-zero indicates that screen output should be made 'speech-friendly'. @@ -103,15 +106,18 @@ static struct option long_options[] = { { "file", 1, 0, 'f' }, { "help", 0, &print_help_p, 1 }, { "index-search", 1, 0, IDXSRCH_OPTION }, + { "location", 0, &print_where_p, 1 }, { "node", 1, 0, 'n' }, { "output", 1, 0, 'o' }, { "raw-escapes", 0, &raw_escapes_p, 1 }, + { "no-raw-escapes", 0, &raw_escapes_p, 0 }, { "restore", 1, 0, RESTORE_OPTION }, { "show-options", 0, 0, 'O' }, { "subnodes", 0, &dump_subnodes, 1 }, { "usage", 0, 0, 'O' }, { "version", 0, &print_version_p, 1 }, { "vi-keys", 0, &vi_keys_p, 1 }, + { "where", 0, &print_where_p, 1 }, #ifdef __MSDOS__ { "speech-friendly", 0, &speech_friendly, 1 }, #endif @@ -120,18 +126,17 @@ static struct option long_options[] = { /* String describing the shorthand versions of the long options found above. */ #ifdef __MSDOS__ -static char *short_options = "d:n:f:ho:ORsb"; +static char *short_options = "d:n:f:ho:ORswb"; #else -static char *short_options = "d:n:f:ho:ORs"; +static char *short_options = "d:n:f:ho:ORws"; #endif /* When non-zero, the Info window system has been initialized. */ int info_windows_initialized_p = 0; /* Some "forward" declarations. */ -static void info_short_help (), remember_info_program_name (); -static void init_messages (); -extern void add_file_directory_to_path (); +static void info_short_help (void); +static void init_messages (void); /* **************************************************************** */ @@ -141,9 +146,7 @@ extern void add_file_directory_to_path (); /* **************************************************************** */ int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int getopt_long_index; /* Index returned by getopt_long (). */ NODE *initial_node; /* First node loaded by Info. */ @@ -153,12 +156,14 @@ main (argc, argv) setlocale (LC_ALL, ""); #endif +#ifdef ENABLE_NLS /* Set the text message domain. */ bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); +#endif init_messages (); - + while (1) { int option_character; @@ -166,7 +171,7 @@ main (argc, argv) option_character = getopt_long (argc, argv, short_options, long_options, &getopt_long_index); - /* getopt_long () returns EOF when there are no more long options. */ + /* getopt_long returns EOF when there are no more long options. */ if (option_character == EOF) break; @@ -199,6 +204,7 @@ main (argc, argv) user_filename = xstrdup (optarg); break; + /* Treat -h like --help. */ case 'h': print_help_p = 1; break; @@ -228,6 +234,11 @@ main (argc, argv) dump_subnodes = 1; break; + /* For compatibility with man, -w is --where. */ + case 'w': + print_where_p = 1; + break; + #ifdef __MSDOS__ /* User wants speech-friendly output. */ case 'b': @@ -280,11 +291,10 @@ main (argc, argv) { printf ("%s (GNU %s) %s\n", program_name, PACKAGE, VERSION); puts (""); - printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\ -There is NO warranty. You may redistribute this software\n\ + puts ("Copyright (C) 2004 Free Software Foundation, Inc."); + printf (_("There is NO warranty. You may redistribute this software\n\ under the terms of the GNU General Public License.\n\ -For more information about these matters, see the files named COPYING.\n"), - "2002"); +For more information about these matters, see the files named COPYING.\n")); xexit (0); } @@ -321,7 +331,13 @@ For more information about these matters, see the files named COPYING.\n"), { info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND); #ifdef INFODIR /* from the Makefile */ - info_add_path (INFODIR, INFOPATH_PREPEND); + info_add_path (INFODIR, INFOPATH_PREPEND); +#endif +#ifdef INFODIR2 /* from the Makefile, too */ +# ifdef INFODIR + if (!STREQ (INFODIR, INFODIR2)) +# endif + info_add_path (INFODIR2, INFOPATH_PREPEND); #endif } } @@ -348,10 +364,10 @@ For more information about these matters, see the files named COPYING.\n"), if (!initial_node) { if (info_recent_file_error) - info_error (info_recent_file_error); + info_error (info_recent_file_error, NULL, NULL); else - info_error (msg_cant_find_node, - user_nodenames ? user_nodenames[0] : "Top"); + info_error ((char *) msg_cant_find_node, + user_nodenames ? user_nodenames[0] : "Top", NULL); xexit (1); } @@ -363,7 +379,9 @@ For more information about these matters, see the files named COPYING.\n"), { free (initial_node); - if (user_output_filename) + if (print_where_p) + printf ("%s\n", user_filename ? user_filename : "unknown?!"); + else if (user_output_filename) dump_nodes_to_file (user_filename, user_nodenames, user_output_filename, dump_subnodes); else @@ -377,13 +395,27 @@ For more information about these matters, see the files named COPYING.\n"), file name is either "dir", or the contents of user_filename if one was specified. */ { - char *errstr, *errarg1, *errarg2; + const char *errstr; + char *errarg1, *errarg2; + NODE *new_initial_node = info_follow_menus (initial_node, argv + optind, - &errstr, &errarg1, &errarg2); + &errstr, &errarg1, &errarg2); if (new_initial_node && new_initial_node != initial_node) initial_node = new_initial_node; + if (print_where_p) + { + if (initial_node->parent) + printf ("%s\n", initial_node->parent); + else if (initial_node->filename + && !is_dir_name (filename_non_directory (initial_node->filename))) + printf ("%s\n", initial_node->filename); + else + xexit (1); + xexit (0); + } + /* If the user specified that this node should be output, then do that now. Otherwise, start the Info session with this node. Or act accordingly if the initial node was not found. */ @@ -393,14 +425,14 @@ For more information about these matters, see the files named COPYING.\n"), dump_node_to_file (initial_node, user_output_filename, dump_subnodes); else - info_error (errstr, errarg1, errarg2); + info_error ((char *) errstr, errarg1, errarg2); } else { if (errstr) - begin_info_session_with_error (initial_node, errstr, - errarg1, errarg2); + begin_info_session_with_error (initial_node, (char *) errstr, + errarg1, errarg2); /* If the user specified `--index-search=STRING' or --show-options, start the info session in the node corresponding to what they want. */ @@ -477,11 +509,12 @@ For more information about these matters, see the files named COPYING.\n"), xexit (0); } + + return 0; /* Avoid bogus warnings. */ } void -add_file_directory_to_path (filename) - char *filename; +add_file_directory_to_path (char *filename) { char *directory_name = xstrdup (filename); char *temp = filename_non_directory (directory_name); @@ -515,9 +548,7 @@ int info_error_rings_bell_p = 1; then the message is printed in the echo area. Otherwise, a message is output to stderr. */ void -info_error (format, arg1, arg2) - char *format; - void *arg1, *arg2; +info_error (char *format, void *arg1, void *arg2) { info_error_was_printed = 1; @@ -553,7 +584,7 @@ info_error (format, arg1, arg2) /* Produce a scaled down description of the available options to Info. */ static void -info_short_help () +info_short_help (void) { #ifdef __MSDOS__ static const char speech_friendly_string[] = N_("\ @@ -562,7 +593,7 @@ info_short_help () static const char speech_friendly_string[] = ""; #endif - + printf (_("\ Usage: %s [OPTION]... [MENU-ITEM...]\n\ \n\ @@ -577,10 +608,12 @@ Options:\n\ --index-search=STRING go to node pointed by index entry STRING.\n\ -n, --node=NODENAME specify nodes in first visited Info file.\n\ -o, --output=FILENAME output selected nodes to FILENAME.\n\ - -R, --raw-escapes don't remove ANSI escapes from man pages.\n\ + -R, --raw-escapes output \"raw\" ANSI escapes (default).\n\ + --no-raw-escapes output escapes as literal text.\n\ --restore=FILENAME read initial keystrokes from FILENAME.\n\ -O, --show-options, --usage go to command-line options node.\n%s\ --subnodes recursively output menu items.\n\ + -w, --where, --location print physical location of Info file.\n\ --vi-keys use vi-like and less-like key bindings.\n\ --version display version information and exit.\n\ \n\ @@ -613,25 +646,25 @@ Texinfo home page: http://www.gnu.org/software/texinfo/")); use them that way. This also has the advantage that there's only one copy of the strings. */ -char *msg_cant_find_node; -char *msg_cant_file_node; -char *msg_cant_find_window; -char *msg_cant_find_point; -char *msg_cant_kill_last; -char *msg_no_menu_node; -char *msg_no_foot_node; -char *msg_no_xref_node; -char *msg_no_pointer; -char *msg_unknown_command; -char *msg_term_too_dumb; -char *msg_at_node_bottom; -char *msg_at_node_top; -char *msg_one_window; -char *msg_win_too_small; -char *msg_cant_make_help; +const char *msg_cant_find_node; +const char *msg_cant_file_node; +const char *msg_cant_find_window; +const char *msg_cant_find_point; +const char *msg_cant_kill_last; +const char *msg_no_menu_node; +const char *msg_no_foot_node; +const char *msg_no_xref_node; +const char *msg_no_pointer; +const char *msg_unknown_command; +const char *msg_term_too_dumb; +const char *msg_at_node_bottom; +const char *msg_at_node_top; +const char *msg_one_window; +const char *msg_win_too_small; +const char *msg_cant_make_help; static void -init_messages () +init_messages (void) { msg_cant_find_node = _("Cannot find node `%s'."); msg_cant_file_node = _("Cannot find node `(%s)%s'."); diff --git a/gnu/usr.bin/texinfo/info/info.h b/gnu/usr.bin/texinfo/info/info.h index deb57e704ff..92d1cbe7925 100644 --- a/gnu/usr.bin/texinfo/info/info.h +++ b/gnu/usr.bin/texinfo/info/info.h @@ -1,7 +1,8 @@ /* info.h -- Header file which includes all of the other headers. - $Id: info.h,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: info.h,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -125,37 +126,35 @@ extern int raw_escapes_p; /* Print FORMAT with ARG1 and ARG2. If the window system was initialized, then the message is printed in the echo area. Otherwise, a message is output to stderr. */ -extern void info_error (); +extern void info_error (char *format, void *arg1, void *arg2); + +extern void add_file_directory_to_path (char *filename); /* Error message defines. */ -extern char *msg_cant_find_node; -extern char *msg_cant_file_node; -extern char *msg_cant_find_window; -extern char *msg_cant_find_point; -extern char *msg_cant_kill_last; -extern char *msg_no_menu_node; -extern char *msg_no_foot_node; -extern char *msg_no_xref_node; -extern char *msg_no_pointer; -extern char *msg_unknown_command; -extern char *msg_term_too_dumb; -extern char *msg_at_node_bottom; -extern char *msg_at_node_top; -extern char *msg_one_window; -extern char *msg_win_too_small; -extern char *msg_cant_make_help; +extern const char *msg_cant_find_node; +extern const char *msg_cant_file_node; +extern const char *msg_cant_find_window; +extern const char *msg_cant_find_point; +extern const char *msg_cant_kill_last; +extern const char *msg_no_menu_node; +extern const char *msg_no_foot_node; +extern const char *msg_no_xref_node; +extern const char *msg_no_pointer; +extern const char *msg_unknown_command; +extern const char *msg_term_too_dumb; +extern const char *msg_at_node_bottom; +extern const char *msg_at_node_top; +extern const char *msg_one_window; +extern const char *msg_win_too_small; +extern const char *msg_cant_make_help; -extern char *filename_non_directory (); /* Found in info-utils.c. */ - #if defined(INFOKEY) -extern void set_variable_to_value (); /* Found in variables.c. */ +/* Found in variables.c. */ +extern void set_variable_to_value (char *name, char *value); #endif /* INFOKEY */ -#if !defined (BUILDING_LIBRARY) -extern int info_windows_initialized_p; /* Found in session.c */ -/* Found in window.c. */ -extern void message_in_echo_area (), unmessage_in_echo_area (); -#endif /* !BUILDING_LIBRARY */ +/* Found in m-x.c. */ +extern char *read_function_name (char *prompt, WINDOW *window); #endif /* !INFO_H */ diff --git a/gnu/usr.bin/texinfo/info/infodoc.c b/gnu/usr.bin/texinfo/info/infodoc.c index 8d0c42dad4c..cb365e2fe2f 100644 --- a/gnu/usr.bin/texinfo/info/infodoc.c +++ b/gnu/usr.bin/texinfo/info/infodoc.c @@ -1,7 +1,8 @@ -/* infodoc.c -- Functions which build documentation nodes. - $Id: infodoc.c,v 1.4 2002/06/10 13:51:03 espie Exp $ +/* infodoc.c -- functions which build documentation nodes. + $Id: infodoc.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99, 2001, 02 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,7 +37,7 @@ static NODE *internal_info_help_node = (NODE *)NULL; static char *internal_info_help_node_contents = (char *)NULL; /* The (more or less) static text which appears in the internal info - help node. The actual key bindings are inserted. Keep the + help node. The actual key bindings are inserted. Keep the underlines (****, etc.) in the same N_ call as the text lines they refer to, so translations can make the number of *'s or -'s match. */ #if defined(INFOKEY) @@ -66,12 +67,12 @@ static char *info_internal_help_text[] = { "\n", N_("Moving within a node:\n\ ---------------------\n"), - N_("\\%-10[scroll-forward] Scroll forward a page.\n"), - N_("\\%-10[scroll-backward] Scroll backward a page.\n"), N_("\\%-10[beginning-of-node] Go to the beginning of this node.\n"), N_("\\%-10[end-of-node] Go to the end of this node.\n"), - N_("\\%-10[scroll-forward] Scroll forward 1 line.\n"), - N_("\\%-10[scroll-backward] Scroll backward 1 line.\n"), + N_("\\%-10[next-line] Scroll forward 1 line.\n"), + N_("\\%-10[prev-line] Scroll backward 1 line.\n"), + N_("\\%-10[scroll-forward] Scroll forward a page.\n"), + N_("\\%-10[scroll-backward] Scroll backward a page.\n"), "\n", N_("Other commands:\n\ ---------------\n"), @@ -184,12 +185,10 @@ static char *info_help_keys_text[][2] = { #endif /* !INFOKEY */ -static char *where_is_internal (); +static char *where_is_internal (Keymap map, InfoCommand *cmd); void -dump_map_to_message_buffer (prefix, map) - char *prefix; - Keymap map; +dump_map_to_message_buffer (char *prefix, Keymap map) { register int i; unsigned prefix_len = strlen (prefix); @@ -225,13 +224,16 @@ dump_map_to_message_buffer (prefix, map) if (last - 1 != i) { - printf_to_message_buffer ("%s .. ", pretty_keyseq (new_prefix)); - new_prefix[prefix_len] = last - 1; - printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix)); + printf_to_message_buffer ("%s .. ", pretty_keyseq (new_prefix), + NULL, NULL); + new_prefix[prefix_len] = last - 1; + printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix), + NULL, NULL); i = last - 1; } else - printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix)); + printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix), + NULL, NULL); #if defined (NAMED_FUNCTIONS) /* Print the name of the function, and some padding before the @@ -240,22 +242,23 @@ dump_map_to_message_buffer (prefix, map) int length_so_far; int desired_doc_start = 40; /* Must be multiple of 8. */ - printf_to_message_buffer ("(%s)", name); + printf_to_message_buffer ("(%s)", name, NULL, NULL); length_so_far = message_buffer_length_this_line (); - if ((desired_doc_start + strlen (doc)) >= the_screen->width) - printf_to_message_buffer ("\n "); + if ((desired_doc_start + strlen (doc)) + >= (unsigned int) the_screen->width) + printf_to_message_buffer ("\n ", NULL, NULL, NULL); else { while (length_so_far < desired_doc_start) { - printf_to_message_buffer ("\t"); + printf_to_message_buffer ("\t", NULL, NULL, NULL); length_so_far += character_width ('\t', length_so_far); } } } #endif /* NAMED_FUNCTIONS */ - printf_to_message_buffer ("%s\n", doc); + printf_to_message_buffer ("%s\n", doc, NULL, NULL); } } free (new_prefix); @@ -268,8 +271,7 @@ dump_map_to_message_buffer (prefix, map) make q do the right thing in both cases. */ static void -create_internal_info_help_node (help_is_only_window_p) - int help_is_only_window_p; +create_internal_info_help_node (int help_is_only_window_p) { register int i; NODE *node; @@ -290,8 +292,9 @@ create_internal_info_help_node (help_is_only_window_p) for (i = 0; info_internal_help_text[i]; i++) { #ifdef INFOKEY - printf_to_message_buffer (replace_in_documentation ( - _(info_internal_help_text[i]), help_is_only_window_p)); + printf_to_message_buffer (replace_in_documentation + ((char *) _(info_internal_help_text[i]), help_is_only_window_p), + NULL, NULL, NULL); #else /* Don't translate blank lines, gettext outputs the po file header in that case. We want a blank line. */ @@ -299,24 +302,27 @@ create_internal_info_help_node (help_is_only_window_p) ? _(info_internal_help_text[i]) : info_internal_help_text[i]; char *key = info_help_keys_text[i][vi_keys_p]; - + /* If we have only one window (because the window size was too small to split it), CTRL-x 0 doesn't work to `quit' help. */ if (STREQ (key, "CTRL-x 0") && help_is_only_window_p) key = "l"; - printf_to_message_buffer (msg, key); + printf_to_message_buffer (msg, key, NULL, NULL); #endif /* !INFOKEY */ } - printf_to_message_buffer ("---------------------\n\n"); - printf_to_message_buffer (_("The current search path is:\n")); - printf_to_message_buffer (" %s\n", infopath); - printf_to_message_buffer ("---------------------\n\n"); - printf_to_message_buffer (_("Commands available in Info windows:\n\n")); + printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL); + printf_to_message_buffer ((char *) _("The current search path is:\n"), + NULL, NULL, NULL); + printf_to_message_buffer (" %s\n", infopath, NULL, NULL); + printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL); + printf_to_message_buffer ((char *) _("Commands available in Info windows:\n\n"), + NULL, NULL, NULL); dump_map_to_message_buffer ("", info_keymap); - printf_to_message_buffer ("---------------------\n\n"); - printf_to_message_buffer (_("Commands available in the echo area:\n\n")); + printf_to_message_buffer ("---------------------\n\n", NULL, NULL, NULL); + printf_to_message_buffer ((char *) _("Commands available in the echo area:\n\n"), + NULL, NULL, NULL); dump_map_to_message_buffer ("", echo_area_keymap); #if defined (NAMED_FUNCTIONS) @@ -328,43 +334,46 @@ create_internal_info_help_node (help_is_only_window_p) { InfoCommand *cmd = DocInfoCmd(&function_doc_array[i]); - if (InfoFunction(cmd) != info_do_lowercase_version - && !where_is_internal (info_keymap, cmd) + if (InfoFunction(cmd) != (VFunction *) info_do_lowercase_version + && !where_is_internal (info_keymap, cmd) && !where_is_internal (echo_area_keymap, cmd)) { if (!printed_one_mx) { - printf_to_message_buffer ("---------------------\n\n"); - if (exec_keys && exec_keys[0]) - printf_to_message_buffer - (_("The following commands can only be invoked via %s:\n\n"), exec_keys); - else - printf_to_message_buffer - (_("The following commands cannot be invoked at all:\n\n")); + printf_to_message_buffer ("---------------------\n\n", + NULL, NULL, NULL); + if (exec_keys && exec_keys[0]) + printf_to_message_buffer + ((char *) _("The following commands can only be invoked via %s:\n\n"), + exec_keys, NULL, NULL); + else + printf_to_message_buffer + ((char *) _("The following commands cannot be invoked at all:\n\n"), + NULL, NULL, NULL); printed_one_mx = 1; } printf_to_message_buffer ("%s %s\n %s\n", - exec_keys, + exec_keys, function_doc_array[i].func_name, replace_in_documentation (strlen (function_doc_array[i].doc) - ? _(function_doc_array[i].doc) - : "") - ); + ? (char *) _(function_doc_array[i].doc) : "", 0) + ); } } if (printed_one_mx) - printf_to_message_buffer ("\n"); + printf_to_message_buffer ("\n", NULL, NULL, NULL); maybe_free (exec_keys); #endif /* NAMED_FUNCTIONS */ printf_to_message_buffer ("%s", replace_in_documentation - (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"))); + ((char *) _("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"), 0), + NULL, NULL); node = message_buffer_to_node (); internal_info_help_node_contents = node->contents; } @@ -403,7 +412,7 @@ create_internal_info_help_node (help_is_only_window_p) #define HELP_SPLIT_SIZE 24 static WINDOW * -info_find_or_create_help_window () +info_find_or_create_help_window (void) { int help_is_only_window_p; WINDOW *eligible = NULL; @@ -437,9 +446,8 @@ info_find_or_create_help_window () argument is false if help will be the only window (so l must be used to quit help), true if help will be one of several visible windows (so CTRL-x 0 must be used to quit help). */ - help_is_only_window_p - = (help_window && !windows->next - || !help_window && eligible->height < HELP_SPLIT_SIZE); + help_is_only_window_p = ((help_window && !windows->next) + || (!help_window && eligible->height < HELP_SPLIT_SIZE)); create_internal_info_help_node (help_is_only_window_p); /* Either use the existing window to display the help node, or create @@ -486,7 +494,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message")) } else { - info_error (msg_cant_make_help); + info_error ((char *) msg_cant_make_help, NULL, NULL); } } @@ -528,9 +536,9 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'") if (!node) { if (info_recent_file_error) - info_error (info_recent_file_error); + info_error (info_recent_file_error, NULL, NULL); else - info_error (msg_cant_file_node, "Info", nodename); + info_error ((char *) msg_cant_file_node, "Info", nodename); } else { @@ -558,8 +566,7 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'") /* Return the documentation associated with the Info command FUNCTION. */ char * -function_documentation (cmd) - InfoCommand *cmd; +function_documentation (InfoCommand *cmd) { char *doc; @@ -579,15 +586,14 @@ function_documentation (cmd) #endif /* !INFOKEY */ - return replace_in_documentation ((strlen (doc) == 0) ? doc : _(doc)); + return replace_in_documentation ((strlen (doc) == 0) ? doc : (char *) _(doc), 0); } #if defined (NAMED_FUNCTIONS) /* Return the user-visible name of the function associated with the Info command FUNCTION. */ char * -function_name (cmd) - InfoCommand *cmd; +function_name (InfoCommand *cmd) { #if defined (INFOKEY) @@ -608,8 +614,7 @@ function_name (cmd) /* Return a pointer to the info command for function NAME. */ InfoCommand * -named_function (name) - char *name; +named_function (char *name) { register int i; @@ -623,9 +628,7 @@ named_function (name) /* Return the documentation associated with KEY in MAP. */ char * -key_documentation (key, map) - char key; - Keymap map; +key_documentation (char key, Keymap map) { InfoCommand *function = map[key].function; @@ -647,7 +650,8 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) for (;;) { - message_in_echo_area (_("Describe key: %s"), pretty_keyseq (keys)); + message_in_echo_area ((char *) _("Describe key: %s"), + pretty_keyseq (keys), NULL); keystroke = info_get_input_char (); unmessage_in_echo_area (); @@ -661,7 +665,7 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) return; } - *k++ = '\e'; + *k++ = '\e'; keystroke = UnMeta (keystroke); map = (Keymap)map[ESC].function; } @@ -673,7 +677,8 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) if (map[keystroke].function == (InfoCommand *)NULL) { - message_in_echo_area (_("%s is undefined."), pretty_keyseq (keys)); + message_in_echo_area ((char *) _("%s is undefined."), + pretty_keyseq (keys), NULL); return; } else if (map[keystroke].type == ISKMAP) @@ -686,28 +691,29 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) char *keyname, *message, *fundoc, *funname = ""; #if defined (INFOKEY) - /* If the key is bound to do-lowercase-version, but its - lower-case variant is undefined, say that this key is - also undefined. This is especially important for unbound - edit keys that emit an escape sequence: it's terribly - confusing to see a message "Home (do-lowercase-version)" - or some such when Home is unbound. */ - if (InfoFunction(map[keystroke].function) == info_do_lowercase_version) - { - unsigned char lowerkey = Meta_p(keystroke) - ? Meta (tolower (UnMeta (keystroke))) - : tolower (keystroke); - - if (map[lowerkey].function == (InfoCommand *)NULL) - { - message_in_echo_area (_("%s is undefined."), - pretty_keyseq (keys)); - return; - } - } + /* If the key is bound to do-lowercase-version, but its + lower-case variant is undefined, say that this key is + also undefined. This is especially important for unbound + edit keys that emit an escape sequence: it's terribly + confusing to see a message "Home (do-lowercase-version)" + or some such when Home is unbound. */ + if (InfoFunction(map[keystroke].function) + == (VFunction *) info_do_lowercase_version) + { + unsigned char lowerkey = Meta_p(keystroke) + ? Meta (tolower (UnMeta (keystroke))) + : tolower (keystroke); + + if (map[lowerkey].function == (InfoCommand *)NULL) + { + message_in_echo_area ((char *) _("%s is undefined."), + pretty_keyseq (keys), NULL); + return; + } + } #endif - keyname = pretty_keyseq (keys); + keyname = pretty_keyseq (keys); #if defined (NAMED_FUNCTIONS) funname = function_name (map[keystroke].function); @@ -724,7 +730,7 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) sprintf (message, _("%s is defined to %s."), keyname, fundoc); #endif /* !NAMED_FUNCTIONS */ - window_message_in_echo_area ("%s", message); + window_message_in_echo_area ("%s", message, NULL); free (message); break; } @@ -733,8 +739,7 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) /* Return the pretty printable name of a single character. */ char * -pretty_keyname (key) - unsigned char key; +pretty_keyname (unsigned char key) { static char rep_buffer[30]; char *rep; @@ -784,11 +789,10 @@ pretty_keyname (key) /* Return the pretty printable string which represents KEYSEQ. */ -static void pretty_keyseq_internal (); +static void pretty_keyseq_internal (char *keyseq, char *rep); char * -pretty_keyseq (keyseq) - char *keyseq; +pretty_keyseq (char *keyseq) { static char keyseq_rep[200]; @@ -799,8 +803,7 @@ pretty_keyseq (keyseq) } static void -pretty_keyseq_internal (keyseq, rep) - char *keyseq, *rep; +pretty_keyseq_internal (char *keyseq, char *rep) { if (term_kP && strncmp(keyseq, term_kP, strlen(term_kP)) == 0) { @@ -868,8 +871,7 @@ pretty_keyseq_internal (keyseq, rep) /* Return a pointer to the last character in s that is found in f. */ static char * -strrpbrk (s, f) - const char *s, *f; +strrpbrk (const char *s, const char *f) { register const char *e = s + strlen(s); register const char *t; @@ -878,16 +880,14 @@ strrpbrk (s, f) { for (t = f; *t; t++) if (*e == *t) - return (char *)e; + return (char *)e; } return NULL; } /* Replace the names of functions with the key that invokes them. */ char * -replace_in_documentation (string, help_is_only_window_p) - char *string; - int help_is_only_window_p; +replace_in_documentation (char *string, int help_is_only_window_p) { unsigned reslen = strlen (string); register int i, start, next; @@ -905,146 +905,146 @@ replace_in_documentation (string, help_is_only_window_p) /* Is this the start of a replaceable function name? */ if (string[i] == '\\') - { - char *fmt = NULL; - unsigned min = 0; - unsigned max = 0; - - if(string[j] == '%') - { - if (string[++j] == '-') - j++; - if (isdigit(string[j])) - { - min = atoi(string + j); - while (isdigit(string[j])) - j++; - if (string[j] == '.' && isdigit(string[j + 1])) - { - j += 1; - max = atoi(string + j); - while (isdigit(string[j])) - j++; - } - fmt = (char *)xmalloc (j - i + 2); - strncpy (fmt, string + i + 1, j - i); - fmt[j - i - 1] = 's'; - fmt[j - i] = '\0'; - } - else - j = i + 1; - } - if (string[j] == '[') - { - unsigned arg = 0; - char *argstr = NULL; - char *rep_name, *fun_name, *rep; - InfoCommand *command; - char *repstr = NULL; - unsigned replen; - - /* Copy in the old text. */ - strncpy (result + next, string + start, i - start); - next += (i - start); - start = j + 1; - - /* Look for an optional numeric arg. */ - i = start; - if (isdigit(string[i]) - || (string[i] == '-' && isdigit(string[i + 1])) ) - { - arg = atoi(string + i); - if (string[i] == '-') - i++; - while (isdigit(string[i])) - i++; - } - start = i; - - /* Move to the end of the function name. */ - for (i = start; string[i] && (string[i] != ']'); i++); - - rep_name = (char *)xmalloc (1 + i - start); - strncpy (rep_name, string + start, i - start); - rep_name[i - start] = '\0'; - - /* If we have only one window (because the window size was too - small to split it), we have to quit help by going back one - noew in the history list, not deleting the window. */ - if (strcmp (rep_name, "quit-help") == 0) - fun_name = help_is_only_window_p ? "history-node" - : "delete-window"; - else - fun_name = rep_name; - - /* Find a key which invokes this function in the info_keymap. */ - command = named_function (fun_name); - - free (rep_name); - - /* If the internal documentation string fails, there is a - serious problem with the associated command's documentation. - We croak so that it can be fixed immediately. */ - if (!command) - abort (); - - if (arg) - { - char *argrep, *p; - - argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg)); - p = argrep ? strrpbrk (argrep, "0123456789-") : NULL; - if (p) - { - argstr = (char *)xmalloc (p - argrep + 21); - strncpy (argstr, argrep, p - argrep); - sprintf (argstr + (p - argrep), "%d", arg); - } - else - command = NULL; - } - rep = command ? where_is (info_keymap, command) : NULL; - if (!rep) - rep = "N/A"; - replen = (argstr ? strlen (argstr) + 1 : 0) + strlen (rep); - repstr = (char *)xmalloc (replen); - repstr[0] = '\0'; - if (argstr) - { - strcat(repstr, argstr); - strcat(repstr, " "); - free (argstr); - } - strcat(repstr, rep); - - if (fmt) - { - if (replen > max) - replen = max; - if (replen < min) - replen = min; - } - if (next + replen > reslen) - { - reslen = next + replen + 1; - result = (char *)xrealloc (result, reslen + 1); - } - - if (fmt) - sprintf (result + next, fmt, repstr); - else - strcpy (result + next, repstr); - - next = strlen (result); - free (repstr); - - start = i; - if (string[i]) - start++; - } - - maybe_free (fmt); - } + { + char *fmt = NULL; + unsigned min = 0; + unsigned max = 0; + + if(string[j] == '%') + { + if (string[++j] == '-') + j++; + if (isdigit(string[j])) + { + min = atoi(string + j); + while (isdigit(string[j])) + j++; + if (string[j] == '.' && isdigit(string[j + 1])) + { + j += 1; + max = atoi(string + j); + while (isdigit(string[j])) + j++; + } + fmt = (char *)xmalloc (j - i + 2); + strncpy (fmt, string + i + 1, j - i); + fmt[j - i - 1] = 's'; + fmt[j - i] = '\0'; + } + else + j = i + 1; + } + if (string[j] == '[') + { + unsigned arg = 0; + char *argstr = NULL; + char *rep_name, *fun_name, *rep; + InfoCommand *command; + char *repstr = NULL; + unsigned replen; + + /* Copy in the old text. */ + strncpy (result + next, string + start, i - start); + next += (i - start); + start = j + 1; + + /* Look for an optional numeric arg. */ + i = start; + if (isdigit(string[i]) + || (string[i] == '-' && isdigit(string[i + 1])) ) + { + arg = atoi(string + i); + if (string[i] == '-') + i++; + while (isdigit(string[i])) + i++; + } + start = i; + + /* Move to the end of the function name. */ + for (i = start; string[i] && (string[i] != ']'); i++); + + rep_name = (char *)xmalloc (1 + i - start); + strncpy (rep_name, string + start, i - start); + rep_name[i - start] = '\0'; + + /* If we have only one window (because the window size was too + small to split it), we have to quit help by going back one + noew in the history list, not deleting the window. */ + if (strcmp (rep_name, "quit-help") == 0) + fun_name = help_is_only_window_p ? "history-node" + : "delete-window"; + else + fun_name = rep_name; + + /* Find a key which invokes this function in the info_keymap. */ + command = named_function (fun_name); + + free (rep_name); + + /* If the internal documentation string fails, there is a + serious problem with the associated command's documentation. + We croak so that it can be fixed immediately. */ + if (!command) + abort (); + + if (arg) + { + char *argrep, *p; + + argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg)); + p = argrep ? strrpbrk (argrep, "0123456789-") : NULL; + if (p) + { + argstr = (char *)xmalloc (p - argrep + 21); + strncpy (argstr, argrep, p - argrep); + sprintf (argstr + (p - argrep), "%d", arg); + } + else + command = NULL; + } + rep = command ? where_is (info_keymap, command) : NULL; + if (!rep) + rep = "N/A"; + replen = (argstr ? strlen (argstr) : 0) + strlen (rep) + 1; + repstr = (char *)xmalloc (replen); + repstr[0] = '\0'; + if (argstr) + { + strcat(repstr, argstr); + strcat(repstr, " "); + free (argstr); + } + strcat(repstr, rep); + + if (fmt) + { + if (replen > max) + replen = max; + if (replen < min) + replen = min; + } + if (next + replen > reslen) + { + reslen = next + replen + 1; + result = (char *)xrealloc (result, reslen + 1); + } + + if (fmt) + sprintf (result + next, fmt, repstr); + else + strcpy (result + next, repstr); + + next = strlen (result); + free (repstr); + + start = i; + if (string[i]) + start++; + } + + maybe_free (fmt); + } } strcpy (result + next, string + start); return (result); @@ -1057,9 +1057,7 @@ static int where_is_rep_index = 0; static int where_is_rep_size = 0; char * -where_is (map, cmd) - Keymap map; - InfoCommand *cmd; +where_is (Keymap map, InfoCommand *cmd) { char *rep; @@ -1076,7 +1074,7 @@ where_is (map, cmd) name = function_name (cmd); if (!name) - return NULL; /* no such function */ + return NULL; /* no such function */ rep = where_is_internal (map, InfoCmd(info_execute_command)); if (!rep) @@ -1092,9 +1090,7 @@ where_is (map, cmd) /* Return the printed rep of the keystrokes that invoke FUNCTION, as found in MAP, or NULL. */ static char * -where_is_internal (map, cmd) - Keymap map; - InfoCommand *cmd; +where_is_internal (Keymap map, InfoCommand *cmd) { #if defined(INFOKEY) @@ -1107,7 +1103,15 @@ where_is_internal (map, cmd) return NULL; #else /* !INFOKEY */ - + /* There is a bug in that create_internal_info_help_node calls + where_is_internal without setting where_is_rep_index to zero. This + was found by Mandrake and reported by Thierry Vignaud + <tvignaud@mandrakesoft.com> around April 24, 2002. + + I think the best fix is to make where_is_rep_index another + parameter to this recursively-called function, instead of a static + variable. But this [!INFOKEY] branch of the code is not enabled + any more, so let's just skip the whole thing. --karl, 28sep02. */ register int i; /* If the function is directly invokable in MAP, return the representation @@ -1145,14 +1149,12 @@ where_is_internal (map, cmd) #endif /* INFOKEY */ } -extern char *read_function_name (); - DECLARE_INFO_COMMAND (info_where_is, _("Show what to type to execute a given command")) { char *command_name; - command_name = read_function_name (_("Where is command: "), window); + command_name = read_function_name ((char *) _("Where is command: "), window); if (!command_name) { @@ -1174,20 +1176,24 @@ DECLARE_INFO_COMMAND (info_where_is, if (!location || !location[0]) { - info_error (_("`%s' is not on any keys"), command_name); + info_error ((char *) _("`%s' is not on any keys"), + command_name, NULL); } else { if (strstr (location, function_name (command))) window_message_in_echo_area - (_("%s can only be invoked via %s."), command_name, location); + ((char *) _("%s can only be invoked via %s."), + command_name, location); else window_message_in_echo_area - (_("%s can be invoked via %s."), command_name, location); + ((char *) _("%s can be invoked via %s."), + command_name, location); } } else - info_error (_("There is no function named `%s'"), command_name); + info_error ((char *) _("There is no function named `%s'"), + command_name, NULL); } free (command_name); diff --git a/gnu/usr.bin/texinfo/info/infomap.c b/gnu/usr.bin/texinfo/info/infomap.c index 9ae2c2d40f1..14735655b36 100644 --- a/gnu/usr.bin/texinfo/info/infomap.c +++ b/gnu/usr.bin/texinfo/info/infomap.c @@ -1,7 +1,8 @@ /* infomap.c -- keymaps for Info. - $Id: infomap.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: infomap.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99, 2001, 02 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,10 +30,13 @@ #include "variables.h" #endif /* INFOKEY */ +static int keymap_bind_keyseq (Keymap map, const char *keyseq, + KEYMAP_ENTRY *keyentry); + /* Return a new keymap which has all the uppercase letters mapped to run the function info_do_lowercase_version (). */ Keymap -keymap_make_keymap () +keymap_make_keymap (void) { int i; Keymap keymap; @@ -58,85 +62,196 @@ keymap_make_keymap () return (keymap); } +#if defined(INFOKEY) +static FUNCTION_KEYSEQ * +find_function_keyseq (Keymap map, int c, Keymap rootmap) +{ + FUNCTION_KEYSEQ *k; + + if (map[c].type != ISFUNC) + abort(); + if (map[c].function == NULL) + return NULL; + for (k = map[c].function->keys; k; k = k->next) + { + const unsigned char *p; + Keymap m = rootmap; + if (k->map != rootmap) + continue; + for (p = (unsigned char *) k->keyseq; *p && m[*p].type == ISKMAP; p++) + m = (Keymap)m[*p].function; + if (*p != c || p[1]) + continue; + if (m[*p].type != ISFUNC) + abort (); + break; + } + return k; +} + +static void +add_function_keyseq (InfoCommand *function, + const char *keyseq, Keymap rootmap) +{ + FUNCTION_KEYSEQ *ks; + + if (function == NULL || + function == InfoCmd(info_do_lowercase_version) || + function == InfoCmd(ea_insert)) + return; + ks = (FUNCTION_KEYSEQ *)xmalloc (sizeof(FUNCTION_KEYSEQ)); + ks->next = function->keys; + ks->map = rootmap; + ks->keyseq = xstrdup(keyseq); + function->keys = ks; +} + +static void +remove_function_keyseq (InfoCommand *function, + const char *keyseq, Keymap rootmap) +{ + + FUNCTION_KEYSEQ *k, *kp; + + if (function == NULL || + function == InfoCmd(info_do_lowercase_version) || + function == InfoCmd(ea_insert)) + return; + for (kp = NULL, k = function->keys; k; kp = k, k = k->next) + if (k->map == rootmap && strcmp(k->keyseq, keyseq) == 0) + break; + if (!k) + abort (); + if (kp) + kp->next = k->next; + else + function->keys = k->next; +} +#endif /* INFOKEY */ + /* Return a new keymap which is a copy of MAP. */ Keymap -keymap_copy_keymap (map) - Keymap map; +keymap_copy_keymap (Keymap map, Keymap rootmap, Keymap newroot) { int i; Keymap keymap; +#if defined(INFOKEY) + FUNCTION_KEYSEQ *ks; +#endif /* INFOKEY */ keymap = keymap_make_keymap (); + if (!newroot) + newroot = keymap; for (i = 0; i < 256; i++) { keymap[i].type = map[i].type; - keymap[i].function = map[i].function; + switch (map[i].type) + { + case ISFUNC: + keymap[i].function = map[i].function; +#if defined(INFOKEY) + ks = find_function_keyseq (map, i, rootmap); + if (ks) + add_function_keyseq(map[i].function, ks->keyseq, newroot); +#endif /* INFOKEY */ + break; + case ISKMAP: + keymap[i].function = (InfoCommand *)keymap_copy_keymap + ((Keymap)map[i].function, rootmap, NULL); + break; + } } return (keymap); } /* Free the keymap and its descendants. */ void -keymap_discard_keymap (map) - Keymap (map); +keymap_discard_keymap (Keymap map, Keymap rootmap) { int i; if (!map) return; + if (!rootmap) + rootmap = map; for (i = 0; i < 256; i++) { +#if defined(INFOKEY) + FUNCTION_KEYSEQ *ks; +#endif /* INFOKEY */ switch (map[i].type) { case ISFUNC: +#if defined(INFOKEY) + ks = find_function_keyseq(map, i, rootmap); + if (ks) + remove_function_keyseq (map[i].function, ks->keyseq, rootmap); +#endif /* INFOKEY */ break; case ISKMAP: - keymap_discard_keymap ((Keymap)map[i].function); + keymap_discard_keymap ((Keymap)map[i].function, rootmap); break; } } + free(map); } /* Conditionally bind key sequence. */ -int -keymap_bind_keyseq (map, keyseq, keyentry) - Keymap map; - const unsigned char *keyseq; - KEYMAP_ENTRY *keyentry; +static int +keymap_bind_keyseq (Keymap map, + const char *keyseq, KEYMAP_ENTRY *keyentry) { Keymap m = map; - const unsigned char *s = keyseq; + const unsigned char *s = (unsigned char *) keyseq; int c; if (s == NULL || *s == '\0') return 0; while ((c = *s++) != '\0') { +#if defined(INFOKEY) + FUNCTION_KEYSEQ *ks; +#endif /* INFOKEY */ switch (m[c].type) { case ISFUNC: +#if defined(INFOKEY) + ks = find_function_keyseq(m, c, map); + if (ks) + remove_function_keyseq (m[c].function, ks->keyseq, map); +#else /* !INFOKEY */ if (!(m[c].function == NULL || ( -#if !defined(INFOKEY) m != map && -#endif /* !INFOKEY */ m[c].function == InfoCmd(info_do_lowercase_version)) )) return 0; +#endif /* !INFOKEY */ if (*s != '\0') { m[c].type = ISKMAP; + /* Here we are casting the Keymap pointer returned from + keymap_make_keymap to an InfoCommand pointer. Ugh. + This makes the `function' structure garbage + if it's actually interpreted as an InfoCommand. + Should really be using a union, and taking steps to + avoid the possible error. */ m[c].function = (InfoCommand *)keymap_make_keymap (); } break; case ISKMAP: +#if defined(INFOKEY) + if (*s == '\0') + keymap_discard_keymap ((Keymap)m[c].function, map); +#else /* !INFOKEY */ if (*s == '\0') return 0; +#endif break; } if (*s != '\0') @@ -146,18 +261,7 @@ keymap_bind_keyseq (map, keyseq, keyentry) else { #if defined(INFOKEY) - FUNCTION_KEYSEQ *k; - - for (k = keyentry->function->keys; k && k->map != map; k = k->next) - ; - if (!k) - { - FUNCTION_KEYSEQ *ks = (FUNCTION_KEYSEQ *)xmalloc (sizeof(FUNCTION_KEYSEQ)); - ks->next = keyentry->function->keys; - ks->map = map; - ks->keyseq = xstrdup (keyseq); - keyentry->function->keys = ks; - } + add_function_keyseq (keyentry->function, keyseq, map); #endif /* INFOKEY */ m[c] = *keyentry; } @@ -505,8 +609,8 @@ initialize_vi_like_keymaps () map['b'].function = ea_backward_word; map['d'].function = ea_kill_word; map['f'].function = ea_forward_word; - map['h'].function = ea_forward; - map['l'].function = ea_backward; + map['h'].function = ea_backward; + map['l'].function = ea_forward; map['w'].function = ea_forward_word; map['x'].function = ea_delete; map['X'].function = ea_kill_word; @@ -600,8 +704,8 @@ initialize_vi_like_keymaps () map['H'].function = info_get_help_window; map['i'].function = info_index_search; map['I'].function = info_goto_invocation_node; - map['j'].function = info_down_line; - map['k'].function = info_up_line; + map['j'].function = info_next_line; + map['k'].function = info_prev_line; map['l'].function = info_history_node; map['m'].function = info_menu_item; map['n'].function = info_search_next; @@ -1078,8 +1182,8 @@ static unsigned char default_vi_like_info_keys[] = 'H', NUL, A_info_get_help_window, 'i', NUL, A_info_index_search, 'I', NUL, A_info_goto_invocation_node, - 'j', NUL, A_info_down_line, - 'k', NUL, A_info_up_line, + 'j', NUL, A_info_next_line, + 'k', NUL, A_info_prev_line, 'l', NUL, A_info_history_node, 'm', NUL, A_info_menu_item, 'n', NUL, A_info_search_next, @@ -1317,8 +1421,7 @@ static unsigned int user_vars_len; * Return the size of a file, or 0 if the size can't be determined. */ static unsigned long -filesize(f) - int f; +filesize(int f) { long pos = lseek(f, 0L, SEEK_CUR); long sz = -1L; @@ -1334,8 +1437,7 @@ filesize(f) Integers are stored as two bytes, low order first, in radix INFOKEY_RADIX. */ static int -getint(sp) - unsigned char **sp; +getint(unsigned char **sp) { int n; @@ -1350,7 +1452,7 @@ getint(sp) /* Fetch the contents of the standard infokey file "$HOME/.info". Return true if ok, false if not. */ static int -fetch_user_maps() +fetch_user_maps(void) { char *filename = NULL; char *homedir; @@ -1378,9 +1480,10 @@ fetch_user_maps() #endif if (filename == NULL || (f = open(filename, O_RDONLY)) == (-1)) { - if (filename) + if (filename && errno != ENOENT) { - info_error(filesys_error_string(filename, errno)); + info_error(filesys_error_string(filename, errno), + NULL, NULL); free(filename); } return 0; @@ -1394,11 +1497,11 @@ fetch_user_maps() /* Bad file (a valid file must have at least 9 chars, and more than 100 KB is a problem). */ if (len < INFOKEY_NMAGIC + 2) - info_error(_("Ignoring invalid infokey file `%s' - too small"), - filename); + info_error((char *) _("Ignoring invalid infokey file `%s' - too small"), + filename, NULL); else - info_error(_("Ignoring invalid infokey file `%s' - too big"), - filename); + info_error((char *) _("Ignoring invalid infokey file `%s' - too big"), + filename, NULL); close(f); free(filename); return 0; @@ -1408,9 +1511,10 @@ fetch_user_maps() buf = (unsigned char *)xmalloc((int)len); nread = read(f, buf, (unsigned int) len); close(f); - if (nread != len) + if ((unsigned int) nread != len) { - info_error(_("Error reading infokey file `%s' - short read"), filename); + info_error((char *) _("Error reading infokey file `%s' - short read"), + filename, NULL); free(buf); free(filename); return 0; @@ -1428,26 +1532,33 @@ fetch_user_maps() || buf[len - 1] != INFOKEY_MAGIC_E3 ) { - info_error(_("Invalid infokey file `%s' (bad magic numbers) -- run infokey to update it"), filename); + info_error((char *) _("Invalid infokey file `%s' (bad magic numbers) -- run infokey to update it"), + filename, NULL); free(filename); return 0; } - if (len < INFOKEY_NMAGIC + strlen(VERSION) + 1 || strcmp(VERSION, buf + 4) != 0) + if (len < INFOKEY_NMAGIC + strlen(VERSION) + 1 + || strcmp(VERSION, (char *) (buf + 4)) != 0) { - info_error(_("Your infokey file `%s' is out of date -- run infokey to update it"), filename); + info_error + ((char *) _("Your infokey file `%s' is out of date -- run infokey to update it"), + filename, NULL); free(filename); return 0; } /* Extract the pieces. */ - for (p = buf + 4 + strlen(VERSION) + 1; p - buf < len - 4; p += n) + for (p = buf + 4 + strlen(VERSION) + 1; + (unsigned int) (p - buf) < len - 4; + p += n) { int s = *p++; n = getint(&p); - if (n < 0 || n > len - 4 - (p - buf)) + if (n < 0 || (unsigned int) n > len - 4 - (p - buf)) { - info_error(_("Invalid infokey file `%s' (bad section length) -- run infokey to update it"), filename); + info_error((char *) _("Invalid infokey file `%s' (bad section length) -- run infokey to update it"), + filename, NULL); free(filename); return 0; } @@ -1467,7 +1578,8 @@ fetch_user_maps() user_vars_len = n; break; default: - info_error(_("Invalid infokey file `%s' (bad section code) -- run infokey to update it"), filename); + info_error((char *) _("Invalid infokey file `%s' (bad section code) -- run infokey to update it"), + filename, NULL); free(filename); return 0; } @@ -1482,27 +1594,26 @@ fetch_user_maps() doesn't define. */ static int -decode_keys(src, slen, dst, dlen) - unsigned char *src; - unsigned int slen; - unsigned char *dst; - unsigned int dlen; +decode_keys(unsigned char *src, unsigned int slen, + unsigned char *dst, unsigned int dlen) { unsigned char *s = src; unsigned char *d = dst; -#define To_dst(c) do { if (d - dst < dlen) *d++ = (c); } while (0) +#define To_dst(c) do { \ + if ((unsigned int) (d - dst) < dlen) *d++ = (c); \ +} while (0) - while (s - src < slen) + while ((unsigned int) (s - src) < slen) { unsigned char c = ISMETA(*s) ? UNMETA(*s) : *s; if (c == SK_ESCAPE) { - unsigned char *t; + char *t; static char lit[] = { SK_ESCAPE, NUL }; - switch (s + 1 - src < slen ? s[1] : '\0') + switch ((unsigned int) (s + 1 - src) < slen ? s[1] : '\0') { case SK_RIGHT_ARROW: t = term_kr; break; case SK_LEFT_ARROW: t = term_kl; break; @@ -1543,21 +1654,17 @@ decode_keys(src, slen, dst, dlen) /* Convert an infokey file section to keymap bindings. Return false if the default bindings are to be suppressed. */ static int -section_to_keymaps(map, table, len) - Keymap map; - unsigned char *table; - unsigned int len; +section_to_keymaps(Keymap map, unsigned char *table, unsigned int len) { int stop; unsigned char *p; - unsigned char *seq; - unsigned int seqlen; - KEYMAP_ENTRY ke; + unsigned char *seq = NULL; + unsigned int seqlen = 0; enum { getseq, gotseq, getaction } state = getseq; stop = len > 0 ? table[0] : 0; - for (p = table + 1; p - table < len; p++) + for (p = table + 1; (unsigned int) (p - table) < len; p++) { switch (state) { @@ -1598,30 +1705,30 @@ section_to_keymaps(map, table, len) action < A_NCOMMANDS ? &function_doc_array[action] : NULL; - keymap_bind_keyseq(map, keyseq, &ke); + keymap_bind_keyseq(map, + (const char *) keyseq, &ke); } } break; } } if (state != getseq) - info_error(_("Bad data in infokey file -- some key bindings ignored")); + info_error((char *) _("Bad data in infokey file -- some key bindings ignored"), + NULL, NULL); return !stop; } /* Convert an infokey file section to variable settings. */ static void -section_to_vars(table, len) - unsigned char *table; - unsigned int len; +section_to_vars(unsigned char *table, unsigned int len) { enum { getvar, gotvar, getval, gotval } state = getvar; unsigned char *var = NULL; unsigned char *val = NULL; unsigned char *p; - for (p = table; p - table < len; p++) + for (p = table; (unsigned int) (p - table) < len; p++) { switch (state) { @@ -1649,23 +1756,23 @@ section_to_vars(table, len) case gotval: if (!*p) { - set_variable_to_value(var, val); + set_variable_to_value((char *) var, (char *) val); state = getvar; } break; } } if (state != getvar) - info_error(_("Bad data in infokey file -- some var settings ignored")); + info_error((char *) _("Bad data in infokey file -- some var settings ignored"), + NULL, NULL); } void -initialize_info_keymaps () +initialize_info_keymaps (void) { int i; int suppress_info_default_bindings = 0; int suppress_ea_default_bindings = 0; - Keymap map; if (!info_keymap) { @@ -1721,3 +1828,4 @@ initialize_info_keymaps () } #endif /* defined(INFOKEY) */ +/* vim: set sw=2 cino={1s>2sn-s^-se-s: */ diff --git a/gnu/usr.bin/texinfo/info/m-x.c b/gnu/usr.bin/texinfo/info/m-x.c index 4fa90d48e0c..8b265943740 100644 --- a/gnu/usr.bin/texinfo/info/m-x.c +++ b/gnu/usr.bin/texinfo/info/m-x.c @@ -1,7 +1,8 @@ /* m-x.c -- Meta-x minibuffer reader. - $Id: m-x.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: m-x.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2001, 2002, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #include "info.h" #include "funs.h" @@ -32,9 +33,7 @@ name. A return value of NULL indicates that no function name could be read. */ char * -read_function_name (prompt, window) - char *prompt; - WINDOW *window; +read_function_name (char *prompt, WINDOW *window) { register int i; char *line; @@ -71,7 +70,7 @@ DECLARE_INFO_COMMAND (describe_command, { char *line; - line = read_function_name (_("Describe command: "), window); + line = read_function_name ((char *) _("Describe command: "), window); if (!line) { @@ -138,7 +137,8 @@ DECLARE_INFO_COMMAND (info_execute_command, (strncmp (line, "echo-area-", 10) == 0)) { free (line); - info_error (_("Cannot execute an `echo-area' command here.")); + info_error ((char *) _("Cannot execute an `echo-area' command here."), + NULL, NULL); return; } @@ -148,7 +148,10 @@ DECLARE_INFO_COMMAND (info_execute_command, if (!command) return; - (*InfoFunction(command)) (active_window, count, 0); + if (InfoFunction(command)) + (*InfoFunction(command)) (active_window, count, 0); + else + info_error ((char *) _("Undefined command: %s"), line, NULL); } } diff --git a/gnu/usr.bin/texinfo/info/makedoc.c b/gnu/usr.bin/texinfo/info/makedoc.c index 919ea090480..e024b688933 100644 --- a/gnu/usr.bin/texinfo/info/makedoc.c +++ b/gnu/usr.bin/texinfo/info/makedoc.c @@ -1,7 +1,8 @@ /* makedoc.c -- make doc.c and funs.h from input files. - $Id: makedoc.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: makedoc.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ /* This program grovels the contents of the source files passed as arguments and writes out a file of function pointers and documentation strings, and @@ -27,7 +28,7 @@ #include "info.h" #include "infokey.h" -static void fatal_file_error (); +static void fatal_file_error (char *filename); /* Name of the header file which receives the declarations of functions. */ static char *funs_filename = "funs.h"; @@ -40,7 +41,7 @@ static char *doc_header[] = { "/* doc.c -- Generated structure containing function names and doc strings.", "", " This file was automatically made from various source files with the", - " command \"%s\". DO NOT EDIT THIS FILE, only \"%s.c\".", + " command `%s'. DO NOT EDIT THIS FILE, only `%s.c'.", (char *)NULL }; @@ -104,16 +105,15 @@ int emacs_tags_slots = 0; #define DECLARATION_STRING "\nDECLARE_INFO_COMMAND" -static void process_one_file (); -static void maybe_dump_tags (); -static FILE *must_fopen (); -static void init_func_key (); -static unsigned int next_func_key (); +static void process_one_file (char *filename, FILE *doc_stream, + FILE *key_stream, FILE *funs_stream); +static void maybe_dump_tags (FILE *stream); +static FILE *must_fopen (char *filename, char *mode); +static void init_func_key (unsigned int val); +static unsigned int next_func_key (void); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { register int i; int tags_only = 0; @@ -142,14 +142,15 @@ main (argc, argv) doc_filename = NULL_DEVICE; key_filename = NULL_DEVICE; } - + funs_stream = must_fopen (funs_filename, "w"); doc_stream = must_fopen (doc_filename, "w"); key_stream = must_fopen (key_filename, "w"); fprintf (funs_stream, - "/* %s -- Generated declarations for Info commands. */\n", - funs_filename); + "/* %s -- Generated declarations for Info commands. */\n\n\ +#include \"info.h\"\n", + funs_filename); for (i = 0; doc_header[i]; i++) { @@ -220,7 +221,7 @@ main (argc, argv) #endif /* !INFOKEY */ - fprintf (key_stream, " (char *)0\n};\n"); + fprintf (key_stream, " { (char *)NULL, 0 }\n};\n"); fprintf (funs_stream, "\n#define A_NCOMMANDS %u\n", next_func_key()); fclose (funs_stream); @@ -229,13 +230,12 @@ main (argc, argv) if (tags_only) maybe_dump_tags (stdout); - xexit (0); + return 0; } /* Dumping out the contents of an Emacs tags table. */ static void -maybe_dump_tags (stream) - FILE *stream; +maybe_dump_tags (FILE *stream) { register int i; @@ -283,8 +283,7 @@ maybe_dump_tags (stream) /* Keeping track of names, line numbers and character offsets of functions found in source files. */ static EMACS_TAG_BLOCK * -make_emacs_tag_block (filename) - char *filename; +make_emacs_tag_block (char *filename) { EMACS_TAG_BLOCK *block; @@ -298,11 +297,8 @@ make_emacs_tag_block (filename) } static void -add_tag_to_block (block, name, line, char_offset) - EMACS_TAG_BLOCK *block; - char *name; - int line; - long char_offset; +add_tag_to_block (EMACS_TAG_BLOCK *block, + char *name, int line, long int char_offset) { EMACS_TAG *tag; @@ -318,11 +314,8 @@ add_tag_to_block (block, name, line, char_offset) function declarations. Output the declarations in various forms to the DOC_STREAM, KEY_STREAM, and FUNS_STREAM. */ static void -process_one_file (filename, doc_stream, key_stream, funs_stream) - char *filename; - FILE *doc_stream; - FILE *key_stream; - FILE *funs_stream; +process_one_file (char *filename, FILE *doc_stream, + FILE *key_stream, FILE *funs_stream) { int descriptor, decl_len; char *buffer, *decl_str; @@ -504,9 +497,12 @@ process_one_file (filename, doc_stream, key_stream, funs_stream) #if defined (INFOKEY) #if defined (NAMED_FUNCTIONS) - fprintf (doc_stream, " { %s, \"%s\", (FUNCTION_KEYSEQ *)0, %s },\n", func, func_name, doc); + fprintf (doc_stream, + " { (VFunction *)%s, \"%s\", (FUNCTION_KEYSEQ *)0, %s },\n", + func, func_name, doc); #else /* !NAMED_FUNCTIONS */ - fprintf (doc_stream, " { %s, (FUNCTION_KEYSEQ *)0, %s },\n", func, doc); + fprintf (doc_stream, + " { (VFunction *) %s, (FUNCTION_KEYSEQ *)0, %s },\n", func, doc); #endif /* !NAMED_FUNCTIONS */ fprintf (key_stream, " { \"%s\", A_%s },\n", func_name, func); @@ -528,7 +524,9 @@ process_one_file (filename, doc_stream, key_stream, funs_stream) #if defined (INFOKEY) fprintf (funs_stream, "#define A_%s %u\n", func, next_func_key()); #endif /* INFOKEY */ - fprintf (funs_stream, "extern void %s ();\n", func); + fprintf (funs_stream, + "extern void %s (WINDOW *window, int count, unsigned char key);\n", + func); free (func); free (doc); } @@ -547,16 +545,14 @@ process_one_file (filename, doc_stream, key_stream, funs_stream) } static void -fatal_file_error (filename) - char *filename; +fatal_file_error (char *filename) { fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename); xexit (2); } static FILE * -must_fopen (filename, mode) - char *filename, *mode; +must_fopen (char *filename, char *mode) { FILE *stream; @@ -570,14 +566,13 @@ must_fopen (filename, mode) static unsigned int func_key; static void -init_func_key(val) - unsigned int val; +init_func_key(unsigned int val) { func_key = val; } static unsigned int -next_func_key() +next_func_key(void) { return func_key++; } diff --git a/gnu/usr.bin/texinfo/info/man.c b/gnu/usr.bin/texinfo/info/man.c index db92d09499b..0462047eacb 100644 --- a/gnu/usr.bin/texinfo/info/man.c +++ b/gnu/usr.bin/texinfo/info/man.c @@ -1,7 +1,8 @@ /* man.c: How to read and format man files. - $Id: man.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: man.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1995, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -52,22 +53,20 @@ static char const * const exec_extensions[] = { static char const * const exec_extensions[] = { "", NULL }; #endif -static char *read_from_fd (); -static void clean_manpage (); -static NODE *manpage_node_of_file_buffer (); -static char *get_manpage_contents (); +static char *read_from_fd (int fd); +static void clean_manpage (char *manpage); +static NODE *manpage_node_of_file_buffer (FILE_BUFFER *file_buffer, + char *pagename); +static char *get_manpage_contents (char *pagename); NODE * -make_manpage_node (pagename) - char *pagename; +make_manpage_node (char *pagename) { return (info_get_node (MANPAGE_FILE_BUFFER_NAME, pagename)); } NODE * -get_manpage_node (file_buffer, pagename) - FILE_BUFFER *file_buffer; - char *pagename; +get_manpage_node (FILE_BUFFER *file_buffer, char *pagename) { NODE *node; @@ -120,23 +119,25 @@ get_manpage_node (file_buffer, pagename) for (in = 0; in < info_win->nodes_index; in++) { - NODE *node = info_win->nodes[in]; + NODE *tmp_node = info_win->nodes[in]; /* It really only suffices to see that node->filename is "*manpages*". But after several hours of debugging this, would you blame me for being a bit paranoid? */ - if (node && node->filename && node->contents && - strcmp (node->filename, - MANPAGE_FILE_BUFFER_NAME) == 0 && - node->contents >= old_contents && - node->contents + node->nodelen <= old_contents_end) + if (tmp_node && tmp_node->filename + && tmp_node->contents + && strcmp (tmp_node->filename, + MANPAGE_FILE_BUFFER_NAME) == 0 + && tmp_node->contents >= old_contents + && tmp_node->contents + tmp_node->nodelen + <= old_contents_end) { info_win->nodes[in] = manpage_node_of_file_buffer (file_buffer, - node->nodename); - free (node->nodename); - free (node); + tmp_node->nodename); + free (tmp_node->nodename); + free (tmp_node); } } } @@ -150,7 +151,7 @@ get_manpage_node (file_buffer, pagename) } FILE_BUFFER * -create_manpage_file_buffer () +create_manpage_file_buffer (void) { FILE_BUFFER *file_buffer = make_file_buffer (); file_buffer->filename = xstrdup (MANPAGE_FILE_BUFFER_NAME); @@ -159,7 +160,7 @@ create_manpage_file_buffer () file_buffer->filesize = 0; file_buffer->contents = (char *)NULL; file_buffer->flags = (N_IsInternal | N_CannotGC | N_IsManPage); - + return (file_buffer); } @@ -167,8 +168,7 @@ create_manpage_file_buffer () one that is an executable file, return it as a new string. Otherwise, return a NULL pointer. */ static char * -executable_file_in_path (filename, path) - char *filename, *path; +executable_file_in_path (char *filename, char *path) { struct stat finfo; char *temp_dirname; @@ -222,7 +222,7 @@ executable_file_in_path (filename, path) /* Return the full pathname of the system man page formatter. */ static char * -find_man_formatter () +find_man_formatter (void) { return (executable_file_in_path ("man", (char *)getenv ("PATH"))); } @@ -231,8 +231,7 @@ static char *manpage_pagename = (char *)NULL; static char *manpage_section = (char *)NULL; static void -get_page_and_section (pagename) - char *pagename; +get_page_and_section (char *pagename) { register int i; @@ -267,21 +266,19 @@ get_page_and_section (pagename) #if PIPE_USE_FORK static void -reap_children (sig) - int sig; +reap_children (int sig) { wait (NULL); } #endif static char * -get_manpage_contents (pagename) - char *pagename; +get_manpage_contents (char *pagename) { static char *formatter_args[4] = { (char *)NULL }; int pipes[2]; pid_t child; - RETSIGTYPE (*sigsave) (); + RETSIGTYPE (*sigsave) (int signum); char *formatted_page = NULL; int arg_index = 1; @@ -375,8 +372,7 @@ get_manpage_contents (pagename) } static void -clean_manpage (manpage) - char *manpage; +clean_manpage (char *manpage) { register int i, j; int newline_count = 0; @@ -400,7 +396,7 @@ clean_manpage (manpage) /* A malformed man page could have a \b as its first character, in which case decrementing j by 2 will cause us to write into newpage[-1], smashing the hidden info stored there by malloc. */ - if (manpage[i] == '\b' || manpage[i] == '\f' && j > 0) + if (manpage[i] == '\b' || (manpage[i] == '\f' && j > 0)) j -= 2; else if (!raw_escapes_p) { @@ -433,9 +429,7 @@ clean_manpage (manpage) } static NODE * -manpage_node_of_file_buffer (file_buffer, pagename) - FILE_BUFFER *file_buffer; - char *pagename; +manpage_node_of_file_buffer (FILE_BUFFER *file_buffer, char *pagename) { NODE *node = (NODE *)NULL; TAG *tag = (TAG *)NULL; @@ -469,8 +463,7 @@ manpage_node_of_file_buffer (file_buffer, pagename) } static char * -read_from_fd (fd) - int fd; +read_from_fd (int fd) { struct timeval timeout; char *buffer = (char *)NULL; @@ -550,8 +543,7 @@ static char *reference_section_starters[] = static SEARCH_BINDING frs_binding; static SEARCH_BINDING * -find_reference_section (node) - NODE *node; +find_reference_section (NODE *node) { register int i; long position = -1; @@ -590,8 +582,7 @@ find_reference_section (node) } REFERENCE ** -xrefs_of_manpage (node) - NODE *node; +xrefs_of_manpage (NODE *node) { SEARCH_BINDING *reference_section; REFERENCE **refs = (REFERENCE **)NULL; @@ -659,10 +650,7 @@ xrefs_of_manpage (node) } long -locate_manpage_xref (node, start, dir) - NODE *node; - long start; - int dir; +locate_manpage_xref (NODE *node, long int start, int dir) { REFERENCE **refs; long position = -1; @@ -709,9 +697,7 @@ locate_manpage_xref (node, start, dir) a START and END value of 0 -- strlen (window-line-containing-point). The BUFFER is a pointer to the start of that line. */ REFERENCE ** -manpage_xrefs_in_binding (node, binding) - NODE *node; - SEARCH_BINDING *binding; +manpage_xrefs_in_binding (NODE *node, SEARCH_BINDING *binding) { register int i; REFERENCE **all_refs = xrefs_of_manpage (node); diff --git a/gnu/usr.bin/texinfo/info/man.h b/gnu/usr.bin/texinfo/info/man.h index 490b4c3b356..9e16ed2e57d 100644 --- a/gnu/usr.bin/texinfo/info/man.h +++ b/gnu/usr.bin/texinfo/info/man.h @@ -1,10 +1,10 @@ /* man.h: Defines and external function declarations for man.c. - $Id: man.h,v 1.2 1999/01/11 16:38:08 espie Exp $ + $Id: man.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,11 +27,13 @@ #define MANPAGE_FILE_BUFFER_NAME "*manpages*" -extern NODE *make_manpage_node (/* char *pagename */); -extern NODE *get_manpage_node (/* FILE_BUFFER *file_buffer, char *pagename */); -extern FILE_BUFFER *create_manpage_file_buffer (/* void */); -extern long locate_manpage_xref (/* NODE *node, long start, int dir */); -extern REFERENCE **xrefs_of_manpage (/* NODE *node */); -extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */); +extern NODE *make_manpage_node (char *pagename); +extern NODE *get_manpage_node (FILE_BUFFER *file_buffer, + char *pagename); +extern FILE_BUFFER *create_manpage_file_buffer (void); +extern long locate_manpage_xref (NODE *node, long int start, int dir); +extern REFERENCE **xrefs_of_manpage (NODE *node); +extern REFERENCE **manpage_xrefs_in_binding (NODE *node, + SEARCH_BINDING *binding); #endif /* INFO_MAN_H */ diff --git a/gnu/usr.bin/texinfo/info/nodemenu.c b/gnu/usr.bin/texinfo/info/nodemenu.c index 1e92a2b6b8c..a0506664948 100644 --- a/gnu/usr.bin/texinfo/info/nodemenu.c +++ b/gnu/usr.bin/texinfo/info/nodemenu.c @@ -1,7 +1,8 @@ /* nodemenu.c -- produce a menu of all visited nodes. - $Id: nodemenu.c,v 1.3 2000/02/09 02:18:40 espie Exp $ + $Id: nodemenu.c,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,9 +22,11 @@ #include "info.h" +NODE * get_visited_nodes (Function *filter_func); + /* Return a line describing the format of a node information line. */ -static char * -nodemenu_format_info () +static const char * +nodemenu_format_info (void) { return (_("\n\ * Menu:\n\ @@ -42,8 +45,7 @@ nodemenu_format_info () * (dir)Top:: 40 589 /usr/gnu/info/dir */ static char * -format_node_info (node) - NODE *node; +format_node_info (NODE *node) { register int i, len; char *parent, *containing_file; @@ -101,7 +103,7 @@ format_node_info (node) if (node->filename && *(node->filename)) { len = pad_to (51, line_buffer); - sprintf (line_buffer + len, node->filename); + strcpy (line_buffer + len, node->filename); } return xstrdup (line_buffer); @@ -109,10 +111,12 @@ format_node_info (node) /* Little string comparison routine for qsort (). */ static int -compare_strings (string1, string2) - char **string1, **string2; +compare_strings (const void *entry1, const void *entry2) { - return (strcasecmp (*string1, *string2)); + char **e1 = (char **) entry1; + char **e2 = (char **) entry2; + + return (strcasecmp (*e1, *e2)); } /* The name of the nodemenu node. */ @@ -123,8 +127,7 @@ static char *nodemenu_nodename = "*Node Menu*"; which nodes will appear in the listing. FILTER_FUNC takes an argument of NODE, and returns non-zero if the node should appear in the listing. */ NODE * -get_visited_nodes (filter_func) - Function *filter_func; +get_visited_nodes (Function *filter_func) { register int i, iw_index; INFO_WINDOW *info_win; @@ -196,14 +199,16 @@ get_visited_nodes (filter_func) printf_to_message_buffer ("%s", replace_in_documentation - (_("Here is the menu of nodes you have recently visited.\n\ -Select one from this menu, or use `\\[history-node]' in another window.\n"))); + ((char *) _("Here is the menu of nodes you have recently visited.\n\ +Select one from this menu, or use `\\[history-node]' in another window.\n"), 0), + NULL, NULL); - printf_to_message_buffer ("%s\n", nodemenu_format_info ()); + printf_to_message_buffer ("%s\n", (char *) nodemenu_format_info (), + NULL, NULL); for (i = 0; (lines != (char **)NULL) && (i < lines_index); i++) { - printf_to_message_buffer ("%s\n", lines[i]); + printf_to_message_buffer ("%s\n", lines[i], NULL, NULL); free (lines[i]); } @@ -308,7 +313,8 @@ DECLARE_INFO_COMMAND (select_visited_node, free (node); line = - info_read_completing_in_echo_area (window, _("Select visited node: "), menu); + info_read_completing_in_echo_area (window, + (char *) _("Select visited node: "), menu); window = active_window; @@ -328,7 +334,7 @@ DECLARE_INFO_COMMAND (select_visited_node, entry = info_get_labeled_reference (line, menu); if (!entry) - info_error (_("The reference disappeared! (%s)."), line); + info_error ((char *) _("The reference disappeared! (%s)."), line, NULL); else info_select_reference (window, entry); } diff --git a/gnu/usr.bin/texinfo/info/nodes.h b/gnu/usr.bin/texinfo/info/nodes.h index 1c196a2fc51..975b90f504e 100644 --- a/gnu/usr.bin/texinfo/info/nodes.h +++ b/gnu/usr.bin/texinfo/info/nodes.h @@ -1,7 +1,7 @@ /* nodes.h -- How we represent nodes internally. - $Id: nodes.h,v 1.3 2000/02/09 02:18:40 espie Exp $ + $Id: nodes.h,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -123,33 +123,34 @@ extern int info_loaded_files_slots; already, or it may not. If it does not already appear, find the file, and add it to the list of loaded files. If the file cannot be found, return a NULL FILE_BUFFER *. */ -extern FILE_BUFFER *info_find_file (); +extern FILE_BUFFER *info_find_file (char *filename); /* Force load the file named FILENAME, and return the information structure describing this file. Even if the file was already loaded, this loads a new buffer, rebuilds tags and nodes, and returns a new FILE_BUFFER *. */ -extern FILE_BUFFER *info_load_file (); +extern FILE_BUFFER *info_load_file (char *filename); /* Return a pointer to a NODE structure for the Info node (FILENAME)NODENAME. FILENAME can be passed as NULL, in which case the filename of "dir" is used. NODENAME can be passed as NULL, in which case the nodename of "Top" is used. If the node cannot be found, return a NULL pointer. */ -extern NODE *info_get_node (); +extern NODE *info_get_node (char *filename, char *nodename); /* Return a pointer to a NODE structure for the Info node NODENAME in FILE_BUFFER. NODENAME can be passed as NULL, in which case the nodename of "Top" is used. If the node cannot be found, return a NULL pointer. */ -extern NODE *info_get_node_of_file_buffer (); +extern NODE *info_get_node_of_file_buffer (char *nodename, + FILE_BUFFER *file_buffer); /* Grovel FILE_BUFFER->contents finding tags and nodes, and filling in the various slots. This can also be used to rebuild a tag or node table. */ -extern void build_tags_and_nodes (); +extern void build_tags_and_nodes (FILE_BUFFER *file_buffer); /* When non-zero, this is a string describing the most recent file error. */ extern char *info_recent_file_error; /* Create a new, empty file buffer. */ -extern FILE_BUFFER *make_file_buffer (); +extern FILE_BUFFER *make_file_buffer (void); #endif /* not NODES_H */ diff --git a/gnu/usr.bin/texinfo/info/search.h b/gnu/usr.bin/texinfo/info/search.h index bf10560032e..235c3b34a53 100644 --- a/gnu/usr.bin/texinfo/info/search.h +++ b/gnu/usr.bin/texinfo/info/search.h @@ -1,7 +1,7 @@ /* search.h -- Structure used to search large bodies of text, with bounds. - $Id: search.h,v 1.3 2000/02/09 02:18:40 espie Exp $ + $Id: search.h,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,26 +42,34 @@ typedef struct { #define S_FoldCase 0x01 /* Set means fold case in searches. */ #define S_SkipDest 0x02 /* Set means return pointing after the dest. */ -SEARCH_BINDING *make_binding (), *copy_binding (); -extern long search_forward (), search_backward (), search (); -extern int looking_at (); +SEARCH_BINDING *make_binding (char *buffer, long int start, long int end); +SEARCH_BINDING *copy_binding (SEARCH_BINDING *binding); +extern long search_forward (char *string, SEARCH_BINDING *binding); +extern long search_backward (char *input_string, SEARCH_BINDING *binding); +extern long search (char *string, SEARCH_BINDING *binding); +extern int looking_at (char *string, SEARCH_BINDING *binding); /* Note that STRING_IN_LINE () always returns the offset of the 1st character after the string. */ -extern int string_in_line (); +extern int string_in_line (char *string, char *line); /* Function names that start with "skip" are passed a string, and return an offset from the start of that string. Function names that start with "find" are passed a SEARCH_BINDING, and return an absolute position marker of the item being searched for. "Find" functions return a value of -1 if the item being looked for couldn't be found. */ -extern int skip_whitespace (), skip_non_whitespace (); -extern int skip_whitespace_and_newlines (), skip_line (); -extern int skip_node_characters (), skip_node_separator (); +extern int skip_whitespace (char *string); +extern int skip_non_whitespace (char *string); +extern int skip_whitespace_and_newlines (char *string); +extern int skip_line (char *string); +extern int skip_node_characters (char *string, int newlines_okay); +extern int skip_node_separator (char *body); + #define DONT_SKIP_NEWLINES 0 #define SKIP_NEWLINES 1 -extern long find_node_separator (), find_tags_table (); -extern long find_node_in_binding (); +extern long find_node_separator (SEARCH_BINDING *binding); +extern long find_tags_table (SEARCH_BINDING *binding); +extern long find_node_in_binding (char *nodename, SEARCH_BINDING *binding); #endif /* not INFO_SEARCH_H */ diff --git a/gnu/usr.bin/texinfo/info/session.c b/gnu/usr.bin/texinfo/info/session.c index 43b8e22ce5f..31b4a283bd3 100644 --- a/gnu/usr.bin/texinfo/info/session.c +++ b/gnu/usr.bin/texinfo/info/session.c @@ -1,7 +1,7 @@ /* session.c -- user windowing interface to Info. - $Id: session.c,v 1.5 2002/06/10 13:51:03 espie Exp $ + $Id: session.c,v 1.6 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 96, 97, 98, 99, 2000, 01, 02 + Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -18,9 +18,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #include "info.h" +#include "search.h" #include <sys/ioctl.h> #if defined (HAVE_SYS_TIME_H) @@ -32,14 +33,11 @@ # include "man.h" #endif -#ifdef M_XENIX -/* SCO 3.2v5.0.2 defines but does not correctly declare strncasecmp. - Since we use it as a symbol, have to get it right. --gildea, 1jul99. */ -extern int strncasecmp (const char *, const char *, size_t); -#endif - -static void info_clear_pending_input (), info_set_pending_input (); -static void info_handle_pointer (); +static void info_clear_pending_input (void); +static void info_set_pending_input (unsigned char key); +static void info_handle_pointer (char *label, WINDOW *window); +static void display_info_keyseq (int expecting_future_input); +char *node_printed_rep (NODE *node); /* **************************************************************** */ /* */ @@ -66,17 +64,15 @@ static int info_windows_index = 0; /* Number of slots allocated to `info_windows'. */ static int info_windows_slots = 0; -void remember_window_and_node (), forget_window_and_nodes (); -void initialize_info_session (), info_session (); -void display_startup_message_and_start (); +void remember_window_and_node (WINDOW *window, NODE *node); +void forget_window_and_nodes (WINDOW *window); +void display_startup_message_and_start (void); /* Begin an info session finding the nodes specified by FILENAME and NODENAMES. For each loaded node, create a new window. Always split the largest of the available windows. */ void -begin_multiple_window_info_session (filename, nodenames) - char *filename; - char **nodenames; +begin_multiple_window_info_session (char *filename, char **nodenames) { register int i; WINDOW *window = (WINDOW *)NULL; @@ -114,7 +110,7 @@ begin_multiple_window_info_session (filename, nodenames) if (!largest) { display_update_display (windows); - info_error (msg_cant_find_window); + info_error ((char *) msg_cant_find_window, NULL, NULL); info_session (); xexit (0); } @@ -129,7 +125,7 @@ begin_multiple_window_info_session (filename, nodenames) else { display_update_display (windows); - info_error (msg_win_too_small); + info_error ((char *) msg_win_too_small, NULL, NULL); info_session (); xexit (0); } @@ -141,11 +137,8 @@ begin_multiple_window_info_session (filename, nodenames) /* Start an info session with INITIAL_NODE, and an error message in the echo area made from FORMAT and ARG. */ void -begin_info_session_with_error (initial_node, format, arg1, arg2) - NODE *initial_node; - char *format; - void *arg1; - void *arg2; +begin_info_session_with_error (NODE *initial_node, char *format, + void *arg1, void *arg2) { initialize_info_session (initial_node, 1); info_error (format, arg1, arg2); @@ -154,28 +147,28 @@ begin_info_session_with_error (initial_node, format, arg1, arg2) /* Start an info session with INITIAL_NODE. */ void -begin_info_session (initial_node) - NODE *initial_node; +begin_info_session (NODE *initial_node) { initialize_info_session (initial_node, 1); display_startup_message_and_start (); } void -display_startup_message_and_start () +display_startup_message_and_start (void) { char *format; format = replace_in_documentation - (_("Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] for menu item.")); + ((char *) _("Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] for menu item."), + 0); - window_message_in_echo_area (format, VERSION); + window_message_in_echo_area (format, VERSION, NULL); info_session (); } /* Run an info session with an already initialized window and node. */ void -info_session () +info_session (void) { display_update_display (windows); info_last_executed_command = NULL; @@ -192,7 +185,7 @@ info_session () /* Here is a window-location dependent event loop. Called from the functions info_session (), and from read_xxx_in_echo_area (). */ void -info_read_and_dispatch () +info_read_and_dispatch (void) { unsigned char key; int done; @@ -200,12 +193,12 @@ info_read_and_dispatch () while (!done && !quit_info_immediately) { - int lk; + int lk = 0; /* If we haven't just gone up or down a line, there is no goal column for this window. */ - if ((info_last_executed_command != info_next_line) && - (info_last_executed_command != info_prev_line)) + if ((info_last_executed_command != (VFunction *) info_next_line) && + (info_last_executed_command != (VFunction *) info_prev_line)) active_window->goal_column = -1; if (echo_area_is_active) @@ -242,30 +235,28 @@ info_read_and_dispatch () if (lk == echo_area_last_command_was_kill) echo_area_last_command_was_kill = 0; - if (ea_last_executed_command == ea_newline || + if (ea_last_executed_command == (VFunction *) ea_newline || info_aborted_echo_area) { ea_last_executed_command = (VFunction *)NULL; done = 1; } - if (info_last_executed_command == info_quit) + if (info_last_executed_command == (VFunction *) info_quit) quit_info_immediately = 1; } - else if (info_last_executed_command == info_quit) + else if (info_last_executed_command == (VFunction *) info_quit) done = 1; } } /* Found in signals.c */ -extern void initialize_info_signal_handler (); +extern void initialize_info_signal_handler (void ); /* Initialize the first info session by starting the terminal, window, and display systems. If CLEAR_SCREEN is 0, don't clear the screen. */ void -initialize_info_session (node, clear_screen) - NODE *node; - int clear_screen; +initialize_info_session (NODE *node, int clear_screen) { char *term_name = getenv ("TERM"); terminal_initialize_terminal (term_name); @@ -275,7 +266,7 @@ initialize_info_session (node, clear_screen) if (!term_name) term_name = "dumb"; - info_error (msg_term_too_dumb, term_name); + info_error ((char *) msg_term_too_dumb, term_name, NULL); xexit (1); } @@ -293,7 +284,7 @@ initialize_info_session (node, clear_screen) /* Tell the window system how to notify us when a window needs to be asynchronously deleted (e.g., user resizes window very small). */ - window_deletion_notifier = forget_window_and_nodes; + window_deletion_notifier = (VFunction *) forget_window_and_nodes; /* If input has not been redirected yet, make it come from unbuffered standard input. */ @@ -308,8 +299,7 @@ initialize_info_session (node, clear_screen) /* Tell Info that input is coming from the file FILENAME. */ void -info_set_input_from_file (filename) - char *filename; +info_set_input_from_file (char *filename) { FILE *stream; @@ -331,8 +321,7 @@ info_set_input_from_file (filename) /* Return the INFO_WINDOW containing WINDOW, or NULL if there isn't one. */ static INFO_WINDOW * -get_info_window_of_window (window) - WINDOW *window; +get_info_window_of_window (WINDOW *window) { register int i; INFO_WINDOW *info_win = (INFO_WINDOW *)NULL; @@ -348,8 +337,7 @@ get_info_window_of_window (window) values if the window and node are the same as the current one being displayed. */ void -set_remembered_pagetop_and_point (window) - WINDOW *window; +set_remembered_pagetop_and_point (WINDOW *window) { INFO_WINDOW *info_win; @@ -367,9 +355,7 @@ set_remembered_pagetop_and_point (window) } void -remember_window_and_node (window, node) - WINDOW *window; - NODE *node; +remember_window_and_node (WINDOW *window, NODE *node) { /* See if we already have this window in our list. */ INFO_WINDOW *info_win = get_info_window_of_window (window); @@ -428,7 +414,7 @@ remember_window_and_node (window, node) #define DEBUG_FORGET_WINDOW_AND_NODES #if defined (DEBUG_FORGET_WINDOW_AND_NODES) static void -consistency_check_info_windows () +consistency_check_info_windows (void) { register int i; @@ -448,8 +434,7 @@ consistency_check_info_windows () /* Remove WINDOW and its associated list of nodes from INFO_WINDOWS. */ void -forget_window_and_nodes (window) - WINDOW *window; +forget_window_and_nodes (WINDOW *window) { register int i; INFO_WINDOW *info_win = (INFO_WINDOW *)NULL; @@ -496,10 +481,7 @@ forget_window_and_nodes (window) the footnotes for this window. If REMEMBER is nonzero, first call set_remembered_pagetop_and_point. */ void -info_set_node_of_window (remember, window, node) - int remember; - WINDOW *window; - NODE *node; +info_set_node_of_window (int remember, WINDOW *window, NODE *node) { if (remember) set_remembered_pagetop_and_point (window); @@ -526,9 +508,7 @@ info_set_node_of_window (remember, window, node) /* Change the pagetop of WINDOW to DESIRED_TOP, perhaps scrolling the screen to do so. */ void -set_window_pagetop (window, desired_top) - WINDOW *window; - int desired_top; +set_window_pagetop (WINDOW *window, int desired_top) { int point_line, old_pagetop; @@ -591,8 +571,7 @@ set_window_pagetop (window, desired_top) /* Immediately make WINDOW->point visible on the screen, and move the terminal cursor there. */ static void -info_show_point (window) - WINDOW *window; +info_show_point (WINDOW *window) { int old_pagetop; @@ -615,13 +594,11 @@ info_show_point (window) /* Move WINDOW->point from OLD line index to NEW line index. */ static void -move_to_new_line (old, new, window) - int old, new; - WINDOW *window; +move_to_new_line (int old, int new, WINDOW *window) { if (old == -1) { - info_error (msg_cant_find_point); + info_error ((char *) msg_cant_find_point, NULL, NULL); } else { @@ -869,23 +846,22 @@ int default_scroll_size = -1; /* meaning half screen size */ /* Move to 1st menu item, Next, Up/Next, or error in this window. */ static void -forward_move_node_structure (window, behaviour) - WINDOW *window; - int behaviour; +forward_move_node_structure (WINDOW *window, int behaviour) { switch (behaviour) { case IS_PageOnly: - info_error (msg_at_node_bottom); + info_error ((char *) msg_at_node_bottom, NULL, NULL); break; case IS_NextOnly: info_next_label_of_node (window->node); if (!info_parsed_nodename && !info_parsed_filename) - info_error (msg_no_pointer, _("Next")); + info_error ((char *) msg_no_pointer, (char *) _("Next"), NULL); else { - window_message_in_echo_area (_("Following Next node...")); + window_message_in_echo_area ((char *) _("Following Next node..."), + NULL, NULL); info_handle_pointer ("Next", window); } break; @@ -902,7 +878,8 @@ forward_move_node_structure (window, behaviour) if (menu) { info_free_references (menu); - window_message_in_echo_area (_("Selecting first menu item...")); + window_message_in_echo_area ((char *) _("Selecting first menu item..."), + NULL, NULL); info_menu_digit (window, 1, '1'); return; } @@ -913,7 +890,8 @@ forward_move_node_structure (window, behaviour) info_next_label_of_node (window->node); if (INFO_LABEL_FOUND ()) { - window_message_in_echo_area (_("Selecting Next node...")); + window_message_in_echo_area ((char *) _("Selecting Next node..."), + NULL, NULL); info_handle_pointer ("Next", window); return; } @@ -983,8 +961,8 @@ forward_move_node_structure (window, behaviour) /* This node has a "Next" pointer, and it is not the same as the first menu item found in this node. */ window_message_in_echo_area - (_("Moving Up %d time(s), then Next."), - up_counter); + ((char *) _("Moving Up %d time(s), then Next."), + (void *) (long) up_counter, NULL); info_handle_pointer ("Next", window); return; @@ -1007,7 +985,8 @@ forward_move_node_structure (window, behaviour) window->point = info_win->points[old_current]; recalculate_line_starts (window); window->flags |= W_UpdateWindow; - info_error (_("No more nodes within this document.")); + info_error ((char *) _("No more nodes within this document."), + NULL, NULL); } } } @@ -1018,23 +997,22 @@ forward_move_node_structure (window, behaviour) /* Move Prev, Up or error in WINDOW depending on BEHAVIOUR. */ static void -backward_move_node_structure (window, behaviour) - WINDOW *window; - int behaviour; +backward_move_node_structure (WINDOW *window, int behaviour) { switch (behaviour) { case IS_PageOnly: - info_error (msg_at_node_top); + info_error ((char *) msg_at_node_top, NULL, NULL); break; case IS_NextOnly: info_prev_label_of_node (window->node); if (!info_parsed_nodename && !info_parsed_filename) - info_error (_("No `Prev' for this node.")); + info_error ((char *) _("No `Prev' for this node."), NULL, NULL); else { - window_message_in_echo_area (_("Moving Prev in this window.")); + window_message_in_echo_area ((char *) _("Moving Prev in this window."), + NULL, NULL); info_handle_pointer ("Prev", window); } break; @@ -1048,10 +1026,13 @@ backward_move_node_structure (window, behaviour) info_up_label_of_node (window->node); if (!info_parsed_nodename && (!info_parsed_filename || is_dir_name (info_parsed_filename))) - info_error (_("No `Prev' or `Up' for this node within this document.")); + info_error ((char *) + _("No `Prev' or `Up' for this node within this document."), + NULL, NULL); else { - window_message_in_echo_area (_("Moving Up in this window.")); + window_message_in_echo_area ((char *) _("Moving Up in this window."), + NULL, NULL); info_handle_pointer ("Up", window); } } @@ -1089,7 +1070,8 @@ backward_move_node_structure (window, behaviour) /* Move to the previous node. If this node now contains a menu, and we have not inhibited movement to it, move to the node corresponding to the last menu item. */ - window_message_in_echo_area (_("Moving Prev in this window.")); + window_message_in_echo_area ((char *) _("Moving Prev in this window."), + NULL, NULL); info_handle_pointer ("Prev", window); if (!inhibit_menu_traversing) @@ -1099,7 +1081,7 @@ backward_move_node_structure (window, behaviour) { info_free_references (menu); window_message_in_echo_area - (_("Moving to `Prev's last menu item.")); + ((char *) _("Moving to `Prev's last menu item."), NULL, NULL); info_menu_digit (window, 1, '0'); } } @@ -1140,15 +1122,13 @@ DECLARE_INFO_COMMAND (info_global_prev_node, } } -static void _scroll_forward(); -static void _scroll_backward(); +static void _scroll_forward(WINDOW *window, int count, + unsigned char key, int behaviour); +static void _scroll_backward(WINDOW *window, int count, + unsigned char key, int behaviour); static void -_scroll_forward(window, count, key, behaviour) - WINDOW *window; - int count; - unsigned char key; - int behaviour; +_scroll_forward(WINDOW *window, int count, unsigned char key, int behaviour) { if (count < 0) _scroll_backward (window, -count, key, behaviour); @@ -1188,11 +1168,7 @@ _scroll_forward(window, count, key, behaviour) } static void -_scroll_backward(window, count, key, behaviour) - WINDOW *window; - int count; - unsigned char key; - int behaviour; +_scroll_backward(WINDOW *window, int count, unsigned char key, int behaviour) { if (count < 0) _scroll_forward (window, -count, key, behaviour); @@ -1406,7 +1382,7 @@ DECLARE_INFO_COMMAND (info_next_window, _("Select the next window")) /* If no other window, error now. */ if (!windows->next && !echo_area_is_active) { - info_error (msg_one_window); + info_error ((char *) msg_one_window, NULL, NULL); return; } @@ -1446,7 +1422,7 @@ DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window")) if (!windows->next && !echo_area_is_active) { - info_error (msg_one_window); + info_error ((char *) msg_one_window, NULL, NULL); return; } @@ -1457,7 +1433,7 @@ DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window")) if (window == the_echo_area || (window == windows && !echo_area_is_active)) { - register WINDOW *win, *last; + register WINDOW *win, *last = NULL; for (win = windows; win; win = win->next) last = win; @@ -1502,7 +1478,7 @@ DECLARE_INFO_COMMAND (info_split_window, _("Split the current window")) if (!split) { - info_error (msg_win_too_small); + info_error ((char *) msg_win_too_small, NULL, NULL); } else { @@ -1570,11 +1546,11 @@ DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window")) { if (!windows->next) { - info_error (msg_cant_kill_last); + info_error ((char *) msg_cant_kill_last, NULL, NULL); } else if (window->flags & W_WindowIsPerm) { - info_error (_("Cannot delete a permanent window")); + info_error ((char *) _("Cannot delete a permanent window"), NULL, NULL); } else { @@ -1591,8 +1567,7 @@ DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window")) /* Do the physical deletion of WINDOW, and forget this window and associated nodes. */ void -info_delete_window_internal (window) - WINDOW *window; +info_delete_window_internal (WINDOW *window) { if (windows->next && ((window->flags & W_WindowIsPerm) == 0)) { @@ -1660,7 +1635,7 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window")) /* If only one window, give up. */ if (!windows->next) { - info_error (msg_one_window); + info_error ((char *) msg_one_window, NULL, NULL); return; } @@ -1712,8 +1687,7 @@ DECLARE_INFO_COMMAND (info_toggle_wrap, /* Return (FILENAME)NODENAME for NODE, or just NODENAME if NODE's filename is not set. */ char * -node_printed_rep (node) - NODE *node; +node_printed_rep (NODE *node) { char *rep; @@ -1734,9 +1708,7 @@ node_printed_rep (node) /* Using WINDOW for various defaults, select the node referenced by ENTRY in it. If the node is selected, the window and node are remembered. */ void -info_select_reference (window, entry) - WINDOW *window; - REFERENCE *entry; +info_select_reference (WINDOW *window, REFERENCE *entry) { NODE *node; char *filename, *nodename, *file_system_error; @@ -1781,9 +1753,9 @@ info_select_reference (window, entry) if (!node) { if (file_system_error) - info_error (file_system_error); + info_error (file_system_error, NULL, NULL); else - info_error (msg_cant_find_node, nodename); + info_error ((char *) msg_cant_find_node, nodename, NULL); } maybe_free (file_system_error); @@ -1798,9 +1770,7 @@ info_select_reference (window, entry) Select the parsed node in WINDOW and remember it, or error if the node couldn't be found. */ static void -info_parse_and_select (line, window) - char *line; - WINDOW *window; +info_parse_and_select (char *line, WINDOW *window) { REFERENCE entry; @@ -1818,9 +1788,7 @@ info_parse_and_select (line, window) WINDOW. The node should have been pointed to by the LABEL pointer of WINDOW->node. */ static void -info_handle_pointer (label, window) - char *label; - WINDOW *window; +info_handle_pointer (char *label, WINDOW *window) { if (info_parsed_filename || info_parsed_nodename) { @@ -1861,9 +1829,9 @@ info_handle_pointer (label, window) else { if (info_recent_file_error) - info_error (info_recent_file_error); + info_error (info_recent_file_error, NULL, NULL); else - info_error (msg_cant_file_node, filename, nodename); + info_error ((char *) msg_cant_file_node, filename, nodename); } free (filename); @@ -1871,7 +1839,7 @@ info_handle_pointer (label, window) } else { - info_error (msg_no_pointer, label); + info_error ((char *) msg_no_pointer, label, NULL); } } @@ -1927,7 +1895,7 @@ DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file")) } if (!node) - info_error (_("This window has no additional nodes")); + info_error ((char *) _("This window has no additional nodes"), NULL, NULL); else info_set_node_of_window (1, window, node); } @@ -1960,7 +1928,7 @@ DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file")) } if (!node) - info_error (_("This window has no additional nodes")); + info_error ((char *) _("This window has no additional nodes"), NULL, NULL); else info_set_node_of_window (1, window, node); } @@ -1976,13 +1944,13 @@ DECLARE_INFO_COMMAND (info_last_menu_item, DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item")) { register int i, item; - register REFERENCE *entry, **menu; + register REFERENCE **menu; menu = info_menu_of_node (window->node); if (!menu) { - info_error (msg_no_menu_node); + info_error ((char *) msg_no_menu_node, NULL, NULL); return; } @@ -1994,54 +1962,118 @@ DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item")) for (i = 0; menu[i + 1]; i++); else { - for (i = 0; (entry = menu[i]); i++) + for (i = 0; menu[i]; i++) if (i == item - 1) break; } if (menu[i]) - info_select_reference (window, menu[i]); + { + info_select_reference (window, menu[i]); + if (menu[i]->line_number > 0) + info_next_line (window, menu[i]->line_number - 1, key); + } else - info_error (_("There aren't %d items in this menu."), item); + info_error ((char *) _("There aren't %d items in this menu."), + (void *) (long) item, NULL); info_free_references (menu); return; } + + +/* Return a pointer to the xref in XREF_LIST that is nearest to POS, or + NULL if XREF_LIST is empty. That is, if POS is within any of the + given xrefs, return that one. Otherwise, return the one with the + nearest beginning or end. If there are two that are equidistant, + prefer the one forward. The return is in newly-allocated memory, + since the caller frees it. + + This is called from info_menu_or_ref_item with XREF_LIST being all + the xrefs in the node, and POS being point. The ui function that + starts it all off is select-reference-this-line. + + This is not the same logic as in info.el. Info-get-token prefers + searching backwards to searching forwards, and has a hardwired search + limit of 200 chars (in Emacs 21.2). */ + +static REFERENCE ** +nearest_xref (REFERENCE **xref_list, long int pos) +{ + int this_xref; + int nearest = -1; + long best_delta = -1; + + for (this_xref = 0; xref_list[this_xref]; this_xref++) + { + long delta; + REFERENCE *xref = xref_list[this_xref]; + if (xref->start <= pos && pos <= xref->end) + { /* POS is within this xref, we're done */ + nearest = this_xref; + break; + } + + /* See how far POS is from this xref. Take into account the + `*Note' that begins the xref, since as far as the user is + concerned, that's where it starts. */ + delta = MIN (labs (pos - (xref->start - strlen (INFO_XREF_LABEL))), + labs (pos - xref->end)); + + /* It's the <= instead of < that makes us choose the forward xref + of POS if two are equidistant. Of course, because of all the + punctuation surrounding xrefs, it's not necessarily obvious + where one ends. */ + if (delta <= best_delta || best_delta < 0) + { + nearest = this_xref; + best_delta = delta; + } + } + + /* Maybe there was no list to search through. */ + if (nearest < 0) + return NULL; + + /* Ok, we have a nearest xref, make a list of it. */ + { + REFERENCE **ret = xmalloc (sizeof (REFERENCE *) * 2); + ret[0] = info_copy_reference (xref_list[nearest]); + ret[1] = NULL; + return ret; + } +} + + /* Read a menu or followed reference from the user defaulting to the reference found on the current line, and select that node. The reading is done with completion. BUILDER is the function used to build the list of references. ASK_P is non-zero if the user should be prompted, or zero to select the default item. */ static void -info_menu_or_ref_item (window, count, key, builder, ask_p) - WINDOW *window; - int count; - unsigned char key; - REFERENCE **(*builder) (); - int ask_p; -{ - REFERENCE **menu, *entry, *defentry = (REFERENCE *)NULL; +info_menu_or_ref_item (WINDOW *window, int count, + unsigned char key, REFERENCE **(*builder) (NODE *node), int ask_p) +{ char *line; - - menu = (*builder) (window->node); + REFERENCE *entry; + REFERENCE *defentry = NULL; + REFERENCE **menu = (*builder) (window->node); if (!menu) { if (builder == info_menu_of_node) - info_error (msg_no_menu_node); + info_error ((char *) msg_no_menu_node, NULL, NULL); else - info_error (msg_no_xref_node); + info_error ((char *) msg_no_xref_node, NULL, NULL); return; } /* Default the selected reference to the one which is on the line that point is in. */ { - REFERENCE **refs = (REFERENCE **)NULL; - int point_line; - - point_line = window_line_of_point (window); + REFERENCE **refs = NULL; + int point_line = window_line_of_point (window); if (point_line != -1) { @@ -2070,50 +2102,43 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) refs = manpage_xrefs_in_binding (window->node, &binding); else #endif /* HANDLE_MAN_PAGES */ - { - refs = info_xrefs (&binding); - if (!refs && point_line > 0) - { - /* People get annoyed that Info cannot find an xref - which starts on a previous line and ends on this - one. So if we fail to find a reference on this - line, let's try the one before. */ - binding.start = - window->line_starts[point_line - 1] - binding.buffer; - refs = info_xrefs (&binding); - } - } + refs = nearest_xref (menu, window->point); } - if (refs) + if (refs && refs[0]) { - if ((strcmp (refs[0]->label, "Menu") != 0) || - (builder == info_xrefs_of_node)) + if (strcmp (refs[0]->label, "Menu") != 0 + || builder == info_xrefs_of_node) { int which = 0; - /* Find the closest reference to point. */ - if (builder == info_xrefs_of_node) + /* For xrefs, find the closest reference to point, + unless we only have one reference (as we will if + we've called nearest_xref above). It would be better + to have only one piece of code, but the conditions + when we call this are tangled. */ + if (builder == info_xrefs_of_node && refs[1]) { int closest = -1; for (; refs[which]; which++) { - if ((window->point >= refs[which]->start) && - (window->point <= refs[which]->end)) + if (window->point >= refs[which]->start + && window->point <= refs[which]->end) { closest = which; break; } else if (window->point < refs[which]->start) - { - break; - } + break; } - if (closest == -1) - which--; - else - which = closest; + if (which > 0) + { + if (closest == -1) + which--; + else + which = closest; + } } if (which < 0) @@ -2122,6 +2147,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) defentry->label = xstrdup (refs[which]->label); defentry->filename = refs[which]->filename; defentry->nodename = refs[which]->nodename; + defentry->line_number = refs[which]->line_number; if (defentry->filename) defentry->filename = xstrdup (defentry->filename); @@ -2139,24 +2165,27 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) char *prompt; /* Build the prompt string. */ - if (defentry) - prompt = (char *)xmalloc (20 + strlen (defentry->label)); - else - prompt = (char *)xmalloc (20); - if (builder == info_menu_of_node) { if (defentry) - sprintf (prompt, _("Menu item (%s): "), defentry->label); + { + prompt = xmalloc (strlen (defentry->label) + + strlen (_("Menu item (%s): "))); + sprintf (prompt, _("Menu item (%s): "), defentry->label); + } else - sprintf (prompt, _("Menu item: ")); + prompt = xstrdup (_("Menu item: ")); } else { if (defentry) - sprintf (prompt, _("Follow xref (%s): "), defentry->label); + { + prompt = xmalloc (strlen (defentry->label) + + strlen (_("Follow xref (%s): "))); + sprintf (prompt, _("Follow xref (%s): "), defentry->label); + } else - sprintf (prompt, _("Follow xref: ")); + prompt = xstrdup (_("Follow xref: ")); } line = info_read_completing_in_echo_area (window, prompt, menu); @@ -2234,11 +2263,12 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) } if (!entry && defentry) - info_error (_("The reference disappeared! (%s)."), line); + info_error ((char *) _("The reference disappeared! (%s)."), line, NULL); else { NODE *orig = window->node; info_select_reference (window, entry); + if (builder == info_xrefs_of_node && window->node != orig && !(window->node->flags & N_FromAnchor)) { /* Search for this reference in the node. */ @@ -2259,6 +2289,11 @@ info_menu_or_ref_item (window, count, key, builder, ask_p) window_adjust_pagetop (window); } } + + if (entry->line_number > 0) + /* next_line starts at line 1? Anyway, the -1 makes it + move to the right line. */ + info_next_line (window, entry->line_number - 1, key); } free (line); @@ -2306,7 +2341,7 @@ DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu") position = search (INFO_MENU_LABEL, &binding); if (position == -1) - info_error (msg_no_menu_node); + info_error ((char *) msg_no_menu_node, NULL, NULL); else { window->point = position; @@ -2325,7 +2360,7 @@ DECLARE_INFO_COMMAND (info_visit_menu, menu = info_menu_of_node (window->node); if (!menu) - info_error (msg_no_menu_node); + info_error ((char *) msg_no_menu_node, NULL, NULL); for (i = 0; (!info_error_was_printed) && (entry = menu[i]); i++) { @@ -2335,7 +2370,7 @@ DECLARE_INFO_COMMAND (info_visit_menu, window_tile_windows (TILE_INTERNALS); if (!new) - info_error (msg_win_too_small); + info_error ((char *) msg_win_too_small, NULL, NULL); else { active_window = new; @@ -2400,11 +2435,12 @@ DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it")) } } } - line = info_read_maybe_completing (window, _("Goto node: "), items); + line = info_read_maybe_completing (window, (char *) _("Goto node: "), + items); info_free_references (items); } #else /* !GOTO_COMPLETES */ - line = info_read_in_echo_area (window, _("Goto node: ")); + line = info_read_in_echo_area (window, (char *) _("Goto node: ")); #endif /* !GOTO_COMPLETES */ /* If the user aborted, quit now. */ @@ -2432,10 +2468,8 @@ DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it")) will be NULL. */ NODE * -info_follow_menus (initial_node, menus, errstr, errarg1, errarg2) - NODE *initial_node; - char **menus; - char **errstr, **errarg1, **errarg2; +info_follow_menus (NODE *initial_node, char **menus, + const char **errstr, char **errarg1, char **errarg2) { NODE *node = NULL; *errstr = *errarg1 = *errarg2 = NULL; @@ -2490,7 +2524,8 @@ info_follow_menus (initial_node, menus, errstr, errarg1, errarg2) if (strcasecmp (entry->label, arg) == 0) break; else - if (strncasecmp (entry->label, arg, strlen (arg)) == 0) + if ((best_guess == -1) + && (strncasecmp (entry->label, arg, strlen (arg)) == 0)) best_guess = i; } @@ -2568,8 +2603,7 @@ info_follow_menus (initial_node, menus, errstr, errarg1, errarg2) Return array terminated with NULL. */ static char ** -split_list_of_nodenames (str) - char *str; +split_list_of_nodenames (char *str) { unsigned len = 2; char **nodes = xmalloc (len * sizeof (char *)); @@ -2598,7 +2632,7 @@ split_list_of_nodenames (str) DECLARE_INFO_COMMAND (info_menu_sequence, _("Read a list of menus starting from dir and follow them")) { - char *line = info_read_in_echo_area (window, _("Follow menus: ")); + char *line = info_read_in_echo_area (window, (char *) _("Follow menus: ")); /* If the user aborted, quit now. */ if (!line) @@ -2611,10 +2645,11 @@ DECLARE_INFO_COMMAND (info_menu_sequence, if (*line) { - char *errstr, *errarg1, *errarg2; + const char *errstr; + char *errarg1, *errarg2; NODE *dir_node = info_get_node (NULL, NULL); char **nodes = split_list_of_nodenames (line); - NODE *node; + NODE *node = NULL; /* If DIR_NODE is NULL, they might be reading a file directly, like in "info -d . -f ./foo". Try using "Top" instead. */ @@ -2630,16 +2665,15 @@ DECLARE_INFO_COMMAND (info_menu_sequence, /* If we still cannot find the starting point, give up. We cannot allow a NULL pointer inside info_follow_menus. */ if (!dir_node) - info_error (msg_cant_find_node, "Top"); + info_error ((char *) msg_cant_find_node, "Top", NULL); else - node - = info_follow_menus (dir_node, nodes, &errstr, &errarg1, &errarg2); + node = info_follow_menus (dir_node, nodes, &errstr, &errarg1, &errarg2); free (nodes); if (!errstr) info_set_node_of_window (1, window, node); else - info_error (errstr, errarg1, errarg2); + info_error ((char *) errstr, errarg1, errarg2); } free (line); @@ -2652,10 +2686,7 @@ DECLARE_INFO_COMMAND (info_menu_sequence, or NULL if there's nothing in this menu seems to fit the bill. If EXACT is non-zero, allow only exact matches. */ static REFERENCE * -entry_in_menu (arg, menu, exact) - char *arg; - REFERENCE **menu; - int exact; +entry_in_menu (char *arg, REFERENCE **menu, int exact) { REFERENCE *entry; @@ -2689,10 +2720,7 @@ entry_in_menu (arg, menu, exact) invocation info and its command-line options, by looking for menu items and chains of menu items with characteristic names. */ void -info_intuit_options_node (window, initial_node, program) - WINDOW *window; - NODE *initial_node; - char *program; +info_intuit_options_node (WINDOW *window, NODE *initial_node, char *program) { /* The list of node names typical for GNU manuals where the program usage and specifically the command-line arguments are described. @@ -2727,7 +2755,7 @@ info_intuit_options_node (window, initial_node, program) in the menu hierarchy... */ for (node = initial_node; node; initial_node = node) { - REFERENCE *entry; + REFERENCE *entry = NULL; /* Build and return a list of the menu items in this node. */ menu = info_menu_of_node (initial_node); @@ -2740,13 +2768,15 @@ info_intuit_options_node (window, initial_node, program) /* Look for node names typical for usage nodes in this menu. */ for (try_node = invocation_nodes; *try_node; try_node++) { - char nodename[200]; + char *nodename; + nodename = xmalloc (strlen (program) + strlen (*try_node)); sprintf (nodename, *try_node, program); /* The last resort "%s" is dangerous, so we restrict it to exact matches here. */ entry = entry_in_menu (nodename, menu, strcmp (*try_node, "%s") == 0); + free (nodename); if (entry) break; } @@ -2774,8 +2804,7 @@ info_intuit_options_node (window, initial_node, program) /* Given a name of an Info file, find the name of the package it describes by removing the leading directories and extensions. */ char * -program_name_from_file_name (file_name) - char *file_name; +program_name_from_file_name (char *file_name) { int i; char *program_name = xstrdup (filename_non_directory (file_name)); @@ -2798,7 +2827,7 @@ program_name_from_file_name (file_name) DECLARE_INFO_COMMAND (info_goto_invocation_node, _("Find the node describing program invocation")) { - char *invocation_prompt = _("Find Invocation node of [%s]: "); + const char *invocation_prompt = _("Find Invocation node of [%s]: "); char *program_name, *line; char *default_program_name, *prompt, *file_name; NODE *top_node; @@ -2816,7 +2845,7 @@ DECLARE_INFO_COMMAND (info_goto_invocation_node, free (prompt); if (!line) { - info_abort_key (); + info_abort_key (window, 0, 0); return; } if (*line) @@ -2828,7 +2857,7 @@ DECLARE_INFO_COMMAND (info_goto_invocation_node, from the Top node. */ top_node = info_get_node (file_name, NULL); if (!top_node) - info_error (msg_cant_find_node, "Top"); + info_error ((char *) msg_cant_find_node, "Top", NULL); info_intuit_options_node (window, top_node, program_name); free (line); @@ -2840,7 +2869,7 @@ DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it")) { char *line; - line = info_read_in_echo_area (window, _("Get Manpage: ")); + line = info_read_in_echo_area (window, (char *) _("Get Manpage: ")); if (!line) { @@ -2885,8 +2914,7 @@ DECLARE_INFO_COMMAND (info_dir_node, _("Select the node `(dir)'")) /* Read the name of a node to kill. The list of available nodes comes from the nodes appearing in the current window configuration. */ static char * -read_nodename_to_kill (window) - WINDOW *window; +read_nodename_to_kill (WINDOW *window) { int iw; char *nodename; @@ -2894,7 +2922,7 @@ read_nodename_to_kill (window) REFERENCE **menu = NULL; int menu_index = 0, menu_slots = 0; char *default_nodename = xstrdup (active_window->node->nodename); - char *prompt = xmalloc (40 + strlen (default_nodename)); + char *prompt = xmalloc (strlen (_("Kill node (%s): ")) + strlen (default_nodename)); sprintf (prompt, _("Kill node (%s): "), default_nodename); @@ -2926,9 +2954,7 @@ read_nodename_to_kill (window) /* Delete NODENAME from this window, showing the most recently selected node in this window. */ static void -kill_node (window, nodename) - WINDOW *window; - char *nodename; +kill_node (WINDOW *window, char *nodename) { int iw, i; INFO_WINDOW *info_win; @@ -2950,7 +2976,7 @@ kill_node (window, nodename) if (!info_win) { if (*nodename) - info_error (_("Cannot kill node `%s'"), nodename); + info_error ((char *) _("Cannot kill node `%s'"), nodename, NULL); else window_clear_echo_area (); @@ -2960,7 +2986,7 @@ kill_node (window, nodename) /* If there are no more nodes left anywhere to view, complain and exit. */ if (info_windows_index == 1 && info_windows[0]->nodes_index == 1) { - info_error (_("Cannot kill the last node")); + info_error ((char *) _("Cannot kill the last node"), NULL, NULL); return; } @@ -3064,7 +3090,7 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it") { char *line; - line = info_read_in_echo_area (window, _("Find file: ")); + line = info_read_in_echo_area (window, (char *) _("Find file: ")); if (!line) { info_abort_key (active_window, 1, 0); @@ -3079,9 +3105,9 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it") if (!node) { if (info_recent_file_error) - info_error (info_recent_file_error); + info_error (info_recent_file_error, NULL, NULL); else - info_error (_("Cannot find `%s'."), line); + info_error ((char *) _("Cannot find `%s'."), line, NULL); } else info_set_node_of_window (1, window, node); @@ -3100,19 +3126,17 @@ DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it") /* **************************************************************** */ #define VERBOSE_NODE_DUMPING -static void write_node_to_stream (); -static void dump_node_to_stream (); -static void initialize_dumping (); +static void write_node_to_stream (NODE *node, FILE *stream); +static void dump_node_to_stream (char *filename, char *nodename, + FILE *stream, int dump_subnodes); +static void initialize_dumping (void); /* Dump the nodes specified by FILENAME and NODENAMES to the file named in OUTPUT_FILENAME. If DUMP_SUBNODES is non-zero, recursively dump the nodes which appear in the menu of each node dumped. */ void -dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes) - char *filename; - char **nodenames; - char *output_filename; - int dump_subnodes; +dump_nodes_to_file (char *filename, char **nodenames, + char *output_filename, int dump_subnodes) { register int i; FILE *output_stream; @@ -3126,7 +3150,8 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes) if (!output_stream) { - info_error (_("Could not create output file `%s'."), output_filename); + info_error ((char *) _("Could not create output file `%s'."), + output_filename, NULL); return; } @@ -3139,7 +3164,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes) fclose (output_stream); #if defined (VERBOSE_NODE_DUMPING) - info_error (_("Done.")); + info_error ((char *) _("Done."), NULL, NULL); #endif /* VERBOSE_NODE_DUMPING */ } @@ -3149,7 +3174,7 @@ static int dumped_already_index = 0; static int dumped_already_slots = 0; static void -initialize_dumping () +initialize_dumping (void) { dumped_already_index = 0; } @@ -3158,10 +3183,8 @@ initialize_dumping () If DUMP_SUBNODES is non-zero, recursively dump the nodes which appear in the menu of each node dumped. */ static void -dump_node_to_stream (filename, nodename, stream, dump_subnodes) - char *filename, *nodename; - FILE *stream; - int dump_subnodes; +dump_node_to_stream (char *filename, char *nodename, + FILE *stream, int dump_subnodes) { register int i; NODE *node; @@ -3171,14 +3194,15 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes) if (!node) { if (info_recent_file_error) - info_error (info_recent_file_error); + info_error (info_recent_file_error, NULL, NULL); else { if (filename && *nodename != '(') - info_error (msg_cant_file_node, filename_non_directory (filename), - nodename); + info_error ((char *) msg_cant_file_node, + filename_non_directory (filename), + nodename); else - info_error (msg_cant_find_node, nodename); + info_error ((char *) msg_cant_find_node, nodename, NULL); } return; } @@ -3195,7 +3219,7 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes) #if defined (VERBOSE_NODE_DUMPING) /* Maybe we should print some information about the node being output. */ - info_error (_("Writing node %s..."), node_printed_rep (node)); + info_error ((char *) _("Writing node %s..."), node_printed_rep (node), NULL); #endif /* VERBOSE_NODE_DUMPING */ write_node_to_stream (node, stream); @@ -3230,10 +3254,7 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes) /* Dump NODE to FILENAME. If DUMP_SUBNODES is non-zero, recursively dump the nodes which appear in the menu of each node dumped. */ void -dump_node_to_file (node, filename, dump_subnodes) - NODE *node; - char *filename; - int dump_subnodes; +dump_node_to_file (NODE *node, char *filename, int dump_subnodes) { FILE *output_stream; char *nodes_filename; @@ -3247,7 +3268,8 @@ dump_node_to_file (node, filename, dump_subnodes) if (!output_stream) { - info_error (_("Could not create output file `%s'."), filename); + info_error ((char *) _("Could not create output file `%s'."), filename, + NULL); return; } @@ -3264,7 +3286,7 @@ dump_node_to_file (node, filename, dump_subnodes) fclose (output_stream); #if defined (VERBOSE_NODE_DUMPING) - info_error (_("Done.")); + info_error ((char *) _("Done."), NULL, NULL); #endif /* VERBOSE_NODE_DUMPING */ } @@ -3280,8 +3302,7 @@ DECLARE_INFO_COMMAND (info_print_node, /* Print NODE on a printer piping it into INFO_PRINT_COMMAND. */ void -print_node (node) - NODE *node; +print_node (NODE *node) { FILE *printer_pipe; char *print_command = getenv ("INFO_PRINT_COMMAND"); @@ -3309,13 +3330,13 @@ print_node (node) if (!printer_pipe) { - info_error (_("Cannot open pipe to `%s'."), print_command); + info_error ((char *) _("Cannot open pipe to `%s'."), print_command, NULL); return; } #if defined (VERBOSE_NODE_DUMPING) /* Maybe we should print some information about the node being output. */ - info_error (_("Printing node %s..."), node_printed_rep (node)); + info_error ((char *) _("Printing node %s..."), node_printed_rep (node), NULL); #endif /* VERBOSE_NODE_DUMPING */ write_node_to_stream (node, printer_pipe); @@ -3325,14 +3346,12 @@ print_node (node) fclose (printer_pipe); #if defined (VERBOSE_NODE_DUMPING) - info_error (_("Done.")); + info_error ((char *) _("Done."), NULL, NULL); #endif /* VERBOSE_NODE_DUMPING */ } static void -write_node_to_stream (node, stream) - NODE *node; - FILE *stream; +write_node_to_stream (NODE *node, FILE *stream) { fwrite (node->contents, 1, node->nodelen, stream); } @@ -3349,11 +3368,11 @@ write_node_to_stream (node, stream) to gc even those file buffer contents which had to be uncompressed. */ int gc_compressed_files = 0; -static void info_gc_file_buffers (); -static void info_search_1 (); +static void info_gc_file_buffers (void); +static void info_search_1 (WINDOW *window, int count, + unsigned char key, int case_sensitive, int ask_for_string); static char *search_string = (char *)NULL; -static int search_string_index = 0; static int search_string_size = 0; static int isearch_is_active = 0; @@ -3362,8 +3381,7 @@ static int last_search_case_sensitive = 0; /* Return the file buffer which belongs to WINDOW's node. */ FILE_BUFFER * -file_buffer_of_window (window) - WINDOW *window; +file_buffer_of_window (WINDOW *window) { /* If this window has no node, then it has no file buffer. */ if (!window->node) @@ -3385,12 +3403,8 @@ file_buffer_of_window (window) DIR says which direction to search in. If it is positive, search forward, else backwards. */ long -info_search_in_node (string, node, start, window, dir, case_sensitive) - char *string; - NODE *node; - long start; - WINDOW *window; - int dir, case_sensitive; +info_search_in_node (char *string, NODE *node, long int start, + WINDOW *window, int dir, int case_sensitive) { SEARCH_BINDING binding; long offset; @@ -3432,13 +3446,10 @@ info_search_in_node (string, node, start, window, dir, case_sensitive) search at START. Return the absolute position of the match, or -1, if no part of the string could be found. */ long -info_target_search_node (node, string, start) - NODE *node; - char *string; - long start; +info_target_search_node (NODE *node, char *string, long int start) { register int i; - long offset; + long offset = 0; char *target; target = xstrdup (string); @@ -3467,10 +3478,8 @@ info_target_search_node (node, string, start) If the search fails, return non-zero, else zero. Side-effect window leaving the node and point where the string was found current. */ static int -info_search_internal (string, window, dir, case_sensitive) - char *string; - WINDOW *window; - int dir, case_sensitive; +info_search_internal (char *string, WINDOW *window, + int dir, int case_sensitive) { register int i; FILE_BUFFER *file_buffer; @@ -3507,7 +3516,7 @@ info_search_internal (string, window, dir, case_sensitive) file's node list. */ if (file_buffer->tags) { - register int current_tag, number_of_tags; + register int current_tag = 0, number_of_tags; char *last_subfile; TAG *tag; @@ -3557,8 +3566,8 @@ info_search_internal (string, window, dir, case_sensitive) if (!echo_area_is_active && (last_subfile != tag->filename)) { window_message_in_echo_area - (_("Searching subfile %s ..."), - filename_non_directory (tag->filename)); + ((char *) _("Searching subfile %s ..."), + filename_non_directory (tag->filename), NULL); last_subfile = tag->filename; } @@ -3571,9 +3580,9 @@ info_search_internal (string, window, dir, case_sensitive) if (!echo_area_is_active) { if (info_recent_file_error) - info_error (info_recent_file_error); + info_error (info_recent_file_error, NULL, NULL); else - info_error (msg_cant_file_node, + info_error ((char *) msg_cant_file_node, filename_non_directory (file_buffer->filename), tag->nodename); } @@ -3632,12 +3641,8 @@ DECLARE_INFO_COMMAND (info_search_backward, } static void -info_search_1 (window, count, key, case_sensitive, ask_for_string) - WINDOW *window; - int count; - unsigned char key; - int case_sensitive; - int ask_for_string; +info_search_1 (WINDOW *window, int count, unsigned char key, + int case_sensitive, int ask_for_string) { char *line, *prompt; int result, old_pagetop; @@ -3664,7 +3669,12 @@ info_search_1 (window, count, key, case_sensitive, ask_for_string) if (ask_for_string) { - prompt = (char *)xmalloc (50 + strlen (search_string)); + prompt = (char *)xmalloc (strlen (_("%s%sfor string [%s]: ")) + + strlen (_("Search backward")) + + strlen (_("Search")) + + strlen (_(" case-sensitively ")) + + strlen (_(" ")) + + strlen (search_string)); sprintf (prompt, _("%s%sfor string [%s]: "), direction < 0 ? _("Search backward") : _("Search"), @@ -3676,18 +3686,17 @@ info_search_1 (window, count, key, case_sensitive, ask_for_string) if (!line) { - info_abort_key (); + info_abort_key (window, 0, 0); return; } if (*line) { - if (strlen (line) + 1 > search_string_size) + if (strlen (line) + 1 > (unsigned int) search_string_size) search_string = (char *) xrealloc (search_string, (search_string_size += 50 + strlen (line))); strcpy (search_string, line); - search_string_index = strlen (line); free (line); } } @@ -3708,7 +3717,7 @@ info_search_1 (window, count, key, case_sensitive, ask_for_string) active_window, direction, case_sensitive); if (result != 0 && !info_error_was_printed) - info_error (_("Search failed.")); + info_error ((char *) _("Search failed."), NULL, NULL); else if (old_pagetop != active_window->pagetop) { int new_pagetop; @@ -3729,7 +3738,7 @@ DECLARE_INFO_COMMAND (info_search_next, _("Repeat last search in the same direction")) { if (!last_search_direction) - info_error (_("No previous search string")); + info_error ((char *) _("No previous search string"), NULL, NULL); else info_search_1 (window, last_search_direction * count, key, last_search_case_sensitive, 0); @@ -3739,7 +3748,7 @@ DECLARE_INFO_COMMAND (info_search_previous, _("Repeat last search in the reverse direction")) { if (!last_search_direction) - info_error (_("No previous search string")); + info_error ((char *) _("No previous search string"), NULL, NULL); else info_search_1 (window, -last_search_direction * count, key, last_search_case_sensitive, 0); @@ -3751,7 +3760,8 @@ DECLARE_INFO_COMMAND (info_search_previous, /* */ /* **************************************************************** */ -static void incremental_search (); +static void incremental_search (WINDOW *window, int count, + unsigned char ignore); DECLARE_INFO_COMMAND (isearch_forward, _("Search interactively for a string as you type it")) @@ -3775,14 +3785,6 @@ static int isearch_string_index = 0; static int isearch_string_size = 0; static unsigned char isearch_terminate_search_key = ESC; -/* Structure defining the current state of an incremental search. */ -typedef struct { - WINDOW_STATE_DECL; /* The node, pagetop and point. */ - int search_index; /* Offset of the last char in the search string. */ - int direction; /* The direction that this search is heading in. */ - int failing; /* Whether or not this search failed. */ -} SEARCH_STATE; - /* Array of search states. */ static SEARCH_STATE **isearch_states = (SEARCH_STATE **)NULL; static int isearch_states_index = 0; @@ -3790,9 +3792,7 @@ static int isearch_states_slots = 0; /* Push the state of this search. */ static void -push_isearch (window, search_index, direction, failing) - WINDOW *window; - int search_index, direction, failing; +push_isearch (WINDOW *window, int search_index, int direction, int failing) { SEARCH_STATE *state; @@ -3808,9 +3808,7 @@ push_isearch (window, search_index, direction, failing) /* Pop the state of this search to WINDOW, SEARCH_INDEX, and DIRECTION. */ static void -pop_isearch (window, search_index, direction, failing) - WINDOW *window; - int *search_index, *direction, *failing; +pop_isearch (WINDOW *window, int *search_index, int *direction, int *failing) { SEARCH_STATE *state; @@ -3830,7 +3828,7 @@ pop_isearch (window, search_index, direction, failing) /* Free the memory used by isearch_states. */ static void -free_isearch_states () +free_isearch_states (void) { register int i; @@ -3844,14 +3842,12 @@ free_isearch_states () /* Display the current search in the echo area. */ static void -show_isearch_prompt (dir, string, failing_p) - int dir; - unsigned char *string; - int failing_p; +show_isearch_prompt (int dir, unsigned char *string, int failing_p) { register int i; - char *prefix, *prompt, *p_rep; - int prompt_len, p_rep_index, p_rep_size; + const char *prefix; + char *prompt, *p_rep; + unsigned int prompt_len, p_rep_index, p_rep_size; if (dir < 0) prefix = _("I-search backward: "); @@ -3879,22 +3875,21 @@ show_isearch_prompt (dir, string, failing_p) p_rep_index += strlen (rep); } - prompt_len = strlen (prefix) + p_rep_index + 20; - prompt = (char *)xmalloc (prompt_len); + prompt_len = strlen (prefix) + p_rep_index + 1; + if (failing_p) + prompt_len += strlen (_("Failing ")); + prompt = xmalloc (prompt_len); sprintf (prompt, "%s%s%s", failing_p ? _("Failing ") : "", prefix, p_rep ? p_rep : ""); - window_message_in_echo_area ("%s", prompt); + window_message_in_echo_area ("%s", prompt, NULL); maybe_free (p_rep); free (prompt); display_cursor_at_point (active_window); } static void -incremental_search (window, count, ignore) - WINDOW *window; - int count; - unsigned char ignore; +incremental_search (WINDOW *window, int count, unsigned char ignore) { unsigned char key; int last_search_result, search_result, dir; @@ -3917,7 +3912,7 @@ incremental_search (window, count, ignore) /* Show the search string in the echo area. */ isearch_string[isearch_string_index] = '\0'; - show_isearch_prompt (dir, isearch_string, search_result); + show_isearch_prompt (dir, (unsigned char *) isearch_string, search_result); isearch_is_active = 1; @@ -3938,7 +3933,7 @@ incremental_search (window, count, ignore) key = info_get_input_char (); window_get_state (window, &mystate); - if (key == DEL) + if (key == DEL || key == Control ('h')) { /* User wants to delete one level of search? */ if (!isearch_states_index) @@ -3951,7 +3946,8 @@ incremental_search (window, count, ignore) pop_isearch (window, &isearch_string_index, &dir, &search_result); isearch_string[isearch_string_index] = '\0'; - show_isearch_prompt (dir, isearch_string, search_result); + show_isearch_prompt (dir, (unsigned char *) isearch_string, + search_result); goto after_search; } } @@ -3969,9 +3965,15 @@ incremental_search (window, count, ignore) if (!Meta_p (key) || key > 32) { - func = InfoFunction(window->keymap[key].function); - - if (isprint (key) || func == (VFunction *)NULL) + /* If this key is not a keymap, get its associated function, + if any. If it is a keymap, then it's probably ESC from an + arrow key, and we handle that case below. */ + char type = window->keymap[key].type; + func = type == ISFUNC + ? InfoFunction(window->keymap[key].function) + : NULL; /* function member is a Keymap if ISKMAP */ + + if (isprint (key) || (type == ISFUNC && func == NULL)) { insert_and_search: @@ -3983,15 +3985,16 @@ incremental_search (window, count, ignore) isearch_string[isearch_string_index] = '\0'; goto search_now; } - else if (func == isearch_forward || func == isearch_backward) + else if (func == (VFunction *) isearch_forward + || func == (VFunction *) isearch_backward) { /* If this key invokes an incremental search, then this means that we will either search again in the same direction, search again in the reverse direction, or insert the last search string that was accepted through incremental searching. */ - if ((func == isearch_forward && dir > 0) || - (func == isearch_backward && dir < 0)) + if ((func == (VFunction *) isearch_forward && dir > 0) || + (func == (VFunction *) isearch_backward && dir < 0)) { /* If the user has typed no characters, then insert the last successful search into the current search string. */ @@ -4000,8 +4003,8 @@ incremental_search (window, count, ignore) /* Of course, there must be something to insert. */ if (last_isearch_accepted) { - if (strlen (last_isearch_accepted) + 1 >= - isearch_string_size) + if (strlen ((char *) last_isearch_accepted) + 1 + >= (unsigned int) isearch_string_size) isearch_string = (char *) xrealloc (isearch_string, isearch_string_size += 10 + @@ -4027,7 +4030,7 @@ incremental_search (window, count, ignore) dir = -dir; } } - else if (func == info_abort_key) + else if (func == (VFunction *) info_abort_key) { /* If C-g pressed, and the search is failing, pop the search stack back to the last unfailed search. */ @@ -4038,7 +4041,8 @@ incremental_search (window, count, ignore) pop_isearch (window, &isearch_string_index, &dir, &search_result); isearch_string[isearch_string_index] = '\0'; - show_isearch_prompt (dir, isearch_string, search_result); + show_isearch_prompt (dir, (unsigned char *) isearch_string, + search_result); continue; } else @@ -4054,7 +4058,7 @@ incremental_search (window, count, ignore) non-null. Exit the search, remembering the search string. If the key is not the same as the isearch_terminate_search_key, then push it into pending input. */ - if (isearch_string_index && func != info_abort_key) + if (isearch_string_index && func != (VFunction *) info_abort_key) { maybe_free (last_isearch_accepted); last_isearch_accepted = xstrdup (isearch_string); @@ -4073,7 +4077,7 @@ incremental_search (window, count, ignore) || info_any_buffered_input_p ())) info_set_pending_input (key); - if (func == info_abort_key) + if (func == (VFunction *) info_abort_key) { if (isearch_states_index) window_set_state (window, &orig_state); @@ -4091,7 +4095,7 @@ incremental_search (window, count, ignore) /* Search for the contents of isearch_string. */ search_now: - show_isearch_prompt (dir, isearch_string, search_result); + show_isearch_prompt (dir, (unsigned char *) isearch_string, search_result); /* If the search string includes upper-case letters, make the search case-sensitive. */ @@ -4133,7 +4137,7 @@ incremental_search (window, count, ignore) terminal_ring_bell (); after_search: - show_isearch_prompt (dir, isearch_string, search_result); + show_isearch_prompt (dir, (unsigned char *) isearch_string, search_result); if (search_result == 0) { @@ -4167,7 +4171,7 @@ incremental_search (window, count, ignore) Garbage collecting a file buffer means to free the file buffers contents. */ static void -info_gc_file_buffers () +info_gc_file_buffers (void) { register int fb_index, iw_index, i; register FILE_BUFFER *fb; @@ -4226,11 +4230,7 @@ info_gc_file_buffers () /* Move to the next or previous cross reference in this node. */ static void -info_move_to_xref (window, count, key, dir) - WINDOW *window; - int count; - unsigned char key; - int dir; +info_move_to_xref (WINDOW *window, int count, unsigned char key, int dir) { long firstmenu, firstxref; long nextmenu, nextxref; @@ -4272,7 +4272,7 @@ info_move_to_xref (window, count, key, dir) if (firstmenu == -1 && firstxref == -1) { - info_error (msg_no_xref_node); + info_error ((char *) msg_no_xref_node, NULL, NULL); return; } @@ -4361,10 +4361,11 @@ DECLARE_INFO_COMMAND (info_select_reference_this_line, _("Select reference or menu item appearing on this line")) { char *line; - NODE *orig; - line = window->line_starts[window_line_of_point (window)]; - orig = window->node; + if (window->line_starts) + line = window->line_starts[window_line_of_point (window)]; + else + line = ""; /* If this line contains a menu item, select that one. */ if (strncmp ("* ", line, 2) == 0) @@ -4387,7 +4388,7 @@ DECLARE_INFO_COMMAND (info_abort_key, _("Cancel current operation")) do it. */ if (!info_error_rings_bell_p) terminal_ring_bell (); - info_error (_("Quit")); + info_error ((char *) _("Quit"), NULL, NULL); info_initialize_numeric_arg (); info_clear_pending_input (); @@ -4482,19 +4483,18 @@ DECLARE_INFO_COMMAND (info_do_lowercase_version, {} static void -dispatch_error (keyseq) - char *keyseq; +dispatch_error (char *keyseq) { char *rep; rep = pretty_keyseq (keyseq); if (!echo_area_is_active) - info_error (_("Unknown command (%s)."), rep); + info_error ((char *) _("Unknown command (%s)."), rep, NULL); else { - char *temp = xmalloc (1 + strlen (rep) + strlen (_("\"\" is invalid"))); - sprintf (temp, _("\"%s\" is invalid"), rep); + char *temp = xmalloc (1 + strlen (rep) + strlen (_("\"%s\" is invalid"))); + sprintf (temp, _("`%s' is invalid"), rep); terminal_ring_bell (); inform_in_echo_area (temp); free (temp); @@ -4509,7 +4509,7 @@ static int info_keyseq_displayed_p = 0; /* Initialize the length of the current key sequence. */ void -initialize_keyseq () +initialize_keyseq (void) { info_keyseq_index = 0; info_keyseq_displayed_p = 0; @@ -4517,8 +4517,7 @@ initialize_keyseq () /* Add CHARACTER to the current key sequence. */ void -add_char_to_keyseq (character) - char character; +add_char_to_keyseq (char character) { if (info_keyseq_index + 2 >= info_keyseq_size) info_keyseq = (char *)xrealloc (info_keyseq, info_keyseq_size += 10); @@ -4530,9 +4529,8 @@ add_char_to_keyseq (character) /* Display the current value of info_keyseq. If argument EXPECTING is non-zero, input is expected to be read after the key sequence is displayed, so add an additional prompting character to the sequence. */ -void -display_info_keyseq (expecting_future_input) - int expecting_future_input; +static void +display_info_keyseq (int expecting_future_input) { char *rep; @@ -4544,7 +4542,7 @@ display_info_keyseq (expecting_future_input) inform_in_echo_area (rep); else { - window_message_in_echo_area (rep); + window_message_in_echo_area (rep, NULL, NULL); display_cursor_at_point (active_window); } info_keyseq_displayed_p = 1; @@ -4552,7 +4550,7 @@ display_info_keyseq (expecting_future_input) /* Called by interactive commands to read a keystroke. */ unsigned char -info_get_another_input_char () +info_get_another_input_char (void) { int ready = !info_keyseq_displayed_p; /* ready if new and pending key */ @@ -4589,9 +4587,7 @@ info_get_another_input_char () /* Do the command associated with KEY in MAP. If the associated command is really a keymap, then read another key, and dispatch into that map. */ void -info_dispatch_on_key (key, map) - unsigned char key; - Keymap map; +info_dispatch_on_key (unsigned char key, Keymap map) { #if !defined(INFOKEY) if (Meta_p (key) && (!ISO_Latin_p || map[key].function != ea_insert)) @@ -4621,7 +4617,7 @@ info_dispatch_on_key (key, map) if (func != (VFunction *)NULL) { /* Special case info_do_lowercase_version (). */ - if (func == info_do_lowercase_version) + if (func == (VFunction *) info_do_lowercase_version) { #if defined(INFOKEY) unsigned char lowerkey; @@ -4729,7 +4725,7 @@ DECLARE_INFO_COMMAND (info_universal_argument, /* Create a default argument. */ void -info_initialize_numeric_arg () +info_initialize_numeric_arg (void) { info_numeric_arg = info_numeric_arg_sign = 1; info_explicit_arg = 0; @@ -4770,8 +4766,9 @@ DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop, key = UnMeta (key); #endif /* !defined(INFOKEY) */ - if (keymap[key].type == ISFUNC && - InfoFunction(keymap[key].function) == info_universal_argument) + if (keymap[key].type == ISFUNC + && InfoFunction(keymap[key].function) + == (VFunction *) info_universal_argument) { info_numeric_arg *= 4; key = 0; @@ -4821,22 +4818,21 @@ static int pending_input_character = 0; /* How to make there be no pending input. */ static void -info_clear_pending_input () +info_clear_pending_input (void) { pending_input_character = 0; } /* How to set the pending input character. */ static void -info_set_pending_input (key) - unsigned char key; +info_set_pending_input (unsigned char key) { pending_input_character = key; } /* How to see if there is any pending input. */ unsigned char -info_input_pending_p () +info_input_pending_p (void) { return (pending_input_character); } @@ -4849,8 +4845,7 @@ static unsigned char info_input_buffer[MAX_INFO_INPUT_BUFFERING]; /* Add KEY to the buffer of characters to be read. */ static void -info_push_typeahead (key) - unsigned char key; +info_push_typeahead (unsigned char key) { /* Flush all pending input in the case of C-g pressed. */ if (key == Control ('g')) @@ -4861,14 +4856,14 @@ info_push_typeahead (key) else { info_input_buffer[push_index++] = key; - if (push_index >= sizeof (info_input_buffer)) + if ((unsigned int) push_index >= sizeof (info_input_buffer)) push_index = 0; } } /* Return the amount of space available in INFO_INPUT_BUFFER for new chars. */ static int -info_input_buffer_space_available () +info_input_buffer_space_available (void) { if (pop_index > push_index) return (pop_index - push_index); @@ -4880,22 +4875,21 @@ info_input_buffer_space_available () Return the key in KEY. Result is non-zero if there was a key, or 0 if there wasn't. */ static int -info_get_key_from_typeahead (key) - unsigned char *key; +info_get_key_from_typeahead (unsigned char *key) { if (push_index == pop_index) return (0); *key = info_input_buffer[pop_index++]; - if (pop_index >= sizeof (info_input_buffer)) + if ((unsigned int) pop_index >= sizeof (info_input_buffer)) pop_index = 0; return (1); } int -info_any_buffered_input_p () +info_any_buffered_input_p (void) { info_gather_typeahead (); return (push_index != pop_index); @@ -4904,7 +4898,7 @@ info_any_buffered_input_p () /* If characters are available to be read, then read them and stuff them into info_input_buffer. Otherwise, do nothing. */ void -info_gather_typeahead () +info_gather_typeahead (void) { register int i = 0; int tty, space_avail; @@ -4978,7 +4972,7 @@ info_gather_typeahead () /* How to read a single character. */ unsigned char -info_get_input_char () +info_get_input_char (void) { unsigned char keystroke; diff --git a/gnu/usr.bin/texinfo/info/signals.h b/gnu/usr.bin/texinfo/info/signals.h index ff82a0b3bee..2874e7717bf 100644 --- a/gnu/usr.bin/texinfo/info/signals.h +++ b/gnu/usr.bin/texinfo/info/signals.h @@ -1,10 +1,7 @@ -/* signals.h -- Header to include system dependent signal definitions. - $Id: signals.h,v 1.2 1999/01/11 16:38:09 espie Exp $ +/* signals.h -- header to include system dependent signal definitions. + $Id: signals.h,v 1.3 2006/07/17 16:12:36 espie Exp $ - This file is part of GNU Info, a program for reading online documentation - stored in Info format. - - Copyright (C) 1993, 94, 95, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1997, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #ifndef INFO_SIGNALS_H #define INFO_SIGNALS_H @@ -37,7 +34,10 @@ # define sigmask(x) (1 << ((x)-1)) #endif /* !HAVE_SIGPROCMASK && !sigmask */ -#if !defined (HAVE_SIGPROCMASK) +/* Without SA_NOCLDSTOP, sigset_t might end up being undefined even + though we have sigprocmask, on older systems, according to Nelson + Beebe. The test is from coreutils/sort.c, via Paul Eggert. */ +#if !defined (HAVE_SIGPROCMASK) || !defined (SA_NOCLDSTOP) # if !defined (SIG_BLOCK) # define SIG_UNBLOCK 1 # define SIG_BLOCK 2 diff --git a/gnu/usr.bin/texinfo/info/termdep.h b/gnu/usr.bin/texinfo/info/termdep.h index 554452674b9..62b3b822a4d 100644 --- a/gnu/usr.bin/texinfo/info/termdep.h +++ b/gnu/usr.bin/texinfo/info/termdep.h @@ -1,7 +1,8 @@ -/* termdep.h -- System things that terminal.c depends on. - $Id: termdep.h,v 1.4 2002/06/10 13:51:03 espie Exp $ +/* termdep.h -- system things that terminal.c depends on. + $Id: termdep.h,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 96, 97, 98, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1997, 1998, 2001, 2002 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gnu/usr.bin/texinfo/info/terminal.c b/gnu/usr.bin/texinfo/info/terminal.c index 075de35b77c..733d7b9a661 100644 --- a/gnu/usr.bin/texinfo/info/terminal.c +++ b/gnu/usr.bin/texinfo/info/terminal.c @@ -1,8 +1,8 @@ -/* terminal.c -- How to handle the physical terminal for Info. - $Id: terminal.c,v 1.6 2002/06/10 13:51:03 espie Exp $ +/* terminal.c -- how to handle the physical terminal for Info. + $Id: terminal.c,v 1.7 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97, 98, 99, 2001 - Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1996, 1997, 1998, + 1999, 2001, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by Brian Fox (bfox@ai.mit.edu). */ + Originally written by Brian Fox (bfox@ai.mit.edu). */ #include "info.h" #include "terminal.h" @@ -103,9 +103,6 @@ static char *visible_bell; /* The string to write to turn on the meta key, if this term has one. */ static char *term_mm; -/* The string to write to turn off the meta key, if this term has one. */ -static char *term_mo; - /* The string to turn on inverse mode, if this term has one. */ static char *term_invbeg; @@ -116,8 +113,7 @@ static char *term_invend; return its argument, all the code I've looked at (termutils, less) does so, so fine. */ static int -output_character_function (c) - int c; +output_character_function (int c) { putc (c, stdout); return c; @@ -132,9 +128,9 @@ output_character_function (c) /* Tell the terminal that we will be doing cursor addressable motion. */ static void -terminal_begin_using_terminal () +terminal_begin_using_terminal (void) { - RETSIGTYPE (*sigsave) (); + RETSIGTYPE (*sigsave) (int signum); if (term_keypad_on) send_to_terminal (term_keypad_on); @@ -163,9 +159,9 @@ terminal_begin_using_terminal () /* Tell the terminal that we will not be doing any more cursor addressable motion. */ static void -terminal_end_using_terminal () +terminal_end_using_terminal (void) { - RETSIGTYPE (*sigsave) (); + RETSIGTYPE (*sigsave) (int signum); if (term_keypad_off) send_to_terminal (term_keypad_off); @@ -230,8 +226,7 @@ char *term_kx = NULL; /* del */ /* Move the cursor to the terminal location of X and Y. */ void -terminal_goto_xy (x, y) - int x, y; +terminal_goto_xy (int x, int y) { if (terminal_goto_xy_hook) (*terminal_goto_xy_hook) (x, y); @@ -244,8 +239,7 @@ terminal_goto_xy (x, y) /* Print STRING to the terminal at the current position. */ void -terminal_put_text (string) - char *string; +terminal_put_text (char *string) { if (terminal_put_text_hook) (*terminal_put_text_hook) (string); @@ -257,9 +251,7 @@ terminal_put_text (string) /* Print NCHARS from STRING to the terminal at the current position. */ void -terminal_write_chars (string, nchars) - char *string; - int nchars; +terminal_write_chars (char *string, int nchars) { if (terminal_write_chars_hook) (*terminal_write_chars_hook) (string, nchars); @@ -272,7 +264,7 @@ terminal_write_chars (string, nchars) /* Clear from the current position of the cursor to the end of the line. */ void -terminal_clear_to_eol () +terminal_clear_to_eol (void) { if (terminal_clear_to_eol_hook) (*terminal_clear_to_eol_hook) (); @@ -284,7 +276,7 @@ terminal_clear_to_eol () /* Clear the entire terminal screen. */ void -terminal_clear_screen () +terminal_clear_screen (void) { if (terminal_clear_screen_hook) (*terminal_clear_screen_hook) (); @@ -296,7 +288,7 @@ terminal_clear_screen () /* Move the cursor up one line. */ void -terminal_up_line () +terminal_up_line (void) { if (terminal_up_line_hook) (*terminal_up_line_hook) (); @@ -308,7 +300,7 @@ terminal_up_line () /* Move the cursor down one line. */ void -terminal_down_line () +terminal_down_line (void) { if (terminal_down_line_hook) (*terminal_down_line_hook) (); @@ -320,7 +312,7 @@ terminal_down_line () /* Turn on reverse video if possible. */ void -terminal_begin_inverse () +terminal_begin_inverse (void) { if (terminal_begin_inverse_hook) (*terminal_begin_inverse_hook) (); @@ -332,7 +324,7 @@ terminal_begin_inverse () /* Turn off reverse video if possible. */ void -terminal_end_inverse () +terminal_end_inverse (void) { if (terminal_end_inverse_hook) (*terminal_end_inverse_hook) (); @@ -345,7 +337,7 @@ terminal_end_inverse () /* Ring the terminal bell. The bell is run visibly if it both has one and terminal_use_visible_bell_p is non-zero. */ void -terminal_ring_bell () +terminal_ring_bell (void) { if (terminal_ring_bell_hook) (*terminal_ring_bell_hook) (); @@ -360,8 +352,7 @@ terminal_ring_bell () /* At the line START, delete COUNT lines from the terminal display. */ static void -terminal_delete_lines (start, count) - int start, count; +terminal_delete_lines (int start, int count) { int lines; @@ -384,8 +375,7 @@ terminal_delete_lines (start, count) /* At the line START, insert COUNT lines in the terminal display. */ static void -terminal_insert_lines (start, count) - int start, count; +terminal_insert_lines (int start, int count) { int lines; @@ -412,8 +402,7 @@ terminal_insert_lines (start, count) towards the top of the screen, else they are scrolled towards the bottom of the screen. */ void -terminal_scroll_terminal (start, end, amount) - int start, end, amount; +terminal_scroll_terminal (int start, int end, int amount) { if (!terminal_can_scroll) return; @@ -449,8 +438,7 @@ terminal_scroll_terminal (start, end, amount) /* Re-initialize the terminal considering that the TERM/TERMCAP variable has changed. */ void -terminal_new_terminal (terminal_name) - char *terminal_name; +terminal_new_terminal (char *terminal_name) { if (terminal_new_terminal_hook) (*terminal_new_terminal_hook) (terminal_name); @@ -462,7 +450,7 @@ terminal_new_terminal (terminal_name) /* Set the global variables SCREENWIDTH and SCREENHEIGHT. */ void -terminal_get_screen_size () +terminal_get_screen_size (void) { if (terminal_get_screen_size_hook) (*terminal_get_screen_size_hook) (); @@ -522,8 +510,7 @@ terminal_get_screen_size () TERMINAL_HAS_META_P becomes nonzero if this terminal supports a Meta key. Finally, the terminal screen is cleared. */ void -terminal_initialize_terminal (terminal_name) - char *terminal_name; +terminal_initialize_terminal (char *terminal_name) { char *buffer; @@ -632,12 +619,10 @@ terminal_initialize_terminal (terminal_name) if (terminal_has_meta_p) { term_mm = tgetstr ("mm", &buffer); - term_mo = tgetstr ("mo", &buffer); } else { term_mm = NULL; - term_mo = NULL; } /* Attempt to find the arrow keys. */ @@ -704,7 +689,7 @@ struct ltchars original_ltchars; /* Prepare to start using the terminal to read characters singly. */ void -terminal_prep_terminal () +terminal_prep_terminal (void) { int tty; @@ -844,7 +829,7 @@ terminal_prep_terminal () /* Restore the tty settings back to what they were before we started using this terminal. */ void -terminal_unprep_terminal () +terminal_unprep_terminal (void) { int tty; diff --git a/gnu/usr.bin/texinfo/info/tilde.c b/gnu/usr.bin/texinfo/info/tilde.c index 59d4fe6b6b7..121eec7c959 100644 --- a/gnu/usr.bin/texinfo/info/tilde.c +++ b/gnu/usr.bin/texinfo/info/tilde.c @@ -1,8 +1,8 @@ /* tilde.c -- tilde expansion code (~/foo := $HOME/foo). - $Id: tilde.c,v 1.3 2000/02/09 02:18:40 espie Exp $ + $Id: tilde.c,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98, 99 - Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1996, 1998, 1999, + 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ /* Include config.h before doing alloca. */ #include "info.h" +#include "tilde.h" #if defined (TEST) || defined (STATIC_MALLOC) static void *xmalloc (), *xrealloc (); @@ -59,9 +60,7 @@ char **tilde_additional_suffixes = default_suffixes; the tilde which starts the expansion. Place the length of the text which identified this tilde starter in LEN, excluding the tilde itself. */ static int -tilde_find_prefix (string, len) - char *string; - int *len; +tilde_find_prefix (char *string, int *len) { register int i, j, string_len; register char **prefixes = tilde_additional_prefixes; @@ -92,8 +91,7 @@ tilde_find_prefix (string, len) /* Find the end of a tilde expansion in STRING, and return the index of the character which ends the tilde definition. */ static int -tilde_find_suffix (string) - char *string; +tilde_find_suffix (char *string) { register int i, j, string_len; register char **suffixes = tilde_additional_suffixes; @@ -116,10 +114,9 @@ tilde_find_suffix (string) /* Return a new string which is the result of tilde expanding STRING. */ char * -tilde_expand (string) - char *string; +tilde_expand (char *string) { - char *result, *tilde_expand_word (); + char *result; int result_size, result_index; result_size = result_index = 0; @@ -179,8 +176,7 @@ tilde_expand (string) /* Do the work of tilde expansion on FILENAME. FILENAME starts with a tilde. If there is no expansion, call tilde_expansion_failure_hook. */ char * -tilde_expand_word (filename) - char *filename; +tilde_expand_word (char *filename) { char *dirname = filename ? xstrdup (filename) : NULL; @@ -236,9 +232,7 @@ tilde_expand_word (filename) expansion, then let them try. */ if (tilde_expansion_failure_hook) { - char *expansion; - - expansion = (*tilde_expansion_failure_hook) (username); + char *expansion = (*tilde_expansion_failure_hook) (username); if (expansion) { diff --git a/gnu/usr.bin/texinfo/info/variables.c b/gnu/usr.bin/texinfo/info/variables.c index 9f30900429f..9c0cdb481c1 100644 --- a/gnu/usr.bin/texinfo/info/variables.c +++ b/gnu/usr.bin/texinfo/info/variables.c @@ -1,7 +1,7 @@ -/* variables.c -- How to manipulate user visible variables in Info. - $Id: variables.c,v 1.4 2002/06/10 13:51:03 espie Exp $ +/* variables.c -- how to manipulate user visible variables in Info. + $Id: variables.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2001, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ DECLARE_INFO_COMMAND (describe_variable, _("Explain the use of a variable")) char *description; /* Get the variable's name. */ - var = read_variable_name (_("Describe variable: "), window); + var = read_variable_name ((char *) _("Describe variable: "), window); if (!var) return; @@ -92,7 +92,7 @@ DECLARE_INFO_COMMAND (describe_variable, _("Explain the use of a variable")) sprintf (description, "%s (%d): %s.", var->name, *(var->value), _(var->doc)); - window_message_in_echo_area ("%s", description); + window_message_in_echo_area ("%s", description, NULL); free (description); } @@ -102,7 +102,7 @@ DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable")) char *line; /* Get the variable's name and value. */ - var = read_variable_name (_("Set variable: "), window); + var = read_variable_name ((char *) _("Set variable: "), window); if (!var) return; @@ -201,9 +201,7 @@ DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable")) address of a VARIABLE_ALIST member. A return value of NULL indicates that no variable could be read. */ VARIABLE_ALIST * -read_variable_name (prompt, window) - char *prompt; - WINDOW *window; +read_variable_name (char *prompt, WINDOW *window) { register int i; char *line; @@ -249,7 +247,7 @@ read_variable_name (prompt, window) /* Make an array of REFERENCE which actually contains the names of the variables available in Info. */ REFERENCE ** -make_variable_completions_array () +make_variable_completions_array (void) { register int i; REFERENCE **array = (REFERENCE **)NULL; @@ -274,9 +272,7 @@ make_variable_completions_array () #if defined(INFOKEY) void -set_variable_to_value(name, value) - char *name; - char *value; +set_variable_to_value(char *name, char *value) { register int i; diff --git a/gnu/usr.bin/texinfo/info/variables.h b/gnu/usr.bin/texinfo/info/variables.h index ba6f1f33176..61d0b7b4889 100644 --- a/gnu/usr.bin/texinfo/info/variables.h +++ b/gnu/usr.bin/texinfo/info/variables.h @@ -1,10 +1,10 @@ /* variables.h -- Description of user visible variables in Info. - $Id: variables.h,v 1.2 1999/01/11 16:38:10 espie Exp $ + $Id: variables.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,14 +42,15 @@ typedef struct { /* Read the name of an Info variable in the echo area and return the address of a VARIABLE_ALIST member. A return value of NULL indicates that no variable could be read. */ -extern VARIABLE_ALIST *read_variable_name (); +extern VARIABLE_ALIST *read_variable_name (char *prompt, WINDOW *window); /* Make an array of REFERENCE which actually contains the names of the variables available in Info. */ -extern REFERENCE **make_variable_completions_array (); +extern REFERENCE **make_variable_completions_array (void); /* Set the value of an info variable. */ -extern void set_variable (); +extern void set_variable (WINDOW *window, int count, unsigned char key); +extern void describe_variable (WINDOW *window, int count, unsigned char key); /* The list of user-visible variables. */ extern int auto_footnotes_p; diff --git a/gnu/usr.bin/texinfo/info/window.c b/gnu/usr.bin/texinfo/info/window.c index 23a9c7addc5..967105dbec4 100644 --- a/gnu/usr.bin/texinfo/info/window.c +++ b/gnu/usr.bin/texinfo/info/window.c @@ -1,7 +1,8 @@ /* window.c -- windows in Info. - $Id: window.c,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: window.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1993, 97, 98, 2001, 02 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 1998, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,8 +51,7 @@ WINDOW *active_window = NULL; Create the first window ever. You pass the dimensions of the total screen size. */ void -window_initialize_windows (width, height) - int width, height; +window_initialize_windows (int width, int height) { the_screen = xmalloc (sizeof (WINDOW)); the_echo_area = xmalloc (sizeof (WINDOW)); @@ -82,7 +82,7 @@ window_initialize_windows (width, height) area. */ the_echo_area->height = ECHO_AREA_HEIGHT; active_window->height = the_screen->height - 1 - the_echo_area->height; - window_new_screen_size (width, height, NULL); + window_new_screen_size (width, height); /* The echo area uses a different keymap than normal info windows. */ the_echo_area->keymap = echo_area_keymap; @@ -102,8 +102,7 @@ window_initialize_windows (width, height) VFunction *window_deletion_notifier = NULL; void -window_new_screen_size (width, height) - int width, height; +window_new_screen_size (int width, int height) { register WINDOW *win; int delta_height, delta_each, delta_leftover; @@ -231,7 +230,7 @@ window_new_screen_size (width, height) if ((win->height < WINDOW_MIN_HEIGHT) || (win->height > avail)) { - WINDOW *lastwin; + WINDOW *lastwin = NULL; /* Split the space among the available windows. */ delta_each = avail / numwins; @@ -261,8 +260,7 @@ window_new_screen_size (width, height) window. If the window could not be made return a NULL pointer. The active window is not changed.*/ WINDOW * -window_make_window (node) - NODE *node; +window_make_window (NODE *node) { WINDOW *window; @@ -376,9 +374,7 @@ window_make_window (node) the previous and next windows in the chain. If there is only one user window, then no change takes place. */ void -window_change_window_height (window, amount) - WINDOW *window; - int amount; +window_change_window_height (WINDOW *window, int amount) { register WINDOW *win, *prev, *next; @@ -509,8 +505,7 @@ window_change_window_height (window, amount) internal nodes as well, otherwise do not change the height of such windows. */ void -window_tile_windows (style) - int style; +window_tile_windows (int style) { WINDOW *win, *last_adjusted; int numwins, avail, per_win_height, leftover; @@ -563,8 +558,7 @@ window_tile_windows (style) /* Toggle the state of line wrapping in WINDOW. This can do a bit of fancy redisplay. */ void -window_toggle_wrap (window) - WINDOW *window; +window_toggle_wrap (WINDOW *window) { if (window->flags & W_NoWrap) window->flags &= ~W_NoWrap; @@ -598,9 +592,7 @@ window_toggle_wrap (window) /* Set WINDOW to display NODE. */ void -window_set_node_of_window (window, node) - WINDOW *window; - NODE *node; +window_set_node_of_window (WINDOW *window, NODE *node) { window->node = node; window->pagetop = 0; @@ -618,8 +610,7 @@ window_set_node_of_window (window, node) If the active window is the next or previous window, choose that window as the recipient of the extra space. Otherwise, prefer the next window. */ void -window_delete_window (window) - WINDOW *window; +window_delete_window (WINDOW *window) { WINDOW *next, *prev, *window_to_fix; @@ -690,9 +681,7 @@ window_delete_window (window) /* For every window in CHAIN, set the flags member to have FLAG set. */ void -window_mark_chain (chain, flag) - WINDOW *chain; - int flag; +window_mark_chain (WINDOW *chain, int flag) { register WINDOW *win; @@ -702,9 +691,7 @@ window_mark_chain (chain, flag) /* For every window in CHAIN, clear the flags member of FLAG. */ void -window_unmark_chain (chain, flag) - WINDOW *chain; - int flag; +window_unmark_chain (WINDOW *chain, int flag) { register WINDOW *win; @@ -715,8 +702,7 @@ window_unmark_chain (chain, flag) /* Return the number of characters it takes to display CHARACTER on the screen at HPOS. */ int -character_width (character, hpos) - int character, hpos; +character_width (int character, int hpos) { int printable_limit = 127; int width = 1; @@ -750,9 +736,7 @@ character_width (character, hpos) /* Return the number of characters it takes to display STRING on the screen at HPOS. */ int -string_width (string, hpos) - char *string; - int hpos; +string_width (char *string, int hpos) { register int i, width, this_char_width; @@ -781,8 +765,7 @@ string_width (string, hpos) /* Quickly guess the approximate number of lines that NODE would take to display. This really only counts carriage returns. */ int -window_physical_lines (node) - NODE *node; +window_physical_lines (NODE *node) { register int i, lines; char *contents; @@ -801,8 +784,7 @@ window_physical_lines (node) /* Calculate a list of line starts for the node belonging to WINDOW. The line starts are pointers to the actual text within WINDOW->NODE. */ void -calculate_line_starts (window) - WINDOW *window; +calculate_line_starts (WINDOW *window) { register int i, hpos; char **line_starts = NULL; @@ -868,7 +850,7 @@ calculate_line_starts (window) cwidth = character_width (c, hpos); /* If this character fits within this line, just do the next one. */ - if ((hpos + cwidth) < window->width) + if ((hpos + cwidth) < (unsigned int) window->width) { i++; hpos += cwidth; @@ -917,8 +899,7 @@ calculate_line_starts (window) /* Given WINDOW, recalculate the line starts for the node it displays. */ void -recalculate_line_starts (window) - WINDOW *window; +recalculate_line_starts (WINDOW *window) { maybe_free (window->line_starts); calculate_line_starts (window); @@ -932,8 +913,7 @@ int window_scroll_step = 0; /* Adjust the pagetop of WINDOW such that the cursor point will be visible. */ void -window_adjust_pagetop (window) - WINDOW *window; +window_adjust_pagetop (WINDOW *window) { register int line = 0; char *contents; @@ -990,8 +970,7 @@ window_adjust_pagetop (window) /* Return the index of the line containing point. */ int -window_line_of_point (window) - WINDOW *window; +window_line_of_point (WINDOW *window) { register int i, start = 0; @@ -1013,8 +992,7 @@ window_line_of_point (window) /* Get and return the goal column for this window. */ int -window_get_goal_column (window) - WINDOW *window; +window_get_goal_column (WINDOW *window) { if (!window->node) return (-1); @@ -1029,8 +1007,7 @@ window_get_goal_column (window) /* Get and return the printed column offset of the cursor in this window. */ int -window_get_cursor_column (window) - WINDOW *window; +window_get_cursor_column (WINDOW *window) { int i, hpos, end; char *line; @@ -1068,11 +1045,9 @@ window_get_cursor_column (window) /* Count the number of characters in LINE that precede the printed column offset of GOAL. */ int -window_chars_to_goal (line, goal) - char *line; - int goal; +window_chars_to_goal (char *line, int goal) { - register int i, check, hpos; + register int i, check = 0, hpos; for (hpos = 0, i = 0; line[i] != '\n'; i++) { @@ -1098,8 +1073,7 @@ window_chars_to_goal (line, goal) /* Create a modeline for WINDOW, and store it in window->modeline. */ void -window_make_modeline (window) - WINDOW *window; +window_make_modeline (WINDOW *window) { register int i; char *modeline; @@ -1143,7 +1117,7 @@ window_make_modeline (window) int modeline_len = 0; char *parent = NULL, *filename = "*no file*"; char *nodename = "*no node*"; - char *update_message = NULL; + const char *update_message = NULL; NODE *node = window->node; if (node) @@ -1213,9 +1187,7 @@ window_make_modeline (window) /* Make WINDOW start displaying at PERCENT percentage of its node. */ void -window_goto_percentage (window, percent) - WINDOW *window; - int percent; +window_goto_percentage (WINDOW *window, int percent) { int desired_line; @@ -1234,9 +1206,7 @@ window_goto_percentage (window, percent) /* Get the state of WINDOW, and save it in STATE. */ void -window_get_state (window, state) - WINDOW *window; - WINDOW_STATE *state; +window_get_state (WINDOW *window, SEARCH_STATE *state) { state->node = window->node; state->pagetop = window->pagetop; @@ -1245,9 +1215,7 @@ window_get_state (window, state) /* Set the node, pagetop, and point of WINDOW. */ void -window_set_state (window, state) - WINDOW *window; - WINDOW_STATE *state; +window_set_state (WINDOW *window, SEARCH_STATE *state) { if (window->node != state->node) window_set_node_of_window (window, state->node); @@ -1263,7 +1231,7 @@ static NODE *echo_area_node = NULL; /* Make the node of the_echo_area be an empty one. */ static void -free_echo_area () +free_echo_area (void) { if (echo_area_node) { @@ -1278,7 +1246,7 @@ free_echo_area () /* Clear the echo area, removing any message that is already present. The echo area is cleared immediately. */ void -window_clear_echo_area () +window_clear_echo_area (void) { free_echo_area (); display_update_one_window (the_echo_area); @@ -1289,9 +1257,7 @@ window_clear_echo_area () printf () hair is present. The message appears immediately. If there was already a message appearing in the echo area, it is removed. */ void -window_message_in_echo_area (format, arg1, arg2) - char *format; - void *arg1, *arg2; +window_message_in_echo_area (char *format, void *arg1, void *arg2) { free_echo_area (); echo_area_node = build_message_node (format, arg1, arg2); @@ -1308,9 +1274,7 @@ static int old_echo_area_nodes_index = 0; static int old_echo_area_nodes_slots = 0; void -message_in_echo_area (format, arg1, arg2) - char *format; - void *arg1, *arg2; +message_in_echo_area (char *format, void *arg1, void *arg2) { if (echo_area_node) { @@ -1323,7 +1287,7 @@ message_in_echo_area (format, arg1, arg2) } void -unmessage_in_echo_area () +unmessage_in_echo_area (void) { free_echo_area (); @@ -1342,8 +1306,7 @@ static int message_buffer_size = 0; /* Ensure that there is enough space to stuff LENGTH characters into MESSAGE_BUFFER. */ static void -message_buffer_resize (length) - int length; +message_buffer_resize (int length) { if (!message_buffer) { @@ -1361,9 +1324,7 @@ message_buffer_resize (length) /* Format MESSAGE_BUFFER with the results of printing FORMAT with ARG1 and ARG2. */ static void -build_message_buffer (format, arg1, arg2, arg3) - char *format; - void *arg1, *arg2, *arg3; +build_message_buffer (char *format, void *arg1, void *arg2, void *arg3) { register int i, len; void *args[3]; @@ -1510,9 +1471,7 @@ build_message_buffer (format, arg1, arg2, arg3) /* Build a new node which has FORMAT printed with ARG1 and ARG2 as the contents. */ NODE * -build_message_node (format, arg1, arg2) - char *format; - void *arg1, *arg2; +build_message_node (char *format, void *arg1, void *arg2) { NODE *node; @@ -1525,7 +1484,7 @@ build_message_node (format, arg1, arg2) /* Convert the contents of the message buffer to a node. */ NODE * -message_buffer_to_node () +message_buffer_to_node (void) { NODE *node; @@ -1547,16 +1506,14 @@ message_buffer_to_node () /* Useful functions can be called from outside of window.c. */ void -initialize_message_buffer () +initialize_message_buffer (void) { message_buffer_index = 0; } /* Print FORMAT with ARG1,2 to the end of the current message buffer. */ void -printf_to_message_buffer (format, arg1, arg2, arg3) - char *format; - void *arg1, *arg2, *arg3; +printf_to_message_buffer (char *format, void *arg1, void *arg2, void *arg3) { build_message_buffer (format, arg1, arg2, arg3); } @@ -1564,7 +1521,7 @@ printf_to_message_buffer (format, arg1, arg2, arg3) /* Return the current horizontal position of the "cursor" on the most recently output message buffer line. */ int -message_buffer_length_this_line () +message_buffer_length_this_line (void) { register int i; @@ -1578,9 +1535,7 @@ message_buffer_length_this_line () /* Pad STRING to COUNT characters by inserting blanks. */ int -pad_to (count, string) - int count; - char *string; +pad_to (int count, char *string) { register int i; diff --git a/gnu/usr.bin/texinfo/info/window.h b/gnu/usr.bin/texinfo/info/window.h index 7c61f55464b..ceefd2ae018 100644 --- a/gnu/usr.bin/texinfo/info/window.h +++ b/gnu/usr.bin/texinfo/info/window.h @@ -1,10 +1,10 @@ /* window.h -- Structure and flags used in manipulating Info windows. - $Id: window.h,v 1.2 1999/01/11 16:38:10 espie Exp $ + $Id: window.h,v 1.3 2006/07/17 16:12:36 espie Exp $ This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 1997, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,8 +25,8 @@ #ifndef INFO_WINDOW_H #define INFO_WINDOW_H -#include "nodes.h" #include "infomap.h" +#include "nodes.h" /* Smallest number of visible lines in a window. The actual height is always one more than this number because each window has a modeline. */ @@ -75,6 +75,14 @@ typedef struct { WINDOW_STATE_DECL; /* What gets saved. */ } WINDOW_STATE; +/* Structure defining the current state of an incremental search. */ +typedef struct { + WINDOW_STATE_DECL; /* The node, pagetop and point. */ + int search_index; /* Offset of the last char in the search string. */ + int direction; /* The direction that this search is heading in. */ + int failing; /* Whether or not this search failed. */ +} SEARCH_STATE; + #define W_UpdateWindow 0x01 /* WINDOW needs updating. */ #define W_WindowIsPerm 0x02 /* This WINDOW is a permanent object. */ #define W_WindowVisible 0x04 /* This WINDOW is currently visible. */ @@ -95,24 +103,24 @@ extern WINDOW *the_echo_area; /* THE_ECHO_AREA is a window in THE_SCREEN. */ extern int window_scroll_step; /* Make the modeline member for WINDOW. */ -extern void window_make_modeline (); +extern void window_make_modeline (WINDOW *window); /* Initalize the window system by creating THE_SCREEN and THE_ECHO_AREA. Create the first window ever, and make it permanent. You pass WIDTH and HEIGHT; the dimensions of the total screen size. */ -extern void window_initialize_windows (); +extern void window_initialize_windows (int width, int height); /* Make a new window showing NODE, and return that window structure. The new window is made to be the active window. If NODE is passed as NULL, then show the node showing in the active window. If the window could not be made return a NULL pointer. The active window is not changed.*/ -extern WINDOW *window_make_window (); +extern WINDOW *window_make_window (NODE *node); /* Delete WINDOW from the list of known windows. If this window was the active window, make the next window in the chain be the active window, or the previous window in the chain if there is no next window. */ -extern void window_delete_window (); +extern void window_delete_window (WINDOW *window); /* A function to call when the screen changes size, and some windows have to get deleted. The function is called with the window to be deleted @@ -121,111 +129,113 @@ extern void window_delete_window (); extern VFunction *window_deletion_notifier; /* Set WINDOW to display NODE. */ -extern void window_set_node_of_window (); +extern void window_set_node_of_window (WINDOW *window, NODE *node); /* Tell the window system that the size of the screen has changed. This causes lots of interesting things to happen. The permanent windows are resized, as well as every visible window. You pass WIDTH and HEIGHT; the dimensions of the total screen size. */ -extern void window_new_screen_size (); +extern void window_new_screen_size (int width, int height); /* Change the height of WINDOW by AMOUNT. This also automagically adjusts the previous and next windows in the chain. If there is only one user window, then no change takes place. */ -extern void window_change_window_height (); +extern void window_change_window_height (WINDOW *window, int amount); /* Adjust the pagetop of WINDOW such that the cursor point will be visible. */ -extern void window_adjust_pagetop (); +extern void window_adjust_pagetop (WINDOW *window); /* Tile all of the windows currently displayed in the global variable WINDOWS. If argument DO_INTERNALS is non-zero, tile windows displaying internal nodes as well. */ #define DONT_TILE_INTERNALS 0 #define TILE_INTERNALS 1 -extern void window_tile_windows (); +extern void window_tile_windows (int style); /* Toggle the state of line wrapping in WINDOW. This can do a bit of fancy redisplay. */ -extern void window_toggle_wrap (); +extern void window_toggle_wrap (WINDOW *window); /* For every window in CHAIN, set the flags member to have FLAG set. */ -extern void window_mark_chain (); +extern void window_mark_chain (WINDOW *chain, int flag); /* For every window in CHAIN, clear the flags member of FLAG. */ -extern void window_unmark_chain (); +extern void window_unmark_chain (WINDOW *chain, int flag); /* Make WINDOW start displaying at PERCENT percentage of its node. */ -extern void window_goto_percentage (); +extern void window_goto_percentage (WINDOW *window, int percent); /* Build a new node which has FORMAT printed with ARG1 and ARG2 as the contents. */ -extern NODE *build_message_node (); +extern NODE *build_message_node (char *format, void *arg1, void *arg2); /* Useful functions can be called from outside of window.c. */ -extern void initialize_message_buffer (); +extern void initialize_message_buffer (void); /* Print FORMAT with ARG1,2 to the end of the current message buffer. */ -extern void printf_to_message_buffer (); +extern void printf_to_message_buffer (char *format, void *arg1, void *arg2, + void *arg3); /* Convert the contents of the message buffer to a node. */ -extern NODE *message_buffer_to_node (); +extern NODE *message_buffer_to_node (void); /* Return the length of the most recently printed line in message buffer. */ -extern int message_buffer_length_this_line (); +extern int message_buffer_length_this_line (void); /* Pad STRING to COUNT characters by inserting blanks. */ -extern int pad_to (); +extern int pad_to (int count, char *string); /* Make a message appear in the echo area, built from FORMAT, ARG1 and ARG2. The arguments are treated similar to printf () arguments, but not all of printf () hair is present. The message appears immediately. If there was already a message appearing in the echo area, it is removed. */ -extern void window_message_in_echo_area (); +extern void window_message_in_echo_area (char *format, void *arg1, void *arg2); /* Place a temporary message in the echo area built from FORMAT, ARG1 and ARG2. The message appears immediately, but does not destroy any existing message. A future call to unmessage_in_echo_area () restores the old contents. */ -extern void message_in_echo_area (); -extern void unmessage_in_echo_area (); +extern void message_in_echo_area (char *format, void *arg1, void *arg2); +extern void unmessage_in_echo_area (void); /* Clear the echo area, removing any message that is already present. The echo area is cleared immediately. */ -extern void window_clear_echo_area (); +extern void window_clear_echo_area (void); /* Quickly guess the approximate number of lines to that NODE would take to display. This really only counts carriage returns. */ -extern int window_physical_lines (); +extern int window_physical_lines (NODE *node); /* Calculate a list of line starts for the node belonging to WINDOW. The line starts are pointers to the actual text within WINDOW->NODE. */ -extern void calculate_line_starts (); +extern void calculate_line_starts (WINDOW *window); /* Given WINDOW, recalculate the line starts for the node it displays. */ -extern void recalculate_line_starts (); +extern void recalculate_line_starts (WINDOW *window); /* Return the number of characters it takes to display CHARACTER on the screen at HPOS. */ -extern int character_width (); +extern int character_width (int character, int hpos); /* Return the number of characters it takes to display STRING on the screen at HPOS. */ -extern int string_width (); +extern int string_width (char *string, int hpos); /* Return the index of the line containing point. */ -extern int window_line_of_point (); +extern int window_line_of_point (WINDOW *window); /* Get and return the goal column for this window. */ -extern int window_get_goal_column (); +extern int window_get_goal_column (WINDOW *window); /* Get and return the printed column offset of the cursor in this window. */ -extern int window_get_cursor_column (); +extern int window_get_cursor_column (WINDOW *window); /* Get and Set the node, pagetop, and point of WINDOW. */ -extern void window_get_state (), window_set_state (); +extern void window_get_state (WINDOW *window, SEARCH_STATE *state); +extern void window_set_state (WINDOW *window, SEARCH_STATE *state); /* Count the number of characters in LINE that precede the printed column offset of GOAL. */ -extern int window_chars_to_goal (); +extern int window_chars_to_goal (char *line, int goal); #endif /* not INFO_WINDOW_H */ diff --git a/gnu/usr.bin/texinfo/lib/Makefile.am b/gnu/usr.bin/texinfo/lib/Makefile.am index df65d78bd26..d19f17013b1 100644 --- a/gnu/usr.bin/texinfo/lib/Makefile.am +++ b/gnu/usr.bin/texinfo/lib/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.5 2002/12/13 03:12:26 millert Exp $ +# $Id: Makefile.am,v 1.6 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/lib. # Run automake in .. to produce Makefile.in from this. # @@ -14,8 +14,8 @@ noinst_LIBRARIES = libtxi.a INCLUDES = -I../intl # Don't need to list alloca.c, etc., Automake includes them. -libtxi_a_SOURCES = gettext.h substring.c system.h xexit.c xmalloc.c xstrdup.c -libtxi_a_LIBADD = @LIBOBJS@ @ALLOCA@ +libtxi_a_SOURCES = gettext.h substring.c system.h xalloc.h xexit.c xmalloc.c xstrdup.c +libtxi_a_LIBADD = $(LIBOBJS) $(ALLOCA) libtxi_a_DEPENDENCIES = $(libtxi_a_LIBADD) ## xx configure for bzero?, clib, other common stuff diff --git a/gnu/usr.bin/texinfo/lib/Makefile.in b/gnu/usr.bin/texinfo/lib/Makefile.in index 533bf4c5c9f..31d8e7435fa 100644 --- a/gnu/usr.bin/texinfo/lib/Makefile.in +++ b/gnu/usr.bin/texinfo/lib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.4 2002/12/13 03:12:26 millert Exp $ +# $Id: Makefile.in,v 1.5 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/lib. # Run automake in .. to produce Makefile.in from this. # @@ -25,148 +25,238 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SHELL = @SHELL@ + +SOURCES = $(libtxi_a_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ +build_triplet = @build@ host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ +subdir = lib +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + alloca.c memcpy.c memmove.c mkstemp.c strcasecmp.c strdup.c \ + strerror.c strncasecmp.c tempname.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libtxi_a_AR = $(AR) $(ARFLAGS) +am__DEPENDENCIES_1 = @LIBOBJS@ +am__DEPENDENCIES_2 = @ALLOCA@ +am_libtxi_a_OBJECTS = substring.$(OBJEXT) xexit.$(OBJEXT) xmalloc.$(OBJEXT) \ + xstrdup.$(OBJEXT) +libtxi_a_OBJECTS = $(am_libtxi_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libtxi_a_SOURCES) +DIST_SOURCES = $(libtxi_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ -HAVE_LIB = @HAVE_LIB@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HELP2MAN = @HELP2MAN@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_WARNINGS_FALSE = @INSTALL_WARNINGS_FALSE@ +INSTALL_WARNINGS_TRUE = @INSTALL_WARNINGS_TRUE@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ +LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LTLIB = @LTLIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ TERMLIBS = @TERMLIBS@ +TOOLS_ONLY_FALSE = @TOOLS_ONLY_FALSE@ +TOOLS_ONLY_TRUE = @TOOLS_ONLY_TRUE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ - +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +native_tools = @native_tools@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ noinst_LIBRARIES = libtxi.a INCLUDES = -I../intl # Don't need to list alloca.c, etc., Automake includes them. -libtxi_a_SOURCES = gettext.h substring.c system.h xexit.c xmalloc.c xstrdup.c +libtxi_a_SOURCES = gettext.h substring.c system.h xalloc.h xexit.c xmalloc.c xstrdup.c -libtxi_a_LIBADD = @LIBOBJS@ @ALLOCA@ +libtxi_a_LIBADD = $(LIBOBJS) $(ALLOCA) libtxi_a_DEPENDENCIES = $(libtxi_a_LIBADD) - EXTRA_DIST = README -subdir = lib -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - -libtxi_a_AR = $(AR) cru -am_libtxi_a_OBJECTS = substring.$(OBJEXT) xexit.$(OBJEXT) xmalloc.$(OBJEXT) \ - xstrdup.$(OBJEXT) -libtxi_a_OBJECTS = $(am_libtxi_a_OBJECTS) - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/memcpy.Po \ -@AMDEP_TRUE@ $(DEPDIR)/memmove.Po $(DEPDIR)/strcasecmp.Po \ -@AMDEP_TRUE@ $(DEPDIR)/strdup.Po $(DEPDIR)/strerror.Po \ -@AMDEP_TRUE@ $(DEPDIR)/strncasecmp.Po ./$(DEPDIR)/substring.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xexit.Po ./$(DEPDIR)/xmalloc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/xstrdup.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -DIST_SOURCES = $(libtxi_a_SOURCES) -DIST_COMMON = README Makefile.am Makefile.in alloca.c memcpy.c \ - memmove.c strcasecmp.c strdup.c strerror.c strncasecmp.c -SOURCES = $(libtxi_a_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -AR = ar +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -176,7 +266,7 @@ libtxi.a: $(libtxi_a_OBJECTS) $(libtxi_a_DEPENDENCIES) $(RANLIB) libtxi.a mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -184,38 +274,32 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memmove.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mkstemp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strdup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strncasecmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/tempname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/substring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xexit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrdup.Po@am__quote@ -distclean-depend: - -rm -rf $(DEPDIR) ./$(DEPDIR) - .c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` -CCDEPMODE = @CCDEPMODE@ -install-info-am: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -224,6 +308,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -235,8 +320,24 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -245,25 +346,29 @@ GTAGS: && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir)$$dir \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ @@ -273,9 +378,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) - installdirs: - install: install-am install-exec: install-exec-am install-data: install-data-am @@ -287,7 +390,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -295,7 +398,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -305,14 +408,17 @@ clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-tags + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -321,29 +427,41 @@ install-data-am: install-exec-am: +install-info: install-info-am + install-man: installcheck-am: maintainer-clean: maintainer-clean-am - + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + uninstall-am: uninstall-info-am -.PHONY: GTAGS all all-am check check-am clean clean-generic \ - clean-noinstLIBRARIES distclean distclean-compile \ - distclean-depend distclean-generic distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic tags \ - uninstall uninstall-am uninstall-info-am +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gnu/usr.bin/texinfo/lib/system.h b/gnu/usr.bin/texinfo/lib/system.h index a32f2f918da..4a34f3c368d 100644 --- a/gnu/usr.bin/texinfo/lib/system.h +++ b/gnu/usr.bin/texinfo/lib/system.h @@ -1,7 +1,8 @@ /* system.h: system-dependent declarations; include this first. - $Id: system.h,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: system.h,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1997, 98, 99, 00, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,12 +25,18 @@ #include <config.h> -/* <unistd.h> should be included before any preprocessor test - of _POSIX_VERSION. */ -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif /* HAVE_UNISTD_H */ +#ifdef MIKTEX +#include <gnu-miktex.h> +#define S_ISDIR(x) ((x)&_S_IFDIR) +#else +/* MiKTeX defines substring() in a separate DLL, where it has its + own __declspec declaration. We don't want to try to duplicate + this Microsoft-ism here. */ +extern char *substring (const char *, const char *); +#endif +/* We follow the order of header inclusion from Autoconf's + ac_includes_default, more or less. */ #include <stdio.h> #include <sys/types.h> #include <ctype.h> @@ -43,14 +50,13 @@ #endif /* For gettext (NLS). */ +#define const #include "gettext.h" +#undef const + #define _(String) gettext (String) #define N_(String) (String) -#ifndef HAVE_LC_MESSAGES -#define LC_MESSAGES (-1) -#endif - #ifdef STDC_HEADERS #define getopt system_getopt #include <stdlib.h> @@ -61,16 +67,34 @@ extern char *getenv (); /* Don't use bcopy! Use memmove if source and destination may overlap, memcpy otherwise. */ -#ifdef HAVE_STRING_H +#if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> -#else +#endif + +#if HAVE_STRINGS_H +/* Always include <strings.h> if we have it. This is because that's + what Autoconf's AC_CHECK_DECL does. On IBM AIX 4.2, strncasecmp is + only declared in strings.h. */ # include <strings.h> +#endif + +#if !HAVE_STRNCASECMP || !HAVE_STRCASECMP +# include "strcase.h" +#endif + +#if !HAVE_DECL_MEMCHR char *memchr (); #endif +/* <unistd.h> defines _POSIX_VERSION, but Paul Eggert points out that is + only supposed to be used in user code, not other system headers. */ +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif /* HAVE_UNISTD_H */ + #include <errno.h> #ifndef errno extern int errno; @@ -177,30 +201,41 @@ extern int strcoll (); # define HAVE_LONG_FILENAMES(dir) (pathconf (dir, _PC_NAME_MAX) > 12) # define NULL_DEVICE "/dev/null" # define DEFAULT_INFOPATH "c:/djgpp/info;/usr/local/info;/usr/info;." -# else /* !__DJGPP__ */ + /* DJGPP supports /dev/null, which is okay for Unix aficionados, + shell scripts and Makefiles, but interactive DOS die-hards + would probably want to have NUL as well. */ +# define ALSO_NULL_DEVICE "NUL" +# else /* O_BINARY && !__DJGPP__ */ # define HAVE_LONG_FILENAMES(dir) (0) # define NULL_DEVICE "NUL" -# endif /* !__DJGPP__ */ +# endif /* O_BINARY && !__DJGPP__ */ # define SET_SCREEN_SIZE_HELPER terminal_prep_terminal() # define DEFAULT_INFO_PRINT_COMMAND ">PRN" -# else /* !__MSDOS__ */ +# else /* O_BINARY && !__MSDOS__ */ # define setmode(f,m) _setmode(f,m) # define HAVE_LONG_FILENAMES(dir) (1) # define NULL_DEVICE "NUL" -# endif /* !__MSDOS__ */ -# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) +# endif /* O_BINARY && !__MSDOS__ */ +# ifdef __CYGWIN__ +# define DEFAULT_TMPDIR "/tmp/" +# define PATH_SEP ":" +# else /* O_BINARY && !__CYGWIN__ */ +# define DEFAULT_TMPDIR "c:/" +# define PATH_SEP ";" +# endif /* O_BINARY && !__CYGWIN__ */ + /* Back to any O_BINARY system. */ +# define FILENAME_CMP strcasecmp +# define FILENAME_CMPN strncasecmp # define FOPEN_RBIN "rb" # define FOPEN_WBIN "wb" -# define IS_SLASH(c) ((c) == '/' || (c) == '\\') # define HAVE_DRIVE(n) ((n)[0] && (n)[1] == ':') +# define IS_SLASH(c) ((c) == '/' || (c) == '\\') # define IS_ABSOLUTE(n) (IS_SLASH((n)[0]) || ((n)[0] && (n)[1] == ':')) -# define FILENAME_CMP strcasecmp -# define FILENAME_CMPN strncasecmp -# define PATH_SEP ";" -# define STRIP_DOT_EXE 1 -# define DEFAULT_TMPDIR "c:/" # define PIPE_USE_FORK 0 -#else /* not O_BINARY */ +# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) +# define STRIP_DOT_EXE 1 + +#else /* not O_BINARY, i.e., Unix */ # define SET_BINARY(f) (void)0 # define FOPEN_RBIN "r" # define FOPEN_WBIN "w" @@ -221,12 +256,8 @@ extern int strcoll (); # define PIPE_USE_FORK 1 #endif /* not O_BINARY */ -/* DJGPP supports /dev/null, which is okay for Unix aficionados, - shell scripts and Makefiles, but interactive DOS die-hards - would probably want to have NUL as well. */ -#ifdef __DJGPP__ -# define ALSO_NULL_DEVICE "NUL" -#else +/* Everything but DJGPP. */ +#ifndef ALSO_NULL_DEVICE # define ALSO_NULL_DEVICE "" #endif @@ -234,15 +265,27 @@ extern int strcoll (); #include <pwd.h> #endif /* Some systems don't declare this function in pwd.h. */ -struct passwd *getpwnam (); +struct passwd *getpwnam (const char *name); /* Our library routines not included in any system library. */ -extern void *xmalloc (), *xrealloc (); -extern char *xstrdup (); -extern void xexit (); -extern char *substring (); +extern void *xmalloc (size_t), *xrealloc (void *, size_t); +extern char *xstrdup (const char *); +extern void xexit (int); /* For convenience. */ #define STREQ(s1,s2) (strcmp (s1, s2) == 0) +#define STRCASEEQ(s1,s2) (strcasecmp (s1, s2) == 0) +#define STRNCASEEQ(s1,s2,n) (strncasecmp (s1, s2, n) == 0) + +/* We don't need anything fancy. If we did need something fancy, gnulib + has it. */ +#ifdef MIN +#undef MIN +#endif +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#ifdef MAX +#undef MAX +#endif +#define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif /* TEXINFO_SYSTEM_H */ diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.am b/gnu/usr.bin/texinfo/makeinfo/Makefile.am index fac3d3074a1..be26805f8e9 100644 --- a/gnu/usr.bin/texinfo/makeinfo/Makefile.am +++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.4 2002/06/10 13:51:03 espie Exp $ +# $Id: Makefile.am,v 1.5 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/makeinfo. # Run automake in .. to produce Makefile.in from this. # @@ -14,17 +14,15 @@ bin_PROGRAMS = makeinfo localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a @LIBINTL@ +LDADD = ../lib/libtxi.a $(LIBINTL) makeinfo_SOURCES = \ - cmds.c cmds.h defun.c defun.h docbook.c docbook.h \ - files.c files.h footnote.c footnote.h \ + cmds.c cmds.h defun.c defun.h \ + files.c files.h float.c float.h footnote.c footnote.h \ html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h \ - macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h \ - sectioning.c sectioning.h toc.c toc.h xml.c xml.h + macro.c macro.h makeinfo.c makeinfo.h multi.c multi.h node.c node.h \ + sectioning.c sectioning.h toc.c toc.h xml.c xml.h xref.c xref.h -pkgdata_DATA = texinfo.dtd texinfo.xsl - -EXTRA_DIST = README $(pkgdata_DATA) +EXTRA_DIST = README SUBDIRS = tests diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.in b/gnu/usr.bin/texinfo/makeinfo/Makefile.in index fc3ba2a219e..b377feff264 100644 --- a/gnu/usr.bin/texinfo/makeinfo/Makefile.in +++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.4 2002/06/10 13:51:03 espie Exp $ +# $Id: Makefile.in,v 1.5 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/makeinfo. # Run automake in .. to produce Makefile.in from this. # @@ -25,192 +25,270 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SHELL = @SHELL@ + +SOURCES = $(makeinfo_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ +build_triplet = @build@ host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ +bin_PROGRAMS = makeinfo$(EXEEXT) +subdir = makeinfo +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_makeinfo_OBJECTS = cmds.$(OBJEXT) defun.$(OBJEXT) files.$(OBJEXT) \ + float.$(OBJEXT) footnote.$(OBJEXT) html.$(OBJEXT) \ + index.$(OBJEXT) insertion.$(OBJEXT) lang.$(OBJEXT) \ + macro.$(OBJEXT) makeinfo.$(OBJEXT) multi.$(OBJEXT) \ + node.$(OBJEXT) sectioning.$(OBJEXT) toc.$(OBJEXT) \ + xml.$(OBJEXT) xref.$(OBJEXT) +makeinfo_OBJECTS = $(am_makeinfo_OBJECTS) +makeinfo_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +makeinfo_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(makeinfo_SOURCES) +DIST_SOURCES = $(makeinfo_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ -HAVE_LIB = @HAVE_LIB@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HELP2MAN = @HELP2MAN@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_WARNINGS_FALSE = @INSTALL_WARNINGS_FALSE@ +INSTALL_WARNINGS_TRUE = @INSTALL_WARNINGS_TRUE@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ +LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LTLIB = @LTLIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ TERMLIBS = @TERMLIBS@ +TOOLS_ONLY_FALSE = @TOOLS_ONLY_FALSE@ +TOOLS_ONLY_TRUE = @TOOLS_ONLY_TRUE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ - -bin_PROGRAMS = makeinfo - +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +native_tools = @native_tools@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a @LIBINTL@ - +LDADD = ../lib/libtxi.a $(LIBINTL) makeinfo_SOURCES = \ - cmds.c cmds.h defun.c defun.h docbook.c docbook.h \ - files.c files.h footnote.c footnote.h \ + cmds.c cmds.h defun.c defun.h \ + files.c files.h float.c float.h footnote.c footnote.h \ html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h \ - macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h \ - sectioning.c sectioning.h toc.c toc.h xml.c xml.h - - -pkgdata_DATA = texinfo.dtd texinfo.xsl - -EXTRA_DIST = README $(pkgdata_DATA) + macro.c macro.h makeinfo.c makeinfo.h multi.c multi.h node.c node.h \ + sectioning.c sectioning.h toc.c toc.h xml.c xml.h xref.c xref.h +EXTRA_DIST = README SUBDIRS = tests -subdir = makeinfo -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = makeinfo$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_makeinfo_OBJECTS = cmds.$(OBJEXT) defun.$(OBJEXT) docbook.$(OBJEXT) \ - files.$(OBJEXT) footnote.$(OBJEXT) html.$(OBJEXT) \ - index.$(OBJEXT) insertion.$(OBJEXT) lang.$(OBJEXT) \ - macro.$(OBJEXT) makeinfo.$(OBJEXT) multi.$(OBJEXT) \ - node.$(OBJEXT) sectioning.$(OBJEXT) toc.$(OBJEXT) xml.$(OBJEXT) -makeinfo_OBJECTS = $(am_makeinfo_OBJECTS) -makeinfo_LDADD = $(LDADD) -makeinfo_DEPENDENCIES = ../lib/libtxi.a -makeinfo_LDFLAGS = - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmds.Po ./$(DEPDIR)/defun.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/docbook.Po ./$(DEPDIR)/files.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/footnote.Po ./$(DEPDIR)/html.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/index.Po ./$(DEPDIR)/insertion.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/lang.Po ./$(DEPDIR)/macro.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/makeinfo.Po ./$(DEPDIR)/multi.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/node.Po ./$(DEPDIR)/sectioning.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/toc.Po ./$(DEPDIR)/xml.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -DIST_SOURCES = $(makeinfo_SOURCES) -DATA = $(pkgdata_DATA) - - -RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ - uninstall-info-recursive all-recursive install-data-recursive \ - install-exec-recursive installdirs-recursive install-recursive \ - uninstall-recursive check-recursive installcheck-recursive -DIST_COMMON = README Makefile.am Makefile.in -DIST_SUBDIRS = $(SUBDIRS) -SOURCES = $(makeinfo_SOURCES) - all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu makeinfo/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu makeinfo/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ - p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \ - f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - f=`echo "$$f" | sed -e 's,^.*/,,'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @@ -220,15 +298,15 @@ makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES) $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defun.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/docbook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/files.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/footnote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/html.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Po@am__quote@ @@ -241,43 +319,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sectioning.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml.Po@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xref.Po@am__quote@ .c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` -CCDEPMODE = @CCDEPMODE@ -.PHONY install-info: install-info-recursive -install-info-am: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -pkgdataDATA_INSTALL = $(INSTALL_DATA) -install-pkgdataDATA: $(pkgdata_DATA) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) - @list='$(pkgdata_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \ - $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \ - done - -uninstall-pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgdata_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \ - rm -f $(DESTDIR)$(pkgdatadir)/$$f; \ - done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -286,7 +343,7 @@ uninstall-pkgdataDATA: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $(MAKEFLAGS); amf=$$2; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -306,7 +363,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -333,11 +390,10 @@ tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done - -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -347,14 +403,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -363,8 +428,24 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -373,51 +454,58 @@ GTAGS: && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir)$$dir \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done - list='$(SUBDIRS)'; for subdir in $$list; do \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive -all-am: Makefile $(PROGRAMS) $(DATA) +all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) - + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -429,7 +517,7 @@ install-am: all-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -437,7 +525,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -447,55 +535,65 @@ clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-tags + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-recursive dvi-am: +html: html-recursive + info: info-recursive info-am: -install-data-am: install-pkgdataDATA +install-data-am: install-exec-am: install-binPROGRAMS +install-info: install-info-recursive + install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive - + -rm -rf ./$(DEPDIR) + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic -uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ - uninstall-pkgdataDATA +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ - clean-binPROGRAMS clean-generic clean-recursive distclean \ - distclean-compile distclean-depend distclean-generic \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-binPROGRAMS install-data install-data-am \ - install-data-recursive install-exec install-exec-am \ - install-exec-recursive install-info-am install-info-recursive \ - install-man install-pkgdataDATA install-recursive install-strip \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-binPROGRAMS clean-generic clean-recursive ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs installdirs-am \ - installdirs-recursive maintainer-clean maintainer-clean-generic \ + maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \ - uninstall-info-recursive uninstall-pkgdataDATA \ - uninstall-recursive + mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/gnu/usr.bin/texinfo/makeinfo/cmds.c b/gnu/usr.bin/texinfo/makeinfo/cmds.c index 70e7a770616..88c0da3deab 100644 --- a/gnu/usr.bin/texinfo/makeinfo/cmds.c +++ b/gnu/usr.bin/texinfo/makeinfo/cmds.c @@ -1,7 +1,8 @@ /* cmds.c -- Texinfo commands. - $Id: cmds.c,v 1.2 2006/01/08 18:08:18 kettenis Exp $ + $Id: cmds.c,v 1.3 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +23,7 @@ #include "defun.h" #include "files.h" #include "footnote.h" +#include "html.h" #include "insertion.h" #include "lang.h" #include "macro.h" @@ -37,64 +39,32 @@ #include <time.h> #endif - -void insert_self (), insert_space (), cm_ignore_line (), cm_ignore_arg (); - -void - cm_TeX (), cm_acronym (), cm_asterisk (), cm_b (), cm_bullet (), cm_cite (), - cm_code (), cm_copyright (), cm_ctrl (), cm_dfn (), cm_dircategory (), - cm_direntry (), cm_dmn (), cm_dots (), cm_emph (), cm_enddots (), cm_i (), - cm_image (), cm_kbd (), cm_key (), cm_no_op (), - cm_novalidate (), cm_not_fixed_width (), cm_r (), - cm_strong (), cm_var (), cm_sc (), cm_w (), cm_email (), cm_url (), - cm_verb (), cm_copying (), cm_insert_copying (), - cm_documentdescription (); - -void - cm_anchor (), cm_node (), cm_menu (), cm_xref (), cm_ftable (), - cm_vtable (), cm_pxref (), cm_inforef (), cm_uref (), cm_email (), - cm_quotation (), cm_display (), cm_smalldisplay (), cm_itemize (), - cm_enumerate (), cm_tab (), cm_table (), cm_itemx (), cm_noindent (), - cm_setfilename (), cm_br (), cm_sp (), cm_page (), cm_group (), - cm_center (), cm_ref (), cm_include (), cm_bye (), cm_item (), cm_end (), - cm_kindex (), cm_cindex (), cm_findex (), cm_pindex (), cm_vindex (), - cm_tindex (), cm_synindex (), cm_printindex (), cm_minus (), - cm_example (), cm_smallexample (), cm_smalllisp (), cm_lisp (), - cm_format (), cm_smallformat (), cm_exdent (), cm_defindex (), - cm_defcodeindex (), cm_result (), cm_expansion (), cm_equiv (), - cm_print (), cm_error (), cm_point (), cm_today (), cm_flushleft (), - cm_flushright (), cm_finalout (), cm_cartouche (), cm_detailmenu (), - cm_multitable (), cm_settitle (), cm_titlefont (), cm_tt (), - cm_verbatim (), cm_verbatiminclude (); - -/* Conditionals. */ -void cm_set (), cm_clear (), cm_ifset (), cm_ifclear (); -void cm_value (), cm_ifeq (); - /* Options. */ -static void cm_paragraphindent (), cm_exampleindent (); +static void cm_exampleindent (void), + cm_firstparagraphindent (void), + cm_paragraphindent (void), + cm_novalidate (void); /* Internals. */ -static void cm_obsolete (); - -/* A random string. */ -static const char small_tag[] = "small"; +static void cm_obsolete (int arg, int start, int end), + not_fixed_width (int arg); /* The dispatch table. */ COMMAND command_table[] = { { "\t", insert_space, NO_BRACE_ARGS }, { "\n", insert_space, NO_BRACE_ARGS }, { " ", insert_space, NO_BRACE_ARGS }, - { "!", insert_self, NO_BRACE_ARGS }, + { "!", cm_punct, NO_BRACE_ARGS }, { "\"", cm_accent_umlaut, MAYBE_BRACE_ARGS }, { "'", cm_accent_acute, MAYBE_BRACE_ARGS }, { "*", cm_asterisk, NO_BRACE_ARGS }, { ",", cm_accent_cedilla, MAYBE_BRACE_ARGS }, { "-", cm_no_op, NO_BRACE_ARGS }, - { ".", insert_self, NO_BRACE_ARGS }, - { ":", cm_no_op, NO_BRACE_ARGS }, + { ".", cm_punct, NO_BRACE_ARGS }, + { "/", cm_no_op, NO_BRACE_ARGS }, + { ":", cm_colon, NO_BRACE_ARGS }, { "=", cm_accent, MAYBE_BRACE_ARGS }, - { "?", insert_self, NO_BRACE_ARGS }, + { "?", cm_punct, NO_BRACE_ARGS }, { "@", insert_self, NO_BRACE_ARGS }, { "\\", insert_self, NO_BRACE_ARGS }, { "^", cm_accent_hat, MAYBE_BRACE_ARGS }, @@ -107,10 +77,12 @@ COMMAND command_table[] = { { "AE", cm_special_char, BRACE_ARGS }, { "H", cm_accent, MAYBE_BRACE_ARGS }, { "L", cm_special_char, BRACE_ARGS }, + { "LaTeX", cm_LaTeX, BRACE_ARGS }, { "O", cm_special_char, BRACE_ARGS }, { "OE", cm_special_char, BRACE_ARGS }, { "TeX", cm_TeX, BRACE_ARGS }, { "aa", cm_special_char, BRACE_ARGS }, + { "abbr", cm_abbr, BRACE_ARGS }, { "acronym", cm_acronym, BRACE_ARGS }, { "ae", cm_special_char, BRACE_ARGS }, { "afivepaper", cm_ignore_line, NO_BRACE_ARGS }, @@ -125,10 +97,12 @@ COMMAND command_table[] = { { "appendixsubsec", cm_appendixsubsec, NO_BRACE_ARGS }, { "appendixsubsubsec", cm_appendixsubsubsec, NO_BRACE_ARGS }, { "asis", cm_no_op, BRACE_ARGS }, + { "author", cm_author, NO_BRACE_ARGS }, { "b", cm_b, BRACE_ARGS }, { "bullet", cm_bullet, BRACE_ARGS }, { "bye", cm_bye, NO_BRACE_ARGS }, - { "c", cm_ignore_line, NO_BRACE_ARGS }, + { "c", cm_comment, NO_BRACE_ARGS }, + { "caption", cm_caption, BRACE_ARGS }, { "cartouche", cm_cartouche, NO_BRACE_ARGS }, { "center", cm_center, NO_BRACE_ARGS }, { "centerchap", cm_unnumbered, NO_BRACE_ARGS }, @@ -138,8 +112,9 @@ COMMAND command_table[] = { { "cite", cm_cite, BRACE_ARGS }, { "clear", cm_clear, NO_BRACE_ARGS }, { "code", cm_code, BRACE_ARGS }, + { "comma", cm_comma, BRACE_ARGS }, { "command", cm_code, BRACE_ARGS }, - { "comment", cm_ignore_line, NO_BRACE_ARGS }, + { "comment", cm_comment, NO_BRACE_ARGS }, { "contents", cm_contents, NO_BRACE_ARGS }, { "copying", cm_copying, NO_BRACE_ARGS }, { "copyright", cm_copyright, BRACE_ARGS }, @@ -165,6 +140,8 @@ COMMAND command_table[] = { { "defspecx", cm_defun, NO_BRACE_ARGS }, { "deftp", cm_defun, NO_BRACE_ARGS }, { "deftpx", cm_defun, NO_BRACE_ARGS }, + { "deftypecv", cm_defun, NO_BRACE_ARGS }, + { "deftypecvx", cm_defun, NO_BRACE_ARGS }, { "deftypefn", cm_defun, NO_BRACE_ARGS }, { "deftypefnx", cm_defun, NO_BRACE_ARGS }, { "deftypefun", cm_defun, NO_BRACE_ARGS }, @@ -190,7 +167,8 @@ COMMAND command_table[] = { { "dircategory", cm_dircategory, NO_BRACE_ARGS }, { "direntry", cm_direntry, NO_BRACE_ARGS }, { "display", cm_display, NO_BRACE_ARGS }, - { "dmn", cm_no_op, BRACE_ARGS }, + { "dmn", cm_dmn, BRACE_ARGS }, + { "docbook", cm_docbook, NO_BRACE_ARGS }, { "documentdescription", cm_documentdescription, NO_BRACE_ARGS }, { "documentencoding", cm_documentencoding, NO_BRACE_ARGS }, { "documentlanguage", cm_documentlanguage, NO_BRACE_ARGS }, @@ -205,6 +183,7 @@ COMMAND command_table[] = { { "env", cm_code, BRACE_ARGS }, { "equiv", cm_equiv, BRACE_ARGS }, { "error", cm_error, BRACE_ARGS }, + { "euro", cm_special_char, BRACE_ARGS }, { "evenfooting", cm_ignore_line, NO_BRACE_ARGS }, { "evenheading", cm_ignore_line, NO_BRACE_ARGS }, { "everyfooting", cm_ignore_line, NO_BRACE_ARGS }, @@ -217,6 +196,8 @@ COMMAND command_table[] = { { "file", cm_code, BRACE_ARGS }, { "finalout", cm_no_op, NO_BRACE_ARGS }, { "findex", cm_findex, NO_BRACE_ARGS }, + { "firstparagraphindent", cm_firstparagraphindent, NO_BRACE_ARGS }, + { "float", cm_float, NO_BRACE_ARGS }, { "flushleft", cm_flushleft, NO_BRACE_ARGS }, { "flushright", cm_flushright, NO_BRACE_ARGS }, { "footnote", cm_footnote, NO_BRACE_ARGS}, /* self-arg eater */ @@ -226,23 +207,30 @@ COMMAND command_table[] = { { "group", cm_group, NO_BRACE_ARGS }, { "heading", cm_heading, NO_BRACE_ARGS }, { "headings", cm_ignore_line, NO_BRACE_ARGS }, + { "headitem", cm_headitem, NO_BRACE_ARGS }, { "html", cm_html, NO_BRACE_ARGS }, { "hyphenation", cm_ignore_arg, BRACE_ARGS }, { "i", cm_i, BRACE_ARGS }, { "ifclear", cm_ifclear, NO_BRACE_ARGS }, { "ifeq", cm_ifeq, NO_BRACE_ARGS }, + { "ifdocbook", cm_ifdocbook, NO_BRACE_ARGS }, { "ifhtml", cm_ifhtml, NO_BRACE_ARGS }, { "ifinfo", cm_ifinfo, NO_BRACE_ARGS }, + { "ifnotdocbook", cm_ifnotdocbook, NO_BRACE_ARGS }, { "ifnothtml", cm_ifnothtml, NO_BRACE_ARGS }, { "ifnotinfo", cm_ifnotinfo, NO_BRACE_ARGS }, { "ifnotplaintext", cm_ifnotplaintext, NO_BRACE_ARGS }, { "ifnottex", cm_ifnottex, NO_BRACE_ARGS }, + { "ifnotxml", cm_ifnotxml, NO_BRACE_ARGS }, { "ifplaintext", cm_ifplaintext, NO_BRACE_ARGS }, { "ifset", cm_ifset, NO_BRACE_ARGS }, { "iftex", cm_iftex, NO_BRACE_ARGS }, + { "ifxml", cm_ifxml, NO_BRACE_ARGS }, { "ignore", command_name_condition, NO_BRACE_ARGS }, { "image", cm_image, BRACE_ARGS }, { "include", cm_include, NO_BRACE_ARGS }, + { "indent", cm_indent, NO_BRACE_ARGS }, + { "indicateurl", cm_indicate_url, BRACE_ARGS }, { "inforef", cm_inforef, BRACE_ARGS }, { "insertcopying", cm_insert_copying, NO_BRACE_ARGS }, { "item", cm_item, NO_BRACE_ARGS }, @@ -254,23 +242,26 @@ COMMAND command_table[] = { { "kindex", cm_kindex, NO_BRACE_ARGS }, { "l", cm_special_char, BRACE_ARGS }, { "lisp", cm_lisp, NO_BRACE_ARGS }, + { "listoffloats", cm_listoffloats, NO_BRACE_ARGS }, { "lowersections", cm_lowersections, NO_BRACE_ARGS }, { "macro", cm_macro, NO_BRACE_ARGS }, { "majorheading", cm_majorheading, NO_BRACE_ARGS }, - { "math", cm_no_op, BRACE_ARGS }, + { "math", cm_math, BRACE_ARGS }, { "menu", cm_menu, NO_BRACE_ARGS }, { "minus", cm_minus, BRACE_ARGS }, { "multitable", cm_multitable, NO_BRACE_ARGS }, { "need", cm_ignore_line, NO_BRACE_ARGS }, { "node", cm_node, NO_BRACE_ARGS }, - { "noindent", cm_noindent, NO_BRACE_ARGS }, - { "noindent", cm_novalidate, NO_BRACE_ARGS }, + { "noindent", cm_noindent_cmd, NO_BRACE_ARGS }, + { "novalidate", cm_novalidate, NO_BRACE_ARGS }, { "nwnode", cm_node, NO_BRACE_ARGS }, { "o", cm_special_char, BRACE_ARGS }, { "oddfooting", cm_ignore_line, NO_BRACE_ARGS }, { "oddheading", cm_ignore_line, NO_BRACE_ARGS }, { "oe", cm_special_char, BRACE_ARGS }, { "option", cm_code, BRACE_ARGS }, + { "ordf", cm_special_char, BRACE_ARGS }, + { "ordm", cm_special_char, BRACE_ARGS }, { "page", cm_no_op, NO_BRACE_ARGS }, { "pagesizes", cm_ignore_line, NO_BRACE_ARGS }, { "paragraphindent", cm_paragraphindent, NO_BRACE_ARGS }, @@ -286,10 +277,12 @@ COMMAND command_table[] = { { "raisesections", cm_raisesections, NO_BRACE_ARGS }, { "ref", cm_ref, BRACE_ARGS }, { "refill", cm_no_op, NO_BRACE_ARGS }, + { "registeredsymbol", cm_registeredsymbol, BRACE_ARGS }, { "result", cm_result, BRACE_ARGS }, { "ringaccent", cm_accent, MAYBE_BRACE_ARGS }, { "rmacro", cm_rmacro, NO_BRACE_ARGS }, { "samp", cm_code, BRACE_ARGS }, + { "sansserif", cm_sansserif, BRACE_ARGS }, { "sc", cm_sc, BRACE_ARGS }, { "section", cm_section, NO_BRACE_ARGS }, { "set", cm_set, NO_BRACE_ARGS }, @@ -299,8 +292,10 @@ COMMAND command_table[] = { { "setfilename", cm_setfilename, NO_BRACE_ARGS }, { "setshortcontentsaftertitlepage", cm_no_op, NO_BRACE_ARGS }, { "settitle", cm_settitle, NO_BRACE_ARGS }, - { "shortcontents", cm_shortcontents, NO_BRACE_ARGS }, + { "shortcaption", cm_caption, BRACE_ARGS }, + { "shortcontents", cm_contents, NO_BRACE_ARGS }, { "shorttitlepage", cm_ignore_line, NO_BRACE_ARGS }, + { "slanted", cm_slanted, BRACE_ARGS }, { "smallbook", cm_ignore_line, NO_BRACE_ARGS }, { "smalldisplay", cm_smalldisplay, NO_BRACE_ARGS }, { "smallexample", cm_smallexample, NO_BRACE_ARGS }, @@ -313,17 +308,20 @@ COMMAND command_table[] = { { "subsection", cm_subsection, NO_BRACE_ARGS }, { "subsubheading", cm_subsubheading, NO_BRACE_ARGS }, { "subsubsection", cm_subsubsection, NO_BRACE_ARGS }, - { "summarycontents", cm_shortcontents, NO_BRACE_ARGS }, + { "subtitle", cm_titlepage_cmds, NO_BRACE_ARGS }, + { "summarycontents", cm_contents, NO_BRACE_ARGS }, { "syncodeindex", cm_synindex, NO_BRACE_ARGS }, { "synindex", cm_synindex, NO_BRACE_ARGS }, { "t", cm_tt, BRACE_ARGS }, { "tab", cm_tab, NO_BRACE_ARGS }, { "table", cm_table, NO_BRACE_ARGS }, { "tex", cm_tex, NO_BRACE_ARGS }, + { "tie", cm_tie, BRACE_ARGS }, { "tieaccent", cm_accent, MAYBE_BRACE_ARGS }, { "tindex", cm_tindex, NO_BRACE_ARGS }, + { "title", cm_titlepage_cmds, NO_BRACE_ARGS }, { "titlefont", cm_titlefont, BRACE_ARGS }, - { "titlepage", command_name_condition, NO_BRACE_ARGS }, + { "titlepage", cm_titlepage, NO_BRACE_ARGS }, { "today", cm_today, BRACE_ARGS }, { "top", cm_top, NO_BRACE_ARGS }, { "u", cm_accent, MAYBE_BRACE_ARGS }, @@ -335,7 +333,7 @@ COMMAND command_table[] = { { "unnumberedsubsec", cm_unnumberedsubsec, NO_BRACE_ARGS }, { "unnumberedsubsubsec", cm_unnumberedsubsubsec, NO_BRACE_ARGS }, { "uref", cm_uref, BRACE_ARGS }, - { "url", cm_url, BRACE_ARGS }, + { "url", cm_uref, BRACE_ARGS }, { "v", cm_accent, MAYBE_BRACE_ARGS }, { "value", cm_value, BRACE_ARGS }, { "var", cm_var, BRACE_ARGS }, @@ -344,7 +342,9 @@ COMMAND command_table[] = { { "verbatiminclude", cm_verbatiminclude, NO_BRACE_ARGS }, { "vindex", cm_vindex, NO_BRACE_ARGS }, { "vtable", cm_vtable, NO_BRACE_ARGS }, + { "vskip", cm_ignore_line, NO_BRACE_ARGS }, { "w", cm_w, BRACE_ARGS }, + { "xml", cm_xml, NO_BRACE_ARGS }, { "xref", cm_xref, BRACE_ARGS }, /* Deprecated commands. These used to be for italics. */ @@ -373,29 +373,37 @@ COMMAND command_table[] = { /* Commands which insert their own names. */ void -insert_self (arg) - int arg; +insert_self (int arg) { if (arg == START) add_word (command); } void -insert_space (arg) - int arg; +insert_space (int arg) { if (arg == START) { if (xml && !docbook) - xml_insert_entity ("space"); + xml_insert_entity ("space"); else - add_char (' '); + add_char (' '); } } +/* Insert a comma. Useful when a literal , would break our parsing of + multiple arguments. */ +void +cm_comma (int arg) +{ + if (arg == START) + add_char (','); +} + + /* Force a line break in the output. */ void -cm_asterisk () +cm_asterisk (void) { if (html) add_word ("<br>"); @@ -412,24 +420,25 @@ cm_asterisk () /* Insert ellipsis. */ void -cm_dots (arg) - int arg; +cm_dots (int arg) { if (arg == START) { if (xml && !docbook) - xml_insert_entity ("dots"); + xml_insert_entity ("dots"); else if (docbook) - xml_insert_entity ("hellip"); + xml_insert_entity ("hellip"); else - add_word (html ? "<small>...</small>" : "..."); + if (html && !in_fixed_width_font) + insert_string ("<small class=\"dots\">...</small>"); + else + add_word ("..."); } } /* Insert ellipsis for sentence end. */ void -cm_enddots (arg) - int arg; +cm_enddots (int arg) { if (arg == START) { @@ -441,18 +450,20 @@ cm_enddots (arg) add_char ('.'); } else - add_word (html ? "<small>...</small>." : "...."); + if (html && !in_fixed_width_font) + insert_string ("<small class=\"enddots\">....</small>"); + else + add_word ("...."); } } void -cm_bullet (arg) - int arg; +cm_bullet (int arg) { if (arg == START) { if (html) - add_word ("•"); + add_word ("•"); else if (xml && !docbook) xml_insert_entity ("bullet"); else if (docbook) @@ -463,36 +474,79 @@ cm_bullet (arg) } void -cm_minus (arg) - int arg; +cm_minus (int arg) { if (arg == START) { if (xml) xml_insert_entity ("minus"); + else if (html) + add_word ("−"); else add_char ('-'); } } +/* Formatting a dimension unit. */ +void +cm_dmn (int arg) +{ + if (html) + insert_html_tag_with_attribute (arg, "span", "class=\"dmn\""); + else if (docbook) + /* No units in docbook yet. */ + ; + else if (xml) + xml_insert_element (DIMENSION, arg); +} + /* Insert "TeX". */ void -cm_TeX (arg) - int arg; +cm_TeX (int arg) { + static int last_position; + if (arg == START) { - if (xml && ! docbook) + if (xml) xml_insert_entity ("tex"); else add_word ("TeX"); + + last_position = output_paragraph_offset; + } + else if (last_position != output_paragraph_offset) + { + warning (_("arguments to @%s ignored"), command); + output_paragraph_offset = last_position; + } +} + +/* Insert "LaTeX". */ +void +cm_LaTeX (int arg) +{ + static int last_position; + + if (arg == START) + { + if (xml) + xml_insert_entity ("latex"); + else + add_word ("LaTeX"); + + last_position = output_paragraph_offset; + } + else if (last_position != output_paragraph_offset) + { + warning (_("arguments to @%s ignored"), command); + output_paragraph_offset = last_position; } } /* Copyright symbol. */ void -cm_copyright (arg) - int arg; +cm_copyright (int arg) { if (arg == START) { @@ -507,9 +561,25 @@ cm_copyright (arg) } } +/* Registered symbol. */ void -cm_today (arg) - int arg; +cm_registeredsymbol (int arg) +{ + if (arg == START) + { + if (html) + add_word ("®"); + else if (docbook) + xml_insert_entity ("reg"); + else if (xml && !docbook) + xml_insert_entity ("registered"); + else + add_word ("(R)"); + } +} + +void +cm_today (int arg) { static char *months[12] = { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"), @@ -525,18 +595,191 @@ cm_today (arg) } void -cm_acronym (arg) - int arg; +cm_comment (void) { + /* For HTML, do not output comments before HTML header is written, + otherwise comments before @settitle cause an empty <title> in the + header. */ + if ((html && html_output_head_p) || xml) + { + char *line; + get_rest_of_line (0, &line); + + if (strlen (line) > 0) + { + int save_inhibit_indentation = inhibit_paragraph_indentation; + int save_paragraph_is_open = paragraph_is_open; + int save_escape_html = escape_html; + int save_xml_no_para = xml_no_para; + int i; + + inhibit_paragraph_indentation = 1; + escape_html = 0; + xml_no_para = 1; + + /* @c and @comment can appear between @item and @itemx, + @deffn and @deffnx. */ + xml_dont_touch_items_defs++; + + /* Use insert for HTML, and XML when indentation is enabled. + For Docbook, use add_char. */ + if (xml && xml_indentation_increment > 0 + && output_paragraph[output_paragraph_offset-1] != '\n') + insert ('\n'); + + /* Crunch double hyphens in comments. */ + add_html_block_elt ("<!-- "); + for (i = 0; i < strlen (line); i++) + if (line[i] != '-' || (i && line[i-1] != '-')) + add_char (line[i]); + add_word (" -->"); + + if (html) + add_char ('\n'); + + inhibit_paragraph_indentation = save_inhibit_indentation; + paragraph_is_open = save_paragraph_is_open; + escape_html = save_escape_html; + xml_no_para = save_xml_no_para; + xml_dont_touch_items_defs--; + } + + free (line); + } + else + cm_ignore_line (); +} + + + +/* We keep acronyms with two arguments around, to be able to refer to them + later with only one argument. */ +static ACRONYM_DESC *acronyms_stack = NULL; + +static void +cm_acronym_or_abbr (int arg, int is_abbr) +{ + char *aa, *description; + unsigned len; + + /* We do everything at START. */ + if (arg == END) + return; + + get_until_in_braces (",", &aa); + if (input_text[input_text_offset] == ',') + input_text_offset++; + get_until_in_braces ("}", &description); + + canon_white (aa); + canon_white (description); + + /* If not enclosed in braces, strip after comma to be compatible + with texinfo.tex. */ + if (description[0] != '{' && strchr (description, ',') != NULL) + { + int i = 0; + while (description[i] != ',') + i++; + /* For now, just terminate the string at comma. */ + description[i] = 0; + } + + /* Get description out of braces. */ + if (description[0] == '{') + description++; + + len = strlen (description); + if (len && description[len-1] == '}') + description[len-1] = 0; + + /* Save new description. */ + if (strlen (description) > 0) + { + ACRONYM_DESC *new = xmalloc (sizeof (ACRONYM_DESC)); + + new->acronym = xstrdup (aa); + new->description = xstrdup (description); + new->next = acronyms_stack; + acronyms_stack = new; + } + if (html) - insert_html_tag (arg, small_tag); + { + add_word (is_abbr ? "<abbr" : "<acronym"); + + if (strlen (description) > 0) + add_word_args (" title=\"%s\"", text_expansion (description)); + else if (acronyms_stack) + { + /* No second argument, get from previous. Search order is from + last to first defined, so we get the most recent version of + the description. */ + ACRONYM_DESC *temp = acronyms_stack; + + while (temp) + { + if (STREQ (aa, temp->acronym) + && strlen (temp->description) > 0) + { + add_word_args (" title=\"%s\"", + text_expansion (temp->description)); + break; + } + temp = temp->next; + } + } + + add_char ('>'); + execute_string ("%s", aa); + add_word (is_abbr ? "</abbr>" : "</acronym>"); + } + else if (docbook) + { + xml_insert_element (is_abbr ? ABBREV : ACRONYM, START); + execute_string ("%s", aa); + xml_insert_element (is_abbr ? ABBREV : ACRONYM, END); + } else if (xml) - xml_insert_element (ACRONYM, arg); + { + xml_insert_element (is_abbr ? ABBREV : ACRONYM, START); + + xml_insert_element (is_abbr ? ABBREVWORD : ACRONYMWORD, START); + execute_string ("%s", aa); + xml_insert_element (is_abbr ? ABBREVWORD : ACRONYMWORD, END); + + if (strlen (description) > 0) + { + xml_insert_element (is_abbr ? ABBREVDESC : ACRONYMDESC, START); + execute_string ("%s", description); + xml_insert_element (is_abbr ? ABBREVDESC : ACRONYMDESC, END); + } + + xml_insert_element (is_abbr ? ABBREV : ACRONYM, END); + } + else + execute_string ("%s", aa); + + /* Put description into parenthesis after the acronym for all outputs + except XML. */ + if (strlen (description) > 0 && (!xml || docbook)) + add_word_args (" (%s)", description); } void -cm_tt (arg) - int arg; +cm_acronym (int arg) +{ + cm_acronym_or_abbr (arg, 0); +} + +void +cm_abbr (int arg) +{ + cm_acronym_or_abbr (arg, 1); +} + +void +cm_tt (int arg) { /* @t{} is a no-op in Info. */ if (html) @@ -546,37 +789,73 @@ cm_tt (arg) } void -cm_code (arg) - int arg; +cm_code (int arg) { + if (arg == START) + in_fixed_width_font++; + if (xml) - xml_insert_element (CODE, arg); - else { - extern int printing_index; - - if (arg == START) + if (STREQ (command, "command")) + xml_insert_element (COMMAND_TAG, arg); + else if (STREQ (command, "env")) + xml_insert_element (ENV, arg); + else if (STREQ (command, "file")) + xml_insert_element (FILE_TAG, arg); + else if (STREQ (command, "option")) + xml_insert_element (OPTION, arg); + else if (STREQ (command, "samp")) + { + if (docbook && arg == START) + { + /* Even though @samp is in_fixed_width_font, it + should always start a paragraph. Unfortunately, + in_fixed_width_font inhibits that. */ + xml_start_para (); + xml_insert_entity ("lsquo"); + } + xml_insert_element (SAMP, arg); + if (docbook && arg == END) + xml_insert_entity ("rsquo"); + } + else + xml_insert_element (CODE, arg); + } + else if (html) { - in_fixed_width_font++; - - if (html) + if (STREQ (command, "code")) insert_html_tag (arg, "code"); - else if (!printing_index) - add_char ('`'); + else + { /* Use <samp> tag in general to get typewriter. */ + if (arg == START) + { /* If @samp specifically, add quotes a la TeX output. */ + if (STREQ (command, "samp")) add_char ('`'); + add_word ("<samp>"); + } + insert_html_tag_with_attribute (arg, "span", "class=\"%s\"",command); + if (arg == END) + { + add_word ("</samp>"); + if (STREQ (command, "samp")) add_char ('\''); + } + } } - else if (html) - insert_html_tag (arg, "code"); else { + extern int printing_index; + if (!printing_index) - add_meta_char ('\''); - } + { + if (arg == START) + add_char ('`'); + else + add_meta_char ('\''); + } } } void -cm_kbd (arg) - int arg; +cm_kbd (int arg) { if (xml) xml_insert_element (KBD, arg); @@ -596,17 +875,19 @@ cm_kbd (arg) } } +/* Just show a url (http://example.org/..., for example), don't link to it. */ void -cm_url (arg, start, end) +cm_indicate_url (int arg, int start, int end) { if (xml) xml_insert_element (URL, arg); else if (html) { if (arg == START) - add_word ("<<code>"); - else - add_word ("</code>>"); + add_word ("<"); + insert_html_tag (arg, "code"); + if (arg != START) + add_word (">"); } else if (arg == START) @@ -616,8 +897,7 @@ cm_url (arg, start, end) } void -cm_key (arg) - int arg; +cm_key (int arg) { if (xml) xml_insert_element (KEY, arg); @@ -629,8 +909,7 @@ cm_key (arg) /* Handle a command that switches to a non-fixed-width font. */ void -not_fixed_width (arg) - int arg; +not_fixed_width (int arg) { if (arg == START) in_fixed_width_font = 0; @@ -638,8 +917,7 @@ not_fixed_width (arg) /* @var in makeinfo just uppercases the text. */ void -cm_var (arg, start_pos, end_pos) - int arg, start_pos, end_pos; +cm_var (int arg, int start_pos, int end_pos) { if (xml) xml_insert_element (VAR, arg); @@ -664,51 +942,50 @@ cm_var (arg, start_pos, end_pos) } void -cm_sc (arg, start_pos, end_pos) - int arg, start_pos, end_pos; +cm_sc (int arg, int start_pos, int end_pos) { if (xml) xml_insert_element (SC, arg); else { - not_fixed_width (arg); - - if (arg == START) - { - if (html) - insert_html_tag (arg, small_tag); - } - else - { - int all_upper; - - if (html) - start_pos += sizeof (small_tag) + 2 - 1; /* skip <small> */ - - /* Avoid the warning below if there's no text inside @sc{}, or - when processing menus under --no-headers. */ - all_upper = start_pos < end_pos; + not_fixed_width (arg); - while (start_pos < end_pos) + if (arg == START) { - unsigned char c = output_paragraph[start_pos]; - if (!isupper (c)) - all_upper = 0; - output_paragraph[start_pos] = coerce_to_upper (c); - start_pos++; + if (html) + insert_html_tag_with_attribute (arg, "span", "class=\"sc\""); + } + else + { + int all_upper; + + if (html) + start_pos += sizeof ("<span class=\"sc\">") - 1; /* skip <span> */ + + /* Avoid the warning below if there's no text inside @sc{}, or + when processing menus under --no-headers. */ + all_upper = start_pos < end_pos; + + while (start_pos < end_pos) + { + unsigned char c = output_paragraph[start_pos]; + if (!isupper (c)) + all_upper = 0; + if (!html) + output_paragraph[start_pos] = coerce_to_upper (c); + start_pos++; + } + if (all_upper) + warning (_("@sc argument all uppercase, thus no effect")); + + if (html) + insert_html_tag (arg, "span"); } - if (all_upper) - warning (_("@sc argument all uppercase, thus no effect")); - - if (html) - insert_html_tag (arg, small_tag); - } } } void -cm_dfn (arg, position) - int arg, position; +cm_dfn (int arg, int position) { if (xml) xml_insert_element (DFN, arg); @@ -724,8 +1001,7 @@ cm_dfn (arg, position) } void -cm_emph (arg) - int arg; +cm_emph (int arg) { if (xml) xml_insert_element (EMPH, arg); @@ -736,11 +1012,10 @@ cm_emph (arg) } void -cm_verb (arg) - int arg; +cm_verb (int arg) { int character; - int delimiter; + int delimiter = 0; /* avoid warning */ int seen_end = 0; in_fixed_width_font++; @@ -748,7 +1023,7 @@ cm_verb (arg) last_char_was_newline = 0; if (html) - add_word ("<pre>"); + add_word ("<tt>"); if (input_text_offset < input_text_length) { @@ -770,18 +1045,28 @@ cm_verb (arg) character = curchar (); if (character == '\n') - line_number++; - /* - Assume no newlines in END_VERBATIM - */ - else if (character == delimiter) - { + { + line_number++; + if (html) + add_word ("<br>\n"); + } + + else if (html && character == '<') + add_word ("<"); + + else if (html && character == '&') + add_word ("&"); + + else if (character == delimiter && input_text[input_text_offset+1] == '}') + { /* Assume no newlines in END_VERBATIM. */ seen_end = 1; input_text_offset++; break; } - add_char (character); + else + add_char (character); + input_text_offset++; } @@ -798,24 +1083,40 @@ cm_verb (arg) } if (html) - add_word ("</pre>"); + add_word ("</tt>"); + + in_fixed_width_font--; } + void -cm_strong (arg, position) - int arg, position; +cm_strong (int arg, int start_pos, int end_pos) { - if (xml) + if (docbook && arg == START) + xml_insert_element_with_attribute (B, arg, "role=\"bold\""); + else if (xml) xml_insert_element (STRONG, arg); else if (html) insert_html_tag (arg, "strong"); else add_char ('*'); + + if (!xml && !html && !docbook && !no_headers + && arg == END + && end_pos - start_pos >= 6 + && (STRNCASEEQ ((char *) output_paragraph + start_pos, "*Note:", 6) + || STRNCASEEQ ((char *) output_paragraph + start_pos, "*Note ", 6))) + { + /* Translators: "Note:" is literal here and should not be + translated. @strong{Nota}, say, does not cause the problem. */ + warning (_("@strong{Note...} produces a spurious cross-reference in Info; reword to avoid that")); + /* Adjust the output to avoid writing the bad xref. */ + output_paragraph[start_pos + 5] = '_'; + } } void -cm_cite (arg, position) - int arg, position; +cm_cite (int arg, int position) { if (xml) xml_insert_element (CITE, arg); @@ -832,8 +1133,7 @@ cm_cite (arg, position) /* No highlighting, but argument switches fonts. */ void -cm_not_fixed_width (arg, start, end) - int arg, start, end; +cm_not_fixed_width (int arg, int start, int end) { if (xml) xml_insert_element (NOTFIXEDWIDTH, arg); @@ -841,10 +1141,14 @@ cm_not_fixed_width (arg, start, end) } void -cm_i (arg) - int arg; +cm_i (int arg) { - if (xml) + /* Make use of <lineannotation> of Docbook, if we are + inside an @example or similar. */ + extern int printing_index; + if (docbook && !filling_enabled && !printing_index) + xml_insert_element (LINEANNOTATION, arg); + else if (xml) xml_insert_element (I, arg); else if (html) insert_html_tag (arg, "i"); @@ -853,10 +1157,31 @@ cm_i (arg) } void -cm_b (arg) - int arg; +cm_slanted (int arg) { - if (xml) + /* Make use of <lineannotation> of Docbook, if we are + inside an @example or similar. */ + extern int printing_index; + if (docbook && !filling_enabled && !printing_index) + xml_insert_element (LINEANNOTATION, arg); + else if (xml) + xml_insert_element (SLANTED, arg); + else if (html) + insert_html_tag (arg, "i"); + else + not_fixed_width (arg); +} + +void +cm_b (int arg) +{ + /* See cm_i comments. */ + extern int printing_index; + if (docbook && !filling_enabled && !printing_index) + xml_insert_element (LINEANNOTATION, arg); + else if (docbook && arg == START) + xml_insert_element_with_attribute (B, arg, "role=\"bold\""); + else if (xml) xml_insert_element (B, arg); else if (html) insert_html_tag (arg, "b"); @@ -865,56 +1190,74 @@ cm_b (arg) } void -cm_r (arg) - int arg; +cm_r (int arg) { - if (xml) + /* See cm_i comments. */ + extern int printing_index; + if (docbook && !filling_enabled && !printing_index) + xml_insert_element (LINEANNOTATION, arg); + else if (xml) xml_insert_element (R, arg); + else if (html) + insert_html_tag_with_attribute (arg, "span", "class=\"roman\""); else - { - extern int printing_index; + not_fixed_width (arg); +} - /* People use @r{} in index entries like this: - - @findex foo@r{, some text} - - This is supposed to produce output as if the entry were saying - "@code{foo}, some text", since the "fn" index is typeset as - @code. The following attempts to do the same in HTML. Note that - this relies on the fact that only @code bumps up the variable - in_fixed_width_font while processing index entries in HTML mode. */ - if (html && printing_index) - { - int level = in_fixed_width_font; - - while (level--) - insert_html_tag (arg == START ? END : START, "code"); - } - - not_fixed_width (arg); - } +void +cm_sansserif (int arg) +{ + /* See cm_i comments. */ + extern int printing_index; + if (docbook && !filling_enabled && !printing_index) + xml_insert_element (LINEANNOTATION, arg); + else if (xml) + xml_insert_element (SANSSERIF, arg); + else if (html) + insert_html_tag_with_attribute (arg, "span", "class=\"sansserif\""); + else + not_fixed_width (arg); } void -cm_titlefont (arg) - int arg; +cm_titlefont (int arg) { if (xml) xml_insert_element (TITLEFONT, arg); else - not_fixed_width (arg); + { + not_fixed_width (arg); + if (html) + { + html_title_written = 1; /* suppress title from @settitle */ + if (arg == START) + add_word ("<h1 class=\"titlefont\">"); + else + add_word ("</h1>\n"); + } + } +} + + +/* Unfortunately, we cannot interpret @math{} contents like TeX does. We just + pass them through. */ +void +cm_math (int arg) +{ + if (xml && !docbook) + xml_insert_element (MATH, arg); } /* Various commands are no-op's. */ void -cm_no_op () +cm_no_op (void) { } /* For proofing single chapters, etc. */ void -cm_novalidate () +cm_novalidate (void) { validating = 0; } @@ -922,44 +1265,98 @@ cm_novalidate () /* Prevent the argument from being split across two lines. */ void -cm_w (arg, start, end) - int arg, start, end; +cm_w (int arg) { if (arg == START) non_splitting_words++; else - non_splitting_words--; + { + if (docbook || html || xml) + /* This is so @w{$}Log$ doesn't end up as <dollar>Log<dollar> + in the output. */ + insert_string ("<!-- /@w -->"); + + non_splitting_words--; + } } +/* An unbreakable word space. Same as @w{ } for makeinfo, but different + for TeX (the space stretches and stretches, and does not inhibit + hyphenation). */ +void +cm_tie (int arg) +{ + if (arg == START) + { + cm_w (START); + add_char (' '); + } + else + cm_w (END); +} + /* Explain that this command is obsolete, thus the user shouldn't do anything with it. */ static void -cm_obsolete (arg, start, end) - int arg, start, end; +cm_obsolete (int arg, int start, int end) { if (arg == START) warning (_("%c%s is obsolete"), COMMAND_PREFIX, command); } -/* This says to inhibit the indentation of the next paragraph, but - not of following paragraphs. */ +/* Inhibit the indentation of the next paragraph, but not of following + paragraphs. */ void -cm_noindent () +cm_noindent (void) { if (!inhibit_paragraph_indentation) inhibit_paragraph_indentation = -1; } +void +cm_noindent_cmd (void) +{ + cm_noindent (); + xml_no_indent = 1; + skip_whitespace_and_newlines(); + + if (xml) + xml_start_para (); + else if (html && !paragraph_is_open) + add_html_block_elt ("<p class=\"noindent\">"); + else + { + paragraph_is_open = 0; + start_paragraph (); + } +} + +/* Force indentation of the next paragraph. */ +void +cm_indent (void) +{ + inhibit_paragraph_indentation = 0; + xml_no_indent = 0; + skip_whitespace_and_newlines(); + + if (xml) + xml_start_para (); + else if (html && !paragraph_is_open) + add_html_block_elt ("<p class=\"indent\">"); + else + start_paragraph (); +} + /* I don't know exactly what to do with this. Should I allow someone to switch filenames in the middle of output? Since the file could be partially written, this doesn't seem to make sense. - Another option: ignore it, since they don't *really* want to + Another option: ignore it, since they don't really want to switch files. Finally, complain, or at least warn. It doesn't really matter, anyway, since this doesn't get executed. */ void -cm_setfilename () +cm_setfilename (void) { char *filename; get_rest_of_line (1, &filename); @@ -970,14 +1367,16 @@ cm_setfilename () } void -cm_settitle () +cm_settitle (void) { if (xml) { xml_begin_document (current_output_filename); xml_insert_element (SETTITLE, START); + xml_in_book_title = 1; get_rest_of_line (0, &title); execute_string ("%s", title); + xml_in_book_title = 0; xml_insert_element (SETTITLE, END); } else @@ -987,8 +1386,7 @@ cm_settitle () /* Ignore argument in braces. */ void -cm_ignore_arg (arg, start_pos, end_pos) - int arg, start_pos, end_pos; +cm_ignore_arg (int arg, int start_pos, int end_pos) { if (arg == END) output_paragraph_offset = start_pos; @@ -996,19 +1394,21 @@ cm_ignore_arg (arg, start_pos, end_pos) /* Ignore argument on rest of line. */ void -cm_ignore_line () +cm_ignore_line (void) { discard_until ("\n"); } /* Insert the number of blank lines passed as argument. */ void -cm_sp () +cm_sp (void) { int lines; char *line; - get_rest_of_line (1, &line); + /* Due to tricky stuff in execute_string(), @value{} can't be expanded. + So there is really no reason to enable expansion for @sp parameters. */ + get_rest_of_line (0, &line); if (sscanf (line, "%d", &lines) != 1 || lines <= 0) line_error (_("@sp requires a positive numeric argument, not `%s'"), line); @@ -1016,41 +1416,45 @@ cm_sp () { if (xml) { + /* @sp can appear between @item and @itemx, @deffn and @deffnx. */ + xml_dont_touch_items_defs++; xml_insert_element_with_attribute (SP, START, "lines=\"%s\"", line); /* insert_string (line);*/ xml_insert_element (SP, END); + xml_dont_touch_items_defs--; } else - { - /* Must disable filling since otherwise multiple newlines is like - multiple spaces. Must close paragraph since that's what the - manual says and that's what TeX does. */ - int save_filling_enabled = filling_enabled; - filling_enabled = 0; - - /* close_paragraph generates an extra blank line. */ - close_single_paragraph (); + { + /* Must disable filling since otherwise multiple newlines is like + multiple spaces. Must close paragraph since that's what the + manual says and that's what TeX does. */ + int save_filling_enabled = filling_enabled; + filling_enabled = 0; - if (lines && html && !executing_string) - html_output_head (); + /* close_paragraph generates an extra blank line. */ + close_single_paragraph (); - while (lines--) - { - if (html) - insert_string ("<br><p>\n"); - else - add_char ('\n'); - } + if (lines && html && !executing_string) + html_output_head (); - filling_enabled = save_filling_enabled; - } + if (html) + add_html_block_elt ("<pre class=\"sp\">\n"); + + while (lines--) + add_char ('\n'); + + if (html) + add_html_block_elt ("</pre>\n"); + + filling_enabled = save_filling_enabled; + } } free (line); } /* @dircategory LINE outputs INFO-DIR-SECTION LINE, unless --no-headers. */ void -cm_dircategory () +cm_dircategory (void) { char *line; @@ -1084,77 +1488,79 @@ cm_dircategory () Then center the line of text. */ void -cm_center () +cm_center (void) { if (xml) { - unsigned char *line; + char *line; xml_insert_element (CENTER, START); - get_rest_of_line (0, (char **)&line); - execute_string ("%s", (char *)line); + get_rest_of_line (0, &line); + execute_string ("%s", line); free (line); xml_insert_element (CENTER, END); } else { - int i, start, length; - unsigned char *line; - int save_indented_fill = indented_fill; - int save_filling_enabled = filling_enabled; - int fudge_factor = 1; + int i, start, length; + char *line; + int save_indented_fill = indented_fill; + int save_filling_enabled = filling_enabled; + int fudge_factor = 1; - filling_enabled = indented_fill = 0; - cm_noindent (); - start = output_paragraph_offset; + filling_enabled = indented_fill = 0; + cm_noindent (); + start = output_paragraph_offset; - if (html) - add_word ("<div align=\"center\">"); + if (html) + add_html_block_elt ("<div align=\"center\">"); - inhibit_output_flushing (); - get_rest_of_line (0, (char **)&line); - execute_string ("%s", (char *)line); - free (line); - uninhibit_output_flushing (); - if (html) - add_word ("</div>"); + inhibit_output_flushing (); + get_rest_of_line (0, &line); + execute_string ("%s", line); + free (line); + uninhibit_output_flushing (); + if (html) + add_html_block_elt ("</div>"); - else - { - i = output_paragraph_offset - 1; - while (i > (start - 1) && output_paragraph[i] == '\n') - i--; + else + { + i = output_paragraph_offset - 1; + while (i > (start - 1) && output_paragraph[i] == '\n') + i--; - output_paragraph_offset = ++i; - length = output_paragraph_offset - start; + output_paragraph_offset = ++i; + length = output_paragraph_offset - start; - if (length < (fill_column - fudge_factor)) - { - line = xmalloc (1 + length); - memcpy (line, (char *)(output_paragraph + start), length); + if (length < (fill_column - fudge_factor)) + { + line = xmalloc (1 + length); + memcpy (line, (char *)(output_paragraph + start), length); - i = (fill_column - fudge_factor - length) / 2; - output_paragraph_offset = start; + i = (fill_column - fudge_factor - length) / 2; + output_paragraph_offset = start; - while (i--) - insert (' '); + while (i--) + insert (' '); - for (i = 0; i < length; i++) - insert (line[i]); + for (i = 0; i < length; i++) + insert (line[i]); - free (line); - } - } + free (line); + } + } - insert ('\n'); - filling_enabled = save_filling_enabled; - indented_fill = save_indented_fill; + insert ('\n'); + filling_enabled = save_filling_enabled; + indented_fill = save_indented_fill; + close_single_paragraph (); + if (looking_at("\n")) + insert ('\n'); } } /* Show what an expression returns. */ void -cm_result (arg) - int arg; +cm_result (int arg) { if (arg == END) add_word (html ? "=>" : "=>"); @@ -1162,8 +1568,7 @@ cm_result (arg) /* What an expression expands to. */ void -cm_expansion (arg) - int arg; +cm_expansion (int arg) { if (arg == END) add_word (html ? "==>" : "==>"); @@ -1171,8 +1576,7 @@ cm_expansion (arg) /* Indicates two expressions are equivalent. */ void -cm_equiv (arg) - int arg; +cm_equiv (int arg) { if (arg == END) add_word ("=="); @@ -1180,8 +1584,7 @@ cm_equiv (arg) /* What an expression may print. */ void -cm_print (arg) - int arg; +cm_print (int arg) { if (arg == END) add_word ("-|"); @@ -1189,8 +1592,7 @@ cm_print (arg) /* An error signaled. */ void -cm_error (arg) - int arg; +cm_error (int arg) { if (arg == END) add_word (html ? "error-->" : "error-->"); @@ -1198,8 +1600,7 @@ cm_error (arg) /* The location of point in an example of a buffer. */ void -cm_point (arg) - int arg; +cm_point (int arg) { if (arg == END) add_word ("-!-"); @@ -1208,13 +1609,13 @@ cm_point (arg) /* @exdent: Start a new line with just this text on it. The text is outdented one level if possible. */ void -cm_exdent () +cm_exdent (void) { char *line; int save_indent = current_indent; int save_in_fixed_width_font = in_fixed_width_font; - /* Read argument */ + /* Read argument. */ get_rest_of_line (0, &line); /* Exdent the output. Actually this may be a no-op. */ @@ -1230,6 +1631,10 @@ cm_exdent () if (html) add_word ("<br>"); + else if (docbook) + xml_insert_element (LINEANNOTATION, START); + else if (xml) + xml_insert_element (EXDENT, START); /* Can't close_single_paragraph, then we lose preceding blank lines. */ flush_output (); @@ -1238,10 +1643,18 @@ cm_exdent () if (html) add_word ("<br>"); + else if (xml) + { + xml_insert_element (docbook ? LINEANNOTATION : EXDENT, END); + insert ('\n'); + } + close_single_paragraph (); current_indent = save_indent; in_fixed_width_font = save_in_fixed_width_font; + if (!xml) + start_paragraph (); } /* @@ -1250,15 +1663,16 @@ cm_exdent () verbatim_include != 0: process through handle_verbatim_environment */ static void -handle_include (verbatim_include) - int verbatim_include; +handle_include (int verbatim_include) { char *arg, *filename; if (macro_expansion_output_stream && !executing_string) me_append_before_this_command (); - close_paragraph (); + if (!insertion_stack) + close_paragraph (); /* No blank lines etc. if not at outer level. */ + get_rest_of_line (0, &arg); /* We really only want to expand @value, but it's easier to just do everything. TeX will only work with @value. */ @@ -1285,10 +1699,8 @@ handle_include (verbatim_include) fflush (stdout); } - if (!find_and_load (filename)) + if (!find_and_load (filename, 1)) { - extern int errno; - popfile (); line_number--; @@ -1316,7 +1728,7 @@ handle_include (verbatim_include) /* Include file as if put in @verbatim environment */ void -cm_verbatiminclude () +cm_verbatiminclude (void) { handle_include (1); } @@ -1324,7 +1736,7 @@ cm_verbatiminclude () /* Remember this file, and move onto the next. */ void -cm_include () +cm_include (void) { handle_include (0); } @@ -1333,17 +1745,16 @@ cm_include () /* @bye: Signals end of processing. Easy to make this happen. */ void -cm_bye () +cm_bye (void) { discard_braces (); /* should not have any unclosed braces left */ - flush_output (); input_text_offset = input_text_length; } /* @paragraphindent */ static void -cm_paragraphindent () +cm_paragraphindent (void) { char *arg; @@ -1354,28 +1765,119 @@ cm_paragraphindent () free (arg); } + /* @exampleindent: change indentation of example-like environments. */ static int -set_default_indentation_increment (string) - char *string; +set_example_indentation_increment (char *string) { if (strcmp (string, "asis") == 0 || strcmp (string, _("asis")) == 0) ; else if (strcmp (string, "none") == 0 || strcmp (string, _("none")) == 0) - default_indentation_increment = 0; - else if (sscanf (string, "%d", &default_indentation_increment) != 1) + example_indentation_increment = 0; + else if (sscanf (string, "%d", &example_indentation_increment) != 1) return -1; return 0; } static void -cm_exampleindent () +cm_exampleindent (void) { char *arg; get_rest_of_line (1, &arg); - if (set_default_indentation_increment (arg) != 0) + if (set_example_indentation_increment (arg) != 0) + line_error (_("Bad argument to @%s"), command); + + if (input_text[input_text_offset] == '\n') + close_single_paragraph (); + + free (arg); +} + + +/* @firstparagraphindent: suppress indentation in first paragraphs after + headings. */ +static int +set_firstparagraphindent (char *string) +{ + if (STREQ (string, "insert") || STREQ (string, _("insert"))) + do_first_par_indent = 1; + else if (STREQ (string, "none") || STREQ (string, _("none"))) + do_first_par_indent = 0; + else + return -1; + return 0; +} + +static void +cm_firstparagraphindent (void) +{ + char *arg; + + get_rest_of_line (1, &arg); + if (set_firstparagraphindent (arg) != 0) line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command); free (arg); } + +/* For DocBook and XML, produce . for `.@:'. This gives the processing + software a fighting chance to treat it specially by not adding extra space. + + Do this also for ?, !, and :. */ +void +cm_colon (void) +{ + if (xml) + { + if (strchr (".?!:", input_text[input_text_offset-3]) != NULL) + { + /* Erase literal character that's there, except `>', which is + part of the XML tag. */ + if (output_paragraph[output_paragraph_offset-1] != '>') + output_paragraph_offset--; + + switch (input_text[input_text_offset-3]) + { + case '.': + xml_insert_entity ("period"); + break; + case '?': + xml_insert_entity ("quest"); + break; + case '!': + xml_insert_entity ("excl"); + break; + case ':': + xml_insert_entity ("colon"); + break; + } + } + } +} + +/* Ending sentences explicitly. Currently, only outputs entities for XML + output, for other formats it calls insert_self. */ +void +cm_punct (int arg) +{ + if (xml && !docbook) + { + switch (input_text[input_text_offset-1]) + { + case '.': + xml_insert_entity ("eosperiod"); + break; + case '?': + xml_insert_entity ("eosquest"); + break; + case '!': + xml_insert_entity ("eosexcl"); + break; + } + } + else + { + insert_self (arg); + } +} diff --git a/gnu/usr.bin/texinfo/makeinfo/insertion.c b/gnu/usr.bin/texinfo/makeinfo/insertion.c index 0c65c49e9bf..ae9c3c7e368 100644 --- a/gnu/usr.bin/texinfo/makeinfo/insertion.c +++ b/gnu/usr.bin/texinfo/makeinfo/insertion.c @@ -1,7 +1,8 @@ /* insertion.c -- insertions for Texinfo. - $Id: insertion.c,v 1.2 2004/08/17 00:28:03 espie Exp $ + $Id: insertion.c,v 1.3 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,25 +21,29 @@ #include "system.h" #include "cmds.h" #include "defun.h" +#include "float.h" +#include "html.h" #include "insertion.h" #include "macro.h" #include "makeinfo.h" +#include "multi.h" #include "xml.h" /* Must match list in insertion.h. */ static char *insertion_type_names[] = { "cartouche", "copying", "defcv", "deffn", "defivar", "defmac", - "defmethod", "defop", "defopt", "defspec", "deftp", "deftypefn", - "deftypefun", "deftypeivar", "deftypemethod", "deftypeop", - "deftypevar", "deftypevr", "defun", "defvar", "defvr", "detailmenu", - "direntry", "display", "documentdescription", "enumerate", "example", - "flushleft", "flushright", "format", "ftable", "group", "ifclear", - "ifhtml", "ifinfo", "ifnothtml", "ifnotinfo", "ifnotplaintext", "ifnottex", - "ifplaintext", "ifset", "iftex", "itemize", "lisp", "menu", - "multitable", "quotation", "rawhtml", "rawtex", "smalldisplay", - "smallexample", "smallformat", "smalllisp", "verbatim", "table", - "tex", "vtable", "bad_type" + "defmethod", "defop", "defopt", "defspec", "deftp", "deftypecv", + "deftypefn", "deftypefun", "deftypeivar", "deftypemethod", + "deftypeop", "deftypevar", "deftypevr", "defun", "defvar", "defvr", + "detailmenu", "direntry", "display", "documentdescription", + "enumerate", "example", "float", "flushleft", "flushright", "format", + "ftable", "group", "ifclear", "ifdocbook", "ifhtml", "ifinfo", + "ifnotdocbook", "ifnothtml", "ifnotinfo", "ifnotplaintext", "ifnottex", + "ifnotxml", "ifplaintext", "ifset", "iftex", "ifxml", "itemize", "lisp", + "menu", "multitable", "quotation", "rawdocbook", "rawhtml", "rawtex", + "rawxml", "smalldisplay", "smallexample", "smallformat", "smalllisp", + "verbatim", "table", "tex", "vtable", "titlepage", "bad_type" }; /* All nested environments. */ @@ -61,19 +66,29 @@ int in_menu = 0; Used for menu and itemize. */ int in_paragraph = 0; -static const char dl_tag[] = "<dl>\n"; -extern void cm_insert_copying (); +/* Since an insertion is already in the stack before we reach the switch + statement, we cannot use is_in_insertion_of_type (always returns true.) Also + making it return the level found, and comparing it with the current level is + no use, due to the order of stack. */ +static int float_active = 0; +/* Unsetting escape_html blindly causes text inside @html/etc. to be escaped if + used within a rmacro. */ +static int raw_output_block = 0; + +/* Non-zero if a <dl> element has a <dt> element in it. We use this when + deciding whether to insert a <br> or not. */ +static int html_deflist_has_term = 0; void -init_insertion_stack () +init_insertion_stack (void) { insertion_stack = NULL; } /* Return the type of the current insertion. */ static enum insertion_type -current_insertion_type () +current_insertion_type (void) { return insertion_level ? insertion_stack->insertion : bad_type; } @@ -81,7 +96,7 @@ current_insertion_type () /* Return the string which is the function to wrap around items, or NULL if we're not in an environment where @item is ok. */ static char * -current_item_function () +current_item_function (void) { int done = 0; INSERTION_ELT *elt = insertion_stack; @@ -100,15 +115,19 @@ current_item_function () case ifnotinfo: case ifnotplaintext: case ifnottex: + case ifnotxml: case ifplaintext: case ifset: case iftex: + case ifxml: + case rawdocbook: case rawhtml: + case rawxml: case rawtex: case tex: case cartouche: - elt = elt->next; - break; + elt = elt->next; + break; default: done = 1; @@ -123,12 +142,25 @@ current_item_function () change it to "@ ", since "@" by itself is not a command. This makes "@ ", "@\t", and "@\n" all the same, but their default meanings are the same anyway, and let's not worry about supporting redefining them. */ -char * -get_item_function () +static char * +get_item_function (void) { char *item_function; + char *item_loc; + get_rest_of_line (0, &item_function); + /* If the document erroneously says + @itemize @bullet @item foobar + it's nicer to give an error up front than repeat `@bullet expected + braces' until we get a segmentation fault. */ + item_loc = strstr (item_function, "@item"); + if (item_loc) + { + line_error (_("@item not allowed in argument to @itemize")); + *item_loc = 0; + } + /* If we hit the end of text in get_rest_of_line, backing up input pointer will cause the last character of the last line be pushed back onto the input, which is wrong. */ @@ -145,10 +177,8 @@ get_item_function () } /* Push the state of the current insertion on the stack. */ -void -push_insertion (type, item_function) - enum insertion_type type; - char *item_function; +static void +push_insertion (enum insertion_type type, char *item_function) { INSERTION_ELT *new = xmalloc (sizeof (INSERTION_ELT)); @@ -168,7 +198,7 @@ push_insertion (type, item_function) /* Pop the value on top of the insertion stack into the global variables. */ void -pop_insertion () +pop_insertion (void) { INSERTION_ELT *temp = insertion_stack; @@ -188,12 +218,22 @@ pop_insertion () /* Return a pointer to the print name of this enumerated type. */ -char * -insertion_type_pname (type) - enum insertion_type type; +static const char * +insertion_type_pname (enum insertion_type type) { if ((int) type < (int) bad_type) - return insertion_type_names[(int) type]; + { + if (type == rawdocbook) + return "docbook"; + else if (type == rawhtml) + return "html"; + else if (type == rawxml) + return "xml"; + else if (type == rawtex) + return "tex"; + else + return insertion_type_names[(int) type]; + } else return _("Broken-Type in insertion_type_pname"); } @@ -201,16 +241,19 @@ insertion_type_pname (type) /* Return the insertion_type associated with NAME. If the type is not one of the known ones, return BAD_TYPE. */ enum insertion_type -find_type_from_name (name) - char *name; +find_type_from_name (char *name) { int index = 0; while (index < (int) bad_type) { if (STREQ (name, insertion_type_names[index])) return (enum insertion_type) index; + if (index == rawdocbook && STREQ (name, "docbook")) + return rawdocbook; if (index == rawhtml && STREQ (name, "html")) return rawhtml; + if (index == rawxml && STREQ (name, "xml")) + return rawxml; if (index == rawtex && STREQ (name, "tex")) return rawtex; index++; @@ -218,9 +261,29 @@ find_type_from_name (name) return bad_type; } +/* Simple function to query insertion_stack to see if we are inside a given + insertion type. */ int -defun_insertion (type) - enum insertion_type type; +is_in_insertion_of_type (int type) +{ + INSERTION_ELT *temp = insertion_stack; + + if (!insertion_level) + return 0; + + while (temp) + { + if (temp->insertion == type) + return 1; + temp = temp->next; + } + + return 0; +} + + +static int +defun_insertion (enum insertion_type type) { return 0 || (type == defcv) @@ -232,6 +295,7 @@ defun_insertion (type) || (type == defopt) || (type == defspec) || (type == deftp) + || (type == deftypecv) || (type == deftypefn) || (type == deftypefun) || (type == deftypeivar) @@ -262,9 +326,8 @@ int current_enumval = 1; int current_enumtype = ENUM_DIGITS; char *enumeration_arg = NULL; -void -start_enumerating (at, type) - int at, type; +static void +start_enumerating (int at, int type) { if ((enumstack_offset + 1) == max_stack_depth) { @@ -278,8 +341,8 @@ start_enumerating (at, type) current_enumtype = type; } -void -stop_enumerating () +static void +stop_enumerating (void) { --enumstack_offset; if (enumstack_offset < 0) @@ -290,8 +353,8 @@ stop_enumerating () } /* Place a letter or digits into the output stream. */ -void -enumerate_item () +static void +enumerate_item (void) { char temp[10]; @@ -313,7 +376,7 @@ enumerate_item () } static void -enum_html () +enum_html (void) { char type; int start; @@ -334,12 +397,12 @@ enum_html () start = *enumeration_arg - 'a' + 1; } - add_word_args ("<ol type=%c start=%d>\n", type, start); + add_html_block_elt_args ("<ol type=%c start=%d>\n", type, start); } /* Conditionally parse based on the current command name. */ void -command_name_condition () +command_name_condition (void) { char *discarder = xmalloc (8 + strlen (command)); @@ -354,8 +417,7 @@ command_name_condition () commands is done. A huge switch statement handles the various setups, and generic code is on both sides. */ void -begin_insertion (type) - enum insertion_type type; +begin_insertion (enum insertion_type type) { int no_discard = 0; @@ -386,11 +448,12 @@ begin_insertion (type) add_word ("* Menu:\n"); if (xml) - xml_insert_element (MENU, START); + xml_insert_element (MENU, START); + else + in_fixed_width_font++; next_menu_item_number = 1; in_menu++; - in_fixed_width_font++; no_discard++; break; @@ -406,7 +469,14 @@ begin_insertion (type) no_discard++; } - in_fixed_width_font++; + if (xml) + { + xml_insert_element (DETAILMENU, START); + skip_whitespace_and_newlines(); + } + else + in_fixed_width_font++; + in_detailmenu++; break; @@ -437,23 +507,15 @@ begin_insertion (type) break; case copying: - { /* Save the copying text away for @insertcopying, typically used on the back of the @titlepage (for TeX) and the Top node (for info/html). */ - char *text; - int start_of_end; - + if (input_text[input_text_offset] != '\n') discard_until ("\n"); /* ignore remainder of @copying line */ - start_of_end = get_until ("\n@end copying", &text); - /* include all the output-format-specific markup. */ - copying_text = full_expansion (text, 0); - free (text); + input_text_offset = get_until ("\n@end copying", ©ing_text); + canon_white (copying_text); - input_text_offset = start_of_end; /* go back to the @end to match */ - } - /* For info, output the copying text right away, so it will end up in the header of the Info file, before the first node, and thus get copied automatically to all the split files. For xml, also @@ -461,14 +523,28 @@ begin_insertion (type) For html, we output it specifically in html_output_head. For plain text, there's no way to hide it, so the author must use @insertcopying in the desired location. */ + if (docbook) + { + if (!xml_in_bookinfo) + { + xml_insert_element (BOOKINFO, START); + xml_in_bookinfo = 1; + } + xml_insert_element (LEGALNOTICE, START); + } + if (!html && !no_headers) cm_insert_copying (); + + if (docbook) + xml_insert_element (LEGALNOTICE, END); + break; - + case quotation: /* @quotation does filling (@display doesn't). */ if (html) - add_word ("<blockquote>\n"); + add_html_block_elt ("<blockquote>\n"); else { /* with close_single_paragraph, we get no blank line above @@ -479,31 +555,48 @@ begin_insertion (type) inhibit_paragraph_indentation = 1; } current_indent += default_indentation_increment; + if (xml) + xml_insert_quotation (insertion_stack->item_function, START); + else if (strlen(insertion_stack->item_function)) + execute_string ("@b{%s:} ", insertion_stack->item_function); break; - case display: - case smalldisplay: case example: case smallexample: case lisp: case smalllisp: + in_fixed_width_font++; + /* fall through */ + + /* Like @example but no fixed width font. */ + case display: + case smalldisplay: /* Like @display but without indentation. */ case smallformat: case format: close_single_paragraph (); inhibit_paragraph_indentation = 1; - in_fixed_width_font++; filling_enabled = 0; last_char_was_newline = 0; if (html) - /* Kludge alert: if <pre> is followed by a newline, IE3 - renders an extra blank line before the pre-formatted block. - Other browsers seem to not mind one way or the other. */ - add_word ("<br><pre>"); + /* Kludge alert: if <pre> is followed by a newline, IE3, + mozilla, maybe others render an extra blank line before the + pre-formatted block. So don't output a newline. */ + add_html_block_elt_args ("<pre class=\"%s\">", command); if (type != format && type != smallformat) - current_indent += default_indentation_increment; + { + current_indent += example_indentation_increment; + if (html) + { + /* Since we didn't put \n after <pre>, we need to insert + the indentation by hand. */ + int i; + for (i = current_indent; i > 0; i--) + add_char (' '); + } + } break; case multitable: @@ -542,15 +635,27 @@ begin_insertion (type) if (html) { if (type == itemize) - { - add_word ("<ul>\n"); - in_paragraph = 0; - } + { + add_html_block_elt ("<ul>\n"); + in_paragraph = 0; + } else - add_word (dl_tag); + { /* We are just starting, so this <dl> + has no <dt> children yet. */ + html_deflist_has_term = 0; + add_html_block_elt ("<dl>\n"); + } } if (xml) - xml_begin_table (type, insertion_stack->item_function); + xml_begin_table (type, insertion_stack->item_function); + + while (input_text[input_text_offset] == '\n' + && input_text[input_text_offset+1] == '\n') + { + line_number++; + input_text_offset++; + } + break; case enumerate: @@ -566,10 +671,13 @@ begin_insertion (type) filling_enabled = indented_fill = 1; if (html) - enum_html (); + { + enum_html (); + in_paragraph = 0; + } if (xml) - xml_begin_enumerate (enumeration_arg); + xml_begin_enumerate (enumeration_arg); if (isdigit (*enumeration_arg)) start_enumerating (atoi (enumeration_arg), ENUM_DIGITS); @@ -577,12 +685,12 @@ begin_insertion (type) start_enumerating (*enumeration_arg, ENUM_ALPHA); break; - /* @group does nothing special in makeinfo. */ + /* @group produces no output in info. */ case group: /* Only close the paragraph if we are not inside of an @example-like environment. */ if (xml) - xml_insert_element (GROUP, START); + xml_insert_element (GROUP, START); else if (!insertion_stack->next || (insertion_stack->next->insertion != display && insertion_stack->next->insertion != smalldisplay @@ -597,25 +705,192 @@ begin_insertion (type) close_single_paragraph (); break; - /* Insertions that are no-ops in info, but do something in TeX. */ case cartouche: + if (html) + add_html_block_elt ("<p><table class=\"cartouche\" summary=\"cartouche\" border=\"1\"><tr><td>\n"); + if (in_menu) + no_discard++; + break; + + case floatenv: + /* Cannot nest floats, so complain. */ + if (float_active) + { + line_error (_("%cfloat environments cannot be nested"), COMMAND_PREFIX); + pop_insertion (); + break; + } + + float_active++; + + { /* Collect data about this float. */ + /* Example: @float [FLOATTYPE][,XREFLABEL][,POSITION] */ + char floattype[200] = ""; + char xreflabel[200] = ""; + char position[200] = ""; + char *text; + char *caption; + char *shortcaption; + int start_of_end; + int save_line_number = line_number; + int save_input_text_offset = input_text_offset; + int i; + + if (strlen (insertion_stack->item_function) > 0) + { + int i = 0, t = 0, c = 0; + while (insertion_stack->item_function[i]) + { + if (insertion_stack->item_function[i] == ',') + { + switch (t) + { + case 0: + floattype[c] = '\0'; + break; + case 1: + xreflabel[c] = '\0'; + break; + case 2: + position[c] = '\0'; + break; + } + c = 0; + t++; + i++; + continue; + } + + switch (t) + { + case 0: + floattype[c] = insertion_stack->item_function[i]; + break; + case 1: + xreflabel[c] = insertion_stack->item_function[i]; + break; + case 2: + position[c] = insertion_stack->item_function[i]; + break; + } + c++; + i++; + } + } + + skip_whitespace_and_newlines (); + + start_of_end = get_until ("\n@end float", &text); + + /* Get also the @caption. */ + i = search_forward_until_pos ("\n@caption{", + save_input_text_offset, start_of_end); + if (i > -1) + { + input_text_offset = i + sizeof ("\n@caption{") - 1; + get_until_in_braces ("\n@end float", &caption); + input_text_offset = save_input_text_offset; + } + else + caption = ""; + + /* ... and the @shortcaption. */ + i = search_forward_until_pos ("\n@shortcaption{", + save_input_text_offset, start_of_end); + if (i > -1) + { + input_text_offset = i + sizeof ("\n@shortcaption{") - 1; + get_until_in_braces ("\n@end float", &shortcaption); + input_text_offset = save_input_text_offset; + } + else + shortcaption = ""; + + canon_white (xreflabel); + canon_white (floattype); + canon_white (position); + canon_white (caption); + canon_white (shortcaption); + + add_new_float (xstrdup (xreflabel), + xstrdup (caption), xstrdup (shortcaption), + xstrdup (floattype), xstrdup (position)); + + /* Move to the start of the @float so the contents get processed as + usual. */ + input_text_offset = save_input_text_offset; + line_number = save_line_number; + } + + if (html) + add_html_block_elt ("<div class=\"float\">\n"); + else if (docbook) + xml_insert_element (FLOAT, START); + else if (xml) + { + xml_insert_element_with_attribute (FLOAT, START, + "name=\"%s\"", current_float_id ()); + + xml_insert_element (FLOATTYPE, START); + execute_string ("%s", current_float_type ()); + xml_insert_element (FLOATTYPE, END); + + xml_insert_element (FLOATPOS, START); + execute_string ("%s", current_float_position ()); + xml_insert_element (FLOATPOS, END); + } + else + { /* Info */ + close_single_paragraph (); + inhibit_paragraph_indentation = 1; + } + + /* Anchor now. Note that XML documents get their + anchors with <float name="anchor"> tag. */ + if ((!xml || docbook) && strlen (current_float_id ()) > 0) + execute_string ("@anchor{%s}", current_float_id ()); + + break; + + /* Insertions that are no-ops in info, but do something in TeX. */ case ifclear: + case ifdocbook: case ifhtml: case ifinfo: + case ifnotdocbook: case ifnothtml: case ifnotinfo: case ifnotplaintext: case ifnottex: + case ifnotxml: case ifplaintext: case ifset: case iftex: + case ifxml: case rawtex: if (in_menu) no_discard++; break; + case rawdocbook: case rawhtml: - escape_html = 0; + case rawxml: + raw_output_block++; + + if (raw_output_block > 0) + { + xml_no_para = 1; + escape_html = 0; + xml_keep_space++; + } + + { + /* Some deuglification for improved readability. */ + extern int xml_in_para; + if (xml && !xml_in_para && xml_indentation_increment > 0) + add_char ('\n'); + } + break; case defcv: @@ -627,6 +902,7 @@ begin_insertion (type) case defopt: case defspec: case deftp: + case deftypecv: case deftypefn: case deftypefun: case deftypeivar: @@ -641,6 +917,8 @@ begin_insertion (type) filling_enabled = indented_fill = 1; current_indent += default_indentation_increment; no_indent = 0; + if (xml) + xml_begin_definition (); break; case flushleft: @@ -648,7 +926,7 @@ begin_insertion (type) inhibit_paragraph_indentation = 1; filling_enabled = indented_fill = no_indent = 0; if (html) - add_word ("<div align=\"left\">"); + add_html_block_elt ("<div align=\"left\">"); break; case flushright: @@ -657,12 +935,15 @@ begin_insertion (type) inhibit_paragraph_indentation = 1; force_flush_right++; if (html) - add_word ("<div align=\"right\">"); + add_html_block_elt ("<div align=\"right\">"); + break; + + case titlepage: + xml_insert_element (TITLEPAGE, START); break; default: line_error ("begin_insertion internal error: type=%d", type); - } if (!no_discard) @@ -673,11 +954,10 @@ begin_insertion (type) `bad_type', TYPE gets translated to match the value currently on top of the stack. Otherwise, if TYPE doesn't match the top of the insertion stack, give error. */ -void -end_insertion (type) - enum insertion_type type; +static void +end_insertion (int type) { - enum insertion_type temp_type; + int temp_type; if (!insertion_level) return; @@ -700,80 +980,116 @@ end_insertion (type) if (xml) { switch (type) - { - case ifinfo: - case documentdescription: - break; - case copying: - xml_insert_element (COPYING, END); - break; - case quotation: - xml_insert_element (QUOTATION, END); - break; - case example: - xml_insert_element (EXAMPLE, END); - break; - case smallexample: - xml_insert_element (SMALLEXAMPLE, END); - break; - case lisp: - xml_insert_element (LISP, END); - break; - case smalllisp: - xml_insert_element (SMALLLISP, END); - break; - case cartouche: - xml_insert_element (CARTOUCHE, END); - break; - case format: - xml_insert_element (FORMAT, END); - break; - case smallformat: - xml_insert_element (SMALLFORMAT, END); - break; - case display: - xml_insert_element (DISPLAY, END); - break; - case smalldisplay: - xml_insert_element (SMALLDISPLAY, END); - break; - case table: - case ftable: - case vtable: - case itemize: - xml_end_table (type); - break; - case enumerate: - xml_end_enumerate (type); - break; - case group: - xml_insert_element (GROUP, END); + { + case ifinfo: + case documentdescription: + break; + case quotation: + xml_insert_quotation ("", END); + break; + case example: + xml_insert_element (EXAMPLE, END); + if (docbook && current_insertion_type () == floatenv) + xml_insert_element (FLOATEXAMPLE, END); + break; + case smallexample: + xml_insert_element (SMALLEXAMPLE, END); + if (docbook && current_insertion_type () == floatenv) + xml_insert_element (FLOATEXAMPLE, END); + break; + case lisp: + xml_insert_element (LISP, END); + if (docbook && current_insertion_type () == floatenv) + xml_insert_element (FLOATEXAMPLE, END); + break; + case smalllisp: + xml_insert_element (SMALLLISP, END); + if (docbook && current_insertion_type () == floatenv) + xml_insert_element (FLOATEXAMPLE, END); + break; + case cartouche: + xml_insert_element (CARTOUCHE, END); + break; + case format: + if (docbook && xml_in_bookinfo && xml_in_abstract) + { + xml_insert_element (ABSTRACT, END); + xml_in_abstract = 0; + } + else + xml_insert_element (FORMAT, END); + break; + case smallformat: + xml_insert_element (SMALLFORMAT, END); + break; + case display: + xml_insert_element (DISPLAY, END); + break; + case smalldisplay: + xml_insert_element (SMALLDISPLAY, END); + break; + case table: + case ftable: + case vtable: + case itemize: + xml_end_table (type); + break; + case enumerate: + xml_end_enumerate (); + break; + case group: + xml_insert_element (GROUP, END); + break; + case titlepage: + xml_insert_element (TITLEPAGE, END); break; - } + } } switch (type) { /* Insertions which have no effect on paragraph formatting. */ case copying: - case documentdescription: + line_number--; + break; + case ifclear: + case ifdocbook: case ifinfo: case ifhtml: + case ifnotdocbook: case ifnothtml: case ifnotinfo: case ifnotplaintext: case ifnottex: + case ifnotxml: case ifplaintext: case ifset: case iftex: + case ifxml: case rawtex: + case titlepage: break; + case rawdocbook: case rawhtml: - escape_html = 1; + case rawxml: + raw_output_block--; + + if (raw_output_block <= 0) + { + xml_no_para = 0; + escape_html = 1; + xml_keep_space--; + } + + if ((xml || html) && output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; break; case detailmenu: + if (xml) + xml_insert_element (DETAILMENU, END); + in_detailmenu--; /* No longer hacking menus. */ if (!in_menu) { @@ -787,11 +1103,17 @@ end_insertion (type) close_insertion_paragraph (); break; + case documentdescription: + if (xml) + insert_string (document_description); + xml_insert_element (DOCUMENTDESCRIPTION, END); + break; + case menu: in_menu--; /* No longer hacking menus. */ - if (html) - add_word ("</ul>\n"); - else if (!no_headers) + if (html && !no_headers) + add_html_block_elt ("</ul>\n"); + else if (!no_headers && !xml) close_insertion_paragraph (); break; @@ -804,20 +1126,78 @@ end_insertion (type) close_insertion_paragraph (); current_indent -= default_indentation_increment; if (html) - add_word ("</ol>\n"); + add_html_block_elt ("</ol>\n"); break; case flushleft: if (html) - add_word ("</div>\n"); + add_html_block_elt ("</div>\n"); close_insertion_paragraph (); break; - case group: case cartouche: + if (html) + add_html_block_elt ("</td></tr></table>\n"); close_insertion_paragraph (); break; + case group: + if (!xml || docbook) + close_insertion_paragraph (); + break; + + case floatenv: + if (xml) + xml_insert_element (FLOAT, END); + else + { + if (html) + add_html_block_elt ("<p><strong class=\"float-caption\">"); + else + close_paragraph (); + + no_indent = 1; + + /* Legend: + 1) @float Foo,lbl & no caption: Foo 1.1 + 2) @float Foo & no caption: Foo + 3) @float ,lbl & no caption: 1.1 + 4) @float & no caption: */ + + if (!xml && !html) + indent (current_indent); + + if (strlen (current_float_type ())) + execute_string ("%s", current_float_type ()); + + if (strlen (current_float_id ()) > 0) + { + if (strlen (current_float_type ()) > 0) + add_char (' '); + + add_word (current_float_number ()); + } + + if (strlen (current_float_title ()) > 0) + { + if (strlen (current_float_type ()) > 0 + || strlen (current_float_id ()) > 0) + insert_string (": "); + + execute_string ("%s", current_float_title ()); + } + + /* Indent the following paragraph. */ + inhibit_paragraph_indentation = 0; + + if (html) + add_word ("</strong></p></div>\n"); + else + close_paragraph (); + } + float_active--; + break; + case format: case smallformat: case display: @@ -829,15 +1209,30 @@ end_insertion (type) case quotation: /* @format and @smallformat are the only fixed_width insertion without a change in indentation. */ - if (type != format && type != smallformat) + if (type != format && type != smallformat && type != quotation) + current_indent -= example_indentation_increment; + else if (type == quotation) current_indent -= default_indentation_increment; if (html) - add_word (type == quotation ? "</blockquote>\n" : "</pre>\n"); + { /* The complex code in close_paragraph that kills whitespace + does not function here, since we've inserted non-whitespace + (the </whatever>) before it. The indentation already got + inserted at the end of the last example line, so we have to + delete it, or browsers wind up showing an extra blank line. */ + kill_self_indent (default_indentation_increment); + add_html_block_elt (type == quotation + ? "</blockquote>\n" : "</pre>\n"); + } /* The ending of one of these insertions always marks the - start of a new paragraph. */ - close_insertion_paragraph (); + start of a new paragraph, except for the XML output. */ + if (!xml || docbook) + close_insertion_paragraph (); + + /* </pre> closes paragraph without messing with </p>. */ + if (html && type != quotation) + paragraph_is_open = 0; break; case table: @@ -845,27 +1240,28 @@ end_insertion (type) case vtable: current_indent -= default_indentation_increment; if (html) - add_word ("</dl>\n"); + add_html_block_elt ("</dl>\n"); + close_insertion_paragraph (); break; case itemize: current_indent -= default_indentation_increment; if (html) - add_word ("</ul>\n"); + add_html_block_elt ("</ul>\n"); close_insertion_paragraph (); break; case flushright: force_flush_right--; if (html) - add_word ("</div>\n"); + add_html_block_elt ("</div>\n"); close_insertion_paragraph (); break; /* Handle the @defun insertions with this default clause. */ default: { - enum insertion_type base_type; + int base_type; if (type < defcv || type > defvr) line_error ("end_insertion internal error: type=%d", type); @@ -876,16 +1272,25 @@ end_insertion (type) case deffn: case defvr: case deftp: + case deftypecv: case deftypefn: case deftypevr: case defcv: case defop: - case deftypemethod: - case deftypeop: - case deftypeivar: - if (html) - /* close the tables which has been opened in defun.c */ - add_word ("</td></tr>\n</table>\n"); + case deftypemethod: + case deftypeop: + case deftypeivar: + if (html) + { + if (paragraph_is_open) + add_html_block_elt ("</p>"); + /* close the div and blockquote which has been opened in defun.c */ + if (!rollback_empty_tag ("blockquote")) + add_html_block_elt ("</blockquote>"); + add_html_block_elt ("</div>\n"); + } + if (xml) + xml_end_definition (); break; } /* switch (base_type)... */ @@ -910,8 +1315,7 @@ end_insertion (type) @if... conditionals, otherwise not. This is because conditionals can cross node boundaries. Always happens with the @top node, for example. */ void -discard_insertions (specials_ok) - int specials_ok; +discard_insertions (int specials_ok) { int real_line_number = line_number; while (insertion_stack) @@ -919,17 +1323,19 @@ discard_insertions (specials_ok) if (specials_ok && ((ifclear <= insertion_stack->insertion && insertion_stack->insertion <= iftex) + || insertion_stack->insertion == rawdocbook || insertion_stack->insertion == rawhtml + || insertion_stack->insertion == rawxml || insertion_stack->insertion == rawtex)) break; else { - char *offender = insertion_type_pname (insertion_stack->insertion); + const char *offender = insertion_type_pname (insertion_stack->insertion); file_line_error (insertion_stack->filename, - insertion_stack->line_number, - _("No matching `%cend %s'"), COMMAND_PREFIX, - offender); + insertion_stack->line_number, + _("No matching `%cend %s'"), COMMAND_PREFIX, + offender); pop_insertion (); } } @@ -939,126 +1345,230 @@ discard_insertions (specials_ok) /* Insertion (environment) commands. */ void -cm_quotation () +cm_quotation (void) { - if (xml) - xml_insert_element (QUOTATION, START); + /* We start the blockquote element in the insertion. */ begin_insertion (quotation); } void -cm_example () +cm_example (void) { + if (docbook && current_insertion_type () == floatenv) + xml_begin_docbook_float (FLOATEXAMPLE); + if (xml) - xml_insert_element (EXAMPLE, START); + { + /* Rollback previous newlines. These occur between + </para> and <example>. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + + xml_insert_element (EXAMPLE, START); + + /* Make sure example text is starting on a new line + for improved readability. */ + if (docbook) + add_char ('\n'); + } + begin_insertion (example); } void -cm_smallexample () +cm_smallexample (void) { + if (docbook && current_insertion_type () == floatenv) + xml_begin_docbook_float (FLOATEXAMPLE); + if (xml) - xml_insert_element (SMALLEXAMPLE, START); + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (SMALLEXAMPLE, START); + if (docbook) + add_char ('\n'); + } + begin_insertion (smallexample); } void -cm_lisp () +cm_lisp (void) { + if (docbook && current_insertion_type () == floatenv) + xml_begin_docbook_float (FLOATEXAMPLE); + if (xml) - xml_insert_element (LISP, START); + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (LISP, START); + if (docbook) + add_char ('\n'); + } + begin_insertion (lisp); } void -cm_smalllisp () +cm_smalllisp (void) { + if (docbook && current_insertion_type () == floatenv) + xml_begin_docbook_float (FLOATEXAMPLE); + if (xml) - xml_insert_element (SMALLLISP, START); + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (SMALLLISP, START); + if (docbook) + add_char ('\n'); + } + begin_insertion (smalllisp); } void -cm_cartouche () +cm_cartouche (void) { + if (docbook && current_insertion_type () == floatenv) + xml_begin_docbook_float (CARTOUCHE); + if (xml) xml_insert_element (CARTOUCHE, START); begin_insertion (cartouche); } void -cm_copying () +cm_copying (void) { - if (xml) - xml_insert_element (COPYING, START); begin_insertion (copying); } /* Not an insertion, despite the name, but it goes with cm_copying. */ void -cm_insert_copying () +cm_insert_copying (void) { - if (copying_text) - { /* insert_string rather than add_word because we've already done - full expansion on copying_text when we saved it. */ - insert_string (copying_text); - insert ('\n'); + if (!copying_text) + { + warning ("@copying not used before %s", command); + return; + } + + execute_string ("%s", copying_text); + + if (!xml && !html) + { + add_word ("\n\n"); + /* Update output_position so that the node positions in the tag + tables will take account of the copying text. */ + flush_output (); } } void -cm_format () +cm_format (void) { if (xml) - xml_insert_element (FORMAT, START); + { + if (docbook && xml_in_bookinfo) + { + xml_insert_element (ABSTRACT, START); + xml_in_abstract = 1; + } + else + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (FORMAT, START); + if (docbook) + add_char ('\n'); + } + } begin_insertion (format); } void -cm_smallformat () +cm_smallformat (void) { if (xml) - xml_insert_element (SMALLFORMAT, START); + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (SMALLFORMAT, START); + if (docbook) + add_char ('\n'); + } + begin_insertion (smallformat); } void -cm_display () +cm_display (void) { if (xml) - xml_insert_element (DISPLAY, START); + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (DISPLAY, START); + if (docbook) + add_char ('\n'); + } + begin_insertion (display); } void -cm_smalldisplay () +cm_smalldisplay (void) { if (xml) - xml_insert_element (SMALLDISPLAY, START); + { + /* See cm_example comments about newlines. */ + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + xml_insert_element (SMALLDISPLAY, START); + if (docbook) + add_char ('\n'); + } + begin_insertion (smalldisplay); } void -cm_direntry () +cm_direntry (void) { - if (html || xml) + if (html || xml || no_headers) command_name_condition (); else begin_insertion (direntry); } void -cm_documentdescription () +cm_documentdescription (void) { - if (html || xml) + if (html) begin_insertion (documentdescription); + + else if (xml) + { + xml_insert_element (DOCUMENTDESCRIPTION, START); + begin_insertion (documentdescription); + } + else command_name_condition (); } void -cm_itemize () +cm_itemize (void) { begin_insertion (itemize); } @@ -1066,9 +1576,7 @@ cm_itemize () /* Start an enumeration insertion of type TYPE. If the user supplied no argument on the line, then use DEFAULT_STRING as the initial string. */ static void -do_enumeration (type, default_string) - int type; - char *default_string; +do_enumeration (int type, char *default_string) { get_until_in_line (0, ".", &enumeration_arg); canon_white (enumeration_arg); @@ -1095,7 +1603,7 @@ do_enumeration (type, default_string) } void -cm_enumerate () +cm_enumerate (void) { do_enumeration (enumerate, "1"); } @@ -1109,15 +1617,16 @@ cm_enumerate () verbatim environment may be encapsulated in an @example environment, for example. */ void -handle_verbatim_environment (find_end_verbatim) - int find_end_verbatim; +handle_verbatim_environment (int find_end_verbatim) { int character; int seen_end = 0; int save_filling_enabled = filling_enabled; int save_inhibit_paragraph_indentation = inhibit_paragraph_indentation; + int save_escape_html = escape_html; - close_single_paragraph (); + if (!insertion_stack) + close_single_paragraph (); /* no blank lines if not at outer level */ inhibit_paragraph_indentation = 1; filling_enabled = 0; in_fixed_width_font++; @@ -1129,7 +1638,22 @@ handle_verbatim_environment (find_end_verbatim) */ if (html) - add_word ("<pre>"); + { /* If inside @example, we'll be preceded by the indentation + already. Browsers will ignore those spaces because we're about + to start another <pre> (don't ask me). So, wipe them out for + cleanliness, and re-insert. */ + int i; + kill_self_indent (default_indentation_increment); + add_html_block_elt ("<pre class=\"verbatim\">"); + for (i = current_indent; i > 0; i--) + add_char (' '); + } + else if (xml) + { + xml_insert_element (VERBATIM, START); + escape_html = 0; + add_word ("<![CDATA["); + } while (input_text_offset < input_text_length) { @@ -1137,20 +1661,25 @@ handle_verbatim_environment (find_end_verbatim) if (character == '\n') line_number++; - /* - Assume no newlines in END_VERBATIM - */ + + /* Assume no newlines in END_VERBATIM. */ else if (find_end_verbatim && (character == COMMAND_PREFIX) /* @ */ - && (input_text_length - input_text_offset > sizeof (END_VERBATIM)) - && !strncmp (&input_text[input_text_offset+1], END_VERBATIM, - sizeof (END_VERBATIM)-1)) - { - input_text_offset += sizeof (END_VERBATIM); - seen_end = 1; - break; - } + && (input_text_length - input_text_offset > sizeof (END_VERBATIM)) + && !strncmp (&input_text[input_text_offset+1], END_VERBATIM, + sizeof (END_VERBATIM)-1)) + { + input_text_offset += sizeof (END_VERBATIM); + seen_end = 1; + break; + } + + if (html && character == '&' && escape_html) + add_word ("&"); + else if (html && character == '<' && escape_html) + add_word ("<"); + else + add_char (character); - add_char (character); input_text_offset++; } @@ -1158,7 +1687,16 @@ handle_verbatim_environment (find_end_verbatim) warning (_("end of file inside verbatim block")); if (html) - add_word ("</pre>"); + { /* See comments in example case above. */ + kill_self_indent (default_indentation_increment); + add_word ("</pre>"); + } + else if (xml) + { + add_word ("]]>"); + xml_insert_element (VERBATIM, END); + escape_html = save_escape_html; + } in_fixed_width_font--; filling_enabled = save_filling_enabled; @@ -1166,44 +1704,44 @@ handle_verbatim_environment (find_end_verbatim) } void -cm_verbatim () +cm_verbatim (void) { handle_verbatim_environment (1); } void -cm_table () +cm_table (void) { begin_insertion (table); } void -cm_multitable () +cm_multitable (void) { begin_insertion (multitable); /* @@ */ } void -cm_ftable () +cm_ftable (void) { begin_insertion (ftable); } void -cm_vtable () +cm_vtable (void) { begin_insertion (vtable); } void -cm_group () +cm_group (void) { begin_insertion (group); } /* Insert raw HTML (no escaping of `<' etc.). */ void -cm_html () +cm_html (int arg) { if (process_html) begin_insertion (rawhtml); @@ -1212,7 +1750,43 @@ cm_html () } void -cm_ifhtml () +cm_xml (int arg) +{ + if (process_xml) + begin_insertion (rawxml); + else + command_name_condition (); +} + +void +cm_docbook (int arg) +{ + if (process_docbook) + begin_insertion (rawdocbook); + else + command_name_condition (); +} + +void +cm_ifdocbook (void) +{ + if (process_docbook) + begin_insertion (ifdocbook); + else + command_name_condition (); +} + +void +cm_ifnotdocbook (void) +{ + if (!process_docbook) + begin_insertion (ifnotdocbook); + else + command_name_condition (); +} + +void +cm_ifhtml (void) { if (process_html) begin_insertion (ifhtml); @@ -1221,7 +1795,7 @@ cm_ifhtml () } void -cm_ifnothtml () +cm_ifnothtml (void) { if (!process_html) begin_insertion (ifnothtml); @@ -1231,7 +1805,7 @@ cm_ifnothtml () void -cm_ifinfo () +cm_ifinfo (void) { if (process_info) begin_insertion (ifinfo); @@ -1240,7 +1814,7 @@ cm_ifinfo () } void -cm_ifnotinfo () +cm_ifnotinfo (void) { if (!process_info) begin_insertion (ifnotinfo); @@ -1250,7 +1824,7 @@ cm_ifnotinfo () void -cm_ifplaintext () +cm_ifplaintext (void) { if (process_plaintext) begin_insertion (ifplaintext); @@ -1259,7 +1833,7 @@ cm_ifplaintext () } void -cm_ifnotplaintext () +cm_ifnotplaintext (void) { if (!process_plaintext) begin_insertion (ifnotplaintext); @@ -1269,7 +1843,7 @@ cm_ifnotplaintext () void -cm_tex () +cm_tex (void) { if (process_tex) begin_insertion (rawtex); @@ -1278,7 +1852,7 @@ cm_tex () } void -cm_iftex () +cm_iftex (void) { if (process_tex) begin_insertion (iftex); @@ -1287,17 +1861,74 @@ cm_iftex () } void -cm_ifnottex () +cm_ifnottex (void) { if (!process_tex) begin_insertion (ifnottex); else command_name_condition (); } + +void +cm_ifxml (void) +{ + if (process_xml) + begin_insertion (ifxml); + else + command_name_condition (); +} + +void +cm_ifnotxml (void) +{ + if (!process_xml) + begin_insertion (ifnotxml); + else + command_name_condition (); +} + +/* Generic xrefable block with a caption. */ +void +cm_float (void) +{ + begin_insertion (floatenv); +} + +void +cm_caption (int arg) +{ + char *temp; + + /* This is a no_op command for most formats, as we handle it during @float + insertion. For XML though, we handle it here to keep document structure + as close as possible, to the Texinfo source. */ + + /* Everything is already handled at START. */ + if (arg == END) + return; + + /* Check if it's mislocated. */ + if (current_insertion_type () != floatenv) + line_error (_("@%s not meaningful outside `@float' environment"), command); + + get_until_in_braces ("\n@end float", &temp); + + if (xml) + { + int elt = STREQ (command, "shortcaption") ? SHORTCAPTION : CAPTION; + xml_insert_element (elt, START); + if (!docbook) + execute_string ("%s", temp); + xml_insert_element (elt, END); + } + + free (temp); +} + /* Begin an insertion where the lines are not filled or indented. */ void -cm_flushleft () +cm_flushleft (void) { begin_insertion (flushleft); } @@ -1305,15 +1936,15 @@ cm_flushleft () /* Begin an insertion where the lines are not filled, and each line is forced to the right-hand side of the page. */ void -cm_flushright () +cm_flushright (void) { begin_insertion (flushright); } void -cm_menu () +cm_menu (void) { - if (current_node == NULL) + if (current_node == NULL && !macro_expansion_output_stream) { warning (_("@menu seen before first @node, creating `Top' node")); warning (_("perhaps your @top node should be wrapped in @ifnottex rather than @ifinfo?")); @@ -1324,22 +1955,108 @@ cm_menu () } void -cm_detailmenu () +cm_detailmenu (void) { - if (current_node == NULL) + if (current_node == NULL && !macro_expansion_output_stream) { /* Problems anyway, @detailmenu should always be inside @menu. */ warning (_("@detailmenu seen before first node, creating `Top' node")); execute_string ("@node top\n@top Top\n"); } begin_insertion (detailmenu); } + +/* Title page commands. */ + +void +cm_titlepage (void) +{ + titlepage_cmd_present = 1; + if (xml && !docbook) + begin_insertion (titlepage); + else + command_name_condition (); +} + +void +cm_author (void) +{ + char *rest; + get_rest_of_line (1, &rest); + + if (is_in_insertion_of_type (quotation)) + { + if (html) + add_word_args ("— %s", rest); + else if (docbook) + { + /* FIXME Ideally, we should use an attribution element, + but they are supposed to be at the start of quotation + blocks. So to avoid looking ahead mess, let's just + use mdash like HTML for now. */ + xml_insert_entity ("mdash"); + add_word (rest); + } + else if (xml) + { + xml_insert_element (AUTHOR, START); + add_word (rest); + xml_insert_element (AUTHOR, END); + } + else + add_word_args ("-- %s", rest); + } + else if (is_in_insertion_of_type (titlepage)) + { + if (xml && !docbook) + { + xml_insert_element (AUTHOR, START); + add_word (rest); + xml_insert_element (AUTHOR, END); + } + } + else + line_error (_("@%s not meaningful outside `@titlepage' and `@quotation' environments"), + command); + + free (rest); +} + +void +cm_titlepage_cmds (void) +{ + char *rest; + + get_rest_of_line (1, &rest); + + if (!is_in_insertion_of_type (titlepage)) + line_error (_("@%s not meaningful outside `@titlepage' environment"), + command); + + if (xml && !docbook) + { + int elt = 0; + + if (STREQ (command, "title")) + elt = BOOKTITLE; + else if (STREQ (command, "subtitle")) + elt = BOOKSUBTITLE; + + xml_insert_element (elt, START); + add_word (rest); + xml_insert_element (elt, END); + } + + free (rest); +} /* End existing insertion block. */ void -cm_end () +cm_end (void) { char *temp; - enum insertion_type type; + int type; + + get_rest_of_line (0, &temp); if (!insertion_level) { @@ -1347,8 +2064,6 @@ cm_end () return; } - get_rest_of_line (0, &temp); - if (temp[0] == 0) line_error (_("`%c%s' needs something after it"), COMMAND_PREFIX, command); @@ -1356,8 +2071,8 @@ cm_end () if (type == bad_type) { - line_error (_("Bad argument to `%s', `%s', using `%s'"), - command, temp, insertion_type_pname (current_insertion_type ())); + line_error (_("Bad argument `%s' to `@%s', using `%s'"), + temp, command, insertion_type_pname (current_insertion_type ())); } if (xml && type == menu) /* fixme */ { @@ -1372,9 +2087,8 @@ cm_end () static int itemx_flag = 0; /* Return whether CMD takes a brace-delimited {arg}. */ -/*static */int -command_needs_braces (cmd) - char *cmd; +int +command_needs_braces (char *cmd) { int i; for (i = 0; command_table[i].name; i++) @@ -1388,7 +2102,7 @@ command_needs_braces (cmd) void -cm_item () +cm_item (void) { char *rest_of_line, *item_func; @@ -1425,10 +2139,14 @@ cm_item () case ifnotinfo: case ifnotplaintext: case ifnottex: + case ifnotxml: case ifplaintext: case ifset: case iftex: + case ifxml: + case rawdocbook: case rawhtml: + case rawxml: case rawtex: case tex: case cartouche: @@ -1465,16 +2183,9 @@ cm_item () else { if (html) - { - if (in_paragraph) - { - add_word ("</p>"); - in_paragraph = 0; - } - add_word ("<li>"); - } - else if (xml) - xml_begin_item (); + add_html_block_elt ("<li>"); + else if (xml) + xml_begin_item (); else { start_paragraph (); @@ -1513,12 +2224,12 @@ cm_item () must_start_paragraph = 1; } - /* Handle text directly after the @item. */ - if (*rest_of_line) - { - line_number--; - input_text_offset = original_input_text_offset; - } + /* Handle text directly after the @item. */ + if (*rest_of_line) + { + line_number--; + input_text_offset = original_input_text_offset; + } } break; @@ -1526,34 +2237,28 @@ cm_item () case ftable: case vtable: if (html) - { - static int last_html_output_position = 0; - - /* If nothing has been output since the last <dd>, + { /* If nothing has been output since the last <dd>, remove the empty <dd> element. Some browsers render an extra empty line for <dd><dt>, which makes @itemx conversion look ugly. */ - if (last_html_output_position == output_position - && strncmp ((char *) output_paragraph, "<dd>", - output_paragraph_offset) == 0) - output_paragraph_offset = 0; + rollback_empty_tag ("dd"); /* Force the browser to render one blank line before - each new @item in a table. But don't do that unless + each new @item in a table. But don't do that if this is the first <dt> after the <dl>, or if we are converting @itemx. Note that there are some browsers which ignore <br> in this context, but I cannot find any way to force them all render exactly one blank line. */ - if (!itemx_flag - && (output_paragraph_offset + 1 < sizeof (dl_tag) || - (strncmp ((char *) output_paragraph - + output_paragraph_offset - sizeof (dl_tag) + 1, - dl_tag, sizeof (dl_tag) - 1) != 0))) - add_word ("<br>"); + if (!itemx_flag && html_deflist_has_term) + add_html_block_elt ("<br>"); + + /* We are about to insert a <dt>, so this <dl> has a term. + Feel free to insert a <br> next time. :) */ + html_deflist_has_term = 1; - add_word ("<dt>"); + add_html_block_elt ("<dt>"); if (item_func && *item_func) execute_string ("%s{%s}", item_func, rest_of_line); else @@ -1564,21 +2269,25 @@ cm_item () if (current_insertion_type () == vtable) execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line); - /* Make sure output_position is updated, so we could - remember it. */ - close_single_paragraph (); - last_html_output_position = output_position; - add_word ("<dd>"); + + add_html_block_elt ("<dd>"); } - else if (xml) /* && docbook)*/ /* 05-08 */ - { - xml_begin_table_item (); + else if (xml) /* && docbook)*/ /* 05-08 */ + { + xml_begin_table_item (); + + if (!docbook && current_insertion_type () == ftable) + execute_string ("%cfindex %s\n", COMMAND_PREFIX, rest_of_line); + + if (!docbook && current_insertion_type () == vtable) + execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line); + if (item_func && *item_func) execute_string ("%s{%s}", item_func, rest_of_line); else execute_string ("%s", rest_of_line); - xml_continue_table_item (); - } + xml_continue_table_item (); + } else { /* We need this to determine if we have two @item's in a row @@ -1650,9 +2359,18 @@ cm_item () } void -cm_itemx () +cm_itemx (void) { itemx_flag++; cm_item (); itemx_flag--; } + +int headitem_flag = 0; + +void +cm_headitem (void) +{ + headitem_flag = 1; + cm_item (); +} diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c index d0aab040ddb..c946a945986 100644 --- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c @@ -1,8 +1,8 @@ /* makeinfo -- convert Texinfo source into other formats. - $Id: makeinfo.c,v 1.7 2002/06/10 13:51:03 espie Exp $ + $Id: makeinfo.c,v 1.8 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02 - Free Software Foundation, Inc. + Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Makeinfo was authored by Brian Fox (bfox@ai.mit.edu). */ + Original author of makeinfo: Brian Fox (bfox@ai.mit.edu). */ #include "system.h" #include "getopt.h" @@ -27,12 +27,15 @@ #include "makeinfo.h" #include "cmds.h" #include "files.h" +#include "float.h" #include "footnote.h" #include "html.h" #include "index.h" #include "insertion.h" +#include "lang.h" #include "macro.h" #include "node.h" +#include "sectioning.h" #include "toc.h" #include "xml.h" @@ -68,10 +71,6 @@ char *output_filename = NULL; char *command_output_filename = NULL; static char *save_command_output_filename = NULL; -/* Flags which control initial output string for xrefs. */ -int px_ref_flag = 0; -int ref_flag = 0; - #define INITIAL_PARAGRAPH_SPACE 5000 int paragraph_buffer_len = INITIAL_PARAGRAPH_SPACE; @@ -134,6 +133,16 @@ int do_justification = 0; /* Nonzero means don't replace whitespace with in HTML mode. */ int in_html_elt = 0; +/* Nonzero means we are inserting a block level HTML element that must not be + enclosed in a <p>, such as <ul>, <ol> and <h?>. */ +int in_html_block_level_elt = 0; + +/* True when expanding a macro definition. */ +static int executing_macro = 0; + +/* True when we are inside a <li> block of a menu. */ +static int in_menu_item = 0; + typedef struct brace_element { struct brace_element *next; @@ -145,67 +154,44 @@ typedef struct brace_element BRACE_ELEMENT *brace_stack = NULL; -extern void do_multitable (), end_multitable (); - -void push_node_filename (), pop_node_filename (); -void remember_error (); -void convert_from_stream (), convert_from_file (), convert_from_loaded_file (); -void init_internals (), init_paragraph (), init_brace_stack (); -void init_insertion_stack (), init_indices (); -void init_tag_table (), write_tag_table (), write_tag_table_internal (); -void validate_file (), validate_other_references (), split_file (); -void free_node_references (), handle_variable (); -void handle_variable_internal (); -void normalize_node_name (); -void add_anchor_name (); -void free_node_node_references (), remember_node_node_reference (); - -char **get_brace_args (); -int array_len (); -void free_array (); -static int end_of_sentence_p (); -static void isolate_nodename (); -void reader_loop (); -void remember_brace (), remember_brace_1 (); -void pop_and_call_brace (), discard_braces (); -void add_word (), add_char (), insert (), flush_output (); -void insert_string (); -void close_paragraph (); -void ignore_blank_line (); -void do_flush_right_indentation (), discard_insertions (); -void start_paragraph (), indent (); -void inhibit_output_flushing (), uninhibit_output_flushing (); -int set_paragraph_indent (); -int self_delimiting (), search_forward (); -int multitable_item (), number_of_node (); -extern void add_link (), add_escaped_anchor_name (); - -void me_execute_string_keep_state (); -void maybe_update_execution_strings (); - -extern char *escape_string (); -extern void insert_html_tag (); -extern void sectioning_html (); -extern void add_link (); - -#if defined (VA_FPRINTF) && __STDC__ -/* Unfortunately we must use prototypes if we are to use <stdarg.h>. */ -void add_word_args (char *, ...); -void execute_string (char *, ...); -#else -void add_word_args (); -void execute_string (); -#endif /* no prototypes */ +static void convert_from_file (char *name); +static void convert_from_loaded_file (char *name); +static void convert_from_stream (FILE *stream, char *name); +static void do_flush_right_indentation (void); +static void handle_variable (int action); +static void handle_variable_internal (int action, char *name); +static void init_brace_stack (void); +static void init_internals (void); +static void pop_and_call_brace (void); +static void remember_brace (COMMAND_FUNCTION (*proc)); +static int end_of_sentence_p (void); + +void maybe_update_execution_strings (char **text, unsigned int new_len); /* Error handling. */ /* Number of errors encountered. */ int errors_printed = 0; +/* Remember that an error has been printed. If more than + max_error_level have been printed, then exit the program. */ +static void +remember_error (void) +{ + errors_printed++; + if (max_error_level && (errors_printed > max_error_level)) + { + fprintf (stderr, _("Too many errors! Gave up.\n")); + flush_file_stack (); + if (errors_printed - max_error_level < 2) + cm_bye (); + xexit (1); + } +} + /* Print the last error gotten from the file system. */ int -fs_error (filename) - char *filename; +fs_error (char *filename) { remember_error (); perror (filename); @@ -215,10 +201,10 @@ fs_error (filename) /* Print an error message, and return false. */ void #if defined (VA_FPRINTF) && __STDC__ -error (char *format, ...) +error (const char *format, ...) #else error (format, va_alist) - char *format; + const char *format; va_dcl #endif { @@ -242,12 +228,12 @@ error (format, va_alist) /* Just like error (), but print the input file and line number as well. */ void #if defined (VA_FPRINTF) && __STDC__ -file_line_error (char *infile, int lno, char *format, ...) +file_line_error (char *infile, int lno, const char *format, ...) #else file_line_error (infile, lno, format, va_alist) char *infile; int lno; - char *format; + const char *format; va_dcl #endif { @@ -273,10 +259,10 @@ file_line_error (infile, lno, format, va_alist) number from global variables. */ void #if defined (VA_FPRINTF) && __STDC__ -line_error (char *format, ...) +line_error (const char *format, ...) #else line_error (format, va_alist) - char *format; + const char *format; va_dcl #endif { @@ -300,10 +286,10 @@ line_error (format, va_alist) void #if defined (VA_FPRINTF) && __STDC__ -warning (char *format, ...) +warning (const char *format, ...) #else warning (format, va_alist) - char *format; + const char *format; va_dcl #endif { @@ -328,24 +314,9 @@ warning (format, va_alist) } -/* Remember that an error has been printed. If more than - max_error_level have been printed, then exit the program. */ -void -remember_error () -{ - errors_printed++; - if (max_error_level && (errors_printed > max_error_level)) - { - fprintf (stderr, _("Too many errors! Gave up.\n")); - flush_file_stack (); - cm_bye (); - xexit (1); - } -} - /* The other side of a malformed expression. */ -void -misplaced_brace () +static void +misplaced_brace (void) { line_error (_("Misplaced %c"), '}'); } @@ -354,7 +325,7 @@ misplaced_brace () /* Display the version info of this invocation of Makeinfo. */ static void -print_version_info () +print_version_info (void) { printf ("makeinfo (GNU %s) %s\n", PACKAGE, VERSION); } @@ -363,15 +334,14 @@ print_version_info () Otherwise, just say to use --help for more info. Then exit with EXIT_VALUE. */ static void -usage (exit_value) - int exit_value; +usage (int exit_value) { if (exit_value != 0) fprintf (stderr, _("Try `%s --help' for more information.\n"), progname); else { printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n"), progname); - printf ("\n"); + puts (""); puts (_("\ Translate Texinfo source documentation to various other formats, by default\n\ @@ -388,17 +358,18 @@ General options:\n\ -v, --verbose explain what is being done.\n\ --version display version information and exit.\n"), max_error_level, reference_warning_limit); - printf ("\n"); + puts (""); /* xgettext: no-wrap */ - puts (_("\ + puts (_("\ Output format selection (default is to produce Info):\n\ - --docbook output DocBook rather than Info.\n\ + --docbook output Docbook XML rather than Info.\n\ --html output HTML rather than Info.\n\ - --xml output XML (TexinfoML) rather than Info.\n\ + --xml output Texinfo XML rather than Info.\n\ + --plaintext output plain text rather than Info.\n\ ")); - puts (_("\ + puts (_("\ General output options:\n\ -E, --macro-expand FILE output macro-expanded source to FILE.\n\ ignoring any @setfilename.\n\ @@ -412,7 +383,7 @@ General output options:\n\ -o, --output=FILE output to FILE (directory if split HTML),\n\ ")); - printf (_("\ + printf (_("\ Options for Info and plain text:\n\ --enable-encoding output accented and special characters in\n\ Info output based on @documentencoding.\n\ @@ -427,42 +398,62 @@ Options for Info and plain text:\n\ --split-size=NUM split Info files at size NUM (default %d).\n"), fill_column, paragraph_start_indent, DEFAULT_SPLIT_SIZE); - } - printf ("\n"); + puts (""); - puts (_("\ + puts (_("\ +Options for HTML:\n\ + --css-include=FILE include FILE in HTML <style> output;\n\ + read stdin if FILE is -.\n\ +")); + + printf (_("\ +Options for XML and Docbook:\n\ + --output-indent=VAL indent XML elements by VAL spaces (default %d).\n\ + If VAL is 0, ignorable whitespace is dropped.\n\ +"), xml_indentation_increment); + puts (""); + + puts (_("\ Input file options:\n\ - --commands-in-node-names allow @ commands in node names.\n\ - -D VAR define the variable VAR, as with @set.\n\ - -I DIR append DIR to the @include search path.\n\ - -P DIR prepend DIR to the @include search path.\n\ - -U VAR undefine the variable VAR, as with @clear.\n\ + --commands-in-node-names allow @ commands in node names.\n\ + -D VAR define the variable VAR, as with @set.\n\ + -I DIR append DIR to the @include search path.\n\ + -P DIR prepend DIR to the @include search path.\n\ + -U VAR undefine the variable VAR, as with @clear.\n\ ")); - puts (_("\ + puts (_("\ Conditional processing in input:\n\ + --ifdocbook process @ifdocbook and @docbook even if\n\ + not generating Docbook.\n\ --ifhtml process @ifhtml and @html even if not generating HTML.\n\ --ifinfo process @ifinfo even if not generating Info.\n\ --ifplaintext process @ifplaintext even if not generating plain text.\n\ --iftex process @iftex and @tex; implies --no-split.\n\ + --ifxml process @ifxml and @xml.\n\ + --no-ifdocbook do not process @ifdocbook and @docbook text.\n\ --no-ifhtml do not process @ifhtml and @html text.\n\ --no-ifinfo do not process @ifinfo text.\n\ --no-ifplaintext do not process @ifplaintext text.\n\ --no-iftex do not process @iftex and @tex text.\n\ + --no-ifxml do not process @ifxml and @xml text.\n\ +\n\ + Also, for the --no-ifFORMAT options, do process @ifnotFORMAT text.\n\ ")); - puts (_("\ + puts (_("\ The defaults for the @if... conditionals depend on the output format:\n\ if generating HTML, --ifhtml is on and the others are off;\n\ if generating Info, --ifinfo is on and the others are off;\n\ if generating plain text, --ifplaintext is on and the others are off;\n\ + if generating XML, --ifxml is on and the others are off.\n\ ")); - fputs (_("\ + fputs (_("\ Examples:\n\ makeinfo foo.texi write Info to foo's @setfilename\n\ makeinfo --html foo.texi write HTML to @setfilename\n\ - makeinfo --xml foo.texi write XML to @setfilename\n\ + makeinfo --xml foo.texi write Texinfo XML to @setfilename\n\ makeinfo --docbook foo.texi write DocBook XML to @setfilename\n\ makeinfo --no-headers foo.texi write plain text to standard output\n\ \n\ @@ -471,17 +462,20 @@ Examples:\n\ makeinfo --no-split foo.texi write one Info file however big\n\ "), stdout); - puts (_("\n\ + puts (_("\n\ Email bug reports to bug-texinfo@gnu.org,\n\ general questions and discussion to help-texinfo@gnu.org.\n\ Texinfo home page: http://www.gnu.org/software/texinfo/")); + } /* end of full help */ + xexit (exit_value); } struct option long_options[] = { { "commands-in-node-names", 0, &expensive_validation, 1 }, + { "css-include", 1, 0, 'C' }, { "docbook", 0, 0, 'd' }, { "enable-encoding", 0, &enable_encoding, 1 }, { "error-limit", 1, 0, 'e' }, @@ -490,16 +484,20 @@ struct option long_options[] = { "force", 0, &force, 1 }, { "help", 0, 0, 'h' }, { "html", 0, 0, 'w' }, + { "ifdocbook", 0, &process_docbook, 1 }, { "ifhtml", 0, &process_html, 1 }, { "ifinfo", 0, &process_info, 1 }, { "ifplaintext", 0, &process_plaintext, 1 }, { "iftex", 0, &process_tex, 1 }, + { "ifxml", 0, &process_xml, 1 }, { "macro-expand", 1, 0, 'E' }, { "no-headers", 0, &no_headers, 1 }, + { "no-ifdocbook", 0, &process_docbook, 0 }, { "no-ifhtml", 0, &process_html, 0 }, { "no-ifinfo", 0, &process_info, 0 }, { "no-ifplaintext", 0, &process_plaintext, 0 }, { "no-iftex", 0, &process_tex, 0 }, + { "no-ifxml", 0, &process_xml, 0 }, { "no-number-footnotes", 0, &number_footnotes, 0 }, { "no-number-sections", 0, &number_sections, 0 }, { "no-pointer-validate", 0, &validating, 0 }, @@ -509,7 +507,9 @@ struct option long_options[] = { "number-footnotes", 0, &number_footnotes, 1 }, { "number-sections", 0, &number_sections, 1 }, { "output", 1, 0, 'o' }, + { "output-indent", 1, 0, 'i' }, { "paragraph-indent", 1, 0, 'p' }, + { "plaintext", 0, 0, 't' }, { "reference-limit", 1, 0, 'r' }, { "split-size", 1, 0, 'S'}, { "verbose", 0, &verbose_mode, 1 }, @@ -518,14 +518,24 @@ struct option long_options[] = {NULL, 0, NULL, 0} }; +/* We use handle_variable_internal for -D and -U, and it depends on + execute_string, which depends on input_filename, which is not defined + while we are handling options. :-\ So we save these defines in this + struct, and handle them later. */ +typedef struct command_line_define +{ + struct command_line_define *next; + int action; + char *define; +} COMMAND_LINE_DEFINE; + +static COMMAND_LINE_DEFINE *command_line_defines = NULL; + /* For each file mentioned in the command line, process it, turning Texinfo commands into wonderfully formatted output text. */ int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { - extern int errors_printed; int c, ind; int reading_from_stdin = 0; @@ -533,17 +543,69 @@ main (argc, argv) /* Do not use LC_ALL, because LC_NUMERIC screws up the scanf parsing of the argument to @multicolumn. */ setlocale (LC_TIME, ""); +#ifdef LC_MESSAGES /* ultrix */ setlocale (LC_MESSAGES, ""); +#endif setlocale (LC_CTYPE, ""); setlocale (LC_COLLATE, ""); #endif +#ifdef ENABLE_NLS /* Set the text message domain. */ bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); +#endif + + /* If TEXINFO_OUTPUT_FORMAT envvar is set, use it to set default output. + Can be overridden with one of the output options. */ + if (getenv ("TEXINFO_OUTPUT_FORMAT") != NULL) + { + if (STREQ (getenv ("TEXINFO_OUTPUT_FORMAT"), "docbook")) + { + splitting = 0; + html = 0; + docbook = 1; + xml = 1; + process_docbook = 1; + } + else if (STREQ (getenv ("TEXINFO_OUTPUT_FORMAT"), "html")) + { + html = 1; + docbook = 0; + xml = 0; + process_html = 1; + } + else if (STREQ (getenv ("TEXINFO_OUTPUT_FORMAT"), "info")) + { + html = 0; + docbook = 0; + xml = 0; + } + else if (STREQ (getenv ("TEXINFO_OUTPUT_FORMAT"), "plaintext")) + { + splitting = 0; + no_headers = 1; + html = 0; + docbook = 0; + xml = 0; + process_plaintext = 1; + } + else if (STREQ (getenv ("TEXINFO_OUTPUT_FORMAT"), "xml")) + { + splitting = 0; + html = 0; + docbook = 0; + xml = 1; + process_xml = 1; + } + else + fprintf (stderr, + _("%s: Ignoring unrecognized TEXINFO_OUTPUT_FORMAT value `%s'.\n"), + progname, getenv ("TEXINFO_OUTPUT_FORMAT")); + } /* Parse argument flags from the input line. */ - while ((c = getopt_long (argc, argv, "D:de:E:f:hI:o:p:P:r:s:U:vV:wx", + while ((c = getopt_long (argc, argv, "D:de:E:f:hI:i:o:p:P:r:s:t:U:vV:wx", long_options, &ind)) != EOF) { if (c == 0 && long_options[ind].flag == 0) @@ -551,16 +613,31 @@ main (argc, argv) switch (c) { + case 'C': /* --css-include */ + css_include = xstrdup (optarg); + break; + case 'D': case 'U': /* User specified variable to set or clear. */ - handle_variable_internal ((c == 'D') ? SET : CLEAR, optarg); + if (xml && !docbook) + { + COMMAND_LINE_DEFINE *new = xmalloc (sizeof (COMMAND_LINE_DEFINE)); + new->action = (c == 'D') ? SET : CLEAR; + new->define = xstrdup (optarg); + new->next = command_line_defines; + command_line_defines = new; + } + else + handle_variable_internal ((c == 'D' ? SET : CLEAR), optarg); break; case 'd': /* --docbook */ splitting = 0; - xml = 1; - docbook = 1; + xml = 1; + docbook = 1; + html = 0; + process_docbook = 1; break; case 'e': /* --error-limit */ @@ -568,7 +645,7 @@ main (argc, argv) { fprintf (stderr, _("%s: %s arg must be numeric, not `%s'.\n"), - "--error-limit", progname, optarg); + progname, "--error-limit", optarg); usage (1); } break; @@ -580,10 +657,13 @@ main (argc, argv) macro_expansion_output_stream = strcmp (optarg, "-") == 0 ? stdout : fopen (optarg, "w"); if (!macro_expansion_output_stream) - error (_("Couldn't open macro expansion output `%s'"), optarg); + error (_("%s: could not open macro expansion output `%s'"), + progname, optarg); } else - error (_("Cannot specify more than one macro expansion output")); + fprintf (stderr, + _("%s: ignoring second macro expansion output `%s'.\n"), + progname, optarg); break; case 'f': /* --fill-column */ @@ -591,7 +671,7 @@ main (argc, argv) { fprintf (stderr, _("%s: %s arg must be numeric, not `%s'.\n"), - "--fill-column", progname, optarg); + progname, "--fill-column", optarg); usage (1); } break; @@ -602,14 +682,17 @@ main (argc, argv) case 'I': /* Append user-specified dir to include file path. */ - if (!include_files_path) - include_files_path = xstrdup ("."); - - include_files_path = (char *) - xrealloc (include_files_path, - 2 + strlen (include_files_path) + strlen (optarg)); - strcat (include_files_path, PATH_SEP); - strcat (include_files_path, optarg); + append_to_include_path (optarg); + break; + + case 'i': + if (sscanf (optarg, "%d", &xml_indentation_increment) != 1) + { + fprintf (stderr, + _("%s: %s arg must be numeric, not `%s'.\n"), + progname, "--output-indent", optarg); + usage (1); + } break; case 'o': /* --output */ @@ -629,23 +712,7 @@ main (argc, argv) case 'P': /* Prepend user-specified include dir to include path. */ - if (!include_files_path) - { - include_files_path = xstrdup (optarg); - include_files_path = xrealloc (include_files_path, - strlen (include_files_path) + 3); /* 3 for ":.\0" */ - strcat (strcat (include_files_path, PATH_SEP), "."); - } - else - { - char *tmp = xstrdup (include_files_path); - include_files_path = xrealloc (include_files_path, - strlen (include_files_path) + strlen (optarg) + 2); /* 2 for ":\0" */ - strcpy (include_files_path, optarg); - strcat (include_files_path, ":"); - strcat (include_files_path, tmp); - free (tmp); - } + prepend_to_include_path (optarg); break; case 'r': /* --reference-limit */ @@ -653,7 +720,7 @@ main (argc, argv) { fprintf (stderr, _("%s: %s arg must be numeric, not `%s'.\n"), - "--reference-limit", progname, optarg); + progname, "--reference-limit", optarg); usage (1); } break; @@ -662,22 +729,31 @@ main (argc, argv) if (set_footnote_style (optarg) < 0) { fprintf (stderr, - _("%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"), + _("%s: --footnote-style arg must be `separate' or `end', not `%s'.\n"), progname, optarg); usage (1); } footnote_style_preset = 1; break; - case 'S': /* --split-size */ + case 'S': /* --split-size */ if (sscanf (optarg, "%d", &split_size) != 1) { fprintf (stderr, _("%s: %s arg must be numeric, not `%s'.\n"), - "--split-size", progname, optarg); + progname, "--split-size", optarg); usage (1); } - break; + break; + + case 't': /* --plaintext */ + splitting = 0; + no_headers = 1; + html = 0; + docbook = 0; + xml = 0; + process_plaintext = 1; + break; case 'v': verbose_mode++; @@ -686,30 +762,37 @@ main (argc, argv) case 'V': /* --version */ print_version_info (); puts (""); - printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\ -There is NO warranty. You may redistribute this software\n\ + puts ("Copyright (C) 2004 Free Software Foundation, Inc."); + printf (_("There is NO warranty. You may redistribute this software\n\ under the terms of the GNU General Public License.\n\ -For more information about these matters, see the files named COPYING.\n"), - "2002"); - exit (0); +For more information about these matters, see the files named COPYING.\n")); + xexit (0); break; case 'w': /* --html */ + xml = 0; + docbook = 0; html = 1; process_html = 1; break; case 'x': /* --xml */ splitting = 0; - xml = 1; + html = 0; + docbook = 0; + xml = 1; + process_xml = 1; break; - + case '?': usage (1); break; } } + if (macro_expansion_output_stream) + validating = 0; + if (!validating) expensive_validation = 0; @@ -727,22 +810,22 @@ For more information about these matters, see the files named COPYING.\n"), if (no_headers) { - if (html && splitting) + /* If the user did not specify an output file, use stdout. */ + if (!command_output_filename) + command_output_filename = xstrdup ("-"); + + if (html && splitting && !STREQ (command_output_filename, "-")) { /* --no-headers --no-split --html indicates confusion. */ fprintf (stderr, - "%s: --no-headers conflicts with --no-split for --html.\n", - progname); + "%s: can't split --html output to `%s' with --no-headers.\n", + progname, command_output_filename); usage (1); } /* --no-headers implies --no-split. */ splitting = 0; - - /* If the user did not specify an output file, use stdout. */ - if (!command_output_filename) - command_output_filename = xstrdup ("-"); } - + if (process_info == -1) { /* no explicit --[no-]ifinfo option, so we'll do @ifinfo if we're generating info or (for compatibility) plain text. */ @@ -754,7 +837,7 @@ For more information about these matters, see the files named COPYING.\n"), if we're generating plain text. */ process_plaintext = no_headers && !html && !xml; } - + if (verbose_mode) print_version_info (); @@ -768,15 +851,28 @@ For more information about these matters, see the files named COPYING.\n"), else convert_from_stream (stdin, "stdin"); - return errors_printed ? 2 : 0; + xexit (errors_printed ? 2 : 0); + return 0; /* Avoid bogus warnings. */ } - /* Hacking tokens and strings. */ -/* Return the next token as a string pointer. We cons the string. */ -char * -read_token () +/* Return the next token as a string pointer. We cons the string. This + `token' means simply a command name. */ + +/* = is so @alias works. ^ and _ are so macros can be used in math mode + without a space following. Possibly we should simply allow alpha, to + be compatible with TeX. */ +#define COMMAND_CHAR(c) (!cr_or_whitespace(c) \ + && (c) != '{' \ + && (c) != '}' \ + && (c) != '=' \ + && (c) != '_' \ + && (c) != '^' \ + ) + +static char * +read_token (void) { int i, character; char *result; @@ -798,7 +894,7 @@ read_token () for (i = 0; ((input_text_offset != input_text_length) && (character = curchar ()) - && command_char (character)); + && COMMAND_CHAR (character)); i++, input_text_offset++); result = xmalloc (i + 1); memcpy (result, &input_text[input_text_offset - i], i); @@ -808,45 +904,44 @@ read_token () /* Return nonzero if CHARACTER is self-delimiting. */ int -self_delimiting (character) - int character; +self_delimiting (int character) { /* @; and @\ are not Texinfo commands, but they are listed here anyway. I don't know why. --karl, 10aug96. */ - return strchr ("~{|}`^\\@?=;:.-,*\'\" !\n\t", character) != NULL; + return strchr ("~{|}`^\\@?=;:./-,*\'\" !\n\t", character) != NULL; } /* Clear whitespace from the front and end of string. */ void -canon_white (string) - char *string; +canon_white (char *string) { - int len = strlen (string); - int x; + char *p = string; + unsigned len; - if (!len) + if (!*p) return; - for (x = 0; x < len; x++) + do { - if (!cr_or_whitespace (string[x])) - { - strcpy (string, string + x); - break; - } + if (!cr_or_whitespace (*p)) + break; + ++p; } - len = strlen (string); - if (len) - len--; - while (len > -1 && cr_or_whitespace (string[len])) - len--; - string[len + 1] = 0; + while (*p); + + len = strlen (p); + while (len && cr_or_whitespace (p[len-1])) + --len; + + if (p != string) + memmove (string, p, len); + + string[len] = 0; } /* Bash STRING, replacing all whitespace with just one space. */ void -fix_whitespace (string) - char *string; +fix_whitespace (char *string) { char *temp = xmalloc (strlen (string) + 1); int string_index = 0; @@ -876,8 +971,7 @@ fix_whitespace (string) /* Discard text until the desired string is found. The string is included in the discarded text. */ void -discard_until (string) - char *string; +discard_until (char *string) { int temp = search_forward (string, input_text_offset); @@ -891,18 +985,26 @@ discard_until (string) if (temp < 0) { - input_text_offset = input_text_length - strlen (string); - + /* not found, move current position to end of string */ + input_text_offset = input_text_length; if (strcmp (string, "\n") != 0) - { - line_error (_("Expected `%s'"), string); + { /* Give a more descriptive feedback, if we are looking for ``@end '' + during macro execution. That means someone used a multiline + command as an argument to, say, @section ... style commands. */ + char *end_block = xmalloc (8); + sprintf (end_block, "\n%cend ", COMMAND_PREFIX); + if (executing_string && strstr (string, end_block)) + line_error (_("Multiline command %c%s used improperly"), + COMMAND_PREFIX, command); + else + line_error (_("Expected `%s'"), string); + free (end_block); return; } } else - input_text_offset = temp; - - input_text_offset += strlen (string); + /* found, move current position to after the found string */ + input_text_offset = temp + strlen (string); } /* Read characters from the file until we are at MATCH. @@ -910,8 +1012,7 @@ discard_until (string) On exit input_text_offset is after the match string. Return the offset where the string starts. */ int -get_until (match, string) - char *match, **string; +get_until (char *match, char **string) { int len, current_point, x, new_point, tem; @@ -944,8 +1045,7 @@ get_until (match, string) /* Replace input_text[FROM .. TO] with its expansion. */ void -replace_with_expansion (from, to) - int from, *to; +replace_with_expansion (int from, int *to) { char *xp; unsigned xp_len, new_len; @@ -1021,9 +1121,7 @@ replace_with_expansion (from, to) expand the text before looking for MATCH for those cases where MATCH might be produced by some macro. */ void -get_until_in_line (expand, match, string) - int expand; - char *match, **string; +get_until_in_line (int expand, char *match, char **string) { int real_bottom = input_text_length; int limit = search_forward ("\n", input_text_offset); @@ -1055,9 +1153,7 @@ get_until_in_line (expand, match, string) } void -get_rest_of_line (expand, string) - int expand; - char **string; +get_rest_of_line (int expand, char **string) { xml_no_para ++; if (expand) @@ -1065,7 +1161,7 @@ get_rest_of_line (expand, string) char *tem; /* Don't expand non-macros in input, since we want them - intact in the macro-expanded output. */ + intact in the macro-expanded output. */ only_macro_expansion++; get_until_in_line (1, "\n", &tem); only_macro_expansion--; @@ -1088,7 +1184,7 @@ get_rest_of_line (expand, string) /* Backup the input pointer to the previous character, keeping track of the current line number. */ void -backup_input_pointer () +backup_input_pointer (void) { if (input_text_offset) { @@ -1101,8 +1197,7 @@ backup_input_pointer () /* Read characters from the file until we are at MATCH or closing brace. Place the characters read into STRING. */ void -get_until_in_braces (match, string) - char *match, **string; +get_until_in_braces (char *match, char **string) { char *temp; int i, brace = 0; @@ -1112,7 +1207,7 @@ get_until_in_braces (match, string) { if (i < input_text_length - 1 && input_text[i] == '@') { - i++; /* skip commands like @, and @{ */ + i++; /* skip commands like @, and @{ */ continue; } else if (input_text[i] == '{') @@ -1140,6 +1235,8 @@ get_until_in_braces (match, string) input_text_offset = i; *string = temp; } + + /* Converting a file. */ @@ -1157,8 +1254,8 @@ static char *suffixes[] = { NULL }; -void -initialize_conversion () +static void +initialize_conversion (void) { init_tag_table (); init_indices (); @@ -1172,16 +1269,11 @@ initialize_conversion () output_position = 0; } -typedef struct generic_list { - struct generic_list *next; -} GENERIC_LIST; - /* Reverse the chain of structures in LIST. Output the new head of the chain. You should always assign the output value of this function to something, or you will lose the chain. */ GENERIC_LIST * -reverse_list (list) - GENERIC_LIST *list; +reverse_list (GENERIC_LIST *list) { GENERIC_LIST *next; GENERIC_LIST *prev = NULL; @@ -1202,10 +1294,8 @@ reverse_list (list) /* Convert the Texinfo file coming from the open stream STREAM. Assume the source of the stream is named NAME. */ -void -convert_from_stream (stream, name) - FILE *stream; - char *name; +static void +convert_from_stream (FILE *stream, char *name) { char *buffer = NULL; int buffer_offset = 0, buffer_size = 0; @@ -1252,13 +1342,15 @@ convert_from_stream (stream, name) convert_from_loaded_file (name); } -void -convert_from_file (name) - char *name; +static void +convert_from_file (char *name) { int i; char *filename = xmalloc (strlen (name) + 50); + /* Prepend file directory to the search path, so relative links work. */ + prepend_to_include_path (pathname_part (name)); + initialize_conversion (); /* Try to load the file specified by NAME, concatenated with our @@ -1269,7 +1361,7 @@ convert_from_file (name) strcpy (filename, name); strcat (filename, suffixes[i]); - if (find_and_load (filename)) + if (find_and_load (filename, 1)) break; if (!suffixes[i][0] && strrchr (filename, '.')) @@ -1290,33 +1382,63 @@ convert_from_file (name) input_filename = filename; convert_from_loaded_file (name); + + /* Pop the prepended path, so multiple filenames in the + command line do not screw each others include paths. */ + pop_path_from_include_path (); +} + +static int +create_html_directory (char *dir, int can_remove_file) +{ + struct stat st; + + /* Already exists. */ + if (stat (dir, &st) == 0) + { + /* And it's a directory, so silently reuse it. */ + if (S_ISDIR (st.st_mode)) + return 1; + /* Not a directory, so move it out of the way if we are allowed. */ + else if (can_remove_file) + { + if (unlink (dir) != 0) + return 0; + } + else + return 0; + } + + if (mkdir (dir, 0777) == 0) + /* Success! */ + return 1; + else + return 0; } /* Given OUTPUT_FILENAME == ``/foo/bar/baz.html'', return "/foo/bar/baz/baz.html". This routine is called only if html && splitting. - + Split html output goes into the subdirectory of the toplevel filename, without extension. For example: @setfilename foo.info produces output in files foo/index.html, foo/second-node.html, ... - + But if the user said -o foo.whatever on the cmd line, then use foo.whatever unchanged. */ static char * -insert_toplevel_subdirectory (output_filename) - char *output_filename; +insert_toplevel_subdirectory (char *output_filename) { + static const char index_name[] = "index.html"; char *dir, *subdir, *base, *basename, *p; char buf[PATH_MAX]; - struct stat st; - static const char index_name[] = "index.html"; const int index_len = sizeof (index_name) - 1; strcpy (buf, output_filename); - dir = pathname_part (buf); - base = filename_part (buf); - basename = xstrdup (base); /* remember real @setfilename name */ + dir = pathname_part (buf); /* directory of output_filename */ + base = filename_part (buf); /* strips suffix, too */ + basename = xstrdup (base); /* remember real @setfilename name */ p = dir + strlen (dir) - 1; if (p > dir && IS_SLASH (*p)) *p = 0; @@ -1325,60 +1447,49 @@ insert_toplevel_subdirectory (output_filename) *p = 0; /* Split html output goes into subdirectory of toplevel name. */ - subdir = ""; - if (FILENAME_CMP (base, filename_part (dir)) != 0) - { - if (save_command_output_filename - && STREQ (output_filename, save_command_output_filename)) - subdir = basename; /* from user, use unchanged */ - else - subdir = base; /* implicit, omit suffix */ - } + if (save_command_output_filename + && STREQ (output_filename, save_command_output_filename)) + subdir = basename; /* from user, use unchanged */ + else + subdir = base; /* implicit, omit suffix */ free (output_filename); output_filename = xmalloc (strlen (dir) + 1 - + strlen (basename) + 1 - + index_len - + 1); + + strlen (basename) + 1 + + index_len + + 1); strcpy (output_filename, dir); if (strlen (dir)) strcat (output_filename, "/"); strcat (output_filename, subdir); - if (mkdir (output_filename, 0777) == -1 && errno != EEXIST - /* output_filename might exist, but be a non-directory. */ - || (stat (output_filename, &st) == 0 && !S_ISDIR (st.st_mode))) - { /* that failed, try subdir name with .html */ + + /* First try, do not remove existing file. */ + if (!create_html_directory (output_filename, 0)) + { + /* That failed, try subdir name with .html. + Remove it if it exists. */ strcpy (output_filename, dir); if (strlen (dir)) strcat (output_filename, "/"); strcat (output_filename, basename); - if (mkdir (output_filename, 0777) == -1) - { - char *errmsg = strerror (errno); - if ((errno == EEXIST -#ifdef __MSDOS__ - || errno == EACCES -#endif - ) - && (stat (output_filename, &st) == 0 && !S_ISDIR (st.st_mode))) - errmsg = _("File exists, but is not a directory"); + if (!create_html_directory (output_filename, 1)) + { + /* Last try failed too :-\ */ line_error (_("Can't create directory `%s': %s"), - output_filename, errmsg); - exit (1); + output_filename, strerror (errno)); + xexit (1); } - strcat (output_filename, "/"); } - else if (strlen (subdir)) - strcat (output_filename, "/"); + + strcat (output_filename, "/"); strcat (output_filename, index_name); return output_filename; } /* FIXME: this is way too hairy */ -void -convert_from_loaded_file (name) - char *name; +static void +convert_from_loaded_file (char *name) { char *real_output_filename = NULL; @@ -1417,7 +1528,7 @@ convert_from_loaded_file (name) command_output_filename = output_name_from_input_name (name); #endif /* !REQUIRE_SETFILENAME */ } - + { int i, end_of_first_line; @@ -1445,8 +1556,6 @@ convert_from_loaded_file (name) if (!command_output_filename) { get_until ("\n", &output_filename); /* read rest of line */ - if (xml && !docbook) - xml_begin_document (output_filename); if (html || xml) { /* Change any extension to .html or .xml. */ char *html_name, *directory_part, *basename_part, *temp; @@ -1505,11 +1614,11 @@ convert_from_loaded_file (name) { if (html && splitting) { - if (FILENAME_CMP (output_filename, NULL_DEVICE) == 0 - || FILENAME_CMP (output_filename, ALSO_NULL_DEVICE) == 0) - splitting = 0; - else - output_filename = insert_toplevel_subdirectory (output_filename); + if (FILENAME_CMP (output_filename, NULL_DEVICE) == 0 + || FILENAME_CMP (output_filename, ALSO_NULL_DEVICE) == 0) + splitting = 0; + else + output_filename = insert_toplevel_subdirectory (output_filename); real_output_filename = xstrdup (output_filename); } else if (!real_output_filename) @@ -1522,6 +1631,9 @@ convert_from_loaded_file (name) set_current_output_filename (real_output_filename); + if (xml && !docbook) + xml_begin_document (filename_part (output_filename)); + if (verbose_mode) printf (_("Making %s file `%s' from `%s'.\n"), no_headers ? "text" @@ -1538,7 +1650,7 @@ convert_from_loaded_file (name) /* Make the displayable filename from output_filename. Only the base portion of the filename need be displayed. */ - flush_output (); /* in case there was no @bye */ + flush_output (); /* in case there was no @bye */ if (output_stream != stdout) pretty_output_filename = filename_part (output_filename); else @@ -1562,10 +1674,23 @@ convert_from_loaded_file (name) output_filename, VERSION, input_filename); close_paragraph (); + + if (xml && !docbook) + { + /* Just before the real main loop, let's handle the defines. */ + COMMAND_LINE_DEFINE *temp; + + for (temp = command_line_defines; temp; temp = temp->next) + { + handle_variable_internal (temp->action, temp->define); + free(temp->define); + } + } + reader_loop (); if (xml) xml_end_document (); - + finished: discard_insertions (0); @@ -1580,7 +1705,8 @@ finished: && FILENAME_CMP (macro_expansion_filename, NULL_DEVICE) != 0 && FILENAME_CMP (macro_expansion_filename, ALSO_NULL_DEVICE) != 0) { - fprintf (stderr, _("%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"), + fprintf (stderr, +_("%s: Removing macro output file `%s' due to errors; use --force to preserve.\n"), progname, macro_expansion_filename); if (unlink (macro_expansion_filename) < 0) perror (macro_expansion_filename); @@ -1590,21 +1716,32 @@ finished: if (output_stream) { output_pending_notes (); - if (tag_table) - { - tag_table = (TAG_ENTRY *) reverse_list (tag_table); - if (!no_headers && !html) - write_tag_table (); - } if (html) { + no_indent = 1; start_paragraph (); add_word ("</body></html>\n"); close_paragraph (); } - flush_output (); /* in case there was no @bye */ + /* maybe we want local variables in info output. */ + { + char *trailer = info_trailer (); + if (!xml && !docbook && trailer) + { + if (html) + insert_string ("<!--"); + insert_string (trailer); + free (trailer); + if (html) + insert_string ("\n-->\n"); + } + } + + /* Write stuff makeinfo generates after @bye, ie. info_trailer. */ + flush_output (); + if (output_stream != stdout) fclose (output_stream); @@ -1612,19 +1749,28 @@ finished: if (validating) validate_file (tag_table); - /* If we need to output the table of contents, do it now. */ - if (contents_filename || shortcontents_filename) - toc_update (); + handle_delayed_writes (); + + if (tag_table) + { + tag_table = (TAG_ENTRY *) reverse_list ((GENERIC_LIST *) tag_table); + if (!no_headers && !html && !STREQ (current_output_filename, "-")) + write_tag_table (real_output_filename); + } if (splitting && !html && (!errors_printed || force)) - split_file (real_output_filename, split_size); + { + clean_old_split_files (real_output_filename); + split_file (real_output_filename, split_size); + } else if (errors_printed && !force && strcmp (real_output_filename, "-") != 0 && FILENAME_CMP (real_output_filename, NULL_DEVICE) != 0 && FILENAME_CMP (real_output_filename, ALSO_NULL_DEVICE) != 0) { /* If there were errors, and no --force, remove the output. */ - fprintf (stderr, _("%s: Removing output file `%s' due to errors; use --force to preserve.\n"), + fprintf (stderr, + _("%s: Removing output file `%s' due to errors; use --force to preserve.\n"), progname, real_output_filename); if (unlink (real_output_filename) < 0) perror (real_output_filename); @@ -1632,10 +1778,35 @@ finished: } free (real_output_filename); } + +/* If enable_encoding is set and @documentencoding is used, return a + Local Variables section (as a malloc-ed string) so that Emacs' + locale features can work. Else return NULL. */ +char * +info_trailer (void) +{ + char *encoding; + if (!enable_encoding) + return NULL; + + encoding = current_document_encoding (); + + if (encoding && *encoding) + { +#define LV_FMT "\n\037\nLocal Variables:\ncoding: %s\nEnd:\n" + char *lv = xmalloc (sizeof (LV_FMT) + strlen (encoding)); + sprintf (lv, LV_FMT, encoding); + free (encoding); + return lv; + } + + free (encoding); + return NULL; +} + void -free_and_clear (pointer) - char **pointer; +free_and_clear (char **pointer) { if (*pointer) { @@ -1645,8 +1816,8 @@ free_and_clear (pointer) } /* Initialize some state. */ -void -init_internals () +static void +init_internals (void) { free_and_clear (&output_filename); free_and_clear (&command); @@ -1666,9 +1837,9 @@ init_internals () } void -init_paragraph () +init_paragraph (void) { - free_and_clear (&output_paragraph); + free (output_paragraph); output_paragraph = xmalloc (paragraph_buffer_len); output_paragraph[0] = 0; output_paragraph_offset = 0; @@ -1682,13 +1853,13 @@ init_paragraph () menu line. */ static void -handle_menu_entry () +handle_menu_entry (void) { char *tem; - + /* Ugh, glean_node_from_menu wants to read the * itself. */ input_text_offset--; - + /* Find node name in menu entry and save it in references list for later validation. Use followed_reference type for detailmenu references since we don't want to use them for default node pointers. */ @@ -1708,29 +1879,27 @@ handle_menu_entry () if (had_menu_commentary) { - add_word ("<ul>\n"); + add_html_block_elt ("<ul class=\"menu\">\n"); had_menu_commentary = 0; in_paragraph = 0; } - else if (!in_paragraph && !paragraph_is_open) - { - add_word ("<p>\n"); - in_paragraph = 1; - } - + if (in_paragraph) { - add_word ("</p>"); + add_html_block_elt ("</p>\n"); + add_html_block_elt ("<ul class=\"menu\">\n"); in_paragraph = 0; } - add_word ("<li><a"); + in_menu_item = 1; + + add_html_block_elt ("<li><a"); if (next_menu_item_number <= 9) - { - add_word(" accesskey="); - add_word_args("%d", next_menu_item_number); - next_menu_item_number++; - } + { + add_word(" accesskey="); + add_word_args("\"%d\"", next_menu_item_number); + next_menu_item_number++; + } add_word (" href=\""); string = expansion (tem, 0); add_anchor_name (string, 1); @@ -1753,11 +1922,22 @@ handle_menu_entry () get_until_in_line (0, ".", &string); free (string); } - input_text_offset++; /* discard the second colon or the period */ - add_word (": "); + input_text_offset++; /* discard the second colon or the period */ + + /* Insert a colon only if there is a description of this menu item. */ + { + int save_input_text_offset = input_text_offset; + int save_line_number = line_number; + char *test_string; + get_rest_of_line (0, &test_string); + if (strlen (test_string) > 0) + add_word (": "); + input_text_offset = save_input_text_offset; + line_number = save_line_number; + } } else if (xml && tem) - { + { xml_start_menu_entry (tem); } else if (tem) @@ -1775,8 +1955,7 @@ handle_menu_entry () /* Find the command corresponding to STRING. If the command is found, return a pointer to the data structure. Otherwise return -1. */ static COMMAND * -get_command_entry (string) - char *string; +get_command_entry (char *string) { int i; @@ -1799,7 +1978,7 @@ get_command_entry (string) Read the next token to determine what to do. Return zero if there's no known command or macro after the prefix character. */ static int -read_command () +read_command (void) { COMMAND *entry; int old_text_offset = input_text_offset++; @@ -1820,14 +1999,16 @@ read_command () if (!(def->flags & ME_RECURSE)) def->inhibited = 1; + executing_macro++; execute_macro (def); + executing_macro--; if (!(def->flags & ME_RECURSE)) def->inhibited = 0; return 1; } - } + } if (only_macro_expansion) { @@ -1903,11 +2084,10 @@ read_command () the function with the proper arguments. Although the filling isn't necessary for HTML, it should do no harm. */ void -reader_loop () +reader_loop (void) { int character; int done = 0; - int dash_count = 0; while (!done) { @@ -1919,25 +2099,79 @@ reader_loop () /* If only_macro_expansion, only handle macros and leave everything else intact. */ if (!only_macro_expansion && !in_fixed_width_font + && ((!html && !xml) || escape_html) && (character == '\'' || character == '`') && input_text[input_text_offset + 1] == character) { - input_text_offset++; - character = '"'; /* html fixxme */ + if (html) + { + input_text_offset += 2; + add_word (character == '`' ? "“" : "”"); + continue; + } + else if (xml) + { + input_text_offset += 2; + xml_insert_entity (character == '`' ? "ldquo" : "rdquo"); + continue; + } + else + { + input_text_offset++; + character = '"'; + } } /* Convert --- to --. */ - if (!only_macro_expansion && character == '-') + if (!only_macro_expansion && character == '-' && !in_fixed_width_font + && ((!html && !xml) || escape_html)) { - dash_count++; - if (dash_count == 2 && !in_fixed_width_font) + int dash_count = 0; + + /* Get the number of consequtive dashes. */ + while (input_text[input_text_offset] == '-') { + dash_count++; input_text_offset++; - continue; } + + /* Eat one dash. */ + dash_count--; + + if (html || xml) + { + if (dash_count == 0) + add_char ('-'); + else + while (dash_count > 0) + { + if (dash_count >= 2) + { + if (html) + add_word ("—"); + else + xml_insert_entity ("mdash"); + dash_count -= 2; + } + else if (dash_count >= 1) + { + if (html) + add_word ("–"); + else + xml_insert_entity ("ndash"); + dash_count--; + } + } + } + else + { + add_char ('-'); + while (--dash_count > 0) + add_char ('-'); + } + + continue; } - else if (dash_count > 0) - dash_count = 0; /* If this is a whitespace character, then check to see if the line is blank. If so, advance to the carriage return. */ @@ -1977,7 +2211,7 @@ reader_loop () input_text_offset++; } break; - + /* Escapes for HTML unless we're outputting raw HTML. Do this always, even if SGML rules don't require it since that's easier and safer for non-conforming browsers. */ @@ -1992,8 +2226,8 @@ reader_loop () case '<': if (html && escape_html) add_word ("<"); - else if (xml) - xml_insert_entity ("lt"); + else if (xml && escape_html) + xml_insert_entity ("lt"); else add_char (character); input_text_offset++; @@ -2002,8 +2236,8 @@ reader_loop () case '>': if (html && escape_html) add_word (">"); - else if (xml) - xml_insert_entity ("gt"); + else if (xml && escape_html) + xml_insert_entity ("gt"); else add_char (character); input_text_offset++; @@ -2021,16 +2255,14 @@ reader_loop () we can ignore its partner. */ if (!only_macro_expansion) { - if (!STREQ (command, "math")) + if (command && !STREQ (command, "math")) { line_error (_("Misplaced %c"), '{'); remember_brace (misplaced_brace); } else - { /* We don't mind `extra' braces inside @math. */ - extern void cm_no_op (); - remember_brace (cm_no_op); - } + /* We don't mind `extra' braces inside @math. */ + remember_brace (cm_no_op); /* remember_brace advances input_text_offset. */ break; } @@ -2054,29 +2286,16 @@ reader_loop () maybe_write_itext (input_text, input_text_offset); } -void -init_brace_stack () +static void +init_brace_stack (void) { brace_stack = NULL; } -void -remember_brace (proc) - COMMAND_FUNCTION *proc; -{ - if (curchar () != '{') - line_error (_("%c%s expected `{...}'"), COMMAND_PREFIX, command); - else - input_text_offset++; - remember_brace_1 (proc, output_paragraph_offset); -} - /* Remember the current output position here. Save PROC along with it so you can call it later. */ -void -remember_brace_1 (proc, position) - COMMAND_FUNCTION *proc; - int position; +static void +remember_brace_1 (COMMAND_FUNCTION (*proc), int position) { BRACE_ELEMENT *new = xmalloc (sizeof (BRACE_ELEMENT)); new->next = brace_stack; @@ -2088,10 +2307,20 @@ remember_brace_1 (proc, position) brace_stack = new; } +static void +remember_brace (COMMAND_FUNCTION (*proc)) +{ + if (curchar () != '{') + line_error (_("%c%s expected braces"), COMMAND_PREFIX, command); + else + input_text_offset++; + remember_brace_1 (proc, output_paragraph_offset); +} + /* Pop the top of the brace stack, and call the associated function with the args END and POS. */ -void -pop_and_call_brace () +static void +pop_and_call_brace (void) { if (brace_stack == NULL) { @@ -2119,9 +2348,8 @@ pop_and_call_brace () } /* Shift all of the markers in `brace_stack' by AMOUNT. */ -void -adjust_braces_following (here, amount) - int here, amount; +static void +adjust_braces_following (int here, int amount) { BRACE_ELEMENT *stack = brace_stack; @@ -2136,9 +2364,8 @@ adjust_braces_following (here, amount) /* Return the string which invokes PROC; a pointer to a function. Always returns the first function in the command table if more than one matches PROC. */ -static char * -find_proc_name (proc) - COMMAND_FUNCTION *proc; +static const char * +find_proc_name (COMMAND_FUNCTION (*proc)) { int i; @@ -2153,7 +2380,7 @@ find_proc_name (proc) in braces, but that was wrong because of things like @code{foo @@}. So now I only detect it at the beginning of nodes. */ void -discard_braces () +discard_braces (void) { if (!brace_stack) return; @@ -2162,12 +2389,12 @@ discard_braces () { if (brace_stack->proc != misplaced_brace) { - char *proc_name; + const char *proc_name; proc_name = find_proc_name (brace_stack->proc); file_line_error (input_filename, brace_stack->line, - _("%c%s missing close brace"), COMMAND_PREFIX, - proc_name); + _("%c%s missing close brace"), COMMAND_PREFIX, + proc_name); pop_and_call_brace (); } else @@ -2180,9 +2407,8 @@ discard_braces () } } -int -get_char_len (character) - int character; +static int +get_char_len (int character) { /* Return the printed length of the character. */ int len; @@ -2216,10 +2442,10 @@ get_char_len (character) void #if defined (VA_FPRINTF) && __STDC__ -add_word_args (char *format, ...) +add_word_args (const char *format, ...) #else add_word_args (format, va_alist) - char *format; + const char *format; va_dcl #endif { @@ -2240,8 +2466,7 @@ add_word_args (format, va_alist) /* Add STRING to output_paragraph. */ void -add_word (string) - char *string; +add_word (char *string) { while (*string) add_char (*string++); @@ -2251,19 +2476,74 @@ add_word (string) Use this to output HTML directives with embedded blanks, to make them @w-safe. */ void -add_html_elt (string) - char *string; +add_html_elt (char *string) { in_html_elt++; add_word (string); in_html_elt--; } +/* These two functions below, add_html_block_elt and add_html_block_elt_args, + are mixtures of add_html_elt and add_word_args. They inform makeinfo that + the current HTML element being inserted should not be enclosed in a <p> + element. */ +void +add_html_block_elt (char *string) +{ + in_html_block_level_elt++; + add_word (string); + in_html_block_level_elt--; +} + +void +#if defined (VA_FPRINTF) && __STDC__ +add_html_block_elt_args (const char *format, ...) +#else +add_html_block_elt_args (format, va_alist) + const char *format; + va_dcl +#endif +{ + char buffer[2000]; /* xx no fixed limits */ +#ifdef VA_FPRINTF + va_list ap; +#endif + + VA_START (ap, format); +#ifdef VA_SPRINTF + VA_SPRINTF (buffer, format, ap); +#else + sprintf (buffer, format, a1, a2, a3, a4, a5, a6, a7, a8); +#endif /* not VA_SPRINTF */ + va_end (ap); + add_html_block_elt (buffer); +} + +/* Here is another awful kludge, used in add_char. Ordinarily, macro + expansions take place in the body of the document, and therefore we + should html_output_head when we see one. But there's an exception: a + macro call might take place within @copying, and that does not start + the real output, even though we fully expand the copying text. + + So we need to be able to check if we are defining the @copying text. + We do this by looking back through the insertion stack. */ +static int +defining_copying (void) +{ + INSERTION_ELT *i; + for (i = insertion_stack; i; i = i->next) + { + if (i->insertion == copying) + return 1; + } + return 0; +} + + /* Add the character to the current paragraph. If filling_enabled is nonzero, then do filling as well. */ void -add_char (character) - int character; +add_char (int character) { if (xml) { @@ -2297,7 +2577,10 @@ add_char (character) { if (html || docbook) { /* Seems cleaner to use than an 8-bit char. */ + int saved_escape_html = escape_html; + escape_html = 0; add_word (" "); + escape_html = saved_escape_html; character = ';'; } else @@ -2309,7 +2592,7 @@ add_char (character) switch (character) { case '\n': - if (!filling_enabled && ! (html && (in_menu || in_detailmenu))) + if (!filling_enabled && !(html && (in_menu || in_detailmenu))) { insert ('\n'); @@ -2366,13 +2649,15 @@ add_char (character) } } - /* This is sad, but it seems desirable to not force any - particular order on the front matter commands. This way, - the document can do @settitle, @documentlanguage, etc, in - any order and with any omissions, and we'll still output - the html <head> `just in time'. */ - if (!executing_string && html && !html_output_head_p) - html_output_head (); + /* This is sad, but it seems desirable to not force any + particular order on the front matter commands. This way, + the document can do @settitle, @documentlanguage, etc, in + any order and with any omissions, and we'll still output + the html <head> `just in time'. */ + if ((executing_macro || !executing_string) + && !only_macro_expansion + && html && !html_output_head_p && !defining_copying ()) + html_output_head (); if (!paragraph_is_open) { @@ -2384,12 +2669,16 @@ add_char (character) indent (pending_indent); pending_indent = 0; - /* This horrible kludge of checking for a < prevents <p> - from being inserted when we already have html markup - starting a paragraph, as with <ul> and <h1> and the like. */ - if (html && escape_html && character != '<' - && (!in_fixed_width_font || in_menu || in_detailmenu)) + /* This check for in_html_block_level_elt prevents <p> from being + inserted when we already have html markup starting a paragraph, + as with <ul> and <h1> and the like. */ + if (html && !in_html_block_level_elt) { + if ((in_menu || in_detailmenu) && in_menu_item) + { + insert_string ("</li></ul>\n"); + in_menu_item = 0; + } insert_string ("<p>"); in_paragraph = 1; adjust_braces_following (0, 3); /* adjust for <p> */ @@ -2444,9 +2733,9 @@ add_char (character) if (t1 != temp) { adjust_braces_following (temp, (- (t1 - temp))); - strncpy ((char *) &output_paragraph[temp], - (char *) &output_paragraph[t1], - (output_paragraph_offset - t1)); + memmove (&output_paragraph[temp], + &output_paragraph[t1], + output_paragraph_offset - t1); output_paragraph_offset -= (t1 - temp); } } @@ -2508,8 +2797,7 @@ add_char (character) /* Add a character and store its position in meta_char_pos. */ void -add_meta_char (character) - int character; +add_meta_char (int character) { meta_char_pos = output_paragraph_offset; add_char (character); @@ -2517,9 +2805,19 @@ add_meta_char (character) /* Insert CHARACTER into `output_paragraph'. */ void -insert (character) - int character; +insert (int character) { + /* We don't want to strip trailing whitespace in multitables. Otherwise + horizontal separators confuse the font locking in Info mode in Emacs, + because it looks like a @subsection. Adding a trailing space to those + lines fixes it. */ + if (character == '\n' && !html && !xml && !multitable_active) + { + while (output_paragraph_offset + && whitespace (output_paragraph[output_paragraph_offset-1])) + output_paragraph_offset--; + } + output_paragraph[output_paragraph_offset++] = character; if (output_paragraph_offset == paragraph_buffer_len) { @@ -2530,8 +2828,7 @@ insert (character) /* Insert the null-terminated string STRING into `output_paragraph'. */ void -insert_string (string) - char *string; +insert_string (const char *string) { while (*string) insert (*string++); @@ -2545,7 +2842,7 @@ insert_string (string) /* Return true if at an end-of-sentence character, possibly followed by post-sentence punctuation to ignore. */ static int -end_of_sentence_p () +end_of_sentence_p (void) { int loc = output_paragraph_offset - 1; @@ -2568,8 +2865,7 @@ end_of_sentence_p () the current output line. If COUNT is less than zero, then remove until none left. */ void -kill_self_indent (count) - int count; +kill_self_indent (int count) { /* Handle infinite case first. */ if (count < 0) @@ -2598,20 +2894,20 @@ static int flushing_ignored = 0; /* Prevent calls to flush_output () from having any effect. */ void -inhibit_output_flushing () +inhibit_output_flushing (void) { flushing_ignored++; } /* Allow calls to flush_output () to write the paragraph data. */ void -uninhibit_output_flushing () +uninhibit_output_flushing (void) { flushing_ignored--; } void -flush_output () +flush_output (void) { int i; @@ -2620,6 +2916,12 @@ flush_output () for (i = 0; i < output_paragraph_offset; i++) { + if (output_paragraph[i] == '\n') + { + output_line_number++; + node_line_number++; + } + /* If we turned on the 8th bit for a space inside @w, turn it back off for output. This might be problematic, since the 0x80 character may be used in 8-bit character sets. Sigh. @@ -2649,8 +2951,7 @@ flush_output () int paragraph_spacing = DEFAULT_PARAGRAPH_SPACING; static void -close_paragraph_with_lines (lines) - int lines; +close_paragraph_with_lines (int lines) { int old_spacing = paragraph_spacing; paragraph_spacing = lines; @@ -2660,14 +2961,14 @@ close_paragraph_with_lines (lines) /* Close the current paragraph, leaving no blank lines between them. */ void -close_single_paragraph () +close_single_paragraph (void) { close_paragraph_with_lines (0); } /* Close a paragraph after an insertion has ended. */ void -close_insertion_paragraph () +close_insertion_paragraph (void) { if (!insertion_paragraph_closed) { @@ -2703,18 +3004,21 @@ close_insertion_paragraph () /* Close the currently open paragraph. */ void -close_paragraph () +close_paragraph (void) { int i; + /* We don't need these newlines in XML and Docbook outputs for + paragraph seperation. We have <para> element for that. */ + if (xml) + return; + /* The insertion paragraph is no longer closed. */ insertion_paragraph_closed = 0; if (paragraph_is_open && !must_start_paragraph) { - int tindex, c; - - tindex = output_paragraph_offset; + int tindex = output_paragraph_offset; /* Back up to last non-newline/space character, forcing all such subsequent characters to be newlines. This isn't strictly @@ -2722,7 +3026,7 @@ close_paragraph () to make decisions. */ for (tindex = output_paragraph_offset - 1; tindex >= 0; --tindex) { - c = output_paragraph[tindex]; + int c = output_paragraph[tindex]; if (c == ' '|| c == '\n') output_paragraph[tindex] = '\n'; @@ -2766,15 +3070,15 @@ close_paragraph () /* Make the last line just read look as if it were only a newline. */ void -ignore_blank_line () +ignore_blank_line (void) { last_inserted_character = '\n'; last_char_was_newline = 1; } /* Align the end of the text in output_paragraph with fill_column. */ -void -do_flush_right_indentation () +static void +do_flush_right_indentation (void) { char *temp; int temp_len; @@ -2811,7 +3115,7 @@ do_flush_right_indentation () /* Begin a new paragraph. */ void -start_paragraph () +start_paragraph (void) { /* First close existing one. */ if (paragraph_is_open) @@ -2858,12 +3162,8 @@ start_paragraph () /* Insert the indentation specified by AMOUNT. */ void -indent (amount) - int amount; +indent (int amount) { - if (html) - return; - /* For every START_POS saved within the brace stack which will be affected by this indentation, bump that start pos forward. */ adjust_braces_following (output_paragraph_offset, amount); @@ -2875,9 +3175,7 @@ indent (amount) /* Search forward for STRING in input_text. FROM says where where to start. */ int -search_forward (string, from) - char *string; - int from; +search_forward (char *string, int from) { int len = strlen (string); @@ -2889,615 +3187,280 @@ search_forward (string, from) } return -1; } - -/* Cross references. */ - -/* Return next comma-delimited argument, but do not cross a close-brace - boundary. Clean up whitespace, too. If EXPAND is nonzero, replace - the entire brace-delimited argument list with its expansion before - looking for the next comma. */ -char * -get_xref_token (expand) - int expand; -{ - char *string; - - if (expand) - { - int old_offset = input_text_offset; - int old_lineno = line_number; - - get_until_in_braces ("}", &string); - if (curchar () == '}') /* as opposed to end of text */ - input_text_offset++; - if (input_text_offset > old_offset) - { - int limit = input_text_offset; - - input_text_offset = old_offset; - line_number = old_lineno; - only_macro_expansion++; - replace_with_expansion (input_text_offset, &limit); - only_macro_expansion--; - } - free (string); - } - - get_until_in_braces (",", &string); - if (curchar () == ',') - input_text_offset++; - fix_whitespace (string); - return string; -} -/* NOTE: If you wonder why the HTML output is produced with such a - peculiar mix of calls to add_word and execute_string, here's the - reason. get_xref_token (1) expands all macros in a reference, but - any other commands, like @value, @@, etc., are left intact. To - expand them, we need to run the arguments through execute_string. - However, characters like <, &, > and others cannot be let into - execute_string, because they will be escaped. See the mess? */ - -/* Make a cross reference. */ -void -cm_xref (arg) +/* search_forward until n characters. */ +int +search_forward_until_pos (char *string, int from, int end_pos) { - if (arg == START) - { - char *arg1 = get_xref_token (1); /* expands all macros in xref */ - char *arg2 = get_xref_token (0); - char *arg3 = get_xref_token (0); - char *arg4 = get_xref_token (0); - char *arg5 = get_xref_token (0); - char *tem; - - /* "@xref{,Foo,, Bar, Baz} is not valid usage of @xref. The - first argument must never be blank." --rms. - We hereby comply by disallowing such constructs. */ - if (!*arg1) - line_error (_("First argument to cross-reference may not be empty")); - - if (xml && docbook) - { - if (!*arg4 && !*arg5) - { - char *arg1_id = xml_id (arg1); - if (*arg2) - { - xml_insert_element_with_attribute (XREFNODENAME, START, - "linkend=\"%s\"", arg1_id); - free (arg1_id); - if (*arg2) - execute_string (arg2); - xml_insert_element (XREFNODENAME, END); - } - else - { - xml_insert_element_with_attribute (XREF, START, - "linkend=\"%s\"", arg1_id); - free (arg1_id); - xml_pop_current_element (); - } - } - } - else if (xml) - { - xml_insert_element (XREF, START); - xml_insert_element (XREFNODENAME, START); - execute_string (arg1); - xml_insert_element (XREFNODENAME, END); - if (*arg2) - { - xml_insert_element (XREFINFONAME, START); - execute_string (arg2); - xml_insert_element (XREFINFONAME, END); - } - if (*arg3) - { - xml_insert_element (XREFPRINTEDDESC, START); - execute_string (arg3); - xml_insert_element (XREFPRINTEDDESC, END); - } - if (*arg4) - { - xml_insert_element (XREFINFOFILE, START); - execute_string (arg4); - xml_insert_element (XREFINFOFILE, END); - } - if (*arg5) - { - xml_insert_element (XREFPRINTEDNAME, START); - execute_string (arg5); - xml_insert_element (XREFPRINTEDNAME, END); - } - xml_insert_element (XREF, END); - } - else if (html) - { - if (!ref_flag) - add_word_args ("%s", px_ref_flag ? _("see ") : _("See ")); - } - else - add_word_args ("%s", px_ref_flag ? "*note " : "*Note "); - - if (!xml) - { - if (*arg5 || *arg4) - { - /* arg1 - node name - arg2 - reference name - arg3 - title or topic (and reference name if arg2 is NULL) - arg4 - info file name - arg5 - printed manual title */ - char *ref_name; - - if (!*arg2) - { - if (*arg3) - ref_name = arg3; - else - ref_name = arg1; - } - else - ref_name = arg2; - - if (html) - { - /* html fixxme: revisit this; external node name not - much use to us with numbered nodes. */ - add_html_elt ("<a href="); - /* Note that if we are splitting, and the referenced - tag is an anchor rather than a node, we will - produce a reference to a file whose name is - derived from the anchor name. However, only - nodes create files, so we are referencing a - non-existent file. cm_anchor, which see, deals - with that problem. */ - if (splitting) - execute_string ("\"../%s/", arg4); - else - execute_string ("\"%s.html", arg4); - /* Do not collapse -- to -, etc., in references. */ - in_fixed_width_font++; - tem = expansion (arg1, 0); /* expand @-commands in node */ - in_fixed_width_font--; - add_anchor_name (tem, 1); - free (tem); - add_word ("\">"); - execute_string ("%s", ref_name); - add_word ("</a>"); - } - else - { - execute_string ("%s:", ref_name); - in_fixed_width_font++; - execute_string (" (%s)%s%s", arg4, arg1, px_ref_flag ? "." : ""); - in_fixed_width_font--; - } - - /* Free all of the arguments found. */ - if (arg1) free (arg1); - if (arg2) free (arg2); - if (arg3) free (arg3); - if (arg4) free (arg4); - if (arg5) free (arg5); - return; - } - else - remember_node_reference (arg1, line_number, followed_reference); + int save_input_text_length = input_text_length; + input_text_length = end_pos; - if (*arg3) - { - if (html) - { - add_html_elt ("<a href=\""); - in_fixed_width_font++; - tem = expansion (arg1, 0); - in_fixed_width_font--; - add_anchor_name (tem, 1); - free (tem); - add_word ("\">"); - execute_string ("%s", *arg2 ? arg2 : arg3); - add_word ("</a>"); - } - else - { - execute_string ("%s:", *arg2 ? arg2 : arg3); - in_fixed_width_font++; - execute_string (" %s%s", arg1, px_ref_flag ? "." : ""); - in_fixed_width_font--; - } - } - else - { - if (html) - { - add_html_elt ("<a href=\""); - in_fixed_width_font++; - tem = expansion (arg1, 0); - in_fixed_width_font--; - add_anchor_name (tem, 1); - free (tem); - add_word ("\">"); - execute_string ("%s", *arg2 ? arg2 : arg1); - add_word ("</a>"); - } - else - { - if (*arg2) - { - execute_string ("%s:", arg2); - in_fixed_width_font++; - execute_string (" %s%s", arg1, px_ref_flag ? "." : ""); - in_fixed_width_font--; - } - else - { - in_fixed_width_font++; - execute_string ("%s::", arg1); - in_fixed_width_font--; - } - } - } - } - /* Free all of the arguments found. */ - if (arg1) free (arg1); - if (arg2) free (arg2); - if (arg3) free (arg3); - if (arg4) free (arg4); - if (arg5) free (arg5); - } - else - { /* Check to make sure that the next non-whitespace character is - valid to follow an xref (so info readers can find the node - names). `input_text_offset' is pointing at the "}" which ended - the xref or ref command. */ - int temp; + from = search_forward (string, from); - for (temp = input_text_offset + 1; temp < input_text_length; ) - { - if (cr_or_whitespace (input_text[temp])) - temp++; - else - { - if (input_text[temp] != '.' && input_text[temp] != ',') - warning (_("`.' or `,' must follow cross reference, not %c"), - input_text[temp]); - break; - } - } - } -} + input_text_length = save_input_text_length; -void -cm_pxref (arg) - int arg; -{ - if (arg == START) - { - px_ref_flag++; - cm_xref (arg); - px_ref_flag--; - } - /* Note that cm_xref isn't called with arg == END, which disables - the code near the end of cm_xref that checks for `.' or `,' - after the cross-reference. This is because @pxref{} generates - the required character itself, when needed. */ + return from; } -void -cm_ref (arg) - int arg; +/* Return next non-whitespace and non-cr character. */ +int +next_nonwhitespace_character (void) { - if (arg == START) - { - ref_flag++; - cm_xref (arg); - ref_flag--; - } -} + /* First check the current input_text. Start from the next char because + we already have input_text[input_text_offset] in ``current''. */ + int pos = input_text_offset + 1; -void -cm_inforef (arg) - int arg; -{ - if (arg == START) + while (pos < input_text_length) { - char *node = get_xref_token (1); /* expands all macros in inforef */ - char *pname = get_xref_token (0); - char *file = get_xref_token (0); - - /* (see comments at cm_xref). */ - if (!*node) - line_error (_("First argument to @inforef may not be empty")); - - if (xml && !docbook) - { - xml_insert_element (INFOREF, START); - xml_insert_element (INFOREFNODENAME, START); - execute_string (node); - xml_insert_element (INFOREFNODENAME, END); - if (*pname) - { - xml_insert_element (INFOREFREFNAME, START); - execute_string (pname); - xml_insert_element (INFOREFREFNAME, END); - } - xml_insert_element (INFOREFINFONAME, START); - execute_string (file); - xml_insert_element (INFOREFINFONAME, END); - - xml_insert_element (INFOREF, END); - } - else if (html) - { - char *tem; - - add_word (_("see ")); - /* html fixxme: revisit this */ - add_html_elt ("<a href="); - if (splitting) - execute_string ("\"../%s/", file); - else - execute_string ("\"%s.html", file); - tem = expansion (node, 0); - add_anchor_name (tem, 1); - add_word ("\">"); - execute_string ("%s", *pname ? pname : tem); - add_word ("</a>"); - free (tem); - } - else - { - if (*pname) - execute_string ("*note %s: (%s)%s", pname, file, node); - else - execute_string ("*note (%s)%s::", file, node); - } - - free (node); - free (pname); - free (file); + if (!cr_or_whitespace(input_text[pos])) + return input_text[pos]; + pos++; } -} -/* A URL reference. */ -void -cm_uref (arg) - int arg; -{ - if (arg == START) - { - extern int printing_index; - char *url = get_xref_token (1); /* expands all macros in uref */ - char *desc = get_xref_token (0); - char *replacement = get_xref_token (0); + { /* Can't find a valid character, so go through filestack + in case we are doing @include or expanding a macro. */ + FSTACK *tos = filestack; - if (xml) - { - xml_insert_element (UREF, START); - xml_insert_element (UREFURL, START); - execute_string (url); - xml_insert_element (UREFURL, END); - if (*desc) - { - xml_insert_element (UREFDESC, START); - execute_string (desc); - xml_insert_element (UREFDESC, END); - } - if (*replacement) - { - xml_insert_element (UREFREPLACEMENT, START); - execute_string (replacement); - xml_insert_element (UREFREPLACEMENT, END); - } - xml_insert_element (UREF, END); - } - else if (html) - { /* never need to show the url */ - add_html_elt ("<a href="); - /* don't collapse `--' etc. in the url */ - in_fixed_width_font++; - execute_string ("\"%s\"", url); - in_fixed_width_font--; - add_word (">"); - execute_string ("%s", *replacement ? replacement - : (*desc ? desc : url)); - add_word ("</a>"); - } - else if (*replacement) /* do not show the url */ - execute_string ("%s", replacement); - else if (*desc) /* show both text and url */ - { - execute_string ("%s ", desc); - in_fixed_width_font++; - execute_string ("(%s)", url); - in_fixed_width_font--; - } - else /* no text at all, so have the url to show */ - { - in_fixed_width_font++; - execute_string ("%s%s%s", - printing_index ? "" : "`", - url, - printing_index ? "" : "'"); - in_fixed_width_font--; - } - if (url) - free (url); - if (desc) - free (desc); - if (replacement) - free (replacement); - } -} + while (tos) + { + int tmp_input_text_length = filestack->size; + int tmp_input_text_offset = filestack->offset; + char *tmp_input_text = filestack->text; -/* An email reference. */ -void -cm_email (arg) - int arg; -{ - if (arg == START) - { - char *addr = get_xref_token (1); /* expands all macros in email */ - char *name = get_xref_token (0); + while (tmp_input_text_offset < tmp_input_text_length) + { + if (!cr_or_whitespace(tmp_input_text[tmp_input_text_offset])) + return tmp_input_text[tmp_input_text_offset]; + tmp_input_text_offset++; + } - if (xml && docbook) - { - xml_insert_element_with_attribute (EMAIL, START, "url=\"mailto:%s\"", addr); - if (*name) - execute_string (name); - xml_insert_element (EMAIL, END); - } - else if (xml) - { - xml_insert_element (EMAIL, START); - xml_insert_element (EMAILADDRESS, START); - execute_string (addr); - xml_insert_element (EMAILADDRESS, END); - if (*name) - { - xml_insert_element (EMAILNAME, START); - execute_string (name); - xml_insert_element (EMAILNAME, END); - } - xml_insert_element (EMAIL, END); - } - else if (html) - { - add_html_elt ("<a href="); - /* don't collapse `--' etc. in the address */ - in_fixed_width_font++; - execute_string ("\"mailto:%s\"", addr); - in_fixed_width_font--; - add_word (">"); - execute_string ("%s", *name ? name : addr); - add_word ("</a>"); - } - else - { - execute_string ("%s%s", name, *name ? " " : ""); - in_fixed_width_font++; - execute_string ("<%s>", addr); - in_fixed_width_font--; - } + tos = tos->next; + } + } - if (addr) - free (addr); - if (name) - free (name); - } + return -1; } - + /* An external image is a reference, kind of. The parsing is (not coincidentally) similar, anyway. */ void -cm_image (arg) - int arg; +cm_image (int arg) { - char *name_arg, *rest, *alt_arg, *ext_arg; + char *name_arg, *w_arg, *h_arg, *alt_arg, *ext_arg; if (arg == END) return; name_arg = get_xref_token (1); /* expands all macros in image */ - /* We don't (yet) care about the next two args, but read them so they - don't end up in the text. */ - rest = get_xref_token (0); - if (rest) - free (rest); - rest = get_xref_token (0); - if (rest) - free (rest); + w_arg = get_xref_token (0); + h_arg = get_xref_token (0); alt_arg = get_xref_token (1); /* expands all macros in alt text */ ext_arg = get_xref_token (0); if (*name_arg) { + struct stat file_info; + char *pathname = NULL; char *fullname = xmalloc (strlen (name_arg) - + (ext_arg && *ext_arg ? strlen (ext_arg) + 1 : 4) + 1); + + (ext_arg && *ext_arg ? strlen (ext_arg) + 1: 4) + 1); - if (html) + if (ext_arg && *ext_arg) { - if (ext_arg && *ext_arg) + sprintf (fullname, "%s%s", name_arg, ext_arg); + if (access (fullname, R_OK) != 0) + pathname = get_file_info_in_path (fullname, include_files_path, + &file_info); + + if (pathname == NULL) { + /* Backwards compatibility (4.6 <= version < 4.7): + try prefixing @image's EXTENSION parameter with a period. */ sprintf (fullname, "%s.%s", name_arg, ext_arg); if (access (fullname, R_OK) != 0) - { - line_error(_("@image file `%s' (for HTML) not readable: %s"), - fullname, strerror (errno)); - return; - } + pathname = get_file_info_in_path (fullname, include_files_path, + &file_info); } - else - { + } + else + { sprintf (fullname, "%s.png", name_arg); - if (access (fullname, R_OK) != 0) - { + if (access (fullname, R_OK) != 0) { + pathname = get_file_info_in_path (fullname, + include_files_path, &file_info); + if (pathname == NULL) { sprintf (fullname, "%s.jpg", name_arg); - if (access (fullname, R_OK) != 0) - { - line_error (_("No `%s.png' or `.jpg', and no extension supplied"), - name_arg); - return; + if (access (fullname, R_OK) != 0) { + sprintf (fullname, "%s.gif", name_arg); + if (access (fullname, R_OK) != 0) { + pathname = get_file_info_in_path (fullname, + include_files_path, &file_info); } + } + } } - } + } + + if (html) + { + int image_in_div = 0; + + if (pathname == NULL && access (fullname, R_OK) != 0) + { + line_error(_("@image file `%s' (for HTML) not readable: %s"), + fullname, strerror (errno)); + return; + } + if (pathname != NULL && access (pathname, R_OK) != 0) + { + line_error (_("No such file `%s'"), + fullname); + return; + } - add_html_elt ("<img src="); + if (!paragraph_is_open) + { + add_html_block_elt ("<div class=\"block-image\">"); + image_in_div = 1; + } + + add_html_elt ("<img src="); add_word_args ("\"%s\"", fullname); - add_html_elt (" alt="); - add_word_args ("\"%s\">", (*alt_arg) ? alt_arg : fullname); + add_html_elt (" alt="); + add_word_args ("\"%s\">", + escape_string (*alt_arg ? text_expansion (alt_arg) : fullname)); + + if (image_in_div) + add_html_block_elt ("</div>"); } else if (xml && docbook) - xml_insert_docbook_image (name_arg); + xml_insert_docbook_image (name_arg); else if (xml) - { - xml_insert_element (IMAGE, START); - add_word (name_arg); - xml_insert_element (IMAGE, END); - } + { + extern int xml_in_para; + extern int xml_no_para; + int elt = xml_in_para ? INLINEIMAGE : IMAGE; + + if (!xml_in_para) + xml_no_para++; + + xml_insert_element_with_attribute (elt, + START, "width=\"%s\" height=\"%s\" name=\"%s\" extension=\"%s\"", + w_arg, h_arg, name_arg, ext_arg); + xml_insert_element (IMAGEALTTEXT, START); + execute_string ("%s", alt_arg); + xml_insert_element (IMAGEALTTEXT, END); + xml_insert_element (elt, END); + + if (!xml_in_para) + xml_no_para--; + } else - { /* Try to open foo.txt. */ + { /* Try to open foo.EXT or foo.txt. */ FILE *image_file; - strcpy (fullname, name_arg); - strcat (fullname, ".txt"); - image_file = fopen (fullname, "r"); - if (image_file) + char *txtpath = NULL; + char *txtname = xmalloc (strlen (name_arg) + + (ext_arg && *ext_arg + ? strlen (ext_arg) : 4) + 1); + strcpy (txtname, name_arg); + strcat (txtname, ".txt"); + image_file = fopen (txtname, "r"); + if (image_file == NULL) + { + txtpath = get_file_info_in_path (txtname, + include_files_path, &file_info); + if (txtpath != NULL) + image_file = fopen (txtpath, "r"); + } + + if (image_file != NULL + || access (fullname, R_OK) == 0 + || (pathname != NULL && access (pathname, R_OK) == 0)) { int ch; int save_inhibit_indentation = inhibit_paragraph_indentation; int save_filling_enabled = filling_enabled; + int image_in_brackets = paragraph_is_open; + + /* Write magic ^@^H[image ...^@^H] cookie in the info file, if + there's an accompanying bitmap. Otherwise just include the + text image. In the plaintext output, always include the text + image without the magic cookie. */ + int use_magic_cookie = !no_headers + && access (fullname, R_OK) == 0 && !STREQ (fullname, txtname); inhibit_paragraph_indentation = 1; filling_enabled = 0; last_char_was_newline = 0; - /* Maybe we need to remove the final newline if the image - file is only one line to allow in-line images. On the - other hand, they could just make the file without a - final newline. */ - while ((ch = getc (image_file)) != EOF) - add_char (ch); + if (use_magic_cookie) + { + add_char ('\0'); + add_word ("\010[image"); + + if (access (fullname, R_OK) == 0 + || (pathname != NULL && access (pathname, R_OK) == 0)) + add_word_args (" src=\"%s\"", fullname); + + if (*alt_arg) + add_word_args (" alt=\"%s\"", alt_arg); + } + + if (image_file != NULL) + { + if (use_magic_cookie) + add_word (" text=\""); + + if (image_in_brackets) + add_char ('['); + + /* Maybe we need to remove the final newline if the image + file is only one line to allow in-line images. On the + other hand, they could just make the file without a + final newline. */ + while ((ch = getc (image_file)) != EOF) + { + if (use_magic_cookie && (ch == '"' || ch == '\\')) + add_char ('\\'); + add_char (ch); + } + + if (image_in_brackets) + add_char (']'); + + if (use_magic_cookie) + add_char ('"'); + + if (fclose (image_file) != 0) + perror (txtname); + } + + if (use_magic_cookie) + { + add_char ('\0'); + add_word ("\010]"); + } inhibit_paragraph_indentation = save_inhibit_indentation; filling_enabled = save_filling_enabled; - - if (fclose (image_file) != 0) - perror (fullname); } else - line_error (_("@image file `%s' (for text) unreadable: %s"), - fullname, strerror (errno)); + warning (_("@image file `%s' (for text) unreadable: %s"), + txtname, strerror (errno)); } free (fullname); + if (pathname) + free (pathname); } else line_error (_("@image missing filename argument")); if (name_arg) free (name_arg); + if (w_arg) + free (w_arg); + if (h_arg) + free (h_arg); if (alt_arg) free (alt_arg); if (ext_arg) @@ -3517,10 +3480,8 @@ typedef struct defines { DEFINE *defines = NULL; /* Add NAME to the list of `set' defines. */ -void -set (name, value) - char *name; - char *value; +static void +set (char *name, char *value) { DEFINE *temp; @@ -3537,12 +3498,18 @@ set (name, value) temp->name = xstrdup (name); temp->value = xstrdup (value); defines = temp; + + if (xml && !docbook) + { + xml_insert_element_with_attribute (SETVALUE, START, "name=\"%s\"", name); + execute_string ("%s", value); + xml_insert_element (SETVALUE, END); + } } /* Remove NAME from the list of `set' defines. */ -void -clear (name) - char *name; +static void +clear (char *name) { DEFINE *temp, *last; @@ -3566,12 +3533,17 @@ clear (name) last = temp; temp = temp->next; } + + if (xml && !docbook) + { + xml_insert_element_with_attribute (CLEARVALUE, START, "name=\"%s\"", name); + xml_insert_element (CLEARVALUE, END); + } } /* Return the value of NAME. The return value is NULL if NAME is unset. */ -char * -set_p (name) - char *name; +static char * +set_p (char *name) { DEFINE *temp; @@ -3584,26 +3556,26 @@ set_p (name) /* Create a variable whose name appears as the first word on this line. */ void -cm_set () +cm_set (void) { handle_variable (SET); } /* Remove a variable whose name appears as the first word on this line. */ void -cm_clear () +cm_clear (void) { handle_variable (CLEAR); } void -cm_ifset () +cm_ifset (void) { handle_variable (IFSET); } void -cm_ifclear () +cm_ifclear (void) { handle_variable (IFCLEAR); } @@ -3615,7 +3587,7 @@ cm_ifclear () if ARG1 and ARG2 caselessly string compare to the same string, otherwise, it produces no output. */ void -cm_ifeq () +cm_ifeq (void) { char **arglist; @@ -3635,11 +3607,16 @@ cm_ifeq () } void -cm_value (arg, start_pos, end_pos) - int arg, start_pos, end_pos; +cm_value (int arg, int start_pos, int end_pos) { static int value_level = 0, saved_meta_pos = -1; + /* xml_add_char() skips any content inside menus when output format is + Docbook, so @value{} is no use there. Also start_pos and end_pos does not + get updated, causing name to be empty string. So just return. */ + if (docbook && in_menu) + return; + /* All the text after @value{ upto the matching } will eventually disappear from output_paragraph, when this function is called with ARG == END. If the text produced until then sets @@ -3654,8 +3631,8 @@ cm_value (arg, start_pos, end_pos) saved_meta_pos = meta_char_pos; value_level++; /* While the argument of @value is processed, we need to inhibit - textual transformations like "--" into "-", since @set didn't - do that when it grabbed the name of the variable. */ + textual transformations like "--" into "-", since @set didn't + do that when it grabbed the name of the variable. */ in_fixed_width_font++; } else @@ -3680,23 +3657,32 @@ cm_value (arg, start_pos, end_pos) } value_level--; /* No need to decrement in_fixed_width_font, since before - we are called with arg == END, the reader loop already - popped the brace stack, which restored in_fixed_width_font, - among other things. */ + we are called with arg == END, the reader loop already + popped the brace stack, which restored in_fixed_width_font, + among other things. */ if (value) - execute_string ("%s", value); + { + /* We need to get past the closing brace since the value may + expand to a context-sensitive macro (e.g. @xref) and produce + spurious warnings */ + input_text_offset++; + execute_string ("%s", value); + input_text_offset--; + } else - add_word_args (_("{No value for `%s'}"), name); + { + warning (_("undefined flag: %s"), name); + add_word_args (_("{No value for `%s'}"), name); + } free (name); } } /* Set, clear, or conditionalize based on ACTION. */ -void -handle_variable (action) - int action; +static void +handle_variable (int action) { char *name; @@ -3710,10 +3696,8 @@ handle_variable (action) free (name); } -void -handle_variable_internal (action, name) - int action; - char *name; +static void +handle_variable_internal (int action, char *name) { char *temp; int delimiter, additional_text_present = 0; @@ -3846,9 +3830,9 @@ handle_variable_internal (action, name) } if (!done) - file_line_error (input_filename, orig_line_number, - _("Reached eof before matching @end %s"), - condition); + file_line_error (input_filename, orig_line_number, + _("Reached eof before matching @end %s"), + condition); /* We found the end of a false @ifset/ifclear. If we are in a menu, back up over the newline that ends the ifset, @@ -3869,7 +3853,6 @@ handle_variable_internal (action, name) } /* Execution of random text not in file. */ - typedef struct { char *string; /* The string buffer. */ int size; /* The size of the buffer. */ @@ -3880,9 +3863,8 @@ static EXECUTION_STRING **execution_strings = NULL; static int execution_strings_index = 0; static int execution_strings_slots = 0; -EXECUTION_STRING * -get_execution_string (initial_size) - int initial_size; +static EXECUTION_STRING * +get_execution_string (int initial_size) { int i = 0; EXECUTION_STRING *es = NULL; @@ -3930,9 +3912,7 @@ get_execution_string (initial_size) entry in the execution_strings[] array and change the .STRING and .SIZE members of that entry as appropriate. */ void -maybe_update_execution_strings (text, new_len) - char **text; - unsigned new_len; +maybe_update_execution_strings (char **text, unsigned int new_len) { int i = 0; @@ -3976,10 +3956,11 @@ execute_string (format, va_alist) #endif { EXECUTION_STRING *es; - char *temp_string; + char *temp_string, *temp_input_filename; #ifdef VA_FPRINTF va_list ap; #endif + int insertion_level_at_start = insertion_level; es = get_execution_string (EXECUTE_STRING_MAX); temp_string = es->string; @@ -3996,31 +3977,53 @@ execute_string (format, va_alist) pushfile (); input_text_offset = 0; input_text = temp_string; - input_filename = xstrdup (input_filename); input_text_length = strlen (temp_string); + input_filename = xstrdup (input_filename); + temp_input_filename = input_filename; executing_string++; reader_loop (); - free (input_filename); + + /* If insertion stack level changes during execution, that means a multiline + command is used inside braces or @section ... kind of commands. */ + if (insertion_level_at_start != insertion_level && !executing_macro) + { + line_error (_("Multiline command %c%s used improperly"), + COMMAND_PREFIX, + command); + /* We also need to keep insertion_level intact to make sure warnings are + issued for @end ... command. */ + while (insertion_level > insertion_level_at_start) + pop_insertion (); + } popfile (); executing_string--; es->in_use = 0; + free (temp_input_filename); } /* Return what would be output for STR (in newly-malloced memory), i.e., - expand Texinfo commands. If IMPLICIT_CODE is set, expand @code{STR}. - This is generally used for short texts; filling, indentation, and - html escapes are disabled. */ + expand Texinfo commands according to the current output format. If + IMPLICIT_CODE is set, expand @code{STR}. This is generally used for + short texts; filling, indentation, and html escapes are disabled. */ char * -expansion (str, implicit_code) - char *str; - int implicit_code; +expansion (char *str, int implicit_code) +{ + return maybe_escaped_expansion (str, implicit_code, 0); +} + + +/* Do HTML escapes according to DO_HTML_ESCAPE. Needed in + cm_printindex, q.v. */ + +char * +maybe_escaped_expansion (char *str, int implicit_code, int do_html_escape) { char *result; - + /* Inhibit indentation and filling, so that extra newlines are not added to the expansion. (This is undesirable if we write the expanded text to macro_expansion_output_stream.) */ @@ -4032,27 +4035,25 @@ expansion (str, implicit_code) filling_enabled = 0; indented_fill = 0; no_indent = 1; - escape_html = 0; - + escape_html = do_html_escape; + result = full_expansion (str, implicit_code); filling_enabled = saved_filling_enabled; indented_fill = saved_indented_fill; no_indent = saved_no_indent; - escape_html = saved_escape_html; - + escape_html = saved_escape_html; + return result; } /* Expand STR (or @code{STR} if IMPLICIT_CODE is nonzero). No change to any formatting parameters -- filling, indentation, html escapes, - etc., are not reset. */ + etc., are not reset. Always returned in new memory. */ char * -full_expansion (str, implicit_code) - char *str; - int implicit_code; +full_expansion (char *str, int implicit_code) { int length; char *result; @@ -4076,8 +4077,8 @@ full_expansion (str, implicit_code) inhibit_output_flushing (); paragraph_is_open = 1; if (strlen (str) > (implicit_code - ? EXECUTE_STRING_MAX - 1 - sizeof("@code{}") - : EXECUTE_STRING_MAX - 1)) + ? EXECUTE_STRING_MAX - 1 - sizeof("@code{}") + : EXECUTE_STRING_MAX - 1)) line_error (_("`%.40s...' is too long for expansion; not expanded"), str); else execute_string (implicit_code ? "@code{%s}" : "%s", str); @@ -4109,19 +4110,21 @@ full_expansion (str, implicit_code) format is. */ char * -text_expansion (str) - char *str; +text_expansion (char *str) { char *ret; int save_html = html; int save_xml = xml; - + int save_docbook = docbook; + html = 0; xml = 0; + docbook = 0; ret = expansion (str, 0); html = save_html; xml = save_xml; - + docbook = save_docbook; + return ret; } @@ -4134,8 +4137,7 @@ text_expansion (str) If NUM is zero, we assume `none'. Returns 0 if successful, or nonzero if STRING isn't one of the above. */ int -set_paragraph_indent (string) - char *string; +set_paragraph_indent (char *string) { if (strcmp (string, "asis") == 0 || strcmp (string, _("asis")) == 0) paragraph_start_indent = 0; diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h index caff24d2e1f..20df9863238 100644 --- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h @@ -1,7 +1,8 @@ /* makeinfo.h -- declarations for Makeinfo. - $Id: makeinfo.h,v 1.4 2002/06/10 13:51:03 espie Exp $ + $Id: makeinfo.h,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free + Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,13 +31,6 @@ /* Hardcoded per GNU standards, not dependent on argv[0]. */ DECLARE (char *, progname, "makeinfo"); - -enum reftype -{ - menu_reference, followed_reference -}; - -extern char *get_xref_token (); /* Nonzero means a string is in execution, as opposed to a file. */ DECLARE (int, executing_string, 0); @@ -44,8 +38,6 @@ DECLARE (int, executing_string, 0); /* Nonzero means to inhibit writing macro expansions to the output stream, because it has already been written. */ DECLARE (int, me_inhibit_expansion, 0); - -extern char *expansion (), *text_expansion (), *full_expansion (); /* Current output stream. */ DECLARE (FILE *, output_stream, NULL); @@ -67,6 +59,10 @@ DECLARE (int, output_column, 0); /* Position in the output file. */ DECLARE (int, output_position, 0); +/* Number of lines in the output. */ +DECLARE (int, output_line_number, 1); +DECLARE (int, node_line_number, 0); + /* The offset into OUTPUT_PARAGRAPH where we have a meta character produced by a markup such as @code or @dfn. */ DECLARE (int, meta_char_pos, -1); @@ -87,15 +83,29 @@ DECLARE (int, non_top_node_seen, 0); /* Nonzero indicates that indentation is temporarily turned off. */ DECLARE (int, no_indent, 1); +/* The amount of indentation to apply at the start of each line. */ +DECLARE (int, current_indent, 0); + +/* Nonzero means that we suppress the indentation of the first paragraph + following any section heading. */ +DECLARE (int, do_first_par_indent, 0); + +/* Amount by which @example indentation increases/decreases. */ +DECLARE (int, example_indentation_increment, 5); + +/* Amount by which @table, @defun, etc. indentation increases/decreases. */ +DECLARE (int, default_indentation_increment, 5); + +/* Amount by which xml indentation increases/decreases. + Zero means unnecessary whitespace is compressed. */ +DECLARE (int, xml_indentation_increment, 2); + /* Nonzero indicates that filling a line also indents the new line. */ DECLARE (int, indented_fill, 0); /* Nonzero means forcing output text to be flushright. */ DECLARE (int, force_flush_right, 0); -/* The amount of indentation to apply at the start of each line. */ -DECLARE (int, current_indent, 0); - /* The column at which long lines are broken. */ DECLARE (int, fill_column, 72); @@ -103,9 +113,6 @@ DECLARE (int, fill_column, 72); gets changed for cm_w (). */ DECLARE (int, non_splitting_words, 0); -/* Amount by which @example indentation increases/decreases. */ -DECLARE (int, default_indentation_increment, 5); - /* Nonzero means that we are currently hacking the insides of an insertion which would use a fixed width font. */ DECLARE (int, in_fixed_width_font, 0); @@ -113,21 +120,21 @@ DECLARE (int, in_fixed_width_font, 0); /* Nonzero if we are currently processing a multitable command */ DECLARE (int, multitable_active, 0); -/* Nonzero means that we're generating HTML. */ +/* Nonzero means that we're generating HTML. (--html) */ DECLARE (int, html, 0); -/* Nonzero means that we're generating XML. */ +/* Nonzero means that we're generating XML. (--xml) */ DECLARE (int, xml, 0); -/* Nonzero means that we're generating DocBook. */ +/* Nonzero means that we're generating DocBook. (--docbook) */ DECLARE (int, docbook, 0); -/* Nonzero means true 8-bit output for Info and plain text. */ +/* Nonzero means true 8-bit output for Info and plain text. + (--enable-encoding) */ DECLARE (int, enable_encoding, 0); /* Nonzero means escape characters in HTML output. */ DECLARE (int, escape_html, 1); -extern char *escape_string (); /* do HTML escapes */ /* Access key number for next menu entry to be generated (1 to 9, or 10 to mean no access key) */ @@ -148,11 +155,14 @@ DECLARE (char *, current_node, NULL); /* Command name in the process of being hacked. */ DECLARE (char *, command, NULL); +/* Nonzero if we have seen an @titlepage command. */ +DECLARE (int, titlepage_cmd_present, 0); + /* @copying ... @end copying. */ DECLARE (char *, copying_text, NULL); /* @documentdescription ... @end documentdescription. */ -DECLARE (char *, document_description, NULL); +DECLARE (const char *, document_description, NULL); /* Nonzero if the last character inserted has the syntax class of NEWLINE. */ DECLARE (int, last_char_was_newline, 1); @@ -173,10 +183,16 @@ DECLARE (char *, include_files_path, NULL); /* The filename of the current input file. This is never freed. */ DECLARE (char *, node_filename, NULL); +/* Name of CSS file to include, if any. (--css-include). */ +DECLARE (char *, css_include, NULL); + /* Nonzero means do not output "Node: Foo" for node separations, that is, generate plain text. (--no-headers) */ DECLARE (int, no_headers, 0); +/* Nonzero means that we process @docbook and @ifdocbook. (--ifdocbook) */ +DECLARE (int, process_docbook, 0); + /* Nonzero means that we process @html and @rawhtml even when not generating HTML. (--ifhtml) */ DECLARE (int, process_html, 0); @@ -194,6 +210,9 @@ DECLARE (int, process_plaintext, -1); /* Nonzero means that we process @tex and @iftex. (--iftex) */ DECLARE (int, process_tex, 0); +/* Nonzero means that we process @xml and @ifxml. (--ifxml) */ +DECLARE (int, process_xml, 0); + /* Maximum number of references to a single node before complaining. (--reference-limit) */ DECLARE (int, reference_warning_limit, 1000); @@ -204,8 +223,9 @@ DECLARE (int, validating, 1); /* Nonzero means print information about what is going on. (--verbose) */ DECLARE (int, verbose_mode, 0); -/* Nonzero means prefix each @chapter, ... with a number like 1. (--number-sections) */ -DECLARE (int, number_sections, 0); +/* Nonzero means prefix each @chapter, ... with a number like + 1, 1.1, etc. (--number-sections) */ +DECLARE (int, number_sections, 1); /* Nonzero means split size. When zero, DEFAULT_SPLIT_SIZE is used. */ DECLARE (int, split_size, 0); @@ -249,23 +269,27 @@ DECLARE (int, expensive_validation, 0); #define digit_value(c) ((c) - '0') #endif -#define HTML_SAFE "$-_.+!*'()" -#define URL_SAFE_CHAR(ch) (isalnum (ch) || strchr (HTML_SAFE, ch)) +/* These characters are not really HTML-safe (with strict XHTML), + and also there are possible collisions. That's the whole reason we + designed a new conversion scheme in the first place. But we + nevertheless need to generate the old names. See + `add_escaped_anchor_name' in html.c. */ +#define OLD_HTML_SAFE "$-_.+!*'()" +#define OLD_URL_SAFE_CHAR(ch) (strchr (OLD_HTML_SAFE, ch)) + +/* For the current/stable scheme. */ +#define URL_SAFE_CHAR(ch) (isalnum (ch)) #define COMMAND_PREFIX '@' #define END_VERBATIM "end verbatim" -/* Stuff for splitting large files. */ -#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */ -#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */ +/* Stuff for splitting large files. The numbers for Emacs + texinfo-format-buffer are much smaller, but memory capacities have + increased so much, 50k info files seem a bit tiny these days. */ +#define DEFAULT_SPLIT_SIZE 300000 DECLARE (int, splitting, 1); /* Defaults to true for now. */ -#define command_char(c) (!cr_or_whitespace(c) \ - && (c) != '{' \ - && (c) != '}' \ - && (c) != '=') - #define skip_whitespace() \ while ((input_text_offset != input_text_length) && \ whitespace (curchar())) \ @@ -287,4 +311,76 @@ DECLARE (int, splitting, 1); /* Defaults to true for now. */ #define looking_at(string) \ (strncmp (input_text + input_text_offset, string, strlen (string)) == 0) +/* Any list with a member named `next'. */ +typedef struct generic_list { + struct generic_list *next; +} GENERIC_LIST; + +/* Reverse the order of a list. */ +extern GENERIC_LIST * reverse_list (GENERIC_LIST *list); + +/* Possibly return Local Variables trailer for Info output. */ +extern char *info_trailer (void), + *expansion (char *str, int implicit_code), + *text_expansion (char *str), + *maybe_escaped_expansion (char *str, int implicit_code, int do_escape_html), + *full_expansion (char *str, int implicit_code); + +extern void free_and_clear (char **pointer), + add_word (char *string), + add_char (int character), + add_meta_char (int character), + close_single_paragraph (void), + insert_string (const char *), + insert (int character), + get_rest_of_line (int expand, char **string), + add_html_block_elt (char *string), + get_until_in_braces (char *match, char **string), + get_until_in_line (int expand, char *match, char **string), + canon_white (char *string), + discard_until (char *string), + indent (int amount), + kill_self_indent (int count), + backup_input_pointer (void), + inhibit_output_flushing (void), + uninhibit_output_flushing (void), + flush_output (void), + start_paragraph (void), + close_paragraph (void), + close_insertion_paragraph (void), + init_paragraph (void), + ignore_blank_line (void), + reader_loop (void), + discard_braces (void), + replace_with_expansion (int from, int *to), + fix_whitespace (char *string), + add_html_elt (char *string); + +extern int get_until (char *match, char **string), + set_paragraph_indent (char *string), + self_delimiting (int character), + search_forward (char *string, int from), + search_forward_until_pos (char *string, int from, int end_pos), + next_nonwhitespace_character (void), + fs_error (char *filename); + +#if defined (VA_FPRINTF) && __STDC__ +/* Unfortunately we must use prototypes if we are to use <stdarg.h>. */ +extern void add_word_args (const char *, ...), + add_html_block_elt_args (const char *, ...), + execute_string (char *, ...), + warning (const char *format, ...), + error (const char *format, ...), + line_error (const char *format, ...), + file_line_error (char *infile, int lno, const char *format, ...); +#else +extern void add_word_args (), + add_html_block_elt_args (), + execute_string (), + warning (), + error (), + line_error (), + file_line_error (); +#endif /* no prototypes */ + #endif /* not MAKEINFO_H */ diff --git a/gnu/usr.bin/texinfo/makeinfo/multi.c b/gnu/usr.bin/texinfo/makeinfo/multi.c index 0e311cee431..fde81c37fc0 100644 --- a/gnu/usr.bin/texinfo/makeinfo/multi.c +++ b/gnu/usr.bin/texinfo/makeinfo/multi.c @@ -1,7 +1,8 @@ -/* multi.c -- multitable stuff for makeinfo. - $Id: multi.c,v 1.6 2005/05/01 17:45:27 otto Exp $ +/* multi.c -- multiple-column tables (@multitable) for makeinfo. + $Id: multi.c,v 1.7 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,11 +18,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Written by phr@gnu.org (Paul Rubin). */ + Originally written by phr@gnu.org (Paul Rubin). */ #include "system.h" +#include "cmds.h" #include "insertion.h" #include "makeinfo.h" +#include "multi.h" #include "xml.h" #define MAXCOLS 100 /* remove this limit later @@ */ @@ -65,6 +68,13 @@ struct env /* index in environment table of currently selected environment */ static int current_env_no; +/* current column number */ +static int current_column_no; + +/* We need to make a difference between template based widths and + @columnfractions for HTML tables' sake. Sigh. */ +static int seen_column_fractions; + /* column number of last column in current multitable */ static int last_column; @@ -74,133 +84,13 @@ static int hsep, vsep; /* whether this is the first row. */ static int first_row; - -static void output_multitable_row (); -/* Output a row. Calls insert, but also flushes the buffered output - when we see a newline, since in multitable every line is a separate - paragraph. */ -static void -out_char (ch) - int ch; -{ - if (html) - add_char (ch); - else - { - int env = select_output_environment (0); - insert (ch); - if (ch == '\n') - { - uninhibit_output_flushing (); - flush_output (); - inhibit_output_flushing (); - } - select_output_environment (env); - } -} - - -void -draw_horizontal_separator () -{ - int i, j, s; - - if (html) - { - add_word ("<hr>"); - return; - } - if (xml) - return; - - for (s = 0; s < envs[0].current_indent; s++) - out_char (' '); - if (vsep) - out_char ('+'); - for (i = 1; i <= last_column; i++) { - for (j = 0; j <= envs[i].fill_column; j++) - out_char ('-'); - if (vsep) - out_char ('+'); - } - out_char ('\n'); -} - - -/* multitable strategy: - for each item { - for each column in an item { - initialize a new paragraph - do ordinary formatting into the new paragraph - save the paragraph away - repeat if there are more paragraphs in the column - } - dump out the saved paragraphs and free the storage - } - - For HTML we construct a simple HTML 3.2 table with <br>s inserted - to help non-tables browsers. `@item' inserts a <tr> and `@tab' - inserts <td>; we also try to close <tr>. The only real - alternative is to rely on the info formatting engine and present - preformatted text. */ - -void -do_multitable () -{ - int ncolumns; - - if (multitable_active) - { - line_error ("Multitables cannot be nested"); - return; - } - - close_single_paragraph (); - - /* scan the current item function to get the field widths - and number of columns, and set up the output environment list - accordingly. */ - /* if (docbook)*/ /* 05-08 */ - if (xml) - xml_no_para = 1; - ncolumns = setup_multitable_parameters (); - first_row = 1; - - /* <p> for non-tables browsers. @multitable implicitly ends the - current paragraph, so this is ok. */ - if (html) - add_word ("<p><table>"); - /* else if (docbook)*/ /* 05-08 */ - else if (xml) - { - int *widths = xmalloc (ncolumns * sizeof (int)); - int i; - for (i=0; i<ncolumns; i++) - widths[i] = envs[i+1].fill_column; - xml_begin_multitable (ncolumns, widths); - free (widths); - } - - if (hsep) - draw_horizontal_separator (); - - /* The next @item command will direct stdout into the first column - and start processing. @tab will then switch to the next column, - and @item will flush out the saved output and return to the first - column. Environment #1 is the first column. (Environment #0 is - the normal output) */ - - ++multitable_active; -} - /* Called to handle a {...} template on the @multitable line. We're at the { and our first job is to find the matching }; as a side effect, we change *PARAMS to point to after it. Our other job is to expand the template text and return the width of that string. */ static unsigned -find_template_width (params) - char **params; +find_template_width (char **params) { char *template, *xtemplate; unsigned len; @@ -240,12 +130,63 @@ find_template_width (params) return len; } +/* Direct current output to environment number N. Used when + switching work from one column of a multitable to the next. + Returns previous environment number. */ +static int +select_output_environment (int n) +{ + struct env *e = &envs[current_env_no]; + int old_env_no = current_env_no; + + /* stash current env info from global vars into the old environment */ + e->output_paragraph = output_paragraph; + e->output_paragraph_offset = output_paragraph_offset; + e->meta_char_pos = meta_char_pos; + e->output_column = output_column; + e->paragraph_is_open = paragraph_is_open; + e->current_indent = current_indent; + e->fill_column = fill_column; + + /* now copy new environment into global vars */ + current_env_no = n; + e = &envs[current_env_no]; + output_paragraph = e->output_paragraph; + output_paragraph_offset = e->output_paragraph_offset; + meta_char_pos = e->meta_char_pos; + output_column = e->output_column; + paragraph_is_open = e->paragraph_is_open; + current_indent = e->current_indent; + fill_column = e->fill_column; + return old_env_no; +} + +/* Initialize environment number ENV_NO, of width WIDTH. + The idea is that we're going to use one environment for each column of + a multitable, so we can build them up separately and print them + all out at the end. */ +static int +setup_output_environment (int env_no, int width) +{ + int old_env = select_output_environment (env_no); + + /* clobber old environment and set width of new one */ + init_paragraph (); + + /* make our change */ + fill_column = width; + + /* Save new environment and restore previous one. */ + select_output_environment (old_env); + + return env_no; +} /* Read the parameters for a multitable from the current command line, save the parameters away, and return the number of columns. */ -int -setup_multitable_parameters () +static int +setup_multitable_parameters (void) { char *params = insertion_stack->item_function; int nchars; @@ -258,6 +199,9 @@ setup_multitable_parameters () but TeX doesn't either. */ hsep = vsep = 0; + /* Assume no @columnfractions per default. */ + seen_column_fractions = 0; + while (*params) { while (whitespace (*params)) params++; @@ -271,6 +215,7 @@ setup_multitable_parameters () else if (strcmp (command, "@vsep") == 0) vsep++; else if (strcmp (command, "@columnfractions") == 0) { + seen_column_fractions = 1; /* Clobber old environments and create new ones, starting at #1. Environment #0 is the normal output, so don't mess with it. */ for ( ; i <= MAXCOLS; i++) { @@ -281,19 +226,26 @@ setup_multitable_parameters () number) and then non-whitespace (the number). */ while (*params && (*params == ' ' || *params == '\t')) params++; - /* Hmm, but what about @columnfractions 3foo. Well, I suppose + /* Hmm, but what about @columnfractions 3foo. Oh well, it's invalid input anyway. */ while (*params && *params != ' ' && *params != '\t' && *params != '\n' && *params != '@') params++; - setup_output_environment (i, - (int) (columnfrac * (fill_column - current_indent) + .5)); + + { + /* For html/xml/docbook, translate fractions into integer + percentages, adding .005 to avoid rounding problems. For + info, we want the character width. */ + int width = xml || html ? (columnfrac + .005) * 100 + : (columnfrac * (fill_column - current_indent) + .5); + setup_output_environment (i, width); + } } } } else if (*params == '{') { unsigned template_width = find_template_width (¶ms); - + /* This gives us two spaces between columns. Seems reasonable. How to take into account current_indent here? */ setup_output_environment (i++, template_width + 2); @@ -312,64 +264,130 @@ done: return last_column; } -/* Initialize environment number ENV_NO, of width WIDTH. - The idea is that we're going to use one environment for each column of - a multitable, so we can build them up separately and print them - all out at the end. */ -int -setup_output_environment (env_no, width) - int env_no; - int width; +/* Output a row. Calls insert, but also flushes the buffered output + when we see a newline, since in multitable every line is a separate + paragraph. */ +static void +out_char (int ch) { - int old_env = select_output_environment (env_no); + if (html || xml) + add_char (ch); + else + { + int env = select_output_environment (0); + insert (ch); + if (ch == '\n') + { + uninhibit_output_flushing (); + flush_output (); + inhibit_output_flushing (); + } + select_output_environment (env); + } +} - /* clobber old environment and set width of new one */ - init_paragraph (); - /* make our change */ - fill_column = width; +static void +draw_horizontal_separator (void) +{ + int i, j, s; - /* Save new environment and restore previous one. */ - select_output_environment (old_env); + if (html) + { + add_word ("<hr>"); + return; + } + if (xml) + return; - return env_no; + for (s = 0; s < envs[0].current_indent; s++) + out_char (' '); + if (vsep) + out_char ('+'); + for (i = 1; i <= last_column; i++) { + for (j = 0; j <= envs[i].fill_column; j++) + out_char ('-'); + if (vsep) + out_char ('+'); + } + out_char (' '); + out_char ('\n'); } -/* Direct current output to environment number N. Used when - switching work from one column of a multitable to the next. - Returns previous environment number. */ -int -select_output_environment (n) - int n; + +/* multitable strategy: + for each item { + for each column in an item { + initialize a new paragraph + do ordinary formatting into the new paragraph + save the paragraph away + repeat if there are more paragraphs in the column + } + dump out the saved paragraphs and free the storage + } + + For HTML we construct a simple HTML 3.2 table with <br>s inserted + to help non-tables browsers. `@item' inserts a <tr> and `@tab' + inserts <td>; we also try to close <tr>. The only real + alternative is to rely on the info formatting engine and present + preformatted text. */ + +void +do_multitable (void) { - struct env *e = &envs[current_env_no]; - int old_env_no = current_env_no; + int ncolumns; - /* stash current env info from global vars into the old environment */ - e->output_paragraph = output_paragraph; - e->output_paragraph_offset = output_paragraph_offset; - e->meta_char_pos = meta_char_pos; - e->output_column = output_column; - e->paragraph_is_open = paragraph_is_open; - e->current_indent = current_indent; - e->fill_column = fill_column; + if (multitable_active) + { + line_error ("Multitables cannot be nested"); + return; + } - /* now copy new environment into global vars */ - current_env_no = n; - e = &envs[current_env_no]; - output_paragraph = e->output_paragraph; - output_paragraph_offset = e->output_paragraph_offset; - meta_char_pos = e->meta_char_pos; - output_column = e->output_column; - paragraph_is_open = e->paragraph_is_open; - current_indent = e->current_indent; - fill_column = e->fill_column; - return old_env_no; + close_single_paragraph (); + + if (xml) + { + xml_no_para = 1; + if (output_paragraph[output_paragraph_offset-1] == '\n') + output_paragraph_offset--; + } + + /* scan the current item function to get the field widths + and number of columns, and set up the output environment list + accordingly. */ + ncolumns = setup_multitable_parameters (); + first_row = 1; + + /* <p> for non-tables browsers. @multitable implicitly ends the + current paragraph, so this is ok. */ + if (html) + add_html_block_elt ("<p><table summary=\"\">"); + /* else if (docbook)*/ /* 05-08 */ + else if (xml) + { + int *widths = xmalloc (ncolumns * sizeof (int)); + int i; + for (i=0; i<ncolumns; i++) + widths[i] = envs[i+1].fill_column; + xml_begin_multitable (ncolumns, widths); + free (widths); + } + + if (hsep) + draw_horizontal_separator (); + + /* The next @item command will direct stdout into the first column + and start processing. @tab will then switch to the next column, + and @item will flush out the saved output and return to the first + column. Environment #1 is the first column. (Environment #0 is + the normal output) */ + + ++multitable_active; } /* advance to the next environment number */ -void -nselect_next_environment () +static void +nselect_next_environment (void) { if (current_env_no >= last_column) { line_error (_("Too many columns in multitable item (max %d)"), last_column); @@ -381,8 +399,8 @@ nselect_next_environment () /* do anything needed at the beginning of processing a multitable column. */ -void -init_column () +static void +init_column (void) { /* don't indent 1st paragraph in the item */ cm_noindent (); @@ -391,49 +409,8 @@ init_column () skip_whitespace (); } -/* start a new item (row) of a multitable */ -int -multitable_item () -{ - if (!multitable_active) { - line_error ("multitable_item internal error: no active multitable"); - xexit (1); - } - - if (html) - { - if (!first_row) - add_word ("<br></td></tr>"); /* <br> for non-tables browsers. */ - add_word ("<tr align=\"left\"><td valign=\"top\">"); - first_row = 0; - return 0; - } - /* else if (docbook)*/ /* 05-08 */ - else if (xml) - { - xml_end_multitable_row (first_row); - first_row = 0; - return 0; - } - first_row = 0; - - if (current_env_no > 0) { - output_multitable_row (); - } - /* start at column 1 */ - select_output_environment (1); - if (!output_paragraph) { - line_error (_("Cannot select column #%d in multitable"), current_env_no); - exit (1); - } - - init_column (); - - return 0; -} - static void -output_multitable_row () +output_multitable_row (void) { /* offset in the output paragraph of the next char needing to be output for that column. */ @@ -518,18 +495,108 @@ output_multitable_row () } } +int after_headitem = 0; +int headitem_row = 0; + +/* start a new item (row) of a multitable */ +int +multitable_item (void) +{ + if (!multitable_active) { + line_error ("multitable_item internal error: no active multitable"); + xexit (1); + } + + current_column_no = 1; + + if (html) + { + if (!first_row) + /* <br> for non-tables browsers. */ + add_word_args ("<br></%s></tr>", after_headitem ? "th" : "td"); + + if (seen_column_fractions) + add_word_args ("<tr align=\"left\"><%s valign=\"top\" width=\"%d%%\">", + headitem_flag ? "th" : "td", + envs[current_column_no].fill_column); + else + add_word_args ("<tr align=\"left\"><%s valign=\"top\">", + headitem_flag ? "th" : "td"); + + if (headitem_flag) + after_headitem = 1; + else + after_headitem = 0; + first_row = 0; + headitem_row = headitem_flag; + headitem_flag = 0; + return 0; + } + /* else if (docbook)*/ /* 05-08 */ + else if (xml) + { + xml_end_multitable_row (first_row); + if (headitem_flag) + after_headitem = 1; + else + after_headitem = 0; + first_row = 0; + headitem_flag = 0; + return 0; + } + first_row = 0; + + if (current_env_no > 0) { + output_multitable_row (); + } + /* start at column 1 */ + select_output_environment (1); + if (!output_paragraph) { + line_error (_("[unexpected] cannot select column #%d in multitable"), + current_env_no); + xexit (1); + } + + init_column (); + + if (headitem_flag) + hsep = 1; + else + hsep = 0; + + if (headitem_flag) + after_headitem = 1; + else + after_headitem = 0; + headitem_flag = 0; + + return 0; +} + #undef CHAR_AT #undef CHAR_ADDR /* select a new column in current row of multitable */ void -cm_tab () +cm_tab (void) { if (!multitable_active) error (_("ignoring @tab outside of multitable")); + + current_column_no++; if (html) - add_word ("</td><td valign=\"top\">"); + { + if (seen_column_fractions) + add_word_args ("</%s><%s valign=\"top\" width=\"%d%%\">", + headitem_row ? "th" : "td", + headitem_row ? "th" : "td", + envs[current_column_no].fill_column); + else + add_word_args ("</%s><%s valign=\"top\">", + headitem_row ? "th" : "td", + headitem_row ? "th" : "td"); + } /* else if (docbook)*/ /* 05-08 */ else if (xml) xml_end_multitable_column (); @@ -542,7 +609,7 @@ cm_tab () /* close a multitable, flushing its output and resetting whatever needs resetting */ void -end_multitable () +end_multitable (void) { if (!html && !docbook) output_multitable_row (); @@ -556,7 +623,7 @@ end_multitable () close_insertion_paragraph (); if (html) - add_word ("<br></td></tr></table>\n"); + add_word_args ("<br></%s></tr></table>\n", headitem_row ? "th" : "td"); /* else if (docbook)*/ /* 05-08 */ else if (xml) xml_end_multitable (); diff --git a/gnu/usr.bin/texinfo/makeinfo/node.c b/gnu/usr.bin/texinfo/makeinfo/node.c index e00006f992a..d5be3730853 100644 --- a/gnu/usr.bin/texinfo/makeinfo/node.c +++ b/gnu/usr.bin/texinfo/makeinfo/node.c @@ -1,7 +1,8 @@ /* node.c -- nodes for Texinfo. - $Id: node.c,v 1.2 2002/12/09 00:45:36 millert Exp $ + $Id: node.c,v 1.3 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +21,7 @@ #include "system.h" #include "cmds.h" #include "files.h" +#include "float.h" #include "footnote.h" #include "macro.h" #include "makeinfo.h" @@ -29,12 +31,12 @@ #include "insertion.h" #include "xml.h" - /* See comments in node.h. */ NODE_REF *node_references = NULL; NODE_REF *node_node_references = NULL; TAG_ENTRY *tag_table = NULL; int node_number = -1; +int node_order = 0; int current_section = 0; int outstanding_node = 0; @@ -42,7 +44,7 @@ int outstanding_node = 0; /* Start a new tag table. */ void -init_tag_table () +init_tag_table (void) { while (tag_table) { @@ -60,8 +62,7 @@ init_tag_table () INDIRECT_P says how to format the output (it depends on whether the table is direct or indirect). */ static void -write_tag_table_internal (indirect_p) - int indirect_p; +write_tag_table_internal (int indirect_p) { TAG_ENTRY *node; int old_indent = no_indent; @@ -111,29 +112,37 @@ write_tag_table_internal (indirect_p) } void -write_tag_table () +write_tag_table (char *filename) { + output_stream = fopen (filename, "a"); + if (!output_stream) + { + fs_error (filename); + return; + } + write_tag_table_internal (0); /* Not indirect. */ + + if (fclose (output_stream) != 0) + fs_error (filename); } -void -write_tag_table_indirect () +static void +write_tag_table_indirect (void) { write_tag_table_internal (1); } /* Convert "top" and friends into "Top". */ static void -normalize_node_name (string) - char *string; +normalize_node_name (char *string) { if (strcasecmp (string, "Top") == 0) strcpy (string, "Top"); } -char * -get_node_token (expand) - int expand; +static char * +get_node_token (int expand) { char *string; @@ -153,8 +162,7 @@ get_node_token (expand) /* Expand any macros and other directives in a node name, and return the expanded name as an malloc'ed string. */ char * -expand_node_name (node) - char *node; +expand_node_name (char *node) { char *result = node; @@ -174,8 +182,7 @@ expand_node_name (node) /* Look up NAME in the tag table, and return the associated tag_entry. If the node is not in the table return NULL. */ TAG_ENTRY * -find_node (name) - char *name; +find_node (char *name) { TAG_ENTRY *tag = tag_table; char *expanded_name; @@ -222,9 +229,8 @@ find_node (name) /* Look in the tag table for a node whose file name is FNAME, and return the associated tag_entry. If there's no such node in the table, return NULL. */ -TAG_ENTRY * -find_node_by_fname (fname) - char *fname; +static TAG_ENTRY * +find_node_by_fname (char *fname) { TAG_ENTRY *tag = tag_table; while (tag) @@ -240,8 +246,7 @@ find_node_by_fname (fname) /* Remember next, prev, etc. references in a @node command, where we don't care about most of the entries. */ static void -remember_node_node_reference (node) - char *node; +remember_node_node_reference (char *node) { NODE_REF *temp = xmalloc (sizeof (NODE_REF)); int number; @@ -262,10 +267,9 @@ remember_node_node_reference (node) } /* Remember NODE and associates. */ -void -remember_node (node, prev, next, up, position, line_no, fname, flags) - char *node, *prev, *next, *up, *fname; - int position, line_no, flags; +static void +remember_node (char *node, char *prev, char *next, char *up, + int position, int line_no, char *fname, int flags) { /* Check for existence of this tag already. */ if (validating) @@ -306,8 +310,18 @@ remember_node (node, prev, next, up, position, line_no, fname, flags) node_number++; new->number = node_number; } - new->html_fname = fname; + if (fname) + new->html_fname = fname; + else + /* This happens for Top node under split-HTML, for example. */ + new->html_fname + = normalize_filename (filename_part (current_output_filename)); new->next_ent = tag_table; + + /* Increment the order counter, and save it. */ + node_order++; + new->order = node_order; + tag_table = new; } @@ -324,10 +338,7 @@ remember_node (node, prev, next, up, position, line_no, fname, flags) output file has been written, if validation is on, then we use the contents of `node_references' as a list of nodes to validate. */ void -remember_node_reference (node, line, type) - char *node; - int line; - enum reftype type; +remember_node_reference (char *node, int line, enum reftype type) { NODE_REF *temp = xmalloc (sizeof (NODE_REF)); int number = number_of_node (node); @@ -351,8 +362,7 @@ remember_node_reference (node, line, type) } static void -isolate_nodename (nodename) - char *nodename; +isolate_nodename (char *nodename) { int i, c; int paren_seen, paren; @@ -411,9 +421,7 @@ isolate_nodename (nodename) just before the menu line. If REMEMBER_REF is zero, REF_TYPE is unused. */ #define MENU_STARTER "* " char * -glean_node_from_menu (remember_ref, ref_type) - int remember_ref; - enum reftype ref_type; +glean_node_from_menu (int remember_ref, enum reftype ref_type) { int i, orig_offset = input_text_offset; char *nodename; @@ -467,22 +475,68 @@ glean_node_from_menu (remember_ref, ref_type) /* Set the name of the current output file. */ void -set_current_output_filename (fname) - const char *fname; +set_current_output_filename (const char *fname) { if (current_output_filename) free (current_output_filename); current_output_filename = xstrdup (fname); } + +/* Output the <a name="..."></a> constructs for NODE. We output both + the new-style conversion and the old-style, if they are different. + See comments at `add_escaped_anchor_name' in html.c. */ + +static void +add_html_names (char *node) +{ + char *tem = expand_node_name (node); + char *otem = xstrdup (tem); + + /* Determine if the old and new schemes come up with different names; + only output the old scheme if that is so. We don't want to output + the same name twice. */ + canon_white (otem); + { + char *optr = otem; + int need_old = 0; + + for (; *optr; optr++) + { + if (!cr_or_whitespace (*optr) && !URL_SAFE_CHAR (*optr)) + { + need_old = 1; + break; + } + } + + if (need_old) + { + add_word ("<a name=\""); + add_anchor_name (otem, -1); /* old anchor name conversion */ + add_word ("\"></a>\n"); + } + free (otem); + } + + /* Always output the new scheme. */ + canon_white (tem); + add_word ("<a name=\""); + add_anchor_name (tem, 0); + add_word ("\"></a>\n"); + + free (tem); +} + + /* The order is: nodename, nextnode, prevnode, upnode. If all of the NEXT, PREV, and UP fields are empty, they are defaulted. You must follow a node command which has those fields defaulted - with a sectioning command (e.g. @chapter) giving the "level" of that node. + with a sectioning command (e.g., @chapter) giving the "level" of that node. It is an error not to do so. The defaults come from the menu in this node's parent. */ void -cm_node () +cm_node (void) { static long epilogue_len = 0L; char *node, *prev, *next, *up; @@ -504,7 +558,6 @@ cm_node () if (!html && !already_outputting_pending_notes) { - if (!xml) close_paragraph (); output_pending_notes (); } @@ -580,6 +633,7 @@ cm_node () epilogue_len = ftell (output_stream) - pos1; fclose (output_stream); output_stream = NULL; + output_position = 0; tag = find_node_by_fname (fname_for_this_node); } free (fname_for_prev_node); @@ -589,13 +643,17 @@ cm_node () filling_enabled = indented_fill = 0; if (!html || (html && splitting)) current_footnote_number = 1; - + if (verbose_mode) printf (_("Formatting node %s...\n"), node); if (macro_expansion_output_stream && !executing_string) remember_itext (input_text, input_text_offset); + /* Reset the line number in each node for Info output, so that + index entries will save the line numbers of parent node. */ + node_line_number = 0; + no_indent = 1; if (xml) { @@ -603,7 +661,7 @@ cm_node () xml_begin_node (); if (!docbook) { - xml_insert_element (NODENAME, START); + xml_insert_element (NODENAME, START); if (macro_expansion_output_stream && !executing_string) me_execute_string (node); else @@ -615,6 +673,9 @@ cm_node () } else if (!no_headers && !html) { + /* Emacs Info reader cannot grok indented escape sequence. */ + kill_self_indent (-1); + add_word_args ("\037\nFile: %s, Node: ", pretty_output_filename); if (macro_expansion_output_stream && !executing_string) @@ -627,7 +688,7 @@ cm_node () /* Check for defaulting of this node's next, prev, and up fields. */ defaulting = (*next == 0 && *prev == 0 && *up == 0); - this_section = what_section (input_text + input_text_offset); + this_section = what_section (input_text + input_text_offset, NULL); /* If we are defaulting, then look at the immediately following sectioning command (error if none) to determine the node's @@ -652,7 +713,7 @@ cm_node () } line_error - (_("Node `%s' requires a sectioning command (e.g. %c%s)"), + (_("Node `%s' requires a sectioning command (e.g., %c%s)"), node, COMMAND_PREFIX, polite_section_name); } else @@ -673,6 +734,8 @@ cm_node () int orig_offset, orig_size; + int bye_offset = search_forward ("\n@bye", input_text_offset); + /* No matter what, make this file point back at `(dir)'. */ free (up); up = xstrdup ("(dir)"); /* html fixxme */ @@ -688,6 +751,7 @@ cm_node () input_text_offset = search_forward ("\n@menu", orig_offset); if (input_text_offset > -1 + && (bye_offset > -1 && input_text_offset < bye_offset) && cr_or_whitespace (input_text[input_text_offset + 6])) { char *nodename_from_menu = NULL; @@ -905,57 +969,67 @@ cm_node () } if (!splitting && no_headers) - { /* cross refs need a name="#anchor" even if we're not writing headers*/ - add_word ("<a name=\""); - tem = expand_node_name (node); - add_anchor_name (tem, 0); - add_word ("\"></a>"); - free (tem); + { /* cross refs need a name="#anchor" even if not writing headers */ + add_html_names (node); } if (splitting || !no_headers) - { /* Navigation bar. The <p> avoids the links area running - on with old Lynxen. */ + { /* Navigation bar. */ + add_html_block_elt ("<div class=\"node\">\n"); + /* The <p> avoids the links area running on with old Lynxen. */ add_word_args ("<p>%s\n", splitting ? "" : "<hr>"); - add_word_args ("%s<a name=\"", _("Node:")); - tem = expand_node_name (node); - add_anchor_name (tem, 0); - add_word_args ("\">%s</a>", tem); - free (tem); + + /* In the split HTML case, the filename is wrong for the + old-style converted names, but we'll add them anyway, for + consistency. (And we need them in the normal (not + no_headers) nonsplit case.) */ + add_html_names (node); if (next) { tem = expansion (next, 0); - add_word (",\n"); - add_word (_("Next:")); - add_word ("<a rel=next accesskey=n href=\""); + add_word ((char *) _("Next:")); + add_word (" "); + + add_word ("<a rel=\"next\" accesskey=\"n\" href=\""); add_anchor_name (tem, 1); + tem = escape_string (tem); add_word_args ("\">%s</a>", tem); + free (tem); + + if (prev || up) + add_word (",\n"); } if (prev) { tem = expansion (prev, 0); - add_word (",\n"); - add_word (_("Previous:")); - add_word ("<a rel=previous accesskey=p href=\""); + add_word ((char *) _("Previous:")); + add_word (" "); + add_word ("<a rel=\"previous\" accesskey=\"p\" href=\""); add_anchor_name (tem, 1); + tem = escape_string (tem); add_word_args ("\">%s</a>", tem); free (tem); + + if (up) + add_word (",\n"); } if (up) { tem = expansion (up, 0); - add_word (",\n"); - add_word (_("Up:")); - add_word ("<a rel=up accesskey=u href=\""); + add_word ((char *) _("Up:")); + add_word (" "); + add_word ("<a rel=\"up\" accesskey=\"u\" href=\""); add_anchor_name (tem, 1); + tem = escape_string (tem); add_word_args ("\">%s</a>", tem); free (tem); } /* html fixxme: we want a `top' or `contents' link here. */ - add_word_args ("\n%s<br>\n", splitting ? "<hr>" : ""); + add_word_args ("\n%s\n", splitting ? "<hr>" : ""); + add_word ("</div>\n"); } } else if (docbook) @@ -971,7 +1045,7 @@ cm_node () if (prev) { xml_insert_element (NODEPREV, START); - execute_string ("%s", prev); + execute_string ("%s", prev); xml_insert_element (NODEPREV, END); } if (up) @@ -1022,8 +1096,7 @@ cm_node () /* Cross-reference target at an arbitrary spot. */ void -cm_anchor (arg) - int arg; +cm_anchor (int arg) { char *anchor; char *fname_for_anchor = NULL; @@ -1034,6 +1107,9 @@ cm_anchor (arg) /* Parse the anchor text. */ anchor = get_xref_token (1); + /* Force all versions of "top" to be "Top". */ + normalize_node_name (anchor); + /* In HTML mode, need to actually produce some output. */ if (html) { @@ -1156,9 +1232,7 @@ cm_anchor (arg) /* Find NODE in REF_LIST. */ static NODE_REF * -find_node_reference (node, ref_list) - char *node; - NODE_REF *ref_list; +find_node_reference (char *node, NODE_REF *ref_list) { NODE_REF *orig_ref_list = ref_list; char *expanded_node; @@ -1196,7 +1270,7 @@ find_node_reference (node, ref_list) } void -free_node_references () +free_node_references (void) { NODE_REF *list, *temp; @@ -1214,7 +1288,7 @@ free_node_references () } void -free_node_node_references () +free_node_node_references (void) { NODE_REF *list, *temp; @@ -1233,8 +1307,7 @@ free_node_node_references () /* Return the number assigned to a named node in either the tag_table or node_references list or zero if no number has been assigned. */ int -number_of_node (node) - char *node; +number_of_node (char *node) { NODE_REF *temp_ref; TAG_ENTRY *temp_node = find_node (node); @@ -1256,10 +1329,7 @@ number_of_node (node) Menu, Cross, Next, etc. */ static int -validate (tag, line, label) - char *tag; - int line; - char *label; +validate (char *tag, int line, const char *label) { TAG_ENTRY *result; @@ -1274,7 +1344,7 @@ validate (tag, line, label) if (!result) { line_number = line; - line_error (_("%s reference to nonexistent node `%s'"), label, tag); + line_error (_("%s reference to nonexistent node `%s' (perhaps incorrect sectioning?)"), label, tag); return 0; } result->touched++; @@ -1284,9 +1354,8 @@ validate (tag, line, label) /* The strings here are followed in the message by `reference to...' in the `validate' routine. They are only used in messages, thus are translated. */ -static char * -reftype_type_string (type) - enum reftype type; +static const char * +reftype_type_string (enum reftype type) { switch (type) { @@ -1300,8 +1369,7 @@ reftype_type_string (type) } static void -validate_other_references (ref_list) - NODE_REF *ref_list; +validate_other_references (NODE_REF *ref_list) { char *old_input_filename = input_filename; @@ -1330,8 +1398,7 @@ validate_other_references (ref_list) If the Next is different from the Next of the Up, then the Next node must have a Prev pointing at this node. */ void -validate_file (tag_table) - TAG_ENTRY *tag_table; +validate_file (TAG_ENTRY *tag_table) { char *old_input_filename = input_filename; TAG_ENTRY *tags = tag_table; @@ -1370,14 +1437,14 @@ validate_file (tag_table) tem1 = expand_node_name (prev); tem2 = expand_node_name (tags->node); - if (STREQ (tem1, tem2)) + if (tem1 && tem2 && STREQ (tem1, tem2)) you_lose = 0; free (tem1); free (tem2); } if (you_lose) { - line_error (_("Next field of node `%s' not pointed to"), + line_error (_("Next field of node `%s' not pointed to (perhaps incorrect sectioning?)"), tags->node); file_line_error (temp_tag->filename, temp_tag->line_no, _("This node (%s) has the bad Prev"), @@ -1451,7 +1518,7 @@ validate_file (tag_table) if (!tags->up && !(tags->flags & TAG_FLAG_ANCHOR) && strcasecmp (tags->node, "Top") != 0) - line_error (_("`%s' has no Up field"), tags->node); + line_error (_("`%s' has no Up field (perhaps incorrect sectioning?)"), tags->node); else if (tags->up) { int valid_p = validate (tags->up, tags->line_no, _("Up")); @@ -1576,8 +1643,7 @@ validate_file (tag_table) This means only anchors follow. */ static int -last_node_p (tags) - TAG_ENTRY *tags; +last_node_p (TAG_ENTRY *tags) { int last = 1; while (tags->next_ent) { @@ -1590,28 +1656,96 @@ last_node_p (tags) break; } } - + return last; } +static char * +enumerate_filename (char *pathname, char *basename, int number) +{ + /* Do we need to generate names of subfiles which don't exceed 8+3 limits? */ + const int dos_file_names = !HAVE_LONG_FILENAMES (pathname ? pathname : "."); + unsigned name_len = strlen (basename); + char *filename = xmalloc (10 + strlen (pathname) + name_len); + char *base_filename = xmalloc (10 + name_len); + + sprintf (base_filename, "%s-%d", basename, number); + + if (dos_file_names) + { + char *dot = strchr (base_filename, '.'); + unsigned base_len = strlen (base_filename); + + if (dot) + { /* Make foobar.i1, .., foobar.i99, foobar.100, ... */ + dot[1] = 'i'; + memmove (number <= 99 ? dot + 2 : dot + 1, + base_filename + name_len + 1, + strlen (base_filename + name_len + 1) + 1); + } + else if (base_len > 8) + { + /* Make foobar-1, .., fooba-10, .., foob-100, ... */ + unsigned numlen = base_len - name_len; + + memmove (base_filename + 8 - numlen, base_filename + name_len, numlen + 1); + } + } + + sprintf (filename, "%s%s", pathname, base_filename); + + return filename; +} + +/* Remove previously split files, to avoid + lingering parts of shrinked documents. */ +void +clean_old_split_files (char *filename) +{ + char *root_filename = filename_part (filename); + char *root_pathname = pathname_part (filename); + int i; + + /* We break as soon as we hit an inexistent file, + so looping until large numbers is harmless. */ + for (i = 1; i < 1000; i++) + { + struct stat st; + char *check_file = enumerate_filename (root_pathname, root_filename, i); + + if (stat (check_file, &st) != 0) + break; + else if (!S_ISDIR (st.st_mode)) + { + /* Give feedback if requested, removing a file is important. */ + if (verbose_mode) + printf (_("Removing %s\n"), check_file); + + /* Warn user that we cannot remove the file. */ + if (unlink (check_file) != 0) + warning (_("Can't remove file `%s': %s"), check_file, strerror (errno)); + } + + free (check_file); + } +} + + /* Split large output files into a series of smaller files. Each file is pointed to in the tag table, which then gets written out as the original file. The new files have the same name as the original file with a "-num" attached. SIZE is the largest number of bytes to allow in any single split file. */ void -split_file (filename, size) - char *filename; - int size; +split_file (char *filename, int size) { char *root_filename, *root_pathname; - char *the_file, *filename_part (); + char *the_file; struct stat fileinfo; long file_size; char *the_header; int header_size; - int dos_file_names = 0; /* if nonzero, don't exceed 8+3 limits */ /* Can only do this to files with tag tables. */ if (!tag_table) @@ -1620,21 +1754,18 @@ split_file (filename, size) if (size == 0) size = DEFAULT_SPLIT_SIZE; - if ((stat (filename, &fileinfo) != 0) || - (((long) fileinfo.st_size) < SPLIT_SIZE_THRESHOLD)) + if ((stat (filename, &fileinfo) != 0) + || (((long) fileinfo.st_size) < size)) return; file_size = (long) fileinfo.st_size; - the_file = find_and_load (filename); + the_file = find_and_load (filename, 0); if (!the_file) return; root_filename = filename_part (filename); root_pathname = pathname_part (filename); - /* Do we need to generate names of subfiles which don't exceed 8+3 limits? */ - dos_file_names = !HAVE_LONG_FILENAMES (root_pathname ? root_pathname : "."); - if (!root_pathname) root_pathname = xstrdup (""); @@ -1648,6 +1779,10 @@ split_file (filename, size) TAG_ENTRY *tags = tag_table; char *indirect_info = NULL; + /* Maybe we want a Local Variables section. */ + char *trailer = info_trailer (); + int trailer_len = trailer ? strlen (trailer) : 0; + /* Remember the `header' of this file. The first tag in the file is the bottom of the header; the top of the file is the start. */ the_header = xmalloc (1 + (header_size = tags->position)); @@ -1733,43 +1868,18 @@ split_file (filename, size) write_region: { int fd; - char *split_filename, *split_basename; - unsigned root_len = strlen (root_filename); - - split_filename = xmalloc (10 + strlen (root_pathname) - + root_len); - split_basename = xmalloc (10 + root_len); - sprintf (split_basename, "%s-%d", root_filename, which_file); - if (dos_file_names) - { - char *dot = strchr (split_basename, '.'); - unsigned base_len = strlen (split_basename); - - if (dot) - { /* Make foobar.i1, .., foobar.i99, foobar.100, ... */ - dot[1] = 'i'; - memmove (which_file <= 99 ? dot + 2 : dot + 1, - split_basename + root_len + 1, - strlen (split_basename + root_len + 1) + 1); - } - else if (base_len > 8) - { - /* Make foobar-1, .., fooba-10, .., foob-100, ... */ - unsigned numlen = base_len - root_len; - - memmove (split_basename + 8 - numlen, - split_basename + root_len, numlen + 1); - } - } - sprintf (split_filename, "%s%s", root_pathname, - split_basename); + char *split_filename = enumerate_filename (root_pathname, + root_filename, which_file); + char *split_basename = filename_part (split_filename); fd = open (split_filename, O_WRONLY|O_TRUNC|O_CREAT, 0666); if (fd < 0 || write (fd, the_header, header_size) != header_size || write (fd, the_file + file_top, file_bot - file_top) != (file_bot - file_top) - || (close (fd)) < 0) + || (trailer_len + && write (fd, trailer, trailer_len) != trailer_len) + || close (fd) < 0) { perror (split_filename); if (fd != -1) @@ -1814,7 +1924,16 @@ split_file (filename, size) /* Inhibit newlines. */ paragraph_is_open = 0; + /* Write the indirect tag table. */ write_tag_table_indirect (); + + /* preserve local variables in info output. */ + if (trailer) + { + fwrite (trailer, 1, trailer_len, output_stream); + free (trailer); + } + fclose (output_stream); free (the_header); free (the_file); diff --git a/gnu/usr.bin/texinfo/mkinstalldirs b/gnu/usr.bin/texinfo/mkinstalldirs index a4d0943e42b..6fbe5e11762 100644 --- a/gnu/usr.bin/texinfo/mkinstalldirs +++ b/gnu/usr.bin/texinfo/mkinstalldirs @@ -1,40 +1,150 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Public domain -# $Id: mkinstalldirs,v 1.4 2002/06/10 13:51:01 espie Exp $ +scriptversion=2004-02-15.20 + +# Original author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to <bug-automake@gnu.org>." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit 0 + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" + mkdir "$pathcomp" || lasterr=$? - mkdir "$pathcomp" || lasterr=$? + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi - pathcomp="$pathcomp/" - done + pathcomp="$pathcomp/" + done done exit $errstatus -# mkinstalldirs ends here +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/gnu/usr.bin/texinfo/po/ChangeLog b/gnu/usr.bin/texinfo/po/ChangeLog index af1087b1751..b965d4e334d 100644 --- a/gnu/usr.bin/texinfo/po/ChangeLog +++ b/gnu/usr.bin/texinfo/po/ChangeLog @@ -1,9 +1,14 @@ -2002-03-14 gettextize <bug-gnu-gettext@gnu.org> +2004-02-05 gettextize <bug-gnu-gettext@gnu.org> - * ORIG: New file, from gettext-0.11.1. + * Makefile.in.in: Upgrade to gettext-0.14.1. + * ORIG: New file, from gettext-0.14.1. + * Rules-quot: Upgrade to gettext-0.14.1. -2002-03-14 gettextize <bug-gnu-gettext@gnu.org> +2003-12-20 gettextize <bug-gnu-gettext@gnu.org> - * ORIG: New file, from gettext-0.11.1. - * remove-potcdate.sin: New file, from gettext-0.11.1. + * ORIG: New file, from gettext-0.13.1. + +2003-12-13 gettextize <bug-gnu-gettext@gnu.org> + + * ORIG: New file, from gettext-0.13. diff --git a/gnu/usr.bin/texinfo/po/Makefile.in.in b/gnu/usr.bin/texinfo/po/Makefile.in.in index f1ff1f13a49..a5293c1bbb5 100644 --- a/gnu/usr.bin/texinfo/po/Makefile.in.in +++ b/gnu/usr.bin/texinfo/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu> +# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu> # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -7,6 +7,8 @@ # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. +# +# Origin: gettext-0.14 PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -27,7 +29,7 @@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ -mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` +mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ @@ -42,9 +44,9 @@ POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ -DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) @@ -55,7 +57,7 @@ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: -.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ @@ -74,18 +76,35 @@ CATALOGS = @CATALOGS@ all: all-@USE_NLS@ -all-yes: $(CATALOGS) +all-yes: stamp-po all-no: +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ @@ -101,25 +120,37 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed fi; \ } +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ - cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ - for file in $(DISTFILES.common); do \ + for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ else \ : ; \ fi @@ -170,7 +201,7 @@ install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ @@ -215,8 +246,8 @@ installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ - if test "$(PACKAGE)" = "gettext"; then \ - for file in $(DISTFILES.common); do \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ @@ -235,10 +266,11 @@ uninstall-data-yes: check: all -dvi info tags TAGS ID: +info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed + rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o @@ -250,7 +282,7 @@ distclean: clean maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) + rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: @@ -259,7 +291,17 @@ dist distdir: # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ - if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ @@ -271,14 +313,21 @@ dist2: $(DISTFILES) update-po: Makefile $(MAKE) $(DOMAIN).pot-update - $(MAKE) $(UPDATEPOFILES) + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ @@ -305,7 +354,7 @@ $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: -Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in +Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status diff --git a/gnu/usr.bin/texinfo/po/fr.gmo b/gnu/usr.bin/texinfo/po/fr.gmo Binary files differindex 0805f61e5a2..daa9765f606 100644 --- a/gnu/usr.bin/texinfo/po/fr.gmo +++ b/gnu/usr.bin/texinfo/po/fr.gmo diff --git a/gnu/usr.bin/texinfo/po/fr.po b/gnu/usr.bin/texinfo/po/fr.po index a52316ad8ec..c2851edf402 100644 --- a/gnu/usr.bin/texinfo/po/fr.po +++ b/gnu/usr.bin/texinfo/po/fr.po @@ -1,144 +1,151 @@ -# Version française du progiciel Texinfo-4.0b. -# Copyright © 1999, 2001 Free Software Foundation, Inc. +# Version française du progiciel texinfo +# Copyright © 2004 Free Software Foundation, Inc. +# Michel Robitaille <robitail@iro.umontreal.ca>, traducteur depuis/since 1996. +# +# Laurent Bourbeau est le traducteur officiel mais depuis plus d'un +# an, Michel assume la traduction avec l'accord de Laurent. +# # Laurent Bourbeau <bourbeau@progiciels-bpi.ca>, 2001. # msgid "" msgstr "" -"Project-Id-Version: texinfo 4.1c\n" -"POT-Creation-Date: 2002-04-01 06:10-0800\n" -"PO-Revision-Date: 2002-03-25 10:00-05:00\n" +"Project-Id-Version: texinfo 4.7.90\n" +"Report-Msgid-Bugs-To: bug-texinfo@gnu.org\n" +"POT-Creation-Date: 2004-12-21 16:20-0800\n" +"PO-Revision-Date: 2004-12-06 08:00-05:00\n" "Last-Translator: Laurent Bourbeau <bourbeau@progiciels-bpi.ca>\n" "Language-Team: French <traduc@traduc.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: info/echo-area.c:283 info/session.c:712 +#: info/echo-area.c:284 info/session.c:689 msgid "Move forward a character" msgstr "Avancer d'un caractère" -#: info/echo-area.c:295 info/session.c:728 +#: info/echo-area.c:296 info/session.c:705 msgid "Move backward a character" msgstr "Reculer d'un caractère" -#: info/echo-area.c:307 +#: info/echo-area.c:308 msgid "Move to the start of this line" msgstr "Se déplacer au début de cette ligne" -#: info/echo-area.c:312 +#: info/echo-area.c:313 msgid "Move to the end of this line" msgstr "Se déplacer à la fin de cette ligne" -#: info/echo-area.c:320 info/session.c:746 +#: info/echo-area.c:321 info/session.c:723 msgid "Move forward a word" msgstr "Avancer d'un mot" -#: info/echo-area.c:360 info/session.c:795 +#: info/echo-area.c:361 info/session.c:772 msgid "Move backward a word" msgstr "Reculer d'un mot" -#: info/echo-area.c:400 +#: info/echo-area.c:401 msgid "Delete the character under the cursor" msgstr "Éliminer le caractère sous le curseur" -#: info/echo-area.c:430 +#: info/echo-area.c:431 msgid "Delete the character behind the cursor" msgstr "Éliminer le caractère précédent le curseur" -#: info/echo-area.c:451 +#: info/echo-area.c:452 msgid "Cancel or quit operation" msgstr "Annuler ou opération de quitter" -#: info/echo-area.c:466 +#: info/echo-area.c:467 msgid "Accept (or force completion of) this line" msgstr "Accepter cette ligne (ou en forcer la complétion)" -#: info/echo-area.c:471 +#: info/echo-area.c:472 msgid "Insert next character verbatim" msgstr "Insérer le prochain caractère textuellement" -#: info/echo-area.c:479 +#: info/echo-area.c:480 msgid "Insert this character" msgstr "Insérer ce caractère" -#: info/echo-area.c:497 +#: info/echo-area.c:498 msgid "Insert a TAB character" msgstr "Insérer un caractère TAB (tabulation)" -#: info/echo-area.c:504 +#: info/echo-area.c:505 msgid "Transpose characters at point" msgstr "Transposer les caractères en position du point courant" -#: info/echo-area.c:555 +#: info/echo-area.c:556 msgid "Yank back the contents of the last kill" msgstr "Recoller le contenu du dernier effacement" -#: info/echo-area.c:562 +#: info/echo-area.c:563 msgid "Kill ring is empty" msgstr "L'anneau des effacements temporaires est vide" -#: info/echo-area.c:575 +#: info/echo-area.c:576 msgid "Yank back a previous kill" msgstr "Recoller un effacement antérieur" -#: info/echo-area.c:608 +#: info/echo-area.c:609 msgid "Kill to the end of the line" msgstr "Effacer du point courant jusqu'à la fin de la ligne" -#: info/echo-area.c:621 +#: info/echo-area.c:622 msgid "Kill to the beginning of the line" msgstr "Effacer du point courant jusqu'au début de la ligne" -#: info/echo-area.c:633 +#: info/echo-area.c:634 msgid "Kill the word following the cursor" msgstr "Effacer le mot suivant le curseur" -#: info/echo-area.c:652 +#: info/echo-area.c:653 msgid "Kill the word preceding the cursor" msgstr "Effacer le mot précédent le curseur" -#: info/echo-area.c:872 info/echo-area.c:932 +#: info/echo-area.c:868 info/echo-area.c:924 msgid "No completions" msgstr "Aucune complétion" -#: info/echo-area.c:874 +#: info/echo-area.c:870 msgid "Not complete" msgstr "Non complet" -#: info/echo-area.c:919 +#: info/echo-area.c:911 msgid "List possible completions" msgstr "Énumérer les complétions possibles" -#: info/echo-area.c:936 +#: info/echo-area.c:928 msgid "Sole completion" msgstr "Une seule complétion" -#: info/echo-area.c:945 +#: info/echo-area.c:937 msgid "One completion:\n" msgstr "Une complétion:\n" -#: info/echo-area.c:946 +#: info/echo-area.c:938 #, c-format msgid "%d completions:\n" msgstr "%d complétions:\n" -#: info/echo-area.c:1092 +#: info/echo-area.c:1085 msgid "Insert completion" msgstr "Insérer la complétion" -#: info/echo-area.c:1225 +#: info/echo-area.c:1220 msgid "Building completions..." msgstr "Construction des complétions..." -#: info/echo-area.c:1342 +#: info/echo-area.c:1340 msgid "Scroll the completions window" msgstr "Dérouler la fenêtre des complétions" -#: info/footnotes.c:212 +#: info/footnotes.c:213 msgid "Footnotes could not be displayed" msgstr "Les notes en bas de page ne peuvent pas être affichées" -#: info/footnotes.c:238 +#: info/footnotes.c:239 msgid "Show the footnotes associated with this node in another window" msgstr "" "Montrer les notes en bas de page associées à ce noeud dans une autre fenêtre" @@ -148,114 +155,113 @@ msgstr "" msgid "---------- Footnotes ----------" msgstr "----- Notes de bas de page ----" -#: info/indices.c:175 +#: info/indices.c:172 msgid "Look up a string in the index for this file" msgstr "Rechercher une chaîne dans l'index pour ce fichier" -#: info/indices.c:205 +#: info/indices.c:199 msgid "Finding index entries..." msgstr "Recherche des entrées d'index..." -#: info/indices.c:212 +#: info/indices.c:207 msgid "No indices found." msgstr "Aucun indice retrouvé." -#: info/indices.c:222 +#: info/indices.c:217 msgid "Index entry: " msgstr "Entrée d'index: " -#: info/indices.c:332 +#: info/indices.c:325 msgid "" "Go to the next matching index item from the last `\\[index-search]' command" msgstr "" "Aller à prochaine référence d'index à partir de la dernière commande « " "\\[index-search] » " -#: info/indices.c:342 +#: info/indices.c:335 msgid "No previous index search string." msgstr "Aucune autre chaîne de fouille d'index." -#: info/indices.c:349 +#: info/indices.c:342 msgid "No index entries." msgstr "Aucune entrée d'index." -#: info/indices.c:382 +#: info/indices.c:375 #, c-format -msgid "No %sindex entries containing \"%s\"." +msgid "No %sindex entries containing `%s'." msgstr "Aucune entrée %sindex contenant « %s »." -#: info/indices.c:383 +#: info/indices.c:376 msgid "more " msgstr "plus " -#: info/indices.c:393 +#: info/indices.c:386 msgid "CAN'T SEE THIS" msgstr "NE PEUT PAS VOIR CECI" -#: info/indices.c:429 +#: info/indices.c:422 #, c-format -msgid "Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)" +msgid "Found `%s' in %s. (`\\[next-index-match]' tries to find next.)" msgstr "" -"Trouver « %s » dans %s. (« \\[next-index-match] » cherchera le prochain.)" +"« %s » repéré dans %s. (« \\[next-index-match] » cherchera le prochain.)" -#: info/indices.c:549 +#: info/indices.c:541 #, c-format -msgid "Scanning indices of \"%s\"..." +msgid "Scanning indices of `%s'..." msgstr "Fouille des indices de « %s »..." -#: info/indices.c:603 +#: info/indices.c:596 #, c-format -msgid "No available info files have \"%s\" in their indices." -msgstr "Aucun fichier info disponible n'a « %s » dans leur indices." +msgid "No available info files have `%s' in their indices." +msgstr "Aucun fichier info disponible n'a « %s » dans leurs indices." -#: info/indices.c:632 +#: info/indices.c:622 msgid "Grovel all known info file's indices for a string and build a menu" msgstr "" "Aplatir tous les indices de fichier Info connus pour une chaîne et " "construire un menu" -#: info/indices.c:636 +#: info/indices.c:626 msgid "Index apropos: " msgstr "Index à-propos: " -#: info/indices.c:666 +#: info/indices.c:654 #, c-format msgid "" "\n" -"* Menu: Nodes whoses indices contain \"%s\":\n" +"* Menu: Nodes whose indices contain `%s':\n" msgstr "" "\n" -"* Menu: Noeuds dont les indices contiennent « %s »:\n" +"* Menu: Noeuds dont les indices contiennent \"%s\":\n" -#: info/info.c:260 info/infokey.c:884 +#: info/info.c:275 info/infokey.c:899 +#, c-format msgid "Try --help for more information.\n" msgstr "Utiliser --help pour plus d'informations.\n" -#: info/info.c:279 info/infokey.c:139 makeinfo/makeinfo.c:689 -#: util/install-info.c:1224 util/texindex.c:338 +#: info/info.c:295 makeinfo/makeinfo.c:766 util/install-info.c:1266 +#: util/texindex.c:343 #, c-format msgid "" -"Copyright (C) %s Free Software Foundation, Inc.\n" "There is NO warranty. You may redistribute this software\n" "under the terms of the GNU General Public License.\n" "For more information about these matters, see the files named COPYING.\n" msgstr "" -"Copyright © %s Free Software Foundation, Inc.\n" "AUCUNE garantie n'est donnée. Vous pouvez redistribuer des copies\n" "de ce logiciel selon les termes de la licence GNU General Public License.\n" "Pour plus d'informations, consultez le fichier COPYING.\n" -#: info/info.c:462 +#: info/info.c:498 #, c-format msgid "no index entries found for `%s'\n" msgstr "aucune entrée d'index retrouvée pour « %s »\n" -#: info/info.c:555 +#: info/info.c:590 msgid " -b, --speech-friendly be friendly to speech synthesizers.\n" msgstr "" " -b, --speech-friendly Être compatible au synthétiseur de voix.\n" -#: info/info.c:562 +#: info/info.c:597 #, c-format msgid "" "Usage: %s [OPTION]... [MENU-ITEM...]\n" @@ -272,10 +278,12 @@ msgid "" " --index-search=STRING go to node pointed by index entry STRING.\n" " -n, --node=NODENAME specify nodes in first visited Info file.\n" " -o, --output=FILENAME output selected nodes to FILENAME.\n" -" -R, --raw-escapes don't remove ANSI escapes from man pages.\n" +" -R, --raw-escapes output \"raw\" ANSI escapes (default).\n" +" --no-raw-escapes output escapes as literal text.\n" " --restore=FILENAME read initial keystrokes from FILENAME.\n" " -O, --show-options, --usage go to command-line options node.\n" "%s --subnodes recursively output menu items.\n" +" -w, --where, --location print physical location of Info file.\n" " --vi-keys use vi-like and less-like key bindings.\n" " --version display version information and exit.\n" "\n" @@ -311,6 +319,8 @@ msgstr "" " -o, --output=FICHIER Écrire dans FICHIER les noeuds sélectionnés.\n" " -R, --raw-escapes Ne pas enlever les séquences d'échappements " "ANSI des man pages.\n" +" --no-raw-escapes Fournir les séquences d'échappements comme du " +"texte.\n" " --restore=FICHIER Lire du FICHIER les clés-clavier initiales.\n" " -O, --show-options, --usage Aller au noeud des options de ligne-de-" "commande.\n" @@ -338,8 +348,8 @@ msgstr "" " info -f ./foo.info Montrer le fichier ./foo.info, sans chercher " "dir\n" -#: info/info.c:598 info/infokey.c:903 makeinfo/makeinfo.c:474 -#: util/install-info.c:421 util/texindex.c:286 +#: info/info.c:635 info/infokey.c:918 makeinfo/makeinfo.c:465 +#: util/install-info.c:466 util/texindex.c:292 msgid "" "\n" "Email bug reports to bug-texinfo@gnu.org,\n" @@ -351,76 +361,76 @@ msgstr "" "vos questions et autre discussion à help-texinfo@gnu.org.\n" "Site de Texinfo: http://www.gnu.org/software/texinfo/" -#: info/info.c:632 +#: info/info.c:669 #, c-format msgid "Cannot find node `%s'." msgstr "Ne peut pas trouver le noeud « %s »." -#: info/info.c:633 +#: info/info.c:670 #, c-format msgid "Cannot find node `(%s)%s'." msgstr "Ne peut pas trouver le noeud « (%s)%s »." -#: info/info.c:634 +#: info/info.c:671 msgid "Cannot find a window!" msgstr "Ne peut pas trouver une fenêtre permanente!" -#: info/info.c:635 +#: info/info.c:672 msgid "Point doesn't appear within this window's node!" msgstr "Le point courant n'apparaît pas dans ce noeud de fenêtre!" -#: info/info.c:636 +#: info/info.c:673 msgid "Cannot delete the last window." msgstr "Ne peut pas éliminer la dernière fenêtre." -#: info/info.c:637 +#: info/info.c:674 msgid "No menu in this node." msgstr "Aucun menu dans ce noeud." -#: info/info.c:638 +#: info/info.c:675 msgid "No footnotes in this node." msgstr "Aucune note de bas de page dans ce noeud." -#: info/info.c:639 +#: info/info.c:676 msgid "No cross references in this node." msgstr "Aucune référence croisée dans ce noeud." -#: info/info.c:640 +#: info/info.c:677 #, c-format msgid "No `%s' pointer for this node." msgstr "Aucun pointeur « %s » pour ce noeud." -#: info/info.c:641 +#: info/info.c:678 #, c-format msgid "Unknown Info command `%c'; try `?' for help." msgstr "Commande Info « %c> » inconnue; essayer « ? » pour de l'aide." -#: info/info.c:642 +#: info/info.c:679 #, c-format msgid "Terminal type `%s' is not smart enough to run Info." msgstr "Le type de terminal « %s » n'est pas en mesure de rouler Info." -#: info/info.c:643 +#: info/info.c:680 msgid "You are already at the last page of this node." msgstr "Vous êtes déjà au point terminal de ce noeud." -#: info/info.c:644 +#: info/info.c:681 msgid "You are already at the first page of this node." msgstr "Vous êtes déjà au point initial de ce noeud." -#: info/info.c:645 +#: info/info.c:682 msgid "Only one window." msgstr "Une seule fenêtre." -#: info/info.c:646 +#: info/info.c:683 msgid "Resulting window would be too small." msgstr "La fenêtre résultante sera trop petite." -#: info/info.c:647 +#: info/info.c:684 msgid "Not enough room for a help window, please delete a window." msgstr "Pas assez de place pour une fenêtre d'aide, fermer svp une fenêtre." -#: info/infodoc.c:45 info/infodoc.c:94 +#: info/infodoc.c:46 info/infodoc.c:95 msgid "" "Basic Commands in Info Windows\n" "******************************\n" @@ -428,20 +438,20 @@ msgstr "" "Commandes de base en Info Windows\n" "---------------------------------\n" -#: info/infodoc.c:48 +#: info/infodoc.c:49 msgid "\\%-10[quit-help] Quit this help.\n" msgstr "\\%-10[quit-help] Quitter ce menu d'aide.\n" -#: info/infodoc.c:49 +#: info/infodoc.c:50 msgid "\\%-10[quit] Quit Info altogether.\n" msgstr "\\%-10[quit] Quitter complètement le mode Info.\n" -#: info/infodoc.c:50 +#: info/infodoc.c:51 msgid "\\%-10[get-info-help-node] Invoke the Info tutorial.\n" msgstr "\\%-10[get-info-help-node] Faire appel au tutoriel Info.\n" # Est-ce vraiment un message à traduire? NON. -#: info/infodoc.c:52 info/infodoc.c:101 +#: info/infodoc.c:53 info/infodoc.c:102 msgid "" "Selecting other nodes:\n" "----------------------\n" @@ -449,19 +459,19 @@ msgstr "" "Sélection d'autres modes:\n" "------------------------\n" -#: info/infodoc.c:54 +#: info/infodoc.c:55 msgid "\\%-10[next-node] Move to the \"next\" node of this node.\n" msgstr "\\%-10[next-node] Aller au noeud « next » de ce noeud.\n" -#: info/infodoc.c:55 +#: info/infodoc.c:56 msgid "\\%-10[prev-node] Move to the \"previous\" node of this node.\n" msgstr "\\%-10[prev-node] Aller au noeud « previous » de ce noeud.\n" -#: info/infodoc.c:56 +#: info/infodoc.c:57 msgid "\\%-10[up-node] Move \"up\" from this node.\n" msgstr "\\%-10[up-node] Aller au noeud « up » à partir de ce noeud.\n" -#: info/infodoc.c:57 +#: info/infodoc.c:58 msgid "" "\\%-10[menu-item] Pick menu item specified by name.\n" " Picking a menu item causes another node to be selected.\n" @@ -469,26 +479,26 @@ msgstr "" "\\%-10[menu-item] Choisir un item menu à partir de son nom.\n" " Choisir un item menu provoque la sélection d'un autre noeud.\n" -#: info/infodoc.c:59 +#: info/infodoc.c:60 msgid "" "\\%-10[xref-item] Follow a cross reference. Reads name of reference.\n" msgstr "" "\\%-10[xref-item] Suivre une référence croisée. Lire le nom de la " "référence.\n" -#: info/infodoc.c:60 +#: info/infodoc.c:61 msgid "\\%-10[history-node] Move to the last node seen in this window.\n" msgstr "" "\\%-10[history-node] Aller au dernier noeud observé dans cette fenêtre.\n" -#: info/infodoc.c:61 +#: info/infodoc.c:62 msgid "" "\\%-10[move-to-next-xref] Skip to next hypertext link within this node.\n" msgstr "" "\\%-10[move-to-next-xref] Sauter au prochain hyperlien à l'intérieur de ce " "noeud.\n" -#: info/infodoc.c:62 +#: info/infodoc.c:63 msgid "" "\\%-10[move-to-prev-xref] Skip to previous hypertext link within this " "node.\n" @@ -496,27 +506,27 @@ msgstr "" "\\%-10[move-to-prev-xref] Sauter au prochain hyperlien à l'intérieur de ce " "noeud.\n" -#: info/infodoc.c:63 +#: info/infodoc.c:64 msgid "" "\\%-10[select-reference-this-line] Follow the hypertext link under cursor.\n" msgstr "" "\\%-10[select-reference-this-line] Suivre l'hyperlien sous le curseur.\n" -#: info/infodoc.c:64 +#: info/infodoc.c:65 msgid "" "\\%-10[dir-node] Move to the `directory' node. Equivalent to `\\[goto-" "node] (DIR)'.\n" msgstr "" "\\%-10[dir-node] Aller au noeud « directory ». Équivalent à « g (DIR) ».\n" -#: info/infodoc.c:65 +#: info/infodoc.c:66 msgid "" "\\%-10[top-node] Move to the Top node. Equivalent to `\\[goto-node] Top'.\n" msgstr "" "\\%-10[top-node] Aller au noeud supérieur Top. Équivalent à « g Top ».\n" # Est-ce vraiment un message à traduire? NON. -#: info/infodoc.c:67 info/infodoc.c:115 +#: info/infodoc.c:68 info/infodoc.c:116 msgid "" "Moving within a node:\n" "---------------------\n" @@ -524,32 +534,32 @@ msgstr "" "Se déplacer à l'intérieur d'un noeud:\n" "------------------------------------\n" -#: info/infodoc.c:69 -msgid "\\%-10[scroll-forward] Scroll forward a page.\n" -msgstr "\\%-10[scroll-forward] Avancer d'une page.\n" - #: info/infodoc.c:70 -msgid "\\%-10[scroll-backward] Scroll backward a page.\n" -msgstr "\\%-10[scroll-backward] Reculer d'une page.\n" - -#: info/infodoc.c:71 msgid "\\%-10[beginning-of-node] Go to the beginning of this node.\n" msgstr "\\%-10[beginning-of-node] Aller au point initial de ce noeud.\n" -#: info/infodoc.c:72 +#: info/infodoc.c:71 msgid "\\%-10[end-of-node] Go to the end of this node.\n" msgstr "\\%-10[end-of-node] Aller au point terminal de ce noeud.\n" +#: info/infodoc.c:72 +msgid "\\%-10[next-line] Scroll forward 1 line.\n" +msgstr "\\%-10[next-line] Avancer de 1 ligne.\n" + #: info/infodoc.c:73 -msgid "\\%-10[scroll-forward] Scroll forward 1 line.\n" -msgstr "\\%-10[scroll-forward] Avancer de 1 ligne.\n" +msgid "\\%-10[prev-line] Scroll backward 1 line.\n" +msgstr "\\%-10[prev-line] Reculer de 1 ligne.\n" #: info/infodoc.c:74 -msgid "\\%-10[scroll-backward] Scroll backward 1 line.\n" -msgstr "\\%-10[scroll-backward] Reculer de 1 ligne.\n" +msgid "\\%-10[scroll-forward] Scroll forward a page.\n" +msgstr "\\%-10[scroll-forward] Avancer d'une page.\n" + +#: info/infodoc.c:75 +msgid "\\%-10[scroll-backward] Scroll backward a page.\n" +msgstr "\\%-10[scroll-backward] Reculer d'une page.\n" # Est-ce vraiment un message à traduire? NON. -#: info/infodoc.c:76 info/infodoc.c:124 +#: info/infodoc.c:77 info/infodoc.c:125 msgid "" "Other commands:\n" "---------------\n" @@ -557,18 +567,18 @@ msgstr "" "Autres commandes:\n" "----------------\n" -#: info/infodoc.c:78 +#: info/infodoc.c:79 msgid "\\%-10[menu-digit] Pick first ... ninth item in node's menu.\n" msgstr "" "\\%-10[menu-digit] Choisir d'abord ... le neuvième item dans le menu de " "noeuds.\n" -#: info/infodoc.c:79 +#: info/infodoc.c:80 msgid "\\%-10[last-menu-item] Pick last item in node's menu.\n" msgstr "" "\\%-10[last-menu-item] Choisir le dernier item dans le menu de noeuds.\n" -#: info/infodoc.c:80 +#: info/infodoc.c:81 msgid "" "\\%-10[index-search] Search for a specified string in the index entries of " "this Info\n" @@ -580,7 +590,7 @@ msgstr "" " et sélectionner le noeud référencé par la première entrée " "trouvée.\n" -#: info/infodoc.c:82 +#: info/infodoc.c:83 msgid "" "\\%-10[goto-node] Move to node specified by name.\n" " You may include a filename as well, as in (FILENAME)NODENAME.\n" @@ -589,7 +599,7 @@ msgstr "" " Vous pouvez aussi bien inclure un nom de fichier, comme dans " "(FILENAME)NODENAME.\n" -#: info/infodoc.c:84 +#: info/infodoc.c:85 msgid "" "\\%-10[search] Search forward for a specified string\n" " and select the node in which the next occurrence is found.\n" @@ -598,7 +608,7 @@ msgstr "" " et sélectionner le noeud dans lequel se trouve la prochaine " "occurrence.\n" -#: info/infodoc.c:86 +#: info/infodoc.c:87 msgid "" "\\%-10[search-backward] Search backward for a specified string\n" " and select the node in which the previous occurrence is " @@ -608,118 +618,118 @@ msgstr "" " et sélectionner le noeud dans lequel se trouve la prochaine " "occurrence.\n" -#: info/infodoc.c:97 +#: info/infodoc.c:98 #, c-format msgid " %-10s Quit this help.\n" msgstr " %-10s Quitter ce menu d'aide.\n" -#: info/infodoc.c:98 +#: info/infodoc.c:99 #, c-format msgid " %-10s Quit Info altogether.\n" msgstr " %-10s Quitter complètement le mode Info.\n" -#: info/infodoc.c:99 +#: info/infodoc.c:100 #, c-format msgid " %-10s Invoke the Info tutorial.\n" msgstr " %-10s Faire appel au guide Info.\n" -#: info/infodoc.c:103 +#: info/infodoc.c:104 #, c-format msgid " %-10s Move to the `next' node of this node.\n" msgstr " %-10s Aller au noeud « next » de ce noeud.\n" -#: info/infodoc.c:104 +#: info/infodoc.c:105 #, c-format msgid " %-10s Move to the `previous' node of this node.\n" msgstr " %-10s Aller au noeud « previous » de ce noeud.\n" -#: info/infodoc.c:105 +#: info/infodoc.c:106 #, c-format msgid " %-10s Move `up' from this node.\n" msgstr " %-10s Aller au noeud « up » à partir de ce noeud.\n" -#: info/infodoc.c:106 +#: info/infodoc.c:107 #, c-format msgid " %-10s Pick menu item specified by name.\n" msgstr " %-10s Choisir l'item menu indiqué par le nom.\n" -#: info/infodoc.c:107 +#: info/infodoc.c:108 msgid " Picking a menu item causes another node to be selected.\n" msgstr "" " Choisir un item menu provoque la sélection d'un autre noeud.\n" -#: info/infodoc.c:108 +#: info/infodoc.c:109 #, c-format msgid " %-10s Follow a cross reference. Reads name of reference.\n" msgstr " %-10s Suivre une référence croisée. Lire le nom de la référence.\n" -#: info/infodoc.c:109 +#: info/infodoc.c:110 #, c-format msgid " %-10s Move to the last node seen in this window.\n" msgstr " %-10s Aller au dernier noeud observé dans cette fenêtre.\n" -#: info/infodoc.c:110 +#: info/infodoc.c:111 #, c-format msgid " %-10s Skip to next hypertext link within this node.\n" msgstr " %-10s Sauter au prochain hyperlien à l'intérieur de ce noeud.\n" -#: info/infodoc.c:111 +#: info/infodoc.c:112 #, c-format msgid " %-10s Follow the hypertext link under cursor.\n" msgstr " %-10s Suivre l'hyperlien sous le curseur.\n" -#: info/infodoc.c:112 +#: info/infodoc.c:113 #, c-format msgid " %-10s Move to the `directory' node. Equivalent to `g (DIR)'.\n" msgstr " %-10s Aller au noeud « directory ». Équivalent à « g (DIR) ».\n" -#: info/infodoc.c:113 +#: info/infodoc.c:114 #, c-format msgid " %-10s Move to the Top node. Equivalent to `g Top'.\n" msgstr " %-10s Aller au noeud supérieur Top. Équivalent à « g Top ».\n" -#: info/infodoc.c:117 +#: info/infodoc.c:118 #, c-format msgid " %-10s Scroll forward a page.\n" msgstr " %-10s Avancer d'une page.\n" -#: info/infodoc.c:118 +#: info/infodoc.c:119 #, c-format msgid " %-10s Scroll backward a page.\n" msgstr " %-10s Reculer d'une page.\n" -#: info/infodoc.c:119 +#: info/infodoc.c:120 #, c-format msgid " %-10s Go to the beginning of this node.\n" msgstr " %-10s Aller au point initial de ce noeud.\n" -#: info/infodoc.c:120 +#: info/infodoc.c:121 #, c-format msgid " %-10s Go to the end of this node.\n" msgstr " %-10s Aller au point terminal de ce noeud.\n" -#: info/infodoc.c:121 +#: info/infodoc.c:122 #, c-format msgid " %-10s Scroll forward 1 line.\n" msgstr " %-10s Avancer de 1 ligne.\n" -#: info/infodoc.c:122 +#: info/infodoc.c:123 #, c-format msgid " %-10s Scroll backward 1 line.\n" msgstr " %-10s Reculer de 1 ligne.\n" -#: info/infodoc.c:126 +#: info/infodoc.c:127 #, c-format msgid " %-10s Pick first ... ninth item in node's menu.\n" msgstr "" " %-10s Choisir d'abord ... le neuvième item dans le menu de noeuds.\n" -#: info/infodoc.c:127 +#: info/infodoc.c:128 #, c-format msgid " %-10s Pick last item in node's menu.\n" msgstr " %-10s Choisir le dernier item dans le menu de noeuds.\n" -#: info/infodoc.c:128 +#: info/infodoc.c:129 #, c-format msgid "" " %-10s Search for a specified string in the index entries of this Info\n" @@ -727,7 +737,7 @@ msgstr "" " %-10s Fouiller pour une chaîne spécifiée dans les entrées d'index de ce " "fichier Info,\n" -#: info/infodoc.c:129 +#: info/infodoc.c:130 msgid "" " file, and select the node referenced by the first entry " "found.\n" @@ -735,40 +745,40 @@ msgstr "" " et sélectionner le noeud référencé par la première entrée " "trouvée.\n" -#: info/infodoc.c:130 +#: info/infodoc.c:131 #, c-format msgid " %-10s Move to node specified by name.\n" msgstr " %-10s Aller au noeud indiqué par le nom.\n" -#: info/infodoc.c:131 +#: info/infodoc.c:132 msgid "" " You may include a filename as well, as in (FILENAME)NODENAME.\n" msgstr "" " Vous pouvez aussi bien inclure un nom de fichier, comme dans " "(FILENAME)NODENAME.\n" -#: info/infodoc.c:132 +#: info/infodoc.c:133 #, c-format msgid " %-10s Search forward for a specified string,\n" msgstr " %-10s Fouiller vers l'avant pour une chaîne spécifiée,\n" -#: info/infodoc.c:133 info/infodoc.c:135 +#: info/infodoc.c:134 info/infodoc.c:136 msgid "" " and select the node in which the next occurrence is found.\n" msgstr "" " et sélectionner le noeud dans lequel se trouve la prochaine " "occurrence.\n" -#: info/infodoc.c:134 +#: info/infodoc.c:135 #, c-format msgid " %-10s Search backward for a specified string\n" msgstr " %-10s Fouiller à reculons pour une chaîne spécifiée\n" -#: info/infodoc.c:313 +#: info/infodoc.c:316 msgid "The current search path is:\n" msgstr "Le chemin de fouille courant est:\n" -#: info/infodoc.c:316 +#: info/infodoc.c:320 msgid "" "Commands available in Info windows:\n" "\n" @@ -776,7 +786,7 @@ msgstr "" "Commandes disponibles en Info Windows:\n" "\n" -#: info/infodoc.c:319 +#: info/infodoc.c:324 msgid "" "Commands available in the echo area:\n" "\n" @@ -784,7 +794,7 @@ msgstr "" "Commandes disponibles dans la zone « echo area »:\n" "\n" -#: info/infodoc.c:340 +#: info/infodoc.c:347 #, c-format msgid "" "The following commands can only be invoked via %s:\n" @@ -793,7 +803,7 @@ msgstr "" "Les commandes suivantes peuvent être invoquées uniquement via %s:\n" "\n" -#: info/infodoc.c:343 +#: info/infodoc.c:351 msgid "" "The following commands cannot be invoked at all:\n" "\n" @@ -801,156 +811,169 @@ msgstr "" "Les commandes suivantes ne peuvent pas être invoquées:\n" "\n" -#: info/infodoc.c:367 +#: info/infodoc.c:375 msgid "--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n" msgstr "" "--- Utiliser « \\[history-node] » ou « \\[kill-node] » pour sortir ---\n" -#: info/infodoc.c:477 +#: info/infodoc.c:485 msgid "Display help message" msgstr "Afficher le message d'aide" -#: info/infodoc.c:495 +#: info/infodoc.c:503 msgid "Visit Info node `(info)Help'" msgstr "Visiter le noeud Info « (info)Help »" -#: info/infodoc.c:638 +#: info/infodoc.c:641 msgid "Print documentation for KEY" msgstr "Imprimer la documentation relative à KEY" -#: info/infodoc.c:650 +#: info/infodoc.c:653 #, c-format msgid "Describe key: %s" msgstr "Décrire la clé: %s" -#: info/infodoc.c:660 +#: info/infodoc.c:664 #, c-format msgid "ESC %s is undefined." msgstr "ESC %s est non défini." -#: info/infodoc.c:676 info/infodoc.c:703 +#: info/infodoc.c:680 info/infodoc.c:709 #, c-format msgid "%s is undefined." msgstr "%s est non défini." -#: info/infodoc.c:724 +#: info/infodoc.c:730 #, c-format msgid "%s is defined to %s." msgstr "%s est défini à %s." -#: info/infodoc.c:1151 +#: info/infodoc.c:1153 msgid "Show what to type to execute a given command" msgstr "Montrer quoi écrire afin d'exécuter une commande donnée" -#: info/infodoc.c:1155 +#: info/infodoc.c:1157 msgid "Where is command: " msgstr "Où se trouve la commande: " -#: info/infodoc.c:1177 +#: info/infodoc.c:1179 #, c-format msgid "`%s' is not on any keys" msgstr "« %s » ne se trouve pas sur une clé quelconque" -#: info/infodoc.c:1183 +#: info/infodoc.c:1186 #, c-format msgid "%s can only be invoked via %s." msgstr "%s peut être invoqué uniquement via %s." -#: info/infodoc.c:1186 +#: info/infodoc.c:1190 #, c-format msgid "%s can be invoked via %s." msgstr "%s peut être invoqué via %s." -#: info/infodoc.c:1190 +#: info/infodoc.c:1195 #, c-format msgid "There is no function named `%s'" msgstr "Il n'y a pas de fonction nommée « %s »" -#: info/infokey.c:164 +#: info/infokey.c:145 +#, c-format +msgid "" +"Copyright (C) %s Free Software Foundation, Inc.\n" +"There is NO warranty. You may redistribute this software\n" +"under the terms of the GNU General Public License.\n" +"For more information about these matters, see the files named COPYING.\n" +msgstr "" +"Copyright © %s Free Software Foundation, Inc.\n" +"AUCUNE garantie n'est donnée. Vous pouvez redistribuer des copies\n" +"de ce logiciel selon les termes de la licence GNU General Public License.\n" +"Pour plus d'informations, consultez le fichier COPYING.\n" + +#: info/infokey.c:170 msgid "incorrect number of arguments" msgstr "nombre incorrect d'arguments" -#: info/infokey.c:194 +#: info/infokey.c:201 #, c-format msgid "cannot open input file `%s'" msgstr "Ne peut ouvrir le fichier d'entrée « %s »." -#: info/infokey.c:207 +#: info/infokey.c:215 #, c-format msgid "cannot create output file `%s'" msgstr "Ne peut pas créer le fichier de sortie « %s »." -#: info/infokey.c:217 +#: info/infokey.c:226 #, c-format msgid "error writing to `%s'" msgstr "erreur d'écriture dans « %s »" -#: info/infokey.c:222 +#: info/infokey.c:232 #, c-format msgid "error closing output file `%s'" msgstr "erreur de fermeture du fichier de sortie « %s »." -#: info/infokey.c:443 +#: info/infokey.c:450 msgid "key sequence too long" msgstr "séquence de clé trop longue" -#: info/infokey.c:521 +#: info/infokey.c:529 msgid "missing key sequence" msgstr "séquence de clé manquante" -#: info/infokey.c:600 +#: info/infokey.c:610 msgid "NUL character (\\000) not permitted" msgstr "Caractère NUL (\\000) n'est pas permis" -#: info/infokey.c:629 +#: info/infokey.c:641 #, c-format msgid "NUL character (^%c) not permitted" msgstr "Caractère NUL (^%c) n'est pas permis" -#: info/infokey.c:652 +#: info/infokey.c:665 msgid "missing action name" -msgstr "%nom de l'action manquant" +msgstr "nom de l'action manquant" -#: info/infokey.c:667 info/infokey.c:733 +#: info/infokey.c:681 info/infokey.c:756 msgid "section too long" msgstr "section trop longue" -#: info/infokey.c:673 +#: info/infokey.c:688 #, c-format msgid "unknown action `%s'" msgstr "action inconnue « %s »." -#: info/infokey.c:682 +#: info/infokey.c:698 msgid "action name too long" msgstr "nom de l'action trop long" -#: info/infokey.c:694 +#: info/infokey.c:712 #, c-format msgid "extra characters following action `%s'" msgstr "caractères superflues détectés après l'action « %s »." -#: info/infokey.c:704 +#: info/infokey.c:723 msgid "missing variable name" msgstr "nom de variable manquant" -#: info/infokey.c:712 +#: info/infokey.c:733 msgid "missing `=' immediately after variable name" msgstr "« = » manquant immédiatement après le nom de la variable" -#: info/infokey.c:719 +#: info/infokey.c:741 msgid "variable name too long" msgstr "nom de variable trop long" -#: info/infokey.c:741 +#: info/infokey.c:765 msgid "value too long" msgstr "valeur trop longue" -#: info/infokey.c:875 +#: info/infokey.c:890 #, c-format msgid "\"%s\", line %u: " msgstr "« %s », ligne %u: " -#: info/infokey.c:891 +#: info/infokey.c:906 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT-FILE]\n" @@ -977,22 +1000,22 @@ msgstr "" " --version Afficher le version du logiciel et quitter.\n" "\n" -#: info/infomap.c:1397 +#: info/infomap.c:1500 #, c-format msgid "Ignoring invalid infokey file `%s' - too small" msgstr "Fichier infokey invalide ignoré « %s » - trop petit" -#: info/infomap.c:1400 +#: info/infomap.c:1503 #, c-format msgid "Ignoring invalid infokey file `%s' - too big" msgstr "Fichier infokey invalide ignoré « %s » - trop gros" -#: info/infomap.c:1413 +#: info/infomap.c:1516 #, c-format msgid "Error reading infokey file `%s' - short read" msgstr "Erreur de lecture du fichier infokey « %s » - lecture écourtée" -#: info/infomap.c:1431 +#: info/infomap.c:1535 #, c-format msgid "" "Invalid infokey file `%s' (bad magic numbers) -- run infokey to update it" @@ -1000,14 +1023,14 @@ msgstr "" "Fichier infokey invalide « %s » (nombre magique erroné) -- exécuter infokey " "pour le mettre à jour" -#: info/infomap.c:1437 +#: info/infomap.c:1544 #, c-format msgid "Your infokey file `%s' is out of date -- run infokey to update it" msgstr "" "Votre fichier infokey « %s » est désuet -- exécuter inforkey pour le mettre " "à jour" -#: info/infomap.c:1450 +#: info/infomap.c:1560 #, c-format msgid "" "Invalid infokey file `%s' (bad section length) -- run infokey to update it" @@ -1015,7 +1038,7 @@ msgstr "" "Fichier infokey invalide « %s » (longueur de section erronée) -- exécuter " "infokey pour la mettre à jour" -#: info/infomap.c:1470 +#: info/infomap.c:1581 #, c-format msgid "" "Invalid infokey file `%s' (bad section code) -- run infokey to update it" @@ -1023,44 +1046,50 @@ msgstr "" "Fichier infokey invalide « %s » (code de section erroné) -- exécuter infokey " "pour le mettre à jour" -#: info/infomap.c:1608 +#: info/infomap.c:1716 msgid "Bad data in infokey file -- some key bindings ignored" msgstr "" "Données erronées dans le fichier infokey -- quelques jumelages de clés " "ignorés" -#: info/infomap.c:1659 +#: info/infomap.c:1766 msgid "Bad data in infokey file -- some var settings ignored" msgstr "" "Données erronées dans le fichier infokey -- quelques initialisations de " "variables ignorées" -#: info/m-x.c:70 +#: info/m-x.c:69 msgid "Read the name of an Info command and describe it" msgstr "Lire le nom d'une commande Info et la décrire" -#: info/m-x.c:74 +#: info/m-x.c:73 msgid "Describe command: " msgstr "Décrire la commande: " -#: info/m-x.c:97 +#: info/m-x.c:96 msgid "Read a command name in the echo area and execute it" msgstr "Lire le nom d'une commande dans la zone « echo area » et l'exécuter" -#: info/m-x.c:141 +#: info/m-x.c:140 msgid "Cannot execute an `echo-area' command here." msgstr "Ne peut pas exécuter une commande « echo-area » en cet endroit." -#: info/m-x.c:157 +#: info/m-x.c:154 +#, c-format +msgid "Undefined command: %s" +msgstr "commandes indéfinie: %s" + +#: info/m-x.c:160 msgid "Set the height of the displayed window" msgstr "Ajuster la hauteur de la fenêtre affichée" -#: info/m-x.c:170 +#: info/m-x.c:173 #, c-format msgid "Set screen height to (%d): " msgstr "Ajuster la hauteur de l'écran à (%d): " -#: info/makedoc.c:161 info/makedoc.c:169 +#: info/makedoc.c:162 info/makedoc.c:170 +#, c-format msgid "" " Source files groveled to make this file include:\n" "\n" @@ -1068,12 +1097,12 @@ msgstr "" " Les fichiers sources aplatis pour faire ce fichier incluent:\n" "\n" -#: info/makedoc.c:553 +#: info/makedoc.c:550 #, c-format msgid "Couldn't manipulate the file %s.\n" msgstr "Ne peut pas manipuler le fichier %s.\n" -#: info/nodemenu.c:28 +#: info/nodemenu.c:31 msgid "" "\n" "* Menu:\n" @@ -1085,7 +1114,7 @@ msgstr "" " (Fichier)Noeud Lignes Taille Contenant Fichier(s)\n" " -------------- ------ ------ --------------------" -#: info/nodemenu.c:199 +#: info/nodemenu.c:202 msgid "" "Here is the menu of nodes you have recently visited.\n" "Select one from this menu, or use `\\[history-node]' in another window.\n" @@ -1094,25 +1123,25 @@ msgstr "" "Sélectionner en un de ce menu, ou utiliser « \\[history-node] » dans une " "autre fenêtre.\n" -#: info/nodemenu.c:219 +#: info/nodemenu.c:224 msgid "Make a window containing a menu of all of the currently visited nodes" msgstr "" "Faire une fenêtre contenant un menu de tous les noeuds actuellement visités" -#: info/nodemenu.c:299 +#: info/nodemenu.c:304 msgid "Select a node which has been previously visited in a visible window" msgstr "Sélectionner un noeud qui a déjà été visité dans une fenêtre visible" -#: info/nodemenu.c:311 +#: info/nodemenu.c:317 msgid "Select visited node: " msgstr "Sélectionner un noeud visité: " -#: info/nodemenu.c:331 info/session.c:2235 +#: info/nodemenu.c:337 info/session.c:2264 #, c-format msgid "The reference disappeared! (%s)." msgstr "La référence est disparue! (%s)." -#: info/session.c:170 +#: info/session.c:162 #, c-format msgid "" "Welcome to Info version %s. Type \\[get-help-window] for help, \\[menu-item] " @@ -1122,111 +1151,111 @@ msgstr "" "Taper « \\[get-help-window] » pour obtenir de l'aide.\n" "Taper « \\[menu-item] » pour obtenir un item menu." -#: info/session.c:643 +#: info/session.c:620 msgid "Move down to the next line" msgstr "Descendre à la ligne suivante" -#: info/session.c:658 +#: info/session.c:635 msgid "Move up to the previous line" msgstr "Monter à la ligne précédente" -#: info/session.c:673 +#: info/session.c:650 msgid "Move to the end of the line" msgstr "Aller à la fin de la ligne" -#: info/session.c:693 +#: info/session.c:670 msgid "Move to the start of the line" msgstr "Aller au début de la ligne" -#: info/session.c:885 makeinfo/node.c:1357 +#: info/session.c:860 makeinfo/node.c:1424 msgid "Next" msgstr "Noeud « Next »" -#: info/session.c:888 +#: info/session.c:863 msgid "Following Next node..." msgstr "Suivre le noeud « Next »..." -#: info/session.c:905 +#: info/session.c:881 msgid "Selecting first menu item..." msgstr "Sélectionner le premier item menu..." -#: info/session.c:916 +#: info/session.c:893 msgid "Selecting Next node..." msgstr "Sélectionner le noeud « Next »..." -#: info/session.c:986 +#: info/session.c:964 #, c-format msgid "Moving Up %d time(s), then Next." msgstr "Monter via « Up » %d fois, puis passer au noeud « Next »." -#: info/session.c:1010 +#: info/session.c:988 msgid "No more nodes within this document." msgstr "Aucun autre noeud dans ce document." -#: info/session.c:1034 +#: info/session.c:1011 msgid "No `Prev' for this node." msgstr "Aucun noeud « Prev » pour ce noeud." -#: info/session.c:1037 info/session.c:1092 +#: info/session.c:1014 info/session.c:1073 msgid "Moving Prev in this window." msgstr "Monter au noeud « Prev » dans cette fenêtre." -#: info/session.c:1051 +#: info/session.c:1030 msgid "No `Prev' or `Up' for this node within this document." msgstr "Aucun noeud « Prev » ou « Up » pour ce noeud dans ce document." -#: info/session.c:1054 +#: info/session.c:1034 msgid "Moving Up in this window." msgstr "Monter au noeud « Up » dans cette fenêtre." -#: info/session.c:1102 +#: info/session.c:1084 msgid "Moving to `Prev's last menu item." msgstr "Aller au dernier item menu du noeud « Prev »." -#: info/session.c:1113 +#: info/session.c:1095 msgid "Move forwards or down through node structure" msgstr "Avancer ou descendre à travers la structure de noeuds" -#: info/session.c:1129 +#: info/session.c:1111 msgid "Move backwards or up through node structure" msgstr "Reculer ou monter à travers la structure de noeuds" -#: info/session.c:1229 +#: info/session.c:1205 msgid "Scroll forward in this window" msgstr "Défiler vers l'avant dans cette fenêtre" -#: info/session.c:1237 +#: info/session.c:1213 msgid "Scroll forward in this window and set default window size" msgstr "" "Défiler vers l'avant dans cette fenêtre et en fixer la dimension par défaut" -#: info/session.c:1245 +#: info/session.c:1221 msgid "Scroll forward in this window staying within node" msgstr "" "Défiler vers l'avant dans cette fenêtre en demeurant à l'intérieur du noeud" -#: info/session.c:1253 +#: info/session.c:1229 msgid "" "Scroll forward in this window staying within node and set default window size" msgstr "" "Défiler vers l'avant dans cette fenêtre en demeurant à l'intérieur du noeud " "et en fixer la dimension par défaut" -#: info/session.c:1261 +#: info/session.c:1237 msgid "Scroll backward in this window" msgstr "Défiler à reculons dans cette fenêtre" -#: info/session.c:1269 +#: info/session.c:1245 msgid "Scroll backward in this window and set default window size" msgstr "" "Défiler à reculons dans cette fenêtre et en fixer la dimension par défaut" -#: info/session.c:1278 +#: info/session.c:1254 msgid "Scroll backward in this window staying within node" msgstr "" "Défiler à reculons dans cette fenêtre en demeurant à l'intérieur de ce noeud" -#: info/session.c:1286 +#: info/session.c:1262 msgid "" "Scroll backward in this window staying within node and set default window " "size" @@ -1234,335 +1263,335 @@ msgstr "" "Défiler à reculons dans cette fenêtre en demeurant à l'intérieur du noeud et " "en fixer la dimension par défaut" -#: info/session.c:1294 +#: info/session.c:1270 msgid "Move to the start of this node" msgstr "Aller au point initial de ce noeud" -#: info/session.c:1301 +#: info/session.c:1277 msgid "Move to the end of this node" msgstr "Aller au point terminal de ce noeud" -#: info/session.c:1308 +#: info/session.c:1284 msgid "Scroll down by lines" msgstr "Défiler vers le bas par pas de N lignes" -#: info/session.c:1325 +#: info/session.c:1301 msgid "Scroll up by lines" msgstr "Défiler vers le haut par pas de N lignes" -#: info/session.c:1343 +#: info/session.c:1319 msgid "Scroll down by half screen size" msgstr "Défiler vers le bas par pas d'un demi écran" -#: info/session.c:1369 +#: info/session.c:1345 msgid "Scroll up by half screen size" msgstr "Défiler vers le haut par pas d'un demi écran" -#: info/session.c:1398 +#: info/session.c:1374 msgid "Select the next window" msgstr "Sélectionner la fenêtre suivante" -#: info/session.c:1437 +#: info/session.c:1413 msgid "Select the previous window" msgstr "Sélectionner la fenêtre précédente" -#: info/session.c:1488 +#: info/session.c:1464 msgid "Split the current window" msgstr "Diviser en deux la fenêtre courante" -#: info/session.c:1569 +#: info/session.c:1545 msgid "Delete the current window" msgstr "Éliminer la fenêtre courante" -#: info/session.c:1577 +#: info/session.c:1553 msgid "Cannot delete a permanent window" msgstr "Ne peut pas éliminer une fenêtre permanente" -#: info/session.c:1610 +#: info/session.c:1585 msgid "Delete all other windows" msgstr "Éliminer toutes les autres fenêtres" -#: info/session.c:1656 +#: info/session.c:1631 msgid "Scroll the other window" msgstr "Défiler l'autre fenêtre" -#: info/session.c:1677 +#: info/session.c:1652 msgid "Scroll the other window backward" msgstr "Défiler l'autre fenêtre à reculons" -#: info/session.c:1683 +#: info/session.c:1658 msgid "Grow (or shrink) this window" msgstr "Agrandir (ou réduire) cette fenêtre" -#: info/session.c:1694 +#: info/session.c:1669 msgid "Divide the available screen space among the visible windows" msgstr "Répartir l'espace écran disponible parmi les fenêtres visibles" -#: info/session.c:1701 +#: info/session.c:1676 msgid "Toggle the state of line wrapping in the current window" msgstr "Basculer l'état du remplissage de ligne dans la fenêtre courante" -#: info/session.c:1880 +#: info/session.c:1848 msgid "Select the Next node" msgstr "Sélectionner le noeud « Next »" -#: info/session.c:1888 +#: info/session.c:1856 msgid "Select the Prev node" msgstr "Sélectionner le noeud « Prev »" -#: info/session.c:1896 +#: info/session.c:1864 msgid "Select the Up node" msgstr "Sélectionner le noeud « Up »" -#: info/session.c:1903 +#: info/session.c:1871 msgid "Select the last node in this file" msgstr "Sélectionner le dernier noeud dans ce fichier" -#: info/session.c:1930 info/session.c:1963 +#: info/session.c:1898 info/session.c:1931 msgid "This window has no additional nodes" msgstr "Cette fenêtre a aucun noeud additionnel" -#: info/session.c:1936 +#: info/session.c:1904 msgid "Select the first node in this file" msgstr "Sélectionner le premier noeud dans ce fichier" -#: info/session.c:1970 +#: info/session.c:1938 msgid "Select the last item in this node's menu" msgstr "Sélectionner le dernier item dans ce menu de noeuds" -#: info/session.c:1976 +#: info/session.c:1944 msgid "Select this menu item" msgstr "Sélectionner cet item menu" -#: info/session.c:2005 +#: info/session.c:1977 #, c-format msgid "There aren't %d items in this menu." msgstr "Il n'y a pas %d items dans ce menu." -#: info/session.c:2148 +#: info/session.c:2171 info/session.c:2172 #, c-format msgid "Menu item (%s): " msgstr "Item menu (%s): " -#: info/session.c:2150 +#: info/session.c:2175 msgid "Menu item: " msgstr "Item menu: " -#: info/session.c:2155 +#: info/session.c:2182 info/session.c:2183 #, c-format msgid "Follow xref (%s): " msgstr "Suivre xref (%s): " -#: info/session.c:2157 +#: info/session.c:2186 msgid "Follow xref: " msgstr "Suivre xref: " -#: info/session.c:2280 +#: info/session.c:2315 msgid "Read a menu item and select its node" msgstr "Lire un item menu et sélectionner son noeud" -#: info/session.c:2288 +#: info/session.c:2323 msgid "Read a footnote or cross reference and select its node" msgstr "" "Lire une note de bas de page ou une référence croisée et sélectionner son " "noeud" -#: info/session.c:2294 +#: info/session.c:2329 msgid "Move to the start of this node's menu" msgstr "Aller au point initial de ce menu de noeuds" -#: info/session.c:2318 +#: info/session.c:2353 msgid "Visit as many menu items at once as possible" msgstr "Visiter d'un seul coup autant d'items menu que possible" -#: info/session.c:2346 +#: info/session.c:2381 msgid "Read a node name and select it" msgstr "Lire un nom de noeud et sélectionner ce noeud" -#: info/session.c:2401 info/session.c:2405 +#: info/session.c:2436 info/session.c:2441 msgid "Goto node: " msgstr "Aller au noeud: " -#: info/session.c:2471 +#: info/session.c:2505 #, c-format msgid "No menu in node `%s'." msgstr "Aucun menu dans le noeud « %s »." -#: info/session.c:2516 +#: info/session.c:2551 #, c-format msgid "No menu item `%s' in node `%s'." msgstr "Aucun item menu « %s » dans le noeud « %s »." -#: info/session.c:2546 +#: info/session.c:2581 #, c-format msgid "Unable to find node referenced by `%s' in `%s'." msgstr "Incapable de trouver le noeud référencé par « %s » dans « %s »." -#: info/session.c:2597 +#: info/session.c:2631 msgid "Read a list of menus starting from dir and follow them" msgstr "Lire une liste de menus en partant de « dir » et les suivre" -#: info/session.c:2599 +#: info/session.c:2633 msgid "Follow menus: " msgstr "Suivre les menus: " -#: info/session.c:2797 +#: info/session.c:2826 msgid "Find the node describing program invocation" msgstr "Trouver le noeud décrivant l'invocation au programme" -#: info/session.c:2799 +#: info/session.c:2828 #, c-format msgid "Find Invocation node of [%s]: " msgstr "Trouver le noeud Invocation de [%s]: " -#: info/session.c:2837 +#: info/session.c:2866 msgid "Read a manpage reference and select it" msgstr "Lire une référence de page-manuel et la sélectionner" -#: info/session.c:2841 +#: info/session.c:2870 msgid "Get Manpage: " msgstr "Obtenir la Page-manuel: " -#: info/session.c:2871 +#: info/session.c:2900 msgid "Select the node `Top' in this file" msgstr "Sélectionner le noeud « Top » dans ce fichier" -#: info/session.c:2877 +#: info/session.c:2906 msgid "Select the node `(dir)'" msgstr "Sélectionner le noeud « (dir) »" -#: info/session.c:2897 +#: info/session.c:2923 info/session.c:2925 #, c-format msgid "Kill node (%s): " msgstr "Effacer le noeud (%s): " -#: info/session.c:2951 +#: info/session.c:2977 #, c-format msgid "Cannot kill node `%s'" msgstr "Ne peut pas effacer le noeud « %s »" -#: info/session.c:2961 +#: info/session.c:2987 msgid "Cannot kill the last node" msgstr "Ne peut pas effacer le dernier noeud" -#: info/session.c:3047 +#: info/session.c:3073 msgid "Select the most recently selected node" msgstr "Choisir le noeud qui a été le plus récemment sélectionné" -#: info/session.c:3053 +#: info/session.c:3079 msgid "Kill this node" msgstr "Effacer ce noeud" -#: info/session.c:3061 +#: info/session.c:3087 msgid "Read the name of a file and select it" msgstr "Lire le nom d'un fichier et le sélectionner" -#: info/session.c:3065 +#: info/session.c:3091 msgid "Find file: " msgstr "Trouver le fichier: " -#: info/session.c:3082 +#: info/session.c:3108 #, c-format msgid "Cannot find `%s'." msgstr "Ne peut pas trouver « %s »." -#: info/session.c:3127 info/session.c:3248 +#: info/session.c:3151 info/session.c:3269 #, c-format msgid "Could not create output file `%s'." msgstr "Ne peut pas créer le fichier de sortie « %s »." -#: info/session.c:3140 info/session.c:3265 info/session.c:3326 +#: info/session.c:3165 info/session.c:3287 info/session.c:3347 msgid "Done." msgstr "Terminé." -#: info/session.c:3196 +#: info/session.c:3220 #, c-format msgid "Writing node %s..." msgstr "Écriture du noeud « %s »..." -#: info/session.c:3274 +#: info/session.c:3296 msgid "Pipe the contents of this node through INFO_PRINT_COMMAND" msgstr "Acheminer les contenus de ce noeud à travers INFO_PRINT_COMMAND" -#: info/session.c:3310 +#: info/session.c:3331 #, c-format msgid "Cannot open pipe to `%s'." msgstr "Ne peut ouvrir un tube de communication à « %s »." -#: info/session.c:3316 +#: info/session.c:3337 #, c-format msgid "Printing node %s..." msgstr "Impression du noeud « %s »..." -#: info/session.c:3558 +#: info/session.c:3567 #, c-format msgid "Searching subfile %s ..." msgstr "Fouille du sous-fichier « %s »..." -#: info/session.c:3610 +#: info/session.c:3619 msgid "Read a string and search for it case-sensitively" msgstr "" "Lire une chaîne et en faire la fouille en distinguant les majuscules et " "minuscules" -#: info/session.c:3617 +#: info/session.c:3626 msgid "Read a string and search for it" msgstr "Lire une chaîne et en faire la fouille" -#: info/session.c:3625 +#: info/session.c:3634 msgid "Read a string and search backward for it" msgstr "Lire une chaîne et en faire la fouille à reculons" -#: info/session.c:3667 +#: info/session.c:3670 info/session.c:3677 #, c-format msgid "%s%sfor string [%s]: " msgstr "%s%s pour la chaîne [%s]: " -#: info/session.c:3668 +#: info/session.c:3671 info/session.c:3678 msgid "Search backward" msgstr "Fouiller à reculons" -#: info/session.c:3668 +#: info/session.c:3672 info/session.c:3678 msgid "Search" msgstr "Fouiller" -#: info/session.c:3669 +#: info/session.c:3673 info/session.c:3679 msgid " case-sensitively " msgstr " en distinguant les casses majuscules et minuscules " -#: info/session.c:3669 +#: info/session.c:3674 info/session.c:3679 msgid " " msgstr " " -#: info/session.c:3709 +#: info/session.c:3718 msgid "Search failed." msgstr "Fouille infructueuse." -#: info/session.c:3727 +#: info/session.c:3736 msgid "Repeat last search in the same direction" msgstr "Répéter la dernière fouille dans la même direction" -#: info/session.c:3730 info/session.c:3740 +#: info/session.c:3739 info/session.c:3749 msgid "No previous search string" msgstr "Aucune chaîne de fouille antérieure" -#: info/session.c:3737 +#: info/session.c:3746 msgid "Repeat last search in the reverse direction" msgstr "Répéter la dernière fouille dans la direction inverse" -#: info/session.c:3755 info/session.c:3761 +#: info/session.c:3765 info/session.c:3771 msgid "Search interactively for a string as you type it" msgstr "Fouiller interactivement pour une chaîne telle que vous la tapez" -#: info/session.c:3855 +#: info/session.c:3851 msgid "I-search backward: " msgstr "Fouille I-search à reculons: " -#: info/session.c:3857 +#: info/session.c:3853 msgid "I-search: " msgstr "Fouille I-search: " -#: info/session.c:3882 +#: info/session.c:3878 info/session.c:3880 msgid "Failing " msgstr "Échec " @@ -1578,27 +1607,27 @@ msgstr "Aller à la prochaine référence croisée" msgid "Select reference or menu item appearing on this line" msgstr "Sélectionner la référence ou l'item menu apparaissant sur cette ligne" -#: info/session.c:4381 +#: info/session.c:4382 msgid "Cancel current operation" msgstr "Annuler l'opération courante" -#: info/session.c:4388 +#: info/session.c:4389 msgid "Quit" msgstr "Quitter" -#: info/session.c:4397 +#: info/session.c:4398 msgid "Move the cursor to a specific line of the window" msgstr "Déplacer le curseur sur une ligne spécifique de la fenêtre" -#: info/session.c:4429 +#: info/session.c:4430 msgid "Redraw the display" msgstr "Redessiner l'affichage écran" -#: info/session.c:4466 +#: info/session.c:4467 msgid "Quit using Info" msgstr "Quitter en utilisant Info" -#: info/session.c:4479 +#: info/session.c:4480 msgid "Run command bound to this key's lowercase variant" msgstr "Exécuter la commande liée à cette variante de touche en minuscule" @@ -1607,29 +1636,30 @@ msgstr "Exécuter la commande liée à cette variante de touche en minuscule" msgid "Unknown command (%s)." msgstr "Commande inconnue (%s)." -# Est-ce que c'est " " ou « » comme caractères? #: info/session.c:4494 -msgid "\"\" is invalid" -msgstr "\"\" est invalide" +#, c-format +msgid "\"%s\" is invalid" +msgstr "« %s » est invalide" #: info/session.c:4495 #, c-format -msgid "\"%s\" is invalid" +msgid "`%s' is invalid" msgstr "« %s » est invalide" -#: info/session.c:4713 +#: info/session.c:4709 msgid "Add this digit to the current numeric argument" msgstr "Ajouter ce chiffre à l'argument numérique courant" -#: info/session.c:4722 +#: info/session.c:4718 msgid "Start (or multiply by 4) the current numeric argument" msgstr "Enclencher (ou multiplier par 4) l'argument numérique courant" -#: info/session.c:4737 +#: info/session.c:4733 msgid "Internally used by \\[universal-argument]" msgstr "Utilisé internement par \\[universal-argument]" -#: info/tilde.c:344 +#: info/tilde.c:338 +#, c-format msgid "readline: Out of virtual memory!\n" msgstr "lecture: Mémoire virtuelle épuisée!\n" @@ -1707,230 +1737,266 @@ msgid "Set %s to value (%s): " msgstr "Fixer %s à la valeur (%s): " # Est-ce vraiment un message à traduire? -#: info/window.c:1164 +#: info/window.c:1138 msgid "--*** Tags out of Date ***" msgstr "--*** Étiquettes passées Date ***" -#: info/window.c:1175 +#: info/window.c:1149 msgid "-----Info: (), lines ----, " msgstr "-----Info: (), lignes ----, " -#: info/window.c:1182 +#: info/window.c:1156 #, c-format msgid "-%s---Info: %s, %d lines --%s--" msgstr "-%s---Info: %s, %d lignes --%s--" -#: info/window.c:1186 +#: info/window.c:1160 #, c-format msgid "-%s%s-Info: (%s)%s, %d lines --%s--" msgstr "-%s%s-Info: (%s)%s, %d lignes --%s--" -#: info/window.c:1193 +#: info/window.c:1167 #, c-format msgid " Subfile: %s" msgstr " Sous-fichier: %s" -#: lib/getopt.c:675 +#: lib/getopt.c:551 lib/getopt.c:570 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: l'option « %s » est ambiguë\n" -#: lib/getopt.c:700 +#: lib/getopt.c:603 lib/getopt.c:607 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: l'option « --%s » ne permet pas un argument\n" -#: lib/getopt.c:705 +#: lib/getopt.c:616 lib/getopt.c:621 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: l'option « %c%s » ne permet pas un argument\n" -#: lib/getopt.c:723 lib/getopt.c:896 +#: lib/getopt.c:667 lib/getopt.c:689 lib/getopt.c:1020 lib/getopt.c:1042 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: l'option « %s » exige un argument\n" -#: lib/getopt.c:752 +#: lib/getopt.c:727 lib/getopt.c:730 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: option non reconnue « --%s »\n" -#: lib/getopt.c:756 +#: lib/getopt.c:738 lib/getopt.c:741 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: option non reconnue « %c%s »\n" -#: lib/getopt.c:782 +#: lib/getopt.c:796 lib/getopt.c:799 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: option illégale -- %c\n" -#: lib/getopt.c:785 +#: lib/getopt.c:805 lib/getopt.c:808 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: option invalide -- %c\n" -#: lib/getopt.c:815 lib/getopt.c:945 +#: lib/getopt.c:863 lib/getopt.c:882 lib/getopt.c:1095 lib/getopt.c:1116 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'option exige un argument -- %c\n" -#: lib/getopt.c:862 +#: lib/getopt.c:935 lib/getopt.c:954 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: l'option « -W %s » est ambiguë\n" -#: lib/getopt.c:880 +#: lib/getopt.c:978 lib/getopt.c:999 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: l'option « -W %s » ne permet pas un argument\n" -#: makeinfo/cmds.c:515 +#: makeinfo/cmds.c:520 makeinfo/cmds.c:542 +#, c-format +msgid "arguments to @%s ignored" +msgstr "arguments à @%s ignorés" + +#: makeinfo/cmds.c:585 msgid "January" msgstr "janvier" -#: makeinfo/cmds.c:515 +#: makeinfo/cmds.c:585 msgid "February" msgstr "février" -#: makeinfo/cmds.c:515 +#: makeinfo/cmds.c:585 msgid "March" msgstr "mars" -#: makeinfo/cmds.c:515 +#: makeinfo/cmds.c:585 msgid "April" msgstr "avril" -#: makeinfo/cmds.c:515 +#: makeinfo/cmds.c:585 msgid "May" msgstr "mai" -#: makeinfo/cmds.c:516 +#: makeinfo/cmds.c:586 msgid "June" msgstr "juin" -#: makeinfo/cmds.c:516 +#: makeinfo/cmds.c:586 msgid "July" msgstr "juillet" -#: makeinfo/cmds.c:516 +#: makeinfo/cmds.c:586 msgid "August" msgstr "août" -#: makeinfo/cmds.c:516 +#: makeinfo/cmds.c:586 msgid "September" msgstr "septembre" -#: makeinfo/cmds.c:516 +#: makeinfo/cmds.c:586 msgid "October" msgstr "octobre" -#: makeinfo/cmds.c:517 +#: makeinfo/cmds.c:587 msgid "November" msgstr "novembre" -#: makeinfo/cmds.c:517 +#: makeinfo/cmds.c:587 msgid "December" msgstr "décembre" -#: makeinfo/cmds.c:658 +#: makeinfo/cmds.c:936 #, c-format msgid "unlikely character %c in @var" msgstr "caractère %c improbable dans la macro @var" -#: makeinfo/cmds.c:701 +#: makeinfo/cmds.c:979 msgid "@sc argument all uppercase, thus no effect" msgstr "argument de la macro @sc tout en majuscules, alors aucun effet" -#: makeinfo/cmds.c:759 +#: makeinfo/cmds.c:1034 #, c-format msgid "`{' expected, but saw `%c'" msgstr "« { » attendu, mais a vu « %c »" -#: makeinfo/cmds.c:789 +#: makeinfo/cmds.c:1074 msgid "end of file inside verb block" msgstr "fin de fichier à l'intérieur du bloc verbe" -#: makeinfo/cmds.c:797 +#: makeinfo/cmds.c:1082 #, c-format msgid "`}' expected, but saw `%c'" msgstr "« } » attendu, mais a vu « %c »" -#: makeinfo/cmds.c:942 +#: makeinfo/cmds.c:1112 +msgid "" +"@strong{Note...} produces a spurious cross-reference in Info; reword to " +"avoid that" +msgstr "" +"@strong{Note...} produit une table douteuse de références croisées dans " +"Info; réécrire pour éviter cela" + +#: makeinfo/cmds.c:1305 #, c-format msgid "%c%s is obsolete" msgstr "%c%s est périmé" -#: makeinfo/cmds.c:1014 +#: makeinfo/cmds.c:1414 #, c-format msgid "@sp requires a positive numeric argument, not `%s'" msgstr "La macro @sp exige un argument numérique positif, pas « %s »" -#: makeinfo/cmds.c:1348 makeinfo/cmds.c:1374 makeinfo/footnote.c:81 +#: makeinfo/cmds.c:1763 makeinfo/cmds.c:1819 makeinfo/footnote.c:82 #, c-format msgid "Bad argument to %c%s" msgstr "Mauvais argument à %c%s" -#: makeinfo/cmds.c:1358 makeinfo/makeinfo.c:4140 +#: makeinfo/cmds.c:1773 makeinfo/makeinfo.c:4142 msgid "asis" msgstr "« asis »" -#: makeinfo/cmds.c:1360 makeinfo/makeinfo.c:4142 +#: makeinfo/cmds.c:1775 makeinfo/cmds.c:1805 makeinfo/makeinfo.c:4144 msgid "none" msgstr "« none »" -#: makeinfo/defun.c:85 +#: makeinfo/cmds.c:1789 +#, c-format +msgid "Bad argument to @%s" +msgstr "Mauvais argument à @%s" + +#: makeinfo/cmds.c:1803 +msgid "insert" +msgstr "insérer" + +#: makeinfo/defun.c:84 msgid "Missing `}' in @def arg" msgstr "Accolade « } » manquante dans @def arg" -#: makeinfo/defun.c:363 +#: makeinfo/defun.c:403 msgid "Function" msgstr "Fonction" -#: makeinfo/defun.c:366 +#: makeinfo/defun.c:406 msgid "Macro" msgstr "Macro" -#: makeinfo/defun.c:369 +#: makeinfo/defun.c:409 msgid "Special Form" msgstr "Forme Spéciale" -#: makeinfo/defun.c:373 +#: makeinfo/defun.c:413 msgid "Variable" msgstr "Variable" -#: makeinfo/defun.c:376 +#: makeinfo/defun.c:416 msgid "User Option" msgstr "Option de l'Usager" -#: makeinfo/defun.c:380 +#: makeinfo/defun.c:420 msgid "Instance Variable" msgstr "Variable d'Instance" -#: makeinfo/defun.c:384 +#: makeinfo/defun.c:424 msgid "Method" msgstr "Méthode" -#: makeinfo/defun.c:466 makeinfo/defun.c:470 makeinfo/defun.c:615 -#: makeinfo/defun.c:631 makeinfo/defun.c:671 +#: makeinfo/defun.c:500 makeinfo/defun.c:505 makeinfo/defun.c:545 +#: makeinfo/defun.c:644 makeinfo/xml.c:2229 msgid "of" msgstr "de" -#: makeinfo/defun.c:474 makeinfo/defun.c:478 makeinfo/defun.c:482 -#: makeinfo/defun.c:624 makeinfo/defun.c:676 +#: makeinfo/defun.c:509 makeinfo/defun.c:513 makeinfo/defun.c:517 +#: makeinfo/defun.c:551 makeinfo/defun.c:650 makeinfo/xml.c:2234 msgid "on" msgstr "sur" -#: makeinfo/defun.c:717 +#: makeinfo/defun.c:711 #, c-format -msgid "Must be in `%s' insertion to use `%sx'" -msgstr "Doit être dans une insertion « %s » afin d'utiliser « %sx »." +msgid "Must be in `@%s' environment to use `@%s'" +msgstr "Doit être dans une insertion « @%s » afin d'utiliser « @%s »." -#: makeinfo/files.c:448 +#: makeinfo/files.c:435 #, c-format msgid "%s: getwd: %s, %s\n" msgstr "%s: getwd: %s, %s\n" +#: makeinfo/files.c:638 +#, c-format +msgid "`%s' omitted before output filename" +msgstr "« %s » omis avant le nom de fichier de sortie" + +#: makeinfo/files.c:646 +#, c-format +msgid "`%s' omitted since writing to stdout" +msgstr "« %s » omis avant l'écriture sur la sortie standard" + +#: makeinfo/files.c:694 +msgid "Output buffer not empty." +msgstr "Tampon de sortie n'est pas vide." + #: makeinfo/footnote.c:150 #, c-format msgid "`%c%s' needs an argument `{...}', not just `%s'" @@ -1950,231 +2016,279 @@ msgid "Footnotes inside footnotes are not allowed" msgstr "Les notes de bas de page récursives ne sont pas permises" # Est-ce vraiement un message à traduire? -#: makeinfo/footnote.c:298 +#: makeinfo/footnote.c:302 makeinfo/index.c:189 msgid "Footnotes" msgstr "Notes de bas de page" -#: makeinfo/html.c:42 +#: makeinfo/html.c:87 +#, c-format +msgid "%s: could not open --css-file: %s" +msgstr "%s: ne peut ouvrir --css-file: %s" + +#: makeinfo/html.c:172 +#, c-format +msgid "%s:%d: --css-file ended in comment" +msgstr "%s%d: --css-file terminé dans le commentaire" + +#: makeinfo/html.c:207 msgid "Untitled" msgstr "Sans titre" -#: makeinfo/html.c:298 +#: makeinfo/html.c:422 +msgid "[unexpected] no html tag to pop" +msgstr "[inattendu] pas d'étiquette html à dépiler" + +#: makeinfo/html.c:752 #, c-format -msgid "Invalid node name: `%s'" -msgstr "Nom de noeud invalide: « %s »" +msgid "[unexpected] invalid node name: `%s'" +msgstr "[inattendu] nom de noeud invalide: « %s »" -#: makeinfo/index.c:213 +#: makeinfo/index.c:169 #, c-format msgid "Unknown index `%s'" msgstr "Nom d'index inconnu « %s »" -#: makeinfo/index.c:238 +#: makeinfo/index.c:234 #, c-format msgid "Info cannot handle `:' in index entry `%s'" msgstr "Info ne peut traiter « : » dans l'entrée d'index « %s »" -#: makeinfo/index.c:396 +#: makeinfo/index.c:412 #, c-format msgid "Index `%s' already exists" msgstr "L'index « %s » existe toujours" -#: makeinfo/index.c:439 +#: makeinfo/index.c:455 #, c-format msgid "Unknown index `%s' and/or `%s' in @synindex" msgstr "Nom d'index « %s » inconnu et/ou « %s » dans @synindex" -#: makeinfo/index.c:666 +#: makeinfo/index.c:661 +msgid "(line )" +msgstr "(ligne )" + +#: makeinfo/index.c:669 +#, c-format +msgid "(line %*d)" +msgstr "(ligne %*d)" + +#: makeinfo/index.c:750 #, c-format msgid "Unknown index `%s' in @printindex" msgstr "Nom d'index « %s » inconnu dans @printindex" -#: makeinfo/index.c:709 +#: makeinfo/index.c:819 #, c-format msgid "Entry for index `%s' outside of any node" msgstr "Entrée pour l'index « %s » à l'extérieure de tout noeud" -#: makeinfo/index.c:712 makeinfo/index.c:751 +#: makeinfo/index.c:822 makeinfo/index.c:858 msgid "(outside of any node)" msgstr "(à l'extérieur de tout noeud)" -#: makeinfo/insertion.c:198 +#: makeinfo/index.c:919 makeinfo/index.c:925 +msgid "See " +msgstr "Voir " + +#: makeinfo/insertion.c:160 +msgid "@item not allowed in argument to @itemize" +msgstr "@item n'est pas permis dans l'agument @itemize" + +#: makeinfo/insertion.c:238 msgid "Broken-Type in insertion_type_pname" msgstr "Type impossible dans la fonction insertion_type_pname" -#: makeinfo/insertion.c:271 +#: makeinfo/insertion.c:334 msgid "Enumeration stack overflow" msgstr "Débordement de la pile d'énumérations" -#: makeinfo/insertion.c:303 +#: makeinfo/insertion.c:366 #, c-format msgid "lettering overflow, restarting at %c" msgstr "débordement du lettrage, reprise à partir de %c" -#: makeinfo/insertion.c:538 +#: makeinfo/insertion.c:631 #, c-format msgid "%s requires an argument: the formatter for %citem" msgstr "%s exige un argument: le formateur pour %citem" -#: makeinfo/insertion.c:693 +#: makeinfo/insertion.c:719 +#, c-format +msgid "%cfloat environments cannot be nested" +msgstr "%cenvironnements float ne peuvent être imbriqués" + +#: makeinfo/insertion.c:973 #, c-format msgid "`@end' expected `%s', but saw `%s'" msgstr "« @end » s'attendait à « %s », mais a vu « %s »" -#: makeinfo/insertion.c:931 +#: makeinfo/insertion.c:1337 #, c-format msgid "No matching `%cend %s'" msgstr "« %cend %s » non apparié" -#: makeinfo/insertion.c:1084 +#: makeinfo/insertion.c:1592 #, c-format msgid "%s requires letter or digit" msgstr "%s exige une lettre ou un chiffre" -#: makeinfo/insertion.c:1158 +#: makeinfo/insertion.c:1687 msgid "end of file inside verbatim block" msgstr "fin de fichier à l'intérieur du bloc verbatim" -#: makeinfo/insertion.c:1318 +#: makeinfo/insertion.c:1913 +#, c-format +msgid "@%s not meaningful outside `@float' environment" +msgstr "@%s n'a aucun sens à l'extérieur de l'environnement « @float »" + +#: makeinfo/insertion.c:1949 msgid "@menu seen before first @node, creating `Top' node" msgstr "@menu vu avant le premier @node, création du noeud « Top »" -#: makeinfo/insertion.c:1319 +#: makeinfo/insertion.c:1950 msgid "" "perhaps your @top node should be wrapped in @ifnottex rather than @ifinfo?" msgstr "" "votre noeud @top devrait se retrouver peut-être dans @ifnottex plutôt que " "dans @ifinfo?" -#: makeinfo/insertion.c:1331 +#: makeinfo/insertion.c:1962 msgid "@detailmenu seen before first node, creating `Top' node" msgstr "@detailmenu vu avant le premier noeud, création du noeud « Top »" -#: makeinfo/insertion.c:1346 +#: makeinfo/insertion.c:2018 +#, c-format +msgid "@%s not meaningful outside `@titlepage' and `@quotation' environments" +msgstr "" +"@%s n'a aucun sens à l'extérieur des environnements « @titlepage » et « " +"@quotation »" + +#: makeinfo/insertion.c:2032 +#, c-format +msgid "@%s not meaningful outside `@titlepage' environment" +msgstr "@%s n'a aucun sens à l'extérieur de l'environnement « @titlepage »" + +#: makeinfo/insertion.c:2063 #, c-format msgid "Unmatched `%c%s'" msgstr "« %c%s » non apparié" -#: makeinfo/insertion.c:1353 +#: makeinfo/insertion.c:2068 #, c-format msgid "`%c%s' needs something after it" msgstr "« %c%s » a besoin de quelque chose après lui" -#: makeinfo/insertion.c:1359 +#: makeinfo/insertion.c:2074 #, c-format -msgid "Bad argument to `%s', `%s', using `%s'" -msgstr "Mauvais argument à « %s », « %s », utilisant « %s »" +msgid "Bad argument `%s' to `@%s', using `%s'" +msgstr "Mauvais argument « %s » à « @%s » utilisant « %s »" -#: makeinfo/insertion.c:1453 +#: makeinfo/insertion.c:2171 #, c-format msgid "@%s not meaningful inside `@%s' block" msgstr "macro @%s inactive à l'intérieur d'un bloc « %s »" -#: makeinfo/insertion.c:1462 +#: makeinfo/insertion.c:2180 #, c-format msgid "@itemx not meaningful inside `%s' block" msgstr "macro @itemx inactive à l'intérieur d'un bloc « %s »" -#: makeinfo/insertion.c:1646 +#: makeinfo/insertion.c:2356 #, c-format msgid "%c%s found outside of an insertion block" msgstr "%c%s est trouvé à l'extérieur d'un bloc d'insertion" -#: makeinfo/lang.c:331 +#: makeinfo/lang.c:580 #, c-format msgid "%s is not a valid ISO 639 language code" msgstr "%s n'est pas un code ISO 639 valide pour l'identification de langue" -#: makeinfo/lang.c:384 +#: makeinfo/lang.c:655 #, c-format -msgid "unrecogized encoding name `%s'" +msgid "unrecognized encoding name `%s'" msgstr "nom d'encodage non reconnu « %s »" -#: makeinfo/lang.c:387 +#: makeinfo/lang.c:663 #, c-format msgid "sorry, encoding `%s' not supported" msgstr "désolé, l'encodage « %s » n'est pas supporté" -#: makeinfo/lang.c:414 +#: makeinfo/lang.c:715 #, c-format msgid "invalid encoded character `%s'" msgstr "caractère encodé invalide « %s »" -#: makeinfo/lang.c:502 -#, c-format -msgid "%s is an invalid ISO code, using %c" -msgstr "%s n'est pas un code ISO valide, utilisé %c" - -#: makeinfo/lang.c:687 +#: makeinfo/lang.c:1009 #, c-format msgid "%c%s expects `i' or `j' as argument, not `%c'" msgstr "%c%s s'attend à argument « i » ou « j », non pas « %c »" -#: makeinfo/lang.c:691 +#: makeinfo/lang.c:1013 #, c-format msgid "%c%s expects a single character `i' or `j' as argument" msgstr "%c%s attend un argument d'un seul caractère « i » ou « j »" -#: makeinfo/macro.c:134 +#: makeinfo/macro.c:128 #, c-format msgid "macro `%s' previously defined" msgstr "macro « %s » déjà définie précédemment" -#: makeinfo/macro.c:138 +#: makeinfo/macro.c:132 #, c-format msgid "here is the previous definition of `%s'" msgstr "ici se trouve la définition précédente de « %s »" #: makeinfo/macro.c:355 #, c-format -msgid "\\ in macro expansion followed by `%s' instead of \\ or parameter name" +msgid "\\ in macro expansion followed by `%s' instead of parameter name" msgstr "" -"\\ dans l'expansion de macro suivie par « %s » au lieu de \\ ou du nom de " -"paramètre" +"\\ dans l'expansion de macro suivie par « %s » au lieu du nom de paramètre" -#: makeinfo/macro.c:403 +#: makeinfo/macro.c:401 #, c-format msgid "Macro `%s' called on line %d with too many args" msgstr "Macro « %s » appelée à la ligne %d avec trop d'arguments" -#: makeinfo/macro.c:594 +#: makeinfo/macro.c:586 #, c-format msgid "%cend macro not found" msgstr "macro %cend non trouvée" -#: makeinfo/macro.c:632 +#: makeinfo/macro.c:624 msgid "@quote-arg only useful for single-argument macros" msgstr "macro @quote-arg utile seulement pour des macros à un seul argument" -#: makeinfo/macro.c:668 +#: makeinfo/macro.c:660 #, c-format msgid "mismatched @end %s with @%s" msgstr "macro @end %s non balancée avec @%s" -#: makeinfo/makeinfo.c:316 +#: makeinfo/makeinfo.c:184 #, c-format -msgid "%s:%d: warning: " -msgstr "%s:%d: avertissement: " - -#: makeinfo/makeinfo.c:339 msgid "Too many errors! Gave up.\n" msgstr "Beaucoup trop d'erreurs! Abandon.\n" -#: makeinfo/makeinfo.c:350 makeinfo/makeinfo.c:2026 +#: makeinfo/makeinfo.c:302 +#, c-format +msgid "%s:%d: warning: " +msgstr "%s:%d: avertissement: " + +#: makeinfo/makeinfo.c:321 makeinfo/makeinfo.c:2260 #, c-format msgid "Misplaced %c" msgstr "%c égarée ou mal placée" -#: makeinfo/makeinfo.c:370 +#: makeinfo/makeinfo.c:340 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "Utiliser « %s --help » pour plus d'informations.\n" -#: makeinfo/makeinfo.c:373 +#: makeinfo/makeinfo.c:343 #, c-format msgid "Usage: %s [OPTION]... TEXINFO-FILE...\n" msgstr "Usage: %s [OPTION]... FICHIER-TEXINFO...\n" -#: makeinfo/makeinfo.c:376 +#: makeinfo/makeinfo.c:346 msgid "" "Translate Texinfo source documentation to various other formats, by default\n" "Info files suitable for reading online with Emacs or standalone GNU Info.\n" @@ -2182,7 +2296,7 @@ msgstr "" "Traduire une documentation Texinfo source en divers autres formats:\n" "Fichiers Info adéquats pour lire en ligne avec Emacs ou GNU Info autonome\n" -#: makeinfo/makeinfo.c:380 +#: makeinfo/makeinfo.c:350 #, c-format msgid "" "General options:\n" @@ -2209,20 +2323,22 @@ msgstr "" " -v, --verbose En mode bavard, expliquer ce qui a été fait.\n" " --version Afficher la version du logiciel et quitter.\n" -#: makeinfo/makeinfo.c:394 +#: makeinfo/makeinfo.c:364 #, no-wrap msgid "" "Output format selection (default is to produce Info):\n" -" --docbook output DocBook rather than Info.\n" +" --docbook output Docbook XML rather than Info.\n" " --html output HTML rather than Info.\n" -" --xml output XML (TexinfoML) rather than Info.\n" +" --xml output Texinfo XML rather than Info.\n" +" --plaintext output plain text rather than Info.\n" msgstr "" "Options de sélection de format de sortie (par défaut produire Info):\n" -" --docbook Écrire en format DocBook plutôt qu'en format Info.\n" +" --docbook Écrire en format DocBook XML plutôt qu'en format Info.\n" " --html Écrire en format HTML plutôt qu'en format Info;\n" -" --xml Produire en XML (TexinfoML) plutôt qu'en format Info.\n" +" --xml Produire en Texinfo XML plutôt qu'en format Info.\n" +" --plaintext Produire en formast plein texte plutôt qu'en format Info.\n" -#: makeinfo/makeinfo.c:401 +#: makeinfo/makeinfo.c:372 msgid "" "General output options:\n" " -E, --macro-expand FILE output macro-expanded source to FILE.\n" @@ -2252,7 +2368,7 @@ msgstr "" " -o, --output=FICHIER produire la sortie dans le FICHIER (répertoire " "si division en HTML),\n" -#: makeinfo/makeinfo.c:415 +#: makeinfo/makeinfo.c:386 #, c-format msgid "" "Options for Info and plain text:\n" @@ -2288,16 +2404,42 @@ msgstr "" " --split-size=NUM séparer les fichiers Info selon la taille NUM (par " "défaut %d).\n" -#: makeinfo/makeinfo.c:433 +#: makeinfo/makeinfo.c:403 +msgid "" +"Options for HTML:\n" +" --css-include=FILE include FILE in HTML <style> output;\n" +" read stdin if FILE is -.\n" +msgstr "" +" --css-include=FICHIER inclure le FICHIER dans le <style> de " +"sortie HTML;\n" +" lire de stdin si le FICHIER est -.\n" + +#: makeinfo/makeinfo.c:409 +#, c-format +msgid "" +"Options for XML and Docbook:\n" +" --output-indent=VAL indent XML elements by VAL spaces (default %" +"d).\n" +" If VAL is 0, ignorable whitespace is " +"dropped.\n" +msgstr "" +" --output-indent=VAL indenter les éléments XML à l'aide dee VAL " +"espaces (par défaut %d).\n" +" Si VAL vaut 0, les espaces pouvant être " +"ignorés sont éliminés.\n" + +#: makeinfo/makeinfo.c:416 msgid "" "Input file options:\n" -" --commands-in-node-names allow @ commands in node names.\n" -" -D VAR define the variable VAR, as with @set.\n" -" -I DIR append DIR to the @include search path.\n" -" -P DIR prepend DIR to the @include search path.\n" -" -U VAR undefine the variable VAR, as with @clear.\n" +" --commands-in-node-names allow @ commands in node names.\n" +" -D VAR define the variable VAR, as with @set.\n" +" -I DIR append DIR to the @include search path.\n" +" -P DIR prepend DIR to the @include search path.\n" +" -U VAR undefine the variable VAR, as with @clear.\n" msgstr "" "Options portant sur les fichier d'entrée:\n" +" --commands-in-node-names permet les commandes @ dans les noms de " +"noeuds.\n" " -D VAR Définir une variable, comme avec @set.\n" " -I DIR Ajouter à la fin DIR au chemin de fouille " "@include.\n" @@ -2306,50 +2448,68 @@ msgstr "" " -U VAR Rendre indéfinie une variable, comme avec " "@clear.\n" -#: makeinfo/makeinfo.c:442 -#, fuzzy +#: makeinfo/makeinfo.c:425 msgid "" "Conditional processing in input:\n" +" --ifdocbook process @ifdocbook and @docbook even if\n" +" not generating Docbook.\n" " --ifhtml process @ifhtml and @html even if not generating HTML.\n" " --ifinfo process @ifinfo even if not generating Info.\n" " --ifplaintext process @ifplaintext even if not generating plain text.\n" " --iftex process @iftex and @tex; implies --no-split.\n" +" --ifxml process @ifxml and @xml.\n" +" --no-ifdocbook do not process @ifdocbook and @docbook text.\n" " --no-ifhtml do not process @ifhtml and @html text.\n" " --no-ifinfo do not process @ifinfo text.\n" " --no-ifplaintext do not process @ifplaintext text.\n" " --no-iftex do not process @iftex and @tex text.\n" +" --no-ifxml do not process @ifxml and @xml text.\n" +"\n" +" Also, for the --no-ifFORMAT options, do process @ifnotFORMAT text.\n" msgstr "" "Traitement conditionel de l'entrée:\n" +" --ifdocbook Traiter @ifdocbook et @docbook même s'il\n" +" n'y a pas de génération Docbook.\n" " --ifhtml Traiter le textuel sous @ifhtml et @html même\n" -" lorsqu'on ne génère pas du HTML.\n" -" --ifinfo Traiter le textuel sous @ifinfo même lorsqu'on\n" -" génère du HTML.\n" -" --iftex Traiter le textuel sous @iftex et sous @tex.\n" +" s'il n'y a pas de génération HTML.\n" +" --ifinfo Traiter le textuel sous @ifinfo même\n" +" s'il n'y a pas de génération Info.\n" +" --ifplaintext Traiter le textuel sous @ifplaintext même\n" +" s'il n'y a pas de génération plein texte\n" +" --iftex Traiter le textuel sous @iftex et @tex.\n" " implique l'option --no-split.\n" +" --ifxml Traiter le textuel sous @ifxml et sous @xml.\n" " --no-ifhtml Ne pas traiter le textuel sous @ifhtml et @html.\n" " --no-ifinfo Ne pas traiter le textuel sous @ifinfo.\n" +" --no-ifplaintext Ne pas traiter le textuel sous @ifplaintext.\n" " --no-iftex Ne pas traiter le textuel sous @iftex et @tex.\n" +" --no-ifxml Ne pas traiter le textuel sous @ifxml et @xml.\n" +"\n" +" Aussi pour l'options --no-ifFORMAT, ne pas traiter le textuel " +"@ifnotFORMAT.\n" -#: makeinfo/makeinfo.c:454 -#, fuzzy +#: makeinfo/makeinfo.c:444 msgid "" " The defaults for the @if... conditionals depend on the output format:\n" " if generating HTML, --ifhtml is on and the others are off;\n" " if generating Info, --ifinfo is on and the others are off;\n" " if generating plain text, --ifplaintext is on and the others are off;\n" +" if generating XML, --ifxml is on and the others are off.\n" msgstr "" "Les valeurs par défaut pour le @if... conditionnels dépend du format de " "sortie:\n" -"en géneration HTML, --ifhtml est « on » et les autres sont « off »;\n" -"en génération Info ou plein texte, --ifinfo est « on » et les autres sont « " -"off ».\n" +"en géneration HTML, --ifhtml est « on » et les autres sont « off » ;\n" +"en génération Info, --ifinfo est « on » et les autres sont « off » ;\n" +"en génération plein texte, --ifplaintext est « on » et les autres sont « off " +"» ;\n" +"en génération XML, --ifxml est « on » et les autres sont « off ».\n" -#: makeinfo/makeinfo.c:461 +#: makeinfo/makeinfo.c:452 msgid "" "Examples:\n" " makeinfo foo.texi write Info to foo's @setfilename\n" " makeinfo --html foo.texi write HTML to @setfilename\n" -" makeinfo --xml foo.texi write XML to @setfilename\n" +" makeinfo --xml foo.texi write Texinfo XML to @setfilename\n" " makeinfo --docbook foo.texi write DocBook XML to @setfilename\n" " makeinfo --no-headers foo.texi write plain text to standard output\n" "\n" @@ -2367,32 +2527,38 @@ msgstr "" "foo\n" " makeinfo --docbook foo.texi Écrire le DocBook en XML dans " "@setfilename\n" -" makeinfo --no-headers -o - foo.texi Écrire en plein texte en sortie " +" makeinfo --no-headers foo.texi Écrire en plein texte en sortie " "standard\n" "\n" -" makeinfo --html --no-headers -o - foo.texi Écrire en HTML sans les lignes " -"de noeuds et de menus\n" +" makeinfo --html --no-headers foo.texi Écrire en HTML sans les lignes de " +"noeuds et de menus\n" " makeinfo --number-sections foo.texi Écrire en Info avec sections " "numérotées\n" " makeinfo --no-split foo.texi Écrire un fichier Info même " "volumineux\n" -#: makeinfo/makeinfo.c:570 makeinfo/makeinfo.c:593 makeinfo/makeinfo.c:655 -#: makeinfo/makeinfo.c:676 +#: makeinfo/makeinfo.c:603 +#, c-format +msgid "%s: Ignoring unrecognized TEXINFO_OUTPUT_FORMAT value `%s'.\n" +msgstr "%s: valeur TEXINFO_OUTPUT_FORMAT non reconnue est ignoré « %s »\n" + +#: makeinfo/makeinfo.c:647 makeinfo/makeinfo.c:673 makeinfo/makeinfo.c:692 +#: makeinfo/makeinfo.c:722 makeinfo/makeinfo.c:743 #, c-format msgid "%s: %s arg must be numeric, not `%s'.\n" msgstr "%s: l'argument %s doit être numérique, non pas « %s ».\n" -#: makeinfo/makeinfo.c:583 +#: makeinfo/makeinfo.c:660 #, c-format -msgid "Couldn't open macro expansion output `%s'" -msgstr "Ne peut ouvrir la sortie d'expansion de macro « %s »" +msgid "%s: could not open macro expansion output `%s'" +msgstr "%s: ne peut ouvrir la sortie d'expansion de macro « %s »" -#: makeinfo/makeinfo.c:586 -msgid "Cannot specify more than one macro expansion output" -msgstr "Ne peut spécifier plus d'une sortie d'expansion de macro" +#: makeinfo/makeinfo.c:665 +#, c-format +msgid "%s: ignoring second macro expansion output `%s'.\n" +msgstr "%s: ignorer la sortie de l'expansion de la seconde macro « %s »\n" -#: makeinfo/makeinfo.c:624 +#: makeinfo/makeinfo.c:707 #, c-format msgid "%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n" msgstr "" @@ -2400,55 +2566,56 @@ msgstr "" "ou\n" "« asis », non pas « %s ».\n" -#: makeinfo/makeinfo.c:665 +#: makeinfo/makeinfo.c:732 #, c-format msgid "%s: --footnote-style arg must be `separate' or `end', not `%s'.\n" msgstr "" "%s: l'argument de l'option --footnote-style doit être « separate » ou\n" "« end », non pas « %s ».\n" -#: makeinfo/makeinfo.c:723 +#: makeinfo/makeinfo.c:806 #, c-format msgid "%s: missing file argument.\n" msgstr "%s: absence d'un argument fichier.\n" -#: makeinfo/makeinfo.c:898 +#: makeinfo/makeinfo.c:997 makeinfo/makeinfo.c:3991 +#, c-format +msgid "Multiline command %c%s used improperly" +msgstr "Commande multilignes %c%s utilisé de manière incorrecte" + +#: makeinfo/makeinfo.c:1000 #, c-format msgid "Expected `%s'" msgstr "« %s » attendue" -#: makeinfo/makeinfo.c:1365 -msgid "File exists, but is not a directory" -msgstr "Le fichier existe mais n'est pas un répertoire" - -#: makeinfo/makeinfo.c:1366 +#: makeinfo/makeinfo.c:1479 #, c-format msgid "Can't create directory `%s': %s" msgstr "Ne peut créer le répertoire « %s »: %s" -#: makeinfo/makeinfo.c:1414 +#: makeinfo/makeinfo.c:1525 #, c-format msgid "No `%s' found in `%s'" msgstr "Aucun « %s » trouvé dans « %s »" -#: makeinfo/makeinfo.c:1496 +#: makeinfo/makeinfo.c:1605 #, c-format msgid "%s: Skipping macro expansion to stdout as Info output is going there.\n" msgstr "" "%s: Sauter l'expansion de macro qui irait sur stdout comme la sortie Info.\n" -#: makeinfo/makeinfo.c:1526 +#: makeinfo/makeinfo.c:1638 #, c-format msgid "Making %s file `%s' from `%s'.\n" msgstr "Fabrication du fichier %s « %s » à partir de « %s ».\n" -#: makeinfo/makeinfo.c:1561 +#: makeinfo/makeinfo.c:1673 #, c-format msgid "This is %s, produced by makeinfo version %s from %s.\n" msgstr "" "Ceci est le fichier Info %s, produit par Makeinfo version %s à partir de %s.\n" -#: makeinfo/makeinfo.c:1583 +#: makeinfo/makeinfo.c:1709 #, c-format msgid "" "%s: Removing macro output file `%s' due to errors; use --force to preserve.\n" @@ -2456,335 +2623,333 @@ msgstr "" "%s: Enlèvement du fichier de sortie de macro « %s » à cause d'erreurs;\n" "utiliser l'option --force pour préserver.\n" -#: makeinfo/makeinfo.c:1627 +#: makeinfo/makeinfo.c:1773 #, c-format msgid "%s: Removing output file `%s' due to errors; use --force to preserve.\n" msgstr "" "%s: Enlèvement du fichier de sortie « %s » à cause d'erreurs;\n" "utiliser l'option --force pour préserver.\n" -#: makeinfo/makeinfo.c:1853 +#: makeinfo/makeinfo.c:2034 #, c-format msgid "Unknown command `%s'" msgstr "Commande inconnue « %s »." -#: makeinfo/makeinfo.c:1875 +#: makeinfo/makeinfo.c:2056 #, c-format msgid "Use braces to give a command as an argument to @%s" msgstr "" "Utiliser des accolades pour donner une commande comme argument à « @%s »" -#: makeinfo/makeinfo.c:2068 +#: makeinfo/makeinfo.c:2314 #, c-format -msgid "%c%s expected `{...}'" -msgstr "%c%s exigeant des accolades « {...} »" +msgid "%c%s expected braces" +msgstr "%c%s accolades attendues" -#: makeinfo/makeinfo.c:2098 +#: makeinfo/makeinfo.c:2327 msgid "Unmatched }" msgstr "Accolade « } » non appariée" -#: makeinfo/makeinfo.c:2148 +#: makeinfo/makeinfo.c:2375 msgid "NO_NAME!" msgstr "NOM_INCONNU!" -#: makeinfo/makeinfo.c:2169 +#: makeinfo/makeinfo.c:2396 #, c-format msgid "%c%s missing close brace" msgstr "%c%s accolade fermante manquante" -#: makeinfo/makeinfo.c:2958 -msgid "First argument to cross-reference may not be empty" -msgstr "Premier argument de références croisée peut ne pas être vide" - -#: makeinfo/makeinfo.c:3018 makeinfo/makeinfo.c:3236 makeinfo/xml.c:1340 -msgid "see " -msgstr "voir " - -#: makeinfo/makeinfo.c:3018 -msgid "See " -msgstr "Voir " - -#: makeinfo/makeinfo.c:3164 -#, c-format -msgid "`.' or `,' must follow cross reference, not %c" -msgstr "« . » ou « , » doit suivre une référence croisée, non pas %c" - -#: makeinfo/makeinfo.c:3212 -msgid "First argument to @inforef may not be empty" -msgstr "Premier argument de @inforef peut ne pas être vide" - -#: makeinfo/makeinfo.c:3427 +#: makeinfo/makeinfo.c:3309 #, c-format msgid "@image file `%s' (for HTML) not readable: %s" msgstr "commande @image dans un fichier (pour HTML) « %s » illisible: %s" -#: makeinfo/makeinfo.c:3440 +#: makeinfo/makeinfo.c:3315 #, c-format -msgid "No `%s.png' or `.jpg', and no extension supplied" -msgstr "Aucun « %s.png » ou « .jpg » et aucune extension fournie" +msgid "No such file `%s'" +msgstr "Aucun fichier « %s »" -#: makeinfo/makeinfo.c:3490 +#: makeinfo/makeinfo.c:3447 #, c-format msgid "@image file `%s' (for text) unreadable: %s" msgstr "commande @image avec un fichier (texte) « %s » illisible: %s" -#: makeinfo/makeinfo.c:3497 +#: makeinfo/makeinfo.c:3456 msgid "@image missing filename argument" msgstr "commande @image ayant un argument fichier absent" -#: makeinfo/makeinfo.c:3690 +#: makeinfo/makeinfo.c:3675 +#, c-format +msgid "undefined flag: %s" +msgstr "fanion indéfini: %s" + +#: makeinfo/makeinfo.c:3676 #, c-format msgid "{No value for `%s'}" msgstr "{Aucune valeur pour « %s »}" -#: makeinfo/makeinfo.c:3744 +#: makeinfo/makeinfo.c:3728 #, c-format msgid "%c%s requires a name" msgstr "%c%s exige un nom" -#: makeinfo/makeinfo.c:3850 +#: makeinfo/makeinfo.c:3834 #, c-format msgid "Reached eof before matching @end %s" msgstr "Fin de fichier rencontré avant l'appariement de @end %s" -#: makeinfo/makeinfo.c:4081 +#: makeinfo/makeinfo.c:4082 #, c-format msgid "`%.40s...' is too long for expansion; not expanded" msgstr "" "« %.40s... » est trop long pour l'expansion; n'a pas fait d'expansion" -#: makeinfo/multi.c:226 +#: makeinfo/multi.c:116 msgid "Missing } in @multitable template" msgstr "Accolade « } » manquante dans un patron @multitable" -#: makeinfo/multi.c:302 +#: makeinfo/multi.c:254 #, c-format msgid "ignoring stray text `%s' after @multitable" msgstr "abandon du texte orphelin « %s » après la commande @multitable" -#: makeinfo/multi.c:375 +#: makeinfo/multi.c:393 #, c-format msgid "Too many columns in multitable item (max %d)" msgstr "Trop de colonnes dans un item de multitable (%d max)" -#: makeinfo/multi.c:426 +#: makeinfo/multi.c:555 #, c-format -msgid "Cannot select column #%d in multitable" -msgstr "Ne peut pas sélectionner la colonne #%d dans une multitable." +msgid "[unexpected] cannot select column #%d in multitable" +msgstr "" +"[inattendu] ne peut pas sélectionner la colonne #%d dans une multitable." -#: makeinfo/multi.c:529 +#: makeinfo/multi.c:584 msgid "ignoring @tab outside of multitable" msgstr "inhibition d'une commande @tab à l'extérieur d'une multitable" -#: makeinfo/multi.c:565 +#: makeinfo/multi.c:632 +#, c-format msgid "** Multicolumn output from last row:\n" msgstr "** Sortie en multicolonnes à partir de la dernière rangée:\n" -#: makeinfo/multi.c:568 +#: makeinfo/multi.c:635 #, c-format msgid "* column #%d: output = %s\n" msgstr "* colonne #%d: sortie = %s\n" -#: makeinfo/node.c:276 +#: makeinfo/node.c:280 #, c-format msgid "Node `%s' previously defined at line %d" msgstr "Le noeud « %s » défini antérieurement à la ligne %d" -#: makeinfo/node.c:594 +#: makeinfo/node.c:648 #, c-format msgid "Formatting node %s...\n" msgstr "Écriture du noeud « %s »...\n" -#: makeinfo/node.c:655 +#: makeinfo/node.c:716 #, c-format -msgid "Node `%s' requires a sectioning command (e.g. %c%s)" -msgstr "Le noeud « %s » exige une commande de subdivision (e.g. %c%s)" +msgid "Node `%s' requires a sectioning command (e.g., %c%s)" +msgstr "Le noeud « %s » exige une commande de subdivision (i.e. %c%s)" -#: makeinfo/node.c:815 +#: makeinfo/node.c:879 #, c-format msgid "No node name specified for `%c%s' command" msgstr "Aucun nom de noeud spécifié pour la commande « %c%s »" -#: makeinfo/node.c:856 makeinfo/node.c:1075 +#: makeinfo/node.c:920 makeinfo/node.c:1151 #, c-format msgid "Anchor `%s' and node `%s' map to the same file name" msgstr "Ancre « %s » et mode « %s » pointe vers le même nom de fichier" -#: makeinfo/node.c:859 +#: makeinfo/node.c:923 msgid "This @anchor command ignored; references to it will not work" msgstr "" "Commande @anchor ignorée; les références vers celle-ci ne fonctionneront pas" -#: makeinfo/node.c:861 makeinfo/node.c:1078 +#: makeinfo/node.c:925 makeinfo/node.c:1154 msgid "Rename this anchor or use the `--no-split' option" msgstr "Renommer cette ancre ou utiliser l'option « --no-split »" -#: makeinfo/node.c:891 +#: makeinfo/node.c:955 #, c-format msgid "Unexpected string at end of split-HTML file `%s'" msgstr "Chaîne inattendue à la fin du fichier morcelé HTML « %s »" -#: makeinfo/node.c:920 -msgid "Node:" -msgstr "Noeud:" - -#: makeinfo/node.c:930 +#: makeinfo/node.c:991 msgid "Next:" msgstr "Noeud « Next »:" # Est-ce vraiment un message à traduire? -#: makeinfo/node.c:940 +#: makeinfo/node.c:1007 msgid "Previous:" msgstr "Noeud « Previous »:" # Est-ce vraiment un message à traduire? -#: makeinfo/node.c:950 +#: makeinfo/node.c:1021 msgid "Up:" msgstr "Noeud « Up »:" -#: makeinfo/node.c:1072 +#: makeinfo/node.c:1148 #, c-format msgid "Anchors `%s' and `%s' map to the same file name" msgstr "Ancre « %s » et mode « %s » pointe vers le même nom de fichier" -#: makeinfo/node.c:1077 +#: makeinfo/node.c:1153 msgid "@anchor command ignored; references to it will not work" msgstr "" "Commande @anchor ignorée; les références vers celle-ci ne fonctionneront pas" -#: makeinfo/node.c:1277 +#: makeinfo/node.c:1347 #, c-format -msgid "%s reference to nonexistent node `%s'" -msgstr "%s réfère à un noeud « %s » non existant" +msgid "%s reference to nonexistent node `%s' (perhaps incorrect sectioning?)" +msgstr "" +"%s réfère à un noeud « %s » inexistant (à mois d'un sectionnement incorrect?)" -#: makeinfo/node.c:1294 +#: makeinfo/node.c:1363 msgid "Menu" msgstr "Menu" -#: makeinfo/node.c:1296 +#: makeinfo/node.c:1365 msgid "Cross" msgstr "Référence" -#: makeinfo/node.c:1380 +#: makeinfo/node.c:1447 #, c-format -msgid "Next field of node `%s' not pointed to" -msgstr "Le champ Next du noeud « %s » n'a pas de pointeur de retour en amont" +msgid "Next field of node `%s' not pointed to (perhaps incorrect sectioning?)" +msgstr "" +"Le champ Next du noeud « %s » n'a pas de pointeur de retour en amont (à " +"moins d'un sectionnement incorrect?)" -#: makeinfo/node.c:1383 +#: makeinfo/node.c:1450 #, c-format msgid "This node (%s) has the bad Prev" msgstr "Ce noeud (%s) a un noeud « Prev » erroné" # Est-ce vraiment un message à traduire? -#: makeinfo/node.c:1395 +#: makeinfo/node.c:1462 msgid "Prev" msgstr "Noeud « Previous »" -#: makeinfo/node.c:1438 +#: makeinfo/node.c:1505 #, c-format msgid "Prev field of node `%s' not pointed to" msgstr "Le champ Prev du noeud « %s » n'a pas de pointeur de retour en amont" -#: makeinfo/node.c:1442 +#: makeinfo/node.c:1509 #, c-format msgid "This node (%s) has the bad Next" msgstr "Ce noeud (%s) a un noeud « Next » erroné" -#: makeinfo/node.c:1454 +#: makeinfo/node.c:1521 #, c-format -msgid "`%s' has no Up field" -msgstr "Le noeud %s a un champ « Up » manquant" +msgid "`%s' has no Up field (perhaps incorrect sectioning?)" +msgstr "« %s » n'a pas de champ Up (à moins d'un sectionnement incorrect?)" # Est-ce vraiment un message à traduire? -#: makeinfo/node.c:1457 +#: makeinfo/node.c:1524 msgid "Up" msgstr "Noeud « Up »" -#: makeinfo/node.c:1523 +#: makeinfo/node.c:1590 #, c-format msgid "Node `%s' lacks menu item for `%s' despite being its Up target" msgstr "" "Le noeud « %s » manque d'un item menu pour « %s » en dépit d'être son noeud " "« Up » cible" -#: makeinfo/node.c:1552 +#: makeinfo/node.c:1619 #, c-format msgid "node `%s' has been referenced %d times" msgstr "Le noeud « %s » a été référencé %d fois" -#: makeinfo/node.c:1566 +#: makeinfo/node.c:1633 #, c-format msgid "unreferenced node `%s'" msgstr "noeud « %s » non référencé" -#: makeinfo/sectioning.c:117 +#: makeinfo/node.c:1723 +#, c-format +msgid "Removing %s\n" +msgstr "Retrait de %s\n" + +#: makeinfo/node.c:1727 +#, c-format +msgid "Can't remove file `%s': %s" +msgstr "Ne peut enlever le fichier « %s »: %s" + +#: makeinfo/sectioning.c:122 +#, c-format +msgid "Appendix %c" +msgstr "Annexe %c" + +#: makeinfo/sectioning.c:467 #, c-format -msgid "Appendix %c " -msgstr "Annexe %c " +msgid "Internal error (search_sectioning) `%s'!" +msgstr "Erreur interne (search_sectioning) « %s »!" -#: makeinfo/sectioning.c:356 makeinfo/sectioning.c:444 +#: makeinfo/sectioning.c:562 #, c-format msgid "Internal error (search_sectioning) \"%s\"!" msgstr "Erreur interne (search_sectioning) « %s »!" -#: makeinfo/sectioning.c:502 +#: makeinfo/sectioning.c:623 #, c-format msgid "%c%s is obsolete; use %c%s instead" msgstr "%c%s est périmé; utiliser plutôt %c%s" -#: makeinfo/sectioning.c:518 +#: makeinfo/sectioning.c:639 #, c-format msgid "Node with %ctop as a section already exists" msgstr "Le noeud avec %ctop en tant que section existe déjà" -#: makeinfo/sectioning.c:526 +#: makeinfo/sectioning.c:647 #, c-format msgid "Here is the %ctop node" msgstr "Le noeud %ctop se trouve ici" -#: makeinfo/sectioning.c:543 +#: makeinfo/sectioning.c:663 #, c-format msgid "%ctop used before %cnode, defaulting to %s" msgstr "noeud %ctop utilisé avant %cnode, %s implicitement" -#: makeinfo/toc.c:221 makeinfo/toc.c:298 makeinfo/toc.c:299 +#: makeinfo/toc.c:197 makeinfo/toc.c:271 makeinfo/toc.c:273 msgid "Table of Contents" msgstr "Table des matières" -#: makeinfo/toc.c:330 makeinfo/toc.c:366 makeinfo/toc.c:367 +#: makeinfo/toc.c:304 makeinfo/toc.c:337 makeinfo/toc.c:339 msgid "Short Contents" msgstr "Sommaire" -#: makeinfo/toc.c:406 -#, c-format -msgid "%s: TOC should be here, but it was not found" -msgstr "%s: Table des matières devrait être là, elle ne s'y trouve pas" - -#: makeinfo/xml.c:1108 +#: makeinfo/xml.c:1605 #, c-format msgid "@image file `%s' unreadable: %s" msgstr "commande @image avec un fichier « %s » illisible: %s" -#: util/install-info.c:151 +#: makeinfo/xml.c:2097 +msgid "" +"@headitem as the last item of @multitable produces invalid Docbook documents" +msgstr "" +"@headitem comme dernier item de @multitable produit des documents Docbook " +"invalides" + +#: util/install-info.c:154 #, c-format msgid "%s: warning: " msgstr "%s: avertissement: " -#: util/install-info.c:176 util/install-info.c:189 -msgid "virtual memory exhausted" -msgstr "mémoire virtuelle épuisée" - -#: util/install-info.c:232 +#: util/install-info.c:203 #, c-format msgid " for %s" msgstr " pour %s" -#: util/install-info.c:381 +#: util/install-info.c:426 #, c-format msgid "\tTry `%s --help' for a complete list of options.\n" msgstr "\\tUtiliser « %s --help » pour une liste complète des options.\n" -#: util/install-info.c:389 +#: util/install-info.c:434 #, c-format msgid "" "Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n" @@ -2858,7 +3023,7 @@ msgstr "" " à partir de l'information dans le fichier Info lui-même.\n" " --version Afficher le nom et la version du logiciel et quitter.\n" -#: util/install-info.c:444 +#: util/install-info.c:488 #, c-format msgid "" "This is the file .../info/dir, which contains the\n" @@ -2875,14 +3040,14 @@ msgid "" " In Emacs, you can click mouse button 2 on a menu item or cross reference\n" " to select it.\n" "\n" -"* Menu:\n" +"%s\n" msgstr "" "Ceci est le fichier .../info/dir, lequel contient le noeud \n" "le plus haut dans la hiérarchie Info, noeud appelé (dir)Top.\n" "La première fois que Info est invoqué, vous démarrez la recherche \n" "à partir de ce noeud.\n" "\n" -"%s\\tCeci est le haut de l'arborescence INFO\n" +"%s\tCeci est le haut de l'arborescence INFO\n" "\n" " Ceci (le noeud Répertoire) fournit un menu des sujets majeurs.\n" " Taper « q » pour quitter, « ? » pour lister toutes les commandes Info,\n" @@ -2894,102 +3059,104 @@ msgstr "" "menu \n" " ou sur une référence croisée pour le sélectionner.\n" "\n" -"* Menu:\n" +"%s\n" -#: util/install-info.c:467 +#: util/install-info.c:513 #, c-format msgid "%s: could not read (%s) and could not create (%s)\n" msgstr "%s: ne peut pas lire (%s) et ne peut pas créer (%s)\n" -#: util/install-info.c:551 +#: util/install-info.c:600 #, c-format msgid "%s: empty file" msgstr "%s: fichier vide" -#: util/install-info.c:866 util/install-info.c:906 +#: util/install-info.c:913 util/install-info.c:953 msgid "START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY" msgstr "START-INFO-DIR-ENTRY non apparié avec END-INFO-DIR-ENTRY" -#: util/install-info.c:901 +#: util/install-info.c:948 msgid "END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY" msgstr "END-INFO-DIR-ENTRY non apparié avec START-INFO-DIR-ENTRY" -#: util/install-info.c:1150 util/install-info.c:1160 +#: util/install-info.c:1191 util/install-info.c:1201 #, c-format -msgid "%s: Specify the Info directory only once.\n" -msgstr "%s: Spécifier le répertoire Info seulement une fois.\n" +msgid "%s: already have dir file: %s\n" +msgstr "%s: a déjà un fichier répertoire: %s\n" -#: util/install-info.c:1195 +#: util/install-info.c:1236 #, c-format msgid "%s: Specify the Info file only once.\n" msgstr "%s: Spécifier le fichier Info seulement une fois.\n" -#: util/install-info.c:1244 +#: util/install-info.c:1284 #, c-format msgid "excess command line argument `%s'" msgstr "excédent d'argument de ligne de commande « %s »" -#: util/install-info.c:1248 +#: util/install-info.c:1288 msgid "No input file specified; try --help for more information." msgstr "" "Aucun fichier d'entrée spécifié; utiliser --help pour plus d'informations." -#: util/install-info.c:1251 +#: util/install-info.c:1291 msgid "No dir file specified; try --help for more information." msgstr "Aucun fichier dir spécifié; utiliser --help pour plus d'informations." -#: util/install-info.c:1273 +#: util/install-info.c:1313 #, c-format msgid "no info dir entry in `%s'" msgstr "aucune entrée répertoire Info dans « %s »" -#: util/install-info.c:1388 +#: util/install-info.c:1426 #, c-format msgid "menu item `%s' already exists, for file `%s'" msgstr "item menu « %s » déjà existant, pour le fichier « %s »" -#: util/install-info.c:1411 +#: util/install-info.c:1449 #, c-format msgid "no entries found for `%s'; nothing deleted" msgstr "aucune entrée trouvée pour « %s »; rien n'a été éliminé" -#: util/texindex.c:245 +#: util/texindex.c:252 msgid "display this help and exit" msgstr "afficher cet aide-mémoire et quitter" -#: util/texindex.c:247 +#: util/texindex.c:254 msgid "keep temporary files around after processing" msgstr "conserver les fichiers temporaires après le traitement" -#: util/texindex.c:249 +#: util/texindex.c:256 msgid "do not keep temporary files around after processing (default)" msgstr "ne pas conserver les fichiers temporaires après le traitement (défaut)" -#: util/texindex.c:251 +#: util/texindex.c:258 msgid "send output to FILE" msgstr "envoyer la sortie dans FICHIER" -#: util/texindex.c:253 +#: util/texindex.c:260 msgid "display version information and exit" msgstr "afficher la version du logiciel et quitter" -#: util/texindex.c:264 +#: util/texindex.c:270 #, c-format msgid "Usage: %s [OPTION]... FILE...\n" msgstr "Usage: %s [OPTION]... FICHIER...\n" -#: util/texindex.c:265 +#: util/texindex.c:271 +#, c-format msgid "Generate a sorted index for each TeX output FILE.\n" msgstr "Générer un index trié pour chaque FICHIER de sortie TeX.\n" -#: util/texindex.c:268 +#: util/texindex.c:274 #, c-format msgid "Usually FILE... is specified as `foo.%c%c' for a document `foo.texi'.\n" msgstr "" "Habituellement FICHIER... est indiqué comme « foo.%c%c » pour un document « " "foo.texi ».\n" -#: util/texindex.c:270 +#: util/texindex.c:276 +#, c-format msgid "" "\n" "Options:\n" @@ -2997,31 +3164,78 @@ msgstr "" "\n" "Options:\n" -#: util/texindex.c:887 util/texindex.c:921 util/texindex.c:997 -#: util/texindex.c:1025 +#: util/texindex.c:876 util/texindex.c:910 util/texindex.c:983 +#: util/texindex.c:1011 #, c-format msgid "%s: not a texinfo index file" msgstr "%s: pas un fichier index en format Texinfo" -#: util/texindex.c:982 +#: util/texindex.c:968 #, c-format msgid "failure reopening %s" msgstr "échec lors de la réouverture de %s" -#: util/texindex.c:1224 +#: util/texindex.c:1218 #, c-format msgid "No page number in %s" msgstr "Aucun numéro de page dans %s" -#: util/texindex.c:1295 +#: util/texindex.c:1291 #, c-format msgid "entry %s follows an entry with a secondary name" msgstr "l'entrée %s suit une entrée ayant un nom secondaire" -#: util/texindex.c:1633 -#, c-format -msgid "%s; for file `%s'.\n" -msgstr "%s; pour le fichier « %s ».\n" +# Est-ce que c'est " " ou « » comme caractères? +#~ msgid "\"\" is invalid" +#~ msgstr "\"\" est invalide" + +#~ msgid "%s: Specify the Info directory only once.\n" +#~ msgstr "%s: Spécifier le répertoire Info seulement une fois.\n" + +#~ msgid "%s is an invalid ISO code, using %c" +#~ msgstr "%s n'est pas un code ISO valide, utilisé %c" + +#~ msgid "Cannot specify more than one macro expansion output" +#~ msgstr "Ne peut spécifier plus d'une sortie d'expansion de macro" + +#~ msgid "File exists, but is not a directory" +#~ msgstr "Le fichier existe mais n'est pas un répertoire" + +#~ msgid "First argument to cross-reference may not be empty" +#~ msgstr "Premier argument de références croisée peut ne pas être vide" + +#~ msgid "see " +#~ msgstr "voir " + +#~ msgid "`.' or `,' must follow cross reference, not %c" +#~ msgstr "« . » ou « , » doit suivre une référence croisée, non pas %c" + +#~ msgid "First argument to @inforef may not be empty" +#~ msgstr "Premier argument de @inforef peut ne pas être vide" + +#~ msgid "Node:" +#~ msgstr "Noeud:" + +#~ msgid "%s: TOC should be here, but it was not found" +#~ msgstr "%s: Table des matières devrait être là, elle ne s'y trouve pas" + +#~ msgid "virtual memory exhausted" +#~ msgstr "mémoire virtuelle épuisée" + +#~ msgid "No `%s.png' or `.jpg', and no extension supplied" +#~ msgstr "Aucun « %s.png » ou « .jpg » et aucune extension fournie" + +#~ msgid "%s; for file `%s'.\n" +#~ msgstr "%s; pour le fichier « %s ».\n" + +#~ msgid "`%s' has no Up field" +#~ msgstr "Le noeud %s a un champ « Up » manquant" + +#~ msgid "\\%-10[scroll-forward] Scroll forward 1 line.\n" +#~ msgstr "\\%-10[scroll-forward] Avancer de 1 ligne.\n" + +#~ msgid "\\%-10[scroll-backward] Scroll backward 1 line.\n" +#~ msgstr "\\%-10[scroll-backward] Reculer de 1 ligne.\n" #~ msgid "" #~ "Email bug reports to bug-texinfo@gnu.org,\n" diff --git a/gnu/usr.bin/texinfo/util/Makefile.am b/gnu/usr.bin/texinfo/util/Makefile.am index 300e95aa658..fbd0ce05281 100644 --- a/gnu/usr.bin/texinfo/util/Makefile.am +++ b/gnu/usr.bin/texinfo/util/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.4 2002/06/10 13:51:04 espie Exp $ +# $Id: Makefile.am,v 1.5 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/util. # Run automake in .. to produce Makefile.in from this. # @@ -10,14 +10,36 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -bin_PROGRAMS = install-info texindex -bin_SCRIPTS = texi2dvi +bin_PROGRAMS = ginstall-info texindex +bin_SCRIPTS = texi2dvi texi2pdf + +# Use `ginstall-info' in the definition of PROGRAMS and in dependencies +# because automake generates an install-info target in every Makefile (a +# bug, IMHO, but this is easier than patching Automake.) +ginstall_info_SOURCES = install-info.c + +# Transform `ginstall-info' to `install-info' before applying any +# user-specified name transformations. +transform = s/ginstall-info/install-info/; $(program_transform_name) localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a @LIBINTL@ +LDADD = ../lib/libtxi.a $(LIBINTL) + +dist_pkgdata_DATA = texinfo.dtd texinfo.xsl +pkgdata_DATA = texinfo.cat -# Most of these are for fun. The only one that's really supported is texi2dvi. -EXTRA_DIST = README deref.c fix-info-dir fixfonts \ - fixref.gawk gen-dir-node install-info-html outline.gawk prepinfo.awk \ - tex3patch texi-docstring-magic.el texi2dvi +# we don't actually use version.texi in the rule, but it's one way of +# noticing when the version changes. +texinfo.cat: texinfo-cat.in $(top_srcdir)/doc/version.texi + sed 's/__VERSION__/@VERSION@/g' $(srcdir)/texinfo-cat.in >$@ + +# Most of these are for fun. The only official/installed ones are the +# texi2* scripts. +# +EXTRA_DIST = README deref.c dir-example fix-info-dir fixfonts \ + fixref.gawk gdoc gen-dir-node gendocs.sh gendocs_template infosrch \ + install-info-html outline.gawk \ + prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi texi2pdf txitextest \ + $(dist_pkgdata_DATA) texinfo-cat.in +CLEANFILES = $(pkgdata_DATA) diff --git a/gnu/usr.bin/texinfo/util/Makefile.in b/gnu/usr.bin/texinfo/util/Makefile.in index 164def0051a..7966f02c95a 100644 --- a/gnu/usr.bin/texinfo/util/Makefile.in +++ b/gnu/usr.bin/texinfo/util/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.in,v 1.3 2002/06/10 13:51:04 espie Exp $ +# $Id: Makefile.in,v 1.4 2006/07/17 16:12:36 espie Exp $ # Makefile.am for texinfo/util. # Run automake in .. to produce Makefile.in from this. # @@ -25,208 +25,322 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SHELL = @SHELL@ + + + +SOURCES = $(ginstall_info_SOURCES) texindex.c srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -host_alias = @host_alias@ +build_triplet = @build@ host_triplet = @host@ +bin_PROGRAMS = ginstall-info$(EXEEXT) texindex$(EXEEXT) +subdir = util +DIST_COMMON = README $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intdiv0.m4 \ + $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ + $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ + $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_ginstall_info_OBJECTS = install-info.$(OBJEXT) +ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS) +ginstall_info_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +ginstall_info_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1) +texindex_SOURCES = texindex.c +texindex_OBJECTS = texindex.$(OBJEXT) +texindex_LDADD = $(LDADD) +texindex_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1) +binSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(bin_SCRIPTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(ginstall_info_SOURCES) texindex.c +DIST_SOURCES = $(ginstall_info_SOURCES) texindex.c +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +dist_pkgdataDATA_INSTALL = $(INSTALL_DATA) +pkgdataDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_pkgdata_DATA) $(pkgdata_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ +# Transform `ginstall-info' to `install-info' before applying any +# user-specified name transformations. +transform = s/ginstall-info/install-info/; $(program_transform_name) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ -HAVE_LIB = @HAVE_LIB@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HELP2MAN = @HELP2MAN@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTALL_WARNINGS_FALSE = @INSTALL_WARNINGS_FALSE@ +INSTALL_WARNINGS_TRUE = @INSTALL_WARNINGS_TRUE@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ -LIB = @LIB@ +LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ -LTLIB = @LTLIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ TERMLIBS = @TERMLIBS@ +TOOLS_ONLY_FALSE = @TOOLS_ONLY_FALSE@ +TOOLS_ONLY_TRUE = @TOOLS_ONLY_TRUE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +native_tools = @native_tools@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +bin_SCRIPTS = texi2dvi texi2pdf -bin_PROGRAMS = install-info texindex -bin_SCRIPTS = texi2dvi - +# Use `ginstall-info' in the definition of PROGRAMS and in dependencies +# because automake generates an install-info target in every Makefile (a +# bug, IMHO, but this is easier than patching Automake.) +ginstall_info_SOURCES = install-info.c localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a @LIBINTL@ - -# Most of these are for fun. The only one that's really supported is texi2dvi. -EXTRA_DIST = README deref.c fix-info-dir fixfonts \ - fixref.gawk gen-dir-node install-info-html outline.gawk prepinfo.awk \ - tex3patch texi-docstring-magic.el texi2dvi - -subdir = util -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = install-info$(EXEEXT) texindex$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -install_info_SOURCES = install-info.c -install_info_OBJECTS = install-info.$(OBJEXT) -install_info_LDADD = $(LDADD) -install_info_DEPENDENCIES = ../lib/libtxi.a -install_info_LDFLAGS = -texindex_SOURCES = texindex.c -texindex_OBJECTS = texindex.$(OBJEXT) -texindex_LDADD = $(LDADD) -texindex_DEPENDENCIES = ../lib/libtxi.a -texindex_LDFLAGS = -SCRIPTS = $(bin_SCRIPTS) +LDADD = ../lib/libtxi.a $(LIBINTL) +dist_pkgdata_DATA = texinfo.dtd texinfo.xsl +pkgdata_DATA = texinfo.cat +# Most of these are for fun. The only official/installed ones are the +# texi2* scripts. +# +EXTRA_DIST = README deref.c dir-example fix-info-dir fixfonts \ + fixref.gawk gdoc gen-dir-node gendocs.sh gendocs_template infosrch \ + install-info-html outline.gawk \ + prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi texi2pdf txitextest \ + $(dist_pkgdata_DATA) texinfo-cat.in -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/install-info.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/texindex.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -DIST_SOURCES = install-info.c texindex.c -DIST_COMMON = README Makefile.am Makefile.in -SOURCES = install-info.c texindex.c - +CLEANFILES = $(pkgdata_DATA) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu util/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ - p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \ - f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - f=`echo "$$f" | sed -e 's,^.*/,,'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -install-info$(EXEEXT): $(install_info_OBJECTS) $(install_info_DEPENDENCIES) - @rm -f install-info$(EXEEXT) - $(LINK) $(install_info_LDFLAGS) $(install_info_OBJECTS) $(install_info_LDADD) $(LIBS) +ginstall-info$(EXEEXT): $(ginstall_info_OBJECTS) $(ginstall_info_DEPENDENCIES) + @rm -f ginstall-info$(EXEEXT) + $(LINK) $(ginstall_info_LDFLAGS) $(ginstall_info_OBJECTS) $(ginstall_info_LDADD) $(LIBS) texindex$(EXEEXT): $(texindex_OBJECTS) $(texindex_DEPENDENCIES) @rm -f texindex$(EXEEXT) $(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f="`echo $$p|sed '$(transform)'`"; \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f; \ - elif test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f; \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f="`echo $$p|sed '$(transform)'`"; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -234,28 +348,54 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/install-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texindex.Po@am__quote@ -distclean-depend: - -rm -rf ./$(DEPDIR) - .c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` -CCDEPMODE = @CCDEPMODE@ -install-info-am: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: +install-dist_pkgdataDATA: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)" + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done -ETAGS = etags -ETAGSFLAGS = +uninstall-dist_pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done +install-pkgdataDATA: $(pkgdata_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)" + @list='$(pkgdata_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done -tags: TAGS +uninstall-pkgdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgdata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -265,6 +405,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -276,8 +417,24 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -286,25 +443,29 @@ GTAGS: && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir)$$dir \ - || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ @@ -313,11 +474,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) - +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir) - + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -329,15 +490,16 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -347,48 +509,71 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-tags + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: -install-data-am: +install-data-am: install-dist_pkgdataDATA install-pkgdataDATA install-exec-am: install-binPROGRAMS install-binSCRIPTS +install-info: install-info-am + install-man: installcheck-am: maintainer-clean: maintainer-clean-am - + -rm -rf ./$(DEPDIR) + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-info-am - -.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic distclean distclean-compile distclean-depend \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-binPROGRAMS \ - install-binSCRIPTS install-data install-data-am install-exec \ - install-exec-am install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-info-am +pdf: pdf-am +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-dist_pkgdataDATA uninstall-info-am \ + uninstall-pkgdataDATA + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-binSCRIPTS install-data install-data-am \ + install-dist_pkgdataDATA install-exec install-exec-am \ + install-info install-info-am install-man install-pkgdataDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-binSCRIPTS uninstall-dist_pkgdataDATA \ + uninstall-info-am uninstall-pkgdataDATA + + +# we don't actually use version.texi in the rule, but it's one way of +# noticing when the version changes. +texinfo.cat: texinfo-cat.in $(top_srcdir)/doc/version.texi + sed 's/__VERSION__/@VERSION@/g' $(srcdir)/texinfo-cat.in >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gnu/usr.bin/texinfo/util/gen-dir-node b/gnu/usr.bin/texinfo/util/gen-dir-node index be0f854fb64..5349d568d65 100644 --- a/gnu/usr.bin/texinfo/util/gen-dir-node +++ b/gnu/usr.bin/texinfo/util/gen-dir-node @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: gen-dir-node,v 1.4 2003/09/09 15:40:25 david Exp $ +# $Id: gen-dir-node,v 1.5 2006/07/17 16:12:36 espie Exp $ # Generate the top-level Info node, given a directory of Info files # and (optionally) a skeleton file. The output will be suitable for a # top-level dir file. The skeleton file contains info topic names in the @@ -51,7 +51,7 @@ echo "This version was generated on `date`" echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`" cat << moobler -\$Id: gen-dir-node,v 1.4 2003/09/09 15:40:25 david Exp $ +\$Id: gen-dir-node,v 1.5 2006/07/17 16:12:36 espie Exp $ This is the file .../info/dir, which contains the topmost node of the Info hierarchy. The first time you invoke Info you start off looking at that node, which is (dir)Top. @@ -107,8 +107,7 @@ while [ $lines -ge $line ] ; do fname= - if [ -z "$echoline" -a ! -z "$file" ] ; then - + if [ -z "$echoline" ] && [ ! -z "$file" ] ; then # Find the file to operate upon. Check both possible names. infoname=`echo $file | sed 's/\.info$//'` noext= @@ -121,10 +120,10 @@ while [ $lines -ge $line ] ; do fi # If it exists with both names take what was said in the file. - if [ ! -z "$ext" -a ! -z "$noext" ]; then + if [ ! -z "$ext" ] && [ ! -z "$noext" ]; then fname=$file warn="### Warning: $ext and $noext both exist! Using ${file}. ###" - elif [ ! \( -z "$ext" -a -z "$noext" \) ]; then + elif [ ! -z "${noext}${ext}" ]; then # just take the name if it exists only once fname=${noext}${ext} fi diff --git a/gnu/usr.bin/texinfo/util/install-info.c b/gnu/usr.bin/texinfo/util/install-info.c index b3b667c9f31..5ff3d572d70 100644 --- a/gnu/usr.bin/texinfo/util/install-info.c +++ b/gnu/usr.bin/texinfo/util/install-info.c @@ -1,7 +1,8 @@ /* install-info -- create Info directory entry(ies) for an Info file. - $Id: install-info.c,v 1.7 2002/06/10 13:51:04 espie Exp $ + $Id: install-info.c,v 1.8 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,11 +23,14 @@ static char *progname = "install-info"; -struct line_data *findlines (); -void insert_entry_here (); -int compare_section_names (), compare_entries_text (); - struct spec_entry; +struct spec_section; + +struct line_data *findlines (char *data, int size, int *nlinesp); +void insert_entry_here (struct spec_entry *entry, int line_number, + struct line_data *dir_lines, int n_entries); +int compare_section_names (const void *s1, const void *s2); +int compare_entries_text (const void *e1, const void *e2); /* Data structures. */ @@ -119,6 +123,7 @@ struct option longopts[] = { "dir-file", required_argument, NULL, 'd' }, { "entry", required_argument, NULL, 'e' }, { "help", no_argument, NULL, 'h' }, + { "infodir", required_argument, NULL, 'D' }, { "info-dir", required_argument, NULL, 'D' }, { "info-file", required_argument, NULL, 'i' }, { "item", required_argument, NULL, 'e' }, @@ -135,8 +140,7 @@ struct option longopts[] = /* VARARGS1 */ void -error (s1, s2, s3) - char *s1, *s2, *s3; +error (const char *s1, const char *s2, const char *s3) { fprintf (stderr, "%s: ", progname); fprintf (stderr, s1, s2, s3); @@ -145,8 +149,7 @@ error (s1, s2, s3) /* VARARGS1 */ void -warning (s1, s2, s3) - char *s1, *s2, *s3; +warning (const char *s1, const char *s2, const char *s3) { fprintf (stderr, _("%s: warning: "), progname); fprintf (stderr, s1, s2, s3); @@ -156,45 +159,16 @@ warning (s1, s2, s3) /* Print error message and exit. */ void -fatal (s1, s2, s3) - char *s1, *s2, *s3; +fatal (const char *s1, const char *s2, const char *s3) { error (s1, s2, s3); xexit (1); } -/* Memory allocation and string operations. */ - -/* Like malloc but get fatal error if memory is exhausted. */ -void * -xmalloc (size) - unsigned int size; -{ - extern void *malloc (); - void *result = malloc (size); - if (result == NULL) - fatal (_("virtual memory exhausted"), 0, 0); - return result; -} - -/* Like realloc but get fatal error if memory is exhausted. */ -void * -xrealloc (obj, size) - void *obj; - unsigned int size; -{ - extern void *realloc (); - void *result = realloc (obj, size); - if (result == NULL) - fatal (_("virtual memory exhausted"), 0, 0); - return result; -} - /* Return a newly-allocated string whose contents concatenate those of S1, S2, S3. */ char * -concat (s1, s2, s3) - char *s1, *s2, *s3; +concat (const char *s1, const char *s2, const char *s3) { int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); char *result = (char *) xmalloc (len1 + len2 + len3 + 1); @@ -211,9 +185,7 @@ concat (s1, s2, s3) copied from starting at STRING. */ char * -copy_string (string, size) - char *string; - int size; +copy_string (const char *string, int size) { int i; char *copy = (char *) xmalloc (size + 1); @@ -226,19 +198,71 @@ copy_string (string, size) /* Print fatal error message based on errno, with file name NAME. */ void -pfatal_with_name (name) - char *name; +pfatal_with_name (const char *name) { char *s = concat ("", strerror (errno), _(" for %s")); fatal (s, name, 0); } +/* Compare the menu item names in LINE1 (line length LEN1) + and LINE2 (line length LEN2). Return 1 if the item name + in LINE1 is less, 0 otherwise. */ + +static int +menu_line_lessp (char *line1, int len1, char *line2, int len2) +{ + int minlen = (len1 < len2 ? len1 : len2); + int i; + + for (i = 0; i < minlen; i++) + { + /* If one item name is a prefix of the other, + the former one is less. */ + if (line1[i] == ':' && line2[i] != ':') + return 1; + if (line2[i] == ':' && line1[i] != ':') + return 0; + /* If they both continue and differ, one is less. */ + if (line1[i] < line2[i]) + return 1; + if (line1[i] > line2[i]) + return 0; + } + /* With a properly formatted dir file, + we can only get here if the item names are equal. */ + return 0; +} + +/* Compare the menu item names in LINE1 (line length LEN1) + and LINE2 (line length LEN2). Return 1 if the item names are equal, + 0 otherwise. */ + +static int +menu_line_equal (char *line1, int len1, char *line2, int len2) +{ + int minlen = (len1 < len2 ? len1 : len2); + int i; + + for (i = 0; i < minlen; i++) + { + /* If both item names end here, they are equal. */ + if (line1[i] == ':' && line2[i] == ':') + return 1; + /* If they both continue and differ, one is less. */ + if (line1[i] != line2[i]) + return 0; + } + /* With a properly formatted dir file, + we can only get here if the item names are equal. */ + return 1; +} + + /* Given the full text of a menu entry, null terminated, return just the menu item name (copied). */ char * -extract_menu_item_name (item_text) - char *item_text; +extract_menu_item_name (char *item_text) { char *p; @@ -256,8 +280,7 @@ extract_menu_item_name (item_text) return just the menu item file (copied). */ char * -extract_menu_file_name (item_text) - char *item_text; +extract_menu_file_name (char *item_text) { char *p = item_text; @@ -300,8 +323,7 @@ extract_menu_file_name (item_text) /* Return FNAME with any [.info][.gz] suffix removed. */ static char * -strip_info_suffix (fname) - char *fname; +strip_info_suffix (char *fname) { char *ret = xstrdup (fname); unsigned len = strlen (ret); @@ -311,6 +333,11 @@ strip_info_suffix (fname) len -= 3; ret[len] = 0; } + else if (len > 4 && FILENAME_CMP (ret + len - 4, ".bz2") == 0) + { + len -= 4; + ret[len] = 0; + } if (len > 5 && FILENAME_CMP (ret + len - 5, ".info") == 0) { @@ -340,14 +367,32 @@ strip_info_suffix (fname) TERM_CHAR) and still match. */ static int -menu_item_equal (item, term_char, name) - char *item; - char term_char; - char *name; +menu_item_equal (const char *item, char term_char, const char *name) { + int ret; + const char *item_basename = item; unsigned name_len = strlen (name); + + /* We must compare the basename in ITEM, since we are passed the + basename of the original info file. Otherwise, a new entry like + "lilypond/lilypond" won't match "lilypond". + + Actually, it seems to me that we should really compare the whole + name, and not just the basename. Couldn't there be dir1/foo.info + and dir2/foo.info? Also, it seems like we should be using the + filename from the new dir entries, not the filename on the command + line. Not worrying about those things right now, though. --karl, + 26mar04. */ + while (*item_basename && !IS_SLASH (*item_basename) + && *item_basename != term_char) + item_basename++; + if (! *item_basename || *item_basename == term_char) + item_basename = item; /* no /, use original */ + else + item_basename++; /* have /, move past it */ + /* First, ITEM must actually match NAME (usually it won't). */ - int ret = strncasecmp (item, name, name_len) == 0; + ret = strncasecmp (item_basename, name, name_len) == 0; if (ret) { /* Then, `foobar' doesn't match `foo', so be sure we've got all of @@ -365,8 +410,8 @@ menu_item_equal (item, term_char, name) { char *suffix = suffixes[i]; unsigned suffix_len = strlen (suffix); - ret = strncasecmp (item + name_len, suffix, suffix_len) == 0 - && item[name_len + suffix_len] == term_char; + ret = strncasecmp (item_basename + name_len, suffix, suffix_len) == 0 + && item_basename[name_len + suffix_len] == term_char; } } @@ -376,7 +421,7 @@ menu_item_equal (item, term_char, name) void -suggest_asking_for_help () +suggest_asking_for_help (void) { fprintf (stderr, _("\tTry `%s --help' for a complete list of options.\n"), progname); @@ -384,7 +429,7 @@ suggest_asking_for_help () } void -print_help () +print_help (void) { printf (_("Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\ \n\ @@ -429,8 +474,7 @@ Texinfo home page: http://www.gnu.org/software/texinfo/")); already exists, do nothing. */ void -ensure_dirfile_exists (dirfile) - char *dirfile; +ensure_dirfile_exists (char *dirfile) { int desc = open (dirfile, O_RDONLY); if (desc < 0 && errno == ENOENT) @@ -444,7 +488,7 @@ ensure_dirfile_exists (dirfile) fprintf (f, _("This is the file .../info/dir, which contains the\n\ topmost node of the Info hierarchy, called (dir)Top.\n\ The first time you invoke Info you start off looking at this node.\n\ -\n\ +\x1f\n\ %s\tThis is the top of the INFO tree\n\ \n\ This (the Directory node) gives a menu of major topics.\n\ @@ -455,8 +499,10 @@ The first time you invoke Info you start off looking at this node.\n\ In Emacs, you can click mouse button 2 on a menu item or cross reference\n\ to select it.\n\ \n\ -* Menu:\n\ -"), "File: dir,\tNode: Top"); /* This part must not be translated. */ +%s\n\ +"), "File: dir,\tNode: Top", /* These keywords must not be translated. */ + "* Menu:" +); if (fclose (f) < 0) pfatal_with_name (dirfile); } @@ -484,13 +530,9 @@ The first time you invoke Info you start off looking at this node.\n\ magic number, not the filename. */ FILE * -open_possibly_compressed_file (filename, create_callback, - opened_filename, compression_program, is_pipe) - char *filename; - void (*create_callback) (); - char **opened_filename; - char **compression_program; - int *is_pipe; +open_possibly_compressed_file (char *filename, + void (*create_callback) (char *), + char **opened_filename, char **compression_program, int *is_pipe) { char *local_opened_filename, *local_compression_program; int nread; @@ -508,6 +550,13 @@ open_possibly_compressed_file (filename, create_callback, { *opened_filename = concat (filename, ".gz", ""); f = fopen (*opened_filename, FOPEN_RBIN); + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".bz2", ""); + f = fopen (*opened_filename, FOPEN_RBIN); + } + #ifdef __MSDOS__ if (!f) { @@ -563,6 +612,18 @@ open_possibly_compressed_file (filename, create_callback, #else *compression_program = "gzip"; #endif + else if(data[0] == 'B' && data[1] == 'Z' && data[2] == 'h') +#ifndef STRIP_DOT_EXE + *compression_program = "bzip2.exe"; +#else + *compression_program = "bzip2"; +#endif + else if(data[0] == 'B' && data[1] == 'Z' && data[2] == '0') +#ifndef STRIP_DOT_EXE + *compression_program = "bzip.exe"; +#else + *compression_program = "bzip"; +#endif else *compression_program = NULL; @@ -601,13 +662,9 @@ open_possibly_compressed_file (filename, create_callback, a fatal error. */ char * -readfile (filename, sizep, create_callback, - opened_filename, compression_program) - char *filename; - int *sizep; - void (*create_callback) (); - char **opened_filename; - char **compression_program; +readfile (char *filename, int *sizep, + void (*create_callback) (char *), char **opened_filename, + char **compression_program) { char *real_name; FILE *f; @@ -658,16 +715,9 @@ readfile (filename, sizep, create_callback, we'll write dir.gz on output. */ static void -output_dirfile (dirfile, dir_nlines, dir_lines, - n_entries_to_add, entries_to_add, input_sections, - compression_program) - char *dirfile; - int dir_nlines; - struct line_data *dir_lines; - int n_entries_to_add; - struct spec_entry *entries_to_add; - struct spec_section *input_sections; - char *compression_program; +output_dirfile (char *dirfile, int dir_nlines, struct line_data *dir_lines, + int n_entries_to_add, struct spec_entry *entries_to_add, + struct spec_section *input_sections, char *compression_program) { int i; FILE *output; @@ -796,11 +846,8 @@ output_dirfile (dirfile, dir_nlines, dir_lines, /* Parse the input to find the section names and the entry names it specifies. Return the number of entries to add from this file. */ int -parse_input (lines, nlines, sections, entries) - const struct line_data *lines; - int nlines; - struct spec_section **sections; - struct spec_entry **entries; +parse_input (const struct line_data *lines, int nlines, + struct spec_section **sections, struct spec_entry **entries) { int n_entries = 0; int prefix_length = strlen ("INFO-DIR-SECTION "); @@ -904,7 +951,7 @@ parse_input (lines, nlines, sections, entries) } if (start_of_this_entry != 0) fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"), - 0, 0); + 0, 0); /* If we ignored the INFO-DIR-ENTRY directives, we need now go back and plug the names of all the sections we found into every @@ -926,11 +973,8 @@ parse_input (lines, nlines, sections, entries) /* Parse the dir file whose basename is BASE_NAME. Find all the nodes, and their menus, and the sections of their menus. */ int -parse_dir_file (lines, nlines, nodes, base_name) - struct line_data *lines; - int nlines; - struct node **nodes; - const char *base_name; +parse_dir_file (struct line_data *lines, int nlines, struct node **nodes, + const char *base_name) { int node_header_flag = 0; int something_deleted = 0; @@ -1080,15 +1124,12 @@ parse_dir_file (lines, nlines, nodes, base_name) } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { char *opened_dirfilename; char *compression_program; char *infile_sans_info; char *infile = 0, *dirfile = 0; - unsigned infilelen_sans_info; /* Record the text of the Info file, as a sequence of characters and as a sequence of lines. */ @@ -1147,8 +1188,8 @@ main (argc, argv) case 'd': if (dirfile) { - fprintf (stderr, _("%s: Specify the Info directory only once.\n"), - progname); + fprintf (stderr, _("%s: already have dir file: %s\n"), + progname, dirfile); suggest_asking_for_help (); } dirfile = optarg; @@ -1157,8 +1198,8 @@ main (argc, argv) case 'D': if (dirfile) { - fprintf (stderr, _("%s: Specify the Info directory only once.\n"), - progname); + fprintf (stderr, _("%s: already have dir file: %s\n"), + progname, dirfile); suggest_asking_for_help (); } dirfile = concat (optarg, "", "/dir"); @@ -1221,11 +1262,10 @@ main (argc, argv) case 'V': printf ("install-info (GNU %s) %s\n", PACKAGE, VERSION); puts (""); - printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\ -There is NO warranty. You may redistribute this software\n\ + puts ("Copyright (C) 2004 Free Software Foundation, Inc."); + printf (_("There is NO warranty. You may redistribute this software\n\ under the terms of the GNU General Public License.\n\ -For more information about these matters, see the files named COPYING.\n"), - "2002"); +For more information about these matters, see the files named COPYING.\n")); xexit (0); default: @@ -1246,7 +1286,7 @@ For more information about these matters, see the files named COPYING.\n"), if (!infile) fatal (_("No input file specified; try --help for more information."), - 0, 0); + 0, 0); if (!dirfile) fatal (_("No dir file specified; try --help for more information."), 0, 0); @@ -1313,13 +1353,12 @@ For more information about these matters, see the files named COPYING.\n"), char *infile_basename = infile + strlen (infile); if (HAVE_DRIVE (infile)) - infile += 2; /* get past the drive spec X: */ + infile += 2; /* get past the drive spec X: */ while (infile_basename > infile && !IS_SLASH (infile_basename[-1])) infile_basename--; infile_sans_info = strip_info_suffix (infile_basename); - infilelen_sans_info = strlen (infile_sans_info); } something_deleted @@ -1329,7 +1368,6 @@ For more information about these matters, see the files named COPYING.\n"), Find the menu sections to add them in. In each section, find the proper alphabetical place to add each of the entries. */ - if (!delete_flag) { struct node *node; @@ -1369,7 +1407,7 @@ For more information about these matters, see the files named COPYING.\n"), } if (!spec || spec == entry->entry_sections_tail) continue; - + /* Subtract one because dir_lines is zero-based, but the `end_line' and `start_line' members are one-based. */ @@ -1414,6 +1452,7 @@ For more information about these matters, see the files named COPYING.\n"), entries_to_add, input_sections, compression_program); xexit (0); + return 0; /* Avoid bogus warnings. */ } /* Divide the text at DATA (of SIZE bytes) into lines. @@ -1421,10 +1460,7 @@ For more information about these matters, see the files named COPYING.\n"), Store the length of that vector into *NLINESP. */ struct line_data * -findlines (data, size, nlinesp) - char *data; - int size; - int *nlinesp; +findlines (char *data, int size, int *nlinesp) { int i; int lineflag = 1; @@ -1469,75 +1505,16 @@ findlines (data, size, nlinesp) return lines; } -/* Compare the menu item names in LINE1 (line length LEN1) - and LINE2 (line length LEN2). Return 1 if the item name - in LINE1 is less, 0 otherwise. */ - -int -menu_line_lessp (line1, len1, line2, len2) - char *line1; - int len1; - char *line2; - int len2; -{ - int minlen = (len1 < len2 ? len1 : len2); - int i; - - for (i = 0; i < minlen; i++) - { - /* If one item name is a prefix of the other, - the former one is less. */ - if (line1[i] == ':' && line2[i] != ':') - return 1; - if (line2[i] == ':' && line1[i] != ':') - return 0; - /* If they both continue and differ, one is less. */ - if (line1[i] < line2[i]) - return 1; - if (line1[i] > line2[i]) - return 0; - } - /* With a properly formatted dir file, - we can only get here if the item names are equal. */ - return 0; -} - -/* Compare the menu item names in LINE1 (line length LEN1) - and LINE2 (line length LEN2). Return 1 if the item names are equal, - 0 otherwise. */ - -int -menu_line_equal (line1, len1, line2, len2) - char *line1; - int len1; - char *line2; - int len2; -{ - int minlen = (len1 < len2 ? len1 : len2); - int i; - - for (i = 0; i < minlen; i++) - { - /* If both item names end here, they are equal. */ - if (line1[i] == ':' && line2[i] == ':') - return 1; - /* If they both continue and differ, one is less. */ - if (line1[i] != line2[i]) - return 0; - } - /* With a properly formatted dir file, - we can only get here if the item names are equal. */ - return 1; -} - -/* This is the comparison function for qsort - for a vector of pointers to struct spec_section. +/* This is the comparison function for qsort for a vector of pointers to + struct spec_section. (Have to use const void * as the parameter type + to avoid incompatible-with-qsort warnings.) Compare the section names. */ int -compare_section_names (sec1, sec2) - struct spec_section **sec1, **sec2; +compare_section_names (const void *p1, const void *p2) { + struct spec_section **sec1 = (struct spec_section **) p1; + struct spec_section **sec2 = (struct spec_section **) p2; char *name1 = (*sec1)->name; char *name2 = (*sec2)->name; return strcmp (name1, name2); @@ -1548,9 +1525,10 @@ compare_section_names (sec1, sec2) Compare the entries' text. */ int -compare_entries_text (entry1, entry2) - struct spec_entry **entry1, **entry2; +compare_entries_text (const void *p1, const void *p2) { + struct spec_entry **entry1 = (struct spec_entry **) p1; + struct spec_entry **entry2 = (struct spec_entry **) p2; char *text1 = (*entry1)->text; char *text2 = (*entry2)->text; char *colon1 = strchr (text1, ':'); @@ -1574,11 +1552,8 @@ compare_entries_text (entry1, entry2) in main. */ void -insert_entry_here (entry, line_number, dir_lines, n_entries) - struct spec_entry *entry; - int line_number; - struct line_data *dir_lines; - int n_entries; +insert_entry_here (struct spec_entry *entry, int line_number, + struct line_data *dir_lines, int n_entries) { int i, j; diff --git a/gnu/usr.bin/texinfo/util/texi2dvi b/gnu/usr.bin/texinfo/util/texi2dvi index fe5f7c345b1..bf6130fb08c 100644 --- a/gnu/usr.bin/texinfo/util/texi2dvi +++ b/gnu/usr.bin/texinfo/util/texi2dvi @@ -1,9 +1,9 @@ #! /bin/sh # texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources. -# $Id: texi2dvi,v 1.4 2002/06/10 13:51:04 espie Exp $ +# $Id: texi2dvi,v 1.5 2006/07/17 16:12:36 espie Exp $ # -# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2001, 02 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, +# 2002, 2003, 2004 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,19 +20,19 @@ # program's maintainer or write to: The Free Software Foundation, # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. # -# Original author: Noah Friedman <friedman@gnu.org>. +# Original author: Noah Friedman. # # Please send bug reports, etc. to bug-texinfo@gnu.org. # If possible, please send a copy of the output of the script called with # the `--debug' option when making a bug report. # This string is expanded by rcs automatically when this file is checked out. -rcs_revision='$Revision: 1.4 $' +rcs_revision='$Revision: 1.5 $' rcs_version=`set - $rcs_revision; echo $2` program=`echo $0 | sed -e 's!.*/!!'` -version="texi2dvi (GNU Texinfo 4.2) $rcs_version +version="texi2dvi (GNU Texinfo 4.8) $rcs_version -Copyright (C) 2002 Free Software Foundation, Inc. +Copyright (C) 2004 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -61,16 +61,18 @@ Operation modes: TeX tuning: -@ use @input instead of \input; for preloaded Texinfo - -e, --expand force macro expansion using makeinfo + -e, -E, --expand force macro expansion using makeinfo -I DIR search DIR for Texinfo files -l, --language=LANG specify the LANG of FILE (LaTeX or Texinfo) -p, --pdf use pdftex or pdflatex for processing - -t, --texinfo=CMD insert CMD after @setfilename in copy of input file - multiple values accumulate + -r, --recode call recode before TeX to translate input characters + -t, --command=CMD insert CMD in copy of input file + or --texinfo=CMD multiple values accumulate The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO, -TEX (or PDFTEX), and TEXINDEX environment variables are used to run -those commands, if they are set. +TEX (or PDFTEX), TEXINDEX, and THUMBPDF environment variables are used +to run those commands, if they are set. Any CMD strings are added +after @setfilename for Texinfo input, in the first line for LaTeX input. Email bug reports to <bug-texinfo@gnu.org>, general questions and discussion to <help-texinfo@gnu.org>. @@ -86,13 +88,15 @@ escape='\' expand= # t for expansion via makeinfo miincludes= # makeinfo include path oformat=dvi -oname= # --output +oname= # --output quiet= # by default let the tools' message be displayed +recode=false set_language= -textra= +textra= # Extra TeX commands to insert in the input file. +textra_cmd= # sed command to insert TEXTRA where appropriate tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems. -txincludes= # TEXINPUTS extensions -txiprereq=19990129 # minimum texinfo.tex version to have macro expansion +txincludes= # TEXINPUTS extensions, with trailing colon +txiprereq=19990129 # minimum texinfo.tex version with macro expansion verbose=false # echo for verbose mode orig_pwd=`pwd` @@ -105,11 +109,39 @@ else path_sep=":" fi -# Save this so we can construct a new TEXINPUTS path for each file. -TEXINPUTS_orig="$TEXINPUTS" -# Unfortunately makeindex does not read TEXINPUTS. -INDEXSTYLE_orig="$INDEXSTYLE" -export TEXINPUTS INDEXSTYLE +# Pacify verbose cds. +CDPATH=${ZSH_VERSION+.}$path_sep + +# In case someone crazy insists on using grep -E. +: ${EGREP=egrep} + +# return true if program $1 is somewhere in PATH, else false. +# +findprog () { + foundprog=false + for dir in `echo $PATH | tr "$path_sep" " "`; do + if test -x "$dir/$1"; then # does anyone still need test -f? + foundprog=true + break + fi + done + $foundprog +} + +# Report an error and exit with failure. +fatal () { + echo "$0: $*" >&2 + exit 1 +} + +# Save TEXINPUTS so we can construct a new TEXINPUTS path for each file. +# Likewise for bibtex and makeindex. +tex_envvars="BIBINPUTS BSTINPUTS INDEXSTYLE TEXINPUTS" +for var in $tex_envvars; do + eval ${var}_orig=\$$var + export $var +done + # Push a token among the arguments that will be used to notice when we # ended options/arguments parsing. @@ -139,16 +171,15 @@ while test x"$1" != x"$arg_sep"; do case "$1" in -@ ) escape=@;; # Silently and without documentation accept -b and --b[atch] as synonyms. - -b | --b*) batch=eval;; - -q | -s | --q* | --s*) quiet=t; batch=eval;; + -b | --b*) batch=true;; -c | --c*) clean=t;; -D | --d*) debug=t;; - -e | --e*) expand=t;; + -e | -E | --e*) expand=t;; -h | --h*) echo "$usage"; exit 0;; -I | --I*) shift miincludes="$miincludes -I $1" - txincludes="$txincludes$path_sep$1" + txincludes="$txincludes$1$path_sep" ;; -l | --l*) shift; set_language=$1;; -o | --o*) @@ -159,8 +190,10 @@ while test x"$1" != x"$arg_sep"; do *) oname="$orig_pwd/$1";; esac;; -p | --p*) oformat=pdf;; - -t | --t*) shift; textra="$textra\\ -$1";; + -q | -s | --q* | --s*) quiet=t; batch=true;; + -r | --r*) recode=true;; + -t | --tex* | --com* ) shift; textra="$textra\\ +"`echo "$1" | sed 's/\\\\/\\\\\\\\/g'`;; -v | --vers*) echo "$version"; exit 0;; -V | --verb*) verbose=echo;; --) # What remains are not options. @@ -197,6 +230,39 @@ case $# in ;; esac + +# We can't do much without tex. +# +if findprog ${TEX:-tex}; then :; else cat <<EOM +You don't have a working TeX binary (${TEX:-tex}) installed anywhere in +your PATH, and texi2dvi cannot proceed without one. If you want to use +this script, you'll need to install TeX (if you don't have it) or change +your PATH or TEX environment variable (if you do). See the --help +output for more details. + +For information about obtaining TeX, please see http://www.tug.org. If +you happen to be using Debian, you can get it with this command: + apt-get install tetex-bin +EOM + exit 1 +fi + + +# We want to use etex (or pdftex) if they are available, and the user +# didn't explicitly specify. We don't check for elatex and pdfelatex +# because (as of 2003), the LaTeX team has asked that new distributions +# use etex by default anyway. +# +# End up with the TEX and PDFTEX variables set to what we are going to use. +if test -z "$TEX"; then + if findprog etex; then TEX=etex; else TEX=tex; fi +fi +# +if test -z "$PDFTEX"; then + if findprog pdfetex; then PDFTEX=pdfetex; else PDFTEX=pdftex; fi +fi + + # Prepare the temporary directory. Remove it at exit, unless debugging. if test -z "$debug"; then trap "cd / && rm -rf $tmpdir" 0 1 2 15 @@ -206,17 +272,18 @@ fi (umask 077 && mkdir $tmpdir) || exit 1 # Prepare the tools we might need. This may be extra work in some -# cases, but improves the readibility of the script. +# cases, but improves the readability of the script. utildir=$tmpdir/utils mkdir $utildir || exit 1 # A sed script that preprocesses Texinfo sources in order to keep the -# iftex sections only. We want to remove non TeX sections, and -# comment (with `@c texi2dvi') TeX sections so that makeinfo does not -# try to parse them. Nevertheless, while commenting TeX sections, -# don't comment @macro/@end macro so that makeinfo does propagate -# them. Unfortunately makeinfo --iftex --no-ifhtml --no-ifinfo -# doesn't work well enough (yet) to use that, so work around with sed. +# iftex sections only. We want to remove non TeX sections, and comment +# (with `@c texi2dvi') TeX sections so that makeinfo does not try to +# parse them. Nevertheless, while commenting TeX sections, don't +# comment @macro/@end macro so that makeinfo does propagate them. +# Unfortunately makeinfo --iftex --no-ifinfo doesn't work well enough +# (yet), makeinfo can't parse the TeX commands, so work around with sed. +# comment_iftex_sed=$utildir/comment.sed cat <<EOF >$comment_iftex_sed /^@tex/,/^@end tex/{ @@ -228,12 +295,6 @@ cat <<EOF >$comment_iftex_sed s/^@c texi2dvi// } } -/^@html/,/^@end html/{ - s/^/@c (texi2dvi)/ -} -/^@ifhtml/,/^@end ifhtml/{ - s/^/@c (texi2dvi)/ -} /^@ifnottex/,/^@end ifnottex/{ s/^/@c (texi2dvi)/ } @@ -252,32 +313,32 @@ cat <<EOF >$uncomment_iftex_sed s/^@c texi2dvi// EOF -# A shell script that computes the list of xref files. +# Compute the list of xref files. # Takes the filename (without extension) of which we look for xref # files as argument. The index files must be reported last. -get_xref_files=$utildir/get_xref.sh -cat <<\EOF >$get_xref_files -#! /bin/sh - -# Get list of xref files (indexes, tables and lists). -# Find all files having root filename with a two-letter extension, -# saves the ones that are really Texinfo-related files. .?o? catches -# LaTeX tables and lists. -for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do - # If file is empty, skip it. - test -s "$this_file" || continue - # If the file is not suitable to be an index or xref file, don't - # process it. The file can't be if its first character is not a - # backslash or single quote. - first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file` - if test "x$first_character" = "x\\" \ - || test "x$first_character" = "x'"; then - xref_files="$xref_files ./$this_file" - fi -done -echo "$xref_files" -EOF -chmod 500 $get_xref_files +get_xref_files () +{ + # Get list of xref files (indexes, tables and lists). + # Find all files having root filename with a two-letter extension, + # saves the ones that are really Texinfo-related files. .?o? catches + # many files: .toc, .log, LaTeX tables and lists, FiXme's .lox, maybe more. + for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do + # If file is empty, skip it. + test -s "$this_file" || continue + # If the file is not suitable to be an index or xref file, don't + # process it. It's suitable if the first character is a + # backslash or right quote or at, as long as the first line isn't + # \input texinfo. + first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file` + if (test "x$first_character" = "x\\" \ + && sed 1q $this_file | grep -v '^\\input *texinfo' >/dev/null) \ + || test "x$first_character" = "x'" \ + || test "x$first_character" = "x@"; then + xref_files="$xref_files ./$this_file" + fi + done + echo "$xref_files" +} # File descriptor usage: # 0 standard input @@ -295,7 +356,12 @@ else fi # Enable tracing -test "$debug" = t && set -x +if test "$debug" = t; then + exec 6>&1 + set -x +else + exec 6>/dev/null +fi # # TeXify files. @@ -305,7 +371,7 @@ for command_line_filename in ${1+"$@"}; do # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex), # prepend `./' in order to avoid that the tools take it as an option. - echo "$command_line_filename" | egrep '^(/|[A-z]:/)' >/dev/null \ + echo "$command_line_filename" | $EGREP '^(/|[A-z]:/)' >&6 \ || command_line_filename="./$command_line_filename" # See if the file exists. If it doesn't we're in trouble since, even @@ -339,29 +405,83 @@ for command_line_filename in ${1+"$@"}; do tmpdir_xtr=$tmpdir/xtr filename_xtr=$tmpdir_xtr/$filename_noext.$ext + # _rcd. The Texinfo file recoded in 7bit. + tmpdir_rcd=$tmpdir/rcd + filename_rcd=$tmpdir_rcd/$filename_noext.$ext + # _bak. Copies of the previous xref files (another round is run if # they differ from the new one). tmpdir_bak=$tmpdir/bak # Make all those directories and give up if we can't succeed. - mkdir $tmpdir_src $tmpdir_xtr $tmpdir_bak || exit 1 + mkdir $tmpdir_src $tmpdir_xtr $tmpdir_rcd $tmpdir_bak || exit 1 - # Source file might include additional sources. Put `.' and - # directory where source file(s) reside in TEXINPUTS before anything - # else. `.' goes first to ensure that any old .aux, .cps, + # Source file might include additional sources. + # We want `.:$orig_pwd' before anything else. (We'll add `.:' later + # after all other directories have been turned into absolute paths.) + # `.' goes first to ensure that any old .aux, .cps, # etc. files in ${directory} don't get used in preference to fresher # files in `.'. Include orig_pwd in case we are in clean mode, where # we've cd'd to a temp directory. - common=".$path_sep$orig_pwd$path_sep$filename_dir$path_sep$txincludes$path_sep" - TEXINPUTS="$common$TEXINPUTS_orig" - INDEXSTYLE="$common$INDEXSTYLE_orig" + common="$orig_pwd$path_sep$filename_dir$path_sep$txincludes" + for var in $tex_envvars; do + eval ${var}="\$common\$${var}_orig" + export $var + done + + # Convert relative paths to absolute paths, so we can run in another + # directory (e.g., in --clean mode, or during the macro-support detection.) + # + # Empty path components are meaningful to tex. We rewrite them + # as `EMPTY' so they don't get lost when we split on $path_sep. + # Hopefully no one will have an actual directory named EMPTY. + replace_empty="-e 's/^$path_sep/EMPTY$path_sep/g' \ + -e 's/$path_sep\$/${path_sep}EMPTY/g' \ + -e 's/$path_sep$path_sep/${path_sep}EMPTY:/g'" + TEXINPUTS=`echo $TEXINPUTS | eval sed $replace_empty` + INDEXSTYLE=`echo $INDEXSTYLE | eval sed $replace_empty` + save_IFS=$IFS + IFS=$path_sep + set x $TEXINPUTS; shift + TEXINPUTS=. + for dir + do + case $dir in + EMPTY) + TEXINPUTS=$TEXINPUTS$path_sep + ;; + [\\/]* | ?:[\\/]*) # Absolute paths don't need to be expanded. + TEXINPUTS=$TEXINPUTS$path_sep$dir + ;; + *) + abs=`cd "$dir" && pwd` && TEXINPUTS=$TEXINPUTS$path_sep$abs + ;; + esac + done + set x $INDEXSTYLE; shift + INDEXSTYLE=. + for dir + do + case $dir in + EMPTY) + INDEXSTYLE=$INDEXSTYLE$path_sep + ;; + [\\/]* | ?:[\\/]*) # Absolute paths don't need to be expansed. + INDEXSTYLE=$INDEXSTYLE$path_sep$dir + ;; + *) + abs=`cd "$dir" && pwd` && INDEXSTYLE=$INDEXSTYLE$path_sep$abs + ;; + esac + done + IFS=$save_IFS # If the user explicitly specified the language, use that. # Otherwise, if the first line is \input texinfo, assume it's texinfo. # Otherwise, guess from the file extension. if test -n "$set_language"; then language=$set_language - elif sed 1q "$command_line_filename" | fgrep 'input texinfo' >/dev/null; then + elif sed 1q "$command_line_filename" | grep 'input texinfo' >&6; then language=texinfo else language= @@ -373,24 +493,35 @@ for command_line_filename in ${1+"$@"}; do [lL]a[tT]e[xX] | *.ltx | *.tex) # Assume a LaTeX file. LaTeX needs bibtex and uses latex for # compilation. No makeinfo. + language=latex bibtex=${BIBTEX:-bibtex} makeinfo= # no point in running makeinfo on latex source. texindex=${MAKEINDEX:-makeindex} + textra_cmd=1i if test $oformat = dvi; then tex=${LATEX:-latex} else tex=${PDFLATEX:-pdflatex} fi + thumbpdf=${THUMBPDF:-thumbpdf} ;; *) # Assume a Texinfo file. Texinfo files need makeinfo, texindex and tex. + language=texinfo bibtex= texindex=${TEXINDEX:-texindex} + textra_cmd='/^@setfilename/a' if test $oformat = dvi; then - tex=${TEX:-tex} + # MetaPost also uses the TEX environment variable. If the user + # has set TEX=latex for that reason, don't bomb out. + if echo $TEX | grep 'latex$' >/dev/null; then + tex=tex # don't bother trying to find etex + else + tex=$TEX + fi else - tex=${PDFTEX:-pdftex} + tex=$PDFTEX fi # Unless required by the user, makeinfo expansion is wanted only # if texinfo.tex is too old. @@ -402,26 +533,47 @@ for command_line_filename in ${1+"$@"}; do # We don't need to use [0-9] to match the digits since anyway # the comparison with $txiprereq, a number, will fail with non # digits. - txiversion_tex=txiversion.tex - echo '\input texinfo.tex @bye' >$tmpdir/$txiversion_tex # Run in the tmpdir to avoid leaving files. - eval `cd $tmpdir >/dev/null && - $tex $txiversion_tex 2>/dev/null | - sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p'` + ( + cd $tmpdir + echo '\input texinfo.tex @bye' >txiversion.tex + # Be sure that if tex wants to fail, it is not interactive: + # close stdin. + $tex txiversion.tex </dev/null + ) >$tmpdir/txiversion.out 2>$tmpdir/txiversion.err + if test $? != 0; then + cat $tmpdir/txiversion.out + cat $tmpdir/txiversion.err >&2 + fatal "texinfo.tex appears to be broken, quitting." + fi + eval `sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p' $tmpdir/txiversion.out` $verbose "texinfo.tex preloaded as \`$txiformat', version is \`$txiversion' ..." if test "$txiprereq" -le "$txiversion" >/dev/null 2>&1; then makeinfo= else makeinfo=${MAKEINFO:-makeinfo} fi - # As long as we had to run TeX, offer the user this convenience - if test "$txiformat" = Texinfo; then - escape=@ - fi + # As long as we had to run TeX, offer the user this convenience: + test "$txiformat" = Texinfo && escape=@ fi + thumbpdf=${THUMBPDF:-thumbpdf} ;; esac + # Go to $tmpdir to try --help, since old versions that don't accept + # --help will generate a texput.log. + tex_help=`cd $tmpdir >/dev/null && $tex --help </dev/null 2>&1` + + # If possible, make TeX report error locations in GNU format. + tex_args= + case $tex_help in + *file-line-error*) tex_args="$tex_args --file-line-error";; + esac + + # Tell TeX to be batch if requested. (\batchmode does not show + # terminal output at all, so we don't want that.) + $batch && tex_args="$tex_args ${escape}nonstopmode ${escape}input" + # Expand macro commands in the original source file using Makeinfo. # Always use `end' footnote style, since the `separate' style # generates different output (arguably this is a bug in -E). @@ -445,11 +597,31 @@ for command_line_filename in ${1+"$@"}; do # Used most commonly for @finalout, @smallbook, etc. if test -n "$textra"; then $verbose "Inserting extra commands: $textra" - sed '/^@setfilename/a\ -'"$textra" "$filename_input" >$filename_xtr + sed "$textra_cmd\\ +$textra" "$filename_input" >"$filename_xtr" filename_input=$filename_xtr fi + # If this is a Texinfo file with a specified input encoding, and + # recode is available, then recode to plain 7 bit Texinfo. + if test $language = texinfo; then + pgm='s/\(^\|.* \)@documentencoding *\([^ ][^ ]*\)\( .*\|$\)/\2/ + t found + d + :found + q' + encoding=`sed -e "$pgm" "$filename_input"` + if $recode && test -n "$encoding" && findprog recode; then + $verbose "Recoding from $encoding to Texinfo." + if recode "$encoding"..texinfo <"$filename_input" >"$filename_rcd" \ + && test -s "$filename_rcd"; then + filename_input=$filename_rcd + else + $verbose "Recoding failed, using original input." + fi + fi + fi + # If clean mode was specified, then move to the temporary directory. if test "$clean" = t; then $verbose "cd $tmpdir_src" @@ -457,7 +629,7 @@ for command_line_filename in ${1+"$@"}; do fi while :; do # will break out of loop below - orig_xref_files=`$get_xref_files "$filename_noext"` + orig_xref_files=`get_xref_files "$filename_noext"` # Save copies of originals for later comparison. if test -n "$orig_xref_files"; then @@ -488,21 +660,23 @@ for command_line_filename in ${1+"$@"}; do && grep '^\\bibstyle[{]' "$filename_noext.aux" \ && (grep 'Warning:.*Citation.*undefined' "$filename_noext.log" \ || grep 'No file .*\.bbl\.' "$filename_noext.log")) \ - >/dev/null 2>&1; \ + >&6 2>&1; \ then $verbose "Running $bibtex $filename_noext ..." - if $bibtex "$filename_noext" >&5; then :; else - echo "$0: $bibtex exited with bad status, quitting." >&2 - exit 1 - fi + $bibtex "$filename_noext" >&5 || + fatal "$bibtex exited with bad status, quitting." fi # What we'll run texindex on -- exclude non-index files. # Since we know index files are last, it is correct to remove everything - # before .aux and .?o?. + # before .aux and .?o?. But don't really do <anything>o<anything> + # -- don't match whitespace as <anything>. + # Otherwise, if orig_xref_files contains something like + # foo.xo foo.whatever + # the space after the o will get matched. index_files=`echo "$orig_xref_files" \ | sed "s!.*\.aux!!g; - s!./$filename_noext\..o.!!g; + s!./$filename_noext\.[^ ]o[^ ]!!g; s/^[ ]*//;s/[ ]*$//"` # Run texindex (or makeindex) on current index files. If they # already exist, and after running TeX a first time the index @@ -511,19 +685,14 @@ for command_line_filename in ${1+"$@"}; do # nonexistent. if test -n "$texindex" && test -n "$index_files"; then $verbose "Running $texindex $index_files ..." - if $texindex $index_files 2>&5 1>&2; then :; else - echo "$0: $texindex exited with bad status, quitting." >&2 - exit 1 - fi + $texindex $index_files 2>&5 1>&2 || + fatal "$texindex exited with bad status, quitting." fi # Finally, run TeX. - # Prevent $ESCAPE from being interpreted by the shell if it happens - # to be `/'. - $batch tex_args="\\${escape}nonstopmode\ \\${escape}input" - cmd="$tex $tex_args $filename_input" - $verbose "Running $cmd ..." - if $cmd >&5; then :; else + cmd="$tex $tex_args" + $verbose "Running $cmd $filename_input ..." + if $cmd "$filename_input" >&5; then :; else echo "$0: $tex exited with bad status, quitting." >&2 echo "$0: see $filename_noext.log for errors." >&2 test "$clean" = t \ @@ -540,12 +709,12 @@ for command_line_filename in ${1+"$@"}; do # subdirs, since texi2dvi does not try to compare xref files in # subdirs. Performing xref files test is still good since LaTeX # does not report changes in xref files. - if fgrep "Rerun to get" "$filename_noext.log" >/dev/null 2>&1; then + if grep "Rerun to get" "$filename_noext.log" >&6 2>&1; then finished= fi # Check if xref files changed. - new_xref_files=`$get_xref_files "$filename_noext"` + new_xref_files=`get_xref_files "$filename_noext"` $verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`" $verbose "New xref files = `echo $new_xref_files | sed 's|\./||g'`" @@ -573,7 +742,28 @@ for command_line_filename in ${1+"$@"}; do # If finished, exit the loop, else rerun the loop. test -n "$finished" && break - done + done # while :; + + # If we were using thumbpdf and producing PDF, then run thumbpdf + # and TeX one last time. + if test $oformat = pdf \ + && test -r "$filename_noext.log" \ + && grep 'thumbpdf\.sty' "$filename_noext.log" >&6 2>&1; \ + then + $verbose "Running $thumbpdf $filename_noext ..." + $thumbpdf "$filename_noext" >&5 || + fatal "$thumbpdf exited with bad status, quitting." + + $verbose "Running $cmd $filename_input..." + if $cmd "$filename_input" >&5; then :; else + echo "$0: $tex exited with bad status, quitting." >&2 + echo "$0: see $filename_noext.log for errors." >&2 + test "$clean" = t \ + && cp "$filename_noext.log" "$orig_pwd" + exit 1 + fi + fi + # If we were in clean mode, compilation was in a tmp directory. # Copy the DVI (or PDF) file into the directory where the compilation @@ -601,5 +791,5 @@ for command_line_filename in ${1+"$@"}; do fi done -$verbose "$0 done." +$verbose "$0: done." exit 0 # exit successfully, not however we ended the loop. diff --git a/gnu/usr.bin/texinfo/util/texindex.c b/gnu/usr.bin/texinfo/util/texindex.c index d520fa3a1b4..b70915fe56c 100644 --- a/gnu/usr.bin/texinfo/util/texindex.c +++ b/gnu/usr.bin/texinfo/util/texindex.c @@ -1,8 +1,8 @@ -/* Process TeX index dribble output into an actual index. - $Id: texindex.c,v 1.4 2002/06/10 13:51:04 espie Exp $ +/* texindex -- sort TeX index dribble output into an actual index. + $Id: texindex.c,v 1.5 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1987, 91, 92, 96, 97, 98, 99, 2000, 01, 02 - Free Software Foundation, Inc. + Copyright (C) 1987, 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ static char *program_name = "texindex"; #define memset(ptr, ignore, count) bzero (ptr, count) #endif -char *mktemp (); +char *mktemp (char *); #if !defined (SEEK_SET) # define SEEK_SET 0 @@ -45,6 +45,8 @@ char *mktemp (); # define SEEK_END 2 #endif /* !SEEK_SET */ +struct linebuffer; + /* When sorting in core, this structure describes one line and the position and length of its first keyfield. */ struct lineinfo @@ -97,9 +99,6 @@ long nlines; /* Directory to use for temporary files. On Unix, it ends with a slash. */ char *tempdir; -/* Start of filename to use for temporary files. */ -char *tempbase; - /* Number of last temporary file. */ int tempcount; @@ -111,40 +110,47 @@ int last_deleted_tempcount; which contains all the lines of data. */ char *text_base; +/* Initially 0; changed to 1 if we want initials in this index. */ +int need_initials; + +/* Remembers the first initial letter seen in this index, so we can + determine whether we need initials in the sorted form. */ +char first_initial; + /* Additional command switches .*/ /* Nonzero means do not delete tempfiles -- for debugging. */ int keep_tempfiles; /* Forward declarations of functions in this file. */ -void decode_command (); -void sort_in_core (); -void sort_offline (); -char **parsefile (); -char *find_field (); -char *find_pos (); -long find_value (); -char *find_braced_pos (); -char *find_braced_end (); -void writelines (); -int compare_field (); -int compare_full (); -long readline (); -int merge_files (); -int merge_direct (); -void pfatal_with_name (); -void fatal (); -void error (); +void decode_command (int argc, char **argv); +void sort_in_core (char *infile, int total, char *outfile); +void sort_offline (char *infile, off_t total, char *outfile); +char **parsefile (char *filename, char **nextline, char *data, long int size); +char *find_field (struct keyfield *keyfield, char *str, long int *lengthptr); +char *find_pos (char *str, int words, int chars, int ignore_blanks); +long find_value (char *start, long int length); +char *find_braced_pos (char *str, int words, int chars, int ignore_blanks); +char *find_braced_end (char *str); +void writelines (char **linearray, int nlines, FILE *ostream); +int compare_field (struct keyfield *keyfield, char *start1, + long int length1, long int pos1, char *start2, + long int length2, long int pos2); +int compare_full (const void *, const void *); +long readline (struct linebuffer *linebuffer, FILE *stream); +int merge_files (char **infiles, int nfiles, char *outfile); +int merge_direct (char **infiles, int nfiles, char *outfile); +void pfatal_with_name (const char *name); +void fatal (const char *format, const char *arg); +void error (const char *format, const char *arg); void *xmalloc (), *xrealloc (); -char *concat (); -void flush_tempfiles (); +char *concat (char *s1, char *s2); +void flush_tempfiles (int to_count); #define MAX_IN_CORE_SORT 500000 int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int i; @@ -160,6 +166,9 @@ main (argc, argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + /* In case we write to a redirected stdout that fails. */ + /* not ready atexit (close_stdout); */ + /* Describe the kind of sorting to do. */ /* The first keyfield uses the first braced field and folds case. */ keyfields[0].braced = 1; @@ -181,11 +190,6 @@ main (argc, argv) decode_command (argc, argv); - /* XXX mkstemp not appropriate, as we need to have somewhat predictable - * names. But race condition was fixed, see maketempname. - */ - tempbase = mktemp (concat ("txiXXXXXX", "", "")); - /* Process input files completely, one by one. */ for (i = 0; i < num_infiles; i++) @@ -216,20 +220,20 @@ main (argc, argv) outfile = outfiles[i]; if (!outfile) - { - outfile = concat (infiles[i], "s", ""); - } + outfile = concat (infiles[i], "s"); + + need_initials = 0; + first_initial = '\0'; if (ptr < MAX_IN_CORE_SORT) /* Sort a small amount of data. */ - sort_in_core (infiles[i], ptr, outfile); + sort_in_core (infiles[i], (int)ptr, outfile); else sort_offline (infiles[i], ptr, outfile); } flush_tempfiles (tempcount); xexit (0); - return 0; /* Avoid bogus warnings. */ } @@ -258,8 +262,7 @@ TEXINDEX_OPTION texindex_options[] = { }; void -usage (result_value) - int result_value; +usage (int result_value) { register int i; FILE *f = result_value ? stderr : stdout; @@ -299,9 +302,7 @@ Texinfo home page: http://www.gnu.org/software/texinfo/"), f); and set up the vector of keyfields and the vector of input files. */ void -decode_command (argc, argv) - int argc; - char **argv; +decode_command (int argc, char **argv) { int arg_index = 1; char **ip; @@ -317,7 +318,7 @@ decode_command (argc, argv) if (tempdir == NULL) tempdir = DEFAULT_TMPDIR; else - tempdir = concat (tempdir, "/", ""); + tempdir = concat (tempdir, "/"); keep_tempfiles = 0; @@ -338,11 +339,10 @@ decode_command (argc, argv) { printf ("texindex (GNU %s) %s\n", PACKAGE, VERSION); puts (""); - printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\ -There is NO warranty. You may redistribute this software\n\ + puts ("Copyright (C) 2004 Free Software Foundation, Inc."); + printf (_("There is NO warranty. You may redistribute this software\n\ under the terms of the GNU General Public License.\n\ -For more information about these matters, see the files named COPYING.\n"), - "2002"); +For more information about these matters, see the files named COPYING.\n")); xexit (0); } else if ((strcmp (arg, "--keep") == 0) || @@ -384,18 +384,28 @@ For more information about these matters, see the files named COPYING.\n"), usage (1); } -/* Return a name for a temporary file. */ +/* Return a name for temporary file COUNT. */ static char * -maketempname (count) - int count; +maketempname (int count) { + static char *tempbase = NULL; char tempsuffix[10]; char *name; int fd; + if (!tempbase) + { + int fd; + tempbase = concat (tempdir, "txidxXXXXXX"); + + fd = mkstemp (tempbase); + if (fd == -1) + pfatal_with_name (tempbase); + } + sprintf (tempsuffix, ".%d", count); - name = concat (tempdir, tempbase, tempsuffix); + name = concat (tempbase, tempsuffix); fd = open (name, O_CREAT|O_EXCL|O_WRONLY, 0666); if (fd == -1) @@ -407,11 +417,11 @@ maketempname (count) } } + /* Delete all temporary files up to TO_COUNT. */ void -flush_tempfiles (to_count) - int to_count; +flush_tempfiles (int to_count) { if (keep_tempfiles) return; @@ -423,9 +433,10 @@ flush_tempfiles (to_count) /* Compare LINE1 and LINE2 according to the specified set of keyfields. */ int -compare_full (line1, line2) - char **line1, **line2; +compare_full (const void *p1, const void *p2) { + char **line1 = (char **) p1; + char **line2 = (char **) p2; int i; /* Compare using the first keyfield; @@ -437,7 +448,8 @@ compare_full (line1, line2) long length1, length2; char *start1 = find_field (&keyfields[i], *line1, &length1); char *start2 = find_field (&keyfields[i], *line2, &length2); - int tem = compare_field (&keyfields[i], start1, length1, *line1 - text_base, + int tem = compare_field (&keyfields[i], start1, length1, + *line1 - text_base, start2, length2, *line2 - text_base); if (tem) { @@ -454,11 +466,11 @@ compare_full (line1, line2) in which the first keyfield is identified in advance. For positional sorting, assumes that the order of the lines in core reflects their nominal order. */ - int -compare_prepared (line1, line2) - struct lineinfo *line1, *line2; +compare_prepared (const void *p1, const void *p2) { + struct lineinfo *line1 = (struct lineinfo *) p1; + struct lineinfo *line2 = (struct lineinfo *) p2; int i; int tem; char *text1, *text2; @@ -495,7 +507,8 @@ compare_prepared (line1, line2) long length1, length2; char *start1 = find_field (&keyfields[i], text1, &length1); char *start2 = find_field (&keyfields[i], text2, &length2); - int tem = compare_field (&keyfields[i], start1, length1, text1 - text_base, + int tem = compare_field (&keyfields[i], start1, length1, + text1 - text_base, start2, length2, text2 - text_base); if (tem) { @@ -514,10 +527,7 @@ compare_prepared (line1, line2) the two lines in the input. */ int -compare_general (str1, str2, pos1, pos2, use_keyfields) - char *str1, *str2; - long pos1, pos2; - int use_keyfields; +compare_general (char *str1, char *str2, long int pos1, long int pos2, int use_keyfields) { int i; @@ -548,10 +558,7 @@ compare_general (str1, str2, pos1, pos2, use_keyfields) is stored into the int that LENGTHPTR points to. */ char * -find_field (keyfield, str, lengthptr) - struct keyfield *keyfield; - char *str; - long *lengthptr; +find_field (struct keyfield *keyfield, char *str, long int *lengthptr) { char *start; char *end; @@ -591,10 +598,7 @@ find_field (keyfield, str, lengthptr) after finding the specified word. */ char * -find_pos (str, words, chars, ignore_blanks) - char *str; - int words, chars; - int ignore_blanks; +find_pos (char *str, int words, int chars, int ignore_blanks) { int i; char *p = str; @@ -627,10 +631,7 @@ find_pos (str, words, chars, ignore_blanks) and that braces within fields are balanced. */ char * -find_braced_pos (str, words, chars, ignore_blanks) - char *str; - int words, chars; - int ignore_blanks; +find_braced_pos (char *str, int words, int chars, int ignore_blanks) { int i; int bracelevel; @@ -679,8 +680,7 @@ find_braced_pos (str, words, chars, ignore_blanks) The position returned is just before the closing brace. */ char * -find_braced_end (str) - char *str; +find_braced_end (char *str) { int bracelevel; char *p = str; @@ -701,9 +701,7 @@ find_braced_end (str) } long -find_value (start, length) - char *start; - long length; +find_value (char *start, long int length) { while (length != 0L) { @@ -721,7 +719,7 @@ find_value (start, length) int char_order[256]; void -init_char_order () +init_char_order (void) { int i; for (i = 1; i < 256; i++) @@ -742,14 +740,8 @@ init_char_order () The sign of the value reports the relation between the fields. */ int -compare_field (keyfield, start1, length1, pos1, start2, length2, pos2) - struct keyfield *keyfield; - char *start1; - long length1; - long pos1; - char *start2; - long length2; - long pos2; +compare_field (struct keyfield *keyfield, char *start1, long int length1, + long int pos1, char *start2, long int length2, long int pos2) { if (keyfields->positional) { @@ -833,8 +825,7 @@ struct linebuffer /* Initialize LINEBUFFER for use. */ void -initbuffer (linebuffer) - struct linebuffer *linebuffer; +initbuffer (struct linebuffer *linebuffer) { linebuffer->size = 200; linebuffer->buffer = (char *) xmalloc (200); @@ -844,9 +835,7 @@ initbuffer (linebuffer) Return the length of the line. */ long -readline (linebuffer, stream) - struct linebuffer *linebuffer; - FILE *stream; +readline (struct linebuffer *linebuffer, FILE *stream) { char *buffer = linebuffer->buffer; char *p = linebuffer->buffer; @@ -876,11 +865,7 @@ readline (linebuffer, stream) /* Sort an input file too big to sort in core. */ void -sort_offline (infile, nfiles, total, outfile) - char *infile; - int nfiles; - off_t total; - char *outfile; +sort_offline (char *infile, off_t total, char *outfile) { /* More than enough. */ int ntemps = 2 * (total + MAX_IN_CORE_SORT - 1) / MAX_IN_CORE_SORT; @@ -960,7 +945,7 @@ fail: for (i = 0; i < ntemps; i++) { char *newtemp = maketempname (++tempcount); - sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp); + sort_in_core (tempfiles[i], MAX_IN_CORE_SORT, newtemp); if (!keep_tempfiles) unlink (tempfiles[i]); tempfiles[i] = newtemp; @@ -979,10 +964,7 @@ fail: then indexify it and send the output to OUTFILE (or to stdout). */ void -sort_in_core (infile, total, outfile) - char *infile; - off_t total; - char *outfile; +sort_in_core (char *infile, int total, char *outfile) { char **nextline; char *data = (char *) xmalloc (total + 1); @@ -1050,7 +1032,7 @@ sort_in_core (infile, total, outfile) Make a `struct lineinfo' for each line, which records the keyfield as well as the line, and sort them. */ - lineinfo = (struct lineinfo *) malloc ((nextline - linearray) * sizeof (struct lineinfo)); + lineinfo = malloc ((nextline - linearray) * sizeof (struct lineinfo)); if (lineinfo) { @@ -1100,11 +1082,7 @@ sort_in_core (infile, total, outfile) Value 0 means input file contents are invalid. */ char ** -parsefile (filename, nextline, data, size) - char *filename; - char **nextline; - char *data; - long size; +parsefile (char *filename, char **nextline, char *data, long int size) { char *p, *end; char **line = nextline; @@ -1119,6 +1097,23 @@ parsefile (filename, nextline, data, size) return 0; *line = p; + + /* Find the first letter of the first field of this line. If it + is different from the first letter of the first field of the + first line, we need initial headers in the output index. */ + while (*p && *p != '{') + p++; + if (p == end) + return 0; + p++; + if (first_initial) + { + if (first_initial != toupper (*p)) + need_initials = 1; + } + else + first_initial = toupper (*p); + while (*p && *p != '\n') p++; if (p != end) @@ -1128,7 +1123,7 @@ parsefile (filename, nextline, data, size) if (line == linearray + nlines) { char **old = linearray; - linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4)); + linearray = xrealloc (linearray, sizeof (char *) * (nlines *= 4)); line += linearray - old; } } @@ -1184,7 +1179,7 @@ char lastinitial1[2]; /* Initialize static storage for writing an index. */ void -init_index () +init_index (void) { pending = 0; lastinitial = lastinitial1; @@ -1203,9 +1198,7 @@ init_index () insert headers for each initial character, etc. */ void -indexify (line, ostream) - char *line; - FILE *ostream; +indexify (char *line, FILE *ostream) { char *primary, *secondary, *pagenumber; int primarylength, secondarylength = 0, pagelength; @@ -1228,12 +1221,9 @@ indexify (line, ostream) else { initial = initial1; - initial1[0] = *p; + initial1[0] = toupper (*p); initial1[1] = 0; initiallength = 1; - - if (initial1[0] >= 'a' && initial1[0] <= 'z') - initial1[0] -= 040; } pagenumber = find_braced_pos (line, 1, 0, 0); @@ -1261,8 +1251,9 @@ indexify (line, ostream) /* If this primary has a different initial, include an entry for the initial. */ - if (initiallength != lastinitiallength || - strncmp (initial, lastinitial, initiallength)) + if (need_initials && + (initiallength != lastinitiallength || + strncmp (initial, lastinitial, initiallength))) { fprintf (ostream, "\\initial {"); fwrite (initial, 1, initiallength, ostream); @@ -1307,7 +1298,8 @@ indexify (line, ostream) lastsecondary[0] = 0; } - /* Should not have an entry with no subtopic following one with a subtopic. */ + /* Should not have an entry with no subtopic following one with a + subtopic. */ if (nosecondary && *lastsecondary) error (_("entry %s follows an entry with a secondary name"), line); @@ -1340,15 +1332,14 @@ indexify (line, ostream) /* Here to add one more page number to the current entry. */ if (pending++ != 1) - fputs (", ", ostream); /* Punctuate first, if this is not the first. */ + fputs (", ", ostream); /* Punctuate first, if this is not the first. */ fwrite (pagenumber, pagelength, 1, ostream); } /* Close out any unfinished output entry. */ void -finish_index (ostream) - FILE *ostream; +finish_index (FILE *ostream) { if (pending) fputs ("}\n", ostream); @@ -1360,10 +1351,7 @@ finish_index (ostream) Each line is copied out of the input file it was found in. */ void -writelines (linearray, nlines, ostream) - char **linearray; - int nlines; - FILE *ostream; +writelines (char **linearray, int nlines, FILE *ostream) { char **stop_line = linearray + nlines; char **next_line; @@ -1374,11 +1362,13 @@ writelines (linearray, nlines, ostream) for (next_line = linearray; next_line != stop_line; next_line++) { - /* If -u was specified, output the line only if distinct from previous one. */ + /* If -u was specified, output the line only if distinct from + previous one. */ if (next_line == linearray /* Compare previous line with this one, using only the explicitly specd keyfields. */ - || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1)) + || compare_general (*(next_line - 1), *next_line, 0L, 0L, + num_keyfields - 1)) { char *p = *next_line; char c; @@ -1403,10 +1393,7 @@ writelines (linearray, nlines, ostream) #define MAX_DIRECT_MERGE 10 int -merge_files (infiles, nfiles, outfile) - char **infiles; - int nfiles; - char *outfile; +merge_files (char **infiles, int nfiles, char *outfile) { char **tempfiles; int ntemps; @@ -1456,10 +1443,7 @@ merge_files (infiles, nfiles, outfile) use it only with a bounded number of input files. */ int -merge_direct (infiles, nfiles, outfile) - char **infiles; - int nfiles; - char *outfile; +merge_direct (char **infiles, int nfiles, char *outfile) { struct linebuffer *lb1, *lb2; struct linebuffer **thisline, **prevline; @@ -1487,20 +1471,20 @@ merge_direct (infiles, nfiles, outfile) return 0; } - /* For each file, make two line buffers. - Also, for each file, there is an element of `thisline' - which points at any time to one of the file's two buffers, - and an element of `prevline' which points to the other buffer. - `thisline' is supposed to point to the next available line from the file, - while `prevline' holds the last file line used, - which is remembered so that we can verify that the file is properly sorted. */ + /* For each file, make two line buffers. Also, for each file, there + is an element of `thisline' which points at any time to one of the + file's two buffers, and an element of `prevline' which points to + the other buffer. `thisline' is supposed to point to the next + available line from the file, while `prevline' holds the last file + line used, which is remembered so that we can verify that the file + is properly sorted. */ /* lb1 and lb2 contain one buffer each per file. */ lb1 = (struct linebuffer *) xmalloc (nfiles * sizeof (struct linebuffer)); lb2 = (struct linebuffer *) xmalloc (nfiles * sizeof (struct linebuffer)); - /* thisline[i] points to the linebuffer holding the next available line in file i, - or is zero if there are no lines left in that file. */ + /* thisline[i] points to the linebuffer holding the next available + line in file i, or is zero if there are no lines left in that file. */ thisline = (struct linebuffer **) xmalloc (nfiles * sizeof (struct linebuffer *)); /* prevline[i] points to the linebuffer holding the last used line @@ -1613,8 +1597,7 @@ merge_direct (infiles, nfiles, outfile) /* Print error message and exit. */ void -fatal (format, arg) - char *format, *arg; +fatal (const char *format, const char *arg) { error (format, arg); xexit (1); @@ -1622,8 +1605,7 @@ fatal (format, arg) /* Print error message. FORMAT is printf control string, ARG is arg for it. */ void -error (format, arg) - char *format, *arg; +error (const char *format, const char *arg) { printf ("%s: ", program_name); printf (format, arg); @@ -1632,58 +1614,31 @@ error (format, arg) } void -perror_with_name (name) - char *name; +perror_with_name (const char *name) { - char *s; - - s = strerror (errno); - printf ("%s: ", program_name); - printf ("%s; for file `%s'.\n", s, name); + fprintf (stderr, "%s: ", program_name); + perror (name); } void -pfatal_with_name (name) - char *name; +pfatal_with_name (const char *name) { - char *s; - - s = strerror (errno); - printf ("%s: ", program_name); - printf (_("%s; for file `%s'.\n"), s, name); + perror_with_name (name); xexit (1); } -/* Return a newly-allocated string whose contents concatenate those of - S1, S2, S3. */ + +/* Return a newly-allocated string concatenating S1 and S2. */ char * -concat (s1, s2, s3) - char *s1, *s2, *s3; +concat (char *s1, char *s2) { - int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); - char *result = (char *) xmalloc (len1 + len2 + len3 + 1); + int len1 = strlen (s1), len2 = strlen (s2); + char *result = (char *) xmalloc (len1 + len2 + 1); strcpy (result, s1); strcpy (result + len1, s2); - strcpy (result + len1 + len2, s3); - *(result + len1 + len2 + len3) = 0; + *(result + len1 + len2) = 0; return result; } - -#if !defined (HAVE_STRCHR) -char * -strrchr (string, character) - char *string; - int character; -{ - register int i; - - for (i = strlen (string) - 1; i > -1; i--) - if (string[i] == character) - return (string + i); - - return ((char *)NULL); -} -#endif /* HAVE_STRCHR */ |