X-Git-Url: https://git.xinqibao.xyz/st.git/blobdiff_plain/88d8293fb4ba150a5f19d58d133b5db93d9dcfa5..2f6e597ed871cff91c627850d03152cae5f45779:/st.h?ds=inline
diff --git a/st.h b/st.h
index 7026de8..fa2eddf 100644
--- a/st.h
+++ b/st.h
@@ -1,7 +1,7 @@
/* See LICENSE for license details. */
-/* Arbitrary sizes */
-#define UTF_SIZ 4
+#include <stdint.h>
+#include <sys/types.h>
/* macros */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
@@ -69,71 +69,18 @@ typedef struct {
typedef Glyph *Line;
-typedef struct {
- Glyph attr; /* current char attributes */
- int x;
- int y;
- char state;
-} TCursor;
-
-/* Internal representation of the screen */
-typedef struct {
- int row; /* nb row */
- int col; /* nb col */
- Line *line; /* screen */
- Line *alt; /* alternate screen */
- int *dirty; /* dirtyness of lines */
- TCursor c; /* cursor */
- int top; /* top scroll limit */
- int bot; /* bottom scroll limit */
- int mode; /* terminal mode flags */
- int esc; /* escape state flags */
- char trantbl[4]; /* charset table translation */
- int charset; /* current charset */
- int icharset; /* selected charset for sequence */
- int *tabs;
-} Term;
-
-/* Purely graphic info */
-typedef struct {
- int tw, th; /* tty width and height */
- int w, h; /* window width and height */
- int ch; /* char height */
- int cw; /* char width */
- int mode; /* window state/mode flags */
- int cursor; /* cursor style */
-} TermWindow;
-
-typedef struct {
- int mode;
- int type;
- int snap;
- /*
- * Selection variables:
- * nb â normalized coordinates of the beginning of the selection
- * ne â normalized coordinates of the end of the selection
- * ob â original coordinates of the beginning of the selection
- * oe â original coordinates of the end of the selection
- */
- struct {
- int x, y;
- } nb, ne, ob, oe;
-
- int alt;
-} Selection;
-
typedef union {
int i;
uint ui;
float f;
const void *v;
+ const char *s;
} Arg;
void die(const char *, ...);
void redraw(void);
void draw(void);
-void iso14755(const Arg *);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);
@@ -143,7 +90,8 @@ int tattrset(int);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
-void ttynew(char *, char *, char **);
+void ttyhangup(void);
+int ttynew(const char *, char *, const char *, char **);
size_t ttyread(void);
void ttyresize(int, int);
void ttywrite(const char *, size_t, int);
@@ -154,30 +102,23 @@ void selclear(void);
void selinit(void);
void selstart(int, int, int);
void selextend(int, int, int, int);
-void selnormalize(void);
int selected(int, int);
char *getsel(void);
-size_t utf8decode(const char *, Rune *, size_t);
size_t utf8encode(Rune, char *);
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
-char *xstrdup(char *);
-
-/* Globals */
-extern Term term;
-extern int cmdfd;
-extern pid_t pid;
-extern int oldbutton;
+char *xstrdup(const char *);
/* config.h globals */
-extern char *shell;
extern char *utmp;
+extern char *scroll;
extern char *stty_args;
extern char *vtiden;
-extern char *worddelimiters;
+extern wchar_t *worddelimiters;
extern int allowaltscreen;
+extern int allowwindowops;
extern char *termname;
extern unsigned int tabspaces;
extern unsigned int defaultfg;