Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Simplify techo
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
70caf82
..
e510565
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-36,10
+36,6
@@
char *argv0;
#define Glyph Glyph_
#define Font Font_
#define Glyph Glyph_
#define Font Font_
-#define Draw XftDraw *
-#define Colour XftColor
-#define Colourmap Colormap
-#define Rectangle XRectangle
#if defined(__linux)
#include <pty.h>
#if defined(__linux)
#include <pty.h>
@@
-180,6
+176,10
@@
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned long ulong;
typedef unsigned short ushort;
+typedef XftDraw *Draw;
+typedef XftColor Colour;
+typedef Colormap Colourmap;
+
typedef struct {
char c[UTF_SIZ]; /* character code */
ushort mode; /* attribute flags */
typedef struct {
char c[UTF_SIZ]; /* character code */
ushort mode; /* attribute flags */
@@
-2318,10
+2318,7
@@
techo(char *buf, int len) {
for(; len > 0; buf++, len--) {
char c = *buf;
for(; len > 0; buf++, len--) {
char c = *buf;
- if(c == '\033') { /* escape */
- tputc("^", 1);
- tputc("[", 1);
- } else if(c < '\x20') { /* control code */
+ if(c < '\x20') { /* control code */
if(c != '\n' && c != '\r' && c != '\t') {
c |= '\x40';
tputc("^", 1);
if(c != '\n' && c != '\r' && c != '\t') {
c |= '\x40';
tputc("^", 1);
@@
-3110,7
+3107,7
@@
xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
FcCharSet *fccharset;
Colour *fg, *bg, *temp, revfg, revbg, truefg, truebg;
XRenderColor colfg, colbg;
FcCharSet *fccharset;
Colour *fg, *bg, *temp, revfg, revbg, truefg, truebg;
XRenderColor colfg, colbg;
- Rectangle r;
+
X
Rectangle r;
int oneatatime;
frcflags = FRC_NORMAL;
int oneatatime;
frcflags = FRC_NORMAL;