summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-26 09:35:35 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-26 09:35:35 +0000
commit7d24aa6b61fc7c0a61348119c53447f5c9b1b892 (patch)
tree8a15230522126a4b7d1f5821880abdca2a1a1dc9
parent0088ea8a5565f33b588d35efb5383d380c1dabcc (diff)
downloadmandoc-7d24aa6b61fc7c0a61348119c53447f5c9b1b892.tar.gz
Fixed `Lb' to be in_line (reported by Ulrich Spoerlein).
Added `Lb' documentation to mdoc.7. Removed harmless but superfluous pre_lb check (was just NULL entries). Added regressions for `Lb' (NOTE that these will only run on new groff, as old groff doesn't support `Lb' at all).
-rw-r--r--mdoc.726
-rw-r--r--mdoc.c2
-rw-r--r--mdoc_macro.c2
-rw-r--r--mdoc_validate.c3
-rw-r--r--regress/mdoc/Lb/blank.in19
-rw-r--r--regress/mdoc/Lb/body.in17
-rw-r--r--regress/mdoc/Lb/custom.in19
-rw-r--r--regress/mdoc/Lb/prolog.in19
8 files changed, 103 insertions, 4 deletions
diff --git a/mdoc.7 b/mdoc.7
index e833e6b3..24d67996 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -731,7 +731,9 @@ Note that the
macro is a
.Sx Block partial-implicit
only when invoked as the first macro
-in a SYNOPSIS section line, else it is
+in a
+.Em SYNOPSIS
+section line, else it is
.Sx In-line .
.Ss In-line
Closed by
@@ -1644,6 +1646,28 @@ and
.Ss \&In
.Ss \&It
.Ss \&Lb
+Specify a library.
+The calling syntax is as follows:
+.Pp
+.D1 \. Ns Sx \&Lb Cm library
+.Pp
+The
+.Cm library
+parameter may be a system library, such as
+.Cm libz
+or
+.Cm libpam ,
+in which case a small library description is printed next to the linker
+invocation; or a custom library, in which case the library name is
+printed in quotes.
+This is most commonly used in the
+.Em SYNOPSIS
+section as described in
+.Sx MANUAL STRUCTURE .
+.Pp
+Examples:
+.D1 \&.Lb libz
+.D1 \&.Lb mdoc
.Ss \&Li
.Ss \&Lk
Format a hyperlink.
diff --git a/mdoc.c b/mdoc.c
index fa633c55..b7048c98 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -560,6 +560,8 @@ mdoc_ptext(struct mdoc *m, int line, char *buf, int offs)
* Search for the beginning of unescaped trailing whitespace (ws)
* and for the first character not to be output (end).
*/
+
+ /* FIXME: replace with strcspn(). */
ws = NULL;
for (c = end = buf + offs; *c; c++) {
switch (*c) {
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 9919f545..f091a015 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -171,7 +171,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ in_line_eoln, 0 }, /* Hf */
{ obsolete, 0 }, /* Fr */
{ in_line_eoln, 0 }, /* Ud */
- { in_line_eoln, 0 }, /* Lb */
+ { in_line, 0 }, /* Lb */
{ in_line_eoln, 0 }, /* Lp */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Lk */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Mt */
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 7527cfb0..2791ceeb 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -138,7 +138,6 @@ static v_pre pres_er[] = { NULL, NULL };
static v_pre pres_ex[] = { NULL, NULL };
static v_pre pres_fd[] = { NULL, NULL };
static v_pre pres_it[] = { pre_it, NULL };
-static v_pre pres_lb[] = { NULL, NULL };
static v_pre pres_os[] = { pre_os, NULL };
static v_pre pres_rv[] = { pre_rv, NULL };
static v_pre pres_sh[] = { pre_sh, NULL };
@@ -251,7 +250,7 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Hf */
{ NULL, NULL }, /* Fr */
{ NULL, posts_notext }, /* Ud */
- { pres_lb, posts_lb }, /* Lb */
+ { NULL, posts_lb }, /* Lb */
{ NULL, posts_notext }, /* Lp */
{ NULL, posts_text }, /* Lk */
{ NULL, posts_text }, /* Mt */
diff --git a/regress/mdoc/Lb/blank.in b/regress/mdoc/Lb/blank.in
new file mode 100644
index 00000000..bb7d7f33
--- /dev/null
+++ b/regress/mdoc/Lb/blank.in
@@ -0,0 +1,19 @@
+.\"
+.\" WARNING: THIS TEST WILL NOT WORK ON OLD GROFF.
+.\" (IT DOES NOT SUPPORT THE `Lb' MACRO.)
+.\"
+.Dd $Mdocdate$
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh LIBRARY
+.Lb
+.Sh DESCRIPTION
+has been optimized for use by applications expecting system scope thread
+semantics, and can provide significant performance improvements
+compared to
+.Lb
+.Sh SEE ALSO
+.Xr pthread 3
diff --git a/regress/mdoc/Lb/body.in b/regress/mdoc/Lb/body.in
new file mode 100644
index 00000000..de334acb
--- /dev/null
+++ b/regress/mdoc/Lb/body.in
@@ -0,0 +1,17 @@
+.\"
+.\" WARNING: THIS TEST WILL NOT WORK ON OLD GROFF.
+.\" (IT DOES NOT SUPPORT THE `Lb' MACRO.)
+.\"
+.Dd $Mdocdate$
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh DESCRIPTION
+has been optimized for use by applications expecting system scope thread
+semantics, and can provide significant performance improvements
+compared to
+.Lb libkse .
+.Sh SEE ALSO
+.Xr pthread 3
diff --git a/regress/mdoc/Lb/custom.in b/regress/mdoc/Lb/custom.in
new file mode 100644
index 00000000..54d9e2e2
--- /dev/null
+++ b/regress/mdoc/Lb/custom.in
@@ -0,0 +1,19 @@
+.\"
+.\" WARNING: THIS TEST WILL NOT WORK ON OLD GROFF.
+.\" (IT DOES NOT SUPPORT THE `Lb' MACRO.)
+.\"
+.Dd $Mdocdate$
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh LIBRARY
+.Lb xyzzy
+.Sh DESCRIPTION
+has been optimized for use by applications expecting system scope thread
+semantics, and can provide significant performance improvements
+compared to
+.Lb xyzzy
+.Sh SEE ALSO
+.Xr pthread 3
diff --git a/regress/mdoc/Lb/prolog.in b/regress/mdoc/Lb/prolog.in
new file mode 100644
index 00000000..0542b7f2
--- /dev/null
+++ b/regress/mdoc/Lb/prolog.in
@@ -0,0 +1,19 @@
+.\"
+.\" WARNING: THIS TEST WILL NOT WORK ON OLD GROFF.
+.\" (IT DOES NOT SUPPORT THE `Lb' MACRO.)
+.\"
+.Dd $Mdocdate$
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh LIBRARY
+.Lb libz
+.Sh DESCRIPTION
+has been optimized for use by applications expecting system scope thread
+semantics, and can provide significant performance improvements
+compared to
+.Lb libkse .
+.Sh SEE ALSO
+.Xr pthread 3