X-Git-Url: https://git.danieliu.xyz/?p=st.git;a=blobdiff_plain;f=st.h;h=e1b5057aba826ba19fe926d1f241fe97a8231be2;hp=0a7472ba8d702dabc5fa94ad3e2c4d953b6c296a;hb=ddb08dfe82ca196bb4f6e554e7db0fd32da58ba2;hpb=30683c70ab62fd37b5921cf72077b9aef2cb842e diff --git a/st.h b/st.h index 0a7472b..e1b5057 100644 --- a/st.h +++ b/st.h @@ -1,13 +1,14 @@ /* See LICENSE for license details. */ -/* Arbitrary sizes */ -#define UTF_SIZ 4 +#include +#include /* macros */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) < (b) ? (b) : (a)) #define LEN(a) (sizeof(a) / sizeof(a)[0]) #define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) +#define OUT(x, a, b) ((a) <= (x) || (x) <= (b)) #define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) #define DEFAULT(a, b) (a) = (a) ? (a) : (b) #define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) @@ -69,53 +70,19 @@ typedef struct { typedef Glyph *Line; -typedef struct { - Glyph attr; /* current char attributes */ - int x; - int y; - char state; -} TCursor; - -/* 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 newterm(const Arg *); void printscreen(const Arg *); void printsel(const Arg *); void sendbreak(const Arg *); @@ -137,23 +104,25 @@ 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 *); +int subprocwd(char *); + /* config.h globals */ 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;