summaryrefslogtreecommitdiffstatshomepage
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
commit1085b597d4bfab63f287b0a8b596e441cfc51014 (patch)
treec9e9f67a24d614afabec2c124346ae1a6de18346 /mlg.c
parent0d929500feda128e984bf588a68b3bb51a9df71d (diff)
downloadmandoc-1085b597d4bfab63f287b0a8b596e441cfc51014.tar.gz
mandoc-1085b597d4bfab63f287b0a8b596e441cfc51014.tar.zst
mandoc-1085b597d4bfab63f287b0a8b596e441cfc51014.zip
*** empty log message ***
Diffstat (limited to 'mlg.c')
-rw-r--r--mlg.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/mlg.c b/mlg.c
index 33f6ff9a..bccde15e 100644
--- a/mlg.c
+++ b/mlg.c
@@ -1,4 +1,4 @@
-/* $Id: mlg.c,v 1.23 2008/12/09 17:09:12 kristaps Exp $ */
+/* $Id: mlg.c,v 1.24 2008/12/10 00:52:46 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);