[hackers] [st] Added basic xterm-ish palette swap support. || Alexander Sedov
commit 800800a3bba020f1e71e821b31c1ad037aab64ee
Author: Alexander Sedov <alex0player_AT_gmail.com>
Date: Tue Feb 19 21:39:13 2013 +0400
Added basic xterm-ish palette swap support.
Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>
diff --git a/st.c b/st.c
index 300e5ec..c25f24c 100644
--- a/st.c
+++ b/st.c
_AT_@ -302,6 +302,7 @@ static void execsh(void);
static void sigchld(int);
static void run(void);
+static inline int parse_int(char *);
static void csidump(void);
static void csihandle(void);
static void csiparse(void);
_AT_@ -348,6 +349,7 @@ static void xclear(int, int, int, int);
static void xdrawcursor(void);
static void xinit(void);
static void xloadcols(void);
+static int xsetcolorname(int, const char *);
static int xloadfont(Font *, FcPattern *);
static void xloadfonts(char *, int);
static void xresettitle(void);
_AT_@ -1855,34 +1857,58 @@ csireset(void) {
memset(&csiescseq, 0, sizeof(csiescseq));
}
+inline int
+parse_int(char *s) {
+ int x = 0;
+ char c;
+ while(isdigit(c = *s)) {
+ if((INT_MAX - c + '0') / 10 >= x) {
+ x = x * 10 + c - '0';
+ } else
+ return -1;
+ s++;
+ }
+ if(*s != '
Received on Fri Feb 22 2013 - 15:56:05 CET
This archive was generated by hypermail 2.3.0
: Fri Feb 22 2013 - 16:00:08 CET