diff -aruN groff-1.16/ChangeLog groff-1.16.1/ChangeLog --- groff-1.16/ChangeLog Wed May 24 00:08:21 2000 +++ groff-1.16.1/ChangeLog Mon Jul 31 17:12:54 2000 @@ -1,3 +1,263 @@ +2000-07-31 Werner LEMBERG + + Preparing release 1.16.1. + + * REVISION: Revision number set to 1. + * MORE.STUFF: Added info about port to DOS. + * NEWS, win32-diffs: Updated. + + * src/include/nonposix.h: Remove first line -- this file is used + in C also. + + * Makefile.in (dist): Delete Imakefile earlier to avoid a soft + link to it. + +2000-07-30 Werner LEMBERG + + * doc/texinfo.tex: Update to latest version. + +2000-06-28 Paul Eggert + + * Makefile.in (ENVSETUP): Don't assume POSIX make semantics for + commands that fail. Don't assume that "export a=b" is valid shell + syntax. This is needed for Solaris 2.5.1. + + * src/libs/libgroff/tmpfile.cc, src/utils/indxbib/indxbib.cc: Fix + comment about missing Solaris headers. + + * PROBLEMS: Add section about problems with Sun Make and VPATH. + +2000-06-25 Werner LEMBERG + + * src/devics/grodvi/dvi.cc: Replace _setmode() (for MSC) with + SET_BINARY(). + + * src/include/posix.h: Use HAVE_UNISTD instead of _MSC_VER. + + * win32-diffs: Updated. + * README.WIN32: Added CRs to make all Windows editors happy. + + * src/roff/troff/node.cc: Added WIFSIGNALED() macro (copied from + src/roff/groff/pipeline.c). + +2000-06-23 Eli Zaretskii + + * src/roff/grog/Makefile.sub (grog): Prepend `-e' to + $(SH_SCRIPT_SED_CMD), for the case where its value is empty. + +2000-06-17 Eli Zaretskii + + * src/utils/tfmtodit/tfmtodit.cc: #include nonposix.h. + (tfm::load, gf::load): Open tfm and gf files in binary mode: these + are binary files. + (main): Support non-Posix systems with several different styles of + slash characters in file names. + + * src/utils/pfbtops/pfbtops.c: #include nonposix.h. + (main) [SET_BINARY]: Switch stdin into binary mode. + + * src/utils/indxbib/indxbib.cc: #include nonposix.h. + (main): Support file names with several possible slash-type + characters, as given by DIR_SEPS[] in nonposix.h. + (main) [__MSDOS__]: If renaming the temporary index file fails + because it has more than one dot in its trunk, replace the dot + with an underscore and try again. + (do_file): Use FOPEN_RB instead of "r". Skip every CR before a + Newline. + [__MSDOS__ || _MSC_VER]: Stop at the first ^Z character. + + * src/utils/hpftodit/hpftodit.cc: #include nonposix.h. + (File::File): Open the input file in binary mode. Strip CR + characters from each CR-LF pair. + (xbasename): Support file names with several possible slash-type + characters, as given by DIR_SEPS[] in nonposix.h. + + * src/include/Makefile.sub (HDRS): Add nonposix.h. + + * src/roff/troff/node.cc [HAVE_UNISTD_H]: Include . + (WIFEXITED, WEXITSTATUS, WTERMSIG, WIFSTOPPED, WSTOPSIG) + [!_POSIX_VERSION]: Define for traditional Unix systems. + (real_output_file::real_output_file): Remove the MSVC-specific + call to popen, use instead POPEN_WT, appropriately defined on + nonposix.h. #include nonposix.h. + (real_output_file::~real_output_file): Remove the MSVC-specific + call to pclose, a suitable macro is now defined on nonposix.h. + Use the portable macros WIFEXITED, WIFSIGNALED, WTERMSIG, WSTOPSIG + and WEXITSTATUS instead of assuming traditional Unix + interpretation of the status returned by pclose. + + * src/roff/troff/input.cc (pipe_source): Remove the MSVC-specific + call to popen, use POPEN_RT instead (appropriately defined on + nonposix.h). #include nonposix.h. + (ps_bbox_request): Open the PostScript file in binary mode. + Close the file after processing it. + (getpid) [_MSC_VER]: Remove; a suitable macro is now defined on + nonposix.h. + + * src/roff/groff/pipeline.c (run_pipeline) [__MSDOS__ || _WIN32]: + A version of run_pipeline that doesn't use `fork'. + (signal_catcher) [__MSDOS__ || _WIN32]: New function. + (system_shell_name, system_shell_dash_c) + (is_system_shell) [__MSDOS__ || _WIN32]: New functions, to hide + the ugliness of testing DOS/Windows file names for equality, and + support both stock shells and ports of Unix shells. + + * src/roff/groff/groff.cc: #include nonposix.h. + (BSHELL): Definition moved to nonposix.h. + (main): Use PATH_SEP[0] instead of literal ':'. Use BSHELL_DASH_C + instead of a literal "-c". + (xbasename): Support file names with several possible slash-type + characters, as given by DIR_SEPS[] in nonposix.h. + (possible_command::print): Use BSHELL_DASH_C and IS_BSHELL instead + of literal strings. + + * src/preproc/soelim/soelim.cc: #include nonposix.h. + (do_file): Use IS_ABSOLUTE instead of testing for a literal '/'. + + * src/preproc/pic/Makefile.sub (YTABH): Change pic.tab.h to + pic_tab.h. + + * src/preproc/pic/lex.cc: Change pic.tab.h to pic_tab.h. + + * src/preproc/eqn/Makefile.sub (YTABH): Rename eqn.tab.h to + eqn_tab.h. + + * src/preproc/eqn/lex.cc: #include eqn_tab.h, not eqn.tab.h. + + * src/libs/libgroff/tmpfile.cc (DEFAULT_TMPDIR) [P_tmpdir]: If + P_tmpdir is defined, use it instead of the literal "/tmp". + (remove_tmp_files, add_tmp_file): New functions. + (xtmpfile): Record temporary files and register an atexit function + to delete them explicitly, instead of relying on the OS to do + that, which doesn't work on non-Unix systems. + + * src/libs/libgroff/searchpath.cc: #include nonposix.h. + (search_path::search_path): Use PATH_SEP instead of a literal + colon. + (search_path::command_line_dir): Ditto. + (search_path::open_file): Use IS_ABSOLUTE, PATH_SEP and DIR_SEPS, + to support non-Posix systems. + + * src/libc/libbib/search.cc: #include nonposix.h. + (search_list::add_file): Open the file in binary mode. + + * src/libs/libbib/linear.cc: #include nonposix.h. + (file_buffer::load): Remove \r characters preceding \n from the + loaded buffer. + + * src/libs/libbib/index.cc: #include nonposix.h. + (make_index_search_item): Open index_filename in O_BINARY mode. + (index_search_item_iterator::get_tag): Ditto. Remove \r + characters before \n characters. + (index_search_item::check_files): Open files in binary mode. + (index_search_item::munge_filename): Support DOS-style file names + with backslashes and drive letters, use IS_ABSOLUTE. + + * src/devices/grops/ps.cc: #include nonposix.h. + (main) [SET_BINARY]: Switch stdout to binary mode. + + * src/devices/grolj4/lj4.cc: #include nonposix.h. + (main) [SET_BINARY]: Switch stdout to binary mode. + + * src/devices/grolbp/lbp.cc: #include nonposix.h + (fill_pattern) [SET_BINARY]: Switch stdout to binary mode. + + * src/devices/grodvi/dvi.cc: #include nonposix.h. + [_MSC_VER]: Remove inclusion of Windows-specific headers (done by + nonposix.h). + (main) [SET_BINARY]: Switch stdout to binary mode. + [_MSC_VER]: Remove an explicit call to _setmode. + + * src/include/nonposix.h: New file. + + * Makefile.in (ENVSETUP): New variable, to set up case-sensitive + operation when building with DJGPP. + ($(TARGETS), dot, $(LIBDIRS), $(CPROGDIRS), $(CCPROGDIRS)) + ($(DEVDIRS), $(TTYDEVDIRS), $(INCDIRS), $(OTHERDIRS)): Use + ENVSETUP. + + * Makefile.comm: mv y.tab.[ch] to y_tab.[ch], to make it work on + MS-DOS. + (.man.n): Replace `;' with `|', since FONTPATH, MACROPATH, + etc. can include a semi-colon on DOS/Windows. + (depend.temp): Use depend1.temp instead of depend.temp1, to + prevent files from overerwiting each other on 8+3 filesystems. + + * gendef.sh (t): Change definition to work with DOS/Windows. + + doc/groff.texinfo: Apart of some typo corrections, I also changed + some index entris, to make them more non-ambiguous, and also put + @ignore around some parts that are not yet written, to allow the + Info output be readable. + +2000-06-10 Gael Queri + + Replaced specific checks for function declarations with a generic + routine taken from GNU bfd. + + * aclocal.m4 (GROFF_NEED_DECLARATION): New function. + GROFF_PUTENV, GROFF_POPEN, GROFF_PCLOSE, GROFF_HYPOT: Removed. + * configure.in: Use it. + * src/devices/grolbp/lbp.cc, src/include/lib.h, + src/preproc/grn/hgraph.cc, src/preproc/pic/pic.h, + src/roff/groff/groff.cc: Use it. + * Makefile.in, configure: Updated. + +2000-06-07 Paco Andres Verdu + + * src/devides/grolbp/lbp.h: Removed unused variables. + +2000-05-31 Keith Thompson + + * src/devices/grolbp/lbp.cc (set_papersizes): Add declaration of + strncasecmp(). + +2000-05-31 Werner LEMBERG + + * aclocal.m4 (GROFF_SRAND): New function to test the return value + of srand() -- at least SunOS 4.1.3 uses `int' instead of `void'. + * configure.in: Use it. + * src/preproc/pic/pic.y, src/preproc/pic/pic.cc: Use it. + * configure, Makefile.in: Updated. + + * configure.in: Add test for strncasecmp(). + * src/include/lib.h: Use it. + +2000-05-29 Andrej Borsenkow + + * src/preproc/grn/Makefile.sub: Add MLIB. + +2000-05-29 Nix + + * Makefile.in: Use @datadir@ and @mandir@ appropriately. + +2000-05-29 Werner LEMBERG + + * src/roff/grog/Makefile.sub, src/roff/grog/grog.sh: Add `@g@'. + + * PROBLEMS: Small update. + + * src/devices/grolbp/lbp.cc: Various small fixes. + +2000-05-28 Keith Thompson + + * src/roff/nroff/nroff.sh: Fix main loop syntax. + + * src/utils/indxbib/indxbib.cc: Add declaration of mkstemp(). + +2000-05-25 Werner LEMBERG + + * man/roff.man: Removed unused macro. + +2000-05-24 Werner LEMBERG + + * Makefile.in (dist): Remove src/xditview/Imakefile explicitly. + This is needed e.g. if you do + `make distclean; ./configure; make dist'. + +Version 1.16 released +===================== + 2000-05-23 Werner LEMBERG Adding font CWI (constant width italic) to devdvi. diff -aruN groff-1.16/INSTALL groff-1.16.1/INSTALL --- groff-1.16/INSTALL Mon May 22 08:21:49 2000 +++ groff-1.16.1/INSTALL Sun Jun 18 12:13:50 2000 @@ -2,6 +2,9 @@ This file contains information that supplements those instructions. +(For instructions how to build groff with DJGPP tools for MS-DOS and +MS-Windows, see the file arch/djgpp/README.) + groff is written in C++, so you will need a C++ compiler. The C++ source files use a suffix of `.cc', so your C++ compiler must be able to handle this. If you don't already have a C++ compiler, I suggest diff -aruN groff-1.16/MORE.STUFF groff-1.16.1/MORE.STUFF --- groff-1.16/MORE.STUFF Mon May 15 01:47:25 2000 +++ groff-1.16.1/MORE.STUFF Mon Jul 31 12:41:29 2000 @@ -4,10 +4,26 @@ win32 ----- -Another win32 port using the gcc compiler and other GNU tools, maintained by -Thomer M. Gil , is available from +Here two ports using the gcc compiler and other GNU tools: - http://www.cs.vu.nl/~tmgil/misc/wingroff.html + Thomer M. Gil : + + http://www.cs.vu.nl/~tmgil/misc/wingroff.html + + Kees Zeelenberg : + + ftp://ftp.franken.de/pub/win32/develop/gnuwin32/ + cygwin/porters/Zeelenberg_Kees/B20/index.html + +dos +--- + +Binaries for Eli Zaretskii's port using the djgpp compiler +are available from + + ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/gro*b.zip + +and its mirrors; for installation details please read `arch/djgpp/README'. grap ---- diff -aruN groff-1.16/Makefile.comm groff-1.16.1/Makefile.comm --- groff-1.16/Makefile.comm Sun Mar 12 12:09:37 2000 +++ groff-1.16.1/Makefile.comm Sun Jun 18 12:13:50 2000 @@ -99,14 +99,16 @@ else \ $(YACC) $(YACCFLAGS) $<; \ fi - mv y.tab.c $@ + -test -f y.tab.h && mv y.tab.h y_tab.h + -test -f y.tab.c && mv y.tab.c y_tab.c + mv y_tab.c $@ # Avoid ending up with two versions of $(YTABH). if test -n "$(YTABH)"; then \ if test -f $(srcdir)/$(YTABH); then \ rm -f $(YTABH); \ - mv y.tab.h $(srcdir)/$(YTABH); \ + mv y_tab.h $(srcdir)/$(YTABH); \ else \ - mv y.tab.h $(YTABH); \ + mv y_tab.h $(YTABH); \ fi; \ fi @@ -117,27 +119,27 @@ .man.n: @echo Making $@ from $< @-rm -f $@ - @sed -e "s;@FONTDIR@;$(fontdir);g" \ - -e "s;@FONTPATH@;$(fontpath);g" \ - -e "s;@MACRODIR@;$(tmacdir);g" \ - -e "s;@MACROPATH@;$(tmacpath);g" \ - -e "s;@DEVICE@;$(DEVICE);g" \ - -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \ - -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \ - -e "s;@INDEX_SUFFIX@;$(indexext);g" \ - -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \ - -e "s;@MAN1EXT@;$(man1ext);g" \ - -e "s;@MAN5EXT@;$(man5ext);g" \ - -e "s;@MAN7EXT@;$(man7ext);g" \ - -e "s;@TMAC_S_PREFIX@;$(tmac_s_prefix);g" \ - -e "s;@TMAC_M_PREFIX@;$(tmac_m_prefix);g" \ - -e "s;@TMAC_AN_PREFIX@;$(tmac_an_prefix);g" \ - -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \ - -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \ - -e "s;@VERSION@;$(version)$(revision);g" \ - -e "s;@MDATE@;`$(SHELL) $(top_srcdir)/mdate.sh $<`;g" \ - -e "s;@g@;$(g);g" \ - -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \ + @sed -e "s|@FONTDIR@|$(fontdir)|g" \ + -e "s|@FONTPATH@|$(fontpath)|g" \ + -e "s|@MACRODIR@|$(tmacdir)|g" \ + -e "s|@MACROPATH@|$(tmacpath)|g" \ + -e "s|@DEVICE@|$(DEVICE)|g" \ + -e "s|@DEFAULT_INDEX@|$(indexdir)/$(indexname)|g" \ + -e "s|@DEFAULT_INDEX_NAME@|$(indexname)|g" \ + -e "s|@INDEX_SUFFIX@|$(indexext)|g" \ + -e "s|@COMMON_WORDS_FILE@|$(common_words_file)|g" \ + -e "s|@MAN1EXT@|$(man1ext)|g" \ + -e "s|@MAN5EXT@|$(man5ext)|g" \ + -e "s|@MAN7EXT@|$(man7ext)|g" \ + -e "s|@TMAC_S_PREFIX@|$(tmac_s_prefix)|g" \ + -e "s|@TMAC_M_PREFIX@|$(tmac_m_prefix)|g" \ + -e "s|@TMAC_AN_PREFIX@|$(tmac_an_prefix)|g" \ + -e "s|@TMAC_MDIR@|$(tmacdir)/mm|g" \ + -e "s|@BROKEN_SPOOLER_FLAGS@|$(BROKEN_SPOOLER_FLAGS)|g" \ + -e "s|@VERSION@|$(version)$(revision)|g" \ + -e "s|@MDATE@|`$(SHELL) $(top_srcdir)/mdate.sh $<`|g" \ + -e "s|@g@|$(g)|g" \ + -e "s!@G@!`echo $(g) | tr [a-z] [A-Z]`!g" \ $< >$@ .PHONY: install_man @@ -238,8 +240,8 @@ test -z "$(CSRCS)" \ || $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp if test -n "$(YTABH)"; then \ - sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend.temp1; \ - mv depend.temp1 depend.temp; \ + sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend1.temp; \ + mv depend1.temp depend.temp; \ fi .PHONY: TAGS_src diff -aruN groff-1.16/Makefile.in groff-1.16.1/Makefile.in --- groff-1.16/Makefile.in Mon May 15 01:47:25 2000 +++ groff-1.16.1/Makefile.in Mon Jul 31 17:12:55 2000 @@ -78,7 +78,7 @@ bindir=$(exec_prefix)/bin # datasubdir says where to install data files -datadir=$(prefix)/share +datadir=@datadir@ datasubdir=$(datadir)/groff # fontdir says where to install dev*/*. @@ -135,7 +135,7 @@ common_words_file=$(datasubdir)/eign # manroot is the root of the man page directory tree. -manroot=$(prefix)/man +manroot=@mandir@ # man1ext is the man section for user commands. man1ext=1 @@ -170,13 +170,17 @@ # -DHAVE_STRDUP if you have strdup() # -DHAVE_STRSEP if you have strsep() # -DHAVE_STRCASECMP if you have strcasecmp() -# -DSTDLIB_H_DECLARES_PUTENV if your C++ declares putenv() -# -DSTDIO_H_DECLARES_POPEN if your C++ declares popen() -# -DSTDIO_H_DECLARES_PCLOSE if your C++ declares pclose() +# -DNEED_DECLARATION_HYPOT if your C++ doesn't declare hypot() +# -DNEED_DECLARATION_PUTENV if your C++ doesn't declare putenv() +# -DNEED_DECLARATION_POPEN if your C++ doesn't declare popen() +# -DNEED_DECLARATION_PCLOSE if your C++ doesn't declare pclose() +# -DNEED_DECLARATION_STRNCASECMP +# if your C++ doesn't declare +# strncasecmp() +# -DRET_TYPE_SRAND_IS_VOID if your srand() returns void or int # -DHAVE_SYS_NERR if you have sysnerr in or # -DHAVE_SYS_ERRLIST if you have sys_errlist in or # -# -DMATH_H_DECLARES_HYPOT if you have hypot() in # -DTRADITIONAL_CPP if your C++ compiler uses a traditional # (Reiser) preprocessor # -DLONG_FOR_TIME_T if localtime() takes a long * not a time_t * @@ -362,6 +366,15 @@ TARGETS=all install install_bin install_data clean distclean mostlyclean \ realclean extraclean distfiles TAGS depend uninstall_sub +# This ENVSETUP gork is required by the DJGPP build on Windows 9X, +# where Make needs to be case-sensitive to find files like BI and VERSION. +ENVSETUP=\ + if test -f $(srcdir)/makefile.ccpg* && \ + test -f $(srcdir)/Makefile.ccpg*; \ + then FNCASE=y; export FNCASE; \ + else :; \ + fi + do=all dodirs=$(ALLDIRS) dot # Default target for subdir_Makefile @@ -369,15 +382,17 @@ $(TARGETS): - @$(MAKE) $(MDEFINES) do=$@ $(dodirs) + @$(ENVSETUP); $(MAKE) $(MDEFINES) do=$@ $(dodirs) dot: FORCE - @$(MAKE) $(MDEFINES) srcdir=$(srcdir) VPATH=$(srcdir) \ + @$(ENVSETUP); \ + $(MAKE) $(MDEFINES) srcdir=$(srcdir) VPATH=$(srcdir) \ -f $(top_srcdir)/Makefile.comm \ -f $(top_srcdir)/Makefile.sub $(do) $(LIBDIRS): FORCE - @if test $(srcdir) = .; \ + @$(ENVSETUP); \ + if test $(srcdir) = .; \ then srcdir=.; \ else srcdir=`cd $(srcdir); pwd`/$@; \ fi; \ @@ -391,7 +406,8 @@ -f Makefile.dep $(do) $(CPROGDIRS): FORCE - @if test $(srcdir) = .; \ + @$(ENVSETUP); \ + if test $(srcdir) = .; \ then srcdir=.; \ else srcdir=`cd $(srcdir); pwd`/$@; \ fi; \ @@ -405,7 +421,8 @@ -f Makefile.dep $(do) $(CCPROGDIRS): FORCE - @if test $(srcdir) = .; \ + @$(ENVSETUP); \ + if test $(srcdir) = .; \ then srcdir=.; \ else srcdir=`cd $(srcdir); pwd`/$@; \ fi; \ @@ -419,7 +436,8 @@ -f Makefile.dep $(do) $(DEVDIRS) $(TTYDEVDIRS): FORCE - @if test $(srcdir) = .; \ + @$(ENVSETUP); \ + if test $(srcdir) = .; \ then srcdir=.; \ else srcdir=`cd $(srcdir); pwd`/$@; \ fi; \ @@ -431,7 +449,8 @@ -f $(top_srcdir)/Makefile.dev $(do) $(INCDIRS) $(OTHERDIRS): FORCE - @if test $(srcdir) = .; \ + @$(ENVSETUP); \ + if test $(srcdir) = .; \ then srcdir=.; \ else srcdir=`cd $(srcdir); pwd`/$@; \ fi; \ @@ -450,6 +469,7 @@ dist: -rm -fr tmp rm -f groff-$(version)$(revision).tar.gz + rm -f src/xditview/Imakefile; mkdir tmp for d in $(DISTDIRS); do \ $(mkinstalldirs) tmp/$$d; \ diff -aruN groff-1.16/NEWS groff-1.16.1/NEWS --- groff-1.16/NEWS Wed May 24 00:08:22 2000 +++ groff-1.16.1/NEWS Mon Jul 31 12:41:29 2000 @@ -1,6 +1,11 @@ This file describes recent user-visible changes in groff. Bug fixes are not described. There are more details in the man pages. +VERSION 1.16.1 +============== + +Bug fixes only; no user-visible changes. + VERSION 1.16 ============ diff -aruN groff-1.16/PROBLEMS groff-1.16.1/PROBLEMS --- groff-1.16/PROBLEMS Mon May 8 10:48:44 2000 +++ groff-1.16.1/PROBLEMS Fri Jul 21 12:23:28 2000 @@ -98,6 +98,24 @@ ---------------------------------------------------------------------- +* On a host using Unix make (e.g. Solaris), if you are compiling for + multiple architectures by building in a subdirectory, the make stops + with a message like this: + + make: Fatal error: Don't know how to make target `assert.o' + + or like this: + + make: Fatal error: Can't find /u/src/groff/src/include/Makefile.sub': No such file or directory + +This occurs because GNU make and Unix make handle VPATH differently, +and the groff build relies on GNU make's VPATH handling. + +Use GNU make to work around the problem. In Solaris 8, GNU make is +on the Software Companion CD and is installed as /opt/sfw/bin/gmake. + +---------------------------------------------------------------------- + * On Ultrix, the make stops with the message *** Error code 1 @@ -145,6 +163,12 @@ The system ranlib can't handle externals longer than 40 characters. Use the ranlib included in demon.co.uk:/pub/xenix/g++-1.40.3a.v1 instead. + +---------------------------------------------------------------------- + +* There are many empty `Makefile.dep' files. Is this a bug? + +No. Real dependency files are created with a `make depend' call. ---------------------------------------------------------------------- diff -aruN groff-1.16/README.WIN32 groff-1.16.1/README.WIN32 --- groff-1.16/README.WIN32 Fri May 19 07:05:37 2000 +++ groff-1.16.1/README.WIN32 Mon Jun 26 15:57:25 2000 @@ -1,68 +1,68 @@ - -WIN32 port of GROFF and friends done by Blake McBride -(blake@florida-software.com) 4/14/00. - -This port differs from other ports in that it uses the Microsoft -compiler. The changes were done such that they only have effect on -the code when compiled with the Microsoft compiler. - -Note that not all preprocessors and output devices have been ported; -missing are grohtml, grolbp, grn, refer, soelim, and groff. Besides -these programs, no utility program has been ported. Of course, -gxditview (which only runs on the X Window System, the standard Unix -GUI) is missing also. - - -The following programs were used, running on Windows NT 4.0: - - Microsoft Visual C++ 6.0 - Unix utilities under NT (gzip, tar, patch) - - -Build Instructions ------------------- - -. Unpack groff (using gzip & tar) as follows: - - cd \ - gzip -dc groff-1.16.tar.gz | tar xvf - - -. Now apply the patch file `win32-diffs': - - cd \groff-1.16 - patch -p1 < win32-diffs - - Note that with older versions of `patch', you will get a lot of - *.orig files (most of them are empty) which can be safely deleted. - -. Edit the file `src/include/defs.h' and adapt the path names to - your needs. - -. Build everything by typing: - - nmake -f Makefile.msc - -You are done. - -The `bin' directory contains some .cmd files to help show how to run -stuff. Since Windows 95/98 doesn't understand .cmd files, if you are -operating under that OS, you'll have to rename them to .bat files. -.bat files do have output redirection problems. - - -The changes I made fall into two categories. - -1. Makefiles. Several makefiles were added. All makefiles were named - Makefile.msc. - -2. The Groff build includes several scripts which generate auxiliary - files used by groff (such as DESC, I, R, prologue, etc). - - -Directories needed at runtime ------------------------------ - -bin -font -tmac -mm (copied, including sub-directories, from contrib/mm) + +WIN32 port of GROFF and friends done by Blake McBride +(blake@florida-software.com) 4/14/00. + +This port differs from other ports in that it uses the Microsoft +compiler. The changes were done such that they only have effect on +the code when compiled with the Microsoft compiler. + +Note that not all preprocessors and output devices have been ported; +missing are grohtml, grolbp, grn, refer, soelim, and groff. Besides +these programs, no utility program has been ported. Of course, +gxditview (which only runs on the X Window System, the standard Unix +GUI) is missing also. + + +The following programs were used, running on Windows NT 4.0: + + Microsoft Visual C++ 6.0 + Unix utilities under NT (gzip, tar, patch) + + +Build Instructions +------------------ + +. Unpack groff (using gzip & tar) as follows: + + cd \ + gzip -dc groff-1.16.tar.gz | tar xvf - + +. Now apply the patch file `win32-diffs': + + cd \groff-1.16 + patch -p1 < win32-diffs + + Note that with older versions of `patch', you will get a lot of + *.orig files (most of them are empty) which can be safely deleted. + +. Edit the file `src/include/defs.h' and adapt the path names to + your needs. + +. Build everything by typing: + + nmake -f Makefile.msc + +You are done. + +The `bin' directory contains some .cmd files to help show how to run +stuff. Since Windows 95/98 doesn't understand .cmd files, if you are +operating under that OS, you'll have to rename them to .bat files. +.bat files do have output redirection problems. + + +The changes I made fall into two categories. + +1. Makefiles. Several makefiles were added. All makefiles were named + Makefile.msc. + +2. The Groff build includes several scripts which generate auxiliary + files used by groff (such as DESC, I, R, prologue, etc). + + +Directories needed at runtime +----------------------------- + +bin +font +tmac +mm (copied, including sub-directories, from contrib/mm) diff -aruN groff-1.16/REVISION groff-1.16.1/REVISION --- groff-1.16/REVISION Sun Feb 6 10:34:43 2000 +++ groff-1.16.1/REVISION Mon Jul 31 12:41:29 2000 @@ -1 +1 @@ -0 +1 diff -aruN groff-1.16/aclocal.m4 groff-1.16.1/aclocal.m4 --- groff-1.16/aclocal.m4 Tue May 2 02:39:37 2000 +++ groff-1.16.1/aclocal.m4 Sun Jun 11 08:27:26 2000 @@ -103,36 +103,16 @@ AC_LANG_RESTORE])dnl dnl dnl -AC_DEFUN(GROFF_PUTENV, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of putenv]) -AC_TRY_COMPILE([#include -extern "C" { void putenv(int); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(STDLIB_H_DECLARES_PUTENV)) -AC_LANG_RESTORE])dnl +dnl srand() of SunOS 4.1.3 has return type int instead of void dnl -dnl -AC_DEFUN(GROFF_POPEN, +AC_DEFUN(GROFF_SRAND, [AC_LANG_SAVE AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of popen]) -AC_TRY_COMPILE([#include -extern "C" { void popen(int); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_POPEN)) -AC_LANG_RESTORE])dnl -dnl -dnl -AC_DEFUN(GROFF_PCLOSE, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of pclose]) -AC_TRY_COMPILE([#include -extern "C" { void pclose(int); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_PCLOSE)) +AC_MSG_CHECKING([for return type of srand]) +AC_TRY_COMPILE([#include +extern "C" { void srand(unsigned int); }],, +AC_MSG_RESULT(void);AC_DEFINE(RET_TYPE_SRAND_IS_VOID), +AC_MSG_RESULT(int)) AC_LANG_RESTORE])dnl dnl dnl @@ -160,17 +140,6 @@ AC_LANG_RESTORE])dnl dnl dnl -AC_DEFUN(GROFF_HYPOT, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of hypot]) -AC_TRY_COMPILE([#include -extern "C" { double hypot(double,double); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(MATH_H_DECLARES_HYPOT)) -AC_LANG_RESTORE])dnl -dnl -dnl AC_DEFUN(GROFF_OSFCN_H, [AC_LANG_SAVE AC_LANG_CPLUSPLUS @@ -503,4 +472,41 @@ DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` fi rm -f conftest.defs -]) +])dnl +dnl +dnl +dnl Check whether we need a declaration for a function. +dnl +dnl Stolen from GNU bfd. +dnl +AC_DEFUN(GROFF_NEED_DECLARATION, +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CACHE_VAL(groff_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif], +[char *(*pfn) = (char *(*)) $1], +groff_cv_decl_needed_$1=no, +groff_cv_decl_needed_$1=yes)]) +AC_MSG_RESULT($groff_cv_decl_needed_$1) +if test $groff_cv_decl_needed_$1 = yes; then + AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z])) +fi +AC_LANG_RESTORE])dnl diff -aruN groff-1.16/arch/djgpp/README groff-1.16.1/arch/djgpp/README --- groff-1.16/arch/djgpp/README Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/arch/djgpp/README Sun Jun 18 12:03:58 2000 @@ -0,0 +1,362 @@ +This is a port of GNU Groff to DJGPP v2.03 or later. +Groff is the GNU version of document formatting tools related to +`troff'. + +This README file describes how to build and install Groff on MS-DOS or +MS-Windows systems using the DJGPP port of GNU C/C++ compiler and +development tools. + + +I. Installing the pre-compiled binary package + ------------------------------------------ + + 1. Unzip the file groNNNb.zip (where NNN is the version number) + preserving the directory structure (-d switch to PKUNZIP) from + the main DJGPP installation directory. If you will use Groff + on Windows 9X or Windows2000, use an unzip program which + supports long filenames. + + 2. Groff binaries were configured so that they will look for their + standard directories under the directory pointed to by the + DJDIR environment variable, so it should work automatically if + you have DJGPP installed. If you don't have a standard DJGPP + installation, set the variable DJDIR to point to the directory + where you unzip Groff. In this latter case, you will need to + set additional environment variables: + + GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac + GROFF_TYPESETTER=ascii + GROFF_FONT_PATH=.;%DJDIR%/share/groff/font + + In addition, you can set the variable GROFF_TMPDIR to point to + a directory where you want Groff to create temporary files it + needs for running its jobs (these files are automatically + deleted when Groff exits). + + All of those variables are automatically set in the file + DJGPP.ENV that is part of the standard DJGPP distribution + djdevNNN.zip (where NNN is the DJGPP version number), so you + only need to set them manually if you don't have DJGPP + installed. + + Note that the GROFF_TYPESETTER variable sets the default Groff + device to be `ascii', which is suitable for formatting man + pages to be viewed on the terminal. Use the -T switch to + generate output for other devices (e.g., -Tps for PostScript). + + 3. If your TMPDIR environment variable points to a RAM drive, you + might consider changing GROFF_TMPDIR to point to a directory on + a real disk drive, especially if you intend to generate + PostScript output, because RAM disks are typically small (2-3 + MBytes) which might be not enough for formatting large + documents. + + 4. Read the docs. It comes as formatted manual pages called *.1, + *.5 and *.7 which unzip into your man/ subdirectory. You + can read them with a pager such as GNU Less (recommended, as + Less will use colors for bold and underlined text) or with + Info (which will remove the bold/underline attributes). + Another alternative is to use Emacs built-in man page reader; + the DJGPP FAQ lists other possibilities. + + Beginning with version 1.15, Groff comes with an Info manual; + type "info -f groff" to read it. The Info manual is still + under construction, so some sections are empty. + + If you want to add a Groff entry to the main Info menu in the + file DIR, chdir to the `info' subdirectory of the main Groff + installation directory and run this command: + + install-info --dir-file=dir groff.info + + After you do that, "info groff" will also work. + + 5. For those who only need Groff to format man pages and don't + like reading the docs, here's a minimal cookbook: + + groff -man -s foo.1 > foo.man + + where `foo.1' is the troff source of the man page and `foo.man' + is the formatted page. If you need to view the man page, say + this: + + groff -man -s foo.1 | less + + You can also use the DJGPP clone of the Unix `man' command, in + which case `man' runs the above command for you automatically. + + Here's how you print man pages on a PostScript printer: + + groff -man -s -Tps foo.1 > prn + + And this is for a LaserJet4 printer: + + groff -man -s -Tlj4 foo.1 > prn + + Printing the documents produced by Groff is possible either by + redirecting Groff's stdandard output to the local printer + device, like shown above, or by using the `-l' switch to Groff. + The latter possibility causes Groff to pipe its output to a + program whose name and arguments appear in the files named + `DESC' in each of the `devFOO' subdirectories of the + %DJDIR%/share/groff/font directory; for example, the file + devps/DESC is used by "groff -Tps". The relevant line in these + files begins with the word "print". + + As configured, when invoked with the `-l' switch, Groff will + call `cat' (from GNU Textutils) to pipe its output to the + default printer device for -Tps, -Tlbp and -Tlj4 options, and + it will call `dvilj4' (from the dvljNNNb.zip package) for -Tdvi + option. If you don't have these programs installed, you can + edit the respective `DESC' files to replace these commands with + something else. The replacement program must be able to read + its standard input and send its output to whatever printer you + want. The "print" entry is assumed to be a shell command, so + it can use redirection, pipes, and other shell features. + + Beginning with version 1.15, Groff can create HTML output, like + this: + + groff -man -s -Thtml foo.1 > foo.html + + Producing HTML files sometimes requires Ghostscript to be + installed, and, for gif images, ppmquant and ppmtogif as well. + If you do not have these programs installed, Groff will print + an error message, and the produced file will have links which + will fail to resolve when you view it with a Web browser. + + 6. Some programs in the package are supplied as Unix shell + scripts. While it is relatively easy to write a DOS batch file + which will do the same, DOS doesn't allow to redirect input and + output of a batch file. Since Groff tools are meant to be + invoked in a pipe, the batch files are not very useful. The + batch files are included in the binary distribution + nonetheless. + + These scripts need the following utilities to run (in addition + to the Groff programs they invoke): + + - bash + - gawk + - egrep + - sed + + The `afmtodit' and `mmroff' utilities are Perl scripts, so you + will need a Perl port to run them. + + All of these ports should be available from the DJGPP sites. + + If you need to run these scripts and batch files, you have to + install the port of bash (or another Unix-like shell) and the + above-mentioned utilities called by the script. Alternatively, + just look inside the shell script and invoke the programs it + calls manually. + + To run the scripts with redirection, invoke them via the shell, + like this: "sh mmroff > foo". + + 7. Note that Groff programs use floating point, so you will need + an FP emulator if your machine doesn't have an FPU. The binary + distribution includes the emulator, in case you don't have the + DJGPP development environment installed. Please refer to the + DJGPP FAQ list in case you have any problems with the emulator. + + 8. The package does not include the directories under + share/groff/font whose names begin with "devX": these are + needed on X-Windows for running the gxditview program, which is + not supported by this port. + + 9. Due to 8+3 limitations of DOS filesystems, several files were + renamed: + + - tmac.mandoc was renamed to tmac.mndoc; you will need to say + "groff -m mndoc" instead of "groff -m mandoc". "groff -mandoc" + still works as usual. + + - tmac.tty-char was renamed to tmac.ttchar. All the files in + the distribution that referenced tmac.tty-char were edited + to refer to the new name. + + - tmac.doc.old was renamed to tmac.old-doc. Use -mold-doc + instead of -mdoc.old switch. The `grog' utility was + changed to suggest the -mold-doc switch instead of + -mdoc.old. + + - dingbatsmap and dingbatsrmap were renamed to dingbats.map + and dingbats.rmap, respectively. The Makefile in the + font/devps/generate directory was modified accordingly. + + - groff_mdoc.samples.7 was renamed to groff-mdoc_samples.7, + groff_msafer.7 to groff-msafer.7, and groff_mmse.7 to + groff-mmse.7. The latter was also converted from Latin-1 + encoding to codepage 437. + + + +II. Building Groff from sources + --------------------------- + + 1. To build Groff, you will need the following tools (the file + name in parentheses is what you need to download from one of + the DJGPP sites): + + - Standard DJGPP development environment (djdev203.zip) + - GNU C compiler (gcc2721b.zip) + - GNU C++ compiler (gpp2721b.zip) + - GNU Make 3.79 (mak379b.zip) + - Bash v2.03 (bsh203b.zip) + - Fileutils 3.16 (fil316b.zip) + - Textutils 2.0 (txt20b.zip) + - Sh-utils 1.12 (shl112b.zip) + - Sed 3.02 (sed302b.zip) + - Gawk 3.04 (gwk304b.zip) + - Grep 2.4 (grep24b.zip) + - Bison (only if you change one of the *.y files) + + Note that you don't need to install libg++ (lgpNNNb.zip) since + Groff doesn't use any C++ classes except its own. + + Any versions of the utilities later than what's mentioned above + should also do; in particular, GCC 2.95.2 was tested and Groff + built okay with it. Versions older than in the above list + might also work, but I don't guarantee that; you are on your + own. + + Special considerations apply if you have GCC 2.8.1 installed, + and cannot upgrade to a later version. See paragraph 4 below. + + After you install these tools, make sure you have a ``symlink'' + to bash.exe called sh.exe and a ``symlink'' to gawk.exe called + awk.exe. If not, go to the DJGPP bin/ subdirectory and type + the following words of wisdom from the DOS prompt: + + ln -s bash.exe sh.exe + ln -s gawk.exe awk.exe + + (`ln' is part of GNU Fileutils, see above.) + + 2. Unzip the source distribution groXYZs.zip (where XYZ is the + version number) preserving the directory structure (-d switch + to PKUNZIP) from the main DJGPP installation directory. (If + you are building Groff on Windows 9X or Windows 2000, use an + unzip program which supports long filenames.) This creates + directory gnu/groff-X.YZ and unzips the sources there. + + If you are building from the official GNU distribution, unpack + the .tar.gz archive like this: + + djtar -x groff-X.YZ.tar.gz + + (DJTAR is part of the standard DJGPP development distribution.) + + 3. Groff sources on DJGPP sites are already configured for the + current version of DJGPP. If that is the version you have, + then you can just chdir to gnu/groff-X.YZ and say "make" to + build the entire package (if you have GCC 2.8.1, see the next + paragraph). + + If you have version of DJGPP other than the current one, or if + you build the official GNU distribution, or if you prefer to + configure the package so that it defaults to the directory + structure on your machine, or need to change some options + (e.g., compile with different optimization options), you will + have to reconfigure Groff. To this end, use the CONFIG.BAT + batch file in the DJGPP subdirectory: + + arch\djgpp\config + + You can configure and build Groff from outside its source + directory. In that case, you need to pass the full path to the + source directory as an argument to CONFIG.BAT, like this: + + d:\gnu\groff-1.16\arch\djgpp\config d:/gnu/groff-1.16 + + Note that you MUST use forward slashes in the path you pass to + CONFIG.BAT, or else it may fail. (For versions of Groff other + than 1.16, change the above command accordingly.) + + 4. If your version of GCC is 2.8.1, you cannot build the + preconfigured package without some tinkering. The DJGPP port + of GCC 2.8.1 had a bug in its C++ configuration, whereby the + file _G_config.h erroneously indicated that the header + is available, and also undefined the symbol + NULL. This causes several files in the Groff distribution to + fail to compile. + + The easiest way to solve this is to upgrade to a later version + of GCC; then you can simply say "make" to build the + preconfigured package. If this is not an option, you will have + to edit the file lang/cxx/_G_config.h and change this line: + + #define _G_HAVE_SYS_SOCKET 1 + + to say this instead: + + #define _G_HAVE_SYS_SOCKET 0 + + The problem with redefining NULL should not happen with DJGPP + v2.03 or later. But if you still see compilation errors which + say "`NULL' undeclared", comment out the line in _G_config.h + that says this: + + #undef NULL + + Alternatively, you can reconfigure the package as described in + the previous paragraph, before building it. + + 5. After the configure script exits, say "make" to build Groff. + Groff is a large package, and it might take a few minutes to + build, depending on your CPU, so you might as well go for a + coffee while it grinds away. + + 6. Test the package that you have built. A batch file T-GROFF.BAT + in the DJGPP subdirectory is supplied for that purpose. Most + of the commands there are commented out, since I cannot + possibly know what kind of printer do you have and which + additional programs, such as Less, do you have installed. The + only command that runs by default will format a large document + and print it to the screen. Read the comments in the batch + file, uncomment additional lines as you see fit and run the + batch file to see that you get the document printed as you'd + expect. (Btw, the document that the batch file prints is an + introduction to the entire Groff package, so you might as well + read it to make yourself familiar with the programs.) + + Note that the batch file sets a lot of environment variables; + if you get ``Out of environment space'' messages, launch a + subsidiary COMMAND.COM with plenty of environment space, like + so: + + command.com /e:3000 + + then invoke T-GROFF.BAT from that COMMAND.COM. + + 7. Install the package by typing "make install". This will copy + all the binaries, the auxiliary files (fonts, macros, etc.) and + the docs into their places. If you configured the package for + your system, these are precisely the directories where the + files should remain (with the exception of the man pages, see + below). If you use the default configuration, the files will + be installed under the top DJGPP installation directory. + + Alternatively, you could instruct Make explicitly where to + install the package by setting the `prefix' variable. For + example: + + make install prefix=c:/groff + + "make install" doesn't format the man pages, it just copies + them into subdirectories of the %DJDIR%\MAN directory. If you + need to keep formatted pages in your man/ subdirectory, you + will need to format them. Use the commands shown in chapter I, + section 5 above to do that, and redirect its output to the + appropriate catN subdirectory. Alternatively, you could format + the pages when you need to view them (the DJGPP clone of `man' + will automatically format them). + + Consult the installation instructions for pre-compiled binaries + above, for more info about installing and using Groff. + + 8. You can safely delete the directories under share/groff/font + whose names begin with "devX": these are needed on X-Windows + which is not supported by this port. diff -aruN groff-1.16/arch/djgpp/config.bat groff-1.16.1/arch/djgpp/config.bat --- groff-1.16/arch/djgpp/config.bat Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/arch/djgpp/config.bat Sun Jun 18 12:18:19 2000 @@ -0,0 +1,95 @@ +@echo off +echo Configuring GNU Groff for DJGPP v2.x... + +Rem The SmallEnv tests protect against fixed and too small size +Rem of the environment in stock DOS shell. + +Rem Find out where the sources are +set XSRC=. +if not "%XSRC%" == "." goto SmallEnv +if "%1" == "" goto InPlace +set XSRC=%1 +if not "%XSRC%" == "%1" goto SmallEnv +redir -e /dev/null update %XSRC%/configure.orig ./configure +if not exist configure update %XSRC%/configure ./configure + +:InPlace +Rem Update configuration files +echo Updating configuration scripts... +if not exist configure.orig update configure configure.orig +sed -f %XSRC%/arch/djgpp/config.sed configure.orig > configure +if errorlevel 1 goto SedError + +Rem Make sure they have a config.site file +set CONFIG_SITE=%XSRC%/arch/djgpp/config.site +if not "%CONFIG_SITE%" == "%XSRC%/arch/djgpp/config.site" goto SmallEnv + +Rem This is required because DOS/Windows are case-insensitive +Rem to file names, and "make install" will do nothing if Make +Rem finds a file called `install'. +if exist INSTALL ren INSTALL INSTALL.txt + +Rem Set HOSTNAME so it shows in config.status +if not "%HOSTNAME%" == "" goto hostdone +if "%windir%" == "" goto msdos +set OS=MS-Windows +if not "%OS%" == "MS-Windows" goto SmallEnv +goto haveos +:msdos +set OS=MS-DOS +if not "%OS%" == "MS-DOS" goto SmallEnv +:haveos +if not "%USERNAME%" == "" goto haveuname +if not "%USER%" == "" goto haveuser +echo No USERNAME and no USER found in the environment, using default values +set HOSTNAME=Unknown PC +if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv +:haveuser +set HOSTNAME=%USER%'s PC +if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv +goto userdone +:haveuname +set HOSTNAME=%USERNAME%'s PC +if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv +:userdone +set _HOSTNAME=%HOSTNAME%, %OS% +if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv +set HOSTNAME=%_HOSTNAME% +:hostdone +set _HOSTNAME= +set OS= + +Rem install-sh is required by the configure script but clashes with the +Rem various Makefile install-foo targets, so we MUST have it before the +Rem script runs and rename it afterwards +test -f install-sh +if not errorlevel 1 goto noren1 +test -f install-sh.sh +if not errorlevel 1 mv -f install-sh.sh install-sh +:noren1 +echo Running the ./configure script... +sh ./configure --src=%XSRC% --disable-nls --without-x +if errorlevel 1 goto CfgError +test -f install-sh.sh +if not errorlevel 1 goto noren2 +test -f install-sh +if not errorlevel 1 mv -f install-sh install-sh.sh +:noren2 +echo Done. +goto End + +:SedError +echo ./configure script editing failed! +goto End + +:CfgError +echo ./configure script exited abnormally! +goto End + +:SmallEnv +echo Your environment size is too small. Enlarge it and run me again. +echo Configuration NOT done! +:End +set XSRC= +set CONFIG_SITE= +set HOSTNAME= diff -aruN groff-1.16/arch/djgpp/config.sed groff-1.16.1/arch/djgpp/config.sed --- groff-1.16/arch/djgpp/config.sed Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/arch/djgpp/config.sed Sun Jun 18 12:03:56 2000 @@ -0,0 +1,16 @@ +# Additional editing of Makefiles and atconfig +/ac_given_INSTALL=/,/^CEOF/ { + /^s%@g@%/a\ + /path=/s,:,;,g +} + +# DOS-style absolute file names should be supported as well +/\*) srcdir=/s,/\*,[\\\\/]* | [A-z]:[\\\\/]*, +/\$]\*) INSTALL=/s,\[/\$\]\*,[\\\\/$]* | [A-z]:[\\\\/]*, + +# Who said each line has only \012 at its end? +/DEFS=`sed -f/s,'\\012','\\012\\015', + +# Switch the order of the two Sed commands, since DOS path names +# could include a colon +/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1, diff -aruN groff-1.16/arch/djgpp/config.site groff-1.16.1/arch/djgpp/config.site --- groff-1.16/arch/djgpp/config.site Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/arch/djgpp/config.site Sun Jun 18 12:03:56 2000 @@ -0,0 +1,33 @@ +#! /bin/sh + +# This is the config.site file for configuring GNU packages +# which are to be built with DJGPP tools. + +# These two variables are required, otherwise looking for +# programs along the PATH will not work. +PATH_SEPARATOR=: +PATH_EXPAND=y + +# This is required in for "test -f foo" to find foo.exe +export TEST_FINDS_EXE=y + +# The root of the DJGPP tree serves as the default prefix +test "x$prefix" = xNONE && prefix='/dev/env/DJDIR' + +# This is required for config.status script to be run, since +# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh} +CONFIG_SHELL=${CONFIG_SHELL='sh'} + +# These are set here so the generated Makefile's will be good +# for every DJGPP installation, not only the one where the +# package was configured. +# $INSTALL must be an absolute path name, otherwise config.status +# will try to prepend ./ and ../ to it when it goes into subdirs. +INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'} +RANLIB=${RANLIB='ranlib'} +LPR=${LPR='cat >>PRN'} +DVIPRINT=${DVIPRINT='dvilj4 - >>PRN'} +PERLPATH=${PERLPATH='/usr/bin/perl'} + +# Force `cp' to be used instead of "ln -s". +ac_cv_prog_LN_S="cp -p" diff -aruN groff-1.16/arch/djgpp/t-groff.bat groff-1.16.1/arch/djgpp/t-groff.bat --- groff-1.16/arch/djgpp/t-groff.bat Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/arch/djgpp/t-groff.bat Sun Jun 18 12:18:19 2000 @@ -0,0 +1,64 @@ +@echo off +Rem This script runs groff without requiring that it be installed. +Rem The current directory must be the build directory. + +test -d ./src/roff/groff +if not errorlevel 1 goto dirOk +echo this batch file must be run with the build directory as the current directory +goto end +:dirOk +test -x ./src/roff/groff/groff +if not errorlevel 1 goto groffOk +echo this batch file must be run with the build directory as the current directory +goto end +:groffOk +Rem chdir to src, to avoid overflowing the DOS limits with a long PATH. +cd src +set GROFF_FONT_PATH=..;../font +set GROFF_TMAC_PATH=../tmac;./roff/troff +set PATH1=%PATH% +set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grotty;%PATH1% +Rem +echo I will use this command to format a document and print it on the screen: +roff\groff\groff -V -e -s -t -p -R -m ttchar -me -Tascii ../doc/meintro.me +pause +Rem Make the following command pipe to Less if you have Less installed: +roff\groff\groff -e -s -t -p -R -m ttchar -me -Tascii ../doc/meintro.me +Rem +set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grops;%PATH1% +echo I will use this command to format a document and print it on PS printer: +roff\groff\groff -V -e -s -t -p -R -me -Tps ../doc/meintro.me +pause +Rem Uncomment the following command if you have a PostScript printer: +REM roff\groff\groff -e -s -t -p -R -me -Tps ../doc/meintro.me >>prn +Rem +set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grolj4;%PATH1% +echo I will use this command to format a document and print it on LJ4 printer: +roff\groff\groff -V -e -s -t -p -R -me -Tlj4 ../doc/meintro.me +pause +Rem Uncomment the following command if you have a LaserJet4 printer: +REM roff\groff\groff -e -s -t -p -R -me -Tlj4 ../doc/meintro.me >>prn +Rem +set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grodvi;%PATH1% +echo I will use this command to format a document into a DVI format: +roff\groff\groff -V -e -s -t -p -R -me -Tdvi ../doc/meintro.me +pause +roff\groff\groff -e -s -t -p -R -me -Tdvi ../doc/meintro.me > meintro.dvi +set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grohtml;%PATH1% +echo I will use this command to format a document into HTML format: +roff\groff\groff -V -e -s -t -p -R -me -Thtml ../doc/meintro.me +pause +roff\groff\groff -e -s -t -p -R -me -Thtml ../doc/meintro.me > meintro.html +set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grolbp;%PATH1% +echo I will use this command to format a document and print it on an LBP printer: +roff\groff\groff -V -e -s -t -p -R -me -Tlbp ../doc/meintro.me +pause +Rem Uncomment the following if you have a Canon CAPSL LBP-4 or LBP-8 printer: +REM roff\groff\groff -e -s -t -p -R -me -Tlbp ../doc/meintro.me >>prn +Rem +set PATH=%PATH1% +set GROFF_FONT_PATH= +set GROFF_TMAC_PATH= +set PATH1= +cd .. +:exit diff -aruN groff-1.16/configure groff-1.16.1/configure --- groff-1.16/configure Tue May 2 02:39:37 2000 +++ groff-1.16.1/configure Sun Jun 11 08:27:26 2000 @@ -1473,21 +1473,22 @@ fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in unistd.h dirent.h limits.h sys/dir.h stdlib.h strings.h +for ac_hdr in stdlib.h unistd.h dirent.h limits.h sys/dir.h \ + string.h strings.h math.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1481: checking for $ac_hdr" >&5 +echo "configure:1482: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1514,7 +1515,7 @@ done echo $ac_n "checking for ISC 3.x or 4.x""... $ac_c" 1>&6 -echo "configure:1518: checking for ISC 3.x or 4.x" >&5 +echo "configure:1519: checking for ISC 3.x or 4.x" >&5 if grep '[34]\.' /usr/options/cb.name >/dev/null 2>&1 then echo "$ac_t""yes" 1>&6 @@ -1526,7 +1527,7 @@ echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether -D_POSIX_SOURCE is necessary""... $ac_c" 1>&6 -echo "configure:1530: checking whether -D_POSIX_SOURCE is necessary" >&5 +echo "configure:1531: checking whether -D_POSIX_SOURCE is necessary" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1536,7 +1537,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < extern "C" { void fileno(int); } @@ -1544,7 +1545,7 @@ ; return 0; } EOF -if { (eval echo configure:1548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 @@ -1572,28 +1573,28 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of putenv""... $ac_c" 1>&6 -echo "configure:1577: checking declaration of putenv" >&5 +echo $ac_n "checking for return type of srand""... $ac_c" 1>&6 +echo "configure:1578: checking for return type of srand" >&5 cat > conftest.$ac_ext < -extern "C" { void putenv(int); } +extern "C" { void srand(unsigned int); } int main() { ; return 0; } EOF -if { (eval echo configure:1587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + echo "$ac_t""void" 1>&6;cat >> confdefs.h <<\EOF +#define RET_TYPE_SRAND_IS_VOID 1 +EOF + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define STDLIB_H_DECLARES_PUTENV 1 -EOF - + echo "$ac_t""int" 1>&6 fi rm -f conftest* ac_ext=c @@ -1603,6 +1604,8 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether hypot must be declared""... $ac_c" 1>&6 +echo "configure:1609: checking whether hypot must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1611,30 +1614,53 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of popen""... $ac_c" 1>&6 -echo "configure:1616: checking declaration of popen" >&5 -cat > conftest.$ac_ext <&6 +else + cat > conftest.$ac_ext < -extern "C" { void popen(int); } +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif int main() { - +char *(*pfn) = (char *(*)) hypot ; return 0; } EOF -if { (eval echo configure:1626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + groff_cv_decl_needed_hypot=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define STDIO_H_DECLARES_POPEN 1 + groff_cv_decl_needed_hypot=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_hypot" 1>&6 +if test $groff_cv_decl_needed_hypot = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_HYPOT 1 EOF fi -rm -f conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1642,6 +1668,8 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether popen must be declared""... $ac_c" 1>&6 +echo "configure:1673: checking whether popen must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1650,30 +1678,117 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of pclose""... $ac_c" 1>&6 -echo "configure:1655: checking declaration of pclose" >&5 -cat > conftest.$ac_ext <&6 +else + cat > conftest.$ac_ext < -extern "C" { void pclose(int); } +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif int main() { - +char *(*pfn) = (char *(*)) popen ; return 0; } EOF -if { (eval echo configure:1665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + groff_cv_decl_needed_popen=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define STDIO_H_DECLARES_PCLOSE 1 + groff_cv_decl_needed_popen=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_popen" 1>&6 +if test $groff_cv_decl_needed_popen = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_POPEN 1 EOF fi +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether pclose must be declared""... $ac_c" 1>&6 +echo "configure:1737: checking whether pclose must be declared" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +if eval "test \"`echo '$''{'groff_cv_decl_needed_pclose'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) pclose +; return 0; } +EOF +if { (eval echo configure:1774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + groff_cv_decl_needed_pclose=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + groff_cv_decl_needed_pclose=yes +fi rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_pclose" 1>&6 +if test $groff_cv_decl_needed_pclose = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_PCLOSE 1 +EOF + +fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1681,6 +1796,8 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether putenv must be declared""... $ac_c" 1>&6 +echo "configure:1801: checking whether putenv must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1689,30 +1806,117 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking for sys_nerr in or ""... $ac_c" 1>&6 -echo "configure:1694: checking for sys_nerr in or " >&5 -cat > conftest.$ac_ext <&6 +else + cat > conftest.$ac_ext < + #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif int main() { -int k; k = sys_nerr; +char *(*pfn) = (char *(*)) putenv ; return 0; } EOF -if { (eval echo configure:1704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define HAVE_SYS_NERR 1 + groff_cv_decl_needed_putenv=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + groff_cv_decl_needed_putenv=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_putenv" 1>&6 +if test $groff_cv_decl_needed_putenv = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_PUTENV 1 EOF +fi +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether strncasecmp must be declared""... $ac_c" 1>&6 +echo "configure:1865: checking whether strncasecmp must be declared" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +if eval "test \"`echo '$''{'groff_cv_decl_needed_strncasecmp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) strncasecmp +; return 0; } +EOF +if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + groff_cv_decl_needed_strncasecmp=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""no" 1>&6 + groff_cv_decl_needed_strncasecmp=yes fi rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_strncasecmp" 1>&6 +if test $groff_cv_decl_needed_strncasecmp = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_STRNCASECMP 1 +EOF + +fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1728,21 +1932,21 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking for sys_errlist in or ""... $ac_c" 1>&6 -echo "configure:1733: checking for sys_errlist in or " >&5 +echo $ac_n "checking for sys_nerr in or ""... $ac_c" 1>&6 +echo "configure:1937: checking for sys_nerr in or " >&5 cat > conftest.$ac_ext < #include int main() { -int k; k = (int)sys_errlist[0]; +int k; k = sys_nerr; ; return 0; } EOF -if { (eval echo configure:1743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define HAVE_SYS_ERRLIST 1 +#define HAVE_SYS_NERR 1 EOF else @@ -1767,28 +1971,28 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of hypot""... $ac_c" 1>&6 -echo "configure:1772: checking declaration of hypot" >&5 +echo $ac_n "checking for sys_errlist in or ""... $ac_c" 1>&6 +echo "configure:1976: checking for sys_errlist in or " >&5 cat > conftest.$ac_ext < -extern "C" { double hypot(double,double); } +#include +#include int main() { - +int k; k = (int)sys_errlist[0]; ; return 0; } EOF -if { (eval echo configure:1782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF +#define HAVE_SYS_ERRLIST 1 +EOF + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define MATH_H_DECLARES_HYPOT 1 -EOF - + echo "$ac_t""no" 1>&6 fi rm -f conftest* ac_ext=c @@ -1807,16 +2011,16 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking C++ ""... $ac_c" 1>&6 -echo "configure:1811: checking C++ " >&5 +echo "configure:2015: checking C++ " >&5 cat > conftest.$ac_ext < int main() { read(0, 0, 0); open(0, 0); ; return 0; } EOF -if { (eval echo configure:1820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define HAVE_CC_OSFCN_H 1 @@ -1845,16 +2049,16 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking C++ ""... $ac_c" 1>&6 -echo "configure:1849: checking C++ " >&5 +echo "configure:2053: checking C++ " >&5 cat > conftest.$ac_ext < int main() { int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX; ; return 0; } EOF -if { (eval echo configure:1858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define HAVE_CC_LIMITS_H 1 @@ -1883,16 +2087,16 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for declaration of time_t""... $ac_c" 1>&6 -echo "configure:1887: checking for declaration of time_t" >&5 +echo "configure:2091: checking for declaration of time_t" >&5 cat > conftest.$ac_ext < int main() { time_t t = time(0); struct tm *p = localtime(&t); ; return 0; } EOF -if { (eval echo configure:1896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1913,12 +2117,12 @@ cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1917: checking return type of signal handlers" >&5 +echo "configure:2121: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1935,7 +2139,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:1939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1954,16 +2158,16 @@ echo $ac_n "checking struct exception""... $ac_c" 1>&6 -echo "configure:1958: checking struct exception" >&5 +echo "configure:2162: checking struct exception" >&5 cat > conftest.$ac_ext < int main() { struct exception e; ; return 0; } EOF -if { (eval echo configure:1967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define HAVE_STRUCT_EXCEPTION 1 @@ -1977,7 +2181,7 @@ fi rm -f conftest* echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:1981: checking for sin in -lm" >&5 +echo "configure:2185: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1985,7 +2189,7 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2021,17 +2225,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2025: checking for $ac_hdr" >&5 +echo "configure:2229: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2060,12 +2264,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2064: checking for $ac_func" >&5 +echo "configure:2268: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2113,7 +2317,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2117: checking for working mmap" >&5 +echo "configure:2321: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2121,7 +2325,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2288,12 +2492,12 @@ for ac_func in fmod strtol getcwd strerror putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2292: checking for $ac_func" >&5 +echo "configure:2496: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2343,15 +2547,15 @@ LIBS="$saved_libs" -for ac_func in rename mkstemp strcasecmp strsep strdup +for ac_func in rename mkstemp strcasecmp strncasecmp strsep strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2350: checking for $ac_func" >&5 +echo "configure:2554: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2399,12 +2603,12 @@ done echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2403: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:2607: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2416,7 +2620,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -2445,16 +2649,16 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether ANSI array delete syntax supported""... $ac_c" 1>&6 -echo "configure:2449: checking whether ANSI array delete syntax supported" >&5 +echo "configure:2653: checking whether ANSI array delete syntax supported" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2483,16 +2687,16 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking traditional preprocessor""... $ac_c" 1>&6 -echo "configure:2487: checking traditional preprocessor" >&5 +echo "configure:2691: checking traditional preprocessor" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define TRADITIONAL_CPP 1 @@ -2513,12 +2717,12 @@ cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking w_coredump""... $ac_c" 1>&6 -echo "configure:2517: checking w_coredump" >&5 +echo "configure:2721: checking w_coredump" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""no" 1>&6 else cat > conftest.$ac_ext < #include @@ -2533,7 +2737,7 @@ #endif } EOF -if { (eval echo configure:2537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define WCOREFLAG 0200 @@ -2549,12 +2753,12 @@ fi echo $ac_n "checking default value for grops -b option""... $ac_c" 1>&6 -echo "configure:2553: checking default value for grops -b option" >&5 +echo "configure:2757: checking default value for grops -b option" >&5 test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=7 echo "$ac_t""$BROKEN_SPOOLER_FLAGS" 1>&6 echo $ac_n "checking default paper size""... $ac_c" 1>&6 -echo "configure:2558: checking default paper size" >&5 +echo "configure:2762: checking default paper size" >&5 if test -z "$PAGE"; then descfile= if test -r $prefix/share/groff/font/devps/DESC; then @@ -2589,7 +2793,7 @@ echo "$ac_t""$PAGE" 1>&6 echo $ac_n "checking for existing troff installation""... $ac_c" 1>&6 -echo "configure:2593: checking for existing troff installation" >&5 +echo "configure:2797: checking for existing troff installation" >&5 if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" = x0; then echo "$ac_t""yes" 1>&6 g=g @@ -2599,7 +2803,7 @@ fi echo $ac_n "checking for prefix of system macro packages""... $ac_c" 1>&6 -echo "configure:2603: checking for prefix of system macro packages" >&5 +echo "configure:2807: checking for prefix of system macro packages" >&5 sys_tmac_prefix= sys_tmac_file_prefix= for d in /usr/share/lib/tmac /usr/lib/tmac; do @@ -2619,7 +2823,7 @@ tmac_wrap= echo $ac_n "checking which system macro packages should be made available""... $ac_c" 1>&6 -echo "configure:2623: checking which system macro packages should be made available" >&5 +echo "configure:2827: checking which system macro packages should be made available" >&5 if test "x$sys_tmac_file_prefix" = "xtmac."; then for f in $sys_tmac_prefix*; do suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` diff -aruN groff-1.16/configure.in groff-1.16.1/configure.in --- groff-1.16/configure.in Sat Apr 29 08:02:24 2000 +++ groff-1.16.1/configure.in Sun Jun 11 08:27:26 2000 @@ -18,15 +18,18 @@ GROFF_CSH_HACK(SH_SCRIPT_SED_CMD='1s/.*/:/', SH_SCRIPT_SED_CMD='') AC_SUBST(SH_SCRIPT_SED_CMD) dnl checks for headers -AC_CHECK_HEADERS(unistd.h dirent.h limits.h sys/dir.h stdlib.h strings.h) +AC_CHECK_HEADERS(stdlib.h unistd.h dirent.h limits.h sys/dir.h \ + string.h strings.h math.h) GROFF_ISC_SYSV3 GROFF_POSIX -GROFF_PUTENV -GROFF_POPEN -GROFF_PCLOSE +GROFF_SRAND +GROFF_NEED_DECLARATION(hypot) +GROFF_NEED_DECLARATION(popen) +GROFF_NEED_DECLARATION(pclose) +GROFF_NEED_DECLARATION(putenv) +GROFF_NEED_DECLARATION(strncasecmp) GROFF_SYS_NERR GROFF_SYS_ERRLIST -GROFF_HYPOT GROFF_OSFCN_H GROFF_LIMITS_H dnl checks for typedefs @@ -41,7 +44,7 @@ LIBS="$LIBS -lc $LIBM" AC_REPLACE_FUNCS(fmod strtol getcwd strerror putenv) LIBS="$saved_libs" -AC_CHECK_FUNCS(rename mkstemp strcasecmp strsep strdup) +AC_CHECK_FUNCS(rename mkstemp strcasecmp strncasecmp strsep strdup) AC_DECL_SYS_SIGLIST dnl checks for compiler characteristics GROFF_ARRAY_DELETE diff -aruN groff-1.16/contrib/mm/ChangeLog groff-1.16.1/contrib/mm/ChangeLog --- groff-1.16/contrib/mm/ChangeLog Mon Feb 21 21:32:58 2000 +++ groff-1.16.1/contrib/mm/ChangeLog Sun Jun 18 12:08:06 2000 @@ -1,3 +1,12 @@ +Sat Jun 17 23:00:00 2000 Eli Zaretskii + + * Makefile.sim (.man.n): Replace `;' with `|', since DOS/Windows + path lists use the semicolon as a separator. + +Sun Jun 4 21:39:00 2000 Kaneda Hiroshi (vanitas at ma3.seikyou.ne.jp) + + * Fixing a lot of typos in groff_mm.man + Sun Jan 30 22:52:20 2000 Jörgen Hägg (jh at axis.com) * version 1.34 diff -aruN groff-1.16/contrib/mm/Makefile.sim groff-1.16.1/contrib/mm/Makefile.sim --- groff-1.16/contrib/mm/Makefile.sim Sun Feb 6 10:34:46 2000 +++ groff-1.16.1/contrib/mm/Makefile.sim Sun Jun 18 12:08:06 2000 @@ -1,5 +1,5 @@ # -# $Id: Makefile.sim,v 1.1.1.1 2000/02/06 09:34:46 wlemb Exp $ +# $Id: Makefile.sim,v 1.2 2000/06/18 10:08:06 wlemb Exp $ # # To install mgm separately as tmac.gm: # make -f Makefile.sub tmacdir=/usr/local/lib/groff/tmac srcdir=. \ @@ -41,26 +41,26 @@ .man.n: @echo Making $@ from $< @-rm -f $@ - @sed -e "s;@HYPHENFILE@;$(hyphenfile);g" \ - -e "s;@FONTDIR@;$(fontdir);g" \ - -e "s;@FONTPATH@;$(fontpath);g" \ - -e "s;@MACRODIR@;$(tmacdir);g" \ - -e "s;@MACROPATH@;$(tmacpath);g" \ - -e "s;@DEVICE@;$(DEVICE);g" \ - -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \ - -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \ - -e "s;@INDEX_SUFFIX@;$(indexext);g" \ - -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \ - -e "s;@MAN1EXT@;$(man1ext);g" \ - -e "s;@MAN5EXT@;$(man5ext);g" \ - -e "s;@MAN7EXT@;$(man7ext);g" \ - -e "s;@TMAC_S@;$(tmac_s);g" \ - -e "s;@TMAC_M@;$(tmac_m);g" \ - -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \ - -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \ - -e "s;@VERSION@;$(version);g" \ - -e "s;@MDATE@;$(mdate);g" \ - -e "s;@g@;$(g);g" \ - -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \ + @sed -e "s|@HYPHENFILE@|$(hyphenfile)|g" \ + -e "s|@FONTDIR@|$(fontdir)|g" \ + -e "s|@FONTPATH@|$(fontpath)|g" \ + -e "s|@MACRODIR@|$(tmacdir)|g" \ + -e "s|@MACROPATH@|$(tmacpath)|g" \ + -e "s|@DEVICE@|$(DEVICE)|g" \ + -e "s|@DEFAULT_INDEX@|$(indexdir)/$(indexname)|g" \ + -e "s|@DEFAULT_INDEX_NAME@|$(indexname)|g" \ + -e "s|@INDEX_SUFFIX@|$(indexext)|g" \ + -e "s|@COMMON_WORDS_FILE@|$(common_words_file)|g" \ + -e "s|@MAN1EXT@|$(man1ext)|g" \ + -e "s|@MAN5EXT@|$(man5ext)|g" \ + -e "s|@MAN7EXT@|$(man7ext)|g" \ + -e "s|@TMAC_S@|$(tmac_s)|g" \ + -e "s|@TMAC_M@|$(tmac_m)|g" \ + -e "s|@TMAC_MDIR@|$(tmacdir)/mm|g" \ + -e "s|@BROKEN_SPOOLER_FLAGS@|$(BROKEN_SPOOLER_FLAGS)|g" \ + -e "s|@VERSION@|$(version)|g" \ + -e "s|@MDATE@|$(mdate)|g" \ + -e "s|@g@|$(g)|g" \ + -e "s!@G@;`echo $(g) | tr [a-z] [A-Z]`!g" \ $< >$@ diff -aruN groff-1.16/contrib/mm/groff_mm.man groff-1.16.1/contrib/mm/groff_mm.man --- groff-1.16/contrib/mm/groff_mm.man Mon Feb 21 21:32:58 2000 +++ groff-1.16.1/contrib/mm/groff_mm.man Sun Jun 4 23:47:19 2000 @@ -1,5 +1,5 @@ .\" -.\" $Id: groff_mm.man,v 1.2 2000/02/21 20:32:58 jhaegg Exp $ +.\" $Id: groff_mm.man,v 1.3 2000/06/04 21:47:19 wlemb Exp $ .\" .de T2 .ne 2v @@ -72,6 +72,7 @@ a double-quote. (Strings are used in the text as \fB\e*[YYY]\fP.) .sp \fBSpecial formatting of number registers\fP +.br A number register is printed with normal digits if no format has been given. Set the format with \fBaf\fP: @@ -119,7 +120,7 @@ .B "AF [name of firm]" Authors firm, should be called before \fBAU\fP, see also \fBCOVER\fP. .TP -.B "AL [type [text-indent [1]]]]" +.B "AL [type [text-indent [1]]]" Start autoincrement list. Items are numbered beginning on one. The \fItype\fP argument controls the type of numbers. .in +.5i @@ -186,8 +187,8 @@ .B "AU [name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]]" Author information, specifies the author of the memo or paper, and will be printed on the cover sheet and on other similar places. -\fBAU\fP must appear before \fBTL\fP. The author information -can contain intials, location, department, telephone extension, +\fBAU\fP must not appear before \fBTL\fP. The author information +can contain initials, location, department, telephone extension, room number or name and up to three extra arguments. .TP .B "AV [name [1]]" @@ -198,14 +199,14 @@ .B "AVL [name]" Letter signature, generates a line with place for signature. .TP -.B "B [bold-text [prev-font-tex [bold...]]]" -Begin boldface +.B "B [bold-text [prev-font-text [bold...]]]" +Begin boldface. No limit on the number of arguments. All arguments will be concatenated to one word, the first, third and so on will be printed in boldface. .TP .B B1 -Begin box (as the ms macro) +Begin box (as the ms macro). Draws a box around the text. The text will be indented one character, and the right margin will be one character shorter. .TP @@ -215,7 +216,7 @@ .B BE End bottom block, see \fBBS\fP. .TP -.B "BI [bold-text [italic-text [bold-text [...]]]" +.B "BI [bold-text [italic-text [bold-text [...]]]]" Bold-italic. No limit on the number of arguments, see \fBB\fP. .TP @@ -228,15 +229,15 @@ A third argument will prohibit printing of a blank line before each item. .TP -.B "BR [bold-text [roman-text [bold-text [...]]]" +.B "BR [bold-text [roman-text [bold-text [...]]]]" Bold-roman. No limit on the number of arguments. .TP .B BS -Bottom block start. Begins the definition of a text block wich is +Bottom block start. Begins the definition of a text block which is printed at the bottom of each page. Block ends with \fBBE\fP. .TP -.B BVL +.B "BVL text-indent [mark-indent [1]]" Start of broken variable-item list. Broken variable-item list has no fixed mark, it assumes that @@ -299,7 +300,7 @@ Displays are printed at the end of each section (when section-page numbering is active) or at the end of the document. .T2 1 -A new display will be printed on the current page is there is enough +A new display will be printed on the current page if there is enough space, otherwise it will be printed at the end of the document. .T2 2 One display will be printed at the top of each page or column @@ -322,8 +323,6 @@ after a dash. \fIText-indent\fP changes the default indentation of the list items set by number register \fBPi\fP. -A third argument will prohibit printing of a blank line before each -item. A second argument prevents the empty line between each list item to be printed. See \fBLI\fP. .TP @@ -460,7 +459,7 @@ List of Exhibits, default is \fILIST OF EXHIBITS\fP. The List of Exhibits will only be printed if number register \fBLx\fP is 1, default 1. -The string \fBLiex\fP contains the word \fIExhibit\fP, wich +The string \fBLiex\fP contains the word \fIExhibit\fP, which is printed before the number. If \fIrefname\fP is used, then the exhibit number is saved with \&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP. @@ -499,7 +498,7 @@ .sp .fi .DT -Argument greater than or equal to 11 is considered as arg 0. +Argument greater than 11 is considered as arg 0. Default for m@TMAC_M_PREFIX@m is 10. .TP .B FE @@ -534,13 +533,13 @@ .B "GETHN refname [varname]" Includes the headernumber where the corresponding \fBSETR\fP \fIrefname\fP was placed. Will be X.X.X. in pass 1. See \fBINITR\fP. -If varname is used, \fBGETHN\fP sets the stringvariable \fIvarname\fP to the +If \fIvarname\fP is used, \fBGETHN\fP sets the stringvariable \fIvarname\fP to the headernumber. .TP .B "GETPN refname [varname]" Includes the pagenumber where the corresponding \fBSETR\fP \fIrefname\fP was placed. Will be 9999 in pass 1. See \fBINITR\fP. -If varname is used, \fBGETPN\fP sets the stringvariable \fIvarname\fP +If \fIvarname\fP is used, \fBGETPN\fP sets the stringvariable \fIvarname\fP to the pagenumber. .TP .B "GETR refname" @@ -600,6 +599,7 @@ .br Indentation of the text after the heading is controlled by number register \fBHi\fP, default value 0. +.sp \fBHi\fP .in +.5i .T2 0 @@ -620,7 +620,7 @@ \fBFont control of the heading\fP .br The font of each heading level is controlled by string \fBHF\fP. -It contains a fontnumber or fontnam for each level. Default +It contains a fontnumber or fontname for each level. Default is \fB2\ 2\ 2\ 2\ 2\ 2\ 2\fP (all headings in italic). Could also be written as \fBI\ I\ I\ I\ I\ I\ I\fP. All omitted values are presumed to be a 1. @@ -641,7 +641,7 @@ the counter for each heading level. The values are printed using arabic numerals, this can be changed with the macro \fBHM\fP (see below). -All marks ar concatenated before printing. To avoid this, set +All marks are concatenated before printing. To avoid this, set number register \fBHt\fP to 1. That will only print the current heading counter at each heading. .sp @@ -693,6 +693,7 @@ might be used to change indentation. .sp \fBHZ\ \fP\fIdlevel\ rlevel\ heading-text\fP +.br \fBHZ\fP is called after the printing of the heading, just before \fBH\fP or \fBHU\fP exits. Could be used to change the page header according to the section heading. @@ -701,7 +702,7 @@ Set hyphenation character. Default value is \e%. Resets to the default if called without argument. -Hyphenation can be turned by setting number +Hyphenation can be turned off by setting number register \fBHy\fP to 0 in the beginning of the file. .TP .B "HM [arg1 [arg2 [... [arg7]]]]" @@ -747,7 +748,7 @@ Called just after printing the header. See \fBH\fP. .TP -.B "I [italic-text [prev-font-text [italic-text [...]]]" +.B "I [italic-text [prev-font-text [italic-text [...]]]]" Italic. Changes the font to italic if called without arguments. With one argument it will set the word in italic. @@ -755,15 +756,15 @@ word in italic and the second in the previous font. There is no limit on the number of argument, all will be concatenated. .TP -.B "IA [addressee-name [title]] +.B "IA [addressee-name [title]]" Begins specification of the addressee and addressee's address in letter style. Several names can be specified with empty \fBIA\fP/\fBIE\fP-pairs, but only one address. See \fBLT\fP. .TP -.B "IB [italic-text [bold-text [italic-text [...]]]" -Italic-bold +.B "IB [italic-text [bold-text [italic-text [...]]]]" +Italic-bold. Even arguments is printed in italic, odd in boldface. See \fBI\fP. .TP @@ -834,8 +835,8 @@ adding \fB-rIso=1\fP on the command line. Reverts to old date format if argument is \fB0\fP. .TP -.B "IR [italic-text [roman-text [italic-text [...]]]" -Italic-roman +.B "IR [italic-text [roman-text [italic-text [...]]]]" +Italic-roman. Even arguments is printed in italic, odd in roman. See \fBI\fP. .TP @@ -887,7 +888,7 @@ \fBLB\fP itself will print \fILB-space\fP blank lines. Default is 0. .TP .B "LC [list-level]" -List-status clear +List-status clear. Terminates all current active lists down to \fIlist-level\fP, or 0 if no argmuent is given. This is used by \fBH\fP to clear any active list. @@ -898,7 +899,7 @@ if an argument is given. .TP .B "LI [mark [1]]" -List item precedes every item in a list. Without argument \fBLS\fP +List item precedes every item in a list. Without argument \fBLI\fP will print the mark determined by the current list type. By giving \fBLI\fP one argument, it will use that as the mark instead. Two arguments to \fBLI\fP will make \fImark\fP a prefix to @@ -949,7 +950,7 @@ Style\fP .T2 BL Blocked. Date line, return address, writer's address and closing -begins at the center of the line. All other lines begins at the left margin. +begins at the center of the line. All other lines begin at the left margin. .T2 SB Semi-blocked. Same as blocked, except that the first line in every paragraph is indented five spaces. @@ -957,7 +958,7 @@ Full-blocked. All lines begin at the left margin. .T2 SP Simplified. Almost the same as the full-blocked style. Subject and -the writer'sidentification is printed in all-capital. +the writer's identification are printed in all-capital. .in .TP .B "LO type [arg]" @@ -965,8 +966,8 @@ This is a list of the standard options: .in +.5i .T2 CN -Confidential notation. Prints \fBRESTRICTED\fP on the second line -below the date line. Any argument replaces \fBRESTRICTED\fP. +Confidential notation. Prints \fBCONFIDENTIAL\fP on the second line +below the date line. Any argument replaces \fBCONFIDENTIAL\fP. See also string variable \fBLetCN\fP. .T2 RN Reference notation. Prints \fBIn reference to:\fP and the argument @@ -1005,7 +1006,7 @@ Memorandum type. The \fIarg\fP is part of a filename in \fI@TMAC_MDIR@/*.MT\fP. Memorandum type 0 thru 5 are supported, including \fI"string"\fP. -\fIAddresse\fP just sets a variable, used in the AT&T macros. +\fIAddressee\fP just sets a variable, used in the AT&T macros. .br \fBarg\fP .in +.5i @@ -1033,11 +1034,11 @@ .B "MULB cw1 space1 [cw2 space2 [cw3 ...]]" Begin a special multi-column mode. Every columns width must be specified. Also the space between the columns must be specified. The last column -does not need any space-definition. MULB starts a diversion and MULE +does not need any space-definition. \fBMULB\fP starts a diversion and \fBMULE\fP ends the diversion and prints the columns. -The unit for width and space is 'n', but MULB accepts all +The unit for width and space is 'n', but \fBMULB\fP accepts all normal unitspecifications like 'c' and 'i'. -MULB operates in a separate environment. +\fBMULB\fP operates in a separate environment. .TP .B "MULN" Begin the next column. This is the only way to switch column. @@ -1046,7 +1047,7 @@ End the multi-column mode and print the columns. .TP .B "nP [type]" -Print numbered paragraph with header level two. Se \fB.P\fP. +Print numbered paragraph with header level two. See \fB.P\fP. .TP .B "NCOL" Force printing to the next column, don't use this together with @@ -1148,8 +1149,8 @@ to change linelength, pagelength and pageoffset instead. Sorry.) .TP .B PGNH -No header is printed on the next page. Used to get rid off -the header in letters or other special texts +No header is printed on the next page. Used to get rid of +the header in letters or other special texts. This macro must be used before any text to inhibit the pageheader on the first page. .TP @@ -1190,7 +1191,7 @@ Roman. Return to roman font, see also \fBI\fP. .TP -.B "RB [roman-text [bold-text [roman-text [...]]]" +.B "RB [roman-text [bold-text [roman-text [...]]]]" Roman-bold. Even arguments is printed in roman, odd in boldface. See \fBI\fP. @@ -1207,16 +1208,16 @@ Reference end. Ends a reference definition and returns to normal processing. See \fBRS\fP. .TP -.B "RI [roman-text [italic-text [roman-text [...]]]" -Even arguments is printed in roman, odd in italic. +.B "RI [roman-text [italic-text [roman-text [...]]]]" +Even arguments are printed in roman, odd in italic. See \fBI\fP. .TP .B "RL [text-indent [1]]" -Reference list start +Reference list start. Begins a list where each item is preceded with a automatically incremented number between square brackets. -\fIText-indent\fP changes the default indentation +\fIText-indent\fP changes the default indentation. .TP .B "RP [arg1 [arg2]]" Produce reference page. @@ -1224,7 +1225,7 @@ document. It is not needed if \fBTC\fP is used to produce a table of content. The reference page will then be printed automatically. .sp -The reference counter will not be resetted if \fIarg1\fP is 1. +The reference counter will not be reset if \fIarg1\fP is 1. .sp \fIArg2\fP tells \fBRP\fP whether to eject a page or not. .br @@ -1271,7 +1272,7 @@ justification. .TP .B "SETR refname [string]" -Remember the current header and page-number as refname. +Remember the current header and page-number as \fIrefname\fP. Saves \fIstring\fP if \fIstring\fP is defined. \fIstring\fP is retrieved with \fB.GETST\fP. See \fBINITR\fP. @@ -1281,10 +1282,11 @@ The argument will be appended to the reference data, printed at either the first or last author. The reference data is the location, department and initials specified with \fB.AU\fP. -It will be printed at the first author, otherwise at the last. +It will be printed at the first author if the second argument is given, +otherwise at the last. No reference data will be printed if the author(s) is specifed thru \fB.WA\fP/\fB.WE\fP. -See \fBLetter internals\fP. +See \fBINTERNALS\fP. .TP .B "SK [pages]" Skip pages. @@ -1354,7 +1356,7 @@ in each level. .sp All texts can be redefined, new stringvariables -\fILifg\fP, \fILitb\fP, \fILiex\fP, \fILiec\fP and \fILicon\fP contains +\fILifg\fP, \fILitb\fP, \fILiex\fP, \fILiec\fP and \fILicon\fP contain "Figure", "TABLE", "Exhibit", "Equation" and "CONTENTS". These can be redefined to other languages. .TP @@ -1367,10 +1369,10 @@ be printed again if a page-break occurs. Argument \fIN\fP isn't implemented yet. .TP -.B TL [charging-case number(s) [filing-case number(s)] +.B TL [charging-case number(s) [filing-case number(s)]] Begin title of memorandum. All text up to the next \fBAU\fP is included in the title. -\fICharging-case number\fP and \fIfiling-case\fP is saved +\fICharging-case number\fP and \fIfiling-case\fP are saved for use in the front page processing. .TP .B TM [num1 [num2 [...]]] @@ -1408,7 +1410,7 @@ The pointsize can be changed with the second argument. By specifying the font-argument it is possible to use another font instead of courier. -\fIflag\fP control several special features. +\fIflag\fP controls several special features. It contains the sum of all wanted features. .in +.5i .T2 Value @@ -1417,9 +1419,9 @@ Disable the escape-character (\e). This is normally turned on during verbose output. .T2 2 -Add en empty line before the verbose text. +Add an empty line before the verbose text. .T2 4 -Add en empty line after the verbose text. +Add an empty line after the verbose text. .T2 8 Print the verbose text with numbered lines. This adds four digitsized spaces in the beginning of each line. Finer control is available with @@ -1444,7 +1446,7 @@ .B "VM [top [bottom]]" Vertical margin. .TP -.B "WA [writer-name [title]] +.B "WA [writer-name [title]]" Begins specification of the writer and writer's address. Several names can be specified with empty \fBWA\fP/\fBWE\fP-pairs, but only one address. @@ -1538,10 +1540,10 @@ Contains "Yours very truly,", used in \fB.FC\fP. .TP .B Letapp -Contains "APPROVED:", used in \fB.AV.\fP. +Contains "APPROVED:", used in \fB.AV\fP. .TP .B Letdate -Contains "Date", used in \fB.AV.\fP. +Contains "Date", used in \fB.AV\fP. .TP .B LetCN Contains "CONFIDENTIAL", used in \fB.LO CN\fP. @@ -1753,7 +1755,6 @@ Default 99. .TP .B Lsp -.TP The size of an empty line. Normally 0.5v, but it is 1v if \fBn\fP is set (\fB.nroff\fP). .TP @@ -1771,7 +1772,7 @@ 4\ ==\ page header is removed on the first page. .br 5\ ==\ "section-page" and "section-figure" numbering enabled. -Se also the number-register Sectf and Sectp. +See also the number-register Sectf and Sectp. .TP .B Np Numbered paragraphs, default 0. @@ -1822,11 +1823,11 @@ .TP .B Sectf Flag controlling "section-figures". A non-zero value enables this. -Se also register N. +See also register N. .TP .B Sectp Flag controlling "section-page-numbers". A non-zero value enables this. -Se also register N. +See also register N. .TP .B Si Display indent, default 5. @@ -1842,7 +1843,7 @@ the letter type. The name of the submacro has the letter type as suffix. It is therefore possible to define other letter types, either in the national macro-file, or as local additions. -\&\fB.LT\fP will set the number variables \fBPt\fP and \fBPi\fP to 5 and 0. +\&\fB.LT\fP will set the number variables \fBPt\fP and \fBPi\fP to 0 and 5. The following strings and macros must be defined for a new letter type: .TP \fBlet@init_\fP\fItype\fP diff -aruN groff-1.16/doc/groff.texinfo groff-1.16.1/doc/groff.texinfo --- groff-1.16/doc/groff.texinfo Mon May 22 08:21:49 2000 +++ groff-1.16.1/doc/groff.texinfo Sun Jun 18 12:13:51 2000 @@ -634,14 +634,14 @@ @cindex what is @code{groff}? @cindex @code{groff} -- what is it? -@code{groff} is of an older generation of document preparation systems, -which operate more like compilers than the more recent interactive -@acronym{WYSIWYG}@footnote{What You See Is What You Get} systems. -@code{groff} and its contemporary counterpart, @TeX{}, both work using a -@dfn{batch} paradigm: The input (or @dfn{source}) files are normal text -files with embedded formatting commands. These files can then be -processed by @code{groff} to produce a typeset document on a variety of -devices. +@code{groff} belongs to an older generation of document preparation +systems, which operate more like compilers than the more recent +interactive @acronym{WYSIWYG}@footnote{What You See Is What You Get} +systems. @code{groff} and its contemporary counterpart, @TeX{}, both +work using a @dfn{batch} paradigm: The input (or @dfn{source}) files are +normal text files with embedded formatting commands. These files can +then be processed by @code{groff} to produce a typeset document on a +variety of devices. Likewise, @code{groff} should not be confused with a @dfn{word processor}, since that term connotes an integrated system which includes @@ -707,17 +707,17 @@ @cindex @code{nroff} When they needed a more flexible language, a new version of @code{roff} -called @code{nroff} (Newer @code{roff}) was written. It had a much more -complicated syntax, but provided the basis for all future versions. +called @code{nroff} (``Newer @code{roff}'') was written. It had a much +more complicated syntax, but provided the basis for all future versions. When they got a Graphic Systems CAT Phototypesetter, Ossanna wrote a version of @code{nroff} which would drive it. It was dubbed -@code{troff} for typesetter @code{roff}, although many people have -speculated that it actually means Times @code{roff} because of the use -of the Times font family in @code{troff} by default. As such, the name -@code{troff} is pronounced `@w{t-roff}' rather than `trough'. +@code{troff}, for ``typesetter @code{roff}'', although many people have +speculated that it actually means ``Times @code{roff}'' because of the +use of the Times font family in @code{troff} by default. As such, the +name @code{troff} is pronounced `@w{t-roff}' rather than `trough'. With @code{troff} came @code{nroff} (they were actually the same program -except for some @samp{#ifdefs}), which was for producing output for line +except for some @samp{#ifdef}s), which was for producing output for line printers and character terminals. It understood everything @code{troff} did, and ignored the commands which were not applicable (e.g.@: font changes). @@ -738,8 +738,8 @@ He rewrote it in C, although it was now 7000@w{ }lines of uncommented code and still dependent on the CAT. As the CAT became less common, and was no longer supported by the manufacturer, the need to make it support -other devices became a priority. However, before this could be done, he -was killed in an auto accident. +other devices became a priority. However, before this could be done, +Ossanna was killed in an auto accident. @pindex ditroff @cindex @code{ditroff} @@ -747,7 +747,7 @@ newly rewritten version produced a device independent code which was very easy for postprocessors to read and translate to the appropriate printer codes. Also, this new version of @code{troff} (called -@code{ditroff} for `device independent @code{troff}') had several +@code{ditroff} for ``device independent @code{troff}'') had several extensions, which included drawing functions. Due to the additional abilities of the new version of @code{troff}, @@ -759,7 +759,7 @@ James Clark began work on a GNU implementation of @code{ditroff} in early@w{ }1989. The first version, @code{groff}@w{ }0.3.1, was released -June@w{ }1990. @code{groff} included +June@w{ }1990. @code{groff} included: @itemize @bullet @item @@ -769,9 +769,9 @@ The @code{soelim}, @code{pic}, @code{tbl}, and @code{eqn} preprocessors. @item -Postprocessors for character devices, @sc{PostScript}, @TeX{} DVI, and -X@w{ }windows. GNU @code{troff} also eliminated the need for a separate -@code{nroff} program with a postprocessor which would produce +Postprocessors for character devices, @acronym{PostScript}, @TeX{} DVI, +and X@w{ }windows. GNU @code{troff} also eliminated the need for a +separate @code{nroff} program with a postprocessor which would produce @acronym{ASCII} output. @item @@ -806,65 +806,66 @@ So what exactly is @code{groff} capable of doing? @code{groff} provides a wide range of low-level text formatting operations. Using these, it is possible to perform a wide range of formatting tasks, such as -footnotes, table of contents, multiple columns, etc. +footnotes, table of contents, multiple columns, etc. Here's a list of +the most important operations supported by @code{groff}: @itemize @bullet @item -Text filling, adjusting, and centering +text filling, adjusting, and centering @item -Hyphenation +hyphenation @item -Page control +page control @item -Font and character size control +font and character size control @item -Vertical spacing (i.e.@: double spacing) +vertical spacing (i.e.@: double spacing) @item -Line length and indenting +line length and indenting @item -Macros, strings, diversions, and traps +macros, strings, diversions, and traps @item -Number registers +number registers @item -Tabs, leaders, and fields +tabs, leaders, and fields @item -Input and output conventions and character translation +input and output conventions and character translation @item -Overstrike, bracket, line drawing, and zero-width functions +overstrike, bracket, line drawing, and zero-width functions @item -Local horizontal and vertical motions and the width function +local horizontal and vertical motions and the width function @item -Three-part titles +three-part titles @item -Output line numbering +output line numbering @item -Conditional acceptance of input +conditional acceptance of input @item -Environment switching +environment switching @item -Insertions from the standard input +insertions from the standard input @item -Input/output file switching +input/output file switching @item -Output and error messages +output and error messages @end itemize @@ -874,7 +875,7 @@ @section Macro Packages @cindex macro packages -Since @code{groff} provides such low level facilities, it can be quite +Since @code{groff} provides such low-level facilities, it can be quite difficult to use by itself. However, @code{groff} provides a @dfn{macro} facility to specify how certain routine operations (e.g.@w{ }starting paragraphs, printing headers and footers, etc.)@: should be @@ -930,10 +931,10 @@ @code{groff} actually produces device independent code which may be fed into a postprocessor which will produce output for a particular device. -Currently, @code{groff} has postprocessors for @sc{PostScript}, -character terminals, X@w{ }Windows (for previewing), @TeX{} DVI format, -HP LaserJet@w{ }4 and Canon LBP printers (which use @acronym{CAPSL}), -and @acronym{HTML}. +Currently, @code{groff} has postprocessors for @acronym{PostScript} +devices, character terminals, X@w{ }Windows (for previewing), @TeX{} DVI +format, HP LaserJet@w{ }4 and Canon LBP printers (which use +@acronym{CAPSL}), and @acronym{HTML}. @c ===================================================================== @@ -960,19 +961,18 @@ @cindex invoking @code{groff} @cindex @code{groff} invocation -@pindex groff -@pindex gtroff This section focuses on how to invoke the @code{groff} front end. This front end takes care of the details of constructing the pipeline among the preprocessors, @code{gtroff} and the postprocessor. It has become a tradition that GNU programs get the prefix @samp{g} to -distinguish it from its original counterparts provided by the host -(@pxref{Environment}, for more details). Thus, for example, @code{geqn} -is GNU @code{eqn}. On operating systems like Linux or the Hurd, which -don't contain proprietary software, this prefix is omitted since GNU -@code{troff} is the only used incarnation of @code{troff}. Exception: -@code{groff} is never replaced by @code{roff}. +distinguish it from its original counterparts provided by the host (see +@ref{Environment}, for more details). Thus, for example, @code{geqn} is +GNU @code{eqn}. On operating systems like Linux or the Hurd, which +don't contain proprietary software, and on MS-DOS/MS-Windows, where +@code{troff} and associated programs are not available at all, this +prefix is omitted since GNU @code{troff} is the only used incarnation of +@code{troff}. Exception: @code{groff} is never replaced by @code{roff}. @menu * Groff Options:: @@ -997,8 +997,9 @@ @pindex grefer @pindex gsoelim @code{groff} normally runs the @code{gtroff} program and a postprocessor -appropriate for the selected device. The default device is @samp{ps}. -It can optionally preprocess with any of @code{gpic}, @code{geqn}, +appropriate for the selected device. The default device is @samp{ps} +(but it can be changed when @code{groff} is configured and built). It +can optionally preprocess with any of @code{gpic}, @code{geqn}, @code{gtbl}, @code{ggrn}, @code{grap}, @code{grefer}, or @code{gsoelim}. This section only documents options to the @code{groff} front end. Many @@ -1020,9 +1021,7 @@ [ @var{files}@dots{} ] @end example -The command line format for @code{gtroff} is as follows. As can be -seen, many of the options to @code{groff} are actually passed on to -@code{gtroff}. +The command line format for @code{gtroff} is as follows. @example gtroff [ -abivzCERU ] [ -w@var{name} ] [ -W@var{name} ] [ -d@var{cs} ] @@ -1031,14 +1030,20 @@ [ -F@var{dir} ] [ -M@var{dir} ] [ @var{files}@dots{} ] @end example +@noindent +Obviously, many of the options to @code{groff} are actually passed +on to @code{gtroff}. + Options without an argument can be grouped behind a single @option{-}. -A filename of @samp{-} denotes the standard input. It is possible to +A filename of @file{-} denotes the standard input. It is possible to have whitespace between an option and its parameter. -@pindex grog The @code{grog} command can be used to guess the correct @code{groff} command to format a file. +Here's the description of the command-line options: + +@cindex command-line options @table @samp @item -h Print a help message. @@ -1102,11 +1107,13 @@ @samp{-} to @var{arg} before passing it to the postprocessor. @item -T@var{dev} -Prepare output for device @var{dev}. The default device is @samp{ps}. -The following are the output devices currently available: +Prepare output for device @var{dev}. The default device is @samp{ps}, +unless changed when @code{groff} was configured and built. The +following are the output devices currently available: + @table @code @item ps -For @sc{PostScript} printers and previewers. +For @acronym{PostScript} printers and previewers. @item dvi For @TeX{} DVI format. @@ -1121,7 +1128,7 @@ For typewriter-like devices. @item latin1 -For typewriter-like devices using the @w{ISO Latin-1} (@w{ISO 8859-1}) +For typewriter-like devices that support the @w{Latin-1} (@w{ISO 8859-1}) character set. @item utf8 @@ -1164,8 +1171,8 @@ Note that this is not the same as using @option{-TX75} or @option{-TX100} to view a document with @code{gxditview}: The former -will us the metrics of the specified device, whereas the latter will use -X-specific fonts and metrics. +will use the metrics of the specified device, whereas the latter will +use X-specific fonts and metrics. @item -N Don't allow newlines with @code{eqn} delimiters. This is the same as @@ -1205,7 +1212,9 @@ Inhibit all error messages. @item -C -Enable compatibility mode. +Enable compatibility mode. @xref{Implementation Differences}, for the +list of incompatibilites between @code{groff} and traditional Unix +@code{troff}. @item -d@var{cs} @itemx -d@var{name}=s @@ -1225,28 +1234,29 @@ @item -o@var{list} @vindex .P Output only pages in @var{list}, which is a comma-separated list of page -ranges; @var{n} means print page @var{n}, @samp{@var{m}-@var{n}} means -print every page between @var{m} and @var{n}, @samp{-@var{n}} means -print every page up to @var{n}, @samp{@var{n}-} means print every page -from @var{n}. @code{gtroff} will exit after printing the last page in -the list. +ranges; @samp{@var{n}} means print page @var{n}, @samp{@var{m}-@var{n}} +means print every page between @var{m} and @var{n}, @samp{-@var{n}} +means print every page up to @var{n}, @samp{@var{n}-} means print every +page beginning with @var{n}. @code{gtroff} will exit after printing the +last page in the list. All the ranges are inclusive on both ends. Within @code{gtroff}, this information can be extracted with the @samp{.P} register. @xref{Built-in Registers}. @item -r@var{cn} @itemx -r@var{name}=@var{n} -Set number register @var{c} or @var{name} to @var{n}. @var{c} must be a -one-letter name; @var{name} can be of arbitrary length. @var{n} can be -any @code{gtroff} numeric expression. +Set number register @var{c} or @var{name} to the value @var{n}. @var{c} +must be a one-letter name; @var{name} can be of arbitrary length. +@var{n} can be any @code{gtroff} numeric expression. @item -F@var{dir} -Search @var{dir} for subdirectories dev@var{name} (@var{name} is the -name of the device) for the @file{DESC} file and font files before the -normal directory. +Search @file{@var{dir}} for subdirectories @file{dev@var{name}} +(@var{name} is the name of the device), for the @file{DESC} file, and +for font files before looking in the standard directory. @item -M@var{dir} -Search directory @var{dir} for macro files before the normal directory. +Search directory @file{@var{dir}} for macro files before the standard +directory. @item -I@var{dir} This option is as described in @ref{gsoelim}. It implies the @@ -1266,40 +1276,46 @@ @table @code @item GROFF_COMMAND_PREFIX -@tindex GROFF_COMMAND_PREFIX +@tindex GROFF_COMMAND_PREFIX, environment variable If this is set to @var{X}, then @code{groff} will run -@var{X}@code{troff} instead of @code{gtroff}. This also applies to +@code{@var{X}troff} instead of @code{gtroff}. This also applies to @code{tbl}, @code{pic}, @code{eqn}, @code{grn}, @code{refer}, and @code{soelim}. It does not apply to @code{grops}, @code{grodvi}, @code{grotty}, @code{grohtml}, @code{grolj4}, and @code{gxditview}. @item GROFF_TMAC_PATH -@tindex GROFF_TMAC_PATH -A colon separated list of directories in which to search for macro +@tindex GROFF_TMAC_PATH, environment variable +A colon-separated list of directories in which to search for macro files. @item GROFF_TYPESETTER -@tindex GROFF_TYPESETTER +@tindex GROFF_TYPESETTER, environment variable The default output device. @item GROFF_FONT_PATH -@tindex GROFF_FONT_PATH -A colon separated list of directories in which to search for the +@tindex GROFF_FONT_PATH, environment variable +A colon-separated list of directories in which to search for the @code{dev}@var{name} directory. @item PATH -@tindex PATH +@tindex PATH, environment variable The search path for commands executed by @code{groff}. @item GROFF_TMPDIR -@tindex GROFF_TMPDIR -@tindex TMPDIR +@tindex GROFF_TMPDIR, environment variable +@tindex TMPDIR, environment variable The directory in which temporary files will be created. If this is not set and @env{TMPDIR} is set, temporary files will be created in that -directory. Otherwise temporary files will be created in @code{/tmp}. -The @code{grops} and @code{grefer} commands can create temporary files. +directory. Otherwise temporary files will be created in a +system-dependent default directory (on Unix and GNU/Linux systems, this +is usually @file{/tmp}). The @code{grops} and @code{grefer} commands +can create temporary files in this directory. @end table +Note that MS-DOS and MS-Windows ports of @code{groff} use semi-colons, +rather than colons, to separate the directories in the lists described +above. + @c ===================================================================== @@ -1316,8 +1332,8 @@ @end example @noindent -This command processes @var{file} without a macro package or a -preprocessor. The output device is the default, @var{ps}, and the +This command processes @file{file} without a macro package or a +preprocessor. The output device is the default, @samp{ps}, and the output is sent to stdout. @example @@ -1326,17 +1342,18 @@ @noindent This is basically what a call to the @code{man} program does. The -manual page @var{file} is processed with the @file{mandoc} macros (which -in turn either calls the @file{man} or the @file{mdoc} macro package), -using the @code{tbl} preprocessor and the @acronym{ASCII} output device. -Finally, the result is displayed with the @code{less} pager. +manual page @file{file} is processed with the @file{mandoc} macros +(which in turn either calls the @file{man} or the @file{mdoc} macro +package), using the @code{tbl} preprocessor and the @acronym{ASCII} +output device. Finally, the result is displayed with the @code{less} +pager. @example groff -X -m me file @end example @noindent -Preview @var{file} with @code{gxditview}, using the @file{me} macro +Preview @file{file} with @code{gxditview}, using the @file{me} macro package. Since no @option{-T} option is specified, use the default device (@samp{ps}). Note that you can either say @w{@samp{-m me}} or @w{@samp{-me}}; the latter is an anachronism from the early days of @@ -1351,8 +1368,8 @@ @end example @noindent -Check @var{file} with the @file{man} macro package, forcing double-sided -printing -- don't produce any output. +Check @file{file} with the @file{man} macro package, forcing +double-sided printing -- don't produce any output. @c --------------------------------------------------------------------- @@ -1363,17 +1380,18 @@ @node grog, , Invocation Examples, Invocation Examples @subsection @code{grog} -@code{grog} reads files and guesses which of the @code{groff} -preprocessors and/or macro packages are are required for formatting -them, and prints the @code{groff} command including those options on the -standard output. The options generated are one of @option{-e}, -@option{-man}, @option{-me}, @option{-mm}, @option{-ms}, @option{-p}, -@option{-R}, @option{-g}, @option{-G}, @option{-s}, and @option{-t}. - -A filename of @samp{-} is taken to refer to the standard input. If no -files are specified the standard input will be read. Any specified -options will be included in the printed command. No space is allowed -between options and their arguments. For example, +@pindex grog +@code{grog} reads files, guesses which of the @code{groff} preprocessors +and/or macro packages are required for formatting them, and prints the +@code{groff} command including those options on the standard output. +The options generated are one of @option{-e}, @option{-man}, +@option{-me}, @option{-mm}, @option{-ms}, @option{-p}, @option{-R}, +@option{-g}, @option{-G}, @option{-s}, and @option{-t}. + +A special file name @file{-} is taken to refer to the standard input. +If no files are specified the standard input will be read. Any +specified options will be included in the printed command. No space is +allowed between options and their arguments. For example, @example grog -Tdvi paper.ms @@ -1382,7 +1400,7 @@ @noindent will guess the appropriate command to print @file{paper.ms} and then print it to the command line after adding the @option{-Tdvi} option. -For direct execution, enclose the call to @code{grog} in backquotes on +For direct execution, enclose the call to @code{grog} in backquotes at the @acronym{UNIX} shell prompt: @example @@ -1402,7 +1420,7 @@ @node Tutorial for Macro Users, Macro Packages, Invoking groff, Top @chapter Tutorial for Macro Users @cindex tutorial for macro users -@cindex macro tutorial for users +@cindex macros, tutorial for users @cindex user's tutorial for macros @cindex user's macro tutorial @@ -1421,7 +1439,8 @@ @node Basics, Common Features, Tutorial for Macro Users, Tutorial for Macro Users @section Basics -@cindex basics +@cindex basics of macros +@cindex macro basics This section covers some of the basic concepts necessary to understand how to use a macro package.@footnote{This section is derived from @@ -1432,11 +1451,12 @@ formatted document suitable for publication or framing. The input consists of text, or words to be printed, and embedded commands (@dfn{requests} and @dfn{escapes}), which tell @code{gtroff} how to -format the output. For more detail on this @pxref{Embedded Commands}. +format the output. For more detail on this, see @ref{Embedded +Commands}. -The word @dfn{argument} is used in this manual to mean a word or number -which appears on the same line as a request which modifies the meaning -of that request. For example, the request +The word @dfn{argument} is used in this chapter to mean a word or number +which appears on the same line as a request, and which modifies the +meaning of that request. For example, the request @example .sp @@ -1456,7 +1476,7 @@ on this can be found in @ref{Request Arguments}. The primary function of @code{gtroff} is to collect words from input -lines, fill output lines with those words, justify the right hand margin +lines, fill output lines with those words, justify the right-hand margin by inserting extra spaces in the line, and output the result. For example, the input: @@ -1494,22 +1514,22 @@ numbering pages, skipping over page boundaries, putting footnotes in the correct place, and so forth. -Here a few hints for preparing text for input to @code{gtroff}. First, -keep the input lines short. Short input lines are easier to edit, and -@code{gtroff} will pack words onto longer lines anyhow. In keeping with -this, it is helpful to begin a new line after every period, comma, or -phrase, since common corrections are to add or delete sentences or -phrases. Secondly, do not hyphenate words at the end of lines -- -@code{gtroff} is smart enough to hyphenate words for the user as needed, -but is not smart enough to take hyphens out and join a word back -together. Also, words such as ``mother-in-law'' should not be broken -over a line, since then a space can occur where not wanted, such as -``@w{mother- in}-law''. +Here are a few hints for preparing text for input to @code{gtroff}. +First, keep the input lines short. Short input lines are easier to +edit, and @code{gtroff} will pack words onto longer lines anyhow. In +keeping with this, it is helpful to begin a new line after every period, +comma, or phrase, since common corrections are to add or delete +sentences or phrases. Secondly, do not hyphenate words at the end of +lines -- @code{gtroff} is smart enough to hyphenate words for the user +as needed, but is not smart enough to take hyphens out and join a word +back together. Also, words such as ``mother-in-law'' should not be +broken over a line, since then a space can occur where not wanted, such +as ``@w{mother- in}-law''. @findex ls @cindex double spacing @cindex spacing -@code{gtroff} will double space output text automatically if using the +@code{gtroff} will double space output text automatically if you use the request @w{@samp{.ls 2}}. Single spaced mode can be reactivated by typing @w{@samp{.ls 1}}. @@ -1517,11 +1537,9 @@ called the @dfn{layout} of the output page. Most of these requests adjust the placing of @dfn{white space} (blank lines or spaces). -@findex bp @cindex new page The @samp{.bp} request starts a new page, causing a line break. -@findex sp @cindex blank lines @cindex empty lines @cindex lines, empty @@ -1661,7 +1679,7 @@ The titles are called three-part titles, that is, there is a left-justified part, a centered part, and a right-justified part. An automatically generated page number may be put in any of these fields -with the @samp{%} character (@pxref{Page Layout} for more details). +with the @samp{%} character (see @ref{Page Layout}, for more details). @c --------------------------------------------------------------------- @@ -1745,7 +1763,7 @@ @node Indices, Paper Formats, Table of Contents, Common Features @subsection Indices -@cindex index +@cindex index, in macro package While some macro packages will use the term @dfn{index}, none actually provide that functionality. The facilities they call indices are @@ -1767,7 +1785,7 @@ @node Multiple Columns, Font and Size Changes, Paper Formats, Common Features @subsection Multiple Columns -Some macro packages (except @file{man}) provide the ability to have two +Some macro packages (but not @file{man}) provide the ability to have two or more columns on a page. @c --------------------------------------------------------------------- @@ -1799,7 +1817,7 @@ @node Configuration and Customization, , Preprocessor Support, Common Features @subsection Configuration and Customization -Some macro packages provide means of customizing many of details of how +Some macro packages provide means of customizing many of the details of how the package behaves. This ranges from setting the default type size to changing the appearance of section headers. @@ -1888,6 +1906,8 @@ @node Man usage, Man font macros, Man options, man @subsection Usage +@cindex @code{man} macros +@cindex macros for manual pages @pindex man.local This section describes the available macros for manual pages. For @@ -1897,9 +1917,9 @@ @maindex TH @Defmac{TH, title section [@var{extra1}] [@var{extra2}] [@var{extra3}]} Sets the title of the man page to @var{title} and the section to -@var{section}, which must take on a value between 1 and@w{ }8. The -value @var{section} may also have a string appended, e.g.@: @samp{.pm}, -to indicate a specific subsection of the man pages. +@var{section}, which must have a value between 1 and@w{ }8. The value +of @var{section} may also have a string appended, e.g.@: @samp{.pm}, to +indicate a specific subsection of the man pages. Both @var{title} and @var{section} are positioned at the left and right in the header line (with @var{section} in parentheses immediately @@ -1909,7 +1929,7 @@ pages if double-sided printing is active). @var{extra3} is centered in the header line. -For @acronym{HTML} output, headers and footers are completely supressed. +For @acronym{HTML} output, headers and footers are completely suppressed. Additionally, this macro starts a new page; the new line number is@w{ }1 again (except if the @option{-rC1} option is given on the command line) @@ -1931,9 +1951,9 @@ @Defmac{SS, [@var{heading}]} Sets up an unnumbered section heading. Prints out all the text following @code{SS} up to the end of the line (resp.@: the text in the -next line if there is no argument to @code{SS}) in bold face, at the sam -size as the base document size. Additionally, the left margin for the -following text is reset to its default value. +next line if there is no argument to @code{SS}) in bold face, at the +same size as the base document size. Additionally, the left margin for +the following text is reset to its default value. @end_Defmac @maindex TP @@ -1974,9 +1994,9 @@ its beginning. The indentation is set to @var{nnn} if that argument is supplied (default unit is @samp{n}), otherwise the default indentation value is used. Font size and face of the paragraph (but not the -designator) are reset to its default values. To start an indented +designator) are reset to their default values. To start an indented paragraph with a particular indentation but without a designator, use -@samp{""} (two doublequotes) as the first argument of @code{IP}. +@samp{""} (two double quotes) as the first argument of @code{IP}. For example, to start a paragraph with bullets as the designator and 4@dmn{en} indentation, write @@ -1987,14 +2007,16 @@ @end_Defmac @maindex HP +@cindex hanging indentation, in manual pages @Defmac{HP, [@var{nnn}]} Sets up a paragraph with hanging left indentation. The indentation is set to @var{nnn} if that argument is supplied (default unit is @samp{n}), otherwise the default indentation value is used. Font size -and face are reset to its default values. +and face are reset to their default values. @end_Defmac @maindex RS +@cindex left margin, how to move, in manual pages @Defmac{RS, [@var{nnn}]} This macro moves the left margin to the right by the value @var{nnn} if specified (default unit is @samp{n}); otherwise the default indentation @@ -2024,13 +2046,15 @@ @maindex RS @maindex RE -The macros @code{RS} and @code{RE} also cause a break but no insertion -of vertical space. +The macros @code{RS} and @code{RE} also cause a break but do not insert +vertical space. @c --------------------------------------------------------------------- @node Man font macros, Miscellaneous man stuff, Man usage, man @subsection Macros to set fonts +@cindex fonts in manual pages +@cindex @code{man}, how to set fonts The standard font is Roman; the default text size is 10@w{ }point. @@ -2041,6 +2065,7 @@ @end_Defmac @maindex SB +@cindex boldface, in manual pages @Defmac{SB, [@var{text}]} Causes the text on the same line or the text on the next line to appear in boldface font, one point size smaller than the default font. @@ -2049,15 +2074,15 @@ @maindex BI @Defmac{BI, text} Causes text on the same line to appear alternately in bold face and -italic. The text must be on the same line as the macro call. Thus +italic. The text must be on the same line as the macro call. Thus, @example .BI this "word and" that @end example @noindent -would cause `this' and `that' to appear in bold face, while `word and' -appears in italics. +would cause ``this'' and ``that'' to appear in bold face, while ``word +and'' appears in italics. @end_Defmac @maindex IB @@ -2106,6 +2131,7 @@ @end_Defmac @maindex I +@cindex italic, in manual pages @Defmac{I, [@var{text}]} Causes @var{text} to appear in italic. If no text is present on the line where the macro is called, then the text of the next line appears @@ -2125,6 +2151,7 @@ @maindex DT @maindex TH +@cindex tab stops, in manual pages @Defmac{DT} Sets tabs every 0.5@w{ }inches. Since this macro is always called during a @code{TH} request, it makes sense to call it only if the tab @@ -2132,6 +2159,7 @@ @end_Defmac @maindex PD +@cindex empty space before a paragraph, in manual pages @Defmac{PD, [@var{nnn}]} Adjusts the empty space before a new paragraph (resp.@: section). The optional argument gives the amount of space (default units are @@ -2180,16 +2208,17 @@ @cindex preprocessor, calling convention @cindex calling convention of preprocessors If a preprocessor like @code{gtbl} or @code{geqn} is needed, it has -become usage to make the first line of the man page look like this: +become common usage to make the first line of the man page look like +this: @example .\" @var{word} @end example -@pindex geqn -@pindex grefer -@pindex gtbl -@pindex man +@pindex geqn@r{, invocation in manual pages} +@pindex grefer@r{, invocation in manual pages} +@pindex gtbl@r{, invocation in manual pages} +@pindex man@r{, invocation of preprocessors} Note the single space character after the double quote. @var{word} consists of letters for the needed preprocessors: @samp{e} for @code{geqn}, @samp{r} for @code{grefer}, @samp{t} for @code{gtbl}. @@ -2286,7 +2315,7 @@ @node Text, Input Conventions, Programming Tutorial, Programming Tutorial @section Text -@cindex text +@cindex text, @code{gtroff} processing @code{gtroff} input files contain text with control commands interspersed throughout. But, even without control codes, @code{gtroff} @@ -2306,21 +2335,19 @@ @node Filling and Adjusting, Hyphenation, Text, Text @subsection Filling and Adjusting -@cindex filling and adjusting -@cindex adjusting and filling +@cindex filling +@cindex adjusting When @code{gtroff} reads in text it collects words from input and fits as many of them together on one output line as it can. This is known as @dfn{filling}. @cindex leading spaces -@cindex spaces, leading +@cindex spaces, leading and trailing @cindex extra spaces -@cindex spaces, extra @cindex trailing spaces -@cindex spaces, trailing Once @code{gtroff} has a @dfn{filled} line it will try to @dfn{adjust} -it. Which means it will widen the spacing between words until the text +it. This means it will widen the spacing between words until the text reaches the right margin (in the default adjustment mode). Extra spaces between words are preserved, but spaces at the end of lines are ignored. Spaces at the front of a line will cause a @dfn{break} (breaks will be @@ -2334,16 +2361,16 @@ @subsection Hyphenation @cindex hyphenation -Since the odds of finding a set of words, for every output line, which -will fit nicely on a line without inserting excessive amounts of space -between words is not great, @code{gtroff} will hyphenate words so that -lines can be justified without there being too much space between words. -It uses an internal hyphenation algorithm (a simplified version of the -algorithm used within @TeX{}) to indicate which words can be hyphenated -and how to do so. When a word is hyphenated the first part of the word -will be added to the current filled line being output (with an attached -hyphen), and the other portion will be added to the next line to be -filled. +Since the odds are not great for finding a set of words, for every +output line, which will fit nicely on a line without inserting excessive +amounts of space between words, @code{gtroff} will hyphenate words so +that lines can be justified without there being too much space between +words. It uses an internal hyphenation algorithm (a simplified version +of the algorithm used within @TeX{}) to indicate which words can be +hyphenated and how to do so. When a word is hyphenated the first part +of the word will be added to the current filled line being output (with +an attached hyphen), and the other portion will be added to the next +line to be filled. @xref{Manipulating Hyphenation}. @@ -2355,11 +2382,11 @@ Although it is often debated, some typesetting rules say there should be different amounts of space after various punctuation marks. For -example, the @emph{Chicago typsetting manual} says that a period at the +example, the @cite{Chicago typsetting manual} says that a period at the end of a sentence should have twice as much space following it as would a comma or a period as part of an abbreviation. -@c XXX exact citation of Chigago manual +@c XXX exact citation of Chicago manual @cindex sentence space @cindex space between sentences @@ -2368,7 +2395,8 @@ @samp{!}, @samp{?} and @samp{.}) as @dfn{end of sentence} characters. When @code{gtroff} encounters one of these characters at the end of a line it will append two @dfn{sentence spaces} in the formatted output. -(Thus, one of the conventions mentioned in @ref{Input Conventions}.) +(This justifies one of the conventions mentioned in @ref{Input +Conventions}.) @cindex transparent characters @cindex character, transparent @@ -2403,9 +2431,9 @@ @dfn{tabs} (normally code point @acronym{ASCII} @code{0x09} resp.@: @acronym{EBCDIC} @code{0x05}), in the input into movements to the next tabulator stop. These tab stops are initially located every half inch -across the page. Using this simple tables can easily be made. However, -it can often be deceptive as the appearance (and width) of the text on a -terminal and the results from @code{gtroff} can vary greatly. +across the page. Using this, simple tables can easily be made. +However, it can often be deceptive as the appearance (and width) of the +text on a terminal and the results from @code{gtroff} can vary greatly. Also, a possible sticking point is that lines beginning with tab characters will still be filled, again producing unexpected results. @@ -2433,8 +2461,8 @@ @node Implicit Line Breaks, , Tab Stops, Text @subsection Implicit Line Breaks @cindex implicit line breaks +@cindex implicit breaks of lines @cindex line, implicit breaks -@cindex break @cindex break, implicit @cindex line break @@ -2477,7 +2505,7 @@ @itemize @bullet @item -Break lines after punctuation, particularly at the end of sentences, +Break lines after punctuation, particularly at the end of a sentence, and in other logical places. Keep separate phrases on lines by themselves, as entire phrases are often added or deleted when editing. @@ -2513,8 +2541,8 @@ specified @code{gtroff} converts this into its @dfn{basic units}. This basic unit, represented by a @samp{u}, is a device dependent measurement which is quite small, ranging from 1/75th to 1/72000th of an inch. The -values may be given as fractional numbers -- nevertheless, fractional -basic units are always rounded to integers. +values may be given as fractional numbers; however, fractional basic +units are always rounded to integers. Some of the measurement units are completely independent of any of the current settings (e.g.@: type size) of @code{gtroff}. @@ -2604,7 +2632,7 @@ Many requests take a default unit. While this can be helpful at times, it can cause strange errors in some expressions. For example, the line length request expects em units. Here are several attempts to get a -line length of 3.5@w{ }inches and the results: +line length of 3.5@w{ }inches and their results: @example 3.5i @result{} 3.5i @@ -2621,6 +2649,7 @@ 7i/2 will be first handled as 7i/2m, then converted to 1680u/66u which is 25@dmn{u}, and this is approximately 0.1@dmn{i}. +@cindex measurements, specifying safely As a conclusion, the safest way to specify measurements is to always attach a scaling indicator. If you want to multiply or divide by a certain scalar value, use @samp{u} as the unit for that value. @@ -2678,8 +2707,8 @@ @opindex - @opindex + @opindex ! -@findex if -@findex while +@findex if@r{, and the @samp{!} operator} +@findex while@r{, and the @samp{!} operator} Unary operators: @samp{-} (negating, i.e.@: changing the sign), @samp{+} (just for completeness; does nothing in expressions), @samp{!} (logical not; this works only within @code{if} and @code{while} requests). See @@ -2712,11 +2741,12 @@ @code{gtroff} they are necessary to ensure order of evaluation. @code{gtroff} has no operator precedence; expressions are evaluated left to right. This means that @samp{3+5*4} is evaluated as if it were -parenthesized like @samp{(3+5)*4}, not as @samp{3+(5*4)}, as expected. +parenthesized like @samp{(3+5)*4}, not as @samp{3+(5*4)}, as might be +expected. -@opindex + -@opindex - -@opindex | +@opindex +@r{, and page motion} +@opindex -@r{, and page motion} +@opindex |@r{, and page motion} @cindex motion operators @cindex operators, motion For many requests which cause a motion on the page, the unary operators @@ -2750,7 +2780,7 @@ Like any other language, @code{gtroff} has rules for properly formed @dfn{identifiers}. In @code{gtroff}, an identifier can be made up of -almost any printable character. The exception are the following +almost any printable character, with the exception of the following characters: @itemize @bullet @@ -2763,22 +2793,22 @@ @item @cindex character, backspace @cindex backspace character -@cindex @acronym{EBCDIC} encoding +@cindex @acronym{EBCDIC} encoding of backspace Backspace (@acronym{ASCII}@w{ }@code{0x08} resp.@: @acronym{EBCDIC}@w{ }@code{0x16}) and character code @code{0x01}. @item -@cindex illegal input characters -@cindex input characters, illegal -@cindex characters, illegal input +@cindex invalid input characters +@cindex input characters, invalid +@cindex characters, invalid input @cindex unicode -The following input characters are illegal and will be ignored if +The following input characters are invalid and will be ignored if @code{groff} runs on a machine based on @acronym{ASCII}, causing a -warning message of type @samp{input} (@pxref{Debugging}, for more +warning message of type @samp{input} (see @ref{Debugging}, for more details): @code{0x00}, @code{0x0B}, @code{0x0D}-@code{0x1F}, @code{0x80}-@code{0x9F}. -And here the illegal input characters if @code{groff} runs on an +And here are the invalid input characters if @code{groff} runs on an @acronym{EBCDIC} host: @code{0x00}, @code{0x08}, @code{0x09}, @code{0x0B}, @code{0x0D}-@code{0x14}, @code{0x17}-@code{0x1F}, @code{0x30}-@code{0x3F}. @@ -2787,9 +2817,9 @@ making it non-trivial to extend @code{gtroff} to cover Unicode or other character sets resp.@: encodings which use characters of these ranges. -Note that illegal characters will be removed before parsing; an -identifier `foo', followed by an illegal character, followed by `bar' -will be treated as `foobar'. +Note that invalid characters will be removed before parsing; an +identifier @code{foo}, followed by an invalid character, followed by +@code{bar} will be treated as @code{foobar}. @end itemize For example, any of the following is valid. @@ -2814,7 +2844,7 @@ @Deffn{Escape, \\A, ident} Whether an identifier @var{ident} is valid in @code{gtroff} can be tested with the @code{\A} escape. It expands to the character@w{ }1 -or@w{ }0 according to whether its argument (delimited by quotes usually) +or@w{ }0 according to whether its argument (usually delimited by quotes) is or is not acceptable as the name of a string, macro, diversion, number register, environment, or font. It will return@w{ }0 if no argument is given. This is useful for looking up user input in some @@ -2832,7 +2862,7 @@ Identifiers in @code{gtroff} can be any length, but, in some contexts, @code{gtroff} needs to be told where identifiers end and text begins -(and in different ways depending on their length). +(and in different ways depending on their length): @findex ( @findex [ @@ -2910,7 +2940,7 @@ @cindex zero width space character @cindex character, zero width space @cindex space character, zero width -@findex \& +@findex \&@r{, escaping control characters} To begin a line with a control character without it being interpreted, precede it with @code{\&}. This represents a zero width space, which means it will not affect the output. @@ -2933,6 +2963,8 @@ is intended to contain spaces can either be enclosed in quotes (single or double), or have the spaces @dfn{escaped} with backslashes. +Here are a few examples: + @example .uh The Mouse Problem .uh "The Mouse Problem" @@ -2944,10 +2976,10 @@ @noindent The first line is the @code{uh} macro being called with 3 arguments, @samp{The}, @samp{Mouse}, and @samp{Problem}. The latter two have the -same effect or calling the @code{uh} macro with one argument @samp{The +same effect or calling the @code{uh} macro with one argument, @samp{The Mouse Problem}.@footnote{The last solution, i.e., using escaped spaces, -is `classical' in the sense that it can be found in most @code{troff} -documents. Nevertheless, it is not optimal in all situations since +is ``classical'' in the sense that it can be found in most @code{troff} +documents. Nevertheless, it is not optimal in all situations, since @w{@samp{\ }} inserts a fixed-width, non-breaking space character which can't stretch. @code{gtroff} provides a different command @code{\~} to insert a stretchable, non-breaking space.} @@ -2974,8 +3006,8 @@ @subsection Escapes @cindex escapes -Escapes may occur anywhere in the input to @code{gtroff}. They begin -with a backslash usually and are followed by a single character which +Escapes may occur anywhere in the input to @code{gtroff}. They usually +begin with a backslash and are followed by a single character which indicates the function to be performed. The escape character can be changed; see @ref{Character Translations}. @@ -3123,7 +3155,7 @@ @opindex ( @opindex ) @opindex . -The (single character) operators @samp{+-/*%<>=&:().}. +The (single-character) operators @samp{+-/*%<>=&:().}. @item @cindex space character @@ -3175,8 +3207,8 @@ @cindex comments Probably one of the most@footnote{Unfortunately, this is a lie. But -hopefully future @code{gtroff} hackers will believe it :-)} common forms -of escapes is the comment. +hopefully future @code{gtroff} hackers will believe it @code{:-)}} +common forms of escapes is the comment. @Deffn{Escape, \\"} Start a comment. Everything to the end of the input line is ignored. @@ -3190,6 +3222,8 @@ by @code{gtroff}. This only affects the @code{.ds} request. @c XXX (any others?) +@cindex tabs before comments +@cindex comments, lining up with tabs One possibly irritating idiosyncracy is that tabs must not be used to line up comments. Tabs are not treated as white space between the request and macro arguments. @@ -3226,7 +3260,7 @@ @end_Deffn @Deffn{Escape, \\#} -Now to avoid all this @code{gtroff} has a new comment mechanism using +To avoid all this, @code{gtroff} has a new comment mechanism using the @code{\#} escape. This escape works the same as @code{\"} except that the newline is also ignored: @@ -3248,7 +3282,8 @@ @end_Deffn @findex ig -For large blocks of text, the @code{ig} request may be useful. +For commenting away large blocks of text, the @code{ig} request may be +useful. @c XXX definition of .ig @@ -3317,6 +3352,7 @@ @result{} 2 @end example +@cindex negating register values To assign the negated value of a register to another register, some care must be taken to get the desired result: @@ -3440,8 +3476,9 @@ -2, -4, -6, -8, -10 @end example +@cindex increment value without changing the register To change the increment value without changing the value of a register, -the following can be used. +the following can be used: @example .nr a \na 10 @@ -3455,9 +3492,9 @@ @cindex formats, assigning When a register is used in the text of an input file (as opposed to part -of an expression) it is textually replaced (or interpolated) with a +of an expression), it is textually replaced (or interpolated) with a representation of that number. This output format can be changed to a -variety of formats (numbers, Roman numerals, etc). This is done using +variety of formats (numbers, Roman numerals, etc.). This is done using the @code{af} request. @Deffn{Request, af, ident format} @@ -3469,30 +3506,30 @@ @table @code @item 1 Decimal arabic numbers. This is the default format: 1, 2, 3,@w{ -}@dots{} +}@enddots{} @item 0@dots{}0 Decimal numbers with as many digits as specified. So, @samp{00} would -result in printing numbers as 01, 02, 03,@w{ }@dots{} +result in printing numbers as 01, 02, 03,@w{ }@enddots{} In fact, any digit instead of zero will do; @code{gtroff} only counts how many digits are specified. As a consequence, @code{af}'s default format @samp{1} could be specified as @samp{0} also (and exactly this is -returned by the @code{\g} escape). +returned by the @code{\g} escape, see below). @item I @cindex roman numerals @cindex numerals, Roman -Upper-case Roman numerals: 0, I, II, III, IV,@w{ }@dots{} +Upper-case Roman numerals: 0, I, II, III, IV,@w{ }@enddots{} @item i -Lower-case Roman numerals: 0, i, ii, iii, iv,@w{ }@dots{} +Lower-case Roman numerals: 0, i, ii, iii, iv,@w{ }@enddots{} @item A -Upper-case letters: A, B, C, @dots{},@w{ }Z, AA, AB,@w{ }@dots{} +Upper-case letters: A, B, C, @dots{},@w{ }Z, AA, AB,@w{ }@enddots{} @item a -Lower-case letters: a, b, c, @dots{},@w{ }z, aa, ab,@w{ }@dots{} +Lower-case letters: a, b, c, @dots{},@w{ }z, aa, ab,@w{ }@enddots{} @end table Omitting the number register format will cause a warning of type @@ -3513,19 +3550,27 @@ \na @end example +@cindex roman numerals, maximum and minimum +@cindex maximum values of Roman numerals +@cindex minimum values of Roman numerals The largest number representable for the @samp{i} and @samp{I} formats is 39999 (resp.@: -39999); @acronym{UNIX} @code{troff} uses @samp{z} and @samp{w} to represent 10000 and 5000 in Roman numerals, and so does -@code{gtroff}. Currently, the correct glyphs (Unicode code points +@code{gtroff}. Currently, the correct glyphs of Roman numeral five +thousand and Roman numeral ten thousand (Unicode code points @code{U+2182} and @code{U+2181}, respectively) are not available. If @var{ident} doesn't exist, it will be created. +@cindex read-only register, changing format +@cindex changing format, read-only register Changing the output format of a read-only register causes an error. It is necessary to first copy the register's value to a writeable register, then apply the @code{af} request to this other register. @end_Deffn +@cindex format of register +@cindex register, format @Deffn{Escape, \\g, ident} Return the current format of the specified register @var{ident}. For example, @samp{\ga} after the previous example would produce the string @@ -3541,44 +3586,44 @@ @cindex registers, built-in The following lists some built-in registers which are not described -elsewhere in this manual. Any register which begin with a @samp{.} is +elsewhere in this manual. Any register which begins with a @samp{.} is read-only. A complete listing of all built-in registers can be found in @ref{Register Index}. @table @code @item .H -@cindex horizontal resolution -@cindex resolution, horizontal +@cindex horizontal resolution register +@cindex resolution, horizontal, register @vindex .H Horizontal resolution in basic units. @item .V -@cindex vertical resolution -@cindex resolution, vertical +@cindex vertical resolution register +@cindex resolution, vertical, register @vindex .V Vertical resolution in basic units. @item dw -@cindex day of the week -@cindex date, day of the week +@cindex day of the week register +@cindex date, day of the week register @vindex dw Day of the week (1-7). @item dy -@cindex day of the month -@cindex date, day of the month +@cindex day of the month register +@cindex date, day of the month register @vindex dy Day of the month (1-31). @item mo -@cindex month of the year -@cindex date, month of the year +@cindex month of the year register +@cindex date, month of the year register @vindex mo Current month (1-12). @item year -@cindex date, year -@cindex year, current +@cindex date, year register +@cindex year, current, register @vindex year The current year. @@ -3614,8 +3659,8 @@ @vindex .c @itemx c. @vindex c. -@cindex input line number -@cindex line number, input +@cindex input line number register +@cindex line number, input, register The current @emph{input} line number. Register @samp{.c} is read-only, whereas @samp{c.} (a @code{gtroff} extension) is writable also, affecting both @samp{.c} and @samp{c.}. @@ -3623,8 +3668,8 @@ @item ln @vindex ln @findex nm -@cindex output line number -@cindex line number, output +@cindex output line number register +@cindex line number, output, register The current @emph{output} line number after a call to the @code{nm} request to activate line numbering. @@ -3632,30 +3677,33 @@ @item .x @vindex .x -@cindex major version number -@cindex version number, major +@cindex major version number register +@cindex version number, major, register The major version number. For example, if the version number is@w{ }1.03 then @code{.x} will contain@w{ }@samp{1}. @item .y @vindex .y -@cindex minor version number -@cindex version number, minor +@cindex minor version number register +@cindex version number, minor, register The minor version number. For example, if the version number is@w{ }1.03 then @code{.y} will contain@w{ }@samp{03}. @item .Y @vindex .Y -@cindex revision number +@cindex revision number register The revision number of @code{groff}. @item .g @vindex .g +@cindex @code{gtroff} identification register +@cindex GNU-specific register Always@w{ }1. Macros should use this to determine whether they are running under GNU @code{troff}. @item .A @vindex .A +@cindex @acronym{ASCII} approximation output register If the command line option @option{-a} is used to produce an @acronym{ASCII} approximation of the output, this is set to@w{ }1, zero otherwise. @xref{Groff Options}. @@ -3674,6 +3722,7 @@ @xref{Groff Options}. @maindex \*(.T +@cindex output device register Additionally, @code{gtroff} predefines a single (read/write) string register @code{.T} which contains the current output device (for example, @samp{latin1} or @samp{ps}). @@ -3777,11 +3826,12 @@ @item b @itemx n -Justify to both margins. This is default of @code{gtroff}. +Justify to both margins. This is the default used by @code{gtroff}. @end table -With no argument, @code{gtroff} will adjust lines the same way before -adjusting has been deactivated (with a call to @code{na}, for example). +With no argument, @code{gtroff} will adjust lines in the same way it did +before adjusting has been deactivated (with a call to @code{na}, for +example). @example text @@ -3796,6 +3846,7 @@ @end example @vindex .j +@cindex current adjustment mode register The current adjustment mode is available in the number register @code{.j}; it can be stored and subsequently used to set adjustment. @@ -3817,7 +3868,7 @@ In most cases this will produce very ugly results, since @code{gtroff} doesn't have a sophisticated paragraph building algorithm (as @TeX{} -have, for example); instead, @code{gtroff} fills and adjusts a paragraph +does, for example); instead, @code{gtroff} fills and adjusts a paragraph line by line: @example @@ -3851,24 +3902,24 @@ @cindex mode, fill If two arguments are given to the @code{ss} request, the second argument sets the sentence space size. If the second argument is not given, -@var{sentence_space_size} will be the same as @var{word_space_size}. -The sentence space size is used in two circumstances: If the end of a -sentence occurs at the end of a line in fill mode, then both an -inter-word space and a sentence space will be added; if two spaces -follow the end of a sentence in the middle of a line, then the second -space will be a sentence space. Note that the behaviour of -@acronym{UNIX} @code{troff} will be exactly that exhibited by GNU -@code{troff} if a second argument is never given to the @code{ss} -request. In GNU @code{troff}, as in @acronym{UNIX} @code{troff}, a -sentence should always be followed with either a newline or two spaces. +sentence space size will be set to @var{word_space_size}. The sentence +space size is used in two circumstances: if the end of a sentence occurs +at the end of a line in fill mode, then both an inter-word space and a +sentence space will be added; if two spaces follow the end of a sentence +in the middle of a line, then the second space will be a sentence space. +Note that the behaviour of @acronym{UNIX} @code{troff} will be exactly +that exhibited by GNU @code{troff} if a second argument is never given +to the @code{ss} request. In GNU @code{troff}, as in @acronym{UNIX} +@code{troff}, a sentence should always be followed by either a newline +or two spaces. @vindex .ss @vindex .sss -The number registers @code{.ss} and @code{.sss} are the values of the +The number registers @code{.ss} and @code{.sss} hold the values of the parameters set by the first and second arguments of the @code{ss} request. -The space and sentence space values are associated with the current +The word space and sentence space values are associated with the current environment (@pxref{Environments}). This request is ignored in nroff mode; it is also ignored if there is no @@ -3878,12 +3929,12 @@ @cindex centering lines @cindex lines, centering @Deffn{Request, ce, [@var{nnn}]} -Center text. While the @w{@samp{ad c}} request will also center text, +Center text. While the @w{@samp{.ad c}} request will also center text, it has the side effect of filling the text. @code{ce} will not fill the text it affects. This request causes a break. With no arguments, @code{ce} will center the next line of text. -@var{nnn} is a number indicating the number of lines to be centered. If +@var{nnn} specifies the number of lines to be centered. If the argument is zero or negative, centering is disabled. @findex ll @@ -3917,9 +3968,9 @@ @cindex right-justifying @vindex .rj @Deffn{Request, rj, [@var{nnn}]} -Justify unfilled text to the right margin. Its arguments are identical -to the @code{ce} request. The @code{.rj} number register is the number -of lines to be right-justified as set by the @code{rj} request. This +Justify unfilled text to the right margin. Arguments are identical to +the @code{ce} request. The @code{.rj} number register is the number of +lines to be right-justified as set by the @code{rj} request. This request causes a line break. @end_Deffn @@ -3932,7 +3983,7 @@ @cindex hyphenation, manipulating As discussed in @ref{Hyphenation}, @code{gtroff} will hyphenate words. -There are a number of ways to influence how hyphenation is done. +There are a number of ways to influence hyphenation. @Deffn{Request, hy, [@var{mode}]} Enable hyphenation. The request has an optional numeric argument, @@ -3958,6 +4009,7 @@ two characters of a word. @vindex .hy +@cindex hyphenation restrictions register The current hyphenation restrictions can be found in the number register @samp{.hy}. @@ -4004,7 +4056,7 @@ @end example @noindent -Besides the space character, any character which hyphenation code value +Besides the space character, any character whose hyphenation code value is zero can be used to separate the arguments of @code{hw} (see the documentation for the @code{hcode} request below for more information). In addition, this request can be used more than once. @@ -4030,13 +4082,13 @@ Preceding a word with this character will prevent it from being hyphenated, putting it in a word will indicate to @code{gtroff} that the word may be hyphenated at that point. Note that this mechanism will -only affect one word; to change the hyphenation of a word for the entire -document, use the @code{hw} request. +only affect that one occurrence of the word; to change the hyphenation +of a word for the entire document, use the @code{hw} request. @end_Deffn @Deffn{Request, hc, [@var{char}]} Change the hyphenation character to @var{char}. This character will -then work the same as the @code{\%} escape, and, thus, no longer appear +then work the same as the @code{\%} escape, and thus, no longer appear in the output. Without an argument, @code{hc} will reset the hyphenation character to be @code{\%} (the default) only. @@ -4070,7 +4122,8 @@ @file{troffrc} loads hyphenation patterns for American English (in file @file{hyphen.us}). -It will cause an error if there is no current hyphenation language. +@code{hpf} will cause an error if there is no current hyphenation +language. @end_Deffn @cindex hyphenation code @@ -4079,9 +4132,9 @@ Sets the hyphenation code of character @var{c1} to @var{code1}, that of @var{c2} to @var{code2}, etc. A hyphenation code must be a single input character (not a special character) other than a digit or a space. -Initially each lower-case letter (@samp{a}-@samp{z}) has a hyphenation -code, which is itself, and each upper-case letter (@samp{A}-@samp{Z}) -has a hyphenation code which is the lower-case version of itself. +Initially each lower-case letter (@samp{a}-@samp{z}) has its hyphenation +set to itself, and each upper-case letter (@samp{A}-@samp{Z}) has a +hyphenation code which is the lower-case version of itself. This request will be ignored if it has no parameter. @end_Deffn @@ -4102,6 +4155,7 @@ a warning of type @samp{range}. @vindex .hym +@cindex current hyphenation margin register The current hyphenation margin is available in the @code{.hym} register. @end_Deffn @@ -4109,7 +4163,7 @@ @findex ad @Deffn{Request, hys, [@var{hyphenation_space}]} Set the hyphenation space to @var{hyphenation_space}. If the current -adjustment mode is@w{ }@samp{b}, don't hyphenate the line if the line +adjustment mode is@w{ }@samp{b}, don't hyphenate the line if it can be justified by adding no more than @var{hyphenation_space} extra space to each word space. Without argument, the hyphenation space is set to its default value, which is@w{ }0. The default scaling indicator @@ -4120,6 +4174,7 @@ warning of type @samp{range}. @vindex .hys +@cindex current hyphenation space register The current hyphenation space is available in the @code{.hys} register. @end_Deffn @@ -4155,6 +4210,7 @@ @samp{us}. @vindex .hla +@cindex current hyphenation language register The current hyphenation language is available as a string in the read-only number register @samp{.hla}. @@ -4198,6 +4254,7 @@ (@pxref{Environments}). @vindex .L +@cindex current line spacing register The number register @code{.L} contains the current line spacing setting. @end_Deffn @@ -4214,26 +4271,29 @@ @xref{Escapes}, for details on parameter delimiting characters. @vindex .a +@cindex extra vertical line space register The @code{.a} number register contains the most recent (nonnegative) extra vertical line space. @c XXX +@ignore @example ... example of inline equation ... @end example +@end ignore @end_Deffn @findex sp @cindex no-space mode @cindex mode, no-space -@cindex blank lines -@cindex lines, blank +@cindex blank lines, disabling +@cindex lines, blank, disabling @Deffn{Request, ns, } Enable @dfn{no-space mode}. In this mode, spacing (either via @code{sp} or via blank lines) is disabled. The @code{bp} request to advance to the next page is also disabled, except if it is accompanied by a page -number (@pxref{Page Control}, for more information). This mode will end -when actual text is output or the @code{rs} request is encountered. +number (see @ref{Page Control}, for more information). This mode will +end when actual text is output or the @code{rs} request is encountered. This request is useful for macros which want to avoid that subsequent macros inadvertently insert some vertical space before the text starts @@ -4241,7 +4301,6 @@ is associated with the current diversion level. @c XXX xref - @end_Deffn @Deffn{Request, rs, } @@ -4249,7 +4308,6 @@ diversion level. @c XXX xref - @end_Deffn @@ -4260,10 +4318,10 @@ @cindex tabs and fields @cindex fields and tabs -@cindex @acronym{EBCDIC} encoding +@cindex @acronym{EBCDIC} encoding of a tab A tab character (@acronym{ASCII} char@w{ }9, @acronym{EBCDIC} char@w{ -}5) causes a horizontal movement to the next tab stop (which is much -like that on a typewriter). +}5) causes a horizontal movement to the next tab stop (much +like it did on a typewriter). @Deffn{Escape, \\t, } This escape is a non-interpreted tab character. In copy mode @@ -4396,12 +4454,14 @@ Calling @code{ta} without an argument will unset all tab stops. @item -The start-up value of @code{gtroff} is @w{@samp{T 0.5i}}. Even in nroff -mode this value is used (contrary to @acronym{UNIX} @code{nroff} which +@cindex tab stops, in nroff mode +The start-up value of @code{gtroff} is @w{@samp{T 0.5i}}. This value is +used even in nroff mode (contrary to @acronym{UNIX} @code{nroff} which has tab stops preset every 0.8@dmn{i}). @end itemize @vindex .tabs +@cindex current tab settings register The number register @code{.tabs} contains a string representation of the current tab settings suitable for use as an argument to the @code{ta} request. @@ -4570,6 +4630,26 @@ @Deffn{Request, eo, } Disable the escape mechanism completely. After executing this request, the backslash character @samp{\} no longer starts an escape sequence. + +This request can be very helpful in writing macros since it is not +necessary then to double the escape character. Here an example: + +@example +.\" This is a simplified version of the +.\" .BR request from the man macro package +.eo +.de BR +. ds result \& +. while (\n[.$] >= 2) \@{\ +. as result \fB\$1\fR\$2 +. shift 2 +. \@} +. if \n[.$] .as result \fB\$1 +\*[result] +. ft R +.. +.ec +@end example @end_Deffn @cindex escape character @@ -4696,10 +4776,9 @@ @item Without an argument, the @code{tr} request is ignored. @end itemize - @end_Deffn -@findex \! +@findex \!@r{, and @code{trnt}} @Deffn{Request, trnt, @var{a}@var{b}@var{c}@var{d}@dots{}} @code{trnt} is the same as the @code{tr} request except that the translations do not apply to text that is transparently throughput into @@ -4777,7 +4856,7 @@ @cindex line dimensions The following drawing shows the dimensions which @code{gtroff} uses for placing a line of output onto the page. They are labeled with the -request which manipulates that dimension. +request which manipulates each dimension. @example @group @@ -4800,19 +4879,19 @@ @cindex margin, left @cindex page offset @cindex offset, page -@dfn{Page offset} -- This is the leftmost position of text on the final +@dfn{Page offset} -- this is the leftmost position of text on the final output, defining the @dfn{left margin}. @item in @cindex indentation @cindex line indentation -@dfn{Indentation} -- This is the distance from the left margin where +@dfn{Indentation} -- this is the distance from the left margin where text will be printed. @item ll @cindex line length @cindex length of line -@dfn{Line length} -- This is the distance from the left margin to right +@dfn{Line length} -- this is the distance from the left margin to right margin. @end ftable @@ -4936,6 +5015,7 @@ @vindex .l @vindex .ll +@cindex current line length register The current line length (as set by @code{ll}) can be found in the built-in number register @code{.l}. The number register @code{.ll} is the line length that applies to the current output line. @@ -4966,6 +5046,7 @@ physical output page. The default scaling indicator is@w{ }@code{v}. @vindex .p +@cindex current page length register The current setting can be found in the built-in number register @samp{.p}. @@ -5003,6 +5084,7 @@ @cindex title line, length @findex lt @vindex .lt +@cindex current title line length register The title line is printed using its own line length, which is specified with the @code{lt} request. The current setting of this is available in the @code{.lt} number register. @@ -5015,6 +5097,7 @@ @vindex % @vindex .pn +@cindex current page number register The current page number is stored in the number register @code{%}. The number register @code{.pn} contains the number of the next page: either the value set by a @code{pn} request, or the number of the current page @@ -5039,6 +5122,7 @@ @findex bp @findex pn +@cindex new page To stop processing the current page, and move to the next page, invoke the @code{bp} request. This request will also cause a break. It can also take an argument of what the next page should be numbered. The @@ -5060,7 +5144,7 @@ page occurs. This is most useful to make sure that there is not a single @dfn{orphan} line left at the bottom of a page. The @code{ne} request will ensure that there is a certain distance, specified by the -first argument, before the next page is triggered (@pxref{Traps}, for +first argument, before the next page is triggered (see @ref{Traps}, for further information). The default unit for @code{ne} is @code{v} and the default argument is@w{ }1@dmn{v}. @@ -5126,7 +5210,7 @@ @cindex previous font @cindex font, previous Font changes can be done either with the @code{ft} request or the -@code{\f} request. With no arguments it will switch to the previous +@code{\f} request. With no arguments, it will switch to the previous font (also known as @samp{P}). @example @@ -5150,7 +5234,7 @@ of @samp{P} to indicate the previous font -- using @code{\f} it is not possible to omit this parameter. -Sometimes when putting letters of different fonts, more or less space at +Sometimes, when putting letters of different fonts, more or less space at such boundaries are needed. There are two escapes to help with this. @findex \/ @@ -5206,8 +5290,8 @@ which translates font@w{ }@var{F} to font@w{ }@var{G}. Whenever a font named @var{F} is referred to in a @code{\f} escape sequence, or in the @code{ft}, @code{ul}, @code{bd}, @code{cs}, @code{tkf}, @code{special}, -@code{fspecial}, @code{fp}, or @code{code} requests, font@w{ }@var{G} will -be used. If @var{G} is missing, or equal to @var{F} then font@w{ +@code{fspecial}, @code{fp}, or @code{code} requests, font@w{ }@var{G} +will be used. If @var{G} is missing, or equal to @var{F} then font@w{ }@var{F} will not be translated. @c --------------------------------------------------------------------- @@ -5280,10 +5364,11 @@ @end example @noindent -Note that after these font changes have taken place the original font +Note that after these font changes have taken place, the original font is restored. @vindex .f +@cindex current font position register The current font in use, as a font position, is available in number register @code{.f}. This can be useful to remember the current font, for later recall. @@ -5295,6 +5380,7 @@ @end example @vindex .fp +@cindex next free font position register The number of the next free font position is available in the number register @code{.fp}. This is useful when mounting a new font, like so: @@ -5302,7 +5388,7 @@ .fp \n[.fp] NEATOFONT @end example -@pindex DESC +@pindex DESC@r{, and font mounting} Fonts not listed in the @file{DESC} file are automatically mounted on the next available font position when they are referenced. If a font is to be mounted explicitly with the @code{fp} request on an unused font @@ -5435,6 +5521,7 @@ @findex char @cindex defining characters @cindex characters, defining +@cindex creating new characters New characters can be created with the @code{char} request. It is called as @@ -5491,7 +5578,7 @@ @findex ul @cindex underlining The @code{ul} request will print subsequent lines in italics on a device -capable of it, or underline the text on an character output device. The +capable of it, or underline the text on a character output device. The single argument is the number of lines to be ``underlined,'' with no argument, the next line will be underlined. @@ -5524,19 +5611,20 @@ @cindex ligatures and kerning @cindex kerning and ligatures -What are ligatures? +@c XXX What are ligatures? @c XXX more info @findex lg @vindex .lg +@cindex ligatures enabled register The ligature mechanism can be switched on or off with the @code{lg} request; if the parameter is non-zero or missing, ligatures are enabled, otherwise disabled. Default is on. The current ligature mode can be found in the number register @code{.lg} (set to@w{ }1 if ligatures are enabled, 0@w{ }otherwise). -What is kerning? +@c XXX What is kerning? @c XXX more info @@ -5549,6 +5637,7 @@ @findex kern @vindex .kern +@cindex kerning enabled register Kerning can be activated with the @code{kern} request. If the parameter is non-zero or missing, enable pairwise kerning, otherwise disable it. The number register @code{.kern} is set to@w{ }1 if pairwise kerning is @@ -5557,13 +5646,14 @@ @findex tkf @cindex track kerning @cindex kerning, track -What is track kerning? + +@c XXX What is track kerning? @c XXX more info Track kerning must be used with great care since it is usually considered bad typography if the reader notices the effect. The syntax -of the @code{tkf} request is +of the @code{tkf} request is like this: @example .tkf @var{f} @var{s1} @var{n1} @var{s2} @var{n2} @@ -5622,6 +5712,8 @@ @findex \s @vindex .s @vindex .v +@cindex current type size register +@cindex current vertical spacing register Using the @code{ps} request and the @code{\s} escape the type size can be changed. The @code{vs} request will change the vertical spacing. The default unit for the @code{ps} and @code{vs} requests are points. @@ -5676,9 +5768,11 @@ @c XXX example +@ignore @example ... .sz macro example?? ... @end example +@end ignore @c --------------------------------------------------------------------- @@ -5700,8 +5794,8 @@ @var{sizescale} is specified in the @file{DESC} file (1@w{ }by default.) There is a new scale indicator @samp{z} which has the effect of multiplying by @var{sizescale}. Requests and escape sequences in -@code{gtroff} interpret arguments that represent a point size as being in -units of scaled points, but they evaluate each such argument using a +@code{gtroff} interpret arguments that represent a point size as being +in units of scaled points, but they evaluate each such argument using a default scale indicator of @samp{z}. Arguments treated in this way are the argument to the @code{ps} request, the third argument to the @code{cs} request, the second and fourth arguments to the @code{tkf} @@ -5711,8 +5805,8 @@ For example, suppose @var{sizescale} is@w{ }1000; then a scaled point will be equivalent to a millipoint; the request @w{@samp{.ps 10.25}} is -equivalent to @w{@samp{.ps 10.25z}} and thus sets the point size to 10250 -scaled points, which is equal to 10.25@w{ }points. +equivalent to @w{@samp{.ps 10.25z}} and thus sets the point size to +10250@w{ }scaled points, which is equal to 10.25@w{ }points. It would make no sense to use the @samp{z} scale indicator in a numeric expression whose default scale indicator was neither @samp{u} nor @@ -5734,9 +5828,10 @@ @vindex .psr @vindex .sr +@cindex last-requested point size register The last-requested point size in scaled points is contained in the @code{.psr} number register. The last requested point size in points as -a decimal fraction can be found in @code{.psr}. This is a string-valued +a decimal fraction can be found in @code{.sr}. This is a string-valued register. @table @code @@ -5753,7 +5848,7 @@ @itemx \s'-@var{n}' @itemx \s+'@var{n}' @itemx \s-'@var{n}' -Increases resp.@: decreases the point size by @var{n} scaled points; +Increase or resp.@: decrease the point size by @var{n} scaled points; @var{n} is a numeric expression with a default scale indicator of @samp{z}. @end table @@ -5834,8 +5929,8 @@ @findex \@key{RET} @cindex multi-line strings @cindex strings, multi-line -@cindex newline character, escaping -@cindex escaping newline characters +@cindex newline character in strings, escaping +@cindex escaping newline characters in strings Strings are not limited to a single line of text. A string can span several lines by escaping the newlines with a backslash. The resulting string will be stored @emph{without} the newlines. @@ -5878,6 +5973,7 @@ It computes the length of @var{string} and returns it in the number register@w{ }@var{xx} (which is not necessarily defined before). +@ignore @findex rn @code{rn} @@ -5897,6 +5993,8 @@ @code{chop} @c XXX +@end ignore + @xref{Identifiers}, and @ref{Comments}. @@ -5908,8 +6006,8 @@ @cindex conditionals and loops @cindex loops and conditionals -@findex if -@findex while +@findex if@r{, operators to use with it} +@findex while@r{, operators to use with it} In @code{if} and @code{while} requests, there are several more operators available: @@ -5930,7 +6028,7 @@ True if the string @var{xxx} is equal to the string @var{yyy}. Other characters can be used in place of the single quotes. @c XXX (Which?) -The strings are `formatted' before being compared. +The strings are ``formatted'' before being compared. @c XXX (?) @item r@var{xxx} @@ -6048,8 +6146,8 @@ Note the usage of the @code{\&} escape to avoid a control character at the beginning of a line. -@findex break -@findex continue +@findex break@r{, in a @code{while} loop} +@findex continue@r{, in a @code{while} loop} The @code{break} request will @dfn{break} out of a while loop. Be sure not to confuse this with the @code{br} request (causing a line break). The @code{continue} request will finish the current iteration of a while @@ -6085,6 +6183,7 @@ @end example @findex am +@cindex appending, to a macro The @code{am} request works similarly to @code{de} except it appends onto the macro named by the first argument. So, to make the previously defined @samp{P} macro actually do indented instead of block paragraphs, @@ -6116,11 +6215,11 @@ @cindex copy-in mode @cindex mode, copy-in -@findex \n -@findex \$ -@findex \* -@findex \\ -@findex \@key{RET} +@findex \n@r{, when reading test for a macro} +@findex \$@r{, when reading test for a macro} +@findex \*@r{, when reading test for a macro} +@findex \\@r{, when reading test for a macro} +@findex \@key{RET}@r{, when reading test for a macro} When @code{gtroff} reads in the text for a macro or diversion it copies the text (including request lines, but excluding escapes) into an internal buffer. Escapes will be converted into an internal form, @@ -6160,7 +6259,7 @@ Any individual argument can be retrieved with one of the following escapes: -@cindex copy-in mode +@cindex copy-in mode, and macro arguments The escapes @code{\$@var{n}}, @code{\$(@var{nn}} and @code{\$[@var{nnn}]} will result in the @var{n}th, @var{nn}th or @var{nnn}th argument. As usual, the first form only accepts a single @@ -6187,7 +6286,7 @@ spaces. @findex \$0 -@findex als +@findex als@r{, use with @code{\$0}} The @code{\$0} escape is the name by which the current macro was invoked. The @code{als} request can make a macro have more than one name. @@ -6202,7 +6301,7 @@ This would be called as @example -.vl $Id: groff.texinfo,v 1.38 2000/05/22 06:21:49 wlemb Exp $ +.vl $Id: groff.texinfo,v 1.40 2000/06/18 10:13:51 wlemb Exp $ @end example @xref{Request Arguments}. @@ -6215,7 +6314,7 @@ @cindex page motions @cindex motions, page -@findex sp +@findex sp@r{, as vertical page motion} Motions up and down the page can be done with the @code{sp} request. However, this causes a break so that the actual effect is to move to the left margin and then to the specified location. @@ -6232,10 +6331,11 @@ location marked with the @code{mk} request @c XXX example - +@ignore @example ... dual column example ... @end example +@end ignore The following escapes give fine control of movements about the page. @@ -6264,6 +6364,9 @@ @end ftable @findex \h +@cindex inserting horizontal space +@cindex horizontal space +@cindex space, horizontal Horizontal motions can be done via the @code{\h'@var{e}'} escape. The expression@w{ }@var{e} indicates how far to move: positive is rightwards and negative leftwards. @@ -6273,11 +6376,11 @@ @ftable @code @item \@key{SP} an unbreakable and unpaddable (i.e.@: not expanded during filling) -space. (Note: It is a backslash followed by a space.) +space. (Note: This is a backslash followed by a space.) @item \~ -an unbreakable space that stretches like a normal inter-word space when a -line is adjusted. +an unbreakable space that stretches like a normal inter-word space when +a line is adjusted. @item \| a 1/6th em space. @@ -6302,9 +6405,11 @@ @c XXX example +@ignore @example ... tex logo example ... @end example +@end ignore @findex \w @cindex width escape @@ -6316,9 +6421,11 @@ @c XXX example +@ignore @example ... strlen example ... @end example +@end ignore Font changes may occur in @var{text} which don't affect current settings. @@ -6342,18 +6449,19 @@ @item ct @vindex ct is set according to what kinds of characters occur in @var{text}: + @table @asis @item 0 only short characters, no descenders or tall characters. @item 1 -descender +descender. @item 2 -tall character +tall character. @item 3 -both a descender and a tall character +both a descender and a tall character. @end table @item ssc @@ -6385,8 +6493,8 @@ @cindex requests for drawing @code{gtroff} provides a number of ways to draw lines and other figures -on the page. Used in combination with the page motion commands -(@pxref{Page Motions}, for more info), a wide variety of figures can be +on the page. Used in combination with the page motion commands (see +@ref{Page Motions}, for more info), a wide variety of figures can be drawn. However, for complex drawings these operations can be quite cumbersome, and it may be wise to use graphic preprocessors like @code{gpic} or @code{ggrn}. @xref{gpic}, and @ref{ggrn}, for more @@ -6395,10 +6503,11 @@ All drawing is done via escapes. @findex \l -@cindex horizontal line -@cindex line, horizontal +@cindex drawing horizontal lines +@cindex horizontal line, drawing +@cindex line, horizontal, drawing The @code{\l} escape will draw a line rightwards from the current -location. The full syntax for this escape is +location. The full syntax for this escape is like this: @example \l'@var{l}@var{c}' @@ -6442,8 +6551,9 @@ the @emph{input} line. @findex \L -@cindex vertical line -@cindex line, vertical +@cindex drawing vertical lines +@cindex vertical line drawing +@cindex line, vertical, drawing @cindex line drawing character @cindex character for line drawing @cindex box rule character @@ -6457,9 +6567,11 @@ @c XXX example +@ignore @example ...box macro... @end example +@end ignore @findex \D More flexible drawing functions are available via the @code{\D} escape. @@ -6473,12 +6585,15 @@ @c XXX example +@ignore @example ...revised box macro... @end example +@end ignore @item \D'c @var{d}' -@cindex circles +@cindex circle drawing +@cindex drawing a circle Draw a circle with a diameter of @var{d} with the leftmost point at the current position. @@ -6486,7 +6601,8 @@ Draw a solid circle with the same parameters as an outlined circle. @item \D'e @var{dx} @var{dy}' -@cindex ellipses +@cindex drawing an ellipse +@cindex ellipse drawing Draw an ellipse with a horizontal diameter of @var{dx} and a vertical diameter of @var{dy} with the leftmost point at the current position. @@ -6494,18 +6610,21 @@ Draw a solid ellipse with the same parameters as an outlined ellipse. @item \D'a @var{dx1} @var{dy1} @var{dx2} @var{dy2}' -@cindex arcs +@cindex arc drawing +@cindex drawing an arc Draw an arc clockwise from the current location through the two specified locations (@var{dx1},@var{dy1}) and (@var{dx2},@var{dy2}). @item \D'~ @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...' -@cindex splines +@cindex drawing a spline +@cindex spline drawing Draw a spline from the current location to (@var{dx1},@var{dy1}) and then to (@var{dx2},@var{dy2}), and so on. @item \D'f @var{n}' @cindex gray shading @cindex shading +@cindex shades for filling objects Set the shade of gray to be used for filling solid objects to@w{ }@var{n}; @var{n}@w{ }must be an integer between 0 and@w{ }1000, where 0 corresponds solid white and 1000 to solid black, and values in between @@ -6514,25 +6633,30 @@ }1000 will be used. @item \D'p @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...' -@cindex polygons +@cindex drawing a polygon +@cindex polygon drawing Draw a polygon from the current location to (@var{dx1},@var{dy1}) and then to (@var{dx2},@var{dy2}) and so on. When the specified data points are exhausted, a line is drawn back to the starting point. @c XXX example +@ignore @example ... box example (yes, again)... @end example +@end ignore @item \D'P @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...' Draw a solid polygon with the same parameters as an outlined polygon. @c XXX example +@ignore @example ... shaded box example ... @end example +@end ignore @item \D't @var{n}' @cindex line thickness @@ -6622,14 +6746,16 @@ @c XXX +@ignore @example ... (simplified) footnote example ... @end example +@end ignore @findex vpt @findex wh -@findex dt @vindex .vpt +@cindex vertical position trap enable register The @code{vpt} request will enable vertical position traps if the argument is non-zero, disable them otherwise. Vertical position traps are traps set by the @code{wh} or @code{dt} requests. Traps set by the @@ -6639,7 +6765,7 @@ this is available in the number register @code{.vpt}. @vindex .trunc -@findex ne +@findex ne@r{, and the @code{.trunc} register} The number register @code{.trunc} contains the amount of vertical space truncated by the most recently sprung vertical position trap, or, if the trap was sprung by a @code{ne} request, minus the amount of vertical @@ -6662,7 +6788,7 @@ @cindex traps, diversion @findex dt -@vindex .t +@vindex .t@r{, and diversions} Traps can also be set @emph{within} a diversion using the @code{dt} request. Like @code{wh} the first argument is the location of the trap and the second argument is the name of the macro to be invoked. The @@ -6755,9 +6881,11 @@ @c XXX example +@ignore @example ... end-note example ... @end example +@end ignore @vindex .z @vindex .d @@ -6907,13 +7035,15 @@ partially collected lines @end itemize -These environments may be given arbitrary names (@pxref{Identifiers}, +These environments may be given arbitrary names (see @ref{Identifiers}, for more info). Old versions of @code{troff} only had environments named @samp{0}, @samp{1} and@w{ }@samp{2}. @findex ev @vindex .ev -The @code{ev} request will switch among environments. The single +@cindex switch environments +@cindex current environment number/name register +The @code{ev} request will switch to another environment. The single argument is the name of the environment to switch to. With no argument @code{gtroff} will switch back to the previous environment. There is no limit on the number of named environments; they will be created the @@ -6930,11 +7060,13 @@ @c XXX example +@ignore @example ... page break macro, revised ... @end example +@end ignore -Here another example: +Here is another example: @example .ev footnote-env @@ -6950,6 +7082,7 @@ @end example @findex evc +@cindex copy environment To copy an environment into the current one, use the @code{evc} request, which takes the name of the environment to copy from as an argument. @@ -6964,6 +7097,8 @@ @cindex output and input requests @findex so +@cindex including a file +@cindex file inclusion The @code{so} request will read in the file given as an argument and include it in place of the @code{so} request. This is quite useful for large documents, i.e.@: keeping each chapter in a separate file. @@ -7001,10 +7136,8 @@ @findex trf With @code{trf}, unlike @code{cf}, the file cannot contain characters -such as NUL that are not legal @code{gtroff} input characters. This -request causes a line break. - -@c XXX xref to illegal input characters +such as NUL that are not valid @code{gtroff} input characters +(@pxref{Identifiers}). This request causes a line break. @findex nx The @code{nx} request will force @code{gtroff} to continue processing of @@ -7091,6 +7224,7 @@ the @code{so} request. @vindex systat +@cindex @code{system()} return value register The @code{systat} number register contains the return value of the @code{system()} function executed by the last @code{sy} request. @@ -7104,9 +7238,8 @@ it instead of truncating it. @findex write -@findex ds -@cindex copy-in mode -@cindex mode, copy-in +@cindex copy-in mode, and @code{write} requests +@cindex mode, copy-in, and @code{write} requests The @code{write} request will write to the file associated with the stream specified by the first argument. The stream must previously have been the subject of an open request. The remainder of the line is @@ -7120,16 +7253,18 @@ @c XXX example +@ignore @example ... example of open write &c... @end example +@end ignore @findex \V The @code{\V} escape will interpolate the contents of the specified -environment variable, as returned by @code{getenv()}. The argument to -@code{\V} is specified as an identifier, i.e.@: @samp{\V@var{x}}, -@samp{\V(@var{xx}} or @samp{\V[@var{xxx}]}. @code{\V} is interpreted in -copy-in mode. +environment variable, as returned by the function @code{getenv}. The +argument to @code{\V} is specified as an identifier, i.e.@: +@samp{\V@var{x}}, @samp{\V(@var{xx}} or @samp{\V[@var{xxx}]}. @code{\V} +is interpreted in copy-in mode. @c ===================================================================== @@ -7167,7 +7302,7 @@ @section Miscellaneous @cindex miscellaneous -This section contains parts of @code{gtroff} which cannot (yet) be +This section documents parts of @code{gtroff} which cannot (yet) be categorized elsewhere in this manual. @findex nm @@ -7193,9 +7328,11 @@ @c XXX example +@ignore @example ... line numbering example ... @end example +@end ignore @findex mc @cindex margin characters @@ -7215,9 +7352,11 @@ @c XXX example +@ignore @example ... margin char example ... @end example +@end ignore @findex lf @pindex soelim @@ -7232,9 +7371,11 @@ @c XXX example +@ignore @example ... example of soelim'ed doc ... @end example +@end ignore @c ===================================================================== @@ -7249,8 +7390,8 @@ @itemize @bullet @item @findex tm -The @code{tm} request will send output to stderr; this is very useful -for printing debugging output. +The @code{tm} request will send output to the standard error stream; +this is very useful for printing debugging output. @item When doing something involved it is useful to leave the debugging @@ -7275,10 +7416,10 @@ will print @samp{User Abort}. @item -@findex ex +@findex ex@r{, use in debugging} @cindex exiting The @code{ex} request will also cause @code{gtroff} to stop processing -(if encountered at the topmost level; see also @ref{I/O}. +if encountered at the topmost level; see also @ref{I/O}. @item If it is known in advance that there will be many errors and no useful @@ -7323,7 +7464,7 @@ @cindex backtrace of input stack @cindex input stack, backtrace The @code{backtrace} request will print a backtrace of the input stack -on stderr. +to the standard error stream. @item @cindex warnings @@ -7403,8 +7544,8 @@ @item di @itemx 256 -@findex di -@findex da +@findex di@r{, debugging} +@findex da@r{, debugging} Use of @code{di} or @code{da} without an argument when there is no current diversion. @@ -7432,7 +7573,7 @@ @item right-brace @itemx 4096 -@findex \@} +@findex \@}@r{, debugging} Use of @code{\@}} where a number was expected. @item missing @@ -7478,6 +7619,7 @@ @section Implementation Differences @cindex implementation differences @cindex differences in implementation +@cindex incompatibilities with Unix @code{troff} @cindex compatibility mode @cindex mode, compatibility @@ -7493,8 +7635,8 @@ .dsabcd @end example -@findex \* -@findex \n +@findex \*@r{, incompatibilities with Unix @code{troff}} +@findex \n@r{, incompatibilities with Unix @code{troff}} @findex cp @vindex .C @noindent @@ -7535,7 +7677,7 @@ @cindex fractional point sizes @cindex point sizes, fractional -@findex ps +@findex ps@r{, incompatibilities with Unix @code{troff}} Fractional point sizes cause one noteworthy incompatibility. In @acronym{UNIX} @code{troff} the @code{ps} request ignores scale indicators and thus @@ -7549,14 +7691,14 @@ will set the point size to 10@w{ }scaled points. @xref{Fractional Type Sizes}, for more information. -@findex bd -@findex cs -@findex tkf -@findex tr -@findex fp -@cindex input and output characters -@cindex output characters -@cindex characters, input and output +@findex bd@r{, incompatibilities with Unix @code{troff}} +@findex cs@r{, incompatibilities with Unix @code{troff}} +@findex tkf@r{, incompatibilities with Unix @code{troff}} +@findex tr@r{, incompatibilities with Unix @code{troff}} +@findex fp@r{, incompatibilities with Unix @code{troff}} +@cindex input and output characters, compatibility with Unix +@cindex output characters, compatibility with Unix +@cindex characters, input and output, compatibility with Unix In GNU @code{troff} there is a fundamental difference between unformatted, input characters, and formatted, output characters. Everything that affects how an output character will be output is stored @@ -7580,11 +7722,11 @@ .x @end example -@findex \e -@findex \! -@findex \? -@cindex transparent output -@cindex output, transparent +@findex \e@r{, incompatibilities with Unix @code{troff}} +@findex \!@r{, incompatibilities with Unix @code{troff}} +@findex \?@r{, incompatibilities with Unix @code{troff}} +@cindex transparent output, incompatibilities with Unix @code{troff} +@cindex output, transparent, incompatibilities with Unix @code{troff} @noindent will print @samp{\\} in GNU @code{troff}; each pair of input backslashes is turned into one output backslash and the resulting output backslashes @@ -7732,7 +7874,7 @@ @section @code{grap} @cindex @code{grap} -A freely available implementation of @code{grap}, written by Ted Faber, +A free implementation of @code{grap}, written by Ted Faber, is available as an extra package from the following address: @display @@ -8080,7 +8222,7 @@ command. @kindex tcommand -@pindex DESC +@pindex DESC@r{, and @code{tcommand}} This command is only allowed if the @samp{tcommand} line is present in the @file{DESC} file. @@ -8100,7 +8242,7 @@ @item s@var{n} @kindex sizescale -@pindex DESC +@pindex DESC@r{, and @code{sizescale}} The argument to the @samp{s} command is in scaled points (units of points/@var{n}, where @var{n} is the argument to the @samp{sizescale} command in the @file{DESC} file). @@ -8162,9 +8304,11 @@ @c XXX example +@ignore @example ... sample output here ... @end example +@end ignore @c --------------------------------------------------------------------- @@ -8291,8 +8435,8 @@ there is no associated binary format; all files are text files. The font files for device @var{name} are stored in a directory @file{dev@var{name}}. There are two types of file: a device description -file called @file{DESC} and for each font@w{ }@samp{F} a font file -called@w{ }@file{F}. +file called @file{DESC} and for each font@w{ }@var{f} a font file +called@w{ }@file{@var{f}}. @menu * DESC file format:: @@ -8306,7 +8450,7 @@ @cindex @file{DESC} file format @cindex font description file format @cindex format of font description file -@pindex DESC +@pindex DESC@r{ file format} The @file{DESC} file can contain the following types of line: @@ -8371,7 +8515,7 @@ @end table The @code{res}, @code{unitwidth}, @code{fonts} and @code{sizes} lines -are compulsory. Other commands are ignored by @code{gtroff} but may be +are mandatory. Other commands are ignored by @code{gtroff} but may be used by postprocessors to store arbitrary information about the device in the @file{DESC} file. @@ -8390,9 +8534,9 @@ the line is a key, and subsequent words give a value for that key. @table @code -@item name @var{F} +@item name @var{f} @kindex name -The name of the font is@w{ }@var{F}. +The name of the font is@w{ }@var{f}. @item spacewidth @var{n} @kindex spacewidth diff -aruN groff-1.16/doc/texinfo.tex groff-1.16.1/doc/texinfo.tex --- groff-1.16/doc/texinfo.tex Sun Mar 19 18:26:39 2000 +++ groff-1.16.1/doc/texinfo.tex Sun Jul 30 13:47:35 2000 @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{1999-09-25.10} +\def\texinfoversion{2000-05-28.15} % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 % Free Software Foundation, Inc. @@ -214,6 +214,9 @@ \normalturnoffactive % \ in index entries must not stay \, e.g., if % 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 + % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin @@ -243,8 +246,6 @@ \unvbox\footlinebox \fi % - \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi - % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup @@ -891,7 +892,7 @@ \fi} \def\pdfmkdest#1{\pdfdest name{#1@} xyz} \def\pdfmkpgn#1{#1@} - \let\linkcolor = \Cyan + \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak @@ -906,7 +907,8 @@ \closein 1 \indexnofonts \def\tt{} - % thanh's hack / proper braces in bookmarks + \let\_ = \normalunderscore + % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % @@ -1670,7 +1672,10 @@ } % Subroutines used in generating headings -% Produces Day Month Year style of output. +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined \def\today{% \number\day\space \ifcase\month @@ -1679,6 +1684,7 @@ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} +\fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. @@ -4710,7 +4716,8 @@ \def\deftypeivarheader#1#2#3{% \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index \begingroup - \defname{#3}{\putwordInstanceVariableof\ \code{#1}}% + \defname{\defheaderxcond#2\relax$$$#3} + {\putwordInstanceVariableof\ \code{#1}}% \defvarargs{#3}% \endgroup } @@ -5794,7 +5801,7 @@ % Use @afourwide to print on European A4 paper in wide format. \def\afourwide{% \afourpaper - \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% + \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% % \globaldefs = 0 } diff -aruN groff-1.16/gendef.sh groff-1.16.1/gendef.sh --- groff-1.16/gendef.sh Sun Feb 6 10:34:43 2000 +++ groff-1.16.1/gendef.sh Sun Jun 18 12:13:50 2000 @@ -11,7 +11,11 @@ #define $def" done -t=/tmp/groff.$$ +# Use $TMPDIR if defined. Default to cwd, for non-Unix systems +# which don't have /tmp on each drive (we are going to remove +# the file before we exit anyway). Put the PID in the basename, +# since the extension can only hold 3 characters on MS-DOS. +t=${TMPDIR-.}/gro$$.tmp sed -e 's/=/ /' >$t < -#include -#endif +#include "nonposix.h" #define DEFAULT_LINEWIDTH 40 static int linewidth = DEFAULT_LINEWIDTH; @@ -854,9 +851,6 @@ static char stderr_buf[BUFSIZ]; setbuf(stderr, stderr_buf); int c; -#ifdef _MSC_VER - _setmode(_fileno(stdout), _O_BINARY); -#endif while ((c = getopt(argc, argv, "F:vw:d")) != EOF) switch(c) { case 'v': @@ -885,6 +879,9 @@ default: assert(0); } +#ifdef SET_BINARY + SET_BINARY(fileno(stdout)); +#endif if (optind >= argc) do_file("-"); else { diff -aruN groff-1.16/src/devices/grohtml/ChangeLog groff-1.16.1/src/devices/grohtml/ChangeLog --- groff-1.16/src/devices/grohtml/ChangeLog Sat May 13 01:27:49 2000 +++ groff-1.16.1/src/devices/grohtml/ChangeLog Sun Jun 18 12:09:09 2000 @@ -1,3 +1,22 @@ +2000-06-17 Eli Zaretskii + + * html.cc [!_POSIX_VERSION]: Include limits.h and dirent.h or + sys/dir.h. Define NAME_MAX using MAXNAMLEN. Include nonposix.h. + (file_name_max): New function. + (html_printer::make_new_image_name): If the filesystem doesn't + support file names longer than 14 characters, use a shorter + image_name string. + (html_printer::convert_to_image): Enlarge the size of buffer[] to + accomodate 2 temp file names plus some slack. Don't put \n at the + end of commands passed to system(). Redirect stderr to the null + device programmatically, not via the shell. Use NULL_DEV, not + literal "/dev/null". Print diagnostics if any calls to system() + failed. + +2000-05-31 Keith Thompson + + * html.cc: Added declaration of mktemp() as needed for SunOS 4.1.3. + 2000-05-11 Werner LEMBERG * output.cc (simple_output::simple_output): Reordering of @@ -6,8 +25,8 @@ 2000-04-28 Gaius Mulley * html.cc (calculate_margin): Calculate the left and right margin - irrespective of the boolean `margin_on'. Fixes a divide by zero - bug and a column bug as reported by Steve Blinkhorn . + irrespective of the boolean `margin_on'. Fixes a divide by zero bug + and a column bug as reported by Steve Blinkhorn . Improved the behaviour of the -m (margin on) option. * html.cc (make_html_indent): More checking. diff -aruN groff-1.16/src/devices/grohtml/html.cc groff-1.16.1/src/devices/grohtml/html.cc --- groff-1.16/src/devices/grohtml/html.cc Sun Apr 30 07:09:24 2000 +++ groff-1.16.1/src/devices/grohtml/html.cc Sun Jun 18 12:09:09 2000 @@ -35,9 +35,44 @@ #include #endif +extern "C" { + // SunOS 4.1.3 fails to declare this in stdlib.h + char *mktemp(char *); +} + #include #include +#ifndef _POSIX_VERSION + +#ifdef HAVE_LIMITS_H +#include +#endif /* HAVE_LIMITS_H */ + +#ifdef HAVE_DIRENT_H +#include +#else /* not HAVE_DIRENT_H */ +#ifdef HAVE_SYS_DIR_H +#include +#endif /* HAVE_SYS_DIR_H */ +#endif /* not HAVE_DIRENT_H */ + +#ifndef NAME_MAX +#ifdef MAXNAMLEN +#define NAME_MAX MAXNAMLEN +#else /* !MAXNAMLEN */ +#ifdef MAXNAMELEN +#define NAME_MAX MAXNAMELEN +#else /* !MAXNAMELEN */ +#define NAME_MAX 14 +#endif /* !MAXNAMELEN */ +#endif /* !MAXNAMLEN */ +#endif /* !NAME_MAX */ + +#endif /* not _POSIX_VERSION */ + +#include "nonposix.h" + #include "ordered_list.h" #if !defined(TRUE) @@ -1529,6 +1564,24 @@ } /* + * file_name_max - return the maximum file-name length permitted + * by the underlying filesystem. + * + * (Code shamelessly stolen from indxbib/dirnamemax.c.) + */ + +static size_t +file_name_max (const char *fname) +{ +#ifdef _POSIX_VERSION + return pathconf (fname, _PC_NAME_MAX); +#else + return NAME_MAX; +#endif +} + + +/* * make_new_image_name - creates a new file name ready for a image file. */ @@ -1539,10 +1592,31 @@ if ((current_filename == 0) || (strcmp(current_filename, "") == 0) || (strcmp(current_filename, "-") == 0) || - (strchr(current_filename, '/') != 0)) { - sprintf(image_name, "grohtml-%d-%ld", image_number, (long)getpid()); - } else { + (strcspn(current_filename, DIR_SEPS) < strlen(current_filename))) { + if (file_name_max(".") > 14) + sprintf(image_name, "groff-html-%d-%ld", image_number, (long)getpid()); + else + // The "-gh" part might be truncated on MS-DOS, but there's enough + // space for the PID and up to 99 image numbers. That's why "-gh" + // comes last. + sprintf(image_name, "%d-%ld-gh", image_number, (long)getpid()); + } else if (file_name_max(".") > 14) { sprintf(image_name, "%s-%d-%ld", current_filename, image_number, (long)getpid()); + } else { // see the commentary above + sprintf(image_name, "%d-%ld-%s", + image_number, (long)getpid(), current_filename); + // Make sure image_name does not have a dot in its trunk, since + // convert_to_image will append .gif or .png to it, and DOS doesn't + // allow more than a single dot in a file name. + int i = strlen(image_name); + for ( ; i > 0; i--) { + if (strchr(DIR_SEPS, image_name[i - 1])) + break; + if (image_name[i - 1] == '.') { + image_name[i - 1] = '\0'; + break; + } + } } } @@ -2394,26 +2468,33 @@ void html_printer::convert_to_image (char *troff_src, char *image_name) { - char buffer[1024]; + char buffer[MAX_STRING_LENGTH*2 + 200]; char *ps_src = mktemp(xtmptemplate("-ps-")); - sprintf(buffer, "grops %s > %s\n", troff_src, ps_src); + sprintf(buffer, "grops%s %s > %s", EXE_EXT, troff_src, ps_src); if (debug_on) { - fprintf(stderr, buffer); + fprintf(stderr, "%s\n", buffer); + } + int status = system(buffer); + if (status == -1) { + fprintf(stderr, "\"%s\" failed (no grops on PATH?)\n", buffer); + return; + } + else if (status) { + fprintf(stderr, "\"%s\" returned status %d\n", buffer, status); } - system(buffer); if (image_type == gif) { sprintf(buffer, - "echo showpage | gs -q -dSAFER -sDEVICE=ppmraw -r%d -g%dx%d -sOutputFile=- %s - | ppmquant 256 2> /dev/null | ppmtogif 2> /dev/null > %s.gif \n", - image_res, + "echo showpage | gs%s -q -dSAFER -sDEVICE=ppmraw -r%d -g%dx%d -sOutputFile=- %s - | ppmquant%s 256 | ppmtogif%s > %s.gif", + EXE_EXT, image_res, (end_region_hpos-start_region_hpos)*image_res/font::res+IMAGE_BOARDER_PIXELS, (end_region_vpos-start_region_vpos)*image_res/font::res+IMAGE_BOARDER_PIXELS, - ps_src, image_name); + ps_src, EXE_EXT, EXE_EXT, image_name); } else { sprintf(buffer, - "echo showpage | gs -q -dSAFER -sDEVICE=%s -r%d -g%dx%d -sOutputFile=- %s - 2> /dev/null > %s.png \n", - image_device, + "echo showpage | gs%s -q -dSAFER -sDEVICE=%s -r%d -g%dx%d -sOutputFile=- %s - > %s.png", + EXE_EXT, image_device, image_res, (end_region_hpos-start_region_hpos)*image_res/font::res+IMAGE_BOARDER_PIXELS, (end_region_vpos-start_region_vpos)*image_res/font::res+IMAGE_BOARDER_PIXELS, @@ -2429,9 +2510,29 @@ #endif } if (debug_on) { - fprintf(stderr, "%s", buffer); + fprintf(stderr, "%s\n", buffer); + } + // Redirect standard error to the null device. This is more + // portable than using "2> /dev/null" inside the commands above, + // since it doesn't require a Unixy shell. + int save_stderr = dup(2); + if (save_stderr > 2) { + int fdnull = open(NULL_DEV, O_WRONLY|O_BINARY, 0666); + if (fdnull > 2) + dup2(fdnull, 2); + if (fdnull >= 0) + close(fdnull); + } + status = system(buffer); + dup2(save_stderr, 2); + if (status == -1) { + fprintf(stderr, + "Conversion to image failed (no gs/ppmquant/ppmtogif on PATH?)\n"); + } + else if (status) { + fprintf(stderr, + "Conversion to image returned status %d\n", status); } - system(buffer); unlink(ps_src); unlink(troff_src); } diff -aruN groff-1.16/src/devices/grolbp/lbp.cc groff-1.16.1/src/devices/grolbp/lbp.cc --- groff-1.16/src/devices/grolbp/lbp.cc Sat May 13 01:27:51 2000 +++ groff-1.16.1/src/devices/grolbp/lbp.cc Sun Jun 18 12:13:55 2000 @@ -31,6 +31,16 @@ #include "lbp.h" #include "charset.h" +#include "nonposix.h" + +#ifdef HAVE_STRNCASECMP +#ifdef NEED_DECLARATION_STRNCASECMP +extern "C" { + // SunOS's string.h fails to declare this. + int strncasecmp(const char *, const char *, int); +} +#endif /* NEED_DECLARATION_STRNCASECMP */ +#endif /* HAVE_STRNCASECMP */ static short int papersize = -1, // papersize orientation = -1 , // orientation @@ -50,7 +60,6 @@ lbp_font(const char *); }; - class lbp_printer : public printer { public: lbp_printer(); @@ -66,8 +75,8 @@ void vdmstart(); void vdmflush(); // the name vdmend was already used in lbp.h void setfillmode(int mode); - void lbp_printer::polygon( int hpos,int vpos,int np,int *p); - char *lbp_printer::font_name(const lbp_font *f, const int siz); + void polygon( int hpos,int vpos,int np,int *p); + char *font_name(const lbp_font *f, const int siz); int fill_pattern; int fill_mode; @@ -168,6 +177,9 @@ cur_symbol_set(0), line_thickness(-1) { +#ifdef SET_BINARY + SET_BINARY(fileno(stdout)); +#endif lbpinit(stdout); lbpputs("\033c\033;\033[2&z\033[7 I\033[?32h\033[?33h\033[11h"); wp54charset(); // Define the new symbol set @@ -422,8 +434,8 @@ if (vdminited()) vdmlinewidth(line_thickness); // fprintf(stderr,"\nthickness: %d == %d, size %d\n", // p[0],line_thickness,env->size ); - break; } // else + break; case 'l': // Line if (np != 2) { @@ -490,7 +502,7 @@ // We must compensate for that, exchanging the starting and // ending points vdmvarc(env->hpos + p[0],env->vpos+p[1],\ - int(sqrt( (p[0]*p[0])+(p[1]*p[1]))),\ + int(sqrt( double((p[0]*p[0])+(p[1]*p[1])))),\ p[2],p[3],\ (-p[0]),(-p[1]),1,2); break; diff -aruN groff-1.16/src/devices/grolbp/lbp.h groff-1.16.1/src/devices/grolbp/lbp.h --- groff-1.16/src/devices/grolbp/lbp.h Sun Feb 27 02:42:12 2000 +++ groff-1.16.1/src/devices/grolbp/lbp.h Sun Jun 11 08:27:26 2000 @@ -350,7 +350,7 @@ { static int lx = 0 ,ly = 0; static float pend = 0.0; - static int dx = 0,dy = 0, despx = 0, despy = 0, sigpend = 0; + static int dy = 0, despx = 0, despy = 0, sigpend = 0; int dxnew ,dynew, sg; char xcoord[4],ycoord[4]; float npend ; @@ -389,7 +389,7 @@ /*if ((despx != 0) || (despy != 0)) fprintf(stderr,"2 *%d,%d\n",despx,despy);*/ if (flush) { - dx = dxnew = dy = despx = despy = 0; + dxnew = dy = despx = despy = 0; return; }; /* if (flush) */ dxnew -= despx; @@ -400,7 +400,7 @@ /* if ((dxnew != 0) || (dynew != 0)) fprintf(stderr,"3 * %d,%d\n",dxnew,dynew);*/ lx = (int)px; ly = (int)py; - dx = dxnew = dy = despx = despy = 0; + dxnew = dy = despx = despy = 0; }; /* splinerel */ diff -aruN groff-1.16/src/devices/grolj4/lj4.cc groff-1.16.1/src/devices/grolj4/lj4.cc --- groff-1.16/src/devices/grolj4/lj4.cc Mon Feb 28 12:02:08 2000 +++ groff-1.16.1/src/devices/grolj4/lj4.cc Sun Jun 18 12:13:56 2000 @@ -33,6 +33,7 @@ */ #include "driver.h" +#include "nonposix.h" static struct { const char *name; @@ -676,6 +677,9 @@ default: assert(0); } +#ifdef SET_BINARY + SET_BINARY(fileno(stdout)); +#endif if (optind >= argc) do_file("-"); else { diff -aruN groff-1.16/src/devices/grops/ps.cc groff-1.16.1/src/devices/grops/ps.cc --- groff-1.16/src/devices/grops/ps.cc Sat Apr 22 15:17:42 2000 +++ groff-1.16.1/src/devices/grops/ps.cc Sun Jun 18 12:13:56 2000 @@ -21,6 +21,7 @@ #include "driver.h" #include "stringclass.h" #include "cset.h" +#include "nonposix.h" #include "ps.h" #include @@ -1519,6 +1520,9 @@ assert(0); } font::set_unknown_desc_command_handler(handle_unknown_desc_command); +#ifdef SET_BINARY + SET_BINARY(fileno(stdout)); +#endif if (optind >= argc) do_file("-"); else { diff -aruN groff-1.16/src/include/Makefile.sub groff-1.16.1/src/include/Makefile.sub --- groff-1.16/src/include/Makefile.sub Sat Apr 29 08:02:46 2000 +++ groff-1.16.1/src/include/Makefile.sub Sun Jun 18 12:13:58 2000 @@ -13,6 +13,7 @@ index.h \ lib.h \ macropath.h \ + nonposix.h \ posix.h \ printer.h \ ptable.h \ diff -aruN groff-1.16/src/include/lib.h groff-1.16.1/src/include/lib.h --- groff-1.16/src/include/lib.h Sat Apr 29 08:02:46 2000 +++ groff-1.16.1/src/include/lib.h Sun Jun 11 08:27:26 2000 @@ -36,17 +36,17 @@ FILE *xtmpfile(char **namep=0, char *postfix=0, int do_unlink=1); char *xtmptemplate(char *extension=0); -#ifndef STDIO_H_DECLARES_POPEN +#ifdef NEED_DECLARATION_POPEN extern "C" { FILE *popen(const char *, const char *); } -#endif /* not STDIO_H_DECLARES_POPEN */ +#endif /* NEED_DECLARATION_POPEN */ -#ifndef STDIO_H_DECLARES_PCLOSE +#ifdef NEED_DECLARATION_PCLOSE extern "C" { int pclose (FILE *); } -#endif /* not STDIO_H_DECLARES_PCLOSE */ +#endif /* NEED_DECLARATION_PCLOSE */ int interpret_lf_args(const char *p); @@ -59,6 +59,10 @@ #ifndef HAVE_STRCASECMP #define strcasecmp(a,b) strcmp((a),(b)) +#endif + +#ifndef HAVE_STRNCASECMP +#define strncasecmp(a,b,c) strncmp((a),(b),(c)) #endif #ifdef HAVE_CC_LIMITS_H diff -aruN groff-1.16/src/include/nonposix.h groff-1.16.1/src/include/nonposix.h --- groff-1.16/src/include/nonposix.h Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/src/include/nonposix.h Mon Jul 31 14:12:33 2000 @@ -0,0 +1,137 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + Written by Eli Zaretskii (eliz@is.elta.co.il) + +This file is part of groff. + +groff 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. + +groff 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 groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This header file compartmentalize all idiosyncrasies of non-Posix + systems, such as MS-DOS, MS-Windows, etc. */ + +#if defined _MSC_VER +# ifndef _WIN32 +# define _WIN32 +# endif +# define setmode(f,m) _setmode(f,m) +# define fileno(f) _fileno(f) +#endif + +#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN32__)) + +/* Binary I/O nuisances. Note: "setmode" is right for DJGPP and + Borland; Windows compilers might need _setmode or some such. */ +# include +# include +# ifdef HAVE_UNISTD_H +# include +# endif +# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) +# define FOPEN_RB "rb" +# define FOPEN_WB "wb" +# define FOPEN_RWB "wb+" +# ifdef _MSC_VER +# define POPEN_RT "rt" +# define POPEN_WT "wt" +# define popen(c,m) _popen(c,m) +# define pclose(p) _pclose(p) +# define getpid() (1) +# endif +# ifndef O_BINARY +# ifdef _O_BINARY +# define O_BINARY (_O_BINARY) +# endif +# endif + +/* The system shell. Groff assumes a Unixy shell, but non-Posix + systems don't have standard places where it lives, and might not + have it installed to begin with. We want to give them some leeway. */ +# define BSHELL (system_shell_name()) +# define BSHELL_DASH_C (system_shell_dash_c()) +# define IS_BSHELL(s) (is_system_shell(s)) + +/* The separator for directories in PATH and other environment + variables. */ +# define PATH_SEP ";" + +/* Characters that separate directories in a path name. */ +# define DIR_SEPS "/\\:" + +/* How to tell if the argument is an absolute file name. */ +# define IS_ABSOLUTE(f) \ + ((f)[0] == '/' || (f)[0] == '\\' || (f)[0] && (f)[1] == ':') + +/* The executable extension. */ +# define EXE_EXT ".exe" + +/* The system null device. */ +# define NULL_DEV "NUL" + +/* Prototypes. */ +# ifdef __cplusplus + extern "C" { +# endif + const char * system_shell_name(void); + const char * system_shell_dash_c(void); + int is_system_shell(const char *); +# ifdef __cplusplus + } +# endif + +#endif + +/* Defaults, for Posix systems. */ + +#ifndef FOPEN_RB +# define FOPEN_RB "r" +#endif +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef FOPEN_RWB +# define FOPEN_RWB "w+" +#endif +#ifndef POPEN_RT +# define POPEN_RT "r" +#endif +#ifndef POPEN_WT +# define POPEN_WT "w" +#endif +#ifndef O_BINARY +# define O_BINARY 0 +#endif +#ifndef BSHELL +# define BSHELL "/bin/sh" +#endif +#ifndef BSHELL_DASH_C +# define BSHELL_DASH_C "-c" +#endif +#ifndef IS_BSHELL +# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0) +#endif +#ifndef PATH_SEP +# define PATH_SEP ":" +#endif +#ifndef DIR_SEPS +# define DIR_SEPS "/" +#endif +#ifndef IS_ABSOLUTE +# define IS_ABSOLUTE(f) ((f)[0] == '/') +#endif +#ifndef EXE_EXT +# define EXE_EXT "" +#endif +#ifndef NULL_DEV +# define NULL_DEV "/dev/null" +#endif diff -aruN groff-1.16/src/include/posix.h groff-1.16.1/src/include/posix.h --- groff-1.16/src/include/posix.h Sat Apr 22 15:17:43 2000 +++ groff-1.16.1/src/include/posix.h Mon Jun 26 15:57:26 2000 @@ -25,7 +25,7 @@ #include #else #include -#ifndef _MSC_VER +#ifdef HAVE_UNISTD_H #include #endif #endif diff -aruN groff-1.16/src/libs/libbib/index.cc groff-1.16.1/src/libs/libbib/index.cc --- groff-1.16/src/libs/libbib/index.cc Sun Feb 6 10:37:10 2000 +++ groff-1.16.1/src/libs/libbib/index.cc Sun Jun 18 12:13:59 2000 @@ -35,6 +35,8 @@ #include "index.h" #include "defs.h" +#include "nonposix.h" + // Interface to mmap. extern "C" { void *mapread(int fd, int len); @@ -274,7 +276,7 @@ char *index_filename = new char[strlen(filename) + sizeof(INDEX_SUFFIX)]; strcpy(index_filename, filename); strcat(index_filename, INDEX_SUFFIX); - int fd = open(index_filename, O_RDONLY); + int fd = open(index_filename, O_RDONLY | O_BINARY); if (fd < 0) return 0; index_search_item *item = new index_search_item(index_filename, fid); @@ -358,7 +360,7 @@ } tag *tp = indx->tags + tagno; const char *filename = indx->munge_filename(indx->pool + tp->filename_index); - int fd = open(filename, O_RDONLY); + int fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) { error("can't open `%1': %2", filename, strerror(errno)); return 0; @@ -376,7 +378,7 @@ return 0; } int res = 0; - FILE *fp = fdopen(fd, "r"); + FILE *fp = fdopen(fd, FOPEN_RB); if (!fp) { error("fdopen failed"); close(fd); @@ -410,6 +412,20 @@ error("fread on `%1' failed: %2", filename, strerror(errno)); else { buf[0] = '\n'; + // Remove the CR characters from CRLF pairs. + int sidx = 1, didx = 1; + for ( ; sidx < length + 1; sidx++, didx++) + { + if (buf[sidx] == '\r') + { + if (buf[++sidx] != '\n') + buf[didx++] = '\r'; + else + length--; + } + if (sidx != didx) + buf[didx] = buf[sidx]; + } buf[length + 1] = '\n'; res = searcher.search(buf + 1, buf + 2 + length, pp, lenp); if (res && ridp) @@ -424,10 +440,11 @@ const char *index_search_item::munge_filename(const char *filename) { - if (filename[0] == '/') + if (IS_ABSOLUTE(filename)) return filename; const char *cwd = pool; - int need_slash = (cwd[0] != 0 && strchr(cwd, '\0')[-1] != '/'); + int need_slash = (cwd[0] != 0 + && strchr(DIR_SEPS, strchr(cwd, '\0')[-1]) == 0); int len = strlen(cwd) + strlen(filename) + need_slash + 1; if (len > filename_buflen) { a_delete filename_buffer; @@ -614,7 +631,7 @@ if (stat(path, &sb) < 0) error("can't stat `%1': %2", path, strerror(errno)); else if (sb.st_mtime > mtime) { - int fd = open(path, O_RDONLY); + int fd = open(path, O_RDONLY | O_BINARY); if (fd < 0) error("can't open `%1': %2", path, strerror(errno)); else diff -aruN groff-1.16/src/libs/libbib/linear.cc groff-1.16.1/src/libs/libbib/linear.cc --- groff-1.16/src/libs/libbib/linear.cc Sun Feb 6 10:37:10 2000 +++ groff-1.16.1/src/libs/libbib/linear.cc Sun Jun 18 12:13:59 2000 @@ -30,6 +30,7 @@ #include "error.h" #include "cset.h" #include "cmap.h" +#include "nonposix.h" #include "refid.h" #include "search.h" @@ -330,6 +331,19 @@ else { close(fd); buffer[3] = '\n'; + int sidx = 4, didx = 4; + for ( ; sidx < size + 4; sidx++, didx++) + { + if (buffer[sidx] == '\r') + { + if (buffer[++sidx] != '\n') + buffer[didx++] = '\r'; + else + size--; + } + if (sidx != didx) + buffer[didx] = buffer[sidx]; + } bufend = buffer + 4 + size; if (bufend[-1] != '\n') *bufend++ = '\n'; diff -aruN groff-1.16/src/libs/libbib/search.cc groff-1.16.1/src/libs/libbib/search.cc --- groff-1.16/src/libs/libbib/search.cc Sun Feb 6 10:37:11 2000 +++ groff-1.16.1/src/libs/libbib/search.cc Sun Jun 18 12:13:59 2000 @@ -27,6 +27,7 @@ #include "lib.h" #include "errarg.h" #include "error.h" +#include "nonposix.h" #include "refid.h" #include "search.h" @@ -53,7 +54,7 @@ { search_item *p = make_index_search_item(filename, next_fid); if (!p) { - int fd = open(filename, O_RDONLY); + int fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) { if (!silent) error("can't open `%1': %2", filename, strerror(errno)); diff -aruN groff-1.16/src/libs/libgroff/font.cc groff-1.16.1/src/libs/libgroff/font.cc --- groff-1.16/src/libs/libgroff/font.cc Sun Feb 6 10:37:14 2000 +++ groff-1.16.1/src/libs/libgroff/font.cc Sun Jun 18 12:14:01 2000 @@ -471,7 +471,7 @@ return p; } -// If the font can't be found, then if not_found is NULL it will be set +// If the font can't be found, then if not_found is non-NULL, it will be set // to 1 otherwise a message will be printed. int font::load(int *not_found) diff -aruN groff-1.16/src/libs/libgroff/searchpath.cc groff-1.16.1/src/libs/libgroff/searchpath.cc --- groff-1.16/src/libs/libgroff/searchpath.cc Fri Mar 3 00:44:12 2000 +++ groff-1.16.1/src/libs/libgroff/searchpath.cc Sun Jun 18 12:14:01 2000 @@ -25,6 +25,7 @@ #include "lib.h" #include "searchpath.h" +#include "nonposix.h" search_path::search_path(const char *envvar, const char *standard) { @@ -32,7 +33,7 @@ if (e && standard) { dirs = new char[strlen(e) + strlen(standard) + 2]; strcpy(dirs, e); - strcat(dirs, ":"); + strcat(dirs, PATH_SEP); strcat(dirs, standard); } else @@ -59,11 +60,11 @@ char *p = dirs; p += old_len - init_len; if (init_len == 0) - *p++ = ':'; + *p++ = PATH_SEP[0]; memcpy(p, s, slen); p += slen; if (init_len > 0) { - *p++ = ':'; + *p++ = PATH_SEP[0]; memcpy(p, old + old_len - init_len, init_len); p += init_len; } @@ -75,7 +76,7 @@ FILE *search_path::open_file(const char *name, char **pathp) { assert(name != 0); - if (*name == '/' || dirs == 0 || *dirs == '\0') { + if (IS_ABSOLUTE(name) || dirs == 0 || *dirs == '\0') { FILE *fp = fopen(name, "r"); if (fp) { if (pathp) @@ -88,14 +89,10 @@ unsigned namelen = strlen(name); char *p = dirs; for (;;) { -#ifdef _MSC_VER - char *end = strchr(p, ';'); -#else - char *end = strchr(p, ':'); -#endif + char *end = strchr(p, PATH_SEP[0]); if (!end) end = strchr(p, '\0'); - int need_slash = end > p && end[-1] != '/'; + int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0; char *path = new char[(end - p) + need_slash + namelen + 1]; memcpy(path, p, end - p); if (need_slash) diff -aruN groff-1.16/src/libs/libgroff/tmpfile.cc groff-1.16.1/src/libs/libgroff/tmpfile.cc --- groff-1.16/src/libs/libgroff/tmpfile.cc Fri Mar 10 02:30:37 2000 +++ groff-1.16.1/src/libs/libgroff/tmpfile.cc Fri Jul 21 12:23:29 2000 @@ -27,9 +27,11 @@ #include "lib.h" #include "errarg.h" #include "error.h" +#include "nonposix.h" extern "C" { - // Sun's stdlib.h fails to declare this. + // Solaris 2.5.1 has these functions, + // but its stdlib.h fails to declare them. char *mktemp(char *); int mkstemp(char *); } @@ -38,8 +40,13 @@ #define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR" // otherwise if this is set, create temporary files there #define TMPDIR_ENVVAR "TMPDIR" +// otherwise if P_tmpdir is defined, create temporary files there +#ifdef P_tmpdir +# define DEFAULT_TMPDIR P_tmpdir +#else // otherwise create temporary files here. -#define DEFAULT_TMPDIR "/tmp" +# define DEFAULT_TMPDIR "/tmp" +#endif // Use this as the prefix for temporary filenames. #define TMPFILE_PREFIX "groff" @@ -64,9 +71,10 @@ if (!dir) dir = DEFAULT_TMPDIR; } - - const char *p = strrchr(dir, '/'); - int needs_slash = (!p || p[1]); + + size_t dir_len = strlen(dir); + const char *dir_end = dir + dir_len - 1; + int needs_slash = strchr(DIR_SEPS, *dir_end) == NULL; char *templ = new char[strlen(dir) + needs_slash + sizeof(TMPFILE_PREFIX) - 1 + 6 + 1 + postlen]; strcpy(templ, dir); @@ -80,6 +88,51 @@ return( templ ); } +// The trick with unlinking the temporary file while it is still in +// use is not portable, it will fail on MS-DOS and most MS-Windows +// filesystems. So it cannot be used on non-Posix systems. +// Instead, we maintain a list of files to be deleted on exit, and +// register an atexit function that will remove them all in one go. +// This should be portable to all platforms. + +static struct xtmpfile_list { + struct xtmpfile_list *next; + char *fname; +} *xtmpfiles_to_delete; + +static void remove_tmp_files(void) +{ + struct xtmpfile_list *p = xtmpfiles_to_delete; + + while (p) + { + if (unlink(p->fname) < 0) + error("cannot unlink `%1': %2", p->fname, strerror(errno)); + a_delete p->fname; + struct xtmpfile_list *old = p; + p = p->next; + free(old); + } +} + +static void add_tmp_file(const char *name) +{ + if (xtmpfiles_to_delete == NULL) + atexit(remove_tmp_files); + + char *fname = new char[FILENAME_MAX]; + struct xtmpfile_list *p + = (struct xtmpfile_list *)malloc(sizeof(struct xtmpfile_list)); + if (p == NULL) + { + error("cannot unlink `%1': %2", name, strerror(errno)); + return; + } + p->next = xtmpfiles_to_delete; + p->fname = strcpy(fname, name); + xtmpfiles_to_delete = p; +} + // Open a temporary file and with fatal error on failure. #ifndef _MSC_VER @@ -94,19 +147,19 @@ if (fd < 0) fatal("cannot create temporary file: %1", strerror(errno)); errno = 0; - FILE *fp = fdopen(fd, "w+"); + FILE *fp = fdopen(fd, FOPEN_RWB); // many callers of xtmpfile use binary I/O if (!fp) fatal("fdopen: %1", strerror(errno)); #else /* not HAVE_MKSTEMP */ if (!mktemp(templ) || !templ[0]) fatal("cannot create file name for temporary file"); errno = 0; - FILE *fp = fopen(templ, "w+"); + FILE *fp = fopen(templ, FOPEN_RWB); if (!fp) fatal("cannot open `%1': %2", templ, strerror(errno)); #endif /* not HAVE_MKSTEMP */ - if ((do_unlink) && (unlink(templ) < 0)) - error("cannot unlink `%1': %2", templ, strerror(errno)); + if (do_unlink) + add_tmp_file(templ); if ((namep != 0) && ((*namep) != 0)) { *namep = templ; } else { @@ -116,6 +169,11 @@ } #else + +// FIXME: does MSVC have mktemp or mkstemp? If so, it should now +// use the version above, as it no longer removes an open file. +// The version below will NOT work with grohtml, since grohtml +// wants to know the name of the file opened by xtmpfile!! // If you're not running Unix, the following will do: FILE *xtmpfile(char **namep, char *postfix, int do_unlink) diff -aruN groff-1.16/src/preproc/eqn/Makefile.sub groff-1.16.1/src/preproc/eqn/Makefile.sub --- groff-1.16/src/preproc/eqn/Makefile.sub Tue Mar 7 23:17:59 2000 +++ groff-1.16.1/src/preproc/eqn/Makefile.sub Sun Jun 18 12:14:03 2000 @@ -38,7 +38,7 @@ $(srcdir)/pbox.h GRAM=$(srcdir)/eqn.y YTABC=$(srcdir)/eqn.cc -YTABH=$(srcdir)/eqn.tab.h +YTABH=$(srcdir)/eqn_tab.h NAMEPREFIX=$(g) CLEANADD=neqn diff -aruN groff-1.16/src/preproc/eqn/eqn.tab.h groff-1.16.1/src/preproc/eqn/eqn.tab.h --- groff-1.16/src/preproc/eqn/eqn.tab.h Sun Feb 6 10:38:01 2000 +++ groff-1.16.1/src/preproc/eqn/eqn.tab.h Thu Jan 1 01:00:00 1970 @@ -1,67 +0,0 @@ -#define OVER 257 -#define SMALLOVER 258 -#define SQRT 259 -#define SUB 260 -#define SUP 261 -#define LPILE 262 -#define RPILE 263 -#define CPILE 264 -#define PILE 265 -#define LEFT 266 -#define RIGHT 267 -#define TO 268 -#define FROM 269 -#define SIZE 270 -#define FONT 271 -#define ROMAN 272 -#define BOLD 273 -#define ITALIC 274 -#define FAT 275 -#define ACCENT 276 -#define BAR 277 -#define UNDER 278 -#define ABOVE 279 -#define TEXT 280 -#define QUOTED_TEXT 281 -#define FWD 282 -#define BACK 283 -#define DOWN 284 -#define UP 285 -#define MATRIX 286 -#define COL 287 -#define LCOL 288 -#define RCOL 289 -#define CCOL 290 -#define MARK 291 -#define LINEUP 292 -#define TYPE 293 -#define VCENTER 294 -#define PRIME 295 -#define SPLIT 296 -#define NOSPLIT 297 -#define UACCENT 298 -#define SPECIAL 299 -#define SPACE 300 -#define GFONT 301 -#define GSIZE 302 -#define DEFINE 303 -#define NDEFINE 304 -#define TDEFINE 305 -#define SDEFINE 306 -#define UNDEF 307 -#define IFDEF 308 -#define INCLUDE 309 -#define DELIM 310 -#define CHARTYPE 311 -#define SET 312 -#define GRFONT 313 -#define GBFONT 314 -typedef union { - char *str; - box *b; - pile_box *pb; - matrix_box *mb; - int n; - column *col; -} YYSTYPE; -extern YYSTYPE yylval; diff -aruN groff-1.16/src/preproc/eqn/eqn_tab.h groff-1.16.1/src/preproc/eqn/eqn_tab.h --- groff-1.16/src/preproc/eqn/eqn_tab.h Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/src/preproc/eqn/eqn_tab.h Sun Jun 18 12:14:03 2000 @@ -0,0 +1,67 @@ +#define OVER 257 +#define SMALLOVER 258 +#define SQRT 259 +#define SUB 260 +#define SUP 261 +#define LPILE 262 +#define RPILE 263 +#define CPILE 264 +#define PILE 265 +#define LEFT 266 +#define RIGHT 267 +#define TO 268 +#define FROM 269 +#define SIZE 270 +#define FONT 271 +#define ROMAN 272 +#define BOLD 273 +#define ITALIC 274 +#define FAT 275 +#define ACCENT 276 +#define BAR 277 +#define UNDER 278 +#define ABOVE 279 +#define TEXT 280 +#define QUOTED_TEXT 281 +#define FWD 282 +#define BACK 283 +#define DOWN 284 +#define UP 285 +#define MATRIX 286 +#define COL 287 +#define LCOL 288 +#define RCOL 289 +#define CCOL 290 +#define MARK 291 +#define LINEUP 292 +#define TYPE 293 +#define VCENTER 294 +#define PRIME 295 +#define SPLIT 296 +#define NOSPLIT 297 +#define UACCENT 298 +#define SPECIAL 299 +#define SPACE 300 +#define GFONT 301 +#define GSIZE 302 +#define DEFINE 303 +#define NDEFINE 304 +#define TDEFINE 305 +#define SDEFINE 306 +#define UNDEF 307 +#define IFDEF 308 +#define INCLUDE 309 +#define DELIM 310 +#define CHARTYPE 311 +#define SET 312 +#define GRFONT 313 +#define GBFONT 314 +typedef union { + char *str; + box *b; + pile_box *pb; + matrix_box *mb; + int n; + column *col; +} YYSTYPE; +extern YYSTYPE yylval; diff -aruN groff-1.16/src/preproc/eqn/lex.cc groff-1.16.1/src/preproc/eqn/lex.cc --- groff-1.16/src/preproc/eqn/lex.cc Sun Feb 6 10:38:02 2000 +++ groff-1.16.1/src/preproc/eqn/lex.cc Sun Jun 18 12:14:03 2000 @@ -19,7 +19,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "eqn.h" -#include "eqn.tab.h" +#include "eqn_tab.h" #include "stringclass.h" #include "ptable.h" diff -aruN groff-1.16/src/preproc/grn/Makefile.sub groff-1.16.1/src/preproc/grn/Makefile.sub --- groff-1.16/src/preproc/grn/Makefile.sub Sun Feb 20 21:52:47 2000 +++ groff-1.16.1/src/preproc/grn/Makefile.sub Mon May 29 22:52:57 2000 @@ -1,5 +1,6 @@ PROG=grn MAN1=grn.n +MLIB=$(LIBM) XLIBS=$(LIBGROFF) OBJS=\ hdb.o \ diff -aruN groff-1.16/src/preproc/grn/hgraph.cc groff-1.16.1/src/preproc/grn/hgraph.cc --- groff-1.16/src/preproc/grn/hgraph.cc Sat May 13 01:27:51 2000 +++ groff-1.16.1/src/preproc/grn/hgraph.cc Sun Jun 11 08:27:28 2000 @@ -6,11 +6,11 @@ #include "gprint.h" -#ifndef MATH_H_DECLARES_HYPOT +#ifdef NEED_DECLARATION_HYPOT extern "C" { double hypot(double, double); } -#endif +#endif /* NEED_DECLARATION_HYPOT */ #define MAXVECT 40 #define MAXPOINTS 200 diff -aruN groff-1.16/src/preproc/pic/Makefile.sub groff-1.16.1/src/preproc/pic/Makefile.sub --- groff-1.16/src/preproc/pic/Makefile.sub Sun Feb 6 10:38:07 2000 +++ groff-1.16.1/src/preproc/pic/Makefile.sub Sun Jun 18 12:14:06 2000 @@ -27,5 +27,5 @@ $(srcdir)/text.h GRAM=$(srcdir)/pic.y YTABC=$(srcdir)/pic.cc -YTABH=$(srcdir)/pic.tab.h +YTABH=$(srcdir)/pic_tab.h NAMEPREFIX=$(g) diff -aruN groff-1.16/src/preproc/pic/lex.cc groff-1.16.1/src/preproc/pic/lex.cc --- groff-1.16/src/preproc/pic/lex.cc Sun Feb 6 10:38:10 2000 +++ groff-1.16.1/src/preproc/pic/lex.cc Sun Jun 18 12:14:06 2000 @@ -21,7 +21,7 @@ #include "pic.h" #include "ptable.h" #include "object.h" -#include "pic.tab.h" +#include "pic_tab.h" declare_ptable(char) implement_ptable(char) diff -aruN groff-1.16/src/preproc/pic/pic.cc groff-1.16.1/src/preproc/pic/pic.cc --- groff-1.16/src/preproc/pic/pic.cc Sun Feb 6 10:38:22 2000 +++ groff-1.16.1/src/preproc/pic/pic.cc Wed May 31 16:18:50 2000 @@ -1,6 +1,6 @@ #ifndef lint /*static char yysccsid[] = "from: @(#)yaccpar 1.9 (Berkeley) 02/21/93";*/ -static char yyrcsid[] = "$Id: pic.cc,v 1.1.1.1 2000/02/06 09:38:22 wlemb Exp $"; +static char yyrcsid[] = "$Id: pic.cc,v 1.2 2000/05/31 14:18:50 wlemb Exp $"; #endif #define YYBYACC 1 #define YYMAJOR 1 @@ -33,7 +33,11 @@ #undef srand extern "C" { int rand(); +#ifdef RET_TYPE_SRAND_IS_VOID void srand(unsigned int); +#else + int srand(unsigned int); +#endif } /* Maximum number of characters produced by printf("%g") */ diff -aruN groff-1.16/src/preproc/pic/pic.h groff-1.16.1/src/preproc/pic/pic.h --- groff-1.16/src/preproc/pic/pic.h Sun Feb 6 10:38:22 2000 +++ groff-1.16.1/src/preproc/pic/pic.h Sun Jun 11 08:27:29 2000 @@ -24,11 +24,11 @@ #include #include -#ifndef MATH_H_DECLARES_HYPOT +#ifdef NEED_DECLARATION_HYPOT extern "C" { double hypot(double, double); } -#endif +#endif /* NEED_DECLARATION_HYPOT */ #include "assert.h" #include "cset.h" diff -aruN groff-1.16/src/preproc/pic/pic.tab.h groff-1.16.1/src/preproc/pic/pic.tab.h --- groff-1.16/src/preproc/pic/pic.tab.h Sun Feb 6 10:38:29 2000 +++ groff-1.16.1/src/preproc/pic/pic.tab.h Thu Jan 1 01:00:00 1970 @@ -1,130 +0,0 @@ -#define LABEL 257 -#define VARIABLE 258 -#define NUMBER 259 -#define TEXT 260 -#define COMMAND_LINE 261 -#define DELIMITED 262 -#define ORDINAL 263 -#define TH 264 -#define LEFT_ARROW_HEAD 265 -#define RIGHT_ARROW_HEAD 266 -#define DOUBLE_ARROW_HEAD 267 -#define LAST 268 -#define UP 269 -#define DOWN 270 -#define LEFT 271 -#define RIGHT 272 -#define BOX 273 -#define CIRCLE 274 -#define ELLIPSE 275 -#define ARC 276 -#define LINE 277 -#define ARROW 278 -#define MOVE 279 -#define SPLINE 280 -#define HEIGHT 281 -#define RADIUS 282 -#define WIDTH 283 -#define DIAMETER 284 -#define FROM 285 -#define TO 286 -#define AT 287 -#define WITH 288 -#define BY 289 -#define THEN 290 -#define DOTTED 291 -#define DASHED 292 -#define CHOP 293 -#define SAME 294 -#define INVISIBLE 295 -#define LJUST 296 -#define RJUST 297 -#define ABOVE 298 -#define BELOW 299 -#define OF 300 -#define THE 301 -#define WAY 302 -#define BETWEEN 303 -#define AND 304 -#define HERE 305 -#define DOT_N 306 -#define DOT_E 307 -#define DOT_W 308 -#define DOT_S 309 -#define DOT_NE 310 -#define DOT_SE 311 -#define DOT_NW 312 -#define DOT_SW 313 -#define DOT_C 314 -#define DOT_START 315 -#define DOT_END 316 -#define DOT_X 317 -#define DOT_Y 318 -#define DOT_HT 319 -#define DOT_WID 320 -#define DOT_RAD 321 -#define SIN 322 -#define COS 323 -#define ATAN2 324 -#define LOG 325 -#define EXP 326 -#define SQRT 327 -#define K_MAX 328 -#define K_MIN 329 -#define INT 330 -#define RAND 331 -#define SRAND 332 -#define COPY 333 -#define THRU 334 -#define TOP 335 -#define BOTTOM 336 -#define UPPER 337 -#define LOWER 338 -#define SH 339 -#define PRINT 340 -#define CW 341 -#define CCW 342 -#define FOR 343 -#define DO 344 -#define IF 345 -#define ELSE 346 -#define ANDAND 347 -#define OROR 348 -#define NOTEQUAL 349 -#define EQUALEQUAL 350 -#define LESSEQUAL 351 -#define GREATEREQUAL 352 -#define LEFT_CORNER 353 -#define RIGHT_CORNER 354 -#define CENTER 355 -#define END 356 -#define START 357 -#define RESET 358 -#define UNTIL 359 -#define PLOT 360 -#define THICKNESS 361 -#define FILL 362 -#define ALIGNED 363 -#define SPRINTF 364 -#define COMMAND 365 -#define DEFINE 366 -#define UNDEF 367 -typedef union { - char *str; - int n; - double x; - struct { double x, y; } pair; - struct { double x; char *body; } if_data; - struct { char *str; const char *filename; int lineno; } lstr; - struct { double *v; int nv; int maxv; } dv; - struct { double val; int is_multiplicative; } by; - place pl; - object *obj; - corner crn; - path *pth; - object_spec *spec; - saved_state *pstate; - graphics_state state; - object_type obtype; -} YYSTYPE; -extern YYSTYPE yylval; diff -aruN groff-1.16/src/preproc/pic/pic.y groff-1.16.1/src/preproc/pic/pic.y --- groff-1.16/src/preproc/pic/pic.y Sun Feb 6 10:38:27 2000 +++ groff-1.16.1/src/preproc/pic/pic.y Wed May 31 16:18:51 2000 @@ -40,7 +40,11 @@ #undef srand extern "C" { int rand(); +#ifdef RET_TYPE_SRAND_IS_VOID void srand(unsigned int); +#else + int srand(unsigned int); +#endif } /* Maximum number of characters produced by printf("%g") */ diff -aruN groff-1.16/src/preproc/pic/pic_tab.h groff-1.16.1/src/preproc/pic/pic_tab.h --- groff-1.16/src/preproc/pic/pic_tab.h Thu Jan 1 01:00:00 1970 +++ groff-1.16.1/src/preproc/pic/pic_tab.h Sun Jun 18 12:14:06 2000 @@ -0,0 +1,130 @@ +#define LABEL 257 +#define VARIABLE 258 +#define NUMBER 259 +#define TEXT 260 +#define COMMAND_LINE 261 +#define DELIMITED 262 +#define ORDINAL 263 +#define TH 264 +#define LEFT_ARROW_HEAD 265 +#define RIGHT_ARROW_HEAD 266 +#define DOUBLE_ARROW_HEAD 267 +#define LAST 268 +#define UP 269 +#define DOWN 270 +#define LEFT 271 +#define RIGHT 272 +#define BOX 273 +#define CIRCLE 274 +#define ELLIPSE 275 +#define ARC 276 +#define LINE 277 +#define ARROW 278 +#define MOVE 279 +#define SPLINE 280 +#define HEIGHT 281 +#define RADIUS 282 +#define WIDTH 283 +#define DIAMETER 284 +#define FROM 285 +#define TO 286 +#define AT 287 +#define WITH 288 +#define BY 289 +#define THEN 290 +#define DOTTED 291 +#define DASHED 292 +#define CHOP 293 +#define SAME 294 +#define INVISIBLE 295 +#define LJUST 296 +#define RJUST 297 +#define ABOVE 298 +#define BELOW 299 +#define OF 300 +#define THE 301 +#define WAY 302 +#define BETWEEN 303 +#define AND 304 +#define HERE 305 +#define DOT_N 306 +#define DOT_E 307 +#define DOT_W 308 +#define DOT_S 309 +#define DOT_NE 310 +#define DOT_SE 311 +#define DOT_NW 312 +#define DOT_SW 313 +#define DOT_C 314 +#define DOT_START 315 +#define DOT_END 316 +#define DOT_X 317 +#define DOT_Y 318 +#define DOT_HT 319 +#define DOT_WID 320 +#define DOT_RAD 321 +#define SIN 322 +#define COS 323 +#define ATAN2 324 +#define LOG 325 +#define EXP 326 +#define SQRT 327 +#define K_MAX 328 +#define K_MIN 329 +#define INT 330 +#define RAND 331 +#define SRAND 332 +#define COPY 333 +#define THRU 334 +#define TOP 335 +#define BOTTOM 336 +#define UPPER 337 +#define LOWER 338 +#define SH 339 +#define PRINT 340 +#define CW 341 +#define CCW 342 +#define FOR 343 +#define DO 344 +#define IF 345 +#define ELSE 346 +#define ANDAND 347 +#define OROR 348 +#define NOTEQUAL 349 +#define EQUALEQUAL 350 +#define LESSEQUAL 351 +#define GREATEREQUAL 352 +#define LEFT_CORNER 353 +#define RIGHT_CORNER 354 +#define CENTER 355 +#define END 356 +#define START 357 +#define RESET 358 +#define UNTIL 359 +#define PLOT 360 +#define THICKNESS 361 +#define FILL 362 +#define ALIGNED 363 +#define SPRINTF 364 +#define COMMAND 365 +#define DEFINE 366 +#define UNDEF 367 +typedef union { + char *str; + int n; + double x; + struct { double x, y; } pair; + struct { double x; char *body; } if_data; + struct { char *str; const char *filename; int lineno; } lstr; + struct { double *v; int nv; int maxv; } dv; + struct { double val; int is_multiplicative; } by; + place pl; + object *obj; + corner crn; + path *pth; + object_spec *spec; + saved_state *pstate; + graphics_state state; + object_type obtype; +} YYSTYPE; +extern YYSTYPE yylval; diff -aruN groff-1.16/src/preproc/soelim/soelim.cc groff-1.16.1/src/preproc/soelim/soelim.cc --- groff-1.16/src/preproc/soelim/soelim.cc Sun Feb 6 10:38:44 2000 +++ groff-1.16.1/src/preproc/soelim/soelim.cc Sun Jun 18 12:14:07 2000 @@ -28,6 +28,7 @@ #include "errarg.h" #include "error.h" #include "stringclass.h" +#include "nonposix.h" static int include_list_length; static char **include_list; @@ -157,7 +158,7 @@ whole_filename = filename; whole_filename += '\0'; } - else if (filename[0] == '/') { + else if (IS_ABSOLUTE(filename)) { whole_filename = filename; whole_filename += '\0'; errno = 0; diff -aruN groff-1.16/src/roff/groff/groff.cc groff-1.16.1/src/roff/groff/groff.cc --- groff-1.16/src/roff/groff/groff.cc Tue May 2 01:47:46 2000 +++ groff-1.16.1/src/roff/groff/groff.cc Sun Jun 18 12:14:08 2000 @@ -35,20 +35,20 @@ #include "font.h" #include "device.h" #include "pipeline.h" +#include "nonposix.h" #include "defs.h" -#define BSHELL "/bin/sh" #define GXDITVIEW "gxditview" // troff will be passed an argument of -rXREG=1 if the -X option is // specified #define XREG ".X" -#ifndef STDLIB_H_DECLARES_PUTENV +#ifdef NEED_DECLARATION_PUTENV extern "C" { int putenv(const char *); } -#endif /* not STDLIB_H_DECLARES_PUTENV */ +#endif /* NEED_DECLARATION_PUTENV */ const int SOELIM_INDEX = 0; const int REFER_INDEX = SOELIM_INDEX + 1; @@ -202,7 +202,7 @@ case 'F': font::command_line_font_dir(optarg); if (Fargs.length() > 0) { - Fargs += ':'; + Fargs += PATH_SEP[0]; Fargs += optarg; } else @@ -297,7 +297,7 @@ commands[POST_INDEX].append_arg("-"); if (lflag && !Xflag && spooler) { commands[SPOOL_INDEX].set_name(BSHELL); - commands[SPOOL_INDEX].append_arg("-c"); + commands[SPOOL_INDEX].append_arg(BSHELL_DASH_C); Largs += '\0'; Largs = spooler + Largs; commands[SPOOL_INDEX].append_arg(Largs.contents()); @@ -328,7 +328,7 @@ e += Fargs; char *fontpath = getenv("GROFF_FONT_PATH"); if (fontpath && *fontpath) { - e += ':'; + e += PATH_SEP[0]; e += fontpath; } e += '\0'; @@ -346,7 +346,19 @@ { if (!s) return 0; - const char *p = strrchr(s, '/'); + // DIR_SEPS[] are possible directory separator characters, see nonposix.h + // We want the rightmost separator of all possible ones. + // Example: d:/foo\\bar. + const char *p = strrchr(s, DIR_SEPS[0]), *p1; + const char *sep = &DIR_SEPS[1]; + + while (*sep) + { + p1 = strrchr(s, *sep); + if (p1 && (!p || p1 > p)) + p = p1; + sep++; + } return p ? p + 1 : s; } @@ -478,8 +490,8 @@ void possible_command::print(int is_last, FILE *fp) { build_argv(); - if (argv[0] != 0 && strcmp(argv[0], BSHELL) == 0 - && argv[1] != 0 && strcmp(argv[1], "-c") == 0 + if (IS_BSHELL(argv[0]) + && argv[1] != 0 && strcmp(argv[1], BSHELL_DASH_C) == 0 && argv[2] != 0 && argv[3] == 0) fputs(argv[2], fp); else { diff -aruN groff-1.16/src/roff/groff/pipeline.c groff-1.16.1/src/roff/groff/pipeline.c --- groff-1.16/src/roff/groff/pipeline.c Mon Feb 28 12:02:14 2000 +++ groff-1.16.1/src/roff/groff/pipeline.c Sun Jun 18 12:14:08 2000 @@ -97,6 +97,186 @@ static const char *xstrsignal P((int)); static char *i_to_a P((int)); +/* MSVC can support asynchronous processes, but it's unlikely to have + fork(). So, until someone writes an emulation, let them at least + have a workable groff by using the good-ole DOS pipe simulation + via temporary files... */ + +#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN32__)) + +#include +#include +#include +#include + +#include "nonposix.h" + +/* A signal handler that just records that a signal has happened. */ +static int child_interrupted; + +static RETSIGTYPE signal_catcher (int signo) +{ + child_interrupted++; +} + +static const char *sh = "sh"; +static const char *command = "command"; + +const char * +system_shell_name (void) +{ + static const char *shell_name; + + /* We want them to be able to use a Unixy shell if they have it + installed. Let spawnlp try to find it, but if it fails, default + to COMMAND.COM. */ + if (shell_name == NULL) + { + int sh_found = spawnlp (P_WAIT, sh, sh, "-c", ":", NULL) == 0; + + if (sh_found) + shell_name = sh; + else + shell_name = command; + } + return shell_name; +} + +const char * +system_shell_dash_c (void) +{ + if (strcmp (system_shell_name(), sh) == 0) + return "-c"; + else + return "/c"; +} + +int +is_system_shell (const char *shell) +{ + char monocased_shell[FILENAME_MAX]; + size_t shlen; + int ibase = 0, idot, i; + + if (!shell) /* paranoia */ + return 0; + idot = shlen = strlen(shell); + + for (i = 0; i < shlen; i++) + { + if (isalpha(shell[i])) + monocased_shell[i] = tolower(shell[i]); + else + { + monocased_shell[i] = shell[i]; + if (shell[i] == '.') + idot = i; + else if (shell[i] == '/' || shell[i] == '\\' || shell[i] == ':') + { + ibase = i + 1; + idot = shlen; + } + } + } + monocased_shell[i] = '\0'; + + /* "sh" and "sh.exe" should compare equal. */ + return + strncmp(monocased_shell + ibase, system_shell_name(), idot - ibase) == 0 + && (idot == shlen + || strcmp(monocased_shell + idot, ".exe") == 0 + || strcmp(monocased_shell + idot, ".com") == 0); +} + +/* MSDOS doesn't have `fork', so we need to simulate the pipe by + running the programs in sequence with redirected standard streams. */ + +int run_pipeline (ncommands, commands) + int ncommands; + char ***commands; +{ + int save_stdin = dup(0); + int save_stdout = dup(1); + char *tmpfiles[2]; + char tem1[L_tmpnam], tem2[L_tmpnam]; + int infile = 0; + int outfile = 1; + int i, f, ret = 0; + + tmpfiles[0] = tmpnam(tem1); + tmpfiles[1] = tmpnam(tem2); + + for (i = 0; i < ncommands; i++) + { + int exit_status; + RETSIGTYPE (*prev_handler)(int); + + if (i) + { + /* redirect stdin from temp file */ + f = open(tmpfiles[infile], O_RDONLY|O_BINARY, 0666); + if (f < 0) + sys_fatal("open stdin"); + if (dup2(f, 0) < 0) + sys_fatal("dup2 stdin"); + if (close(f) < 0) + sys_fatal("close stdin"); + } + if (i < ncommands - 1) + { + /* redirect stdout to temp file */ + f = open(tmpfiles[outfile], O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0666); + if (f < 0) + sys_fatal("open stdout"); + if (dup2(f, 1) < 0) + sys_fatal("dup2 stdout"); + if (close(f) < 0) + sys_fatal("close stdout"); + } + else if (dup2(save_stdout, 1) < 0) + sys_fatal("restore stdout"); + + /* run the program */ + child_interrupted = 0; + prev_handler = signal(SIGINT, signal_catcher); + exit_status = spawnvp(P_WAIT, commands[i][0], commands[i]); + signal(SIGINT, prev_handler); + if (child_interrupted) + { + error("%1: Interrupted", commands[i][0], (char *)0, (char *)0); + ret |= 2; + } + else if (exit_status < 0) + { + error("couldn't exec %1: %2", commands[i][0], + strerror(errno), (char *)0); + fflush(stderr); /* just in case error() doesn't */ + ret |= 4; + } + if (exit_status != 0) + ret |= 1; + + /* There's no sense to continue with the pipe if one of the + programs has ended abnormally, is there? */ + if (ret != 0) + break; + + /* swap temp files: make output of this program be input for the next */ + infile = 1 - infile; + outfile = 1 - outfile; + } + + if (dup2(save_stdin, 0) < 0) + sys_fatal("restore stdin"); + + unlink(tmpfiles[0]); + unlink(tmpfiles[1]); + + return ret; +} + +#else /* not __MSDOS__, not _WIN32 */ + int run_pipeline(ncommands, commands) int ncommands; char ***commands; @@ -209,6 +389,8 @@ } return ret; } + +#endif /* not __MSDOS__, not _WIN32 */ static void sys_fatal(s) const char *s; diff -aruN groff-1.16/src/roff/grog/Makefile.sub groff-1.16.1/src/roff/grog/Makefile.sub --- groff-1.16/src/roff/grog/Makefile.sub Tue Mar 7 23:18:01 2000 +++ groff-1.16.1/src/roff/grog/Makefile.sub Sat Jun 24 22:21:52 2000 @@ -1,5 +1,6 @@ MAN1=grog.n CLEANADD=grog +NAMEPREFIX=$(g) all: grog @@ -9,7 +10,8 @@ sed -e 's;/usr/bin/perl;$(PERLPATH);' $(srcdir)/grog.pl >$@; \ else \ rm -f $@; \ - sed "$(SH_SCRIPT_SED_CMD)" $(srcdir)/grog.sh >$@; \ + sed -e 's/@g@/$(g)/g' \ + -e "$(SH_SCRIPT_SED_CMD)" $(srcdir)/grog.sh >$@; \ fi chmod +x $@ diff -aruN groff-1.16/src/roff/grog/grog.sh groff-1.16.1/src/roff/grog/grog.sh --- groff-1.16/src/roff/grog/grog.sh Tue May 2 01:47:49 2000 +++ groff-1.16.1/src/roff/grog/grog.sh Mon May 29 01:12:28 2000 @@ -2,7 +2,7 @@ # grog -- guess options for groff command # Like doctype in Kernighan & Pike, Unix Programming Environment, pp 306-8. -soelim=gsoelim +soelim=@g@soelim opts= diff -aruN groff-1.16/src/roff/nroff/nroff.sh groff-1.16.1/src/roff/nroff/nroff.sh --- groff-1.16/src/roff/nroff/nroff.sh Sun Apr 30 07:12:50 2000 +++ groff-1.16.1/src/roff/nroff/nroff.sh Sun May 28 23:46:42 2000 @@ -36,7 +36,10 @@ opts= safer=-S -for i; do +# `for i; do' doesn't work with some versions of sh + +for i + do case $1 in -h) opts="$opts -P-h" ;; diff -aruN groff-1.16/src/roff/troff/input.cc groff-1.16.1/src/roff/troff/input.cc --- groff-1.16/src/roff/troff/input.cc Wed May 17 00:56:59 2000 +++ groff-1.16.1/src/roff/troff/input.cc Sun Jun 18 12:14:10 2000 @@ -37,6 +37,8 @@ // Needed for getpid(). #include "posix.h" +#include "nonposix.h" + #ifdef ISATTY_MISSING #undef isatty #define isatty(n) (1) @@ -4447,11 +4449,7 @@ } buf[buf_used] = '\0'; errno = 0; -#ifdef _MSC_VER - FILE *fp = popen(buf, "rt"); -#else - FILE *fp = popen(buf, "r"); -#endif + FILE *fp = popen(buf, POPEN_RT); if (fp) input_stack::push(new file_iterator(fp, symbol(buf).contents(), 1)); else @@ -4636,9 +4634,13 @@ while (!tok.newline() && !tok.eof()) tok.next(); errno = 0; - FILE *fp = fopen(nm.contents(), "r"); - if (fp) + // PS files might contain non-printable characters, such as ^Z + // and CRs not followed by an LF, so open them in binary mode. + FILE *fp = fopen(nm.contents(), FOPEN_RB); + if (fp) { do_ps_file(fp, nm.contents()); + fclose(fp); + } else error("can't open `%1': %2", nm.contents(), strerror(errno)); tok.next(); @@ -5846,13 +5848,6 @@ warning_mask = WARN_TOTAL; skip_line(); } - -#ifdef _MSC_VER -static int getpid(void) -{ - return 1; -} -#endif static void init_registers() { diff -aruN groff-1.16/src/roff/troff/node.cc groff-1.16.1/src/roff/troff/node.cc --- groff-1.16/src/roff/troff/node.cc Mon Feb 28 12:02:16 2000 +++ groff-1.16.1/src/roff/troff/node.cc Mon Jun 26 15:57:27 2000 @@ -18,6 +18,10 @@ with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_UNISTD_H +#include +#endif + #include "troff.h" #include "symbol.h" #include "dictionary.h" @@ -30,6 +34,25 @@ #include "font.h" #include "reg.h" +#include "nonposix.h" + +#ifdef _POSIX_VERSION + +#include + +#else /* not _POSIX_VERSION */ + +/* traditional Unix */ + +#define WIFEXITED(s) (((s) & 0377) == 0) +#define WEXITSTATUS(s) (((s) >> 8) & 0377) +#define WTERMSIG(s) ((s) & 0177) +#define WIFSTOPPED(s) (((s) & 0377) == 0177) +#define WSTOPSIG(s) (((s) >> 8) & 0377) +#define WIFSIGNALED(s) (((s) & 0377) != 0 && (((s) & 0377) != 0177)) + +#endif /* not _POSIX_VERSION */ + #define STORE_WIDTH 1 symbol HYPHEN_SYMBOL("hy"); @@ -1195,11 +1218,7 @@ { #ifndef POPEN_MISSING if (pipe_command) { -#ifdef _MSC_VER - if ((fp = _popen(pipe_command, "wt")) != 0) { -#else - if ((fp = popen(pipe_command, "w")) != 0) { -#endif + if ((fp = popen(pipe_command, POPEN_WT)) != 0) { piped = 1; return; } @@ -1221,19 +1240,16 @@ } #ifndef POPEN_MISSING if (piped) { -#ifdef _MSC_VER - int result = _pclose(fp); -#else int result = pclose(fp); -#endif fp = 0; if (result < 0) fatal("pclose failed"); - if ((result & 0x7f) != 0) + if (!WIFEXITED(result)) error("output process `%1' got fatal signal %2", - pipe_command, result & 0x7f); + pipe_command, + WIFSIGNALED(result) ? WTERMSIG(result) : WSTOPSIG(result)); else { - int exit_status = (result >> 8) & 0xff; + int exit_status = WEXITSTATUS(result); if (exit_status != 0) error("output process `%1' exited with status %2", pipe_command, exit_status); diff -aruN groff-1.16/src/utils/hpftodit/hpftodit.cc groff-1.16.1/src/utils/hpftodit/hpftodit.cc --- groff-1.16/src/utils/hpftodit/hpftodit.cc Sun Feb 6 10:37:20 2000 +++ groff-1.16.1/src/utils/hpftodit/hpftodit.cc Sun Jun 18 12:14:12 2000 @@ -39,6 +39,7 @@ #include "errarg.h" #include "error.h" #include "cset.h" +#include "nonposix.h" #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) @@ -273,7 +274,9 @@ File::File(const char *s) { - int fd = open(s, O_RDONLY); + // We need to read the file in binary mode because hpftodit relies + // on byte counts. + int fd = open(s, O_RDONLY | O_BINARY); if (fd < 0) fatal("cannot open `%1': %2", s, strerror(errno)); current_filename = s; @@ -290,6 +293,24 @@ fatal("read unexpected number of bytes"); ptr_ = buf_; end_ = buf_ + sb.st_size; + // These are actually text files, so we must get rid of the `\r' + // characters. This is also enabled for Posix systems, in case the + // input came from Windows... + unsigned char *p = buf_, *q = buf_; + while (q < end_) + { + if (*q == '\r') + { + if (*++q != '\n') + *p++ = '\r'; + } +#if defined(__MSDOS__) || defined(_MSC_VER) + if (*q == '\032') // ^Z means ``software EOF'' + break; +#endif + *p++ = *q++; + } + end_ = p; } void File::skip(int n) @@ -774,6 +795,18 @@ static const char *xbasename(const char *s) { - const char *b = strrchr(s, '/'); + // DIR_SEPS[] are possible directory separator characters, see + // nonposix.h. We want the rightmost separator of all possible + // ones. Example: d:/foo\\bar. + const char *b = strrchr(s, DIR_SEPS[0]), *b1; + const char *sep = &DIR_SEPS[1]; + + while (*sep) + { + b1 = strrchr(s, *sep); + if (b1 && (!b || b1 > b)) + b = b1; + sep++; + } return b ? b + 1 : s; } diff -aruN groff-1.16/src/utils/indxbib/indxbib.cc groff-1.16.1/src/utils/indxbib/indxbib.cc --- groff-1.16/src/utils/indxbib/indxbib.cc Wed Mar 1 14:53:30 2000 +++ groff-1.16.1/src/utils/indxbib/indxbib.cc Fri Jul 21 12:23:30 2000 @@ -35,9 +35,13 @@ #include "defs.h" #include "index.h" +#include "nonposix.h" + extern "C" { - // Sun's stdlib.h fails to declare this. + // Solaris 2.5.1 has these functions, + // but its stdlib.h fails to declare them. char *mktemp(char *); + int mkstemp(char *); } #define DEFAULT_HASH_TABLE_SIZE 997 @@ -197,7 +201,15 @@ read_common_words_file(); if (!basename) basename = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME; - const char *p = strrchr(basename, '/'); + const char *p = strrchr(basename, DIR_SEPS[0]), *p1; + const char *sep = &DIR_SEPS[1]; + while (*sep) + { + p1 = strrchr(basename, *sep); + if (p1 && (!p || p1 > p)) + p = p1; + sep++; + } long name_max; if (p) { char *dir = strsave(basename); @@ -231,7 +243,7 @@ #endif if (fd < 0) fatal("can't create temporary index file: %1", strerror(errno)); - indxfp = fdopen(fd, "w"); + indxfp = fdopen(fd, FOPEN_WB); if (indxfp == 0) fatal("fdopen failed"); if (fseek(indxfp, sizeof(index_header), 0) < 0) @@ -280,7 +292,22 @@ strcat(index_file, INDEX_SUFFIX); #ifdef HAVE_RENAME if (rename(temp_index_file, index_file) < 0) - fatal("can't rename temporary index file: %1", strerror(errno)); + { +#ifdef __MSDOS__ + // RENAME could fail on plain MSDOS filesystems because + // INDEX_FILE is an invalid filename, e.g. it has multiple dots. + char *fname = p ? index_file + (p - basename) : 0; + char *dot = 0; + + // Replace the dot with an underscore and try again. + if (fname + && (dot = strchr(fname, '.')) != 0 + && strcmp(dot, INDEX_SUFFIX) != 0) + *dot = '_'; + if (rename(temp_index_file, index_file) < 0) +#endif + fatal("can't rename temporary index file: %1", strerror(errno)); + } #else /* not HAVE_RENAME */ ignore_fatal_signals(); if (unlink(index_file) < 0) { @@ -428,7 +455,9 @@ static int do_file(const char *filename) { errno = 0; - FILE *fp = fopen(filename, "r"); + // Need binary I/O for MS-DOS/MS-Windows, because indxbib relies on + // byte counts to be consistent with fseek. + FILE *fp = fopen(filename, FOPEN_RB); if (fp == 0) { error("can't open `%1': %2", filename, strerror(errno)); return 0; @@ -458,6 +487,21 @@ int c = getc(fp); if (c == EOF) break; + // We opened the file in binary mode, so we need to skip + // every CR character before a Newline. + if (c == '\r') { + int peek = getc(fp); + if (peek = '\n') { + byte_count++; + c = peek; + } + else + ungetc(peek, fp); + } +#if defined(__MSDOS__) || defined(_MSC_VER) + else if (c == 0x1a) // ^Z means EOF in text files + break; +#endif byte_count++; switch (state) { case START: diff -aruN groff-1.16/src/utils/pfbtops/pfbtops.c groff-1.16.1/src/utils/pfbtops/pfbtops.c --- groff-1.16/src/utils/pfbtops/pfbtops.c Sat May 13 01:27:52 2000 +++ groff-1.16.1/src/utils/pfbtops/pfbtops.c Sun Jun 18 12:14:14 2000 @@ -3,6 +3,8 @@ #include #include +#include "nonposix.h" + /* Binary bytes per output line. */ #define BYTES_PER_LINE (64/2) #define HEX_DIGITS "0123456789abcdef" @@ -52,6 +54,9 @@ perror(argv[optind]); exit(1); } +#ifdef SET_BINARY + SET_BINARY(fileno(stdin)); +#endif for (;;) { int type, c, i; diff -aruN groff-1.16/src/utils/tfmtodit/tfmtodit.cc groff-1.16.1/src/utils/tfmtodit/tfmtodit.cc --- groff-1.16/src/utils/tfmtodit/tfmtodit.cc Sun Feb 6 10:37:25 2000 +++ groff-1.16.1/src/utils/tfmtodit/tfmtodit.cc Sun Jun 18 12:14:16 2000 @@ -57,6 +57,7 @@ #include "error.h" #include "assert.h" #include "cset.h" +#include "nonposix.h" /* Values in the tfm file should be multiplied by this. */ @@ -273,7 +274,7 @@ int tfm::load(const char *file) { errno = 0; - FILE *fp = fopen(file, "r"); + FILE *fp = fopen(file, FOPEN_RB); if (!fp) { error("can't open `%1': %2", file, strerror(errno)); return 0; @@ -413,7 +414,7 @@ int left_adj, right_adj; const int gf_id_byte = 131; errno = 0; - FILE *fp = fopen(file, "r"); + FILE *fp = fopen(file, FOPEN_RB); if (!fp) { error("can't open `%1': %2", file, strerror(errno)); return 0; @@ -750,7 +751,18 @@ int len = strlen(internal_name); if (len > 4 && strcmp(internal_name + len - 4, ".tfm") == 0) internal_name[len - 4] = '\0'; - char *s = strrchr(internal_name, '/'); + // DIR_SEPS[] are possible directory separator characters, see nonposix.h. + // We want the rightmost separator of all possible ones. + // Example: d:/foo\\bar. + const char *s = strrchr(internal_name, DIR_SEPS[0]), *s1; + const char *sep = &DIR_SEPS[1]; + while (*sep) + { + s1 = strrchr(internal_name, *sep); + if (s1 && (!s || s1 > s)) + s = s1; + sep++; + } printf("internalname %s\n", s ? s + 1 : internal_name); int n; if (t.get_param(2, &n)) { diff -aruN groff-1.16/src/xditview/Imakefile groff-1.16.1/src/xditview/Imakefile --- groff-1.16/src/xditview/Imakefile Wed May 24 01:45:36 2000 +++ groff-1.16.1/src/xditview/Imakefile Thu Jan 1 01:00:00 1970 @@ -1,99 +0,0 @@ -srcdir=/tmp/groff/src/xditview -top_srcdir=/tmp/groff -VPATH=/tmp/groff/src/xditview -top_builddir=/tmp/groff - -GROFF_PREFIX = /usr/local -GROFF_DATADIR = $(GROFF_PREFIX)/share -GROFF_LIBDIR = $(GROFF_DATADIR)/groff -GROFF_FONTDIR = $(GROFF_LIBDIR)/font -GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font -DPIS = 75 100 - -PROGRAMS = \ - gxditview \ - xtotroff -DEPLIBS = XawClientDepLibs -LOCAL_LIBRARIES = XawClientLibs -SRCS1 = \ - $(srcdir)/xditview.c \ - $(srcdir)/Dvi.c \ - $(srcdir)/draw.c \ - $(srcdir)/font.c \ - $(srcdir)/lex.c \ - $(srcdir)/page.c \ - $(srcdir)/parse.c \ - $(srcdir)/XFontName.c \ - $(srcdir)/DviChar.c \ - $(srcdir)/device.c -OBJS1 = \ - xditview.o \ - Dvi.o \ - draw.o \ - font.o \ - lex.o \ - page.o \ - parse.o \ - XFontName.o \ - DviChar.o \ - device.o -SRCS2 = \ - $(srcdir)/xtotroff.c \ - $(srcdir)/XFontName.c \ - $(srcdir)/DviChar.c -OBJS2 = \ - xtotroff.o \ - XFontName.o \ - DviChar.o -INCLUDES = \ - -I$(TOOLKITSRC) \ - -I$(TOP) -MATHLIB = -lm -DEFINES = \ - $(SIGNAL_DEFINES) \ - -DFONTPATH=\"$(GROFF_FONTPATH)\" # -DX_NOT_STDC_ENV - -DEVDIR = $(top_builddir)/font -MKINSTALLDIRS = $(top_srcdir)/mkinstalldirs - -ComplexProgramTarget_1(gxditview,$(LOCAL_LIBRARIES),$(MATHLIB)) -NormalProgramTarget(xtotroff,$(OBJS2),$(DEPXLIB),$(XLIB), /**/) - -InstallAppDefaults(GXditview) - -fonts: xtotroff $(srcdir)/DESC $(srcdir)/FontMap - @dir=`pwd`; \ - fonts=`sed -e 's/[ ].*//' $(srcdir)/FontMap`; \ - for dpi in $(DPIS); do \ - echo Making devX$$dpi; \ - test -d $(DEVDIR)/devX$$dpi || \ - $(MKINSTALLDIRS) $(DEVDIR)/devX$$dpi; \ - rm -f $(DEVDIR)/devX$$dpi/DESC; \ - sed -e "s/res 75/res $$dpi/" $(srcdir)/DESC \ - >$(DEVDIR)/devX$$dpi/DESC; \ - (cd $(DEVDIR)/devX$$dpi; \ - rm -f Makefile.sub; \ - echo DEV=X$$dpi >Makefile.sub; \ - echo DEVFILES=DESC $$fonts >>Makefile.sub; \ - $$dir/xtotroff -g -r $$dpi -s 10 $(srcdir)/FontMap); \ - echo Making devX$$dpi-12; \ - test -d $(DEVDIR)/devX$$dpi-12 || \ - $(MKINSTALLDIRS) $(DEVDIR)/devX$$dpi-12; \ - rm -f $(DEVDIR)/devX$$dpi-12/DESC; \ - sed -e "s/res 75/res $$dpi/" \ - -e 's/unitwidth 10/unitwidth 12/' $(srcdir)/DESC \ - >$(DEVDIR)/devX$$dpi-12/DESC; \ - (cd $(DEVDIR)/devX$$dpi-12; \ - rm -f Makefile.sub; \ - echo DEV=X$$dpi-12 >Makefile.sub; \ - echo DEVFILES=DESC $$fonts >>Makefile.sub; \ - $$dir/xtotroff -g -r $$dpi -s 12 $(srcdir)/FontMap); \ - done - -GXditview-ad.h: $(srcdir)/GXditview.ad - /bin/sh $(srcdir)/ad2c $(srcdir)/GXditview.ad >GXditview-ad.h - -extraclean: clean - -rm -f junk tmp grot old Makefile Imakefile - -FORCE: diff -aruN groff-1.16/win32-diffs groff-1.16.1/win32-diffs --- groff-1.16/win32-diffs Wed May 24 00:08:22 2000 +++ groff-1.16.1/win32-diffs Mon Jul 31 13:37:25 2000 @@ -2892,7 +2892,7 @@ +++ groff.win32/src/libs/libgroff/version.cc Wed May 17 08:57:48 2000 @@ -0,0 +1,3 @@ +const char *version_string = "1.16"; -+const char *revision_string = "0"; ++const char *revision_string = "1"; +const char *Version_string = "1.16"; diff -aruN groff/src/preproc/eqn/Makefile.msc groff.win32/src/preproc/eqn/Makefile.msc --- groff/src/preproc/eqn/Makefile.msc Thu Jan 1 00:00:00 1970 @@ -2946,8 +2946,8 @@ +# by Blake McBride (blake@florida-software.com) + + -+#CFLAGS = -nologo -I../../include -GF -Zi -Yd -+CFLAGS = -nologo -I../../include -GF -Ox ++#CFLAGS = -nologo -I../../include -GF -Zi -Yd -DRET_TYPE_SRAND_IS_VOID ++CFLAGS = -nologo -I../../include -GF -Ox -DRET_TYPE_SRAND_IS_VOID + +.SUFFIXES : .cc +