socsvn commit: r237033 - in soc2012/jhagewood/mdocml: .
mdocml-1.12.1
jhagewood at FreeBSD.org
jhagewood at FreeBSD.org
Mon Jun 4 05:41:58 UTC 2012
Author: jhagewood
Date: Mon Jun 4 05:41:55 2012
New Revision: 237033
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237033
Log:
Modified:
soc2012/jhagewood/mdocml/hagewood-mdocml.patch
soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h
soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h
soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c
soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c
soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c
soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c
soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c
Modified: soc2012/jhagewood/mdocml/hagewood-mdocml.patch
==============================================================================
--- soc2012/jhagewood/mdocml/hagewood-mdocml.patch Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/hagewood-mdocml.patch Mon Jun 4 05:41:55 2012 (r237033)
@@ -1,221 +1,61 @@
-diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h jhagewood/mdocml/mdocml-1.12.1/libmandoc.h
---- jhagewood/mdocml/mdocml-1.12.1-orig/libmandoc.h 2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/libmandoc.h 2012-06-02 06:16:40.000000000 -0400
-@@ -31,6 +31,7 @@ enum rofferr {
-
- enum regs {
- REG_nS = 0, /* nS register */
-+ REG_ns = 0, /* ns register (no-space) */
- REG__MAX
- };
-
-diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c jhagewood/mdocml/mdocml-1.12.1/man_html.c
---- jhagewood/mdocml/mdocml-1.12.1-orig/man_html.c 2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/man_html.c 2012-06-02 06:45:04.000000000 -0400
-@@ -27,6 +27,7 @@
- #include <string.h>
-
- #include "mandoc.h"
-+#include "libmandoc.h"
- #include "out.h"
- #include "html.h"
- #include "man.h"
-@@ -134,7 +135,8 @@ print_bvspace(struct html *h, const stru
- if (MAN_ROOT == n->parent->type || MAN_RS != n->parent->tok)
- if (NULL == n->prev)
- return;
--
-+ if (REG_ns)
-+ return;
- print_otag(h, TAG_P, 0, NULL);
- }
-
+diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man.h jhagewood/mdocml/mdocml-1.12.1/man.h
+--- jhagewood/mdocml/mdocml-1.12.1-orig/man.h 2012-06-01 05:35:15.000000000 -0400
++++ jhagewood/mdocml/mdocml-1.12.1/man.h 2012-06-04 04:47:34.000000000 -0400
+@@ -43,6 +43,8 @@ enum mant {
+ MAN_sp,
+ MAN_nf,
+ MAN_fi,
++ MAN_ns,
++ MAN_rs,
+ MAN_RE,
+ MAN_RS,
+ MAN_DT,
diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c jhagewood/mdocml/mdocml-1.12.1/man_term.c
--- jhagewood/mdocml/mdocml-1.12.1-orig/man_term.c 2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/man_term.c 2012-06-02 06:51:05.000000000 -0400
-@@ -28,6 +28,7 @@
- #include <string.h>
-
- #include "mandoc.h"
-+#include "libmandoc.h"
- #include "out.h"
- #include "man.h"
- #include "term.h"
-@@ -455,13 +456,14 @@ pre_sp(DECL_ARGS)
- len = n->child ? a2height(p, n->child->string) : 1;
- break;
- }
--
-- if (0 == len)
-- term_newln(p);
-- for (i = 0; i < len; i++)
-- term_vspace(p);
--
-- return(0);
-+ if (!REG_ns)
-+ {
-+ if (0 == len)
-+ term_newln(p);
-+ for (i = 0; i < len; i++)
-+ term_vspace(p);
-+ }
-+ return(0);
- }
-
-
-diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c
---- jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_html.c 2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c 2012-06-02 06:46:47.000000000 -0400
-@@ -28,6 +28,7 @@
- #include <unistd.h>
-
- #include "mandoc.h"
-+#include "libmandoc.h"
- #include "out.h"
- #include "html.h"
- #include "mdoc.h"
-@@ -1614,27 +1615,27 @@ mdoc_pp_pre(MDOC_ARGS)
- static int
- mdoc_sp_pre(MDOC_ARGS)
- {
-- struct roffsu su;
-- struct htmlpair tag;
-+ struct roffsu su;
-+ struct htmlpair tag;
-
-- SCALE_VS_INIT(&su, 1);
-+ SCALE_VS_INIT(&su, 1);
-
-- if (MDOC_sp == n->tok) {
-- if (NULL != (n = n->child))
-- if ( ! a2roffsu(n->string, &su, SCALE_VS))
-- SCALE_VS_INIT(&su, atoi(n->string));
-- } else
-- su.scale = 0;
-+ if (MDOC_sp == n->tok) {
-+ if (NULL != (n = n->child))
-+ if ( ! a2roffsu(n->string, &su, SCALE_VS))
-+ SCALE_VS_INIT(&su, atoi(n->string));
-+ } else
-+ su.scale = 0;
-
-- bufinit(h);
-- bufcat_su(h, "height", &su);
-- PAIR_STYLE_INIT(&tag, h);
-- print_otag(h, TAG_DIV, 1, &tag);
--
-- /* So the div isn't empty: */
-- print_text(h, "\\~");
-+ bufinit(h);
-+ bufcat_su(h, "height", &su);
-+ PAIR_STYLE_INIT(&tag, h);
-+ if (!REG_ns)
-+ print_otag(h, TAG_DIV, 1, &tag);
-
-- return(0);
-+ /* So the div isn't empty: */
-+ print_text(h, "\\~");
-+ return(0);
-
- }
-
-diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c
---- jhagewood/mdocml/mdocml-1.12.1-orig/mdoc_term.c 2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c 2012-06-02 06:47:03.000000000 -0400
-@@ -29,6 +29,7 @@
- #include <string.h>
-
- #include "mandoc.h"
-+#include "libmandoc.h"
- #include "out.h"
- #include "term.h"
- #include "mdoc.h"
-@@ -1882,12 +1883,13 @@ termp_sp_pre(DECL_ARGS)
- len = 1;
- break;
- }
--
-- if (0 == len)
-- term_newln(p);
-- for (i = 0; i < len; i++)
-- term_vspace(p);
--
-+ if (!REG_ns)
-+ {
-+ if (0 == len)
-+ term_newln(p);
-+ for (i = 0; i < len; i++)
-+ term_vspace(p);
-+ }
++++ jhagewood/mdocml/mdocml-1.12.1/man_term.c 2012-06-04 05:04:08.000000000 -0400
+@@ -82,6 +82,8 @@ static int pre_alternate(DECL_ARGS);
+ static int pre_ft(DECL_ARGS);
+ static int pre_ign(DECL_ARGS);
+ static int pre_in(DECL_ARGS);
++static int pre_ns(DECL_ARGS);
++static int pre_rs(DECL_ARGS);
+ static int pre_literal(DECL_ARGS);
+ static int pre_sp(DECL_ARGS);
+
+@@ -125,6 +127,8 @@ static const struct termact termacts[MAN
+ { pre_ign, NULL, 0 }, /* PD */
+ { pre_ign, NULL, 0 }, /* AT */
+ { pre_in, NULL, MAN_NOTEXT }, /* in */
++ { pre_ns, NULL, MAN_NOTEXT }, /* ns */
++ { pre_rs, NULL, MAN_NOTEXT }, /* rs */
+ { pre_ft, NULL, MAN_NOTEXT }, /* ft */
+ { pre_OP, NULL, 0 }, /* OP */
+ };
+@@ -433,6 +437,27 @@ pre_in(DECL_ARGS)
return(0);
}
-diff -rupN jhagewood/mdocml/mdocml-1.12.1-orig/roff.c jhagewood/mdocml/mdocml-1.12.1/roff.c
---- jhagewood/mdocml/mdocml-1.12.1-orig/roff.c 2012-06-01 05:35:15.000000000 -0400
-+++ jhagewood/mdocml/mdocml-1.12.1/roff.c 2012-06-02 06:51:16.000000000 -0400
-@@ -55,6 +55,7 @@ enum rofft {
- ROFF_ns,
- ROFF_ps,
- ROFF_rm,
-+ ROFF_rs,
- ROFF_so,
- ROFF_ta,
- ROFF_tr,
-@@ -182,6 +183,7 @@ static const char *roff_getstrn(const st
- const char *, size_t);
- static enum rofferr roff_line_ignore(ROFF_ARGS);
- static enum rofferr roff_nr(ROFF_ARGS);
-+static enum rofferr roff_ns(ROFF_ARGS);
- static void roff_openeqn(struct roff *, const char *,
- int, int, const char *);
- static enum rofft roff_parse(struct roff *, const char *, int *);
-@@ -189,6 +191,7 @@ static enum rofferr roff_parsetext(char
- static enum rofferr roff_res(struct roff *,
- char **, size_t *, int, int);
- static enum rofferr roff_rm(ROFF_ARGS);
-+static enum rofferr roff_rs(ROFF_ARGS);
- static void roff_setstr(struct roff *,
- const char *, const char *, int);
- static void roff_setstrn(struct roffkv **, const char *,
-@@ -228,9 +231,10 @@ static struct roffmac roffs[ROFF_MAX] =
- { "ne", roff_line_ignore, NULL, NULL, 0, NULL },
- { "nh", roff_line_ignore, NULL, NULL, 0, NULL },
- { "nr", roff_nr, NULL, NULL, 0, NULL },
-- { "ns", roff_line_ignore, NULL, NULL, 0, NULL },
-+ { "ns", roff_ns, NULL, NULL, 0, NULL },
- { "ps", roff_line_ignore, NULL, NULL, 0, NULL },
- { "rm", roff_rm, NULL, NULL, 0, NULL },
-+ { "rs", roff_rs, NULL, NULL, 0, NULL },
- { "so", roff_so, NULL, NULL, 0, NULL },
- { "ta", roff_line_ignore, NULL, NULL, 0, NULL },
- { "tr", roff_tr, NULL, NULL, 0, NULL },
-@@ -1256,6 +1260,14 @@ roff_nr(ROFF_ARGS)
- return(ROFF_IGN);
- }
-
-+static enum rofferr
-+roff_ns(ROFF_ARGS)
++/* ARGSUSED */
++static int
++pre_ns(DECL_ARGS)
+{
-+ /* Sets no-space register to 1. (on) */
-+ r->regs[(int)REG_ns].set = 1;
-+ return(ROFF_IGN);
++
++ if ( ! (MAN_LINE & n->flags))
++ p->flags |= TERMP_NOSPACE;
++ return(1);
+}
+
- /* ARGSUSED */
- static enum rofferr
- roff_rm(ROFF_ARGS)
-@@ -1272,6 +1284,14 @@ roff_rm(ROFF_ARGS)
- return(ROFF_IGN);
- }
-
-+static enum rofferr
-+roff_rs(ROFF_ARGS)
++/* ARGSUSED */
++static int
++pre_rs(DECL_ARGS)
+{
-+ /* Sets no-space register to 0. */
-+ roff_regunset(r, REG_ns);
-+ return(ROFF_IGN);
++ /*
++ if (SEC_SEE_ALSO != n->sec)
++ return(1);
++ if (MAN_BLOCK == n->type && n->prev)
++ term_vspace(p); */
++ return(1);
+}
-+
+
/* ARGSUSED */
- static enum rofferr
- roff_TE(ROFF_ARGS)
+ static int
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/libmandoc.h Mon Jun 4 05:41:55 2012 (r237033)
@@ -31,7 +31,6 @@
enum regs {
REG_nS = 0, /* nS register */
- REG_ns = 0, /* ns register (no-space) */
REG__MAX
};
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/man.h Mon Jun 4 05:41:55 2012 (r237033)
@@ -43,6 +43,8 @@
MAN_sp,
MAN_nf,
MAN_fi,
+ MAN_ns,
+ MAN_rs,
MAN_RE,
MAN_RS,
MAN_DT,
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/man_html.c Mon Jun 4 05:41:55 2012 (r237033)
@@ -27,7 +27,6 @@
#include <string.h>
#include "mandoc.h"
-#include "libmandoc.h"
#include "out.h"
#include "html.h"
#include "man.h"
@@ -135,8 +134,7 @@
if (MAN_ROOT == n->parent->type || MAN_RS != n->parent->tok)
if (NULL == n->prev)
return;
- if (REG_ns)
- return;
+
print_otag(h, TAG_P, 0, NULL);
}
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/man_term.c Mon Jun 4 05:41:55 2012 (r237033)
@@ -28,7 +28,6 @@
#include <string.h>
#include "mandoc.h"
-#include "libmandoc.h"
#include "out.h"
#include "man.h"
#include "term.h"
@@ -83,6 +82,8 @@
static int pre_ft(DECL_ARGS);
static int pre_ign(DECL_ARGS);
static int pre_in(DECL_ARGS);
+static int pre_ns(DECL_ARGS);
+static int pre_rs(DECL_ARGS);
static int pre_literal(DECL_ARGS);
static int pre_sp(DECL_ARGS);
@@ -126,6 +127,8 @@
{ pre_ign, NULL, 0 }, /* PD */
{ pre_ign, NULL, 0 }, /* AT */
{ pre_in, NULL, MAN_NOTEXT }, /* in */
+ { pre_ns, NULL, MAN_NOTEXT }, /* ns */
+ { pre_rs, NULL, MAN_NOTEXT }, /* rs */
{ pre_ft, NULL, MAN_NOTEXT }, /* ft */
{ pre_OP, NULL, 0 }, /* OP */
};
@@ -434,6 +437,27 @@
return(0);
}
+/* ARGSUSED */
+static int
+pre_ns(DECL_ARGS)
+{
+
+ if ( ! (MAN_LINE & n->flags))
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+}
+
+/* ARGSUSED */
+static int
+pre_rs(DECL_ARGS)
+{
+ /*
+ if (SEC_SEE_ALSO != n->sec)
+ return(1);
+ if (MAN_BLOCK == n->type && n->prev)
+ term_vspace(p); */
+ return(1);
+}
/* ARGSUSED */
static int
@@ -456,14 +480,13 @@
len = n->child ? a2height(p, n->child->string) : 1;
break;
}
- if (!REG_ns)
- {
- if (0 == len)
- term_newln(p);
- for (i = 0; i < len; i++)
- term_vspace(p);
- }
- return(0);
+
+ if (0 == len)
+ term_newln(p);
+ for (i = 0; i < len; i++)
+ term_vspace(p);
+
+ return(0);
}
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_html.c Mon Jun 4 05:41:55 2012 (r237033)
@@ -28,7 +28,6 @@
#include <unistd.h>
#include "mandoc.h"
-#include "libmandoc.h"
#include "out.h"
#include "html.h"
#include "mdoc.h"
@@ -1615,27 +1614,27 @@
static int
mdoc_sp_pre(MDOC_ARGS)
{
- struct roffsu su;
- struct htmlpair tag;
+ struct roffsu su;
+ struct htmlpair tag;
- SCALE_VS_INIT(&su, 1);
+ SCALE_VS_INIT(&su, 1);
- if (MDOC_sp == n->tok) {
- if (NULL != (n = n->child))
- if ( ! a2roffsu(n->string, &su, SCALE_VS))
- SCALE_VS_INIT(&su, atoi(n->string));
- } else
- su.scale = 0;
+ if (MDOC_sp == n->tok) {
+ if (NULL != (n = n->child))
+ if ( ! a2roffsu(n->string, &su, SCALE_VS))
+ SCALE_VS_INIT(&su, atoi(n->string));
+ } else
+ su.scale = 0;
- bufinit(h);
- bufcat_su(h, "height", &su);
- PAIR_STYLE_INIT(&tag, h);
- if (!REG_ns)
- print_otag(h, TAG_DIV, 1, &tag);
+ bufinit(h);
+ bufcat_su(h, "height", &su);
+ PAIR_STYLE_INIT(&tag, h);
+ print_otag(h, TAG_DIV, 1, &tag);
- /* So the div isn't empty: */
- print_text(h, "\\~");
- return(0);
+ /* So the div isn't empty: */
+ print_text(h, "\\~");
+
+ return(0);
}
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/mdoc_term.c Mon Jun 4 05:41:55 2012 (r237033)
@@ -29,7 +29,6 @@
#include <string.h>
#include "mandoc.h"
-#include "libmandoc.h"
#include "out.h"
#include "term.h"
#include "mdoc.h"
@@ -1883,13 +1882,12 @@
len = 1;
break;
}
- if (!REG_ns)
- {
- if (0 == len)
- term_newln(p);
- for (i = 0; i < len; i++)
- term_vspace(p);
- }
+
+ if (0 == len)
+ term_newln(p);
+ for (i = 0; i < len; i++)
+ term_vspace(p);
+
return(0);
}
Modified: soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c
==============================================================================
--- soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Mon Jun 4 04:24:59 2012 (r237032)
+++ soc2012/jhagewood/mdocml/mdocml-1.12.1/roff.c Mon Jun 4 05:41:55 2012 (r237033)
@@ -55,7 +55,6 @@
ROFF_ns,
ROFF_ps,
ROFF_rm,
- ROFF_rs,
ROFF_so,
ROFF_ta,
ROFF_tr,
@@ -183,7 +182,6 @@
const char *, size_t);
static enum rofferr roff_line_ignore(ROFF_ARGS);
static enum rofferr roff_nr(ROFF_ARGS);
-static enum rofferr roff_ns(ROFF_ARGS);
static void roff_openeqn(struct roff *, const char *,
int, int, const char *);
static enum rofft roff_parse(struct roff *, const char *, int *);
@@ -191,7 +189,6 @@
static enum rofferr roff_res(struct roff *,
char **, size_t *, int, int);
static enum rofferr roff_rm(ROFF_ARGS);
-static enum rofferr roff_rs(ROFF_ARGS);
static void roff_setstr(struct roff *,
const char *, const char *, int);
static void roff_setstrn(struct roffkv **, const char *,
@@ -231,10 +228,9 @@
{ "ne", roff_line_ignore, NULL, NULL, 0, NULL },
{ "nh", roff_line_ignore, NULL, NULL, 0, NULL },
{ "nr", roff_nr, NULL, NULL, 0, NULL },
- { "ns", roff_ns, NULL, NULL, 0, NULL },
+ { "ns", roff_line_ignore, NULL, NULL, 0, NULL },
{ "ps", roff_line_ignore, NULL, NULL, 0, NULL },
{ "rm", roff_rm, NULL, NULL, 0, NULL },
- { "rs", roff_rs, NULL, NULL, 0, NULL },
{ "so", roff_so, NULL, NULL, 0, NULL },
{ "ta", roff_line_ignore, NULL, NULL, 0, NULL },
{ "tr", roff_tr, NULL, NULL, 0, NULL },
@@ -1260,14 +1256,6 @@
return(ROFF_IGN);
}
-static enum rofferr
-roff_ns(ROFF_ARGS)
-{
- /* Sets no-space register to 1. (on) */
- r->regs[(int)REG_ns].set = 1;
- return(ROFF_IGN);
-}
-
/* ARGSUSED */
static enum rofferr
roff_rm(ROFF_ARGS)
@@ -1284,14 +1272,6 @@
return(ROFF_IGN);
}
-static enum rofferr
-roff_rs(ROFF_ARGS)
-{
- /* Sets no-space register to 0. */
- roff_regunset(r, REG_ns);
- return(ROFF_IGN);
-}
-
/* ARGSUSED */
static enum rofferr
roff_TE(ROFF_ARGS)
More information about the svn-soc-all
mailing list