diff options
| author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2009-06-11 16:41:14 +0200 |
|---|---|---|
| committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2009-06-11 16:41:14 +0200 |
| commit | ad39f000be87ec16e74c05bdc3fa81ef307b5477 (patch) | |
| tree | 06fbb74004f4e5c3c071ceb3918c278ae229e616 /st.h | |
| parent | cleaned up (removed space indentation). select/event bug fixed. (diff) | |
| download | st-ad39f000be87ec16e74c05bdc3fa81ef307b5477.tar.gz st-ad39f000be87ec16e74c05bdc3fa81ef307b5477.zip | |
added sigchld handler, cleaned error checking.
Diffstat (limited to 'st.h')
| -rw-r--r-- | st.h | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -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[] = { | |||
| 63 | enum { ATnone=0 , ATreverse=1 , ATunderline=2, ATbold=4 }; /* Attribute */ | 67 | enum { ATnone=0 , ATreverse=1 , ATunderline=2, ATbold=4 }; /* Attribute */ |
| 64 | enum { CSup, CSdown, CSright, CSleft, CShide, CSdraw, CSwrap, CSsave, CSload }; /* Cursor */ | 68 | enum { CSup, CSdown, CSright, CSleft, CShide, CSdraw, CSwrap, CSsave, CSload }; /* Cursor */ |
| 65 | enum { CRset=1 , CRupdate=2 }; /* Character state */ | 69 | enum { CRset=1 , CRupdate=2 }; /* Character state */ |
| 66 | enum { TMwrap=1 , TMinsert=2 }; /* Terminal mode */ | 70 | enum { TMwrap=1 , TMinsert=2, TMaltcharset }; /* Terminal mode */ |
| 67 | enum { SCupdate, SCredraw }; /* screen draw mode */ | 71 | enum { SCupdate, SCredraw }; /* screen draw mode */ |
| 68 | 72 | ||
| 69 | typedef int Color; | 73 | typedef int Color; |
| @@ -130,6 +134,7 @@ typedef struct { | |||
| 130 | void die(const char *errstr, ...); | 134 | void die(const char *errstr, ...); |
| 131 | void draw(int); | 135 | void draw(int); |
| 132 | void execsh(void); | 136 | void execsh(void); |
| 137 | void sigchld(int); | ||
| 133 | void kpress(XKeyEvent *); | 138 | void kpress(XKeyEvent *); |
| 134 | void resize(XEvent *); | 139 | void resize(XEvent *); |
| 135 | void run(void); | 140 | void run(void); |
