Update of /cvsroot/mingw/msys/packages/texinfo/4.3/makeinfo In directory sc8-pr-cvs1:/tmp/cvs-serv4095/makeinfo Added Files: Makefile.am Makefile.in README cmds.c cmds.h defun.c defun.h files.c files.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 texinfo.dtd texinfo.xsl toc.c toc.h xml.c xml.h Log Message: Pristine 4.3 --- NEW FILE: Makefile.am --- # $Id: Makefile.am,v 1.1 2002/12/05 21:07:17 earnie Exp $ # Makefile.am for texinfo/makeinfo. # Run automake in .. to produce Makefile.in from this. # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # 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. bin_PROGRAMS = makeinfo localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" LDADD = ../lib/libtxi.a @LIBINTL@ makeinfo_SOURCES = \ cmds.c cmds.h defun.c defun.h \ files.c files.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) SUBDIRS = tests --- NEW FILE: Makefile.in --- # Makefile.in generated by automake 1.7.1 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. # 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. @SET_MAKE@ # $Id: Makefile.in,v 1.1 2002/12/05 21:07:17 earnie Exp $ # Makefile.am for texinfo/makeinfo. # Run automake in .. to produce Makefile.in from this. # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # 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. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c 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_triplet = @host@ 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@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ 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@ TEXINFO_MAINT_FALSE = @TEXINFO_MAINT_FALSE@ TEXINFO_MAINT_TRUE = @TEXINFO_MAINT_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__quote = @am__quote@ 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@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ bin_PROGRAMS = makeinfo localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" LDADD = ../lib/libtxi.a @LIBINTL@ makeinfo_SOURCES = \ cmds.c cmds.h defun.c defun.h \ files.c files.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) 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) 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 = DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmds.Po ./$(DEPDIR)/defun.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/files.Po ./$(DEPDIR)/footnote.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/html.Po ./$(DEPDIR)/index.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/insertion.Po ./$(DEPDIR)/lang.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/macro.Po ./$(DEPDIR)/makeinfo.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/multi.Po ./$(DEPDIR)/node.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sectioning.Po ./$(DEPDIR)/toc.Po \ @AMDEP_TRUE@ ./$(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 $@ DIST_SOURCES = $(makeinfo_SOURCES) DATA = $(pkgdata_DATA) RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-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) 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) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ 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,^.*/,,;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) makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES) @rm -f makeinfo$(EXEEXT) $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core 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)/files.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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/insertion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lang.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makeinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@ @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) .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ @am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ @am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` 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. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (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; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 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; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ 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 "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique 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: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @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"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ 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 \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." 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 dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-pkgdataDATA install-exec-am: install-binPROGRAMS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ uninstall-pkgdataDATA uninstall-info: uninstall-info-recursive .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-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 install-info-am \ install-info-recursive install-man install-pkgdataDATA \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-recursive pdf pdf-am \ pdf-recursive ps ps-am ps-recursive tags tags-recursive \ uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \ uninstall-info-recursive uninstall-pkgdataDATA \ uninstall-recursive # 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: --- NEW FILE: README --- $Id: README,v 1.1 2002/12/05 21:07:17 earnie Exp $ texinfo/makeinfo/README Copyright (C) 2002 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. makeinfo is a standalone program to convert Texinfo source into Info files readable with standalone info or M-x info in Emacs. makeinfo can also output other formats: plain ASCII (with --no-headers) or HTML (with --html) or XML (with --xml). The Emacs function M-x texinfo-format-buffer does more or less the same job, but makeinfo is faster and gives better error messages. --- NEW FILE: cmds.c --- /* cmds.c -- Texinfo commands. $Id: cmds.c,v 1.1 2002/12/05 21:07:17 earnie Exp $ Copyright (C) 1998, 1999, 2000, 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 the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ [...1374 lines suppressed...] 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) return -1; return 0; } static void cm_exampleindent () { char *arg; get_rest_of_line (1, &arg); if (set_default_indentation_increment (arg) != 0) line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command); free (arg); } --- NEW FILE: cmds.h --- /* cmds.h -- declarations for cmds.c. $Id: cmds.h,v 1.1 2002/12/05 21:07:17 earnie Exp $ Copyright (C) 1998, 1999, 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 the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef CMDS_H #define CMDS_H /* The three arguments a command can get are a flag saying whether it is before argument parsing (START) or after (END), the starting position of the arguments, and the ending position. */ typedef void COMMAND_FUNCTION (); /* So we can say COMMAND_FUNCTION *foo; */ /* Each command has an associated function. When the command is encountered in the text, the associated function is called with START as the argument. If the function expects arguments in braces, it remembers itself on the stack. When the corresponding close brace is encountered, the function is called with END as the argument. */ #define START 0 #define END 1 /* Does the command expect braces? */ #define NO_BRACE_ARGS 0 #define BRACE_ARGS 1 #define MAYBE_BRACE_ARGS 2 typedef struct { char *name; COMMAND_FUNCTION *proc; int argument_in_braces; } COMMAND; extern COMMAND command_table[]; /* Nonzero if we have seen an @titlepage command. */ extern int titlepage_cmd_present; #endif /* !CMDS_H */ --- NEW FILE: defun.c --- /* defun.c -- @defun and friends. $Id: defun.c,v 1.1 2002/12/05 21:07:17 earnie Exp $ Copyright (C) 1998, 1999, 2000, 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 the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "system.h" #include "defun.h" #include "xml.h" #include "insertion.h" #include "makeinfo.h" #include "cmds.h" #include "html.h" #define DEFUN_SELF_DELIMITING(c) \ ((c) == '(' || (c) == ')' || (c) == '[' || (c) == ']') struct token_accumulator { unsigned int length; unsigned int index; char **tokens; }; static void initialize_token_accumulator (accumulator) struct token_accumulator *accumulator; { accumulator->length = 0; accumulator->index = 0; accumulator->tokens = NULL; } static void accumulate_token (accumulator, token) struct token_accumulator *accumulator; char *token; { if (accumulator->index >= accumulator->length) { accumulator->length += 10; accumulator->tokens = xrealloc (accumulator->tokens, (accumulator->length * sizeof (char *))); } accumulator->tokens[accumulator->index] = token; accumulator->index += 1; } /* Given STRING_POINTER pointing at an open brace, skip forward and return a pointer to just past the matching close brace. */ static int scan_group_in_string (string_pointer) char **string_pointer; { char *scan_string = (*string_pointer) + 1; unsigned int level = 1; int started_command = 0; for (;;) { int c; if (level == 0) { *string_pointer = scan_string; return 1; } c = *scan_string++; if (c == 0) { /* Tweak line_number to compensate for fact that we gobbled the whole line before coming here. */ line_number--; line_error (_("Missing `}' in @def arg")); line_number++; *string_pointer = scan_string - 1; return 0; } if (c == '{' && !started_command) level++; if (c == '}' && !started_command) level--; /* remember if at @. */ started_command = (c == '@' && !started_command); } } /* Return a list of tokens from the contents of STRING. Commands and brace-delimited groups count as single tokens. Contiguous whitespace characters are converted to a token consisting of a single space. */ static char ** args_from_string (string) char *string; { struct token_accumulator accumulator; char *token_start, *token_end; char *scan_string = string; initialize_token_accumulator (&accumulator); while (*scan_string) { /* Replace arbitrary whitespace by a single space. */ if (whitespace (*scan_string)) { scan_string += 1; while (whitespace (*scan_string)) scan_string += 1; accumulate_token ((&accumulator), (xstrdup (" "))); continue; } /* Commands count as single tokens. */ if (*scan_string == COMMAND_PREFIX) { token_start = scan_string; scan_string += 1; if (self_delimiting (*scan_string)) scan_string += 1; else { int c; while (1) { c = *scan_string++; if ((c == 0) || (c == '{') || (whitespace (c))) { scan_string -= 1; break; } } if (*scan_string == '{') { char *s = scan_string; (void) scan_group_in_string (&s); scan_string = s; } } token_end = scan_string; } /* Parentheses and brackets are self-delimiting. */ else if (DEFUN_SELF_DELIMITING (*scan_string)) { token_start = scan_string; scan_string += 1; token_end = scan_string; } /* Open brace introduces a group that is a single token. */ else if (*scan_string == '{') { char *s = scan_string; int balanced = scan_group_in_string (&s); token_start = scan_string + 1; scan_string = s; token_end = balanced ? (scan_string - 1) : scan_string; } /* Otherwise a token is delimited by whitespace, parentheses, brackets, or braces. A token is also ended by a command. */ else { token_start = scan_string; for (;;) { int c; c = *scan_string++; /* Do not back up if we're looking at a }; since the only valid }'s are those matched with {'s, we want to give an error. If we back up, we go into an infinite loop. */ if (!c || whitespace (c) || DEFUN_SELF_DELIMITING (c) || c == '{') { scan_string--; break; } /* If we encounter a command embedded within a token, then end the token. */ if (c == COMMAND_PREFIX) { scan_string--; break; } } token_end = scan_string; } accumulate_token (&accumulator, substring (token_start, token_end)); } accumulate_token (&accumulator, NULL); return accumulator.tokens; } static void process_defun_args (defun_args, auto_var_p) char **defun_args; int auto_var_p; { int pending_space = 0; for (;;) { char *defun_arg = *defun_args++; if (defun_arg == NULL) break; if (defun_arg[0] == ' ') { pending_space = 1; continue; } if (pending_space) { add_char (' '); pending_space = 0; } if (DEFUN_SELF_DELIMITING (defun_arg[0])) { /* Within @deffn and friends, texinfo.tex makes parentheses sans serif and brackets bold. We use roman instead. */ insert_html_tag (START, ""); add_char (defun_arg[0]); insert_html_tag (END, ""); } else if (defun_arg[0] == '&') if (html) { defun_arg = escape_string (xstrdup (defun_arg)); add_word (defun_arg); free (defun_arg); } else add_word (defun_arg); else if (defun_arg[0] == COMMAND_PREFIX) execute_string ("%s", defun_arg); else if (auto_var_p) if (html) { defun_arg = escape_string (xstrdup (defun_arg)); add_word (defun_arg); free (defun_arg); } else add_word (defun_arg); else add_word (defun_arg); } } static char * next_nonwhite_defun_arg (arg_pointer) char ***arg_pointer; { char **scan = (*arg_pointer); char *arg = (*scan++); if ((arg != 0) && (*arg == ' ')) arg = *scan++; if (arg == 0) scan -= 1; *arg_pointer = scan; return (arg == 0) ? "" : arg; } /* This is needed also in insertion.c. */ enum insertion_type get_base_type (type) enum insertion_type type; { enum insertion_type base_type; switch (type) { case defivar: base_type = defcv; break; case defmac: base_type = deffn; break; case defmethod: base_type = defop; break; case defopt: base_type = defvr; break; case defspec: base_type = deffn; break; case deftypefun: base_type = deftypefn; break; case deftypeivar: base_type = deftypeivar; break; case deftypemethod: base_type = deftypemethod; break; case deftypeop: base_type = deftypeop; break; case deftypevar: base_type = deftypevr; break; case defun: base_type = deffn; break; case defvar: base_type = defvr; break; default: base_type = type; break; } return base_type; } /* Make the defun type insertion. TYPE says which insertion this is. X_P, if nonzero, says not to start a new insertion. */ static void defun_internal (type, x_p) enum insertion_type type; int x_p; { enum insertion_type base_type; char **defun_args, **scan_args; char *category, *defined_name, *type_name, *type_name2; { char *line; /* The @def.. line is the only place in Texinfo where you are allowed to use unquoted braces that don't delimit arguments of a command or a macro; in any other place it will trigger an error message from the reader loop. The special handling of this case inside `args_from_string' is an extra special hack which allows this. The side effect is that if we try to expand the rest of the line below, the recursive reader loop will signal an error if there are brace-delimited arguments on that line. The best solution to this would be to change the syntax of @def.. commands so that it doesn't violate Texinfo's own rules. But it's probably too late for this now, as it will break a lot of existing manuals. Unfortunately, this means that you can't call macros, use @value, etc. inside @def.. commands, sigh. */ get_rest_of_line (0, &line); defun_args = (args_from_string (line)); free (line); } scan_args = defun_args; /* Get base type and category string. */ base_type = get_base_type (type); /* xx all these const strings should be determined upon documentlanguage argument and NOT via gettext (kama). */ switch (type) { case defun: case deftypefun: category = _("Function"); break; case defmac: category = _("Macro"); break; case defspec: category = _("Special Form"); break; case defvar: case deftypevar: category = _("Variable"); break; case defopt: category = _("User Option"); break; case defivar: case deftypeivar: category = _("Instance Variable"); break; case defmethod: case deftypemethod: category = _("Method"); break; default: category = next_nonwhite_defun_arg (&scan_args); break; } /* The class name. */ if ((base_type == deftypefn) || (base_type == deftypevr) || (base_type == defcv) || (base_type == defop) || (base_type == deftypeivar) || (base_type == deftypemethod) || (base_type == deftypeop) ) type_name = next_nonwhite_defun_arg (&scan_args); /* The type name for typed languages. */ if ((base_type == deftypemethod) || (base_type == deftypeivar) || (base_type == deftypeop) ) type_name2 = next_nonwhite_defun_arg (&scan_args); /* The function or whatever that's actually being defined. */ defined_name = next_nonwhite_defun_arg (&scan_args); /* This hack exists solely for the purposes of formatting the Texinfo manual. I couldn't think of a better way. The token might be a simple @@ followed immediately by more text. If this is the case, then the next defun arg is part of this one, and we should concatenate them. */ if (*scan_args && **scan_args && !whitespace (**scan_args) && STREQ (defined_name, "@@")) { char *tem = xmalloc (3 + strlen (scan_args[0])); sprintf (tem, "@@%s", scan_args[0]); free (scan_args[0]); scan_args[0] = tem; scan_args++; defined_name = tem; } /* It's easy to write @defun foo(arg1 arg2), but a following ( is misparsed by texinfo.tex and this is next to impossible to fix. Warn about it. */ if (*scan_args && **scan_args && **scan_args == '(') warning ("`%c' follows defined name `%s' instead of whitespace", **scan_args, defined_name); if (!x_p) begin_insertion (type); /* Write the definition header line. This should start at the normal indentation. */ current_indent -= default_indentation_increment; start_paragraph (); if (!x_p) { /* Start the definition on new paragraph. */ if (html) add_word ("<p>\n"); } if (!html && !docbook) switch (base_type) { case deffn: case defvr: case deftp: execute_string (" -- %s: %s", category, defined_name); break; case deftypefn: case deftypevr: execute_string (" -- %s: %s %s", category, type_name, defined_name); break; case defcv: execute_string (" -- %s %s %s: %s", category, _("of"), type_name, defined_name); break; case deftypeivar: execute_string (" -- %s %s %s: %s %s", category, _("of"), type_name, type_name2, defined_name); break; case defop: execute_string (" -- %s %s %s: %s", category, _("on"), type_name, defined_name); break; case deftypeop: execute_string (" -- %s %s %s: %s %s", category, _("on"), type_name, type_name2, defined_name); break; case deftypemethod: execute_string (" -- %s %s %s: %s %s", category, _("on"), type_name, type_name2, defined_name); break; } if (html) { /* If this is not a @def...x version, it could only be a normal version @def.... So start the table here. */ if (!x_p) { add_html_elt ("<table width="); add_word ("\"100%\">\n"); } /* If this is an @def...x there has to be an other @def... before it, so this is only a new row within an existing table. With two complete standalone tables the gap between them is too big. */ add_word ("<tr>\n"); add_html_elt ("<td align=\"left\">"); switch (base_type) { case deffn: case defvr: case deftp: /* <i> is for the following function arguments. */ insert_html_tag (START, "b"); execute_string ("%s", defined_name); insert_html_tag (END, "b"); insert_html_tag (START, "i"); break; case deftypefn: case deftypevr: execute_string ("%s ", type_name); insert_html_tag (START, "b"); execute_string ("%s", defined_name); insert_html_tag (END, "b"); insert_html_tag (START, "i"); break; case defcv: case defop: insert_html_tag (START, "b"); execute_string ("%s", defined_name); insert_html_tag (END, "b"); insert_html_tag (START, "i"); break; case deftypemethod: case deftypeop: case deftypeivar: execute_string ("%s ", type_name2); insert_html_tag (START, "b"); execute_string ("%s", defined_name); insert_html_tag (END, "b"); insert_html_tag (START, "i"); break; } } /* if (html)... */ if (docbook) { switch (base_type) { case deffn: case defvr: case deftp: case defcv: case defop: xml_insert_element (FUNCTION, START); execute_string ("%s", defined_name); xml_insert_element (FUNCTION, END); break; case deftypefn: case deftypevr: execute_string ("%s", type_name); xml_insert_element (FUNCTION, START); execute_string ("%s", defined_name); xml_insert_element (FUNCTION, END); break; case deftypemethod: case deftypeop: case deftypeivar: execute_string ("%s", type_name2); xml_insert_element (FUNCTION, START); execute_string ("%s", defined_name); xml_insert_element (FUNCTION, END); break; } } /* if (docbook)... */ current_indent += default_indentation_increment; /* Now process the function arguments, if any. If these carry onto the next line, they should be indented by two increments to distinguish them from the body of the definition, which is indented by one increment. */ current_indent += default_indentation_increment; switch (base_type) { case deffn: case defop: process_defun_args (scan_args, 1); break; /* Through Makeinfo 1.67 we processed remaining args only for deftp, deftypefn, and deftypemethod. But the libc manual, for example, needs to say: @deftypevar {char *} tzname[2] And simply allowing the extra text seems far simpler than trying to invent yet more defn commands. In any case, we should either output it or give an error, not silently ignore it. */ default: process_defun_args (scan_args, 0); break; } current_indent -= default_indentation_increment; close_single_paragraph (); if (html) { /* xx The single words (on, off) used here, should depend on documentlanguage and NOT on gettext --kama. */ switch (base_type) { case deffn: case defvr: case deftp: case deftypefn: case deftypevr: insert_html_tag (END, "i"); /* close italic area for arguments */ /* put the rest into the second column */ add_word ("</td>\n"); add_html_elt ("<td align=\"right\">"); execute_string ("%s", category); break; case defcv: add_word ("</td>\n"); add_html_elt ("<td align=\"right\">"); execute_string ("%s %s %s", category, _("of"), type_name); break; case defop: case deftypemethod: case deftypeop: insert_html_tag (END, "i"); add_word ("</td>\n"); add_html_elt ("<td align=\"right\">"); execute_string ("%s %s %s", category, _("on"), type_name); break; case deftypeivar: insert_html_tag (END, "i"); add_word ("</td>\n"); add_html_elt ("<td align=\"right\">"); execute_string ("%s %s %s", category, _("of"), type_name); break; } /* switch (base_type)... */ add_word ("</td>\n"); /* close second column */ add_word ("</tr>\n"); /* close row */ /* This is needed because I have to know if the next line is normal text or another @def..x. If text follows, create a new table to get the indentation for the following text. This construction would fail if someone uses: @deffn @sp 2 @deffnx . @end deffn But we don't care. */ if (!looking_at ("@def")) { add_word ("</table>\n"); add_html_elt ("<table width=\"95%\" align=\"center\">"); add_word ("\n<tr><td>\n"); } } /* if (html)... */ /* Make an entry in the appropriate index. */ switch (base_type) { case deffn: case deftypefn: execute_string ("@findex %s\n", defined_name); break; case defvr: case deftypevr: case defcv: execute_string ("@vindex %s\n", defined_name); break; case deftypeivar: execute_string ("@vindex %s %s %s\n", defined_name, _("of"), type_name); break; case defop: case deftypeop: case deftypemethod: execute_string ("@findex %s %s %s\n", defined_name, _("on"), type_name); break; case deftp: execute_string ("@tindex %s\n", defined_name); break; } /* Deallocate the token list. */ scan_args = defun_args; while (1) { char * arg = (*scan_args++); if (arg == NULL) break; free (arg); } free (defun_args); } /* Add an entry for a function, macro, special form, variable, or option. If the name of the calling command ends in `x', then this is an extra entry included in the body of an insertion of the same type. */ void cm_defun () { int x_p; enum insertion_type type; char *temp = xstrdup (command); x_p = (command[strlen (command) - 1] == 'x'); if (x_p) temp[strlen (temp) - 1] = 0; type = find_type_from_name (temp); free (temp); /* If we are adding to an already existing insertion, then make sure that we are already in an insertion of type TYPE. */ if (x_p && (!insertion_level || insertion_stack->insertion != type)) { line_error (_("Must be in `%s' insertion to use `%sx'"), command, command); discard_until ("\n"); return; } defun_internal (type, x_p); } --- NEW FILE: defun.h --- /* defun.h -- declaration for defuns. $Id: defun.h,v 1.1 2002/12/05 21:07:17 earnie Exp $ Copyright (C) 1999 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 the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License 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 Karl Heinz Marbaise <ka...@hi...>. */ #ifndef DEFUN_H #define DEFUN_H #include "insertion.h" extern enum insertion_type get_base_type (); extern void cm_defun (); #endif /* !DEFUN_H */ --- NEW FILE: files.c --- /* files.c -- file-related functions for makeinfo. $Id: files.c,v 1.1 2002/12/05 21:07:17 earnie Exp $ Copyright (C) 1998, 1999, 2000, 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 the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "system.h" #include "files.h" #include "macro.h" #include "makeinfo.h" FSTACK *filestack = NULL; static int node_filename_stack_index = 0; static int node_filename_stack_size = 0; static char **node_filename_stack = NULL; /* Looking for include files. */ /* Given a string containing units of information separated by colons, return the next one pointed to by INDEX, or NULL if there are no more. Advance INDEX to the character after the colon. */ static char * extract_colon_unit (string, index) char *string; int *index; { int start; int path_sep_char = PATH_SEP[0]; int i = *index; if (!string || (i >= strlen (string))) return NULL; /* Each call to this routine leaves the index pointing at a colon if there is more to the path. If i > 0, then increment past the `:'. If i == 0, then the path has a leading colon. Trailing colons are handled OK by the `else' part of the if statement; an empty string is returned in that case. */ if (i && string[i] == path_sep_char) i++; start = i; while (string[i] && string[i] != path_sep_char) i++; *index = i; if (i == start) { if (string[i]) (*index)++; /* Return "" in the case of a trailing `:'. */ return xstrdup (""); } else { char *value; value = xmalloc (1 + (i - start)); memcpy (value, &string[start], (i - start)); value [i - start] = 0; return value; } } /* Return the full pathname for FILENAME by searching along PATH. When found, return the stat () info for FILENAME in FINFO. If PATH is NULL, only the current directory is searched. If the file could not be found, return a NULL pointer. */ static char * get_file_info_in_path (filename, path, finfo) char *filename, *path; struct stat *finfo; { char *dir; int result, index = 0; if (path == NULL) path = "."; /* Handle absolute pathnames. */ if (IS_ABSOLUTE (filename) || (*filename == '.' && (IS_SLASH (filename[1]) || (filename[1] == '.' && IS_SLASH (filename[2]))))) { if (stat (filename, finfo) == 0) return xstrdup (filename); else return NULL; } while ((dir = extract_colon_unit (path, &index))) { char *fullpath; if (!*dir) { free (dir); dir = xstrdup ("."); } fullpath = xmalloc (2 + strlen (dir) + strlen (filename)); sprintf (fullpath, "%s/%s", dir, filename); free (dir); result = stat (fullpath, finfo); if (result == 0) return fullpath; else free (fullpath); } return NULL; } /* Find and load the file named FILENAME. Return a pointer to the loaded file, or NULL if it can't be loaded. */ char * find_and_load (filename) char *filename; { struct stat fileinfo; long file_size; int file = -1, count = 0; char *fullpath, *result; int n, bytes_to_read; result = fullpath = NULL; fullpath = get_file_info_in_path (filename, include_files_path, &fileinfo); if (!fullpath) goto error_exit; filename = fullpath; file_size = (long) fileinfo.st_size; file = open (filename, O_RDONLY); if (file < 0) goto error_exit; /* Load the file, with enough room for a newline and a null. */ result = xmalloc (file_size + 2); /* VMS stat lies about the st_size value. The actual number of readable bytes is always less than this value. The arcane mysteries of VMS/RMS are too much to probe, so this hack suffices to make things work. It's also needed on Cygwin. And so we might as well use it everywhere. */ bytes_to_read = file_size; while ((n = read (file, result + count, bytes_to_read)) > 0) { count += n; bytes_to_read -= n; } if (0 < count && count < file_size) result = xrealloc (result, count + 2); /* why waste the slack? */ else if (n == -1) error_exit: { if (result) free (result); if (fullpath) free (fullpath); if (file != -1) close (file); return NULL; } close (file); /* Set the globals to the new file. */ input_text = result; input_text_length = count; input_filename = fullpath; node_filename = xstrdup (fullpath); input_text_offset = 0; line_number = 1; /* Not strictly necessary. This magic prevents read_token () from doing extra unnecessary work each time it is called (that is a lot of times). INPUT_TEXT_LENGTH is one past the actual end of the text. */ input_text[input_text_length] = '\n'; /* This, on the other hand, is always necessary. */ input_text[input_text_length+1] = 0; return result; } /* Pushing and popping files. */ void push_node_filename () { if (node_filename_stack_index + 1 > node_filename_stack_size) node_filename_stack = xrealloc (node_filename_stack, (node_filename_stack_size += 10) * sizeof (char *)); node_filename_stack[node_filename_stack_index] = node_filename; node_filename_stack_index++; } void pop_node_filename () { node_filename = node_filename_stack[--node_filename_stack_index]; } /* Save the state of the current input file. */ void pushfile () { FSTACK *newstack = xmalloc (sizeof (FSTACK)); newstack->filename = input_filename; newstack->text = input_text; newstack->size = input_text_length; newstack->offset = input_text_offset; newstack->line_number = line_number; newstack->next = filestack; filestack = newstack; push_node_filename (); } /* Make the current file globals be what is on top of the file stack. */ void popfile () { FSTACK *tos = filestack; if (!tos) abort (); /* My fault. I wonder what I did? */ if (macro_expansion_output_stream) { maybe_write_itext (input_text, input_text_offset); forget_itext (input_text); } /* Pop the stack. */ filestack = filestack->next; /* Make sure that commands with braces have been satisfied. */ if (!executing_string && !me_executing_string) discard_braces (); /* Get the top of the stack into the globals. */ input_filename = tos->filename; input_text = tos->text; input_text_length = tos->size; input_text_offset = tos->offset; line_number = tos->line_number; free (tos); /* Go back to the (now) current node. */ pop_node_filename (); } /* Flush all open files on the file stack. */ void flush_file_stack () { while (filestack) { char *fname = input_filename; char *text = input_text; popfile (); free (fname); free (text); } } /* Return the index of the first character in the filename which is past all the leading directory characters. */ static int skip_directory_part (filename) char *filename; { int i = strlen (filename) - 1; while (i && !IS_SLASH (filename[i])) i--; if (IS_SLASH (filename[i])) i++; else if (filename[i] && HAVE_DRIVE (filename)) i = 2; return i; } char * filename_non_directory (name) char *name; { return xstrdup (name + skip_directory_part (name)); } /* Return just the simple part of the filename; i.e. the filename without the path information, or extensions. This conses up a new string. */ char * filename_part (filename) char *filename; { char *basename = filename_non_directory (filename); #ifdef REMOVE_OUTPUT_EXTENSIONS /* See if there is an extension to remove. If so, remove it. */ { char *temp; temp = strrchr (basename, '.'); if (temp) *temp = 0; } #endif /* REMOVE_OUTPUT_EXTENSIONS */ return basename; } /* Return the pathname part of filename. This can be NULL. */ char * pathname_part (filename) char *filename; { char *expand_filename (); char *result = NULL; int i; filename = expand_filename (filename, ""); i = skip_directory_part (filename); if (i) { result = xmalloc (1 + i); strncpy (result, filename, i); result[i] = 0; } free (filename); return result; } /* Return the expansion of FILENAME. */ char * expand_filename (filename, input_name) char *filename, *input_name; { int i; char *full_pathname (); if (filename) { filename = full_pathname (filename); if (IS_ABSOLUTE (filename) || (*filename == '.' && (IS_SLASH (filename[1]) || (filename[1] == '.' && IS_SLASH (filename[2]))))) return filename; } else { filename = filename_non_directory (input_name); if (!*filename) { free (filename); filename = xstrdup ("noname.texi"); } for (i = strlen (filename) - 1; i; i--) if (filename[i] == '.') break; if (!i) i = strlen (filename); if (i + 6 > (strlen (filename))) filename = xrealloc (filename, i + 6); strcpy (filename + i, html ? ".html" : ".info"); return filename; } if (IS_ABSOLUTE (input_name)) { /* Make it so that relative names work. */ char *result; i = strlen (input_name) - 1; result = xmalloc (1 + strlen (input_name) + strlen (filename)); strcpy (result, input_name); while (!IS_SLASH (result[i]) && i) i--; if (IS_SLASH (result[i])) i++; strcpy (&result[i], filename); free (filename); return result; } return filename; } /* Return the full path to FILENAME. */ char * full_pathname (filename) char *filename; { int initial_character; char *result; /* No filename given? */ if (!filename || !*filename) return xstrdup (""); /* Already absolute? */ if (IS_ABSOLUTE (filename) || (*filename == '.' && (IS_SLASH (filename[1]) || (filename[1] == '.' && IS_SLASH (filename[2]))))) return xstrdup (filename); initial_character = *filename; if (initial_character != '~') { char *localdir = xmalloc (1025); #ifdef HAVE_GETCWD if (!getcwd (localdir, 1024)) #else if (!getwd (localdir)) #endif { fprintf (stderr, _("%s: getwd: %s, %s\n"), progname, filename, localdir); xexit (1); } strcat (localdir, "/"); strcat (localdir, filename); result = xstrdup (localdir); free (localdir); } else { /* Does anybody know why WIN32 doesn't want to support $HOME? If the reason is they don't have getpwnam, they should only disable the else clause below. */ #ifndef WIN32 if (IS_SLASH (filename[1])) { /* Return the concatenation of the environment variable HOME and the rest of the string. */ char *temp_home; temp_home = (char *) getenv ("HOME"); result = xmalloc (strlen (&filename[1]) + 1 + temp_home ? strlen (temp_home) : 0); *result = 0; if (temp_home) strcpy (result, temp_home); strcat (result, &filename[1]); } else { struct passwd *user_entry; int i, c; char *username = xmalloc (257); for (i = 1; (c = filename[i]); i++) { if (IS_SLASH (c)) break; else username[i - 1] = c; } if (c) username[i - 1] = 0; user_entry = getpwnam (username); if (!user_entry) return xstrdup (filename); result = xmalloc (1 + strlen (user_entry->pw_dir) + strlen (&filename[i])); strcpy (result, user_entry->pw_dir); strcat (result, &filename[i]); } #endif /* not WIN32 */ } return result; } char * output_name_from_input_name (name) char *name; { return expand_filename (NULL, name); } /* Modify the file name FNAME so that it fits the limitations of the underlying filesystem. In particular, truncate the file name as it would be truncated by the filesystem. We assume the result can never be longer than the original, otherwise we couldn't be sure we have enough space in the original string to modify it in place. */ char * normalize_filename (fname) char *fname; { int maxlen; char orig[PATH_MAX + 1]; int i; char *lastdot, *p; #ifdef _PC_NAME_MAX maxlen = pathc... [truncated message content] |