aboutsummaryrefslogtreecommitdiff
path: root/contrib/mandoc/term.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/mandoc/term.h')
-rw-r--r--contrib/mandoc/term.h38
1 files changed, 16 insertions, 22 deletions
diff --git a/contrib/mandoc/term.h b/contrib/mandoc/term.h
index 3b3a79527eeb..1e4659734fc5 100644
--- a/contrib/mandoc/term.h
+++ b/contrib/mandoc/term.h
@@ -1,6 +1,7 @@
-/* $Id: term.h,v 1.134 2022/08/16 17:45:55 schwarze Exp $ */
+/* $Id: term.h,v 1.138 2025/07/27 15:27:28 schwarze Exp $ */
/*
- * Copyright (c) 2011-2015,2017,2019,2022 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2015, 2017, 2019, 2021, 2022, 2025
+ * Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -44,19 +45,14 @@ struct termp;
typedef void (*term_margin)(struct termp *, const struct roff_meta *);
-struct termp_tbl {
- int width; /* width in fixed chars */
- int decimal; /* decimal point position */
-};
-
struct termp_col {
int *buf; /* Output buffer. */
size_t maxcols; /* Allocated bytes in buf. */
size_t lastcol; /* Last byte in buf. */
size_t col; /* Byte in buf to be written. */
- size_t rmargin; /* Current right margin. */
- size_t offset; /* Current left margin. */
- size_t taboff; /* Offset for literal tabs. */
+ size_t rmargin; /* Current right margin [BU]. */
+ size_t offset; /* Current left margin [BU]. */
+ size_t taboff; /* Offset for literal tabs [BU]. */
};
struct termp {
@@ -66,17 +62,16 @@ struct termp {
size_t maxtcol; /* Allocated table columns. */
size_t lasttcol; /* Last column currently used. */
size_t line; /* Current output line number. */
- size_t defindent; /* Default indent for text. */
- size_t defrmargin; /* Right margin of the device. */
- size_t lastrmargin; /* Right margin before the last ll. */
- size_t maxrmargin; /* Max right margin. */
+ size_t defindent; /* Default indent for text [EN]. */
+ size_t defrmargin; /* Right margin of the device [BU]. */
+ size_t lastrmargin; /* Right margin before last ll [BU]. */
+ size_t maxrmargin; /* Maximum right margin [BU]. */
size_t col; /* Byte position in buf. */
- size_t viscol; /* Chars on current line. */
- size_t trailspace; /* See term_flushln(). */
- size_t minbl; /* Minimum blanks before next field. */
+ size_t viscol; /* Width of the current line [BU]. */
+ size_t trailspace; /* Whitespace after field [EN]. */
+ size_t minbl; /* Whitespace before field [EN]. */
int synopsisonly; /* Print the synopsis only. */
- int mdocstyle; /* Imitate mdoc(7) output. */
- int ti; /* Temporary indent for one line. */
+ int ti; /* Temporary indent for line [BU]. */
int skipvsp; /* Vertical space to skip. */
int flags;
#define TERMP_SENTENCE (1 << 0) /* Space before a sentence. */
@@ -108,6 +103,7 @@ struct termp {
enum termfont *fontq; /* Symmetric fonts. */
int fontsz; /* Allocated size of font stack */
int fonti; /* Index of font stack. */
+ int fontibi; /* Map font I to BI. */
term_margin headf; /* invoked to print head */
term_margin footf; /* invoked to print foot */
void (*letter)(struct termp *, int);
@@ -116,7 +112,7 @@ struct termp {
void (*endline)(struct termp *);
void (*advance)(struct termp *, size_t);
void (*setwidth)(struct termp *, int, int);
- size_t (*width)(const struct termp *, int);
+ size_t (*getwidth)(const struct termp *, int);
int (*hspan)(const struct termp *,
const struct roffsu *);
const void *argf; /* arg for headf/footf */
@@ -143,13 +139,11 @@ void term_end(struct termp *);
void term_setwidth(struct termp *, const char *);
int term_hspan(const struct termp *, const struct roffsu *);
-int term_hen(const struct termp *, const struct roffsu *);
int term_vspan(const struct termp *, const struct roffsu *);
size_t term_strlen(const struct termp *, const char *);
size_t term_len(const struct termp *, size_t);
void term_tab_set(const struct termp *, const char *);
-void term_tab_iset(size_t);
void term_tab_ref(struct termp *);
size_t term_tab_next(size_t);
void term_tab_free(void);