1991-03-28 16:26:26 +00:00
|
|
|
/* chardefs.h -- Character definitions for readline. */
|
|
|
|
#ifndef _CHARDEFS_
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#define _CHARDEFS_
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
1994-01-22 02:06:58 +00:00
|
|
|
#if 0
|
|
|
|
/* Getting the correct definition of HAVE_STRING_H is harder than just
|
|
|
|
declaring them ourselves. CYGNUS LOCAL. */
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#if defined (HAVE_STRING_H)
|
|
|
|
# include <string.h>
|
|
|
|
#else
|
|
|
|
# include <strings.h>
|
|
|
|
#endif /* HAVE_STRING_H */
|
1994-01-22 02:06:58 +00:00
|
|
|
#else /* not 0 */
|
|
|
|
/* We don't worry about declaring functions where we don't use the return
|
|
|
|
value (e.g. strcpy) or which return int. */
|
|
|
|
extern char *strrchr ();
|
|
|
|
#endif /* not 0 */
|
1991-03-28 16:26:26 +00:00
|
|
|
|
|
|
|
#ifndef savestring
|
1994-01-16 18:48:02 +00:00
|
|
|
#if 0
|
|
|
|
|
|
|
|
/* CYGNUS LOCAL--this declaration loses if xmalloc has already been
|
|
|
|
declared as void *xmalloc (), as in GDB. The whole concept of
|
|
|
|
readline using xmalloc rather than just returning NULL when it runs
|
|
|
|
out of memory is questionable, but if we do want xmalloc we need a
|
|
|
|
better way to declare it (e.g. the client declares it, or the client
|
|
|
|
calls a rl_register_xmalloc function analagous to the way signal()
|
|
|
|
works. */
|
|
|
|
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
extern char *xmalloc ();
|
1994-01-16 18:48:02 +00:00
|
|
|
#endif
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
# ifndef strcpy
|
|
|
|
extern char *strcpy ();
|
|
|
|
# endif
|
|
|
|
#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
|
1991-03-28 16:26:26 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef whitespace
|
|
|
|
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CTRL
|
|
|
|
#undef CTRL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Some character stuff. */
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#define control_character_threshold 0x020 /* Smaller than this is control. */
|
|
|
|
#define meta_character_threshold 0x07f /* Larger than this is Meta. */
|
1991-03-28 16:26:26 +00:00
|
|
|
#define control_character_bit 0x40 /* 0x000000, must be off. */
|
|
|
|
#define meta_character_bit 0x080 /* x0000000, must be on. */
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#define largest_char 255 /* Largest character value. */
|
1991-03-28 16:26:26 +00:00
|
|
|
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
|
1991-03-28 16:26:26 +00:00
|
|
|
#define CTRL(c) ((c) & (~control_character_bit))
|
|
|
|
#define META(c) ((c) | meta_character_bit)
|
|
|
|
|
|
|
|
#define UNMETA(c) ((c) & (~meta_character_bit))
|
|
|
|
#define UNCTRL(c) to_upper(((c)|control_character_bit))
|
|
|
|
|
|
|
|
#define lowercase_p(c) (((c) > ('a' - 1) && (c) < ('z' + 1)))
|
|
|
|
#define uppercase_p(c) (((c) > ('A' - 1) && (c) < ('Z' + 1)))
|
|
|
|
|
|
|
|
#define pure_alphabetic(c) (lowercase_p(c) || uppercase_p(c))
|
|
|
|
|
|
|
|
#ifndef to_upper
|
|
|
|
#define to_upper(c) (lowercase_p(c) ? ((c) - 32) : (c))
|
|
|
|
#define to_lower(c) (uppercase_p(c) ? ((c) + 32) : (c))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CTRL_P(c) ((c) < control_character_threshold)
|
|
|
|
#define META_P(c) ((c) > meta_character_threshold)
|
|
|
|
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#ifndef NEWLINE
|
1991-03-28 16:26:26 +00:00
|
|
|
#define NEWLINE '\n'
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RETURN
|
1991-03-28 16:26:26 +00:00
|
|
|
#define RETURN CTRL('M')
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RUBOUT
|
1991-03-28 16:26:26 +00:00
|
|
|
#define RUBOUT 0x07f
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TAB
|
1991-03-28 16:26:26 +00:00
|
|
|
#define TAB '\t'
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ABORT_CHAR
|
|
|
|
#undef ABORT_CHAR
|
|
|
|
#endif
|
1991-03-28 16:26:26 +00:00
|
|
|
#define ABORT_CHAR CTRL('G')
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
|
|
|
|
#ifdef PAGE
|
|
|
|
#undef PAGE
|
|
|
|
#endif
|
1991-03-28 16:26:26 +00:00
|
|
|
#define PAGE CTRL('L')
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
|
|
|
|
#ifdef SPACE
|
|
|
|
#undef SPACE
|
|
|
|
#endif
|
1991-03-28 16:26:26 +00:00
|
|
|
#define SPACE 0x020
|
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.
1994-01-16 03:39:57 +00:00
|
|
|
|
|
|
|
#ifdef ESC
|
|
|
|
#undef ESC
|
|
|
|
#endif
|
|
|
|
|
1991-03-28 16:26:26 +00:00
|
|
|
#define ESC CTRL('[')
|
|
|
|
|
|
|
|
#endif /* _CHARDEFS_ */
|