aboutsummaryrefslogtreecommitdiff
path: root/readline/chardefs.h
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1994-01-16 03:39:57 +0000
committerPer Bothner <per@bothner.com>1994-01-16 03:39:57 +0000
commit5e98bbab1738932aeeb251684bba6aa550f5885a (patch)
treee51fd93e8d56b82ea1e55ab8cece5ecb2c0af014 /readline/chardefs.h
parent8b564df836ca7baffe636c1a16658cdcb6388080 (diff)
downloadgdb-5e98bbab1738932aeeb251684bba6aa550f5885a.zip
gdb-5e98bbab1738932aeeb251684bba6aa550f5885a.tar.gz
gdb-5e98bbab1738932aeeb251684bba6aa550f5885a.tar.bz2
Merge in changes from bash-1.13. The most obvious one is
that the file readline.c has been split into multiple files. * bind.c, complete.c, dispay.c, isearch.c, parens.c, rldefs.h, rltty.c, search.c signals.c, tilde.c, tilde.h, xmalloc.c: New files.
Diffstat (limited to 'readline/chardefs.h')
-rw-r--r--readline/chardefs.h49
1 files changed, 46 insertions, 3 deletions
diff --git a/readline/chardefs.h b/readline/chardefs.h
index 9749ae4..43d8539 100644
--- a/readline/chardefs.h
+++ b/readline/chardefs.h
@@ -1,8 +1,21 @@
/* chardefs.h -- Character definitions for readline. */
#ifndef _CHARDEFS_
+#define _CHARDEFS_
+
+#include <ctype.h>
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#else
+# include <strings.h>
+#endif /* HAVE_STRING_H */
#ifndef savestring
-#define savestring(x) (char *)strcpy (xmalloc (1 + strlen (x)), (x))
+extern char *xmalloc ();
+# ifndef strcpy
+extern char *strcpy ();
+# endif
+#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
#endif
#ifndef whitespace
@@ -14,11 +27,13 @@
#endif
/* Some character stuff. */
-#define control_character_threshold 0x020 /* smaller than this is control */
-#define meta_character_threshold 0x07f /* larger than this is Meta. */
+#define control_character_threshold 0x020 /* Smaller than this is control. */
+#define meta_character_threshold 0x07f /* Larger than this is Meta. */
#define control_character_bit 0x40 /* 0x000000, must be off. */
#define meta_character_bit 0x080 /* x0000000, must be on. */
+#define largest_char 255 /* Largest character value. */
+#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
#define CTRL(c) ((c) & (~control_character_bit))
#define META(c) ((c) | meta_character_bit)
@@ -38,13 +53,41 @@
#define CTRL_P(c) ((c) < control_character_threshold)
#define META_P(c) ((c) > meta_character_threshold)
+#ifndef NEWLINE
#define NEWLINE '\n'
+#endif
+
+#ifndef RETURN
#define RETURN CTRL('M')
+#endif
+
+#ifndef RUBOUT
#define RUBOUT 0x07f
+#endif
+
+#ifndef TAB
#define TAB '\t'
+#endif
+
+#ifdef ABORT_CHAR
+#undef ABORT_CHAR
+#endif
#define ABORT_CHAR CTRL('G')
+
+#ifdef PAGE
+#undef PAGE
+#endif
#define PAGE CTRL('L')
+
+#ifdef SPACE
+#undef SPACE
+#endif
#define SPACE 0x020
+
+#ifdef ESC
+#undef ESC
+#endif
+
#define ESC CTRL('[')
#endif /* _CHARDEFS_ */