History log of /openbsd-current/usr.bin/mandoc/st.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.15 16-Jun-2024 job

Add new argument for IEEE 1003.1-2024 aka POSIX.1

OK jmc@ schwarze@


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.14 13-Jan-2022 schwarze

Tedu support for the -xsh4.2 argument to the mdoc(7) .St macro
because all of the following hold:
* It is an alias for a part of an ancient standard that is no longer important.
* To refer to that old standard, -xpg4.2 is readily available and portable.
* It is unused in OpenBSD, FreeBSD, and NetBSD.
* Groff never supported it.

I agreed with G. Branden Robinson that deleting this from mandoc
is preferable to adding it to groff.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.13 14-Dec-2018 schwarze

Major cleanup; may imply minor changes in edge cases of error reporting.

Finally, drop support for the run-time configurable mandocmsg()
callback. It was over-engineered from the start, never used for
anything in a decade, and repeatedly caused maintenance headaches.

Consolidate reporting infrastructure into two files, mandoc.h and
mandoc_msg.c, mopping up the bits and pieces that were scattered
around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes
of four parsing-related functions, and both parser structs.


# 1.12 13-Dec-2018 schwarze

Cleanup, no functional change:
Finally merge the pointless file st.in into st.c.
Nobody should do operating systems dependent changes to standards:
By definition, standards are the same for every operating system.
While here, libmdoc.h no longer requires mdoc.h.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.11 24-Jun-2017 schwarze

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system. Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.10 06-Oct-2015 schwarze

modernize style: "return" is not a function; ok cmp(1)


Revision tags: OPENBSD_5_8_BASE
# 1.9 02-Apr-2015 schwarze

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.


Revision tags: OPENBSD_5_7_BASE
# 1.8 28-Nov-2014 schwarze

Add some missing OpenBSD RCS markers
and a few missing <sys/types.h> inclusions; no code change.


Revision tags: OPENBSD_5_6_BASE
# 1.7 21-Mar-2014 schwarze

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.6 24-Apr-2011 schwarze

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.5 31-Jul-2010 schwarze

Correct Copyright lines in the rarely touched files:
* add missing years (only where substantial changes were committed)
* update Kristaps' email address in the remaining places
No code changes.


# 1.4 23-May-2010 schwarze

Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
probably lose information or produce structurally garbled output;
it will try to produce output anyway but exit non-zero at the end,
which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.

In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)

While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column

Written by kristaps@.


Revision tags: OPENBSD_4_7_BASE
# 1.3 22-Dec-2009 schwarze

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/


Revision tags: OPENBSD_4_6_BASE
# 1.2 14-Jun-2009 schwarze

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change


# 1.1 06-Apr-2009 kristaps

Initial check-in of mandoc for formatting manuals. ok deraadt@


# 1.14 13-Jan-2022 schwarze

Tedu support for the -xsh4.2 argument to the mdoc(7) .St macro
because all of the following hold:
* It is an alias for a part of an ancient standard that is no longer important.
* To refer to that old standard, -xpg4.2 is readily available and portable.
* It is unused in OpenBSD, FreeBSD, and NetBSD.
* Groff never supported it.

I agreed with G. Branden Robinson that deleting this from mandoc
is preferable to adding it to groff.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.13 14-Dec-2018 schwarze

Major cleanup; may imply minor changes in edge cases of error reporting.

Finally, drop support for the run-time configurable mandocmsg()
callback. It was over-engineered from the start, never used for
anything in a decade, and repeatedly caused maintenance headaches.

Consolidate reporting infrastructure into two files, mandoc.h and
mandoc_msg.c, mopping up the bits and pieces that were scattered
around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes
of four parsing-related functions, and both parser structs.


# 1.12 13-Dec-2018 schwarze

Cleanup, no functional change:
Finally merge the pointless file st.in into st.c.
Nobody should do operating systems dependent changes to standards:
By definition, standards are the same for every operating system.
While here, libmdoc.h no longer requires mdoc.h.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.11 24-Jun-2017 schwarze

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system. Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.10 06-Oct-2015 schwarze

modernize style: "return" is not a function; ok cmp(1)


Revision tags: OPENBSD_5_8_BASE
# 1.9 02-Apr-2015 schwarze

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.


Revision tags: OPENBSD_5_7_BASE
# 1.8 28-Nov-2014 schwarze

Add some missing OpenBSD RCS markers
and a few missing <sys/types.h> inclusions; no code change.


