aboutsummaryrefslogtreecommitdiff
path: root/st.h
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2018-02-24 16:32:20 -0600
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:56:26 -0600
commite0215d53770a9b6bc6e5d7b9a603ecd34dbd7100 (patch)
treeb696b3fa2c69270a198c3bcc1e0a289b12b3538c /st.h
parent30683c70ab62fd37b5921cf72077b9aef2cb842e (diff)
downloadst-patched-e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100.tar.bz2
st-patched-e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100.tar.xz
st-patched-e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100.zip
Reduce visibility wherever possible
When possible, declare functions/variables static and move struct definitions out of headers. In order to allow utf8decode to become internal, use codepoint for DECSCUSR extension directly. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Diffstat (limited to 'st.h')
-rw-r--r--st.h40
1 files changed, 0 insertions, 40 deletions
diff --git a/st.h b/st.h
index 0a7472b..1015fc6 100644
--- a/st.h
+++ b/st.h
@@ -1,8 +1,5 @@
1/* See LICENSE for license details. */ 1/* See LICENSE for license details. */
2 2
3/* Arbitrary sizes */
4#define UTF_SIZ 4
5
6/* macros */ 3/* macros */
7#define MIN(a, b) ((a) < (b) ? (a) : (b)) 4#define MIN(a, b) ((a) < (b) ? (a) : (b))
8#define MAX(a, b) ((a) < (b) ? (b) : (a)) 5#define MAX(a, b) ((a) < (b) ? (b) : (a))
@@ -69,41 +66,6 @@ typedef struct {
69 66
70typedef Glyph *Line; 67typedef Glyph *Line;
71 68
72typedef struct {
73 Glyph attr; /* current char attributes */
74 int x;
75 int y;
76 char state;
77} TCursor;
78
79/* Purely graphic info */
80typedef struct {
81 int tw, th; /* tty width and height */
82 int w, h; /* window width and height */
83 int ch; /* char height */
84 int cw; /* char width */
85 int mode; /* window state/mode flags */
86 int cursor; /* cursor style */
87} TermWindow;
88
89typedef struct {
90 int mode;
91 int type;
92 int snap;
93 /*
94 * Selection variables:
95 * nb – normalized coordinates of the beginning of the selection
96 * ne – normalized coordinates of the end of the selection
97 * ob – original coordinates of the beginning of the selection
98 * oe – original coordinates of the end of the selection
99 */
100 struct {
101 int x, y;
102 } nb, ne, ob, oe;
103
104 int alt;
105} Selection;
106
107typedef union { 69typedef union {
108 int i; 70 int i;
109 uint ui; 71 uint ui;
@@ -137,11 +99,9 @@ void selclear(void);
137void selinit(void); 99void selinit(void);
138void selstart(int, int, int); 100void selstart(int, int, int);
139void selextend(int, int, int, int); 101void selextend(int, int, int, int);
140void selnormalize(void);
141int selected(int, int); 102int selected(int, int);
142char *getsel(void); 103char *getsel(void);
143 104
144size_t utf8decode(const char *, Rune *, size_t);
145size_t utf8encode(Rune, char *); 105size_t utf8encode(Rune, char *);
146 106
147void *xmalloc(size_t); 107void *xmalloc(size_t);