=================================================================== RCS file: /cvs/mandoc/term_ascii.c,v retrieving revision 1.2 retrieving revision 1.5 diff -u -p -r1.2 -r1.5 --- mandoc/term_ascii.c 2010/06/08 15:06:01 1.2 +++ mandoc/term_ascii.c 2010/06/25 18:53:14 1.5 @@ -1,6 +1,6 @@ -/* $Id: term_ascii.c,v 1.2 2010/06/08 15:06:01 kristaps Exp $ */ +/* $Id: term_ascii.c,v 1.5 2010/06/25 18:53:14 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -35,6 +35,7 @@ static void ascii_letter(struct termp *, char); static void ascii_begin(struct termp *); static void ascii_advance(struct termp *, size_t); static void ascii_end(struct termp *); +static size_t ascii_width(const struct termp *, char); void * @@ -47,12 +48,16 @@ ascii_alloc(char *outopts) if (NULL == (p = term_alloc(TERMENC_ASCII))) return(NULL); + p->tabwidth = 5; + p->defrmargin = 78; + p->type = TERMTYPE_CHAR; p->letter = ascii_letter; p->begin = ascii_begin; p->end = ascii_end; p->endline = ascii_endline; p->advance = ascii_advance; + p->width = ascii_width; toks[0] = "width"; toks[1] = NULL; @@ -74,6 +79,14 @@ ascii_alloc(char *outopts) } +static size_t +ascii_width(const struct termp *p, char c) +{ + + return(1); +} + + void ascii_free(void *arg) { @@ -87,7 +100,6 @@ static void ascii_letter(struct termp *p, char c) { - /* Just push onto the screen. */ putchar(c); }