summaryrefslogtreecommitdiffstats
path: root/mlg.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-10 00:52:46 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-10 00:52:46 +0000
commit14b766df0d1ee7f25fafdd5aafafb9f03d3f0488 (patch)
treefd4e8d52ac28c902aff3985b63cef09c9b9d24e9 /mlg.c
parent5181e986114c18c409bb0b17c01aa4306c15c24e (diff)
downloadmandoc-14b766df0d1ee7f25fafdd5aafafb9f03d3f0488.tar.gz
*** empty log message ***
Diffstat (limited to 'mlg.c')
-rw-r--r--mlg.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/mlg.c b/mlg.c
index 780167b4..c6c3963a 100644
--- a/mlg.c
+++ b/mlg.c
@@ -24,15 +24,10 @@
#include <stdio.h>
#include <string.h>
-#include "private.h"
#include "ml.h"
/* TODO: literal tokens. */
-#define COLUMNS 72
-#define INDENT 4
-#define MAXINDENT 10
-
enum md_tok {
MD_TEXT,
MD_INLINE_IN,
@@ -239,14 +234,10 @@ mlg_endtag(struct md_mlg *p, enum md_ns ns, int tok)
static int
mlg_indent(struct md_mlg *p)
{
- size_t count;
-
- count = p->indent > MAXINDENT ?
- (size_t)MAXINDENT : p->indent;
- count *= INDENT;
assert(0 == p->pos);
- return(ml_putchars(p->mbuf, ' ', count, &p->pos));
+ return(ml_putchars(p->mbuf, ' ', INDENT_SZ *
+ INDENT(p->indent), &p->pos));
}
@@ -325,7 +316,7 @@ mlg_data(struct md_mlg *p, int space,
if ( ! mlg_nstring(p, start, buf, sz))
return(0);
- if (p->indent * INDENT + sz >= COLUMNS)
+ if (INDENT(p->indent) * INDENT_SZ + sz >= COLUMNS)
if ( ! mlg_newline(p))
return(0);