-/* $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>
*
#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,
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));
}
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);