term.h revision 260e9a87725c090ba5835b1f9f0b62fa2f96036f
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle/* $Id: term.h,v 1.111 2015/01/31 00:12:41 schwarze Exp $ */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
2312a9d8e5342846988edcd629e1ac56a8b5d4a9Brendan Mmiller * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * Permission to use, copy, modify, and distribute this software for any
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * purpose with or without fee is hereby granted, provided that the above
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * copyright notice and this permission notice appear in all copies.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienletypedef void (*term_margin)(struct termp *, const void *);
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle size_t defindent; /* Default indent for text. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle size_t defrmargin; /* Right margin of the device. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle size_t lastrmargin; /* Right margin before the last ll. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle size_t tabwidth; /* Distance of tab positions. */
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle#define TERMP_SENTENCE (1 << 1) /* Space before a sentence. */
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle#define TERMP_NOSPACE (1 << 2) /* No space before words. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#define TERMP_NONOSPACE (1 << 3) /* No space (no autounset). */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#define TERMP_NBRWORD (1 << 4) /* Make next word nonbreaking. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#define TERMP_KEEP (1 << 5) /* Keep words together. */
b1c33bb0456be2f3b9e866871ff404ae012978b9Chad Kienle#define TERMP_PREKEEP (1 << 6) /* ...starting with the next one. */
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle#define TERMP_SKIPCHAR (1 << 7) /* Skip the next character. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#define TERMP_NOBREAK (1 << 8) /* See term_flushln(). */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#define TERMP_BRIND (1 << 9) /* See term_flushln(). */
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle#define TERMP_DANGLE (1 << 10) /* See term_flushln(). */
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle#define TERMP_HANG (1 << 11) /* See term_flushln(). */
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle#define TERMP_NOSPLIT (1 << 12) /* Do not break line before .An. */
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle#define TERMP_SPLIT (1 << 13) /* Break line before .An. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#define TERMP_NONEWLINE (1 << 14) /* No line break in nofill mode. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle const struct mchars *symtab; /* Character table. */
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle const struct roffsu *);
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienleconst char *ascii_uc2str(int);
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienlevoid term_eqn(struct termp *, const struct eqn *);
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienlevoid term_tbl(struct termp *, const struct tbl_span *);
e4b22b1a9af1faf38ffcd030aecc5f246550f701chad.kienle term_margin, const void *);
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienlevoid term_setwidth(struct termp *, const char *);
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienleint term_hspan(const struct termp *, const struct roffsu *);
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienleint term_vspan(const struct termp *, const struct roffsu *);
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienlesize_t term_strlen(const struct termp *, const char *);
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienlevoid term_fontpush(struct termp *, enum termfont);
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienlevoid term_fontrepl(struct termp *, enum termfont);