mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-05 12:56:08 +00:00
Virgin import of FSF groff v1.17.2
This commit is contained in:
parent
af2a8ba6c3
commit
5ecb0ad24f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/groff/dist/; revision=79543
@ -1,3 +1,449 @@
|
||||
2001-07-07 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/utils/indxbib/indxbib.cc (main): Change type of `name_max'
|
||||
to size_t.
|
||||
|
||||
2001-07-06 Ruslan Ermilov <ru@FreeBSD.org>
|
||||
|
||||
* tmac/doc.tmac (Rv): Make `Rv' really not parseable.
|
||||
Fix synopsis.
|
||||
* tmac/groff_mdoc.man: Fix synopsis.
|
||||
|
||||
2001-07-05 Ruslan Ermilov <ru@FreeBSD.org>
|
||||
|
||||
* tmac/doc.tmac (doc-inset-list, doc-hang-list, doc-ohang-list):
|
||||
Restore `doc-Pa-font'.
|
||||
|
||||
2001-07-04 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/utils/indxbib/dirnamemax.c: Moved to ...
|
||||
* src/libs/libgroff/maxfilename.cc: Here.
|
||||
s/dir_name_max/file_name_max/.
|
||||
Add copyright.
|
||||
* src/include/lib.h: Add file_name_max.
|
||||
* src/utils/indxbib/indxbib.cc: Updated.
|
||||
* src/utils/indxbib/Makefile.sub, src/libs/libgroff/Makefile.sub:
|
||||
Updated.
|
||||
|
||||
* src/libs/libgroff/tmpfile.cc (TMPFILE_PREFIX) [__MSDOS__]: Define
|
||||
as empty.
|
||||
(xtmpfile) [_MSC_VER]: Removed -- MSVC has mktemp().
|
||||
|
||||
* src/preproc/html/pre-html.cc (PAGE_TEMPLATE, PS_TEMPLATE,
|
||||
REGION_TEMPLATE): New macros.
|
||||
(createAllPages, makeTempFiles): Use them.
|
||||
Include `nonposix.h'.
|
||||
(html_system): New function.
|
||||
(createAllPages, createImage): Use it.
|
||||
Use EXE_EXT.
|
||||
|
||||
* tmac/www.tmac: Fix typos.
|
||||
|
||||
2001-07-03 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* tmac/www.tmac: Disable hyphenation in normal text only if output
|
||||
device is html.
|
||||
(URL, FTP, MAILTO): Disable hyphenation of actual URL with `\%'.
|
||||
* tmac/groff_mwww.man, NEWS: Updated.
|
||||
|
||||
2001-07-03 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* tmac/www.tmac (.IMAGE): Add fourth parameter to specify vertical
|
||||
image location.
|
||||
|
||||
2001-07-02 Ruslan Ermilov <ru@FreeBSD.org>
|
||||
|
||||
* tmac/doc-common, tmac/doc.tmac (doc-display-ft-stack,
|
||||
doc-display-ps-stack): Implement font and font size stack for
|
||||
displays.
|
||||
|
||||
2001-07-02 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* REVISION: Increased to 2.
|
||||
* src/roff/troff/input.cc (read_size): Fix special case `\s[0]'.
|
||||
|
||||
* src/groff/grog/grog.pl (process): Handle `Oo' and `Oc' not at the
|
||||
beginning of a line.
|
||||
* src/groff/grog/grog.sh: Ditto.
|
||||
|
||||
2001-06-29 Peter Marquardt <wwwutz@molgen.mpg.de>
|
||||
|
||||
* src/preproc/eqn/neqn.sh: Put `export' keyword in a new line to
|
||||
make it portable.
|
||||
|
||||
2001-06-27 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
Fix problems with preprocessor string for `man' program.
|
||||
|
||||
* *.man: Don't use `s' in preprocessor string -- it doesn't exist.
|
||||
Updated/added copyright.
|
||||
Moved Emacs's local variable to identify nroff mode to the end of
|
||||
the file; add local variable if missing.
|
||||
|
||||
2001-06-26 Andras Salamon <andras@cs.wits.ac.za>
|
||||
|
||||
* aclocal.m4: Replace AC_LANG_SAVE + AC_LANG_CPLUSPLUS with
|
||||
AC_LANG_PUSH(C++) and AC_LANG_RESTORE with AC_LANG_POP(C++).
|
||||
* configure: Regenerated.
|
||||
|
||||
2001-06-25 Andras Salamon <andras@cs.wits.ac.za>
|
||||
|
||||
* aclocal.m4 (GROFF_PAGE): Fix page detection code.
|
||||
* configure: Regenerated.
|
||||
|
||||
2001-06-24 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* doc/homepage.ms: Don't include arkup.tmac (which no longer exists)
|
||||
but www.tmac.
|
||||
* doc/pic.ms: Fix typos.
|
||||
|
||||
Version 1.17.1 released
|
||||
=======================
|
||||
|
||||
2001-06-21 Golubev I. N. <gin@mo.msk.ru>
|
||||
|
||||
* aclocal.m4 (GROFF_NEED_DECLARATION): Fix inclusion of strings.h.
|
||||
* configure: Updated.
|
||||
|
||||
2001-06-20 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* src/roff/preproc/html/pre-html.cc (make_message): Fix incorrect
|
||||
image names.
|
||||
* src/roff/troff/dic.cc (blank_line): Add html tag.
|
||||
|
||||
2001-06-19 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* src/roff/troff/input.cc (do_suppress): Fix typo.
|
||||
|
||||
2001-06-18 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
Added two new options (-D and -I) to specify image names and a
|
||||
subdirectory to place the images in.
|
||||
|
||||
Change syntax from \\Ox to \\O[x].
|
||||
|
||||
* src/devices/grohtml/post-html.cc (main): Add options.
|
||||
(usage): Updated.
|
||||
* src/preproc/html/pre-html.cc: Include `stdarg.h'.
|
||||
Use `NULL' instead of `0' for null string pointers.
|
||||
(MAX_RETRIES): New macro.
|
||||
(lengthOfintToStr, intToStr, make_message): New functions.
|
||||
(makeFileName): Make function static.
|
||||
Implement -D and -I options.
|
||||
(checkImageDir): New function.
|
||||
(write_end_image, write_start_image): Use new syntax of \O.
|
||||
(createAllPages, removeAllPages): Implement -D and -I options. Use
|
||||
make_message().
|
||||
(createImage): Use make_message().
|
||||
(addps4html): Add guard for malloc().
|
||||
(usage, scanArguments): Updated.
|
||||
(makeTempFiles): Use mkstemp().
|
||||
(removeTempFiles): Use unlink().
|
||||
(findPrefix): Add guard for malloc().
|
||||
(main): Updated.
|
||||
* src/roff/troff/input.cc (get_delim_file_name): New function to
|
||||
parse \O.
|
||||
(do_suppress): Updated to parse new syntax.
|
||||
* src/devices/grohtml/grohtml.man: Updated.
|
||||
* tmac/www.tmac: Updated to new syntax.
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
2001-06-15 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/roff/grog/Makefile.sub: Remove NAMEPREFIX.
|
||||
|
||||
* src/devices/grohtml/grohtml.man: Minor improvements.
|
||||
|
||||
2001-06-14 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/preproc/html/Makefile.sub: Remove NAMEPREFIX.
|
||||
|
||||
2001-06-11 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* man/roff.man, mann/groff.man: Use '\" instead of .\" in the first
|
||||
line to specify preprocessor options -- mandb 2.3.1 only recognizes
|
||||
the former.
|
||||
* src/preproc/grn/grn.man: Add proper '\" string.
|
||||
|
||||
2001-06-11 OKAZAKI Tetsurou <okazaki@be.to>
|
||||
|
||||
* test-groff: Don't use PATH but GROFF_BIN_PATH.
|
||||
|
||||
2001-06-08 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
Updated to autoconf 2.50.
|
||||
|
||||
* configure.in: Renamed to...
|
||||
* configure.ac: This.
|
||||
* aclocal.m4 (AC_OUTPUT_MAKE_DEFS): Removed.
|
||||
(GROFF_OS390): Updated.
|
||||
* configure: Regenerated.
|
||||
|
||||
2001-05-18 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/roff/troff/env.c, src/roff/troff/env.h,
|
||||
src/roff/troff/input.cc, src/roff/troff/troff.man: Undo `ss' change
|
||||
from 2000-12-21.
|
||||
|
||||
2001-05-17 Jeffrey Friedl <jfriedl@yahoo-inc.com>
|
||||
|
||||
* src/roff/troff/input.cc (read_size): Fix special case `\s0'.
|
||||
|
||||
2001-05-16 Bruce Lilly <blilly@erols.com>
|
||||
|
||||
* contrib/mm/m.tmac (TH): Fix incorrect error message.
|
||||
|
||||
2001-05-16 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/roff/troff/input.cc (read_size): Emit warning if value becomes
|
||||
less than or equal zero; set it to 1 then.
|
||||
* src/roff/troff/node.h (node::node): Initialize `last'.
|
||||
|
||||
2001-05-08 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* tmac/an-old.tmac: Make predefined strings work in compatibility
|
||||
mode.
|
||||
Add troff version guard.
|
||||
* tmac/doc.tmac: Simplify version guard.
|
||||
|
||||
2001-05-07 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
The .ns and .rs requests are now honoured not only in the top-level
|
||||
but in all diversions (similar to UNIX troff).
|
||||
|
||||
This change is based on a patch from Tadziu Hoffmann
|
||||
<hoffmann@usm.uni-muenchen.de>.
|
||||
|
||||
* src/roff/troff/div.h (diversion): Add `no_space_mode' member.
|
||||
(top_level_diversion): Remove `no_space_mode' member.
|
||||
* src/roff/troff/div.cc (diversion::diversion,
|
||||
top_level_diversion::top_level_diversion): Updated.
|
||||
(macro_diversion::output): Reset `no_space_mode'.
|
||||
(no_space, restore_spacing): Use `curdiv' unconditionally.
|
||||
(space_request, blank_line): Check `curdiv->no_space_mode'.
|
||||
(no_space_mode_reg::get_value, no_space_mode_reg::get_string): Use
|
||||
`curdiv' unconditionally.
|
||||
* NEWS, src/roff/troff/troff.man, man/groff.man, doc/groff.texinfo:
|
||||
Updated.
|
||||
|
||||
2001-05-06 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
Added two new requests `de1' and `am1' which are similar to `de' and
|
||||
`am' with the difference that compatibility mode is saved on entry,
|
||||
switched off during macro execution, and restored on exit.
|
||||
|
||||
* src/roff/troff/input.h: Added two new special characters
|
||||
(COMPATIBLE_SAVE, COMPATIBLE_RESTORE).
|
||||
* src/roff/troff/input.cc (input_iterator): Added two member
|
||||
functions `save_compatible_flag' and `get_compatible_flag'.
|
||||
(input_stack): Ditto.
|
||||
(string_iterator): Ditto. Also add private member
|
||||
`saved_compatible_flag'.
|
||||
(token::next): Use COMPATIBLE_SAVE and COMPATIBLE_RESTORE.
|
||||
(calling_mode): New enumeration.
|
||||
(do_define_macro): Use it. Insert COMPATIBLE_SAVE and
|
||||
COMPATIBLE_RESTORE at the beginning and end of macro, respectively.
|
||||
(define_macro, define_indirect_macro, append_macro, ignore): Use
|
||||
`calling_mode'.
|
||||
(define_nocomp_macro, append_nocomp_macro): New functions.
|
||||
(init_input_requests): Updated.
|
||||
(do_request): Rename local variable `saved_compatible_flag' to
|
||||
`old_compatible_flag'.
|
||||
* NEWS, src/roff/troff/troff.man, man/groff.man: Document it.
|
||||
|
||||
* tmac/an-old.tmac: Use `de1' instead of `de' request for all
|
||||
public and trap-invoked macros. As a consequence, the man macros
|
||||
work in compatibility mode also.
|
||||
|
||||
2001-05-06 Solar Designer <solar@openwall.com>
|
||||
|
||||
* Makefile.in: Use $(mandir).
|
||||
|
||||
2001-05-06 Alexios Zavras <zvr@pobox.com>
|
||||
|
||||
* src/utils/afmtodit/afmtodit.pl: Fix serious typo.
|
||||
|
||||
2001-05-05 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
Added `.ns' number register: Returns 1 in no-space mode (if in
|
||||
top-level diversion), 0 otherwise.
|
||||
|
||||
* src/roff/troff/div.cc (no_space_mode_reg): New class.
|
||||
(init_div_requests): Updated.
|
||||
* NEWS, src/roff/troff/troff.man, man/groff.man, doc/groff.texinfo:
|
||||
Document it.
|
||||
|
||||
2001-05-04 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/roff/nroff/nroff.man: Improved documentation (especially
|
||||
locales).
|
||||
|
||||
2001-05-02 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
Added `brp' request: This is \p as a request.
|
||||
|
||||
* src/roff/troff/env.cc (environment::do_break): Add parameter
|
||||
`spread'.
|
||||
(do_break_request): New function (was `break_request').
|
||||
(break_request): Calls `do_break_request'.
|
||||
(break_spread_request): New; calls `do_break_request'.
|
||||
(init_env_requests): Updated.
|
||||
* src/roff/troff/env.h: Updated.
|
||||
* NEWS, src/roff/troff/troff.man, man/groff.man: Document it.
|
||||
|
||||
* REVISION: Increased to 1.
|
||||
* win32-diffs: Updated.
|
||||
|
||||
2001-05-01 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* tmac/an-old.tmac: Fix minor compatibility mode issue.
|
||||
* tmac/troffrc-end: Make it really work in compatibility mode.
|
||||
|
||||
2001-04-27 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/utils/lkbib/lkbib.cc: Switch inclusion order of stdio.h and
|
||||
stdlib.h.
|
||||
|
||||
2001-04-22 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/libs/libgroff/getopt.c, src/include/getopt.h: Updating to
|
||||
latest versions from glibc CVS archive.
|
||||
|
||||
* MORE.STUFF: Updated, using a patch from Kees Zeelenberg
|
||||
<c.zeelenberg@hccnet.nl>.
|
||||
|
||||
2001-04-21 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* configure.in: Move check for mkstemp() to...
|
||||
* aclocal.m4 (GROFF_MKSTEMP): This new function.
|
||||
* configure: Regenerated.
|
||||
|
||||
* src/include/groff-getopt.h: Don't use variable names in
|
||||
declarations.
|
||||
|
||||
* src/devices/grohtml/html-chars.h: Removed. It isn't used.
|
||||
* src/devices/grohtml/Makefile.sub,
|
||||
src/devices/grohtml/post-html.cc: Updated.
|
||||
|
||||
2001-04-21 Albert Chin-A-Young <china@thewrittenword.com>
|
||||
|
||||
* configure.in: Add special check for mkstemp().
|
||||
* src/libs/libgroff/tmpfile.cc: Use it.
|
||||
* src/utils/indxbib/indxbib.cc: Ditto.
|
||||
* src/utils/pfbtops/pfbtops.c (main): Don't use C++ comment style.
|
||||
* src/devices/grolbp/lbp.h (lbpprintf, lbpputs, vdmprintf): Use
|
||||
`const'.
|
||||
|
||||
2001-04-20 Bruce Lilly <blilly@erols.com>
|
||||
|
||||
`Version_string' as C++ object was not visible to linker from C
|
||||
object files.
|
||||
Add `const' to `Version_string'.
|
||||
|
||||
* src/utils/pfbtops/pfbtops.c (main), src/roff/groff/groff.cc
|
||||
(main), src/roff/troff/input.cc (main), src/preproc/tbl/main.cc
|
||||
(main), src/preproc/pic/main.cc (main), src/preproc/eqn/main.cc
|
||||
(main), src/preproc/grn/main.cc (main), src/preproc/html/pre-html.cc
|
||||
(scanArguments), src/preproc/refer/refer.cc (main),
|
||||
src/preproc/soelim/soelim.cc (main), src/devices/grotty/tty.cc
|
||||
(main), src/devices/grodvi/dvi.cc (main), src/devices/grolj4/lj4.cc
|
||||
(main), src/devices/grohtml/post-html.cc (main),
|
||||
src/devices/grolbp/lbp.cc (main), src/utils/tfmtodit/tfmtodit.cc
|
||||
(main), src/utils/hpftodit/hpftodit.cc (main),
|
||||
src/utils/lookbib/lookbib.cc (main), src/utils/indxbib/indxbib.cc
|
||||
(main), src/utils/lkbib/lkbib.cc (main),
|
||||
src/utils/addftinfo/addftinfo.cc (main): Implement it.
|
||||
|
||||
* src/roff/groff/pipeline.c: Add _UWIN.
|
||||
* src/include/nonposix.h: Ditto.
|
||||
|
||||
2001-04-20 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/include/lib.h: Use HAVE_STRERROR.
|
||||
* src/roff/groff/pipeline.c: Ditto.
|
||||
* src/preproc/html/pre-html.cc: Remove declaration of `strerror'.
|
||||
* src/libs/libgroff/Makefile.sub (version.cc): Add `extern "C"'.
|
||||
* src/utils/pfbtops/pfbtops.c: Add copyright notice.
|
||||
* win32-diffs: Updated.
|
||||
* src/utils/hpftodit/hpftodit.cc (read_map): Fix compiler warning.
|
||||
|
||||
2001-04-19 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* src/preproc/html/pre-html.cc (scanArguments): Use `troff_command'
|
||||
instead of hardwired `"troff"'.
|
||||
(char_buffer::read_file): Remove unused variables.
|
||||
(char_buffer::write_file_troff): Ditto.
|
||||
(char_buffer::write_file_html): Ditto.
|
||||
(generateImages): Ditto.
|
||||
(abs): Removed.
|
||||
* src/utils/addftinfo/addftinfo.cc (main): Fix compilation problem.
|
||||
|
||||
* src/include/lib.h: Don't include `groff-getopt.h' for UWIN.
|
||||
|
||||
* src/libs/libgroff/font.cc (font::load_desc): Fix compiler warning.
|
||||
* src/libs/libbib/index.cc (index_search_item_iterator::get_tag,
|
||||
index_search_item::search1): Ditto.
|
||||
* src/roff/troff/node.h (width_list): Reorder members.
|
||||
* src/roff/troff/input.cc (do_define_macro): Fix compiler warning.
|
||||
(lookup_warning): Ditto.
|
||||
(prepend_string): Commented out.
|
||||
* src/roff/troff/dictionary.cc (is_good_size): Fix compiler warning.
|
||||
* src/roff/troff/reg.cc (number_value_to_ascii): Ditto.
|
||||
* src/preproc/tbl/main.cc (process_format): Ditto.
|
||||
* src/preproc/pic/pic.y (define_variable, reset, reset_all): Fix
|
||||
compiler warnings.
|
||||
* src/preproc/pic/pic.cc: Updated.
|
||||
* src/preproc/eqn/lex.cc (init_table): Fix compiler warnings.
|
||||
* src/preproc/eqn/over.cc (over_box::compute_metrics): Ditto.
|
||||
* src/preproc/refer/command.cc (execute_command): Ditto.
|
||||
* src/preproc/refer/ref.cc (sortify_title, find_month): Ditto.
|
||||
* src/preproc/refer/token.cc (lookup_token): Ditto.
|
||||
* src/preproc/soelim/soelim.cc: Ditto.
|
||||
* src/preproc/html/pushbackbuffer.cc (ERROR): Ditto.
|
||||
(isHexDigit): Commented out.
|
||||
(pushBackBuffer::isString): Remove unused variable.
|
||||
* src/devices/grops/ps.cc (ps_printer::special): Fix compiler
|
||||
warning.
|
||||
* src/devices/grops/psrm.cc (resource_manager::lookup_font,
|
||||
resource_manager::read_resource_arg, read_one_of, parse_extensions):
|
||||
Ditto.
|
||||
* src/devices/grodvi/dvi.cc (dvi_printer::draw): Ditto.
|
||||
* src/devices/grolj4/lj4.cc (lj4_font::handle_unknown_font_command,
|
||||
lookup_paper_size): Ditto.
|
||||
* src/devices/grohtml/post-html.cc (is_subsection): Commented out.
|
||||
(text_glob, element_list): Reorder members.
|
||||
* src/devices/grohtml/html-text.cc (html_text::do_pre): Remove
|
||||
compiler warning.
|
||||
* src/devices/grohtml/html-text.h (html_text::emit_space): Change
|
||||
return value to `void'.
|
||||
* src/devices/grohtml/output.cc (word_list::word_list): Fix order
|
||||
of initializers.
|
||||
* src/devices/grohtml/html.h (simple_output::check_newline,
|
||||
simple_output::space_or_newline, simple_output::enable_newlines):
|
||||
Add return value.
|
||||
* src/devices/grolbp/lbp.cc (wp54charset, set_papersize): Remove
|
||||
compiler warnings.
|
||||
* src/utils/tfmtodit/tfmtodit.cc (tfm::load, gf::load, main): Ditto.
|
||||
* src/utils/hpftodit/hpftodit.cc (File::seek, read_symbol_sets,
|
||||
output_ligatures, output_charset, read_map): Ditto.
|
||||
* src/utils/lookbib/lookbib.cc (main): Ditto.
|
||||
* src/utils/indxbib/indxbib.cc (main, fwrite_or_die): Ditto.
|
||||
(do_file): Fix typo (`=' -> `==').
|
||||
* src/utils/lkbib/lkbib.cc (main): Remove compiler warning.
|
||||
* src/utils/addftinfo/addftinfo.cc (main): Ditto.
|
||||
|
||||
2001-04-18 Ruslan Ermilov <ru@FreeBSD.org>
|
||||
|
||||
* src/roff/nroff/nroff.sh: Adding -p (pic) and -t (tbl) options.
|
||||
Fix usage of GROFF_BIN_PATH.
|
||||
* src/roff/nroff/nroff.man: Updated.
|
||||
|
||||
2001-04-18 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
* NEWS: Fixing typos.
|
||||
Updated.
|
||||
|
||||
Version 1.17 released
|
||||
=====================
|
||||
|
||||
@ -54,7 +500,7 @@ Version 1.17 released
|
||||
* doc/groff.texinfo: Fixes, additions.
|
||||
* MORE.STUFF: Updated.
|
||||
|
||||
2001-04-12 Gaius Mulley <gaius@glam.ac.uk>
|
||||
2001-04-12 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* src/devices/grohtml/grohtml.man: Updated manual page regarding
|
||||
simple anchor.
|
||||
@ -245,7 +691,7 @@ Version 1.17 released
|
||||
* tmac/doc.tmac (Cd): Simplify code.
|
||||
* tmac/groff_mdoc.man: Document some behaviour of `Cd' request.
|
||||
|
||||
2001-04-06 Werner Lemberg <wl@gnu.org>
|
||||
2001-04-06 Werner LEMBERG <wl@gnu.org>
|
||||
|
||||
Implement continuous underlining for nroff mode. To do that, a new
|
||||
request in the ditroff language has been added: `x u N' (N is 0
|
||||
@ -1530,7 +1976,7 @@ Version 1.17 released
|
||||
|
||||
* src/roff/troff/troff.man, NEWS, man/groff.man: Updated.
|
||||
|
||||
2000-09-22 Ricardo Soares Guimarães <ricardo@conectiva.com.br>
|
||||
2000-09-22 Ricardo Soares Guimarães <ricardo@conectiva.com.br>
|
||||
|
||||
Adding a new option -P and new environment variable GROPS_PROLOGUE
|
||||
to grops, selecting a different prologue file (minor modifications
|
||||
@ -2526,7 +2972,7 @@ Version 1.16 released
|
||||
|
||||
* tmac/eqnrc: Small fixes.
|
||||
|
||||
2000-03-05 Abramo Bagnara <abramo@alsa-project.org>
|
||||
2000-03-05 Abramo Bagnara <abramo@alsa-project.org>
|
||||
|
||||
Adding a request `evc' to copy environments.
|
||||
|
||||
@ -3118,7 +3564,7 @@ Version 1.16 released
|
||||
* Makefile.in: Added $(tmac_m) again since the Makefile in `mm'
|
||||
expects this variable
|
||||
|
||||
2000-01-01 Gaius Mulley <gaius@glam.ac.uk>
|
||||
2000-01-01 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* doc/Makefile: Added instructions to create HTML and text
|
||||
versions of some files.
|
||||
@ -3284,7 +3730,7 @@ Version 1.12 released
|
||||
|
||||
* pfbtops/Makefile.sub: On AIX, -lm is needed also.
|
||||
|
||||
1999-12-03 Gaius Mulley <gaius@glam.ac.uk>
|
||||
1999-12-03 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* doc/Makefile: Added rule for generation pic.html.
|
||||
|
||||
@ -3294,7 +3740,7 @@ Version 1.12 released
|
||||
|
||||
* tmac/tmac.html: Fixed suppression of headers.
|
||||
|
||||
1999-11-16 Gaius Mulley <gaius@glam.ac.uk>
|
||||
1999-11-16 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* tmac/tmac.html: Fixing horizontal arrows.
|
||||
|
||||
@ -3303,7 +3749,7 @@ Version 1.12 released
|
||||
* tmac/tmac.an: Improved support for grohtml; better indentation,
|
||||
no footers/headers.
|
||||
|
||||
1999-10-31 Gaius Mulley <gaius@glam.ac.uk>
|
||||
1999-10-31 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* tmac/tmac.arkup: Added CDFTP macro
|
||||
|
||||
@ -3312,7 +3758,7 @@ Version 1.12 released
|
||||
|
||||
* tmac/troffrc: Some additions for HTML stuff.
|
||||
|
||||
1999-10-06 Gaius Mulley <gaius@glam.ac.uk>
|
||||
1999-10-06 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* tmac/tmac.html: Small changes.
|
||||
|
||||
@ -3320,7 +3766,7 @@ Version 1.12 released
|
||||
|
||||
* doc/groff.texinfo: Minor fixes.
|
||||
|
||||
1999-09-26 Gaius Mulley <gaius@glam.ac.uk>
|
||||
1999-09-26 Gaius Mulley <gaius@glam.ac.uk>
|
||||
|
||||
* devhtml/TR: Changed spacewidth to 3.
|
||||
|
||||
|
@ -6,40 +6,54 @@ win32
|
||||
|
||||
Here two ports using the gcc compiler and other GNU tools:
|
||||
|
||||
Thomer M. Gil <tmgil@cs.vu.nl>:
|
||||
. Cygwin:
|
||||
|
||||
http://www.cs.vu.nl/~tmgil/misc/wingroff.html
|
||||
http://sources.redhat.com/cygwin/
|
||||
|
||||
Kees Zeelenberg <c.zeelenberg@hccnet.nl>:
|
||||
Look for a convenient mirror site in
|
||||
|
||||
http://gnuwin32.sourceforge.net/
|
||||
http://sources.redhat.com/cygwin/mirrors.html
|
||||
|
||||
At any of this mirrors, groff can be found in the directory
|
||||
latest/groff.
|
||||
|
||||
. Kees Zeelenberg <c.zeelenberg@hccnet.nl>:
|
||||
|
||||
http://gnuwin32.sourceforge.net/packages/groffl.htm
|
||||
|
||||
This port includes grap-1.10 and deroff-1.7.
|
||||
|
||||
dos
|
||||
---
|
||||
|
||||
Binaries for Eli Zaretskii's port using the djgpp compiler
|
||||
are available from
|
||||
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'.
|
||||
This port also runs on win32 systems, except Win2K.
|
||||
|
||||
grap
|
||||
----
|
||||
|
||||
An implementation of Kernighan & Bentley's grap language for typesetting
|
||||
graphs. Written by Ted Faber <faber@lunabase.org>. The actual version
|
||||
can be found at
|
||||
can be found at
|
||||
|
||||
http://www.lunabase.org/~faber/Vault/software/grap/
|
||||
|
||||
A djgpp port which runs on MS-DOS and all Win32 systems (Win95, Win98,
|
||||
A djgpp port which runs on dos and most win32 systems (Win95, Win98,
|
||||
WinNT) done by Kees Zeelenberg <c.zeelenberg@hccnet.nl> is available from
|
||||
|
||||
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2apps/
|
||||
|
||||
It is intended to be used with the djgpp port of groff.
|
||||
|
||||
A win32 port is included in the groff package available from
|
||||
|
||||
http://gnuwin32.sourceforge.net/
|
||||
|
||||
plot2dev
|
||||
--------
|
||||
|
||||
@ -67,7 +81,7 @@ everything is available from
|
||||
http://www.primate.wisc.edu/software/troffcvt/
|
||||
|
||||
unroff
|
||||
______
|
||||
------
|
||||
|
||||
From the README file:
|
||||
|
||||
@ -88,8 +102,8 @@ deroff
|
||||
Deroff removes roff constructs from documents for the purpose of indexing,
|
||||
spell checking etc.
|
||||
|
||||
Michael Haardt's <michael@moria.de> implementation is a little smarter than
|
||||
traditional implementations, because it knows about certain -man and
|
||||
Michael Haardt's <michael@moria.de> implementation is a little smarter
|
||||
than traditional implementations, because it knows about certain -man and
|
||||
-mm macros. It is able to generate a word list for spell checking tools
|
||||
or omit headers for sentence analysis tools. It can further generate
|
||||
cpp-style #line lines.
|
||||
@ -103,6 +117,10 @@ Win95, Win98, WinNT) is available from
|
||||
|
||||
and its mirrors.
|
||||
|
||||
A win32 port of version 1.7 is available from
|
||||
|
||||
http://gnuwin32.sourceforge.net/
|
||||
|
||||
miscellaneous
|
||||
-------------
|
||||
|
||||
@ -125,9 +143,9 @@ miscellaneous
|
||||
things to ASCII text. Amongst other things, it breaks lines at new
|
||||
sentences, reduces upper-case acronyms by one point size, adds
|
||||
diacriticals, changes simple quotes into smart quotes, and makes a few
|
||||
simple grammar checks. The best way to see what it does is to run it as
|
||||
a sed script file (or files) on a text file and then compare the output
|
||||
file with the original.
|
||||
simple grammar checks. The best way to see what it does is to run it
|
||||
as a sed script file (or files) on a text file and then compare the
|
||||
output file with the original.
|
||||
|
||||
o `DropCaps' is a troff script which replaces the initial letters of
|
||||
paragraphs immediately after H1 and H2 headings with drop-capitals of
|
||||
@ -148,7 +166,8 @@ miscellaneous
|
||||
documentation
|
||||
-------------
|
||||
|
||||
Many documents related to the original versions of troff, ditroff, pic, and
|
||||
others can be accessed from the following web page:
|
||||
Many documents related to the original versions of troff, ditroff, pic,
|
||||
and others can be accessed from the following web pages:
|
||||
|
||||
http://www.cs.bell-labs.com/cm/cs/cstr.html
|
||||
http://www.cs.bell-labs.com/cm/cs/papers.html
|
||||
|
@ -158,7 +158,8 @@ indexname=Ind
|
||||
common_words_file=$(datasubdir)/eign
|
||||
|
||||
# manroot is the root of the man page directory tree.
|
||||
manroot=@mandir@
|
||||
mandir=@mandir@
|
||||
manroot=$(mandir)
|
||||
|
||||
# man1ext is the man section for user commands.
|
||||
man1ext=1
|
||||
|
@ -1,21 +1,72 @@
|
||||
This file describes recent user-visible changes in groff. Bug fixes
|
||||
are not described. There are more details in the man pages.
|
||||
This file describes recent user-visible changes in groff. Bug fixes are not
|
||||
described. There are more details in the man pages.
|
||||
|
||||
VERSION 1.17.2
|
||||
==============
|
||||
|
||||
This is major bug-fixing release which should replace 1.17.1.
|
||||
|
||||
Troff
|
||||
-----
|
||||
|
||||
o The `IMAGE' macro in www.tmac has changed: Now the optional 2nd parameter
|
||||
gives the horizontal image location (left, centered, or right), and the
|
||||
optional 3rd and 4th parameter the image dimensions.
|
||||
|
||||
VERSION 1.17.1
|
||||
==============
|
||||
|
||||
This is mainly a bug-fixing release.
|
||||
|
||||
Troff
|
||||
-----
|
||||
|
||||
o Two new requests `de1' and `am1' which are similar to `de' and `am' but
|
||||
with compatibility mode disabled during expansion of macros defined by
|
||||
them.
|
||||
|
||||
o Added request `brp'. This is the same as `\p'.
|
||||
|
||||
o Similar to other versions of troff, `.ns' now works in all diversions,
|
||||
not only in the top-level one.
|
||||
|
||||
o New read-only number register `.ns'. Returns 1 if in no-space mode,
|
||||
0 otherwise.
|
||||
|
||||
Nroff
|
||||
-----
|
||||
|
||||
o Options -p (pic) and -t (tbl) added.
|
||||
|
||||
o The environment variable GROFF_BIN_PATH is now checked before PATH for
|
||||
finding groff.
|
||||
|
||||
Grohtml
|
||||
-------
|
||||
|
||||
o New option `-D dir' to specify a directory in which all images are placed.
|
||||
|
||||
o New option `-I stem' to specify an image name stame. If not given,
|
||||
`grohtml-XXX' is used (`XXX' is the process ID).
|
||||
|
||||
VERSION 1.17
|
||||
============
|
||||
|
||||
Groff
|
||||
-----
|
||||
|
||||
o `-mFOO' will now search first for `FOO.tmac' and then for `tmac.FOO'. The
|
||||
o `-mFOO' now searches first for `FOO.tmac' and then for `tmac.FOO'. The
|
||||
old behaviour has been changed to overcome problems with platforms which
|
||||
have an 8+3 file name limit, and platforms which have other versions of
|
||||
troff installed also. Additionally, all macro files have been renamed
|
||||
using the latter scheme to avoid 8+3 name clashes.
|
||||
|
||||
o The new environment variable GROFF_BIN_PATH will be checked for programs
|
||||
groff is calling (preprocessors, troff, and output devices) before PATH.
|
||||
If not set, it defaults to the directory where the groff binary is
|
||||
located. Previously, it was PATH only. The nroff script will only use
|
||||
GROFF_BIN_PATH to find the groff binary but passes both the GROFF_BIN_PATH
|
||||
and PATH environment variable to groff.
|
||||
o The new environment variable GROFF_BIN_PATH is checked for programs groff
|
||||
is calling (preprocessors, troff, and output devices) before PATH. If not
|
||||
set, it defaults to the directory where the groff binary is located.
|
||||
Previously, it was PATH only. The nroff script only uses GROFF_BIN_PATH
|
||||
to find the groff binary but passes both the GROFF_BIN_PATH and PATH
|
||||
environment variable to groff.
|
||||
|
||||
Troff
|
||||
-----
|
||||
@ -47,9 +98,9 @@ o The mdoc package has been completely rewritten, using the full power of
|
||||
encounter any abnormal results, please report them to bug-groff@gnu.org.
|
||||
|
||||
o A new command line option for the `man' macros (similar to the `mdoc'
|
||||
package has been implemented: `-rcR=1' (now the default in nroff mode) will
|
||||
produce one single, very long page instead of multiple pages. `-rcR=0'
|
||||
will deactivate it.
|
||||
package has been implemented: `-rcR=1' (now the default in nroff mode)
|
||||
produces one single, very long page instead of multiple pages. `-rcR=0'
|
||||
deactivates it.
|
||||
|
||||
o The `return' request has been added to return immediately from a macro.
|
||||
|
||||
@ -73,7 +124,7 @@ o `box' and `boxa' are two new requests which behave similarly to `di' and
|
||||
o The `asciify' request has been extended to `unformat' space characters
|
||||
and some other escape sequences also.
|
||||
|
||||
`\ ' will no longer be unformatted as a space but remains an unpaddable,
|
||||
`\ ' is no longer unformatted as a space but remains an unpaddable,
|
||||
unbreakable space character.
|
||||
|
||||
o The new `unformat' request is similar to `asciify' but only handles space
|
||||
@ -164,7 +215,7 @@ o Calling the `fam' request without an argument switches back to the
|
||||
previous font family.
|
||||
|
||||
o The new read-only register `.int' is set to a positive value if the last
|
||||
output line is interrupted (i.e., if it contains `\c').
|
||||
output line is interrupted (i.e., if the input line contains `\c').
|
||||
|
||||
o The `writem' request is not new, but hasn't been documented before. This
|
||||
is similar to `write' but instead of a string the contents of a given
|
||||
@ -174,24 +225,17 @@ o The read/write number register `hp' to get/set the current horizontal
|
||||
position relative to the input line isn't new but hasn't been documented
|
||||
properly before.
|
||||
|
||||
o `\X' and `\Y' are no transparent for end-of-sentence recognition.
|
||||
o `\X' and `\Y' are now transparent for end-of-sentence recognition.
|
||||
|
||||
o The `cu' request in nroff mode now works as documented (i.e., it does
|
||||
underline spaces also).
|
||||
|
||||
Nroff
|
||||
-----
|
||||
|
||||
Option -v shows the version number.
|
||||
o The `cu' request in nroff mode now works as documented (i.e., it
|
||||
underlines spaces also).
|
||||
|
||||
Grog
|
||||
----
|
||||
|
||||
o The grog script will now work in non-compatibility mode also (which is the
|
||||
o The grog script now works in non-compatibility mode also (which is the
|
||||
default). As usual, use the `-C' option to activate compatibility mode.
|
||||
|
||||
o Option -v shows the version number.
|
||||
|
||||
Grops
|
||||
-----
|
||||
|
||||
@ -227,16 +271,15 @@ o For security reasons the following changes have been done:
|
||||
Use the `-F' command line option or the GROFF_FONT_PATH environment
|
||||
variable if you really need the current directory.
|
||||
|
||||
o groff will now install its data files into
|
||||
/usr/local/share/groff/<version> by default, following the GNU standard.
|
||||
Additionally, a local tmac directory (by default
|
||||
/usr/local/share/groff/site-tmac) will be scanned before the standard tmac
|
||||
directory. Wrapper files for system-specific macro packages (if
|
||||
necessary) are put into /usr/local/lib/groff/site-tmac; this directory
|
||||
will be searched before the local tmac directory.
|
||||
o groff now installs its data files into /usr/local/share/groff/<version> by
|
||||
default, following the GNU standard. Additionally, a local tmac directory
|
||||
(by default /usr/local/share/groff/site-tmac) is scanned before the
|
||||
standard tmac directory. Wrapper files for system-specific macro packages
|
||||
(if necessary) are put into /usr/local/lib/groff/site-tmac; this directory
|
||||
is searched before the local tmac directory.
|
||||
|
||||
o All programs now have option `-v' to show the version number; they will
|
||||
exit immediately afterwards, following the GNU standards. Additionally,
|
||||
o All programs now have option `-v' to show the version number; they exit
|
||||
immediately afterwards, following the GNU standards. Additionally,
|
||||
`--version' and `--help' have been added, doing the obvious actions.
|
||||
|
||||
VERSION 1.16.1
|
||||
|
@ -1 +1 @@
|
||||
0
|
||||
2
|
||||
|
102
contrib/groff/aclocal.m4
vendored
102
contrib/groff/aclocal.m4
vendored
@ -94,38 +94,35 @@ dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_POSIX,
|
||||
[AC_MSG_CHECKING([whether -D_POSIX_SOURCE is necessary])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_TRY_COMPILE([#include <stdio.h>
|
||||
extern "C" { void fileno(int); }],,
|
||||
AC_MSG_RESULT(yes);AC_DEFINE(_POSIX_SOURCE),
|
||||
AC_MSG_RESULT(no))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
dnl srand() of SunOS 4.1.3 has return type int instead of void
|
||||
dnl
|
||||
AC_DEFUN(GROFF_SRAND,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([for return type of srand])
|
||||
AC_TRY_COMPILE([#include <stdlib.h>
|
||||
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
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_SYS_NERR,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([for sys_nerr in <errno.h> or <stdio.h>])
|
||||
AC_TRY_COMPILE([#include <errno.h>
|
||||
#include <stdio.h>],
|
||||
[int k; k = sys_nerr;],
|
||||
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_SYS_NERR),
|
||||
AC_MSG_RESULT(no))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_SYS_ERRLIST,
|
||||
@ -138,36 +135,33 @@ AC_MSG_RESULT(no))])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_OSFCN_H,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([C++ <osfcn.h>])
|
||||
AC_TRY_COMPILE([#include <osfcn.h>],
|
||||
[read(0, 0, 0); open(0, 0);],
|
||||
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_OSFCN_H),
|
||||
AC_MSG_RESULT(no))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_LIMITS_H,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([C++ <limits.h>])
|
||||
AC_TRY_COMPILE([#include <limits.h>],
|
||||
[int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX;],
|
||||
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_LIMITS_H),
|
||||
AC_MSG_RESULT(no))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_TIME_T,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([for declaration of time_t])
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[time_t t = time(0); struct tm *p = localtime(&t);],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no);AC_DEFINE(LONG_FOR_TIME_T))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_STRUCT_EXCEPTION,
|
||||
@ -179,26 +173,24 @@ AC_MSG_RESULT(no))])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_ARRAY_DELETE,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([whether ANSI array delete syntax supported])
|
||||
AC_TRY_COMPILE(,
|
||||
changequote(,)dnl
|
||||
char *p = new char[5]; delete [] p;changequote([,]),
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no);AC_DEFINE(ARRAY_DELETE_NEEDS_SIZE))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_TRADITIONAL_CPP,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
[AC_LANG_PUSH(C++)
|
||||
AC_MSG_CHECKING([traditional preprocessor])
|
||||
AC_TRY_COMPILE([#define name2(a,b) a/**/b],[int name2(foo,bar);],
|
||||
AC_MSG_RESULT(yes);AC_DEFINE(TRADITIONAL_CPP),
|
||||
AC_MSG_RESULT(no))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_WCOREFLAG,
|
||||
@ -246,8 +238,6 @@ if test -z "$PAGE"; then
|
||||
if test -n "$descfile" \
|
||||
&& grep "^paperlength 841890" $descfile >/dev/null 2>&1; then
|
||||
PAGE=A4
|
||||
else
|
||||
PAGE=letter
|
||||
fi
|
||||
fi
|
||||
if test -z "$PAGE"; then
|
||||
@ -255,7 +245,8 @@ if test -z "$PAGE"; then
|
||||
/etc/resolv.conf 2>/dev/null`
|
||||
if test -z "$dom"; then
|
||||
dom=`(domainname) 2>/dev/null | tr -d '+'`
|
||||
if test -z "$dom"; then
|
||||
if test -z "$dom" \
|
||||
|| test "$dom" = '(none)'; then
|
||||
dom=`(hostname) 2>/dev/null | grep '\.'`
|
||||
fi
|
||||
fi
|
||||
@ -275,8 +266,7 @@ dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_CXX_CHECK,
|
||||
[AC_REQUIRE([AC_PROG_CXX])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_LANG_PUSH(C++)
|
||||
if test "$cross_compiling" = no; then
|
||||
AC_MSG_CHECKING([that C++ compiler can compile simple program])
|
||||
fi
|
||||
@ -308,7 +298,7 @@ AC_TRY_LINK([#include <stdio.h>],
|
||||
[fopen(0, 0);],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no);AC_MSG_ERROR([header files do not support C++ (if you are using a version of gcc/g++ earlier than 2.5, you should install libg++)]))
|
||||
AC_LANG_RESTORE])dnl
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(GROFF_TMAC,
|
||||
@ -437,13 +427,11 @@ dnl Check for OS/390 Unix. We test for EBCDIC also -- the Linux port (with
|
||||
dnl gcc) to OS/390 uses ASCII internally.
|
||||
dnl
|
||||
AC_DEFUN(GROFF_OS390,
|
||||
[groff_cv_os390="no"
|
||||
if test "$groff_cv_ebcdic" = "yes"; then
|
||||
[if test "$groff_cv_ebcdic" = "yes"; then
|
||||
AC_MSG_CHECKING([for OS/390 Unix])
|
||||
case `uname` in
|
||||
OS/390)
|
||||
CFLAGS="$CFLAGS -D_ALL_SOURCE"
|
||||
groff_cv_os390="yes"
|
||||
AC_MSG_RESULT(yes) ;;
|
||||
*)
|
||||
AC_MSG_RESULT(no) ;;
|
||||
@ -451,52 +439,22 @@ if test "$groff_cv_ebcdic" = "yes"; then
|
||||
fi])dnl
|
||||
dnl
|
||||
dnl
|
||||
dnl Finally, we must modify a base function of autoconf to replace the
|
||||
dnl ASCII char `012' with its generic equivalent `\n' if we run under
|
||||
dnl OS/390 Unix -- unfortunately, not all `tr' variants understand `\n',
|
||||
dnl so this hack is necessary.
|
||||
dnl
|
||||
define([AC_OUTPUT_MAKE_DEFS],
|
||||
[# Transform confdefs.h into DEFS.
|
||||
dnl Using a here document instead of a string reduces the quoting nightmare.
|
||||
# Protect against shell expansion while executing Makefile rules.
|
||||
# Protect against Makefile macro expansion.
|
||||
cat > conftest.defs <<\EOF
|
||||
changequote(<<, >>)dnl
|
||||
s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
|
||||
s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
|
||||
s%\[%\\&%g
|
||||
s%\]%\\&%g
|
||||
s%\$%$$%g
|
||||
changequote([, ])dnl
|
||||
EOF
|
||||
if test "$groff_cv_os390" = "yes"; then
|
||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\n' ' '`
|
||||
else
|
||||
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_LANG_PUSH(C++)
|
||||
AC_CACHE_VAL(groff_cv_decl_needed_$1,
|
||||
[AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
@ -513,4 +471,16 @@ 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
|
||||
AC_LANG_POP(C++)])dnl
|
||||
dnl
|
||||
dnl
|
||||
dnl Check for mkstemp() and its function prototype.
|
||||
dnl
|
||||
AC_DEFUN(GROFF_MKSTEMP,
|
||||
[AC_CHECK_FUNC(mkstemp,
|
||||
[AC_DEFINE(HAVE_MKSTEMP)
|
||||
AC_MSG_CHECKING([for mkstemp prototype in <stdlib.h>])
|
||||
AC_EGREP_CPP(mkstemp,
|
||||
[#include <stdlib.h>],
|
||||
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MKSTEMP_PROTO),
|
||||
AC_MSG_RESULT(no))])])
|
||||
|
5391
contrib/groff/configure
vendored
5391
contrib/groff/configure
vendored
File diff suppressed because it is too large
Load Diff
65
contrib/groff/configure.ac
Normal file
65
contrib/groff/configure.ac
Normal file
@ -0,0 +1,65 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([src/roff/groff/groff.cc])
|
||||
dnl checks for programs
|
||||
GROFF_SRCDIR
|
||||
GROFF_BUILDDIR
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
GROFF_CXX_CHECK
|
||||
GROFF_EBCDIC
|
||||
GROFF_OS390
|
||||
GROFF_PRINT
|
||||
AC_PATH_PROG(PERLPATH, perl, /usr/bin/perl)
|
||||
GROFF_PROG_YACC
|
||||
AC_PROG_RANLIB
|
||||
GROFF_INSTALL_SH
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
dnl use a dummy substitution if no csh hack is necessary to avoid errors
|
||||
dnl with non-GNU sed programs
|
||||
GROFF_CSH_HACK(SH_SCRIPT_SED_CMD='1s/.*/:/', SH_SCRIPT_SED_CMD='1s/a/a/')
|
||||
AC_SUBST(SH_SCRIPT_SED_CMD)
|
||||
dnl checks for headers
|
||||
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_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_OSFCN_H
|
||||
GROFF_LIMITS_H
|
||||
dnl checks for typedefs
|
||||
GROFF_TIME_T
|
||||
AC_TYPE_SIGNAL
|
||||
GROFF_STRUCT_EXCEPTION
|
||||
dnl checks for libraries
|
||||
GROFF_LIBM
|
||||
dnl checks for functions
|
||||
AC_FUNC_MMAP
|
||||
saved_libs="$LIBS"
|
||||
LIBS="$LIBS -lc $LIBM"
|
||||
AC_REPLACE_FUNCS(fmod strtol getcwd strerror putenv)
|
||||
LIBS="$saved_libs"
|
||||
AC_CHECK_FUNCS(rename strcasecmp strncasecmp strsep strdup)
|
||||
GROFF_MKSTEMP
|
||||
AC_DECL_SYS_SIGLIST
|
||||
dnl checks for compiler characteristics
|
||||
GROFF_ARRAY_DELETE
|
||||
GROFF_TRADITIONAL_CPP
|
||||
dnl checks for operating system services
|
||||
GROFF_WCOREFLAG
|
||||
dnl other random stuff
|
||||
GROFF_BROKEN_SPOOLER_FLAGS
|
||||
GROFF_PAGE
|
||||
GROFF_G
|
||||
GROFF_TMAC
|
||||
$srcdir/mkinstalldirs src/xditview
|
||||
AC_CONFIG_FILES([Makefile src/xditview/Imakefile])
|
||||
AC_OUTPUT
|
@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" $Id: groff_mm.man,v 2.1 2001/04/13 09:03:52 wlemb Exp $
|
||||
.\" $Id: groff_mm.man,v 2.2 2001/06/27 12:47:16 wlemb Exp $
|
||||
.\"
|
||||
.de T2
|
||||
.ne 2v
|
||||
@ -1895,3 +1895,7 @@ J
|
||||
.br
|
||||
.BR mm (@MAN7EXT@)
|
||||
.BR m@TMAC_M_PREFIX@mse (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" $Id: groff_mmse.man,v 2.0 2000/09/14 03:40:24 jhaegg Exp $
|
||||
.\" $Id: groff_mmse.man,v 2.1 2001/06/27 12:47:16 wlemb Exp $
|
||||
.\" Skrivet av Jörgen Hägg, Lund, Sverige
|
||||
.\"
|
||||
.TH GROFF_MMSE @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
|
||||
@ -80,3 +80,7 @@ J
|
||||
.BR @g@eqn (@MAN1EXT@)
|
||||
.br
|
||||
.BR m@TMAC_M_PREFIX@m (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -3,8 +3,8 @@
|
||||
.ds RE \\$2
|
||||
..
|
||||
.\"
|
||||
.\" $Id: m.tmac,v 2.3 2001/03/05 09:56:29 jhaegg Exp $
|
||||
.@revision $Revision: 2.3 $
|
||||
.\" $Id: m.tmac,v 2.4 2001/05/16 11:07:52 wlemb Exp $
|
||||
.@revision $Revision: 2.4 $
|
||||
.ig
|
||||
|
||||
Copyright (C) 1991-2000 Free Software Foundation, Inc.
|
||||
@ -2258,7 +2258,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
|
||||
.nr tbl*header-written 1
|
||||
..
|
||||
.de TH
|
||||
.if '\\$1'N' @error TH: N not implemented yet. Sorry.
|
||||
.ie '\\n[.z]'tbl*header-div' \{\
|
||||
. nr T. 0
|
||||
. T#
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" $Id: mmroff.man,v 2.0 2000/09/14 03:40:24 jhaegg Exp $
|
||||
.\" $Id: mmroff.man,v 2.1 2001/06/27 12:47:16 wlemb Exp $
|
||||
.\"
|
||||
.TH MMROFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
|
||||
.SH NAME
|
||||
@ -46,3 +46,7 @@ J
|
||||
.br
|
||||
.BR mm (@MAN7EXT@)
|
||||
.BR m@TMAC_M_PREFIX@mse (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -4655,29 +4655,23 @@ The @code{.a} read-only number register contains the most recent
|
||||
@cindex blank lines, disabling
|
||||
@cindex lines, blank, disabling
|
||||
@Defreq {ns, }
|
||||
@Defregx {.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 (see @ref{Page Control}, for more information). This
|
||||
mode ends when actual text is output or the @code{rs} request is
|
||||
encountered.
|
||||
encountered. The read-only number register @code{.ns} is set to@w{ }1.
|
||||
|
||||
@cindex top-level diversion
|
||||
@cindex diversion, top-level
|
||||
This request is useful for macros which want to avoid that subsequent
|
||||
macros inadvertently insert some vertical space before the text starts
|
||||
(for example, to set up the first paragraph after a section header). It
|
||||
has no effect if not called within the top-level diversion
|
||||
(@pxref{Diversions}).
|
||||
(for example, to set up the first paragraph after a section header).
|
||||
|
||||
@c XXX xref
|
||||
@endDefreq
|
||||
|
||||
@cindex top-level diversion
|
||||
@cindex diversion, top-level
|
||||
@Defreq {rs, }
|
||||
Disable no-space mode. It has no effect if not called within the
|
||||
top-level diversion (@pxref{Diversions}).
|
||||
Disable no-space mode.
|
||||
|
||||
@c XXX xref
|
||||
@endDefreq
|
||||
@ -7409,7 +7403,7 @@ The @code{als} request can make a macro have more than one name.
|
||||
This would be called as
|
||||
|
||||
@Example
|
||||
.vl $Id: groff.texinfo,v 1.74 2001/04/16 14:47:18 wlemb Exp $
|
||||
.vl $Id: groff.texinfo,v 1.77 2001/05/07 13:36:24 wlemb Exp $
|
||||
@endExample
|
||||
@endDefesc
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
.\"
|
||||
.\" To make it work with other output devices also, we include arkup.tmac
|
||||
.\" directly.
|
||||
.mso arkup.tmac
|
||||
.mso www.tmac
|
||||
.\"
|
||||
.LP
|
||||
.\"
|
||||
|
@ -10,7 +10,7 @@
|
||||
.\" This document was written for free use and redistribution by
|
||||
.\" Eric S. Raymond <esr@thyrsus.com> in August 1995.
|
||||
.\"
|
||||
.\" $Id: pic.ms,v 1.3 2001/04/13 17:11:32 wlemb Exp $
|
||||
.\" $Id: pic.ms,v 1.4 2001/06/24 13:03:27 wlemb Exp $
|
||||
.\"
|
||||
.\" Set a proper TeX
|
||||
.ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
|
||||
@ -1507,7 +1507,7 @@ macro argument parsing is not token-oriented. If you call \fBjumper(
|
||||
If you want to pass in a coordinate pair, you can avoid getting
|
||||
tripped up by the comma by wrapping the pair in parentheses.
|
||||
.PP
|
||||
Macros persist through pictures. To undefine a mcro, say \fBundef\fP
|
||||
Macros persist through pictures. To undefine a macro, say \fBundef\fP
|
||||
\fIname\fR; for example,
|
||||
.DS
|
||||
\f(CWundef jumper\fP
|
||||
@ -1554,7 +1554,7 @@ source up to the next .PE.
|
||||
In either of the \fBcopy\fP commands, GNU \fBgpic\fP permits a
|
||||
trailing `\fBuntil\fP \fIword\fP' clause to be added which terminates
|
||||
the copy when the first word matches the argument (the default
|
||||
behavior is therefore equivalent to \fBuntil .PE\fP,
|
||||
behavior is therefore equivalent to \fBuntil .PE\fP).
|
||||
.PP
|
||||
Accordingly, the command
|
||||
.RS
|
||||
@ -2390,7 +2390,7 @@ text (not including the braces). The macro may be called as
|
||||
.DE
|
||||
.LP
|
||||
The arguments (if any) will be substituted for tokens $1, $2 ... $n
|
||||
appearing in the replacement text. To undefine a mcro, say \fBundef\fP
|
||||
appearing in the replacement text. To undefine a macro, say \fBundef\fP
|
||||
\fIname\fR, specifying the name to be undefined.
|
||||
.\"%%POSTLUDE%%
|
||||
.NH 1
|
||||
|
@ -1,14 +1,12 @@
|
||||
.\" st -*- nroff -*-
|
||||
'\" t
|
||||
.ig
|
||||
groff.7
|
||||
|
||||
This file is part of groff, the GNU roff type-setting system.
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
written by Bernd Warken <bwarken@mayn.de>
|
||||
|
||||
Last update: 17 May 2000
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
@ -866,6 +864,16 @@ until
|
||||
.request .end
|
||||
is called.
|
||||
.
|
||||
.REQ .am1 macro
|
||||
Same as
|
||||
.request .am
|
||||
but with compatibility mode switched off during macro expansion.
|
||||
.
|
||||
.REQ .am1 macro end
|
||||
Same as
|
||||
.request .am
|
||||
but with compatibility mode switched off during macro expansion.
|
||||
.
|
||||
.REQ .as stringvar anything
|
||||
Append
|
||||
.argument anything
|
||||
@ -892,6 +900,13 @@ Embolden Special Font
|
||||
when current font is
|
||||
.argument font .
|
||||
.
|
||||
.REQ .blm
|
||||
Unset the blank line macro.
|
||||
.
|
||||
.REQ .blm macro
|
||||
Set the blank line macro to
|
||||
.argument macro .
|
||||
.
|
||||
.REQ .box
|
||||
End current diversion.
|
||||
.
|
||||
@ -907,6 +922,7 @@ End current diversion.
|
||||
Divert and append to
|
||||
.argument macro ,
|
||||
omitting a partially filled line.
|
||||
.
|
||||
.REQ .bp
|
||||
Eject current page and begin new page.
|
||||
.
|
||||
@ -914,13 +930,14 @@ Eject current page and begin new page.
|
||||
Eject current page; next page number
|
||||
.argument \(+-N .
|
||||
.
|
||||
.REQ .blm macro
|
||||
Set the blank line macro to
|
||||
.argument macro .
|
||||
.
|
||||
.REQ .br
|
||||
Line break.
|
||||
.
|
||||
.REQ .brp
|
||||
Break and spread output line.
|
||||
Same as
|
||||
.esc p .
|
||||
.
|
||||
.REQ .break
|
||||
Break out of a while loop.
|
||||
.
|
||||
@ -1028,6 +1045,16 @@ until
|
||||
.request .end
|
||||
is called.
|
||||
.
|
||||
.REQ .de1 macro
|
||||
Same as
|
||||
.request .de
|
||||
but with compatibility mode switched off during macro expansion.
|
||||
.
|
||||
.REQ .de1 macro end
|
||||
Same as
|
||||
.request .de
|
||||
but with compatibility mode switched off during macro expansion.
|
||||
.
|
||||
.REQ .dei macro
|
||||
Define or redefine a macro whose name is contained in the string register
|
||||
.argument macro
|
||||
@ -1053,7 +1080,7 @@ Divert to
|
||||
.REQ .do name
|
||||
Interpret
|
||||
.request .name
|
||||
with compatibility mode enabled.
|
||||
with compatibility mode disabled.
|
||||
.
|
||||
.REQ .ds stringvar anything
|
||||
Set
|
||||
@ -2414,6 +2441,11 @@ The amount of space that was needed in the last
|
||||
request that caused a trap to be sprung.
|
||||
Useful in conjunction with
|
||||
.register .trunc .
|
||||
.REG .ns
|
||||
.number 1
|
||||
if in no-space mode,
|
||||
.number 0
|
||||
otherwise.
|
||||
.REG .o Current page offset.
|
||||
.REG .p Current page length.
|
||||
.REG .pn
|
||||
@ -2889,3 +2921,7 @@ documentation is available on-line at
|
||||
and
|
||||
.RS
|
||||
.IR http://www.kohala.com/start/troff/ .
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -571,3 +571,7 @@ Output Input Input PostScript Notes
|
||||
.IR "An extension to the troff character set for Europe" ,
|
||||
E.G. Keizer, K.J. Simonsen, J. Akkerhuis,
|
||||
EUUG Newsletter, Volume 9, No. 2, Summer 1989
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,4 +1,4 @@
|
||||
.ig \"-*- nroff -*-
|
||||
.ig
|
||||
Copyright (C) 1989-1995, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
@ -417,3 +417,7 @@ of device
|
||||
.SH "SEE ALSO"
|
||||
.BR groff_out (@MAN5EXT@),
|
||||
.BR @g@troff (@MAN1EXT@).
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,14 +1,12 @@
|
||||
.\" t -*- nroff -*-
|
||||
'\" t
|
||||
.ig
|
||||
roff.7
|
||||
|
||||
This file is part of groff, the GNU roff type-setting system.
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
written by Bernd Warken <bwarken@mayn.de>
|
||||
|
||||
Last update: 17 May 2000
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
@ -539,3 +537,7 @@ free UNIX 7 found at
|
||||
.I http://cm.bell-labs.com/cm/cs/cstr.html
|
||||
and the collection of the late Richard S. Stevens at
|
||||
.IR http://www.kohala.com/start/troff/ .
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "driver.h"
|
||||
#include "nonposix.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#define DEFAULT_LINEWIDTH 40
|
||||
static int linewidth = DEFAULT_LINEWIDTH;
|
||||
|
||||
@ -521,8 +523,8 @@ void dvi_printer::moveto(int h, int v)
|
||||
void dvi_printer::draw(int code, int *p, int np, const environment *env)
|
||||
{
|
||||
if (code == 'l') {
|
||||
int x, y;
|
||||
int height = 0, width;
|
||||
int x = 0, y = 0;
|
||||
int height = 0, width = 0;
|
||||
int thickness;
|
||||
if (line_thickness < 0)
|
||||
thickness = env->size*RES_7227*linewidth/1000;
|
||||
@ -863,7 +865,6 @@ int main(int argc, char **argv)
|
||||
switch(c) {
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU grodvi (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -172,3 +172,7 @@ and widths of rules be rounded.
|
||||
.BR groff_out (@MAN5EXT@),
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -12,5 +12,4 @@ CCSRCS=\
|
||||
$(srcdir)/output.cc
|
||||
HDRS=\
|
||||
$(srcdir)/html.h \
|
||||
$(srcdir)/html-chars.h \
|
||||
$(srcdir)/html-text.h
|
||||
|
@ -1,4 +1,4 @@
|
||||
.ig \"-*- nroff -*-
|
||||
.ig
|
||||
Copyright (C) 1999-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
@ -37,8 +37,10 @@ grohtml \- html driver for groff
|
||||
.el .RB "[\ " "\\$1" "\ ]"
|
||||
..
|
||||
.OP \-v?lrn
|
||||
.OP \-D dir
|
||||
.OP \-F dir
|
||||
.OP \-i resolution
|
||||
.OP \-I image stem
|
||||
.OP \-o image vertical offset
|
||||
.RI "[\ " files\|.\|.\|. "\ ]"
|
||||
.br
|
||||
@ -88,8 +90,9 @@ Turns off the automatic header and footer line (html rule).
|
||||
.TP
|
||||
.B -n
|
||||
Generate simple heading anchors whenever a section/number heading is found.
|
||||
Without the option the anchor value is the textual heading. This can cause problems
|
||||
when a heading contains a `?' on some brousers (netscape).
|
||||
Without the option the anchor value is the textual heading.
|
||||
This can cause problems when a heading contains a `?' on some brousers
|
||||
(netscape).
|
||||
This flag is automatically turned on if a heading contains an image.
|
||||
.TP
|
||||
.BI \-F dir
|
||||
@ -101,10 +104,23 @@ is the name of the device, usually
|
||||
.BR html .
|
||||
.TP
|
||||
.BI \-i resolution
|
||||
select the resolution for all images.
|
||||
Select the resolution for all images.
|
||||
By default this is 80 pixels per inch.
|
||||
Example: -i100 indicates 100 pixels per inch.
|
||||
.TP
|
||||
.BI \-I stem
|
||||
Determine the image stem name.
|
||||
If omitted grohtml uses
|
||||
.BI grohtml- XXX
|
||||
.RI ( XXX
|
||||
is the process ID).
|
||||
.TP
|
||||
.BI \-D dir
|
||||
Inform
|
||||
.B grohtml
|
||||
to place all image files into directory
|
||||
.IR dir .
|
||||
.TP
|
||||
.B \-v
|
||||
Print the version number.
|
||||
.TP
|
||||
@ -120,7 +136,10 @@ and
|
||||
mounted at font positions 1 to 4.
|
||||
.SH DEPENDENCIES
|
||||
.B grohtml
|
||||
is dependent upon the png utilities and gs.
|
||||
is dependent upon the png utilities
|
||||
.RB ( \&\%pnmcut ,\ \%pnmtopng )
|
||||
and GhostScript
|
||||
.RB ( gs ).
|
||||
Images are generated whenever a table, picture, equation or line is
|
||||
encountered.
|
||||
.SH BUGS
|
||||
@ -135,3 +154,7 @@ It is still alpha code.
|
||||
.BR groff_out (@MAN5EXT@),
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -350,7 +350,7 @@ void html_text::do_pre (void)
|
||||
done_bold();
|
||||
done_italic();
|
||||
done_tt();
|
||||
char *type = done_para();
|
||||
(void)done_para();
|
||||
if (! is_present(PRE_TAG)) {
|
||||
push_para(PRE_TAG, "");
|
||||
}
|
||||
@ -661,7 +661,7 @@ int html_text::emitted_text (void)
|
||||
* emit_space - writes a space providing that text was written beforehand.
|
||||
*/
|
||||
|
||||
int html_text::emit_space (void)
|
||||
void html_text::emit_space (void)
|
||||
{
|
||||
if (space_emitted) {
|
||||
if (is_present(PRE_TAG)) {
|
||||
|
@ -78,7 +78,7 @@ class html_text {
|
||||
void done_big (void);
|
||||
void do_indent (char *arg, int indent, int pageoff, int linelen);
|
||||
int emitted_text (void);
|
||||
int emit_space (void);
|
||||
void emit_space (void);
|
||||
int is_in_pre (void);
|
||||
void remove_tag (HTML_TAG tag);
|
||||
void remove_sub_sup (void);
|
||||
|
@ -71,7 +71,7 @@ word::~word ()
|
||||
*/
|
||||
|
||||
word_list::word_list ()
|
||||
: head(0), tail(0), length(0)
|
||||
: length(0), head(0), tail(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -208,6 +208,7 @@ simple_output &simple_output::check_newline(int n)
|
||||
fputc('\n', fp);
|
||||
col = last_word.flush(fp);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -236,6 +237,7 @@ simple_output &simple_output::space_or_newline (void)
|
||||
col += last_word.flush(fp);
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -303,6 +305,7 @@ simple_output &simple_output::enable_newlines (int auto_newlines)
|
||||
check_newline(0);
|
||||
newlines = auto_newlines;
|
||||
check_newline(0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -27,7 +27,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "stringclass.h"
|
||||
#include "cset.h"
|
||||
#include "html.h"
|
||||
#include "html-chars.h"
|
||||
#include "html-text.h"
|
||||
|
||||
#include <time.h>
|
||||
@ -39,6 +38,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#if !defined(TRUE)
|
||||
# define TRUE (1==1)
|
||||
#endif
|
||||
@ -102,11 +103,13 @@ static int max (int a, int b)
|
||||
* is_subsection - returns TRUE if a1..a2 is within b1..b2
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static int is_subsection (int a1, int a2, int b1, int b2)
|
||||
{
|
||||
// easier to see whether this is not the case
|
||||
return( !((a1 < b1) || (a1 > b2) || (a2 < b1) || (a2 > b2)) );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* is_intersection - returns TRUE if range a1..a2 intersects with b1..b2
|
||||
@ -357,11 +360,11 @@ public:
|
||||
style text_style;
|
||||
char *text_string;
|
||||
unsigned int text_length;
|
||||
int minv, maxv, minh, maxh;
|
||||
int minv, minh, maxv, maxh;
|
||||
int is_raw_command; // should the text be sent directly to the device?
|
||||
int is_tag; // is this a .br, .sp, .tl etc
|
||||
int is_line; // is the command a <line>?
|
||||
int is_img_auto; // image created by eqn delim
|
||||
int is_line; // is the command a <line>?
|
||||
int thickness; // the thickness of a line
|
||||
};
|
||||
|
||||
@ -379,7 +382,7 @@ text_glob::text_glob (style *s, char *string, unsigned int length,
|
||||
}
|
||||
|
||||
text_glob::text_glob ()
|
||||
: text_string(0), text_length(0), minv(-1), maxv(-1), minh(-1), maxh(-1),
|
||||
: text_string(0), text_length(0), minv(-1), minh(-1), maxv(-1), maxh(-1),
|
||||
is_raw_command(FALSE), is_tag(FALSE), is_line(FALSE), thickness(0)
|
||||
{
|
||||
}
|
||||
@ -455,7 +458,7 @@ struct element_list {
|
||||
element_list *left;
|
||||
text_glob *datum;
|
||||
int lineno;
|
||||
int minv, maxv, minh, maxh;
|
||||
int minv, minh, maxv, maxh;
|
||||
|
||||
element_list (text_glob *d,
|
||||
int line_number,
|
||||
@ -465,7 +468,7 @@ struct element_list {
|
||||
};
|
||||
|
||||
element_list::element_list ()
|
||||
: right(0), left(0), datum(0), lineno(0), minv(-1), maxv(-1), minh(-1), maxh(-1)
|
||||
: right(0), left(0), datum(0), lineno(0), minv(-1), minh(-1), maxv(-1), maxh(-1)
|
||||
{
|
||||
}
|
||||
|
||||
@ -2283,10 +2286,10 @@ html_printer::html_printer()
|
||||
end_tempindent(0),
|
||||
next_tag(INLINE),
|
||||
fill_on(TRUE),
|
||||
linelength(0),
|
||||
pageoffset(0),
|
||||
indentation(0),
|
||||
prev_indent(0),
|
||||
linelength(0),
|
||||
line_number(0)
|
||||
{
|
||||
#if defined(DEBUGGING)
|
||||
@ -2769,7 +2772,6 @@ html_printer::~html_printer()
|
||||
header.write_headings(stdout, FALSE);
|
||||
write_rule();
|
||||
{
|
||||
extern const char *Version_string;
|
||||
html.begin_comment("Creator : ")
|
||||
.put_string("groff ")
|
||||
.put_string("version ")
|
||||
@ -2877,12 +2879,11 @@ int main(int argc, char **argv)
|
||||
{ "version", no_argument, 0, 'v' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
while ((c = getopt_long(argc, argv, "o:i:F:vd?lrn", long_options, NULL))
|
||||
while ((c = getopt_long(argc, argv, "o:i:I:D:F:vd?lrn", long_options, NULL))
|
||||
!= EOF)
|
||||
switch(c) {
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU post-grohtml (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
@ -2902,6 +2903,12 @@ int main(int argc, char **argv)
|
||||
case 'i':
|
||||
/* handled by pre-html */
|
||||
break;
|
||||
case 'I':
|
||||
/* handled by pre-html */
|
||||
break;
|
||||
case 'D':
|
||||
/* handled by pre-html */
|
||||
break;
|
||||
case 'n':
|
||||
simple_anchors = TRUE;
|
||||
break;
|
||||
@ -2928,6 +2935,6 @@ int main(int argc, char **argv)
|
||||
|
||||
static void usage(FILE *stream)
|
||||
{
|
||||
fprintf(stream, "usage: %s [-vld?n] [-F dir] [files ...]\n",
|
||||
fprintf(stream, "usage: %s [-vld?n] [-D dir] [-I image_stem] [-F dir] [files ...]\n",
|
||||
program_name);
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ TODO
|
||||
|
||||
#include "nonposix.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static short int papersize = -1, // papersize
|
||||
orientation = -1 , // orientation
|
||||
paperlength = 0, // Custom Paper size
|
||||
@ -151,7 +153,7 @@ void lbp_font::handle_unknown_font_command(const char *command,
|
||||
|
||||
static void wp54charset()
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
lbpputs("\033[714;100;29;0;32;120.}");
|
||||
for (i = 0; i < sizeof(symset) ; i++) lbpputc(symset[i]);
|
||||
@ -561,7 +563,7 @@ static struct
|
||||
|
||||
static int set_papersize(const char *papersize)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
// First test for a standard (i.e. supported directly by the printer)
|
||||
// papersize
|
||||
@ -715,7 +717,6 @@ int main(int argc, char **argv)
|
||||
case 'l' : orientation = 1;
|
||||
break;
|
||||
case 'v' : {
|
||||
extern const char *Version_string;
|
||||
printf("GNU grolbp (groff) version %s\n",
|
||||
Version_string);
|
||||
exit(0);
|
||||
|
@ -36,7 +36,7 @@ lbpinit(FILE *outfile)
|
||||
|
||||
|
||||
static inline void
|
||||
lbpprintf(char *format, ... )
|
||||
lbpprintf(const char *format, ... )
|
||||
{ /* Taken from cjet */
|
||||
va_list stuff;
|
||||
|
||||
@ -46,7 +46,7 @@ lbpprintf(char *format, ... )
|
||||
};
|
||||
|
||||
static inline void
|
||||
lbpputs(char *data)
|
||||
lbpputs(const char *data)
|
||||
{
|
||||
fputs(data,lbpoutput);
|
||||
};
|
||||
@ -123,7 +123,7 @@ lbpruleabs(int x, int y, int hsize, int vsize)
|
||||
fprintf(lbpoutput,"\033[9r");
|
||||
};
|
||||
|
||||
static inline void vdmprintf(char *format, ... );
|
||||
static inline void vdmprintf(const char *format, ... );
|
||||
|
||||
static inline char *
|
||||
vdmnum(int num,char *result)
|
||||
@ -179,7 +179,7 @@ vdmend()
|
||||
};
|
||||
|
||||
static inline void
|
||||
vdmprintf(char *format, ... )
|
||||
vdmprintf(const char *format, ... )
|
||||
{ /* Taken from cjet */
|
||||
va_list stuff;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1994-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1994-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -142,3 +142,7 @@ Small dots.
|
||||
.BR groff_out (@MAN5EXT@),
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -35,6 +35,8 @@ X command to include bitmap graphics
|
||||
#include "driver.h"
|
||||
#include "nonposix.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static struct {
|
||||
const char *name;
|
||||
int code;
|
||||
@ -123,7 +125,8 @@ void lj4_font::handle_unknown_font_command(const char *command,
|
||||
const char *arg,
|
||||
const char *filename, int lineno)
|
||||
{
|
||||
for (int i = 0; i < sizeof(command_table)/sizeof(command_table[0]); i++) {
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(command_table)/sizeof(command_table[0]); i++) {
|
||||
if (strcmp(command, command_table[i].s) == 0) {
|
||||
if (arg == 0)
|
||||
fatal_with_file_and_line(filename, lineno,
|
||||
@ -568,7 +571,8 @@ printer *make_printer()
|
||||
static
|
||||
int lookup_paper_size(const char *s)
|
||||
{
|
||||
for (int i = 0; i < sizeof(paper_table)/sizeof(paper_table[0]); i++) {
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(paper_table)/sizeof(paper_table[0]); i++) {
|
||||
// FIXME Perhaps allow unique prefix.
|
||||
if (strcasecmp(s, paper_table[i].name) == 0)
|
||||
return i;
|
||||
@ -645,7 +649,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU grolj4 (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -859,3 +859,7 @@ Temporary file.
|
||||
.BR groff_out (@MAN5EXT@),
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -33,6 +33,8 @@ extern "C" {
|
||||
}
|
||||
#endif /* NEED_DECLARATION_PUTENV */
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static int landscape_flag = 0;
|
||||
static int manual_feed_flag = 0;
|
||||
static int ncopies = 1;
|
||||
@ -1119,7 +1121,6 @@ ps_printer::~ps_printer()
|
||||
putchar('\n');
|
||||
out.set_file(stdout);
|
||||
{
|
||||
extern const char *Version_string;
|
||||
out.begin_comment("Creator:")
|
||||
.comment_arg("groff")
|
||||
.comment_arg("version")
|
||||
@ -1248,7 +1249,7 @@ void ps_printer::special(char *arg, const environment *env, char type)
|
||||
error("X command without `ps:' tag ignored");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++)
|
||||
for (unsigned int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++)
|
||||
if (strncmp(command, proc_table[i].name, p - command) == 0) {
|
||||
(this->*(proc_table[i].proc))(p, env);
|
||||
return;
|
||||
@ -1495,7 +1496,6 @@ int main(int argc, char **argv)
|
||||
switch(c) {
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU grops (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -174,7 +175,7 @@ resource *resource_manager::lookup_font(const char *name)
|
||||
resource *r;
|
||||
for (r = resource_list; r; r = r->next)
|
||||
if (r->type == RESOURCE_FONT
|
||||
&& strlen(name) == r->name.length()
|
||||
&& strlen(name) == (size_t)r->name.length()
|
||||
&& memcmp(name, r->name.contents(), r->name.length()) == 0)
|
||||
return r;
|
||||
string s(name);
|
||||
@ -535,7 +536,7 @@ resource *resource_manager::read_resource_arg(const char **ptr)
|
||||
}
|
||||
int ri;
|
||||
for (ri = 0; ri < NRESOURCES; ri++)
|
||||
if (strlen(resource_table[ri]) == *ptr - name
|
||||
if (strlen(resource_table[ri]) == size_t(*ptr - name)
|
||||
&& memcmp(resource_table[ri], name, *ptr - name) == 0)
|
||||
break;
|
||||
if (ri >= NRESOURCES) {
|
||||
@ -717,7 +718,7 @@ int read_one_of(const char **ptr, const char **s, int n)
|
||||
++(*ptr);
|
||||
} while (**ptr != '\0' && !white_space(**ptr));
|
||||
for (int i = 0; i < n; i++)
|
||||
if (strlen(s[i]) == *ptr - start
|
||||
if (strlen(s[i]) == size_t(*ptr - start)
|
||||
&& memcmp(s[i], start, *ptr - start) == 0)
|
||||
return i;
|
||||
return -1;
|
||||
@ -859,7 +860,7 @@ static unsigned parse_extensions(const char *ptr)
|
||||
} while (*ptr != '\0' && !white_space(*ptr));
|
||||
int i;
|
||||
for (i = 0; i < NEXTENSIONS; i++)
|
||||
if (strlen(extension_table[i]) == ptr - name
|
||||
if (strlen(extension_table[i]) == size_t(ptr - name)
|
||||
&& memcmp(extension_table[i], name, ptr - name) == 0) {
|
||||
flags |= (1 << i);
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -258,3 +258,7 @@ cannot be printed.
|
||||
.BR ul (1),
|
||||
.BR more (1),
|
||||
.BR less (1)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -21,6 +21,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "driver.h"
|
||||
#include "device.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#ifndef SHRT_MIN
|
||||
#define SHRT_MIN (-32768)
|
||||
#endif
|
||||
@ -442,7 +444,6 @@ int main(int argc, char **argv)
|
||||
switch(c) {
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU grotty (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -23,6 +23,17 @@
|
||||
# define _GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* If __GNU_LIBRARY__ is not already defined, either we are being used
|
||||
standalone, or this is the first header included in the source file.
|
||||
If we are being used with glibc, we need to include <features.h>, but
|
||||
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
|
||||
not defined, include <ctype.h>, which will pull in <features.h> for us
|
||||
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
|
||||
doesn't flood the namespace with stuff the way some other headers do.) */
|
||||
#if !defined __GNU_LIBRARY__
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -82,7 +93,7 @@ extern int optopt;
|
||||
|
||||
struct option
|
||||
{
|
||||
# if defined __STDC__ && __STDC__
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
const char *name;
|
||||
# else
|
||||
char *name;
|
||||
@ -126,7 +137,7 @@ struct option
|
||||
arguments to the option '\0'. This behavior is specific to the GNU
|
||||
`getopt'. */
|
||||
|
||||
#if defined __STDC__ && __STDC__
|
||||
#if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
# ifdef __GNU_LIBRARY__
|
||||
/* Many other libraries have conflicting prototypes for getopt, with
|
||||
differences in the consts, in stdlib.h. To avoid compilation
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
Written by Werner Lemberg (wl@gnu.org)
|
||||
|
||||
This file is part of groff.
|
||||
@ -47,19 +47,19 @@ struct option
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
extern int getopt(int __argc,
|
||||
char *const *__argv,
|
||||
const char *__shortopts);
|
||||
extern int getopt_long(int __argc,
|
||||
char *const *__argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts,
|
||||
int *__longind);
|
||||
extern int getopt_long_only(int __argc,
|
||||
char *const *__argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts,
|
||||
int *__longind);
|
||||
extern int getopt(int, // __argc
|
||||
char *const *, // __argv
|
||||
const char *); // __shortopts
|
||||
extern int getopt_long(int, // __argc
|
||||
char *const *, // __argv
|
||||
const char *, // __shortopts
|
||||
const struct option *, // __longopts
|
||||
int *); // __longind
|
||||
extern int getopt_long_only(int, // __argc
|
||||
char *const *, // __argv
|
||||
const char *, // __shortopts
|
||||
const struct option *, // __longopts
|
||||
int *); // __longind
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -19,16 +19,18 @@ with groff; see the file COPYING. If not, write to the Free Software
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
extern "C" {
|
||||
#ifndef strerror
|
||||
#ifndef HAVE_STRERROR
|
||||
char *strerror(int);
|
||||
#endif
|
||||
const char *i_to_a(int);
|
||||
const char *if_to_a(int, int);
|
||||
}
|
||||
|
||||
/* stdio.h on IRIX and OSF/1 include getopt.h */
|
||||
/* stdio.h on IRIX, OSF/1, and UWIN includes getopt.h */
|
||||
|
||||
#if !(defined(__sgi) || (defined(__osf__) && defined(__alpha)))
|
||||
#if !(defined(__sgi) \
|
||||
|| (defined(__osf__) && defined(__alpha)) \
|
||||
|| defined(_UWIN))
|
||||
#include <groff-getopt.h>
|
||||
#endif
|
||||
|
||||
@ -41,8 +43,8 @@ int is_prime(unsigned);
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
FILE *xtmpfile(char **namep=0, char *postfix=0, int do_unlink=1);
|
||||
char *xtmptemplate(char *extension=0);
|
||||
FILE *xtmpfile(char **namep = 0, char *postfix = 0, int do_unlink = 1);
|
||||
char *xtmptemplate(char *extension = 0);
|
||||
|
||||
#ifdef NEED_DECLARATION_POPEN
|
||||
|
||||
@ -56,6 +58,8 @@ extern "C" { int pclose (FILE *); }
|
||||
|
||||
#endif /* NEED_DECLARATION_PCLOSE */
|
||||
|
||||
size_t file_name_max(const char *fname);
|
||||
|
||||
int interpret_lf_args(const char *p);
|
||||
|
||||
extern char illegal_char_table[];
|
||||
|
@ -27,7 +27,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# define setmode(f,m) _setmode(f,m)
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN32__))
|
||||
#if defined(__MSDOS__) \
|
||||
|| (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN32__))
|
||||
|
||||
/* Binary I/O nuisances. Note: "setmode" is right for DJGPP and
|
||||
Borland; Windows compilers might need _setmode or some such. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -408,7 +408,7 @@ int index_search_item_iterator::get_tag(int tagno,
|
||||
buflen = length + 2;
|
||||
buf = new char[buflen];
|
||||
}
|
||||
if (fread(buf + 1, 1, length, fp) != length)
|
||||
if (fread(buf + 1, 1, length, fp) != (size_t)length)
|
||||
error("fread on `%1' failed: %2", filename, strerror(errno));
|
||||
else {
|
||||
buf[0] = '\n';
|
||||
@ -487,7 +487,7 @@ const int *index_search_item::search1(const char **pp, const char *end)
|
||||
for (int h = hc % common_words_table_size;
|
||||
common_words_table[h];
|
||||
--h) {
|
||||
if (strlen(common_words_table[h]) == len
|
||||
if (strlen(common_words_table[h]) == (size_t)len
|
||||
&& memcmp(common_words_table[h], key_buffer, len) == 0)
|
||||
return 0;
|
||||
if (h == 0)
|
||||
|
@ -18,6 +18,7 @@ OBJS=\
|
||||
lf.o \
|
||||
lineno.o \
|
||||
macropath.o \
|
||||
maxfilename.o \
|
||||
nametoindex.o \
|
||||
new.o \
|
||||
prime.o \
|
||||
@ -49,6 +50,7 @@ CCSRCS=\
|
||||
$(srcdir)/lf.cc \
|
||||
$(srcdir)/lineno.cc \
|
||||
$(srcdir)/macropath.cc \
|
||||
$(srcdir)/maxfilename.cc \
|
||||
$(srcdir)/nametoindex.cc \
|
||||
$(srcdir)/new.cc \
|
||||
$(srcdir)/prime.cc \
|
||||
@ -80,5 +82,5 @@ version.cc: $(top_srcdir)/VERSION $(top_srcdir)/REVISION
|
||||
@echo Making version.cc
|
||||
@echo const char \*version_string = \"$(version)\"\; >$@
|
||||
@echo const char \*revision_string = \"$(revision)\"\; >>$@
|
||||
@echo const char \*Version_string = \"$(version).$(revision)\"\; | \
|
||||
@echo extern \"C\" const char \*Version_string = \"$(version).$(revision)\"\; | \
|
||||
sed -e 's/\.0\"/\"/' >>$@
|
||||
|
@ -1,5 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -751,7 +752,7 @@ int font::load_desc()
|
||||
while (t.next()) {
|
||||
char *p = strtok(t.buf, WS);
|
||||
int found = 0;
|
||||
int idx;
|
||||
unsigned int idx;
|
||||
for (idx = 0; !found && idx < sizeof(table)/sizeof(table[0]); idx++)
|
||||
if (strcmp(table[idx].command, p) == 0)
|
||||
found = 1;
|
||||
|
@ -77,11 +77,12 @@
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
/* This is for other GNU distributions with internationalized messages.
|
||||
When compiling libc, the _ macro is predefined. */
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
# if defined HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
# define _(msgid) gettext (msgid)
|
||||
# ifndef _
|
||||
# define _(msgid) gettext (msgid)
|
||||
# endif
|
||||
# else
|
||||
# define _(msgid) (msgid)
|
||||
# endif
|
||||
@ -521,6 +522,9 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
if (optstring[0] == ':')
|
||||
print_errors = 0;
|
||||
|
||||
if (argc < 1)
|
||||
return -1;
|
||||
|
||||
optarg = NULL;
|
||||
|
||||
if (optind == 0 || !__getopt_initialized)
|
||||
@ -670,7 +674,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
}
|
||||
else
|
||||
else if (long_only
|
||||
|| pfound->has_arg != p->has_arg
|
||||
|| pfound->flag != p->flag
|
||||
|| pfound->val != p->val)
|
||||
/* Second or later nonexact match found. */
|
||||
ambig = 1;
|
||||
}
|
||||
|
67
contrib/groff/src/libs/libgroff/maxfilename.cc
Normal file
67
contrib/groff/src/libs/libgroff/maxfilename.cc
Normal file
@ -0,0 +1,67 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
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. */
|
||||
|
||||
/* file_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#ifdef _POSIX_VERSION
|
||||
|
||||
size_t file_name_max(const char *fname)
|
||||
{
|
||||
return pathconf(fname, _PC_NAME_MAX);
|
||||
}
|
||||
|
||||
#else /* not _POSIX_VERSION */
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif /* HAVE_LIMITS_H */
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#else /* not HAVE_DIRENT_H */
|
||||
#ifdef HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#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 */
|
||||
|
||||
size_t file_name_max(const char *)
|
||||
{
|
||||
return NAME_MAX;
|
||||
}
|
||||
|
||||
#endif /* not _POSIX_VERSION */
|
@ -1,5 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -29,12 +30,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "error.h"
|
||||
#include "nonposix.h"
|
||||
|
||||
#ifndef HAVE_MKSTEMP_PROTO
|
||||
extern "C" {
|
||||
// Solaris 2.5.1 has these functions,
|
||||
// but its stdlib.h fails to declare them.
|
||||
char *mktemp(char *);
|
||||
int mkstemp(char *);
|
||||
extern int mkstemp (char *);
|
||||
}
|
||||
#endif
|
||||
|
||||
// If this is set, create temporary files there
|
||||
#define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR"
|
||||
@ -48,7 +48,11 @@ extern "C" {
|
||||
# define DEFAULT_TMPDIR "/tmp"
|
||||
#endif
|
||||
// Use this as the prefix for temporary filenames.
|
||||
#define TMPFILE_PREFIX "groff"
|
||||
#ifdef __MSDOS__
|
||||
#define TMPFILE_PREFIX ""
|
||||
#else
|
||||
#define TMPFILE_PREFIX "groff"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generate a temporary name template with a postfix
|
||||
@ -104,14 +108,13 @@ static void remove_tmp_files()
|
||||
{
|
||||
struct xtmpfile_list *p = xtmpfiles_to_delete;
|
||||
|
||||
while (p)
|
||||
{
|
||||
if (unlink(p->fname) < 0)
|
||||
error("cannot unlink `%1': %2", p->fname, strerror(errno));
|
||||
struct xtmpfile_list *old = p;
|
||||
p = p->next;
|
||||
free(old);
|
||||
}
|
||||
while (p) {
|
||||
if (unlink(p->fname) < 0)
|
||||
error("cannot unlink `%1': %2", p->fname, strerror(errno));
|
||||
struct xtmpfile_list *old = p;
|
||||
p = p->next;
|
||||
free(old);
|
||||
}
|
||||
}
|
||||
|
||||
static void add_tmp_file(const char *name)
|
||||
@ -122,11 +125,10 @@ static void add_tmp_file(const char *name)
|
||||
struct xtmpfile_list *p
|
||||
= (struct xtmpfile_list *)malloc(sizeof(struct xtmpfile_list)
|
||||
+ strlen (name));
|
||||
if (p == NULL)
|
||||
{
|
||||
error("cannot unlink `%1': %2", name, strerror(errno));
|
||||
return;
|
||||
}
|
||||
if (p == NULL) {
|
||||
error("cannot unlink `%1': %2", name, strerror(errno));
|
||||
return;
|
||||
}
|
||||
p->next = xtmpfiles_to_delete;
|
||||
strcpy(p->fname, name);
|
||||
xtmpfiles_to_delete = p;
|
||||
@ -134,8 +136,6 @@ static void add_tmp_file(const char *name)
|
||||
|
||||
// Open a temporary file and with fatal error on failure.
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
||||
FILE *xtmpfile(char **namep, char *postfix, int do_unlink)
|
||||
{
|
||||
char *templ = xtmptemplate(postfix);
|
||||
@ -159,28 +159,9 @@ FILE *xtmpfile(char **namep, char *postfix, int do_unlink)
|
||||
#endif /* not HAVE_MKSTEMP */
|
||||
if (do_unlink)
|
||||
add_tmp_file(templ);
|
||||
if ((namep != 0) && ((*namep) != 0)) {
|
||||
if ((namep != 0) && ((*namep) != 0))
|
||||
*namep = templ;
|
||||
} else {
|
||||
else
|
||||
a_delete templ;
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
|
||||
#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)
|
||||
{
|
||||
FILE *fp = tmpfile();
|
||||
if (!fp)
|
||||
fatal("couldn't create temporary file");
|
||||
return fp;
|
||||
}
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -880,3 +880,7 @@ beginning of the input line.
|
||||
.BR @g@troff (@MAN1EXT@),
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.I The\ \*(txbook
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,5 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -251,7 +252,7 @@ static struct {
|
||||
|
||||
void init_table(const char *device)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < sizeof(token_table)/sizeof(token_table[0]); i++) {
|
||||
definition *def = new definition;
|
||||
def->is_macro = 0;
|
||||
|
@ -30,6 +30,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#define STARTUP_FILE "eqnrc"
|
||||
|
||||
extern int yyparse();
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static char *delim_search (char *, int);
|
||||
static int inline_equation (FILE *, string &, string &);
|
||||
@ -303,7 +304,6 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU eqn (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,3 +1,21 @@
|
||||
.ig
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this
|
||||
manual into another language, under the above conditions for modified
|
||||
versions, except that this permission notice may be included in
|
||||
translations approved by the Free Software Foundation instead of in
|
||||
the original English.
|
||||
..
|
||||
.TH @G@NEQN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
|
||||
.SH NAME
|
||||
@g@neqn \- format equations for ascii output
|
||||
@ -19,3 +37,7 @@ does not support low-resolution, typewriter-like devices (although it may
|
||||
work adequately for very simple input).
|
||||
.SH "SEE ALSO"
|
||||
.BR @g@eqn (@MAN1EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -3,7 +3,8 @@
|
||||
# GNU eqn with groff -Tascii|-Tlatin1|-Tutf8|-Tcp1047 is supported.
|
||||
|
||||
: ${GROFF_BIN_PATH=@BINDIR@}
|
||||
export PATH=$GROFF_BIN_PATH:$PATH
|
||||
PATH=$GROFF_BIN_PATH:$PATH
|
||||
export PATH
|
||||
exec @g@eqn -Tascii ${1+"$@"}
|
||||
|
||||
# eof
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -65,7 +65,7 @@ int over_box::compute_metrics(int style)
|
||||
set_script_size();
|
||||
printf(".nr " SMALL_SIZE_FORMAT " \\n[.s]\n", uid);
|
||||
}
|
||||
int mark_uid;
|
||||
int mark_uid = 0;
|
||||
int res = num->compute_metrics(style);
|
||||
if (res)
|
||||
mark_uid = num->uid;
|
||||
|
@ -1,5 +1,6 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
'\" t
|
||||
.ig
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -634,3 +635,7 @@ David Slattengren and Barry Roitblat wrote the original Berkeley
|
||||
.PP
|
||||
Daniel Senderowicz and Werner Lemberg modified it for
|
||||
.IR groff .
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -82,6 +82,8 @@
|
||||
#include "error.h"
|
||||
#include "defs.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
/* database imports */
|
||||
|
||||
extern void HGPrintElt(ELT *element, int baseline);
|
||||
@ -282,7 +284,6 @@ main(int argc,
|
||||
case '-':
|
||||
if (strcmp(*argv,"--version")==0) {
|
||||
case 'v':
|
||||
extern const char *Version_string;
|
||||
printf("GNU grn (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -4,4 +4,3 @@ MAN1=
|
||||
XLIBS=$(LIBGROFF)
|
||||
OBJS=pre-html.o pushbackbuffer.o
|
||||
CCSRCS=$(srcdir)/pre-html.cc $(srcdir)/pushbackbuffer.cc
|
||||
NAMEPREFIX=$(g)
|
||||
|
@ -23,7 +23,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
@ -47,7 +46,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#define PID_T int
|
||||
#endif /* not _POSIX_VERSION */
|
||||
|
||||
extern char *strerror();
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "nonposix.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#include "pre-html.h"
|
||||
#include "pushbackbuffer.h"
|
||||
@ -59,9 +62,20 @@ extern char *strerror();
|
||||
#define IMAGE_BOARDER_PIXELS 0
|
||||
#define MAX_WIDTH 8 // inches
|
||||
#define INLINE_LEADER_CHAR '\\'
|
||||
#define MAX_RETRIES 4096 // number of different page directory names to try before giving up
|
||||
|
||||
#define TRANSPARENT "-background \"#FFF\" -transparent \"#FFF\""
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#define PAGE_TEMPLATE "pg"
|
||||
#define PS_TEMPLATE "ps"
|
||||
#define REGION_TEMPLATE "rg"
|
||||
#else
|
||||
#define PAGE_TEMPLATE "-page-"
|
||||
#define PS_TEMPLATE "-ps-"
|
||||
#define REGION_TEMPLATE "-regions-"
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
# define DEBUGGING
|
||||
# define DEBUG_HTML
|
||||
@ -82,20 +96,21 @@ static int stdoutfd = 1; // output file descriptor - norm
|
||||
// -1 means closed
|
||||
static int copyofstdoutfd =-1; // a copy of stdout, so we can restore stdout when
|
||||
// writing to post-html
|
||||
static char *psFileName = 0; // name of postscript file
|
||||
static char *regionFileName = 0; // name of file containing all image regions
|
||||
static char *imagePageStem = 0; // stem of all files containing page images
|
||||
static char *psFileName = NULL; // name of postscript file
|
||||
static char *regionFileName = NULL; // name of file containing all image regions
|
||||
static char *imagePageStem = NULL; // stem of all files containing page images
|
||||
static char *image_device = "pnmraw";
|
||||
static int image_res = DEFAULT_IMAGE_RES;
|
||||
static int vertical_offset= DEFAULT_VERTICAL_OFFSET;
|
||||
static char *image_template = 0; // image template filename
|
||||
static char *image_template = NULL; // image template filename
|
||||
static int troff_arg = 0; // troff arg index
|
||||
static char *command_prefix = 0; // optional prefix for some installations.
|
||||
static char *troff_command = 0;
|
||||
static char *command_prefix = NULL; // optional prefix for some installations.
|
||||
static char *troff_command = NULL;
|
||||
static char *image_dir = NULL; // user specified image directory
|
||||
#if defined(DEBUGGING)
|
||||
static int debug = FALSE;
|
||||
static char *troffFileName = 0; // output of pre-html output which is sent to troff -Tps
|
||||
static char *htmlFileName = 0; // output of pre-html output which is sent to troff -Thtml
|
||||
static char *troffFileName = NULL; // output of pre-html output which is sent to troff -Tps
|
||||
static char *htmlFileName = NULL; // output of pre-html output which is sent to troff -Thtml
|
||||
#endif
|
||||
|
||||
|
||||
@ -111,7 +126,8 @@ static char *htmlFileName = 0; // output of pre-html output whi
|
||||
static int do_file(const char *filename);
|
||||
|
||||
/*
|
||||
* sys_fatal - writes a fatal error message. Taken from src/roff/groff/pipeline.c
|
||||
* sys_fatal - writes a fatal error message.
|
||||
* Taken from src/roff/groff/pipeline.c.
|
||||
*/
|
||||
|
||||
void sys_fatal (const char *s)
|
||||
@ -119,6 +135,222 @@ void sys_fatal (const char *s)
|
||||
fprintf(stderr, "%s: %s: %s", program_name, s, strerror(errno));
|
||||
}
|
||||
|
||||
/*
|
||||
* html_system - a wrapper for system()
|
||||
*/
|
||||
void html_system(const char *s, int redirect_stdout)
|
||||
{
|
||||
// Redirect standard error to the null device. This is more
|
||||
// portable than using "2> /dev/null", since it doesn't require a
|
||||
// Unixy shell.
|
||||
int save_stderr = dup(2);
|
||||
int save_stdout = dup(1);
|
||||
int fdnull = open(NULL_DEV, O_WRONLY|O_BINARY, 0666);
|
||||
if (save_stderr > 2 && fdnull > 2)
|
||||
dup2(fdnull, 2);
|
||||
if (redirect_stdout && save_stdout > 1 && fdnull > 1)
|
||||
dup2(fdnull, 1);
|
||||
if (fdnull >= 0)
|
||||
close(fdnull);
|
||||
int status = system(s);
|
||||
dup2(save_stderr, 2);
|
||||
if (redirect_stdout)
|
||||
dup2(save_stdout, 1);
|
||||
if (status == -1)
|
||||
fprintf(stderr, "Calling `%s' failed\n", s);
|
||||
else if (status)
|
||||
fprintf(stderr, "Calling `%s' returned status %d\n", s, status);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/*
|
||||
* if/when vsnprintf becomes available on all *NIX machines we can use this function,
|
||||
* until then we must use the more complex function below which performs hand built
|
||||
* %d, %s and %%.
|
||||
*/
|
||||
|
||||
/*
|
||||
* make_message - taken from man printf(3), creates a string via malloc
|
||||
* and places the result of the va args into string.
|
||||
* Finally the new string is returned.
|
||||
*/
|
||||
|
||||
char *
|
||||
make_message (const char *fmt, ...)
|
||||
{
|
||||
/* Guess we need no more than 100 bytes. */
|
||||
int n, size = 100;
|
||||
char *p;
|
||||
char *np;
|
||||
va_list ap;
|
||||
if ((p = (char *)malloc (size)) == NULL)
|
||||
return NULL;
|
||||
while (1) {
|
||||
/* Try to print in the allocated space. */
|
||||
va_start(ap, fmt);
|
||||
n = vsnprintf (p, size, fmt, ap);
|
||||
va_end(ap);
|
||||
/* If that worked, return the string. */
|
||||
if (n > -1 && n < size) {
|
||||
if (size > n+1) {
|
||||
np = strdup(p);
|
||||
if (np == NULL)
|
||||
sys_fatal("strdup");
|
||||
free(p);
|
||||
return np;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
/* Else try again with more space. */
|
||||
if (n > -1) /* glibc 2.1 */
|
||||
size = n+1; /* precisely what is needed */
|
||||
else /* glibc 2.0 */
|
||||
size *= 2; /* twice the old size */
|
||||
if ((np = (char *)realloc (p, size)) == NULL) {
|
||||
free(p); /* realloc failed, free old, p. */
|
||||
return NULL;
|
||||
}
|
||||
p = np; /* use realloc'ed, p */
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
/*
|
||||
* lengthOfintToStr - returns the length of the proposed string value of i.
|
||||
* Hand built log10.
|
||||
*/
|
||||
|
||||
int
|
||||
lengthOfintToStr (int i)
|
||||
{
|
||||
int n=0;
|
||||
|
||||
if (i < 0)
|
||||
sys_fatal("expecting positive integer value");
|
||||
|
||||
do {
|
||||
i /= 10;
|
||||
n++;
|
||||
} while (i > 0);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* intToStr - returns a string containing the positive value of i.
|
||||
* (int i is assumed to be positive).
|
||||
*/
|
||||
|
||||
char *
|
||||
intToStr (int i)
|
||||
{
|
||||
int n=lengthOfintToStr(i)+1;
|
||||
char *p = (char *)malloc(n);
|
||||
|
||||
if (p == NULL)
|
||||
sys_fatal("malloc");
|
||||
|
||||
if (i < 0)
|
||||
sys_fatal("expecting positive integer value");
|
||||
|
||||
n--;
|
||||
p[n] = (char)0;
|
||||
do {
|
||||
n--;
|
||||
p[n] = (char)((i % 10) + (int)'0');
|
||||
i /= 10;
|
||||
} while (i > 0);
|
||||
return( p );
|
||||
}
|
||||
|
||||
/*
|
||||
* make_message - returns a string built from a format specifier.
|
||||
* This function does not use vsnprintf; it only
|
||||
* understands primitive %%, %s, and %d specifiers.
|
||||
*/
|
||||
|
||||
char *
|
||||
make_message (const char *fmt, ...)
|
||||
{
|
||||
char *p = strdup(fmt); /* so we can splat a nul anywhere in the string */
|
||||
char *np;
|
||||
char *l;
|
||||
char *s;
|
||||
char *num;
|
||||
int search=0;
|
||||
va_list ap;
|
||||
|
||||
if (p == NULL)
|
||||
sys_fatal("strdup");
|
||||
|
||||
va_start(ap, fmt);
|
||||
while (p) {
|
||||
int lenp=strlen(p);
|
||||
char *f = strchr(p+search, '%');
|
||||
|
||||
search = f-p;
|
||||
np = p;
|
||||
|
||||
if (f == NULL) {
|
||||
va_end(ap);
|
||||
return p;
|
||||
}
|
||||
switch (*(f+1)) {
|
||||
|
||||
case 'd':
|
||||
l = strdup(f+2);
|
||||
if (l == NULL)
|
||||
sys_fatal("strdup");
|
||||
*f = (char)0;
|
||||
num = intToStr(va_arg(ap, int));
|
||||
np = (char *)malloc(strlen(p)+strlen(num)+strlen(l)+1);
|
||||
if (np == NULL)
|
||||
sys_fatal("malloc");
|
||||
strcpy(np, p);
|
||||
strcat(np, num);
|
||||
strcat(np, l);
|
||||
search += strlen(np)-lenp;
|
||||
free(num);
|
||||
free(l);
|
||||
break;
|
||||
case 's':
|
||||
/* concat */
|
||||
l = f+2;
|
||||
if (l == NULL)
|
||||
sys_fatal("strdup");
|
||||
s = va_arg(ap, char *);
|
||||
*f = (char)0;
|
||||
np = (char *)malloc(strlen(l)+1+strlen(p)+strlen(s));
|
||||
if (np == NULL)
|
||||
sys_fatal("malloc");
|
||||
strcpy(np, p);
|
||||
strcat(np, s);
|
||||
strcat(np, l);
|
||||
search += strlen(s);
|
||||
break;
|
||||
case '%':
|
||||
/* remove one of the two % that we have seen */
|
||||
*f = (char)0;
|
||||
l = f+1;
|
||||
np = (char *)malloc(strlen(l)+1+strlen(p));
|
||||
if (np == NULL)
|
||||
sys_fatal("malloc");
|
||||
strcpy(np, p);
|
||||
strcat(np, l);
|
||||
search++;
|
||||
break;
|
||||
default:
|
||||
sys_fatal("unexpected format specifier");
|
||||
return NULL;
|
||||
}
|
||||
free(p);
|
||||
p = np;
|
||||
}
|
||||
va_end(ap);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* the class and methods for retaining ascii text
|
||||
*/
|
||||
@ -174,7 +406,7 @@ char_buffer::char_buffer()
|
||||
|
||||
char_buffer::~char_buffer()
|
||||
{
|
||||
while (head != 0) {
|
||||
while (head != NULL) {
|
||||
char_block *temp = head;
|
||||
head = head->next;
|
||||
delete temp;
|
||||
@ -187,12 +419,10 @@ char_buffer::~char_buffer()
|
||||
|
||||
int char_buffer::read_file (FILE *fp)
|
||||
{
|
||||
int i=0;
|
||||
unsigned int old_used;
|
||||
int n;
|
||||
|
||||
while (! feof(fp)) {
|
||||
if (tail == 0) {
|
||||
if (tail == NULL) {
|
||||
tail = new char_block;
|
||||
head = tail;
|
||||
} else {
|
||||
@ -246,14 +476,55 @@ static void writeString (char *s)
|
||||
* makeFileName - creates the image filename template.
|
||||
*/
|
||||
|
||||
void makeFileName ()
|
||||
static void makeFileName (void)
|
||||
{
|
||||
char buffer[8192];
|
||||
char *s;
|
||||
|
||||
sprintf(buffer, "grohtml-%d", (int)getpid());
|
||||
strcat(buffer, "-%d");
|
||||
image_template = (char *)malloc(strlen(buffer)+1);
|
||||
strcpy(image_template, buffer);
|
||||
if ((image_dir != NULL) && (strchr(image_dir, '%') != NULL)) {
|
||||
error("cannot use a `%%' within the image directory name");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((image_template != NULL) && (strchr(image_template, '%') != NULL)) {
|
||||
error("cannot use a `%%' within the image template");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (image_dir == NULL) {
|
||||
image_dir = "";
|
||||
} else if ((strlen(image_dir)>0) && (image_dir[strlen(image_dir)-1] != '/')) {
|
||||
image_dir = make_message("%s/", image_dir);
|
||||
if (image_dir == NULL)
|
||||
sys_fatal("make_message");
|
||||
}
|
||||
|
||||
if (image_template == NULL)
|
||||
s = make_message("%sgrohtml-%d", image_dir, (int)getpid());
|
||||
else {
|
||||
s = make_message("%s%s", image_dir, image_template);
|
||||
}
|
||||
if (s == NULL)
|
||||
sys_fatal("make_message");
|
||||
|
||||
image_template = (char *)malloc(strlen("-%d")+strlen(s)+1);
|
||||
if (image_template == NULL)
|
||||
sys_fatal("malloc");
|
||||
strcpy(image_template, s);
|
||||
strcat(image_template, "-%d");
|
||||
free(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* checkImageDir - checks to see whether the image directory is available.
|
||||
*/
|
||||
|
||||
static void checkImageDir (void)
|
||||
{
|
||||
if ((image_dir != NULL) && (strcmp(image_dir, "") != 0))
|
||||
if (! ((mkdir(image_dir, 0700) == 0) || (errno == EEXIST))) {
|
||||
error("cannot create directory `%1'", image_dir);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -266,12 +537,12 @@ static void write_end_image (int is_html)
|
||||
/*
|
||||
* emit image name and enable output
|
||||
*/
|
||||
writeString("\\O2\\O1\\O4\n");
|
||||
writeString("\\O[2]\\O[1]\\O[4]\n");
|
||||
} else {
|
||||
/*
|
||||
* postscript, therefore emit image boundaries
|
||||
*/
|
||||
writeString("\\O2\\O4\n");
|
||||
writeString("\\O[2]\\O[4]\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,8 +557,8 @@ static void write_end_image (int is_html)
|
||||
static void write_start_image (IMAGE_ALIGNMENT pos, int is_html)
|
||||
{
|
||||
if (pos == INLINE) {
|
||||
writeString("\\O3\\O5'");
|
||||
writeString(image_template); writeString(".png'");
|
||||
writeString("\\O[3]\\O[5 ");
|
||||
writeString(image_template); writeString(".png]");
|
||||
} else {
|
||||
writeString(".begin \\{\\\n");
|
||||
switch (pos) {
|
||||
@ -310,10 +581,10 @@ static void write_start_image (IMAGE_ALIGNMENT pos, int is_html)
|
||||
writeString("\\}\n");
|
||||
}
|
||||
if (is_html) {
|
||||
writeString("\\O0\n");
|
||||
writeString("\\O[0]\n");
|
||||
} else {
|
||||
// reset min/max registers
|
||||
writeString("\\O0\\O1\n");
|
||||
writeString("\\O[0]\\O[1]\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,10 +727,9 @@ void char_buffer::skip_to_newline (char_block **t, int *i)
|
||||
void char_buffer::write_file_troff (void)
|
||||
{
|
||||
char_block *t=head;
|
||||
int r;
|
||||
int i=0;
|
||||
|
||||
if (t != 0) {
|
||||
if (t != NULL) {
|
||||
do {
|
||||
/*
|
||||
* remember to check the shortest string last
|
||||
@ -479,7 +749,7 @@ void char_buffer::write_file_troff (void)
|
||||
} else {
|
||||
write_upto_newline(&t, &i, FALSE);
|
||||
}
|
||||
} while (t != 0);
|
||||
} while (t != NULL);
|
||||
}
|
||||
if (close(stdoutfd) < 0)
|
||||
sys_fatal("close");
|
||||
@ -526,7 +796,7 @@ imageItem::imageItem (int x1, int y1, int x2, int y2, int page, int res, int max
|
||||
resolution = res;
|
||||
maxx = max_width;
|
||||
imageName = name;
|
||||
next = 0;
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -567,7 +837,7 @@ imageList::imageList ()
|
||||
|
||||
imageList::~imageList ()
|
||||
{
|
||||
while (head != 0) {
|
||||
while (head != NULL) {
|
||||
imageItem *i = head;
|
||||
head = head->next;
|
||||
delete i;
|
||||
@ -578,21 +848,54 @@ imageList::~imageList ()
|
||||
* createAllPages - creates a set of images, one per page.
|
||||
*/
|
||||
|
||||
static void createAllPages (void)
|
||||
static int createAllPages (void)
|
||||
{
|
||||
char buffer[4096];
|
||||
char *s;
|
||||
int retries = MAX_RETRIES;
|
||||
|
||||
sprintf(buffer,
|
||||
"echo showpage | gs -q -dSAFER -sDEVICE=%s -r%d -sOutputFile=%s%%d %s - > /dev/null 2>&1 \n",
|
||||
image_device,
|
||||
image_res,
|
||||
imagePageStem,
|
||||
psFileName);
|
||||
imagePageStem = xtmptemplate(PAGE_TEMPLATE);
|
||||
strcpy(buffer, imagePageStem);
|
||||
|
||||
do {
|
||||
if (mktemp(imagePageStem) == NULL) {
|
||||
sys_fatal("mktemp");
|
||||
return -1;
|
||||
}
|
||||
if (mkdir(imagePageStem, 0700) == 0) break;
|
||||
if (errno == EEXIST) {
|
||||
// directory already exists, try another name
|
||||
retries--;
|
||||
if (retries == 0) {
|
||||
// time to give up
|
||||
sys_fatal("mkdir");
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
// another error, quit
|
||||
sys_fatal("mkdir");
|
||||
return -1;
|
||||
}
|
||||
strcpy(imagePageStem, buffer);
|
||||
} while (1);
|
||||
|
||||
s = make_message("echo showpage | "
|
||||
"gs%s -q -dSAFER -sDEVICE=%s -r%d "
|
||||
"-sOutputFile=%s/%%d %s -",
|
||||
EXE_EXT,
|
||||
image_device,
|
||||
image_res,
|
||||
imagePageStem,
|
||||
psFileName);
|
||||
if (s == NULL)
|
||||
sys_fatal("make_message");
|
||||
#if defined(DEBUGGING)
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), stderr);
|
||||
fwrite(s, sizeof(char), strlen(s), stderr);
|
||||
fflush(stderr);
|
||||
#endif
|
||||
system(buffer);
|
||||
html_system(s, 1);
|
||||
free(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -602,29 +905,21 @@ static void createAllPages (void)
|
||||
static void removeAllPages (void)
|
||||
{
|
||||
#if !defined(DEBUGGING)
|
||||
char buffer[4096];
|
||||
char *s=NULL;
|
||||
int i=1;
|
||||
|
||||
do {
|
||||
sprintf(buffer, "%s%d", imagePageStem, i);
|
||||
if (s)
|
||||
free(s);
|
||||
s = make_message("%s/%d", imagePageStem, i);
|
||||
if (s == NULL)
|
||||
sys_fatal("make_message");
|
||||
i++;
|
||||
} while (remove(buffer) == 0);
|
||||
} while (unlink(s) == 0);
|
||||
rmdir(imagePageStem);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* abs - returns the absolute value.
|
||||
*/
|
||||
|
||||
int abs (int x)
|
||||
{
|
||||
if (x < 0) {
|
||||
return( -x );
|
||||
} else {
|
||||
return( x );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* min - returns the minimum of two numbers.
|
||||
*/
|
||||
@ -658,23 +953,28 @@ int max (int x, int y)
|
||||
static void createImage (imageItem *i)
|
||||
{
|
||||
if (i->X1 != -1) {
|
||||
char buffer[4096];
|
||||
char *s;
|
||||
int x1 = max(min(i->X1, i->X2)*image_res/POSTSCRIPTRES-1*IMAGE_BOARDER_PIXELS, 0);
|
||||
int y1 = max((image_res*vertical_offset/72)+min(i->Y1, i->Y2)*image_res/POSTSCRIPTRES-IMAGE_BOARDER_PIXELS, 0);
|
||||
int x2 = max(i->X1, i->X2)*image_res/POSTSCRIPTRES+1*IMAGE_BOARDER_PIXELS;
|
||||
int y2 = (image_res*vertical_offset/72)+max(i->Y1, i->Y2)*image_res/POSTSCRIPTRES+1*IMAGE_BOARDER_PIXELS;
|
||||
|
||||
sprintf(buffer,
|
||||
"pnmcut %d %d %d %d < %s%d | pnmtopng %s > %s \n",
|
||||
x1, y1, x2-x1+1, y2-y1+1,
|
||||
imagePageStem,
|
||||
i->pageNo,
|
||||
TRANSPARENT,
|
||||
i->imageName);
|
||||
s = make_message("pnmcut%s %d %d %d %d < %s/%d | pnmtopng%s %s > %s \n",
|
||||
EXE_EXT,
|
||||
x1, y1, x2-x1+1, y2-y1+1,
|
||||
imagePageStem,
|
||||
i->pageNo,
|
||||
EXE_EXT,
|
||||
TRANSPARENT,
|
||||
i->imageName);
|
||||
if (s == NULL)
|
||||
sys_fatal("make_message");
|
||||
|
||||
#if defined(DEBUGGING)
|
||||
fprintf(stderr, buffer);
|
||||
fprintf(stderr, s);
|
||||
#endif
|
||||
system(buffer);
|
||||
html_system(s, 0);
|
||||
free(s);
|
||||
#if defined(DEBUGGING)
|
||||
} else {
|
||||
fprintf(stderr, "ignoring image as x1 coord is -1\n");
|
||||
@ -691,7 +991,7 @@ void imageList::add (int x1, int y1, int x2, int y2, int page, int res, int maxx
|
||||
{
|
||||
imageItem *i = new imageItem(x1, y1, x2, y2, page, res, maxx, name);
|
||||
|
||||
if (head == 0) {
|
||||
if (head == NULL) {
|
||||
head = i;
|
||||
tail = i;
|
||||
} else {
|
||||
@ -712,10 +1012,9 @@ static imageList listOfImages; // list of images defined by the region file.
|
||||
void char_buffer::write_file_html (void)
|
||||
{
|
||||
char_block *t =head;
|
||||
char *name;
|
||||
int i=0;
|
||||
|
||||
if (t != 0) {
|
||||
if (t != NULL) {
|
||||
stop();
|
||||
do {
|
||||
/*
|
||||
@ -737,7 +1036,7 @@ void char_buffer::write_file_html (void)
|
||||
} else {
|
||||
write_upto_newline(&t, &i, TRUE);
|
||||
}
|
||||
} while (t != 0);
|
||||
} while (t != NULL);
|
||||
}
|
||||
if (close(stdoutfd) < 0)
|
||||
sys_fatal("close");
|
||||
@ -760,7 +1059,6 @@ void char_buffer::write_file_html (void)
|
||||
static void generateImages (char *regionFileName)
|
||||
{
|
||||
pushBackBuffer *f=new pushBackBuffer(regionFileName);
|
||||
char ch;
|
||||
|
||||
while (f->putPB(f->getPB()) != eof) {
|
||||
if (f->isString("grohtml-info:page")) {
|
||||
@ -775,10 +1073,10 @@ static void generateImages (char *regionFileName)
|
||||
listOfImages.add(x1, y1, x2, y2, page, res, maxx, name);
|
||||
while ((f->putPB(f->getPB()) != '\n') &&
|
||||
(f->putPB(f->getPB()) != eof)) {
|
||||
ch = f->getPB();
|
||||
(void)f->getPB();
|
||||
}
|
||||
if (f->putPB(f->getPB()) == '\n') {
|
||||
ch = f->getPB();
|
||||
(void)f->getPB();
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@ -931,6 +1229,9 @@ char **addps4html (int argc, char *argv[])
|
||||
char **new_argv = (char **)malloc((argc+2)*sizeof(char *));
|
||||
int i=0;
|
||||
|
||||
if (new_argv == NULL)
|
||||
sys_fatal("malloc");
|
||||
|
||||
while (i<argc) {
|
||||
new_argv[i] = argv[i];
|
||||
i++;
|
||||
@ -1006,13 +1307,15 @@ static char_buffer inputFile;
|
||||
|
||||
void usage(FILE *stream)
|
||||
{
|
||||
fprintf(stream, "usage: %s troffname [-P-o vertical_image_offset] [-P-i image_resolution] [troff flags] [files]\n", program_name);
|
||||
fprintf(stream, "usage: %s troffname [-Iimage_name] [-Dimage_directory] [-P-o vertical_image_offset] [-P-i image_resolution] [troff flags] [files]\n", program_name);
|
||||
fprintf(stream, " vertical_image_offset (default %d/72 of an inch)\n", vertical_offset);
|
||||
fprintf(stream, " image_resolution (default %d) pixels per inch\n", image_res);
|
||||
fprintf(stream, " image_name is the name of the stem for all images (default is grohtml-<pid>)\n");
|
||||
fprintf(stream, " place all png files into image_directory\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* scanArguments - scans for -P-i and -P-o arguments.
|
||||
* scanArguments - scans for -P-i, -P-o, -P-D and -P-I arguments.
|
||||
*/
|
||||
|
||||
int scanArguments (int argc, char **argv)
|
||||
@ -1020,13 +1323,16 @@ int scanArguments (int argc, char **argv)
|
||||
int i=1;
|
||||
|
||||
while (i<argc) {
|
||||
if (strncmp(argv[i], "-i", 2) == 0) {
|
||||
if (strncmp(argv[i], "-D", 2) == 0) {
|
||||
image_dir = (char *)(argv[i]+2);
|
||||
} else if (strncmp(argv[i], "-I", 2) == 0) {
|
||||
image_template = (char *)(argv[i]+2);
|
||||
} else if (strncmp(argv[i], "-i", 2) == 0) {
|
||||
image_res = atoi((char *)(argv[i]+2));
|
||||
} else if (strncmp(argv[i], "-o", 2) == 0) {
|
||||
vertical_offset = atoi((char *)(argv[i]+2));
|
||||
} else if ((strcmp(argv[i], "-v") == 0)
|
||||
|| (strcmp(argv[i], "--version") == 0)) {
|
||||
extern const char *Version_string;
|
||||
printf("GNU pre-grohtml (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
} else if ((strcmp(argv[i], "-h") == 0)
|
||||
@ -1034,7 +1340,7 @@ int scanArguments (int argc, char **argv)
|
||||
|| (strcmp(argv[i], "-?") == 0)) {
|
||||
usage(stdout);
|
||||
exit(0);
|
||||
} else if (strcmp(argv[i], "troff") == 0) {
|
||||
} else if (strcmp(argv[i], troff_command) == 0) {
|
||||
/* remember troff argument number */
|
||||
troff_arg = i;
|
||||
#if defined(DEBUGGING)
|
||||
@ -1053,7 +1359,7 @@ int scanArguments (int argc, char **argv)
|
||||
* makeTempFiles - name the temporary files
|
||||
*/
|
||||
|
||||
static void makeTempFiles (void)
|
||||
static int makeTempFiles (void)
|
||||
{
|
||||
#if defined(DEBUGGING)
|
||||
psFileName = "/tmp/prehtml-ps";
|
||||
@ -1062,10 +1368,21 @@ static void makeTempFiles (void)
|
||||
troffFileName = "/tmp/prehtml-troff";
|
||||
htmlFileName = "/tmp/prehtml-html";
|
||||
#else
|
||||
psFileName = mktemp(xtmptemplate("-ps-"));
|
||||
regionFileName = mktemp(xtmptemplate("-regions-"));
|
||||
imagePageStem = mktemp(xtmptemplate("-page-"));
|
||||
int fd;
|
||||
|
||||
if ((fd = mkstemp(psFileName = xtmptemplate(PS_TEMPLATE))) == -1) {
|
||||
sys_fatal("mkstemp");
|
||||
return -1;
|
||||
}
|
||||
close(fd);
|
||||
if ((fd = mkstemp(regionFileName = xtmptemplate(REGION_TEMPLATE))) == -1) {
|
||||
sys_fatal("mkstemp");
|
||||
unlink(psFileName);
|
||||
return -1;
|
||||
}
|
||||
close(fd);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1075,8 +1392,8 @@ static void makeTempFiles (void)
|
||||
static void removeTempFiles (void)
|
||||
{
|
||||
#if !defined(DEBUGGING)
|
||||
remove(psFileName);
|
||||
remove(regionFileName);
|
||||
unlink(psFileName);
|
||||
unlink(regionFileName);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1091,6 +1408,9 @@ static void findPrefix (void)
|
||||
if (!command_prefix)
|
||||
command_prefix = PROG_PREFIX;
|
||||
troff_command = (char *)malloc(strlen("troff")+strlen(command_prefix)+1);
|
||||
if (troff_command == NULL)
|
||||
sys_fatal("malloc");
|
||||
|
||||
strcpy(troff_command, command_prefix);
|
||||
strcat(troff_command, "troff");
|
||||
}
|
||||
@ -1104,8 +1424,9 @@ int main(int argc, char **argv)
|
||||
int ok=1;
|
||||
|
||||
findPrefix();
|
||||
makeFileName();
|
||||
i = scanArguments(argc, argv);
|
||||
checkImageDir();
|
||||
makeFileName();
|
||||
while (i < argc) {
|
||||
if (argv[i][0] != '-') {
|
||||
/* found source file */
|
||||
@ -1123,13 +1444,16 @@ int main(int argc, char **argv)
|
||||
if (! found) {
|
||||
do_file("-");
|
||||
}
|
||||
makeTempFiles();
|
||||
if (makeTempFiles())
|
||||
return 1;
|
||||
ok = inputFile.do_image(argc, argv);
|
||||
if (ok == 0) {
|
||||
createAllPages();
|
||||
generateImages(regionFileName);
|
||||
ok = inputFile.do_html(argc, argv);
|
||||
removeAllPages();
|
||||
ok = createAllPages();
|
||||
if (ok == 0) {
|
||||
generateImages(regionFileName);
|
||||
ok = inputFile.do_html(argc, argv);
|
||||
removeAllPages();
|
||||
}
|
||||
}
|
||||
removeTempFiles();
|
||||
return ok;
|
||||
@ -1155,6 +1479,6 @@ static int do_file(const char *filename)
|
||||
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
current_filename = 0;
|
||||
current_filename = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# define FALSE (1==0)
|
||||
#endif
|
||||
|
||||
# define ERROR(X) (fprintf(stderr, "%s:%d error %s\n", __FILE__, __LINE__, X) && \
|
||||
# define ERROR(X) (void)(fprintf(stderr, "%s:%d error %s\n", __FILE__, __LINE__, X) && \
|
||||
(fflush(stderr)) && localexit(1))
|
||||
|
||||
|
||||
@ -195,7 +195,6 @@ int pushBackBuffer::isString (char *s)
|
||||
{
|
||||
int length=strlen(s);
|
||||
int i=0;
|
||||
int j;
|
||||
|
||||
while ((i<length) && (putPB(getPB())==s[i])) {
|
||||
if (getPB() != s[i]) {
|
||||
@ -230,10 +229,12 @@ static int isDigit (char ch)
|
||||
* isHexDigit - returns TRUE if the character, ch, is a hex digit.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
static int isHexDigit (char ch)
|
||||
{
|
||||
return( (isDigit(ch)) || ((ch>='a') && (ch<='f')) );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* readInt - returns an integer from the input stream.
|
||||
|
@ -21,6 +21,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "pic.h"
|
||||
|
||||
extern int yyparse();
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
output *out;
|
||||
|
||||
@ -568,7 +569,6 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU pic (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -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.3 2000/11/14 20:40:28 wlemb Exp $";
|
||||
static char yyrcsid[] = "$Id: pic.cc,v 1.4 2001/04/19 14:01:55 wlemb Exp $";
|
||||
#endif
|
||||
#define YYBYACC 1
|
||||
#define YYMAJOR 1
|
||||
@ -3217,7 +3217,8 @@ void define_variable(const char *name, double val)
|
||||
if (strcmp(name, "scale") == 0) {
|
||||
// When the scale changes, reset all scaled pre-defined variables to
|
||||
// their default values.
|
||||
for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
if (defaults_table[i].scaled)
|
||||
define_variable(defaults_table[i].name, val*defaults_table[i].val);
|
||||
}
|
||||
@ -3236,7 +3237,8 @@ void parse_init()
|
||||
|
||||
void reset(const char *nm)
|
||||
{
|
||||
for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
if (strcmp(nm, defaults_table[i].name) == 0) {
|
||||
double val = defaults_table[i].val;
|
||||
if (defaults_table[i].scaled) {
|
||||
@ -3256,7 +3258,8 @@ void reset_all()
|
||||
// aren't scaled because `scale' is not scaled, and changing the
|
||||
// value of `scale' will reset all the pre-defined variables that
|
||||
// are scaled.
|
||||
for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
if (!defaults_table[i].scaled)
|
||||
define_variable(defaults_table[i].name, defaults_table[i].val);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -881,3 +881,7 @@ is incompatible with the pic in 10th edition Unix,
|
||||
which interprets 0 as black and 1 as white.
|
||||
.LP
|
||||
PostScript\*R is a registered trademark of Adobe Systems Incorporation.
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -1622,7 +1623,8 @@ void define_variable(const char *name, double val)
|
||||
if (strcmp(name, "scale") == 0) {
|
||||
// When the scale changes, reset all scaled pre-defined variables to
|
||||
// their default values.
|
||||
for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
if (defaults_table[i].scaled)
|
||||
define_variable(defaults_table[i].name, val*defaults_table[i].val);
|
||||
}
|
||||
@ -1641,7 +1643,8 @@ void parse_init()
|
||||
|
||||
void reset(const char *nm)
|
||||
{
|
||||
for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
if (strcmp(nm, defaults_table[i].name) == 0) {
|
||||
double val = defaults_table[i].val;
|
||||
if (defaults_table[i].scaled) {
|
||||
@ -1661,7 +1664,8 @@ void reset_all()
|
||||
// aren't scaled because `scale' is not scaled, and changing the
|
||||
// value of `scale' will reset all the pre-defined variables that
|
||||
// are scaled.
|
||||
for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
|
||||
if (!defaults_table[i].scaled)
|
||||
define_variable(defaults_table[i].name, defaults_table[i].val);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -755,7 +755,8 @@ static int check_args(const char *types, const char *name,
|
||||
|
||||
static void execute_command(const char *name, int argc, argument *argv)
|
||||
{
|
||||
for (int i = 0; i < sizeof(command_table)/sizeof(command_table[0]); i++)
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(command_table)/sizeof(command_table[0]); i++)
|
||||
if (strcmp(name, command_table[i].name) == 0) {
|
||||
if (check_args(command_table[i].arg_types, name, argc, argv))
|
||||
(*command_table[i].func)(argc, argv);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -327,13 +327,13 @@ void sortify_title(const char *s, int len, string &key)
|
||||
break;
|
||||
}
|
||||
if (ptr < end) {
|
||||
int first_word_len = ptr - s - 1;
|
||||
unsigned int first_word_len = ptr - s - 1;
|
||||
const char *ae = articles.contents() + articles.length();
|
||||
for (const char *a = articles.contents();
|
||||
a < ae;
|
||||
a = strchr(a, '\0') + 1)
|
||||
if (first_word_len == strlen(a)) {
|
||||
int j;
|
||||
unsigned int j;
|
||||
for (j = 0; j < first_word_len; j++)
|
||||
if (a[j] != cmlower(s[j]))
|
||||
break;
|
||||
@ -951,7 +951,7 @@ static int find_month(const char *start, const char *end)
|
||||
while (ptr < end && csalpha(*ptr))
|
||||
ptr++;
|
||||
if (ptr - start >= 3) {
|
||||
for (int i = 0; i < sizeof(months)/sizeof(months[0]); i++) {
|
||||
for (unsigned int i = 0; i < sizeof(months)/sizeof(months[0]); i++) {
|
||||
const char *q = months[i];
|
||||
const char *p = start;
|
||||
for (; p < ptr; p++, q++)
|
||||
|
@ -25,6 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "search.h"
|
||||
#include "command.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
const char PRE_LABEL_MARKER = '\013';
|
||||
const char POST_LABEL_MARKER = '\014';
|
||||
const char LABEL_MARKER = '\015'; // label_type is added on
|
||||
@ -344,7 +346,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
if (strcmp(opt,"-version")==0) {
|
||||
case 'v':
|
||||
extern const char *Version_string;
|
||||
printf("GNU refer (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -1300,3 +1300,7 @@ In label expressions,
|
||||
expressions are ignored inside
|
||||
.BI . char
|
||||
expressions.
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -181,7 +181,7 @@ const token_info *lookup_token(const char *start, const char *end)
|
||||
for (;;) {
|
||||
if (token_table[n].tok == 0)
|
||||
break;
|
||||
if (strlen(token_table[n].tok) == end - start
|
||||
if (strlen(token_table[n].tok) == size_t(end - start)
|
||||
&& memcmp(token_table[n].tok, start, end - start) == 0)
|
||||
return &(token_table[n].ti);
|
||||
if (n == 0)
|
||||
|
@ -30,12 +30,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "stringclass.h"
|
||||
#include "nonposix.h"
|
||||
|
||||
static int include_list_length;
|
||||
static size_t include_list_length;
|
||||
static char **include_list;
|
||||
|
||||
int compatible_flag = 0;
|
||||
|
||||
extern int interpret_lf_args(const char *);
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
int do_file(const char *filename);
|
||||
|
||||
@ -77,7 +78,6 @@ int main(int argc, char **argv)
|
||||
switch (opt) {
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU soelim (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
@ -183,18 +183,18 @@ int do_file(const char *filename)
|
||||
{
|
||||
char *path = include_list[j];
|
||||
if (0 == strcmp(path, "."))
|
||||
whole_filename = filename;
|
||||
whole_filename = filename;
|
||||
else
|
||||
whole_filename = string(path) + "/" + filename;
|
||||
whole_filename = string(path) + "/" + filename;
|
||||
whole_filename += '\0';
|
||||
errno = 0;
|
||||
fp = fopen(whole_filename.contents(), "r");
|
||||
if (fp != 0)
|
||||
break;
|
||||
break;
|
||||
if (errno != ENOENT) {
|
||||
error("can't open `%1': %2",
|
||||
error("can't open `%1': %2",
|
||||
whole_filename.contents(), strerror(errno));
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (j >= include_list_length)
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -83,3 +83,7 @@ No directory search is performed for files specified using an absolute path.
|
||||
Print the version number.
|
||||
.SH "SEE ALSO"
|
||||
.BR groff (@MAN1EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -25,6 +25,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#define MAX_POINT_SIZE 99
|
||||
#define MAX_VERTICAL_SPACING 72
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static int compatible_flag = 0;
|
||||
|
||||
class table_input {
|
||||
@ -731,7 +733,7 @@ format *process_format(table_input &in, options *opt,
|
||||
int pre_vline = 0;
|
||||
int got_format = 0;
|
||||
int got_period = 0;
|
||||
format_type t;
|
||||
format_type t = FORMAT_LEFT;
|
||||
for (;;) {
|
||||
if (c == EOF) {
|
||||
error("end of input while processing format");
|
||||
@ -1470,7 +1472,6 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU tbl (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-1995 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-1995, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -176,3 +176,7 @@ A\e*a;B
|
||||
.SH "SEE ALSO"
|
||||
.BR groff (@MAN1EXT@),
|
||||
.BR @g@troff (@MAN1EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -82,6 +82,8 @@ public:
|
||||
void print(int is_last, FILE *fp);
|
||||
};
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
int lflag = 0;
|
||||
char *spooler = 0;
|
||||
char *postdriver = 0;
|
||||
@ -175,7 +177,6 @@ int main(int argc, char **argv)
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU groff version %s\n", Version_string);
|
||||
printf("Copyright (C) 1989-2001 Free Software Foundation, Inc.\n"
|
||||
"GNU groff comes with ABSOLUTELY NO WARRANTY.\n"
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -484,3 +484,7 @@ The actual version can be found at
|
||||
.BR groff_ms (@MAN7EXT@),
|
||||
.BR groff_me (@MAN7EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -34,7 +35,11 @@ Compile options are:
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRERROR
|
||||
#include <string.h>
|
||||
#else
|
||||
extern char *strerror();
|
||||
#endif
|
||||
|
||||
#ifdef _POSIX_VERSION
|
||||
|
||||
@ -98,7 +103,8 @@ static char *i_to_a P((int));
|
||||
have a workable groff by using the good-ole DOS pipe simulation
|
||||
via temporary files... */
|
||||
|
||||
#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN32__))
|
||||
#if defined(__MSDOS__) \
|
||||
|| (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN32__))
|
||||
|
||||
#include <process.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -1,6 +1,5 @@
|
||||
MAN1=grog.n
|
||||
CLEANADD=grog
|
||||
NAMEPREFIX=$(g)
|
||||
|
||||
all: grog
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -84,3 +84,7 @@ option.
|
||||
.BR @g@grn (@MAN1EXT@),
|
||||
.BR grap (1),
|
||||
.BR @g@soelim (@MAN1EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -113,9 +113,36 @@ sub process {
|
||||
# closed by `Oc'.
|
||||
elsif (/^\.Oo$sp/) {
|
||||
$Oo++;
|
||||
s/^\.Oo/\. /;
|
||||
redo;
|
||||
}
|
||||
# The test for `Oo' and `Oc' not starting a line (as allowed by the
|
||||
# new implementation of -mdoc) is not complete; it assumes that
|
||||
# macro arguments are well behaved, i.e., "" is used within "..." to
|
||||
# indicate a doublequote as a string element, and weird features
|
||||
# like `.foo a"b' are not used.
|
||||
elsif (/^\..* Oo( |$)/) {
|
||||
s/\\\".*//;
|
||||
s/\"[^\"]*\"//g;
|
||||
s/\".*//;
|
||||
if (s/ Oo( |$)/ /) {
|
||||
$Oo++;
|
||||
}
|
||||
redo;
|
||||
}
|
||||
elsif (/^\.Oc$sp/) {
|
||||
$Oo--;
|
||||
s/^\.Oc/\. /;
|
||||
redo;
|
||||
}
|
||||
elsif (/^\..* Oc( |$)/) {
|
||||
s/\\\".*//;
|
||||
s/\"[^\"]*\"//g;
|
||||
s/\".*//;
|
||||
if (s/ Oc( |$)/ /) {
|
||||
$Oo--;
|
||||
}
|
||||
redo;
|
||||
}
|
||||
if (/^\.so$sp/) {
|
||||
chop;
|
||||
|
@ -29,12 +29,12 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
egrep -h "^\.(P|PS|[PLI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|so|\[|R1|GS|G1|PH|SA)$sp" $* \
|
||||
egrep -h "^\.(P|PS|[PLI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|.* Oo|Oc|.* Oc|TS|EQ|TH|SH|so|\[|R1|GS|G1|PH|SA)$sp" $* \
|
||||
| sed -e '/^\.so/s/^.*$/.SO_START\
|
||||
&\
|
||||
.SO_END/' \
|
||||
| $soelim \
|
||||
| egrep '^\.(P|PS|[PLI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|\[|R1|GS|G1|PH|SA|SO_START|SO_END)' \
|
||||
| egrep '^\.(P|PS|[PLI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|.* Oo|Oc|.* Oc|TS|EQ|TH|SH|\[|R1|GS|G1|PH|SA|SO_START|SO_END)' \
|
||||
| awk '
|
||||
/^\.SO_START$/ { so = 1 }
|
||||
/^\.SO_END$/ { so = 0 }
|
||||
@ -52,8 +52,23 @@ egrep -h "^\.(P|PS|[PLI]P|[pnil]p|sh|Dd|Tp|Dp|De|Cx|Cl|Oo|Oc|TS|EQ|TH|SH|so|\[|R
|
||||
/^\.([pnil]p|sh)/ { me++ }
|
||||
/^\.Dd/ { mdoc++ }
|
||||
/^\.(Tp|Dp|De|Cx|Cl)/ { mdoc_old++ }
|
||||
/^\.Oo/ { Oo++ }
|
||||
/^\.Oc/ { Oo-- }
|
||||
/^\.(O[oc]|.* O[oc]( |$))/ {
|
||||
sub(/\\\".*/, "")
|
||||
gsub(/\"[^\"]*\"/, "")
|
||||
sub(/\".*/, "")
|
||||
sub(/^\.Oo/, " Oo ")
|
||||
sub(/^\.Oc/, " Oc ")
|
||||
sub(/ Oo$/, " Oo ")
|
||||
sub(/ Oc$/, " Oc ")
|
||||
while (/ Oo /) {
|
||||
sub(/ Oo /, " ")
|
||||
Oo++
|
||||
}
|
||||
while (/ Oc /) {
|
||||
sub(/ Oc /, " ")
|
||||
Oo--
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
if (files ~ /^-/)
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -30,14 +30,18 @@ the original English.
|
||||
.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
|
||||
.el .RB "[\ " "\\$1" "\ ]"
|
||||
..
|
||||
.OP \-v
|
||||
.OP \-h
|
||||
.OP \-i
|
||||
.OP \-m name
|
||||
.OP \-n num
|
||||
.OP \-o list
|
||||
.OP \-p
|
||||
.OP \-r cn
|
||||
.OP \-t
|
||||
.OP \-S
|
||||
.OP \-T name
|
||||
.OP \-U
|
||||
.OP \-v
|
||||
.RI "[\ " file\|.\|.\|. "\ ]"
|
||||
.br
|
||||
.ad \na
|
||||
@ -47,24 +51,38 @@ The
|
||||
script emulates the
|
||||
.B nroff
|
||||
command using groff.
|
||||
The
|
||||
.B \-T
|
||||
option with an argument other than
|
||||
Only
|
||||
.BR ascii ,
|
||||
.BR latin1 ,
|
||||
.BR utf8 ,
|
||||
or
|
||||
and
|
||||
.B cp1047
|
||||
will be ignored (and
|
||||
.B \-Tascii
|
||||
will be used).
|
||||
are valid arguments for the
|
||||
.B -T
|
||||
option.
|
||||
If an invalid or no
|
||||
.BR \-T
|
||||
option is given,
|
||||
.B @g@nroff
|
||||
checks the current locale to select a default output device.
|
||||
It first tries the
|
||||
.B locale
|
||||
program, then the environment variables
|
||||
.BR LC_ALL ,
|
||||
.BR LC_CTYPE ,
|
||||
and
|
||||
.BR LANG ,
|
||||
and finally the
|
||||
.B LESSCHARSET
|
||||
environment variable.
|
||||
.PP
|
||||
The
|
||||
.B \-h
|
||||
option
|
||||
is equivalent to the
|
||||
.B grotty
|
||||
.BR grotty 's
|
||||
.B \-h
|
||||
option.
|
||||
option (i.e., using tabs in the output).
|
||||
The
|
||||
.BR \-i ,
|
||||
.BR \-n ,
|
||||
@ -74,16 +92,22 @@ and
|
||||
.B \-r
|
||||
options have the effect described in
|
||||
.BR @g@troff (@MAN1EXT@).
|
||||
In addition
|
||||
In addition,
|
||||
.B @g@nroff
|
||||
silently ignores options of
|
||||
silently ignores the options
|
||||
.BR \-e ,
|
||||
.B \-q
|
||||
or
|
||||
.BR \-s .
|
||||
.BR \-q ,
|
||||
and
|
||||
.BR \-s
|
||||
(which are not implemented in
|
||||
.BR @g@troff ).
|
||||
Options
|
||||
.B \-p
|
||||
(pic),
|
||||
.B \-t
|
||||
(tbl),
|
||||
.B \-S
|
||||
(safer) and
|
||||
(safer), and
|
||||
.B \-U
|
||||
(unsafe) are passed to
|
||||
.BR groff .
|
||||
@ -97,7 +121,7 @@ shows the version number.
|
||||
.B GROFF_BIN_PATH
|
||||
A colon separated list of directories in which to search for the
|
||||
.B groff
|
||||
executable. If unset, `@BINDIR@' is used.
|
||||
executable before searching in PATH. If unset, `@BINDIR@' is used.
|
||||
.SH NOTES
|
||||
This shell script is basically intended for use with
|
||||
.BR man (1),
|
||||
@ -108,3 +132,7 @@ loaded to emulate unrepresentable glyphs.
|
||||
.BR groff (@MAN1EXT@),
|
||||
.BR @g@troff (@MAN1EXT@),
|
||||
.BR grotty (@MAN1EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -49,7 +49,7 @@ for i
|
||||
-[mrnoT])
|
||||
echo "$prog: option $1 requires an argument" >&2
|
||||
exit 1 ;;
|
||||
-i | -[mrno]*)
|
||||
-[ipt] | -[mrno]*)
|
||||
opts="$opts $1" ;;
|
||||
-Tascii | -Tlatin1 | -Tutf8 | -Tcp1047)
|
||||
T=$1 ;;
|
||||
@ -70,7 +70,7 @@ for i
|
||||
echo "GNU nroff (groff) version @VERSION@"
|
||||
exit 0 ;;
|
||||
--help)
|
||||
echo "usage: nroff [-h] [-i] [-mNAME] [-nNUM] [-oLIST] [-rCN] [-Tname] [FILE...]"
|
||||
echo "usage: nroff [-h] [-i] [-mNAME] [-nNUM] [-oLIST] [-p] [-rCN] [-t] [-Tname] [FILE...]"
|
||||
exit 0 ;;
|
||||
--)
|
||||
shift
|
||||
@ -89,10 +89,8 @@ done
|
||||
# This shell script is intended for use with man, so warnings are
|
||||
# probably not wanted. Also load nroff-style character definitions.
|
||||
|
||||
OLD_PATH=$PATH
|
||||
: ${GROFF_BIN_PATH=@BINDIR@}
|
||||
export GROFF_BIN_PATH
|
||||
PATH=$GROFF_BIN_PATH
|
||||
PATH=$OLD_PATH groff $safer -Wall -mtty-char $T $opts ${1+"$@"}
|
||||
PATH=$GROFF_BIN_PATH:$PATH groff $safer -Wall -mtty-char $T $opts ${1+"$@"}
|
||||
|
||||
# eof
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -25,10 +25,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
// is `p' a good size for a hash table
|
||||
|
||||
static int is_good_size(int p)
|
||||
static int is_good_size(unsigned int p)
|
||||
{
|
||||
const int SMALL = 10;
|
||||
unsigned i;
|
||||
const unsigned int SMALL = 10;
|
||||
unsigned int i;
|
||||
for (i = 2; i <= p/2; i++)
|
||||
if (p % i == 0)
|
||||
return 0;
|
||||
|
@ -49,7 +49,8 @@ static vunits truncated_space;
|
||||
static vunits needed_space;
|
||||
|
||||
diversion::diversion(symbol s)
|
||||
: prev(0), nm(s), vertical_position(V0), high_water_mark(V0), marked_place(V0)
|
||||
: prev(0), nm(s), vertical_position(V0), high_water_mark(V0),
|
||||
no_space_mode(0), marked_place(V0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -249,6 +250,7 @@ void macro_diversion::transparent_output(node *n)
|
||||
void macro_diversion::output(node *nd, int retain_size,
|
||||
vunits vs, vunits post_vs, hunits width)
|
||||
{
|
||||
no_space_mode = 0;
|
||||
vertical_size v(vs, post_vs);
|
||||
while (nd != 0) {
|
||||
nd->set_vertical_size(&v);
|
||||
@ -316,7 +318,7 @@ top_level_diversion::top_level_diversion()
|
||||
page_length(units_per_inch*11),
|
||||
prev_page_offset(units_per_inch), page_offset(units_per_inch),
|
||||
page_trap_list(0), have_next_page_number(0),
|
||||
ejecting_page(0), before_first_page(1), no_space_mode(0)
|
||||
ejecting_page(0), before_first_page(1)
|
||||
{
|
||||
}
|
||||
|
||||
@ -722,15 +724,13 @@ void begin_page()
|
||||
|
||||
void no_space()
|
||||
{
|
||||
if (curdiv == topdiv)
|
||||
topdiv->no_space_mode = 1;
|
||||
curdiv->no_space_mode = 1;
|
||||
skip_line();
|
||||
}
|
||||
|
||||
void restore_spacing()
|
||||
{
|
||||
if (curdiv == topdiv)
|
||||
topdiv->no_space_mode = 0;
|
||||
curdiv->no_space_mode = 0;
|
||||
skip_line();
|
||||
}
|
||||
|
||||
@ -755,8 +755,8 @@ void space_request()
|
||||
n = curenv->get_vertical_spacing();
|
||||
while (!tok.newline() && !tok.eof())
|
||||
tok.next();
|
||||
if (!unpostpone_traps())
|
||||
curdiv->space(n);
|
||||
if (!unpostpone_traps() && !curdiv->no_space_mode)
|
||||
curdiv->space(n);
|
||||
else
|
||||
// The line might have had line spacing that was truncated.
|
||||
truncated_space += n;
|
||||
@ -767,9 +767,10 @@ void space_request()
|
||||
void blank_line()
|
||||
{
|
||||
curenv->do_break();
|
||||
if (!trap_sprung_flag)
|
||||
if (!trap_sprung_flag && !curdiv->no_space_mode) {
|
||||
curdiv->space(curenv->get_vertical_spacing());
|
||||
else
|
||||
curenv->add_html_tag(".sp", 1);
|
||||
} else
|
||||
truncated_space += curenv->get_vertical_spacing();
|
||||
}
|
||||
|
||||
@ -1114,6 +1115,23 @@ void nl_reg::set_value(units n)
|
||||
topdiv->before_first_page = 2;
|
||||
}
|
||||
|
||||
class no_space_mode_reg : public reg {
|
||||
public:
|
||||
int get_value(units *);
|
||||
const char *get_string();
|
||||
};
|
||||
|
||||
int no_space_mode_reg::get_value(units *val)
|
||||
{
|
||||
*val = curdiv->no_space_mode;
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *no_space_mode_reg::get_string()
|
||||
{
|
||||
return curdiv->no_space_mode ? "1" : "0";
|
||||
}
|
||||
|
||||
void init_div_requests()
|
||||
{
|
||||
init_request("wh", when_request);
|
||||
@ -1143,6 +1161,7 @@ void init_div_requests()
|
||||
number_reg_dictionary.define(".z", new diversion_name_reg);
|
||||
number_reg_dictionary.define(".o", new page_offset_reg);
|
||||
number_reg_dictionary.define(".p", new page_length_reg);
|
||||
number_reg_dictionary.define(".ns", new no_space_mode_reg);
|
||||
number_reg_dictionary.define(".d", new vertical_position_reg);
|
||||
number_reg_dictionary.define(".h", new high_water_mark_reg);
|
||||
number_reg_dictionary.define(".t", new distance_to_next_trap_reg);
|
||||
|
@ -33,6 +33,7 @@ class diversion {
|
||||
vunits vertical_position;
|
||||
vunits high_water_mark;
|
||||
public:
|
||||
int no_space_mode;
|
||||
vunits marked_place;
|
||||
diversion(symbol s = NULL_SYMBOL);
|
||||
virtual ~diversion();
|
||||
@ -101,7 +102,6 @@ class top_level_diversion : public diversion {
|
||||
int ejecting_page; // Is the current page being ejected?
|
||||
public:
|
||||
int before_first_page;
|
||||
int no_space_mode;
|
||||
top_level_diversion();
|
||||
void output(node *nd, int retain_size, vunits vs, vunits post_vs,
|
||||
hunits width);
|
||||
|
@ -1117,7 +1117,7 @@ void point_size()
|
||||
void space_size()
|
||||
{
|
||||
int n;
|
||||
if (get_integer(&n) && !compatible_flag) {
|
||||
if (get_integer(&n)) {
|
||||
curenv->space_size = n;
|
||||
if (has_arg() && get_integer(&n))
|
||||
curenv->sentence_space_size = n;
|
||||
@ -2135,7 +2135,7 @@ void environment::add_html_tag_tabs()
|
||||
}
|
||||
}
|
||||
|
||||
void environment::do_break()
|
||||
void environment::do_break(int spread)
|
||||
{
|
||||
if (curdiv == topdiv && topdiv->before_first_page) {
|
||||
topdiv->begin_page();
|
||||
@ -2146,7 +2146,7 @@ void environment::do_break()
|
||||
if (line) {
|
||||
line = new space_node(H0, line); // this is so that hyphenation works
|
||||
space_total++;
|
||||
possibly_break_line();
|
||||
possibly_break_line(0, spread);
|
||||
}
|
||||
while (line != 0 && line->discardable()) {
|
||||
width_total -= line->width();
|
||||
@ -2185,17 +2185,27 @@ int environment::is_empty()
|
||||
return !current_tab && line == 0 && pending_lines == 0;
|
||||
}
|
||||
|
||||
void break_request()
|
||||
void do_break_request(int spread)
|
||||
{
|
||||
while (!tok.newline() && !tok.eof())
|
||||
tok.next();
|
||||
if (break_flag) {
|
||||
curenv->do_break();
|
||||
curenv->do_break(spread);
|
||||
curenv->add_html_tag(".br");
|
||||
}
|
||||
tok.next();
|
||||
}
|
||||
|
||||
void break_request()
|
||||
{
|
||||
do_break_request(0);
|
||||
}
|
||||
|
||||
void break_spread_request()
|
||||
{
|
||||
do_break_request(1);
|
||||
}
|
||||
|
||||
void title()
|
||||
{
|
||||
if (curdiv == topdiv && topdiv->before_first_page) {
|
||||
@ -3014,6 +3024,7 @@ void init_env_requests()
|
||||
init_request("cc", control_char);
|
||||
init_request("c2", no_break_control_char);
|
||||
init_request("br", break_request);
|
||||
init_request("brp", break_spread_request);
|
||||
init_request("tl", title);
|
||||
init_request("ta", set_tabs);
|
||||
init_request("linetabs", line_tabs_request);
|
||||
|
@ -275,7 +275,7 @@ class environment {
|
||||
void interrupt();
|
||||
void spread() { spread_flag = 1; }
|
||||
void possibly_break_line(int start_here = 0, int forced = 0);
|
||||
void do_break(); // .br
|
||||
void do_break(int spread = 0); // .br
|
||||
void final_break();
|
||||
void add_html_tag_eol();
|
||||
void add_html_tag(const char *);
|
||||
@ -345,6 +345,5 @@ void init_environments();
|
||||
void read_hyphen_file(const char *name);
|
||||
|
||||
extern int break_flag;
|
||||
extern int compatible_flag;
|
||||
extern symbol default_family;
|
||||
extern int translate_space_to_dummy;
|
||||
|
@ -73,6 +73,8 @@ extern "C" {
|
||||
// initial size of buffer for reading names; expanded as necessary
|
||||
#define ABUF_SIZE 16
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#ifdef COLUMN
|
||||
void init_column_requests();
|
||||
#endif /* COLUMN */
|
||||
@ -106,7 +108,7 @@ static void disable_warning(const char *);
|
||||
static int escape_char = '\\';
|
||||
static symbol end_macro_name;
|
||||
static symbol blank_line_macro_name;
|
||||
int compatible_flag = 0;
|
||||
static int compatible_flag = 0;
|
||||
int ascii_output_flag = 0;
|
||||
int suppress_output_flag = 0;
|
||||
int is_html = 0;
|
||||
@ -133,6 +135,7 @@ static void interpolate_arg(symbol);
|
||||
static request_or_macro *lookup_request(symbol);
|
||||
static int get_delim_number(units *, int);
|
||||
static int get_delim_number(units *, int, units);
|
||||
static symbol get_delim_file_name();
|
||||
static int get_line_arg(units *res, int si, charinfo **cp);
|
||||
static int read_size(int *);
|
||||
static symbol get_delim_name();
|
||||
@ -206,6 +209,8 @@ private:
|
||||
virtual int internal_level() { return 0; }
|
||||
virtual int is_file() { return 0; }
|
||||
virtual int is_macro() { return 0; }
|
||||
virtual void save_compatible_flag(int) {}
|
||||
virtual int get_compatible_flag() { return 0; }
|
||||
};
|
||||
|
||||
input_iterator::input_iterator()
|
||||
@ -406,6 +411,8 @@ public:
|
||||
static int get_level();
|
||||
static void clear();
|
||||
static void pop_macro();
|
||||
static void save_compatible_flag(int);
|
||||
static int get_compatible_flag();
|
||||
|
||||
static int limit;
|
||||
private:
|
||||
@ -626,6 +633,16 @@ void input_stack::pop_macro()
|
||||
add_return_boundary();
|
||||
}
|
||||
|
||||
inline void input_stack::save_compatible_flag(int f)
|
||||
{
|
||||
top->save_compatible_flag(f);
|
||||
}
|
||||
|
||||
inline int input_stack::get_compatible_flag()
|
||||
{
|
||||
return top->get_compatible_flag();
|
||||
}
|
||||
|
||||
void backtrace_request()
|
||||
{
|
||||
input_stack::backtrace_all();
|
||||
@ -1272,6 +1289,13 @@ void token::next()
|
||||
if (cc != escape_char || escape_char == 0) {
|
||||
handle_normal_char:
|
||||
switch(cc) {
|
||||
case COMPATIBLE_SAVE:
|
||||
input_stack::save_compatible_flag(compatible_flag);
|
||||
compatible_flag = 0;
|
||||
continue;
|
||||
case COMPATIBLE_RESTORE:
|
||||
compatible_flag = input_stack::get_compatible_flag();
|
||||
continue;
|
||||
case EOF:
|
||||
type = TOKEN_EOF;
|
||||
return;
|
||||
@ -2049,14 +2073,14 @@ static void trapping_blank_line()
|
||||
|
||||
void do_request()
|
||||
{
|
||||
int saved_compatible_flag = compatible_flag;
|
||||
int old_compatible_flag = compatible_flag;
|
||||
compatible_flag = 0;
|
||||
symbol nm = get_name();
|
||||
if (nm.is_null())
|
||||
skip_line();
|
||||
else
|
||||
interpolate_macro(nm);
|
||||
compatible_flag = saved_compatible_flag;
|
||||
compatible_flag = old_compatible_flag;
|
||||
}
|
||||
|
||||
inline int possibly_handle_first_page_transition()
|
||||
@ -2701,6 +2725,7 @@ class string_iterator : public input_iterator {
|
||||
char_block *bp;
|
||||
int count; // of characters remaining
|
||||
node *nd;
|
||||
int saved_compatible_flag;
|
||||
protected:
|
||||
symbol nm;
|
||||
string_iterator();
|
||||
@ -2710,6 +2735,8 @@ public:
|
||||
int peek();
|
||||
int get_location(int, const char **, int *);
|
||||
void backtrace();
|
||||
void save_compatible_flag(int f) { saved_compatible_flag = f; }
|
||||
int get_compatible_flag() { return saved_compatible_flag; }
|
||||
};
|
||||
|
||||
string_iterator::string_iterator(const macro &m, const char *p, symbol s)
|
||||
@ -3447,11 +3474,12 @@ void handle_initial_title()
|
||||
static symbol dot_symbol(".");
|
||||
|
||||
enum define_mode { DEFINE_NORMAL, DEFINE_APPEND, DEFINE_IGNORE };
|
||||
enum calling_mode { CALLING_NORMAL, CALLING_INDIRECT, CALLING_DISABLE_COMP };
|
||||
|
||||
void do_define_macro(define_mode mode, int indirect)
|
||||
void do_define_macro(define_mode mode, calling_mode calling)
|
||||
{
|
||||
symbol nm, term;
|
||||
if (indirect) {
|
||||
if (calling == CALLING_INDIRECT) {
|
||||
symbol temp1 = get_name(1);
|
||||
if (temp1.is_null()) {
|
||||
skip_line();
|
||||
@ -3497,6 +3525,8 @@ void do_define_macro(define_mode mode, int indirect)
|
||||
mac = *mm;
|
||||
}
|
||||
int bol = 1;
|
||||
if (calling == CALLING_DISABLE_COMP)
|
||||
mac.append(COMPATIBLE_SAVE);
|
||||
for (;;) {
|
||||
while (c == ESCAPE_NEWLINE) {
|
||||
if (mode == DEFINE_NORMAL || mode == DEFINE_APPEND)
|
||||
@ -3505,7 +3535,7 @@ void do_define_macro(define_mode mode, int indirect)
|
||||
}
|
||||
if (bol && c == '.') {
|
||||
const char *s = term.contents();
|
||||
int d;
|
||||
int d = 0;
|
||||
// see if it matches term
|
||||
int i;
|
||||
for (i = 0; s[i] != 0; i++) {
|
||||
@ -3517,25 +3547,27 @@ void do_define_macro(define_mode mode, int indirect)
|
||||
&& ((i == 2 && compatible_flag)
|
||||
|| (d = get_copy(&n)) == ' '
|
||||
|| d == '\n')) { // we found it
|
||||
if (d == '\n')
|
||||
tok.make_newline();
|
||||
else
|
||||
tok.make_space();
|
||||
if (mode == DEFINE_APPEND || mode == DEFINE_NORMAL) {
|
||||
if (!mm) {
|
||||
mm = new macro;
|
||||
request_dictionary.define(nm, mm);
|
||||
}
|
||||
*mm = mac;
|
||||
}
|
||||
if (term != dot_symbol) {
|
||||
ignoring = 0;
|
||||
interpolate_macro(term);
|
||||
}
|
||||
else
|
||||
skip_line();
|
||||
return;
|
||||
}
|
||||
if (d == '\n')
|
||||
tok.make_newline();
|
||||
else
|
||||
tok.make_space();
|
||||
if (mode == DEFINE_APPEND || mode == DEFINE_NORMAL) {
|
||||
if (!mm) {
|
||||
mm = new macro;
|
||||
request_dictionary.define(nm, mm);
|
||||
}
|
||||
if (calling == CALLING_DISABLE_COMP)
|
||||
mac.append(COMPATIBLE_RESTORE);
|
||||
*mm = mac;
|
||||
}
|
||||
if (term != dot_symbol) {
|
||||
ignoring = 0;
|
||||
interpolate_macro(term);
|
||||
}
|
||||
else
|
||||
skip_line();
|
||||
return;
|
||||
}
|
||||
if (mode == DEFINE_APPEND || mode == DEFINE_NORMAL) {
|
||||
mac.append(c);
|
||||
for (int j = 0; j < i; j++)
|
||||
@ -3575,23 +3607,33 @@ void do_define_macro(define_mode mode, int indirect)
|
||||
|
||||
void define_macro()
|
||||
{
|
||||
do_define_macro(DEFINE_NORMAL, 0);
|
||||
do_define_macro(DEFINE_NORMAL, CALLING_NORMAL);
|
||||
}
|
||||
|
||||
void define_nocomp_macro()
|
||||
{
|
||||
do_define_macro(DEFINE_NORMAL, CALLING_DISABLE_COMP);
|
||||
}
|
||||
|
||||
void define_indirect_macro()
|
||||
{
|
||||
do_define_macro(DEFINE_NORMAL, 1);
|
||||
do_define_macro(DEFINE_NORMAL, CALLING_INDIRECT);
|
||||
}
|
||||
|
||||
void append_macro()
|
||||
{
|
||||
do_define_macro(DEFINE_APPEND, 0);
|
||||
do_define_macro(DEFINE_APPEND, CALLING_NORMAL);
|
||||
}
|
||||
|
||||
void append_nocomp_macro()
|
||||
{
|
||||
do_define_macro(DEFINE_APPEND, CALLING_DISABLE_COMP);
|
||||
}
|
||||
|
||||
void ignore()
|
||||
{
|
||||
ignoring = 1;
|
||||
do_define_macro(DEFINE_IGNORE, 0);
|
||||
do_define_macro(DEFINE_IGNORE, CALLING_NORMAL);
|
||||
ignoring = 0;
|
||||
}
|
||||
|
||||
@ -3954,6 +3996,11 @@ static int read_size(int *x)
|
||||
if (!bad) {
|
||||
switch (inc) {
|
||||
case 0:
|
||||
if (val == 0) {
|
||||
// special case -- \s[0] and \s0 means to revert to previous size
|
||||
*x = 0;
|
||||
return 1;
|
||||
}
|
||||
*x = val;
|
||||
break;
|
||||
case 1:
|
||||
@ -3965,6 +4012,11 @@ static int read_size(int *x)
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
if (*x <= 0) {
|
||||
warning(WARN_RANGE,
|
||||
"\\s request results in non-positive point size; set to 1");
|
||||
*x = 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
@ -4033,6 +4085,65 @@ static symbol get_delim_name()
|
||||
}
|
||||
}
|
||||
|
||||
static symbol get_delim_file_name()
|
||||
{
|
||||
token start;
|
||||
start.next();
|
||||
if (start.eof()) {
|
||||
error("end of input at start of delimited file name");
|
||||
return NULL_SYMBOL;
|
||||
}
|
||||
if (start.newline()) {
|
||||
error("can't delimit file name with a newline");
|
||||
return NULL_SYMBOL;
|
||||
}
|
||||
int start_level = input_stack::get_level();
|
||||
char abuf[ABUF_SIZE];
|
||||
char *buf = abuf;
|
||||
int buf_size = ABUF_SIZE;
|
||||
int i = 0;
|
||||
for (;;) {
|
||||
if (i + 1 > buf_size) {
|
||||
if (buf == abuf) {
|
||||
buf = new char[ABUF_SIZE*2];
|
||||
memcpy(buf, abuf, buf_size);
|
||||
buf_size = ABUF_SIZE*2;
|
||||
}
|
||||
else {
|
||||
char *old_buf = buf;
|
||||
buf = new char[buf_size*2];
|
||||
memcpy(buf, old_buf, buf_size);
|
||||
buf_size *= 2;
|
||||
a_delete old_buf;
|
||||
}
|
||||
}
|
||||
tok.next();
|
||||
if (tok.ch() == ']' && input_stack::get_level() == start_level)
|
||||
break;
|
||||
if ((buf[i] = tok.ch()) == 0) {
|
||||
error("missing delimiter (got %1)", tok.description());
|
||||
if (buf != abuf)
|
||||
a_delete buf;
|
||||
return NULL_SYMBOL;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
buf[i] = '\0';
|
||||
if (buf == abuf) {
|
||||
if (i == 0) {
|
||||
error("empty delimited file name");
|
||||
return NULL_SYMBOL;
|
||||
}
|
||||
else
|
||||
return symbol(buf);
|
||||
}
|
||||
else {
|
||||
symbol s(buf);
|
||||
a_delete buf;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
// Implement \R
|
||||
|
||||
static void do_register()
|
||||
@ -4273,6 +4384,14 @@ node *do_suppress()
|
||||
{
|
||||
tok.next();
|
||||
int c = tok.ch();
|
||||
if (c != '[') {
|
||||
error("argument(s) of \\O must be enclosed in brackets (got %1)",
|
||||
char(c));
|
||||
return 0;
|
||||
}
|
||||
tok.next();
|
||||
c = tok.ch();
|
||||
tok.next();
|
||||
switch (c) {
|
||||
case '0':
|
||||
if (begin_level == 1)
|
||||
@ -4293,7 +4412,12 @@ node *do_suppress()
|
||||
begin_level--;
|
||||
break;
|
||||
case '5': {
|
||||
symbol filename = get_delim_name();
|
||||
symbol filename = get_delim_file_name();
|
||||
tok.next();
|
||||
if (filename.is_null()) {
|
||||
error("missing filename as second argument to \\O");
|
||||
return 0;
|
||||
}
|
||||
if (begin_level == 1)
|
||||
return new suppress_node(filename, 'i');
|
||||
return 0;
|
||||
@ -6034,12 +6158,14 @@ struct string_list {
|
||||
string_list(const char *ss) : s(ss), next(0) {}
|
||||
};
|
||||
|
||||
#if 0
|
||||
static void prepend_string(const char *s, string_list **p)
|
||||
{
|
||||
string_list *l = new string_list(s);
|
||||
l->next = *p;
|
||||
*p = l;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void add_string(const char *s, string_list **p)
|
||||
{
|
||||
@ -6095,7 +6221,6 @@ int main(int argc, char **argv)
|
||||
switch(c) {
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU troff (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
@ -6346,7 +6471,9 @@ void init_input_requests()
|
||||
init_request("as", append_string);
|
||||
init_request("de", define_macro);
|
||||
init_request("dei", define_indirect_macro);
|
||||
init_request("de1", define_nocomp_macro);
|
||||
init_request("am", append_macro);
|
||||
init_request("am1", append_nocomp_macro);
|
||||
init_request("ig", ignore);
|
||||
init_request("rm", remove_macro);
|
||||
init_request("rn", rename_macro);
|
||||
@ -6638,7 +6765,7 @@ static struct {
|
||||
|
||||
static int lookup_warning(const char *name)
|
||||
{
|
||||
for (int i = 0;
|
||||
for (unsigned int i = 0;
|
||||
i < sizeof(warning_table)/sizeof(warning_table[0]);
|
||||
i++)
|
||||
if (strcmp(name, warning_table[i].name) == 0)
|
||||
|
@ -54,6 +54,8 @@ const int LAST_PAGE_EJECTOR = 0205;
|
||||
const int ESCAPE_RIGHT_PARENTHESIS = 0206;
|
||||
const int ESCAPE_TILDE = 0207;
|
||||
const int ESCAPE_COLON = 0210;
|
||||
const int COMPATIBLE_SAVE = 0211;
|
||||
const int COMPATIBLE_RESTORE = 0212;
|
||||
|
||||
#else /* IS_EBCDIC_HOST */
|
||||
|
||||
@ -88,5 +90,7 @@ const int LAST_PAGE_EJECTOR = 065;
|
||||
const int ESCAPE_RIGHT_PARENTHESIS = 066;
|
||||
const int ESCAPE_TILDE = 067;
|
||||
const int ESCAPE_COLON = 070;
|
||||
const int COMPATIBLE_SAVE = 071;
|
||||
const int COMPATIBLE_RESTORE = 072;
|
||||
|
||||
#endif /* IS_EBCDIC_HOST */
|
||||
|
@ -181,9 +181,9 @@ class space_node : public node {
|
||||
};
|
||||
|
||||
struct width_list {
|
||||
width_list *next;
|
||||
hunits width;
|
||||
hunits sentence_width;
|
||||
width_list *next;
|
||||
width_list(hunits, hunits);
|
||||
width_list(width_list *);
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by James Clark (jjc@jclark.com)
|
||||
|
||||
This file is part of groff.
|
||||
@ -87,7 +88,7 @@ static const char *number_value_to_ascii(int value, char format, int width)
|
||||
case '1':
|
||||
if (width <= 0)
|
||||
return i_to_a(value);
|
||||
else if (width > sizeof(buf) - 2)
|
||||
else if (width > int(sizeof(buf) - 2))
|
||||
sprintf(buf, "%.*d", int(sizeof(buf) - 2), int(value));
|
||||
else
|
||||
sprintf(buf, "%.*d", width, int(value));
|
||||
|
@ -72,7 +72,7 @@ class token {
|
||||
int space(); // is the current token a space?
|
||||
int stretchable_space(); // is the current token a stretchable space?
|
||||
int white_space(); // is the current token space or tab?
|
||||
int special(); // is the current token a special character?
|
||||
int special(); // is the current token a special character?
|
||||
int newline(); // is the current token a newline?
|
||||
int tab(); // is the current token a tab?
|
||||
int leader();
|
||||
|
@ -1,4 +1,4 @@
|
||||
.ig \"-*- nroff -*-
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
@ -739,6 +739,12 @@ requests only create a new object if the name of the macro, diversion
|
||||
or string diversion is currently undefined or if it is defined to be a
|
||||
request; normally they modify the value of an existing object.
|
||||
.TP
|
||||
.BI .am1\ xx\ yy
|
||||
Similar to
|
||||
.BR .am ,
|
||||
but compatibility mode is switched off during execution.
|
||||
On entry, the current compatibility mode is saved and restored at exit.
|
||||
.TP
|
||||
.BI .asciify\ xx
|
||||
This request `unformats' the diversion
|
||||
.I xx
|
||||
@ -810,6 +816,10 @@ Be sure not to confuse this with the
|
||||
.B br
|
||||
request.
|
||||
.TP
|
||||
.B .brp
|
||||
This is the same as
|
||||
.BR \ep .
|
||||
.TP
|
||||
.BI .cflags\ n\ c1\ c2\|.\|.\|.
|
||||
Characters
|
||||
.IR c1 ,
|
||||
@ -966,6 +976,12 @@ is equivalent to
|
||||
\&.de aa bb
|
||||
.RE
|
||||
.TP
|
||||
.BI .de1\ xx\ yy
|
||||
Similar to
|
||||
.BR .de ,
|
||||
but compatibility mode is switched off during execution.
|
||||
On entry, the current compatibility mode is saved and restored at exit.
|
||||
.TP
|
||||
.BI .do\ xxx
|
||||
Interpret
|
||||
.I .xxx
|
||||
@ -1709,8 +1725,7 @@ one twelfth of the spacewidth parameter for the current font.
|
||||
Initially both the word space size and the sentence
|
||||
space size are 12.
|
||||
Contrary to UNIX troff, GNU troff handles this request in nroff mode
|
||||
also (if not in compatibility mode); a given value is then rounded down
|
||||
to the nearest multiple of\~12.
|
||||
also; a given value is then rounded down to the nearest multiple of\~12.
|
||||
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;
|
||||
@ -1857,6 +1872,12 @@ Useful in conjunction with the
|
||||
.B \en[.trunc]
|
||||
register.
|
||||
.TP
|
||||
.B \en[.ns]
|
||||
.B 1
|
||||
if no-space mode is active,
|
||||
.B 0
|
||||
otherwise.
|
||||
.TP
|
||||
.B \en[.pn]
|
||||
The number of the next page:
|
||||
either the value set by a
|
||||
@ -2445,6 +2466,10 @@ necessary.
|
||||
.SH "SEE ALSO"
|
||||
.
|
||||
.
|
||||
.BR groff (@MAN7EXT@)
|
||||
-- This is a short but complete reference of all requests, registers, and
|
||||
escapes.
|
||||
.PP
|
||||
.BR groff (@MAN1EXT@),
|
||||
.BR @g@tbl (@MAN1EXT@),
|
||||
.BR @g@pic (@MAN1EXT@),
|
||||
@ -2460,3 +2485,7 @@ necessary.
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR groff_out (@MAN5EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -31,6 +31,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "cset.h"
|
||||
#include "guess.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static void usage(FILE *stream);
|
||||
static void usage();
|
||||
static void version();
|
||||
@ -67,7 +69,8 @@ static struct {
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
program_name = argv[0];
|
||||
for (int i = 1; i < argc; i++) {
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-v") || !strcmp(argv[i],"--version"))
|
||||
version();
|
||||
if (!strcmp(argv[i],"--help")) {
|
||||
@ -99,7 +102,6 @@ int main(int argc, char **argv)
|
||||
param.comma_depth = DEFAULT_COMMA_DEPTH;
|
||||
param.desc_depth = DEFAULT_DESC_DEPTH;
|
||||
param.body_depth = DEFAULT_BODY_DEPTH;
|
||||
int i;
|
||||
for (i = 1; i < argc && argv[i][0] == '-'; i++) {
|
||||
if (argv[i][1] == '-' && argv[i][2] == '\0') {
|
||||
i++;
|
||||
@ -107,7 +109,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
if (i + 1 >= argc)
|
||||
usage();
|
||||
int j;
|
||||
size_t j;
|
||||
for (j = 0;; j++) {
|
||||
if (j >= sizeof(param_table)/sizeof(param_table[0]))
|
||||
fatal("parameter `%1' not recognized", argv[i] + 1);
|
||||
@ -142,7 +144,6 @@ static void usage()
|
||||
|
||||
static void version()
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU addftinfo (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -105,3 +105,7 @@ a Times font.
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR groff (@MAN1EXT@),
|
||||
.BR groff_char (@MAN7EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -223,3 +223,7 @@ Standard mapping.
|
||||
.BR grops (@MAN1EXT@),
|
||||
.BR groff_font (@MAN5EXT@),
|
||||
.BR perl (1)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -25,7 +25,7 @@ $prog =~ s@.*/@@;
|
||||
do 'getopts.pl';
|
||||
do Getopts('ve:sd:i:a:n');
|
||||
|
||||
if (opt_v) {
|
||||
if ($opt_v) {
|
||||
print "GNU afmtodit (groff) version @VERSION@\n";
|
||||
exit 0;
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ put filename in error messages (or fix lib)
|
||||
#include "cset.h"
|
||||
#include "nonposix.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
|
||||
|
||||
const int MULTIPLIER = 3;
|
||||
@ -163,10 +165,10 @@ entry tags[max_tag + 1 - min_tag];
|
||||
char_info *char_table;
|
||||
uint32 nchars;
|
||||
|
||||
int msl_name_table_size = 0;
|
||||
unsigned int msl_name_table_size = 0;
|
||||
name_list **msl_name_table = 0;
|
||||
|
||||
int n_symbol_sets;
|
||||
unsigned int n_symbol_sets;
|
||||
symbol_set *symbol_set_table;
|
||||
|
||||
static int special_flag = 0;
|
||||
@ -226,7 +228,6 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU hpftodit (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
}
|
||||
@ -337,7 +338,7 @@ void File::skip(int n)
|
||||
|
||||
void File::seek(uint32 n)
|
||||
{
|
||||
if (end_ - buf_ < n)
|
||||
if ((uint32)(end_ - buf_) < n)
|
||||
fatal("unexpected end of file");
|
||||
ptr_ = buf_ + n;
|
||||
}
|
||||
@ -437,7 +438,7 @@ void read_symbol_sets(File &f)
|
||||
uint32 symbol_set_dir_length = tag_info(symbol_set_tag).count;
|
||||
n_symbol_sets = symbol_set_dir_length/14;
|
||||
symbol_set_table = new symbol_set[n_symbol_sets];
|
||||
int i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < n_symbol_sets; i++) {
|
||||
f.seek(tag_info(symbol_set_tag).value + i*14);
|
||||
(void)f.get_uint32();
|
||||
@ -445,7 +446,7 @@ void read_symbol_sets(File &f)
|
||||
uint32 off2 = f.get_uint32();
|
||||
(void)f.get_uint16(); // what's this for?
|
||||
f.seek(off1);
|
||||
int j;
|
||||
unsigned int j;
|
||||
uint16 kind = 0;
|
||||
for (j = 0; j < off2 - off1; j++) {
|
||||
unsigned char c = f.get_byte();
|
||||
@ -465,7 +466,7 @@ void read_symbol_sets(File &f)
|
||||
? special_symbol_sets
|
||||
: text_symbol_sets);
|
||||
for (i = 0; symbol_set_selectors[i] != 0; i++) {
|
||||
int j;
|
||||
unsigned int j;
|
||||
for (j = 0; j < n_symbol_sets; j++)
|
||||
if (symbol_set_table[j].select == symbol_set_selectors[i])
|
||||
break;
|
||||
@ -610,13 +611,13 @@ void output_ligatures()
|
||||
};
|
||||
|
||||
unsigned ligature_mask = 0;
|
||||
int i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < nchars; i++) {
|
||||
uint16 msl = char_table[i].msl;
|
||||
if (msl < msl_name_table_size
|
||||
&& char_table[i].symbol_set != NO_SYMBOL_SET) {
|
||||
for (name_list *p = msl_name_table[msl]; p; p = p->next)
|
||||
for (int j = 0; j < SIZEOF(ligature_chars); j++)
|
||||
for (unsigned int j = 0; j < SIZEOF(ligature_chars); j++)
|
||||
if (strcmp(p->name, ligature_chars[j]) == 0) {
|
||||
ligature_mask |= 1 << j;
|
||||
break;
|
||||
@ -671,7 +672,7 @@ void output_charset()
|
||||
require_tag(lower_descent_tag);
|
||||
|
||||
printf("charset\n");
|
||||
int i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < nchars; i++) {
|
||||
uint16 msl = char_table[i].msl;
|
||||
if (msl < msl_name_table_size
|
||||
@ -782,7 +783,7 @@ int read_map(const char *file)
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
if (n >= msl_name_table_size) {
|
||||
if ((size_t)n >= msl_name_table_size) {
|
||||
size_t old_size = msl_name_table_size;
|
||||
name_list **old_table = msl_name_table;
|
||||
msl_name_table_size = n + 256;
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1994-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1994-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -153,3 +153,7 @@ TrueType tfm files are not supported.
|
||||
.BR groff (@MAN1EXT@),
|
||||
.BR grolj4 (@MAN1EXT@),
|
||||
.BR groff_font (@MAN5EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -4,12 +4,10 @@ XLIBS=$(LIBBIB) $(LIBGROFF)
|
||||
MLIB=$(LIBM)
|
||||
OBJS=\
|
||||
indxbib.o \
|
||||
dirnamemax.o \
|
||||
signal.o
|
||||
CCSRCS=\
|
||||
$(srcdir)/indxbib.cc
|
||||
CSRCS=\
|
||||
$(srcdir)/dirnamemax.c \
|
||||
$(srcdir)/signal.c
|
||||
NAMEPREFIX=$(g)
|
||||
|
||||
|
@ -37,12 +37,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "nonposix.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
#ifndef HAVE_MKSTEMP_PROTO
|
||||
extern "C" {
|
||||
// Solaris 2.5.1 has these functions,
|
||||
// but its stdlib.h fails to declare them.
|
||||
char *mktemp(char *);
|
||||
int mkstemp(char *);
|
||||
extern int mkstemp(char *);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DEFAULT_HASH_TABLE_SIZE 997
|
||||
#define TEMP_INDEX_TEMPLATE "indxbibXXXXXX"
|
||||
@ -114,7 +115,6 @@ static char *get_cwd();
|
||||
|
||||
extern "C" {
|
||||
void cleanup();
|
||||
long dir_name_max(const char *);
|
||||
void catch_fatal_signals();
|
||||
void ignore_fatal_signals();
|
||||
}
|
||||
@ -179,12 +179,9 @@ int main(int argc, char **argv)
|
||||
parser = do_whole_file;
|
||||
break;
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU indxbib (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
printf("GNU indxbib (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
case CHAR_MAX + 1: // --help
|
||||
usage(stdout);
|
||||
exit(0);
|
||||
@ -215,24 +212,24 @@ int main(int argc, char **argv)
|
||||
basename = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME;
|
||||
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;
|
||||
while (*sep) {
|
||||
p1 = strrchr(basename, *sep);
|
||||
if (p1 && (!p || p1 > p))
|
||||
p = p1;
|
||||
sep++;
|
||||
}
|
||||
size_t name_max;
|
||||
if (p) {
|
||||
char *dir = strsave(basename);
|
||||
dir[p - basename] = '\0';
|
||||
name_max = dir_name_max(dir);
|
||||
name_max = file_name_max(dir);
|
||||
a_delete dir;
|
||||
}
|
||||
else
|
||||
name_max = dir_name_max(".");
|
||||
name_max = file_name_max(".");
|
||||
const char *filename = p ? p + 1 : basename;
|
||||
if (name_max >= 0 && strlen(filename) + sizeof(INDEX_SUFFIX) - 1 > name_max)
|
||||
if (name_max >= 0 &&
|
||||
long(strlen(filename) + sizeof(INDEX_SUFFIX) - 1) > name_max)
|
||||
fatal("`%1.%2' is too long for a filename", filename, INDEX_SUFFIX);
|
||||
if (p) {
|
||||
p++;
|
||||
@ -303,23 +300,22 @@ int main(int argc, char **argv)
|
||||
strcpy(index_file, basename);
|
||||
strcat(index_file, INDEX_SUFFIX);
|
||||
#ifdef HAVE_RENAME
|
||||
if (rename(temp_index_file, index_file) < 0)
|
||||
{
|
||||
if (rename(temp_index_file, index_file) < 0) {
|
||||
#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;
|
||||
// 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)
|
||||
// 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));
|
||||
}
|
||||
fatal("can't rename temporary index file: %1", strerror(errno));
|
||||
}
|
||||
#else /* not HAVE_RENAME */
|
||||
ignore_fatal_signals();
|
||||
if (unlink(index_file) < 0) {
|
||||
@ -502,7 +498,7 @@ static int do_file(const char *filename)
|
||||
// every CR character before a Newline.
|
||||
if (c == '\r') {
|
||||
int peek = getc(fp);
|
||||
if (peek = '\n') {
|
||||
if (peek == '\n') {
|
||||
byte_count++;
|
||||
c = peek;
|
||||
}
|
||||
@ -784,7 +780,7 @@ static void write_hash_table()
|
||||
|
||||
static void fwrite_or_die(const void *ptr, int size, int nitems, FILE *fp)
|
||||
{
|
||||
if (fwrite(ptr, size, nitems, fp) != nitems)
|
||||
if (fwrite(ptr, size, nitems, fp) != (size_t)nitems)
|
||||
fatal("fwrite failed: %1", strerror(errno));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
.ig \"-*- nroff -*-
|
||||
Copyright (C) 1989-2000 Free Software Foundation, Inc.
|
||||
.ig
|
||||
Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@ -205,3 +205,7 @@ Temporary file.
|
||||
.BR @g@refer (@MAN1EXT@),
|
||||
.BR lkbib (@MAN1EXT@),
|
||||
.BR @g@lookbib (@MAN1EXT@)
|
||||
.
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
|
@ -18,8 +18,8 @@ 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. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
@ -32,6 +32,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "refid.h"
|
||||
#include "search.h"
|
||||
|
||||
extern "C" const char *Version_string;
|
||||
|
||||
static void usage(FILE *stream)
|
||||
{
|
||||
fprintf(stream, "usage: %s [-nv] [-p database] [-i XYZ] [-t N] keys ...\n",
|
||||
@ -78,7 +80,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
case 'v':
|
||||
{
|
||||
extern const char *Version_string;
|
||||
printf("GNU lkbib (groff) version %s\n", Version_string);
|
||||
exit(0);
|
||||
break;
|
||||
@ -126,7 +127,7 @@ int main(int argc, char **argv)
|
||||
int len;
|
||||
int count;
|
||||
for (count = 0; iter.next(&start, &len); count++) {
|
||||
if (fwrite(start, 1, len, stdout) != len)
|
||||
if (fwrite(start, 1, len, stdout) != (size_t)len)
|
||||
fatal("write error on stdout: %1", strerror(errno));
|
||||
// Can happen for last reference in file.
|
||||
if (start[len - 1] != '\n')
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user