Revision tags: OPENBSD_5_6_BASE
# 1.7 21-Mar-2014 schwarze

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.6 24-Apr-2011 schwarze

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.5 31-Jul-2010 schwarze

Correct Copyright lines in the rarely touched files:
* add missing years (only where substantial changes were committed)
* update Kristaps' email address in the remaining places
No code changes.


# 1.4 23-May-2010 schwarze

Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
probably lose information or produce structurally garbled output;
it will try to produce output anyway but exit non-zero at the end,
which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.

In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)

While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column

Written by kristaps@.


Revision tags: OPENBSD_4_7_BASE
# 1.3 22-Dec-2009 schwarze

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/


Revision tags: OPENBSD_4_6_BASE
# 1.2 14-Jun-2009 schwarze

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change


# 1.1 06-Apr-2009 kristaps

Initial check-in of mandoc for formatting manuals. ok deraadt@


# 1.13 14-Dec-2018 schwarze

Major cleanup; may imply minor changes in edge cases of error reporting.

Finally, drop support for the run-time configurable mandocmsg()
callback. It was over-engineered from the start, never used for
anything in a decade, and repeatedly caused maintenance headaches.

Consolidate reporting infrastructure into two files, mandoc.h and
mandoc_msg.c, mopping up the bits and pieces that were scattered
around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes
of four parsing-related functions, and both parser structs.


# 1.12 13-Dec-2018 schwarze

Cleanup, no functional change:
Finally merge the pointless file st.in into st.c.
Nobody should do operating systems dependent changes to standards:
By definition, standards are the same for every operating system.
While here, libmdoc.h no longer requires mdoc.h.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.11 24-Jun-2017 schwarze

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system. Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.10 06-Oct-2015 schwarze

modernize style: "return" is not a function; ok cmp(1)


Revision tags: OPENBSD_5_8_BASE
# 1.9 02-Apr-2015 schwarze

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.


Revision tags: OPENBSD_5_7_BASE
# 1.8 28-Nov-2014 schwarze

Add some missing OpenBSD RCS markers
and a few missing <sys/types.h> inclusions; no code change.


Revision tags: OPENBSD_5_6_BASE
# 1.7 21-Mar-2014 schwarze

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.6 24-Apr-2011 schwarze

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.5 31-Jul-2010 schwarze

Correct Copyright lines in the rarely touched files:
* add missing years (only where substantial changes were committed)
* update Kristaps' email address in the remaining places
No code changes.


# 1.4 23-May-2010 schwarze

Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
probably lose information or produce structurally garbled output;
it will try to produce output anyway but exit non-zero at the end,
which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.

In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)

While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column

Written by kristaps@.


Revision tags: OPENBSD_4_7_BASE
# 1.3 22-Dec-2009 schwarze

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/


Revision tags: OPENBSD_4_6_BASE
# 1.2 14-Jun-2009 schwarze

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change


# 1.1 06-Apr-2009 kristaps

Initial check-in of mandoc for formatting manuals. ok deraadt@


Revision tags: OPENBSD_6_2_BASE
# 1.11 24-Jun-2017 schwarze

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system. Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.10 06-Oct-2015 schwarze

modernize style: "return" is not a function; ok cmp(1)


Revision tags: OPENBSD_5_8_BASE
# 1.9 02-Apr-2015 schwarze

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.


Revision tags: OPENBSD_5_7_BASE
# 1.8 28-Nov-2014 schwarze

Add some missing OpenBSD RCS markers
and a few missing <sys/types.h> inclusions; no code change.


Revision tags: OPENBSD_5_6_BASE
# 1.7 21-Mar-2014 schwarze

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.6 24-Apr-2011 schwarze

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.5 31-Jul-2010 schwarze

Correct Copyright lines in the rarely touched files:
* add missing years (only where substantial changes were committed)
* update Kristaps' email address in the remaining places
No code changes.


# 1.4 23-May-2010 schwarze

Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
probably lose information or produce structurally garbled output;
it will try to produce output anyway but exit non-zero at the end,
which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.

In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)

While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column

Written by kristaps@.


Revision tags: OPENBSD_4_7_BASE
# 1.3 22-Dec-2009 schwarze

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/


Revision tags: OPENBSD_4_6_BASE
# 1.2 14-Jun-2009 schwarze

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change


# 1.1 06-Apr-2009 kristaps

Initial check-in of mandoc for formatting manuals. ok deraadt@