From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Re-ordering of roff requests as per OpenBSD.
Date: Wed, 1 Dec 2010 05:31:35 -0500 (EST) [thread overview]
Message-ID: <201012011031.oB1AVZ8R019886@krisdoz.my.domain> (raw)
Log Message:
-----------
Re-ordering of roff requests as per OpenBSD.
Made `rm' be an error (again, OpenBSD...).
Modified Files:
--------------
mdocml:
main.c
mandoc.h
roff.c
Revision Data
-------------
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lmandoc.h -Lmandoc.h -u -p -r1.24 -r1.25
--- mandoc.h
+++ mandoc.h
@@ -85,6 +85,7 @@ enum mandocerr {
MANDOCERR_NOTEXT, /* no text in this context */
MANDOCERR_BADCOMMENT, /* bad comment style */
MANDOCERR_MACRO, /* unknown macro will be lost */
+ MANDOCERR_REQUEST, /* NOT IMPLEMENTED: skipping request */
MANDOCERR_LINESCOPE, /* line scope broken */
MANDOCERR_ARGCOUNT, /* argument count wrong */
MANDOCERR_NOSCOPE, /* no such block is open */
Index: roff.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -Lroff.c -Lroff.c -u -p -r1.103 -r1.104
--- roff.c
+++ roff.c
@@ -60,11 +60,11 @@ enum rofft {
ROFF_ig,
ROFF_ne,
ROFF_nh,
+ ROFF_nr,
ROFF_rm,
ROFF_tr,
ROFF_cblock,
ROFF_ccond, /* FIXME: remove this. */
- ROFF_nr,
ROFF_MAX
};
@@ -135,6 +135,7 @@ static void roff_freestr(struct roff *
static const char *roff_getstrn(const struct roff *,
const char *, size_t);
static enum rofferr roff_line_ignore(ROFF_ARGS);
+static enum rofferr roff_line_error(ROFF_ARGS);
static enum rofferr roff_nr(ROFF_ARGS);
static int roff_res(struct roff *,
char **, size_t *, int);
@@ -166,11 +167,11 @@ static struct roffmac roffs[ROFF_MAX] =
{ "ig", roff_block, roff_block_text, roff_block_sub, 0, NULL },
{ "ne", roff_line_ignore, NULL, NULL, 0, NULL },
{ "nh", roff_line_ignore, NULL, NULL, 0, NULL },
- { "rm", roff_line_ignore, NULL, NULL, 0, NULL },
+ { "nr", roff_nr, NULL, NULL, 0, NULL },
+ { "rm", roff_line_error, NULL, NULL, 0, NULL },
{ "tr", roff_line_ignore, NULL, NULL, 0, NULL },
{ ".", roff_cblock, NULL, NULL, 0, NULL },
{ "\\}", roff_ccond, NULL, NULL, 0, NULL },
- { "nr", roff_nr, NULL, NULL, 0, NULL },
};
static void roff_free1(struct roff *);
@@ -846,7 +847,6 @@ roff_evalcond(const char *v, int *pos)
return(ROFFRULE_DENY);
}
-
/* ARGSUSED */
static enum rofferr
roff_line_ignore(ROFF_ARGS)
@@ -855,6 +855,14 @@ roff_line_ignore(ROFF_ARGS)
return(ROFF_IGN);
}
+/* ARGSUSED */
+static enum rofferr
+roff_line_error(ROFF_ARGS)
+{
+
+ (*r->msg)(MANDOCERR_REQUEST, r->data, ln, ppos, roffs[tok].name);
+ return(ROFF_IGN);
+}
/* ARGSUSED */
static enum rofferr
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -Lmain.c -Lmain.c -u -p -r1.109 -r1.110
--- main.c
+++ main.c
@@ -159,6 +159,7 @@ static const char * const mandocerrs[MAN
"no text in this context",
"bad comment style",
"unknown macro will be lost",
+ "NOT IMPLEMENTED: skipping request",
"line scope broken",
"argument count wrong",
"request scope close w/none open",
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2010-12-01 10:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201012011031.oB1AVZ8R019886@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).