aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.3
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-23 11:25:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-23 11:25:25 +0000
commit6a81c8460007e1d52bf6aab06460b9ce75c1ae4b (patch)
tree5a3bfa345c1f70d7d3c6ad760fe291cc75bd6730 /mandoc.3
parent4f632f9feb86ec93aaa9cd7d8ee145bf5788b13c (diff)
downloadmandoc-6a81c8460007e1d52bf6aab06460b9ce75c1ae4b.tar.gz
mandoc-6a81c8460007e1d52bf6aab06460b9ce75c1ae4b.tar.zst
mandoc-6a81c8460007e1d52bf6aab06460b9ce75c1ae4b.zip
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.
Diffstat (limited to 'mandoc.3')
-rw-r--r--mandoc.384
1 files changed, 57 insertions, 27 deletions
diff --git a/mandoc.3 b/mandoc.3
index db763749..2e6b78b9 100644
--- a/mandoc.3
+++ b/mandoc.3
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.3,v 1.23 2014/01/05 20:26:36 schwarze Exp $
+.\" $Id: mandoc.3,v 1.24 2014/03/23 11:25:26 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,12 +15,17 @@
.\" 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 5 2014 $
+.Dd $Mdocdate: March 23 2014 $
.Dt MANDOC 3
.Os
.Sh NAME
.Nm mandoc ,
+.Nm mandoc_calloc ,
.Nm mandoc_escape ,
+.Nm mandoc_malloc ,
+.Nm mandoc_realloc ,
+.Nm mandoc_strdup ,
+.Nm mandoc_strndup ,
.Nm man_meta ,
.Nm man_mparse ,
.Nm man_node ,
@@ -45,28 +50,30 @@
.Sh LIBRARY
.Lb libmandoc
.Sh SYNOPSIS
-.In man.h
-.In mdoc.h
.In mandoc.h
+.Fd "#define ASCII_NBRSP"
+.Fd "#define ASCII_HYPH"
+.Fd "#define ASCII_BREAK"
+.Ft "void *"
+.Fo mandoc_calloc
+.Fa "size_t nmemb"
+.Fa "size_t size"
+.Fc
.Ft "enum mandoc_esc"
.Fo mandoc_escape
.Fa "const char **end"
.Fa "const char **start"
.Fa "int *sz"
.Fc
-.Ft "const struct man_meta *"
-.Fo man_meta
-.Fa "const struct man *man"
-.Fc
-.Ft "const struct mparse *"
-.Fo man_mparse
-.Fa "const struct man *man"
-.Fc
-.Ft "const struct man_node *"
-.Fo man_node
-.Fa "const struct man *man"
-.Fc
+.Ft "void *"
+.Fn mandoc_malloc "size_t size"
.Ft "struct mchars *"
+.Fo mandoc_realloc
+.Fa "void *ptr"
+.Fa "size_t size"
+.Fc
+.Ft "char *"
+.Fn mandoc_strdup
.Fn mchars_alloc "void"
.Ft void
.Fn mchars_free "struct mchars *p"
@@ -87,14 +94,6 @@
.Fa "const char *cp"
.Fa "size_t sz"
.Fc
-.Ft "const struct mdoc_meta *"
-.Fo mdoc_meta
-.Fa "const struct mdoc *mdoc"
-.Fc
-.Ft "const struct mdoc_node *"
-.Fo mdoc_node
-.Fa "const struct mdoc *mdoc"
-.Fc
.Ft void
.Fo mparse_alloc
.Fa "enum mparset inttype"
@@ -104,6 +103,15 @@
.Fa "int quick"
.Fc
.Ft void
+.Fo (*mandocmsg)
+.Fa "enum mandocerr errtype"
+.Fa "enum mandoclevel level"
+.Fa "const char *file"
+.Fa "int line"
+.Fa "int col"
+.Fa "const char *msg"
+.Fc
+.Ft void
.Fo mparse_free
.Fa "struct mparse *parse"
.Fc
@@ -139,11 +147,33 @@
.Fo mparse_strlevel
.Fa "enum mandoclevel"
.Fc
-.Vt extern const char * const * man_macronames;
+.In mandoc.h
+.In mdoc.h
+.Ft "const struct mdoc_meta *"
+.Fo mdoc_meta
+.Fa "const struct mdoc *mdoc"
+.Fc
+.Ft "const struct mdoc_node *"
+.Fo mdoc_node
+.Fa "const struct mdoc *mdoc"
+.Fc
.Vt extern const char * const * mdoc_argnames;
.Vt extern const char * const * mdoc_macronames;
-.Fd "#define ASCII_NBRSP"
-.Fd "#define ASCII_HYPH"
+.In mandoc.h
+.In man.h
+.Ft "const struct man_meta *"
+.Fo man_meta
+.Fa "const struct man *man"
+.Fc
+.Ft "const struct mparse *"
+.Fo man_mparse
+.Fa "const struct man *man"
+.Fc
+.Ft "const struct man_node *"
+.Fo man_node
+.Fa "const struct man *man"
+.Fc
+.Vt extern const char * const * man_macronames;
.Sh DESCRIPTION
The
.Nm mandoc