source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: rudimentary support for -Tman .Ft and .Fn; some blank lines are
@ 2012-07-07 21:16 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2012-07-07 21:16 UTC (permalink / raw)
  To: source

Log Message:
-----------
rudimentary support for -Tman .Ft and .Fn;
some blank lines are still missing from the output
OpenBSD rev. 1.13

Modified Files:
--------------
    mdocml:
        mdoc_man.c

Revision Data
-------------
Index: mdoc_man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_man.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.15 -r1.16
--- mdoc_man.c
+++ mdoc_man.c
@@ -53,6 +53,7 @@ static	void	  post_bd(DECL_ARGS);
 static	void	  post_bk(DECL_ARGS);
 static	void	  post_dl(DECL_ARGS);
 static	void	  post_enc(DECL_ARGS);
+static	void	  post_fn(DECL_ARGS);
 static	void	  post_in(DECL_ARGS);
 static	void	  post_lb(DECL_ARGS);
 static	void	  post_nm(DECL_ARGS);
@@ -67,6 +68,7 @@ static	int	  pre_br(DECL_ARGS);
 static	int	  pre_bx(DECL_ARGS);
 static	int	  pre_dl(DECL_ARGS);
 static	int	  pre_enc(DECL_ARGS);
+static	int	  pre_fn(DECL_ARGS);
 static	int	  pre_in(DECL_ARGS);
 static	int	  pre_it(DECL_ARGS);
 static	int	  pre_nm(DECL_ARGS);
@@ -110,8 +112,8 @@ static	const struct manact manacts[MDOC_
 	{ NULL, NULL, NULL, NULL, NULL }, /* _Fa */
 	{ NULL, NULL, NULL, NULL, NULL }, /* _Fd */
 	{ NULL, pre_enc, post_enc, "\\fB-", "\\fP" }, /* Fl */
-	{ NULL, NULL, NULL, NULL, NULL }, /* _Fn */
-	{ NULL, NULL, NULL, NULL, NULL }, /* _Ft */
+	{ NULL, pre_fn, post_fn, NULL, NULL }, /* Fn */
+	{ NULL, pre_enc, post_enc, "\\fI", "\\fP" }, /* Ft */
 	{ NULL, pre_enc, post_enc, "\\fB", "\\fP" }, /* Ic */
 	{ NULL, pre_in, post_in, NULL, NULL }, /* In */
 	{ NULL, pre_enc, post_enc, "\\fR", "\\fP" }, /* Li */
@@ -585,6 +587,50 @@ post_dl(DECL_ARGS)
 	mm->need_nl = 1;
 	print_word(mm, ".RE");
 	mm->need_nl = 1;
+}
+
+static int
+pre_fn(DECL_ARGS)
+{
+
+	n = n->child;
+	if (NULL == n)
+		return(0);
+
+	if (MDOC_SYNPRETTY & n->flags) {
+		mm->need_nl = 1;
+		print_word(mm, ".br");
+		mm->need_nl = 1;
+	}
+	print_word(mm, "\\fB");
+	mm->need_space = 0;
+	print_node(m, n, mm);
+	mm->need_space = 0;
+	print_word(mm, "\\fP(");
+	mm->need_space = 0;
+	for (n = n->next; n; n = n->next) {
+		print_word(mm, "\\fI");
+		mm->need_space = 0;
+		print_node(m, n, mm);
+		mm->need_space = 0;
+		print_word(mm, "\\fP");
+		if (NULL != n->next)
+			print_word(mm, ",");
+	}
+	return(0);
+}
+
+static void
+post_fn(DECL_ARGS)
+{
+
+	mm->need_space = 0;
+	print_word(mm, ");");
+	if (MDOC_SYNPRETTY & n->flags) {
+		mm->need_nl = 1;
+		print_word(mm, ".br");
+		mm->need_nl = 1;
+	}
 }
 
 static int
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-07 21:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-07 21:16 mdocml: rudimentary support for -Tman .Ft and .Fn; some blank lines are schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).