=================================================================== RCS file: /cvs/mandoc/term.h,v retrieving revision 1.4 retrieving revision 1.7 diff -u -p -r1.4 -r1.7 --- mandoc/term.h 2009/02/22 19:23:48 1.4 +++ mandoc/term.h 2009/02/25 12:27:37 1.7 @@ -1,4 +1,4 @@ -/* $Id: term.h,v 1.4 2009/02/22 19:23:48 kristaps Exp $ */ +/* $Id: term.h,v 1.7 2009/02/25 12:27:37 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -40,24 +40,41 @@ struct termp { char *buf; }; +struct termpair { + int type; +#define TERMPAIR_FLAG (1 << 0) + int flag; + size_t offset; +}; + +#define TERMPAIR_SETFLAG(p, fl) \ + do { \ + assert(! (TERMPAIR_FLAG & (p)->type)); \ + (p)->flag = (fl); \ + (p)->type |= TERMPAIR_FLAG; \ + } while (0) + struct termact { int (*pre)(struct termp *, + struct termpair *, const struct mdoc_meta *, const struct mdoc_node *); void (*post)(struct termp *, + struct termpair *, const struct mdoc_meta *, const struct mdoc_node *); }; -void termprint(const struct mdoc_node *, - const struct mdoc_meta *); - void newln(struct termp *); void vspace(struct termp *); void word(struct termp *, const char *); void flushln(struct termp *); void transcode(struct termp *, const char *, size_t); + +void subtree(struct termp *, + const struct mdoc_meta *, + const struct mdoc_node *); const struct termact *termacts;