diff options
| author | Devin J. Pohly <djpohly@gmail.com> | 2017-10-17 15:21:04 -0500 |
|---|---|---|
| committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
| commit | 65976c1a29f2945c3cfb6af74cd6440cf193021d (patch) | |
| tree | 670d2b3063767c1363322d6db5e73447e682081a /st.c | |
| parent | Factor out equivalent code from ttyread/ttysend (diff) | |
| download | st-65976c1a29f2945c3cfb6af74cd6440cf193021d.tar.gz st-65976c1a29f2945c3cfb6af74cd6440cf193021d.zip | |
Move config.h include from st.c to x.c
config.h includes references to KeySyms and other X stuff. Until we
come up with a cleaner way to separate configuration, it is simpler
(leads to more code removal) to have this here.
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Diffstat (limited to '')
| -rw-r--r-- | st.c | 47 |
1 files changed, 4 insertions, 43 deletions
| @@ -109,19 +109,6 @@ typedef struct { | |||
| 109 | int narg; /* nb of args */ | 109 | int narg; /* nb of args */ |
| 110 | } STREscape; | 110 | } STREscape; |
| 111 | 111 | ||
| 112 | /* function definitions used in config.h */ | ||
| 113 | static void clipcopy(const Arg *); | ||
| 114 | static void clippaste(const Arg *); | ||
| 115 | static void numlock(const Arg *); | ||
| 116 | static void selpaste(const Arg *); | ||
| 117 | static void printsel(const Arg *); | ||
| 118 | static void printscreen(const Arg *) ; | ||
| 119 | static void iso14755(const Arg *); | ||
| 120 | static void toggleprinter(const Arg *); | ||
| 121 | static void sendbreak(const Arg *); | ||
| 122 | |||
| 123 | /* config.h for applying patches and the configuration. */ | ||
| 124 | #include "config.h" | ||
| 125 | 112 | ||
| 126 | static void execsh(char **); | 113 | static void execsh(char **); |
| 127 | static void stty(char **); | 114 | static void stty(char **); |
| @@ -199,14 +186,6 @@ static uchar utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; | |||
| 199 | static Rune utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; | 186 | static Rune utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; |
| 200 | static Rune utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; | 187 | static Rune utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; |
| 201 | 188 | ||
| 202 | /* config.h array lengths */ | ||
| 203 | size_t colornamelen = LEN(colorname); | ||
| 204 | size_t mshortcutslen = LEN(mshortcuts); | ||
| 205 | size_t shortcutslen = LEN(shortcuts); | ||
| 206 | size_t selmaskslen = LEN(selmasks); | ||
| 207 | size_t keyslen = LEN(key); | ||
| 208 | size_t mappedkeyslen = LEN(mappedkeys); | ||
| 209 | |||
| 210 | ssize_t | 189 | ssize_t |
| 211 | xwrite(int fd, const char *s, size_t len) | 190 | xwrite(int fd, const char *s, size_t len) |
| 212 | { | 191 | { |
| @@ -586,24 +565,6 @@ getsel(void) | |||
| 586 | } | 565 | } |
| 587 | 566 | ||
| 588 | void | 567 | void |
| 589 | selpaste(const Arg *dummy) | ||
| 590 | { | ||
| 591 | xselpaste(); | ||
| 592 | } | ||
| 593 | |||
| 594 | void | ||
| 595 | clipcopy(const Arg *dummy) | ||
| 596 | { | ||
| 597 | xclipcopy(); | ||
| 598 | } | ||
| 599 | |||
| 600 | void | ||
| 601 | clippaste(const Arg *dummy) | ||
| 602 | { | ||
| 603 | xclippaste(); | ||
| 604 | } | ||
| 605 | |||
| 606 | void | ||
| 607 | selclear(void) | 568 | selclear(void) |
| 608 | { | 569 | { |
| 609 | if (sel.ob.x == -1) | 570 | if (sel.ob.x == -1) |
| @@ -1572,7 +1533,7 @@ csihandle(void) | |||
| 1572 | break; | 1533 | break; |
| 1573 | case 'c': /* DA -- Device Attributes */ | 1534 | case 'c': /* DA -- Device Attributes */ |
| 1574 | if (csiescseq.arg[0] == 0) | 1535 | if (csiescseq.arg[0] == 0) |
| 1575 | ttywrite(vtiden, sizeof(vtiden) - 1); | 1536 | ttywrite(vtiden, strlen(vtiden)); |
| 1576 | break; | 1537 | break; |
| 1577 | case 'C': /* CUF -- Cursor <n> Forward */ | 1538 | case 'C': /* CUF -- Cursor <n> Forward */ |
| 1578 | case 'a': /* HPR -- Cursor <n> Forward */ | 1539 | case 'a': /* HPR -- Cursor <n> Forward */ |
| @@ -1791,7 +1752,7 @@ strhandle(void) | |||
| 1791 | dec = base64dec(strescseq.args[2]); | 1752 | dec = base64dec(strescseq.args[2]); |
| 1792 | if (dec) { | 1753 | if (dec) { |
| 1793 | xsetsel(dec, CurrentTime); | 1754 | xsetsel(dec, CurrentTime); |
| 1794 | clipcopy(NULL); | 1755 | xclipcopy(); |
| 1795 | } else { | 1756 | } else { |
| 1796 | fprintf(stderr, "erresc: invalid base64\n"); | 1757 | fprintf(stderr, "erresc: invalid base64\n"); |
| 1797 | } | 1758 | } |
| @@ -2134,7 +2095,7 @@ tcontrolcode(uchar ascii) | |||
| 2134 | case 0x99: /* TODO: SGCI */ | 2095 | case 0x99: /* TODO: SGCI */ |
| 2135 | break; | 2096 | break; |
| 2136 | case 0x9a: /* DECID -- Identify Terminal */ | 2097 | case 0x9a: /* DECID -- Identify Terminal */ |
| 2137 | ttywrite(vtiden, sizeof(vtiden) - 1); | 2098 | ttywrite(vtiden, strlen(vtiden)); |
| 2138 | break; | 2099 | break; |
| 2139 | case 0x9b: /* TODO: CSI */ | 2100 | case 0x9b: /* TODO: CSI */ |
| 2140 | case 0x9c: /* TODO: ST */ | 2101 | case 0x9c: /* TODO: ST */ |
| @@ -2206,7 +2167,7 @@ eschandle(uchar ascii) | |||
| 2206 | } | 2167 | } |
| 2207 | break; | 2168 | break; |
| 2208 | case 'Z': /* DECID -- Identify Terminal */ | 2169 | case 'Z': /* DECID -- Identify Terminal */ |
| 2209 | ttywrite(vtiden, sizeof(vtiden) - 1); | 2170 | ttywrite(vtiden, strlen(vtiden)); |
| 2210 | break; | 2171 | break; |
| 2211 | case 'c': /* RIS -- Reset to inital state */ | 2172 | case 'c': /* RIS -- Reset to inital state */ |
| 2212 | treset(); | 2173 | treset(); |
