summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.3
blob: 0df0188aab37f308b1e4c30ade1ed09f73567188 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.\" 
.Dd $Mdocdate: January 16 2009 $
.Dt mdoc 3
.Os
.\"
.Sh NAME
.Nm mdoc_alloc ,
.Nm mdoc_parseln ,
.Nm mdoc_endparse ,
.Nm mdoc_result ,
.Nm mdoc_free
.Nd mdoc macro compiler
.\"
.Sh SYNOPSIS
.In mdoc.h
.Ft "struct mdoc *"
.Fn mdoc_alloc "void *data" "const struct mdoc_cb *cb"
.Ft void
.Fn mdoc_free "struct mdoc *"
.Ft int
.Fn mdoc_parseln "struct mdoc *" "int" "char *buf"
.Ft "const struct mdoc_node *"
.Fn mdoc_result "struct mdoc *"
.Ft int
.Fn mdoc_endparse "struct mdoc *"
.\"
.Sh DESCRIPTION
The
.Nm mdoc
library parses lines of mdoc-macro text into an abstract syntax tree.
In general, applications initiate a parsing sequence with
.Fn mdoc_alloc ,
parse each line in a document with 
.Fn mdoc_parseln ,
close the parsing session with
.Fn mdoc_endparse ,
operate over the syntax tree returned by
.Fn mdoc_result ,
then free all allocated memory with
.Fn mdoc_free .
See the
.Sx EXAMPLES
section for a full example.
.\" The following requests should be uncommented and used where appropriate.
.\" This next request is for sections 2, 3, and 9 function return values only.
.\" .Sh RETURN VALUES
.\" .Sh EXAMPLES
.\" The next request is for sections 2, 3, and 9 error and signal handling only.
.\" .Sh ERRORS
.\" .Sh SEE ALSO
.\" .Xr foobar 1
.\" .Sh STANDARDS
.\" .Sh HISTORY
.\" .Sh AUTHORS
.\" .Sh CAVEATS
.\" .Sh BUGS