From d04547258a86ffb9245467c62e8bd9e13b60ce73 Mon Sep 17 00:00:00 2001 From: ayin Date: Sat, 8 Sep 2007 20:55:49 +0000 Subject: [PATCH] Remove unused function. --- src/misc.C | 85 ------------------------------------------------------ src/rxvt.h | 1 - 2 files changed, 86 deletions(-) diff --git a/src/misc.C b/src/misc.C index 98caa73f..f65cde4a 100644 --- a/src/misc.C +++ b/src/misc.C @@ -261,91 +261,6 @@ rxvt_Str_trim (char *str) NOTHROW return str; } -/* - * in-place interpretation of string: - * - * backslash-escaped: "\a\b\E\e\n\r\t", "\octal" - * Ctrl chars: ^@ .. ^_, ^? - * - * Emacs-style: "M-" prefix - * - * Also, - * "M-x" prefixed strings, append "\r" if needed - * "\E]" prefixed strings (XTerm escape sequence) append ST if needed - * - * returns the converted string length - */ -int -rxvt_Str_escaped (char *str) NOTHROW -{ - char ch, *s, *d; - int i, num, append = 0; - - if (!str || !*str) - return 0; - - d = s = str; - - if (*s == 'M' && s[1] == '-') - { - /* Emacs convenience, replace leading `M-..' with `\E..' */ - *d++ = C0_ESC; - s += 2; - if (toupper (*s) == 'X') - /* append carriage-return for `M-xcommand' */ - for (*d++ = 'x', append = '\r', s++; isspace (*s); s++) ; - } - for (; (ch = *s++);) - { - if (ch == '\\') - { - ch = *s++; - if (ch >= '0' && ch <= '7') - { /* octal */ - num = ch - '0'; - for (i = 0; i < 2; i++, s++) - { - ch = *s; - if (ch < '0' || ch > '7') - break; - num = num * 8 + ch - '0'; - } - ch = (char)num; - } - else if (ch == 'a') - ch = C0_BEL; /* bell */ - else if (ch == 'b') - ch = C0_BS; /* backspace */ - else if (ch == 'E' || ch == 'e') - ch = C0_ESC; /* escape */ - else if (ch == 'n') - ch = '\n'; /* newline */ - else if (ch == 'r') - ch = '\r'; /* carriage-return */ - else if (ch == 't') - ch = C0_HT; /* tab */ - } - else if (ch == '^') - { - ch = *s++; - ch = toupper (ch); - ch = (ch == '?' ? 127 : (ch - '@')); - } - *d++ = ch; - } - - /* ESC] is an XTerm escape sequence, must be terminated */ - if (*str == '\0' && str[1] == C0_ESC && str[2] == ']') - append = CHAR_ST; - - /* add trailing character as required */ - if (append && d[-1] != append) - *d++ = append; - *d = '\0'; - - return (d - str); -} - /* * Split a comma-separated string into an array, stripping leading and * trailing spaces from each entry. Empty strings are properly returned diff --git a/src/rxvt.h b/src/rxvt.h index 8370d6f1..31a98298 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -121,7 +121,6 @@ void rxvt_fatal (const char *fmt, ...) THROW ( void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; char * rxvt_Str_trim (char *str) NOTHROW; -int rxvt_Str_escaped (char *str) NOTHROW; char ** rxvt_splitcommastring (const char *cs) NOTHROW; void rxvt_freecommastring (char **cs) NOTHROW; -- 2.34.1