aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.3
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-07-19 06:05:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-07-19 06:05:16 +0000
commitf0143f309111bca83659f897fa5c7c42548890ed (patch)
treea4e4f250b02548ce4781417e928a293aee002be7 /mandoc.3
parent0c627ea8c3cc862ae75011fd19486724efdf240b (diff)
downloadmandoc-f0143f309111bca83659f897fa5c7c42548890ed.tar.gz
mandoc-f0143f309111bca83659f897fa5c7c42548890ed.tar.zst
mandoc-f0143f309111bca83659f897fa5c7c42548890ed.zip
Do not fork and exec gunzip(1), just link with libz instead.
As discussed with deraadt@, that's cleaner and will help tame(2). Something like this was also suggested earlier by bapt at FreeBSD. Minus 50 lines of code, deleting one interface function (mparse_wait), no functional change intended.
Diffstat (limited to 'mandoc.3')
-rw-r--r--mandoc.354
1 files changed, 9 insertions, 45 deletions
diff --git a/mandoc.3 b/mandoc.3
index a41e25b9..15b47067 100644
--- a/mandoc.3
+++ b/mandoc.3
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.3,v 1.31 2015/01/15 04:26:40 schwarze Exp $
+.\" $Id: mandoc.3,v 1.32 2015/07/19 06:05:16 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 15 2015 $
+.Dd $Mdocdate: July 19 2015 $
.Dt MANDOC 3
.Os
.Sh NAME
@@ -37,7 +37,6 @@
.Nm mparse_result ,
.Nm mparse_strerror ,
.Nm mparse_strlevel
-.Nm mparse_wait ,
.Nd mandoc macro compiler library
.Sh SYNOPSIS
.In sys/types.h
@@ -106,10 +105,6 @@
.Fo mparse_strlevel
.Fa "enum mandoclevel"
.Fc
-.Ft "enum mandoclevel"
-.Fo mparse_wait
-.Fa "struct mparse *parse"
-.Fc
.In sys/types.h
.In mandoc.h
.In mdoc.h
@@ -392,20 +387,14 @@ Declared in
implemented in
.Pa read.c .
.It Fn mparse_open
-If the
+Open the file for reading.
+If that fails and
.Fa fname
-ends in
-.Pa .gz ,
-open with
-.Xr gunzip 1 ;
-otherwise, with
-.Xr open 2 .
-If
-.Xr open 2
-fails, append
-.Pa .gz
-and try with
-.Xr gunzip 1 .
+does not already end in
+.Ql .gz ,
+try again after appending
+.Ql .gz .
+Save the information whether the file is zipped or not.
Return a file descriptor open for reading in
.Fa fd ,
or -1 on failure.
@@ -423,9 +412,6 @@ or
.Fn mparse_open .
Pass the associated filename in
.Va fname .
-Calls
-.Fn mparse_wait
-before returning.
This function may be called multiple times with different parameters; however,
.Fn mparse_reset
should be invoked between parses.
@@ -460,28 +446,6 @@ Declared in
.In mandoc.h ,
implemented in
.Pa read.c .
-.It Fn mparse_wait
-Bury a
-.Xr gunzip 1
-child process that was spawned with
-.Fn mparse_open .
-To be called after the parse sequence is complete.
-Not needed after
-.Fn mparse_readfd ,
-but does no harm in that case, either.
-Returns
-.Dv MANDOCLEVEL_OK
-on success and
-.Dv MANDOCLEVEL_SYSERR
-on failure, that is, when
-.Xr wait 2
-fails, or when
-.Xr gunzip 1
-died from a signal or exited with non-zero status.
-Declared in
-.In mandoc.h ,
-implemented in
-.Pa read.c .
.El
.Ss Variables
.Bl -ohang