aboutsummaryrefslogtreecommitdiffstats
path: root/src/termcap.c
diff options
context:
space:
mode:
authorRichard M. Stallman1998-08-18 20:58:45 +0000
committerRichard M. Stallman1998-08-18 20:58:45 +0000
commit1ddd1e348ac050b94883146ee427960fe5d71fdb (patch)
tree92ce1255e673e007dff73fb1831cb7eff6c6c037 /src/termcap.c
parent64e49fa8935aed03a1916f85666c80ad2608978c (diff)
downloademacs-1ddd1e348ac050b94883146ee427960fe5d71fdb.tar.gz
emacs-1ddd1e348ac050b94883146ee427960fe5d71fdb.zip
(tgetst1): Supprt EBCDIC systems.
(esctab): Alternate definition if IS_EBCDIC_HOST.
Diffstat (limited to 'src/termcap.c')
-rw-r--r--src/termcap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/termcap.c b/src/termcap.c
index 8537d801b40..c447ce8b4b0 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -173,6 +173,17 @@ tgetstr (cap, area)
173 return tgetst1 (ptr, area); 173 return tgetst1 (ptr, area);
174} 174}
175 175
176#ifdef IS_EBCDIC_HOST
177/* Table, indexed by a character in range 0200 to 0300 with 0200 subtracted,
178 gives meaning of character following \, or a space if no special meaning.
179 Sixteen characters per line within the string. */
180
181static char esctab[]
182 = " \057\026 \047\014 \
183 \025 \015 \
184 \005 \013 \
185 ";
186#else
176/* Table, indexed by a character in range 0100 to 0140 with 0100 subtracted, 187/* Table, indexed by a character in range 0100 to 0140 with 0100 subtracted,
177 gives meaning of character following \, or a space if no special meaning. 188 gives meaning of character following \, or a space if no special meaning.
178 Eight characters per line within the string. */ 189 Eight characters per line within the string. */
@@ -182,6 +193,7 @@ static char esctab[]
182 \012 \ 193 \012 \
183 \015 \011 \013 \ 194 \015 \011 \013 \
184 "; 195 ";
196#endif
185 197
186/* PTR points to a string value inside a termcap entry. 198/* PTR points to a string value inside a termcap entry.
187 Copy that value, processing \ and ^ abbreviations, 199 Copy that value, processing \ and ^ abbreviations,
@@ -245,12 +257,21 @@ tgetst1 (ptr, area)
245 p++; 257 p++;
246 } 258 }
247 } 259 }
260#ifdef IS_EBCDIC_HOST
261 else if (c >= 0200 && c < 0360)
262 {
263 c1 = esctab[(c & ~0100) - 0200];
264 if (c1 != ' ')
265 c = c1;
266 }
267#else
248 else if (c >= 0100 && c < 0200) 268 else if (c >= 0100 && c < 0200)
249 { 269 {
250 c1 = esctab[(c & ~040) - 0100]; 270 c1 = esctab[(c & ~040) - 0100];
251 if (c1 != ' ') 271 if (c1 != ' ')
252 c = c1; 272 c = c1;
253 } 273 }
274#endif
254 } 275 }
255 *r++ = c; 276 *r++ = c;
256 } 277 }