X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/e4966b859ee26adbd25172e1e2e7d266feb6d36c..f52cdc4437cb37e93dbd03a14742e01eb654df7e:/term.h diff --git a/term.h b/term.h index 3bf16d7a..95e75d2a 100644 --- a/term.h +++ b/term.h @@ -1,4 +1,4 @@ -/* $Id: term.h,v 1.1 2009/02/21 19:05:28 kristaps Exp $ */ +/* $Id: term.h,v 1.12 2009/03/01 13:06:49 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -35,14 +35,37 @@ struct termp { #define TERMP_NOSPACE (1 << 2) /* No space before words. */ #define TERMP_NOLPAD (1 << 3) /* No leftpad before flush. */ #define TERMP_NOBREAK (1 << 4) /* No break after flush. */ +#define TERMP_LITERAL (1 << 5) /* Literal words. */ +#define TERMP_IGNDELIM (1 << 6) /* Delims like regulars. */ +#define TERMP_NONOSPACE (1 << 7) /* No space (no autounset). */ char *buf; }; +struct termpair { + struct termpair *ppair; + int type; +#define TERMPAIR_FLAG (1 << 0) + int flag; + size_t offset; + size_t rmargin; + int count; +}; + +#define TERMPAIR_SETFLAG(termp, p, fl) \ + do { \ + assert(! (TERMPAIR_FLAG & (p)->type)); \ + (termp)->flags |= (fl); \ + (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 *); - int (*post)(struct termp *, + void (*post)(struct termp *, + struct termpair *, const struct mdoc_meta *, const struct mdoc_node *); }; @@ -51,6 +74,12 @@ 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;