-/* $Id: libmandoc.h,v 1.24 2014/01/05 20:26:27 schwarze Exp $ */
+/* $Id: libmandoc.h,v 1.25 2014/01/06 21:33:00 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org>
int man_addeqn(struct man *, const struct eqn *);
void roff_free(struct roff *);
-struct roff *roff_alloc(enum mparset, struct mparse *);
+struct roff *roff_alloc(enum mparset, struct mparse *, int);
void roff_reset(struct roff *);
enum rofferr roff_parseln(struct roff *, int,
char **, size_t *, int, int *);
-/* $Id: read.c,v 1.20 2014/01/06 00:53:14 schwarze Exp $ */
+/* $Id: read.c,v 1.21 2014/01/06 21:33:00 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
curp->defos = defos;
curp->quick = quick;
- curp->roff = roff_alloc(inttype, curp);
+ curp->roff = roff_alloc(inttype, curp, curp->quick);
return(curp);
}
-/* $Id: roff.c,v 1.62 2013/12/30 18:42:55 schwarze Exp $ */
+/* $Id: roff.c,v 1.63 2014/01/06 21:33:00 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
struct roff {
enum mparset parsetype; /* requested parse type */
struct mparse *parse; /* parse point */
+ int quick; /* skip standard macro deletion */
struct roffnode *last; /* leaf of stack */
enum roffrule rstack[RSTACK_MAX]; /* stack of !`ie' rules */
char control; /* control character */
struct roff *
-roff_alloc(enum mparset type, struct mparse *parse)
+roff_alloc(enum mparset type, struct mparse *parse, int quick)
{
struct roff *r;
int i;
r = mandoc_calloc(1, sizeof(struct roff));
r->parsetype = type;
r->parse = parse;
+ r->quick = quick;
r->rstackpos = -1;
roffhash_init();
{
const char *const *cp;
- if (MPARSE_MDOC != r->parsetype)
+ if (0 == r->quick && MPARSE_MDOC != r->parsetype)
for (cp = __mdoc_reserved; *cp; cp++)
roff_setstr(r, *cp, NULL, 0);
{
const char *const *cp;
- if (MPARSE_MDOC != r->parsetype)
+ if (0 == r->quick && MPARSE_MDOC != r->parsetype)
for (cp = __man_reserved; *cp; cp++)
roff_setstr(r, *cp, NULL, 0);