aboutsummaryrefslogtreecommitdiff
path: root/st.h
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2009-06-11 16:41:14 +0200
committerAurélien Aptel <aurelien.aptel@gmail.com>2009-06-11 16:41:14 +0200
commitad39f000be87ec16e74c05bdc3fa81ef307b5477 (patch)
tree06fbb74004f4e5c3c071ceb3918c278ae229e616 /st.h
parent2f35cef54b5a32b5498aded0a25f78d0d973a152 (diff)
downloadst-patched-ad39f000be87ec16e74c05bdc3fa81ef307b5477.tar.bz2
st-patched-ad39f000be87ec16e74c05bdc3fa81ef307b5477.tar.xz
st-patched-ad39f000be87ec16e74c05bdc3fa81ef307b5477.zip
added sigchld handler, cleaned error checking.
Diffstat (limited to 'st.h')
-rw-r--r--st.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/st.h b/st.h
index 4652a33..0bd2c4e 100644
--- a/st.h
+++ b/st.h
@@ -1,16 +1,19 @@
1/* See LICENSE for licence details. */ 1/* See LICENSE for licence details. */
2#define _XOPEN_SOURCE 2#define _XOPEN_SOURCE
3#include <ctype.h> 3#include <ctype.h>
4#include <errno.h>
4#include <fcntl.h> 5#include <fcntl.h>
5#include <locale.h> 6#include <locale.h>
6#include <stdarg.h> 7#include <stdarg.h>
7#include <stdio.h> 8#include <stdio.h>
8#include <stdlib.h> 9#include <stdlib.h>
9#include <string.h> 10#include <string.h>
11#include <signal.h>
10#include <sys/ioctl.h> 12#include <sys/ioctl.h>
11#include <sys/select.h> 13#include <sys/select.h>
12#include <sys/stat.h> 14#include <sys/stat.h>
13#include <sys/types.h> 15#include <sys/types.h>
16#include <sys/wait.h>
14#include <unistd.h> 17#include <unistd.h>
15#include <X11/Xlib.h> 18#include <X11/Xlib.h>
16#include <X11/keysym.h> 19#include <X11/keysym.h>
@@ -52,6 +55,7 @@ static char* colorname[] = {
52#define ESCSIZ 256 55#define ESCSIZ 256
53#define ESCARG 16 56#define ESCARG 16
54 57
58#define SERRNO strerror(errno)
55#define MIN(a, b) ((a) < (b) ? (a) : (b)) 59#define MIN(a, b) ((a) < (b) ? (a) : (b))
56#define MAX(a, b) ((a) < (b) ? (b) : (a)) 60#define MAX(a, b) ((a) < (b) ? (b) : (a))
57#define LEN(a) (sizeof(a) / sizeof(a[0])) 61#define LEN(a) (sizeof(a) / sizeof(a[0]))
@@ -63,7 +67,7 @@ static char* colorname[] = {
63enum { ATnone=0 , ATreverse=1 , ATunderline=2, ATbold=4 }; /* Attribute */ 67enum { ATnone=0 , ATreverse=1 , ATunderline=2, ATbold=4 }; /* Attribute */
64enum { CSup, CSdown, CSright, CSleft, CShide, CSdraw, CSwrap, CSsave, CSload }; /* Cursor */ 68enum { CSup, CSdown, CSright, CSleft, CShide, CSdraw, CSwrap, CSsave, CSload }; /* Cursor */
65enum { CRset=1 , CRupdate=2 }; /* Character state */ 69enum { CRset=1 , CRupdate=2 }; /* Character state */
66enum { TMwrap=1 , TMinsert=2 }; /* Terminal mode */ 70enum { TMwrap=1 , TMinsert=2, TMaltcharset }; /* Terminal mode */
67enum { SCupdate, SCredraw }; /* screen draw mode */ 71enum { SCupdate, SCredraw }; /* screen draw mode */
68 72
69typedef int Color; 73typedef int Color;
@@ -130,6 +134,7 @@ typedef struct {
130void die(const char *errstr, ...); 134void die(const char *errstr, ...);
131void draw(int); 135void draw(int);
132void execsh(void); 136void execsh(void);
137void sigchld(int);
133void kpress(XKeyEvent *); 138void kpress(XKeyEvent *);
134void resize(XEvent *); 139void resize(XEvent *);
135void run(void); 140void run(void);