diff options
author | Quentin Rameau <quinq@fifth.space> | 2018-09-11 13:11:28 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-09-11 19:05:55 +0200 |
commit | 67d0cb65d0794e2d91e72e5fa1e3612172e5812e (patch) | |
tree | d8275afb0f98a5171bc459b5e45c4bc2a67a92f5 /st.c | |
parent | 4f4bccd1627c845330235721f593d2e93418723d (diff) | |
download | st-67d0cb65d0794e2d91e72e5fa1e3612172e5812e.tar.gz st-67d0cb65d0794e2d91e72e5fa1e3612172e5812e.zip |
Remove the ISO 14755 feature
And move it to the patches section.
Keeping it would force to add an exec pledge on OpenBSD, and some
people think it's bloated, so bye!
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -38,15 +38,11 @@ | |||
38 | 38 | ||
39 | /* macros */ | 39 | /* macros */ |
40 | #define IS_SET(flag) ((term.mode & (flag)) != 0) | 40 | #define IS_SET(flag) ((term.mode & (flag)) != 0) |
41 | #define NUMMAXLEN(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) | ||
42 | #define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177') | 41 | #define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177') |
43 | #define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) | 42 | #define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) |
44 | #define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) | 43 | #define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) |
45 | #define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL) | 44 | #define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL) |
46 | 45 | ||
47 | /* constants */ | ||
48 | #define ISO14755CMD "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null" | ||
49 | |||
50 | enum term_mode { | 46 | enum term_mode { |
51 | MODE_WRAP = 1 << 0, | 47 | MODE_WRAP = 1 << 0, |
52 | MODE_INSERT = 1 << 1, | 48 | MODE_INSERT = 1 << 1, |
@@ -1982,28 +1978,6 @@ tprinter(char *s, size_t len) | |||
1982 | } | 1978 | } |
1983 | 1979 | ||
1984 | void | 1980 | void |
1985 | iso14755(const Arg *arg) | ||
1986 | { | ||
1987 | FILE *p; | ||
1988 | char *us, *e, codepoint[9], uc[UTF_SIZ]; | ||
1989 | unsigned long utf32; | ||
1990 | |||
1991 | if (!(p = popen(ISO14755CMD, "r"))) | ||
1992 | return; | ||
1993 | |||
1994 | us = fgets(codepoint, sizeof(codepoint), p); | ||
1995 | pclose(p); | ||
1996 | |||
1997 | if (!us || *us == '\0' || *us == '-' || strlen(us) > 7) | ||
1998 | return; | ||
1999 | if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX || | ||
2000 | (*e != '\n' && *e != '\0')) | ||
2001 | return; | ||
2002 | |||
2003 | ttywrite(uc, utf8encode(utf32, uc), 1); | ||
2004 | } | ||
2005 | |||
2006 | void | ||
2007 | toggleprinter(const Arg *arg) | 1981 | toggleprinter(const Arg *arg) |
2008 | { | 1982 | { |
2009 | term.mode ^= MODE_PRINT; | 1983 | term.mode ^= MODE_PRINT; |