From 8f484cb522ea01737fad808702f61bc20a5c7996 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 22 Oct 1999 16:04:02 +0000 Subject: Added \rule for a horizontal rule [originally from svn r248] --- bk_text.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bk_text.c') diff --git a/bk_text.c b/bk_text.c index 2b58c06..2f32b47 100644 --- a/bk_text.c +++ b/bk_text.c @@ -23,6 +23,7 @@ static int text_convert(wchar_t *, char **); static void text_title(FILE *, word *, word *, alignment, wchar_t, int, int); static void text_heading(FILE *, word *, word *, int, int); +static void text_rule(FILE *, int, int); static void text_para(FILE *, word *, char *, word *, int, int, int); static void text_codepara(FILE *, word *, int, int); static void text_versionid(FILE *, word *); @@ -139,6 +140,10 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, index *idx) { text_heading(fp, p->kwtext2, p->words, conf.indent, conf.width); break; + case para_Rule: + text_rule(fp, conf.indent, conf.width); + break; + case para_Normal: case para_BiblioCited: /* FIXME: put the citation on front */ case para_Bullet: @@ -410,6 +415,13 @@ static void text_heading(FILE *fp, word *prefix, word *text, sfree(t.text); } +static void text_rule(FILE *fp, int indent, int width) { + while (indent--) putc(' ', fp); + while (width--) putc('-', fp); /* FIXME: configurability! */ + putc('\n', fp); + putc('\n', fp); +} + static void text_para(FILE *fp, word *prefix, char *prefixextra, word *text, int indent, int extraindent, int width) { wrappedline *wrapping, *p; -- cgit v1.1