| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | /* rldefs.h -- an attempt to isolate some of the system-specific defines
 | 
					
						
							|  |  |  |    for readline.  This should be included after any files that define | 
					
						
							|  |  |  |    system-specific constants like _POSIX_VERSION or USG. */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  | /* Copyright (C) 1987-2009 Free Software Foundation, Inc.
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  |    This file is part of the GNU Readline Library (Readline), a library | 
					
						
							|  |  |  |    for reading lines of text with interactive input and history editing.       | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  |    Readline is free software: you can redistribute it and/or modify | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  |    it under the terms of the GNU General Public License as published by | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  |    the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  |    (at your option) any later version. | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  |    Readline is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |    GNU General Public License for more details. | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  |    You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |    along with Readline.  If not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #if !defined (_RLDEFS_H_)
 | 
					
						
							|  |  |  | #define _RLDEFS_H_
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #if defined (HAVE_CONFIG_H)
 | 
					
						
							|  |  |  | #  include "config.h"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-06 19:14:31 +00:00
										 |  |  | #include "rlstdc.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-12 13:36:28 +00:00
										 |  |  | #if defined (STRCOLL_BROKEN)
 | 
					
						
							|  |  |  | #  undef HAVE_STRCOLL
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #if defined (_POSIX_VERSION) && !defined (TERMIOS_MISSING)
 | 
					
						
							|  |  |  | #  define TERMIOS_TTY_DRIVER
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #  if defined (HAVE_TERMIO_H)
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | #    define TERMIO_TTY_DRIVER
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #  else
 | 
					
						
							| 
									
										
										
										
											2005-12-07 14:08:12 +00:00
										 |  |  | #    if !defined (__MINGW32__)
 | 
					
						
							|  |  |  | #      define NEW_TTY_DRIVER
 | 
					
						
							|  |  |  | #    else
 | 
					
						
							|  |  |  | #      define NO_TTY_DRIVER
 | 
					
						
							|  |  |  | #    endif
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #  endif
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Posix macro to check file in statbuf for directory-ness.
 | 
					
						
							|  |  |  |    This requires that <sys/stat.h> be included before this test. */ | 
					
						
							|  |  |  | #if defined (S_IFDIR) && !defined (S_ISDIR)
 | 
					
						
							|  |  |  | #  define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Decide which flavor of the header file describing the C library
 | 
					
						
							|  |  |  |    string functions to include and include it. */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined (HAVE_STRING_H)
 | 
					
						
							|  |  |  | #  include <string.h>
 | 
					
						
							|  |  |  | #else /* !HAVE_STRING_H */
 | 
					
						
							|  |  |  | #  include <strings.h>
 | 
					
						
							|  |  |  | #endif /* !HAVE_STRING_H */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if !defined (strchr) && !defined (__STDC__)
 | 
					
						
							|  |  |  | extern char *strchr (), *strrchr (); | 
					
						
							|  |  |  | #endif /* !strchr && !__STDC__ */
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #if defined (PREFER_STDARG)
 | 
					
						
							|  |  |  | #  include <stdarg.h>
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #  if defined (PREFER_VARARGS)
 | 
					
						
							|  |  |  | #    include <varargs.h>
 | 
					
						
							|  |  |  | #  endif
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #if defined (HAVE_STRCASECMP)
 | 
					
						
							|  |  |  | #define _rl_stricmp strcasecmp
 | 
					
						
							|  |  |  | #define _rl_strnicmp strncasecmp
 | 
					
						
							|  |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2001-11-13 17:56:06 +00:00
										 |  |  | extern int _rl_stricmp PARAMS((char *, char *)); | 
					
						
							| 
									
										
										
										
											2002-07-17 14:10:11 +00:00
										 |  |  | extern int _rl_strnicmp PARAMS((char *, char *, int)); | 
					
						
							| 
									
										
										
										
											2001-11-13 17:56:06 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-27 13:29:18 +00:00
										 |  |  | #if defined (HAVE_STRPBRK) && !defined (HAVE_MULTIBYTE)
 | 
					
						
							| 
									
										
										
										
											2001-11-13 17:56:06 +00:00
										 |  |  | #  define _rl_strpbrk(a,b)	strpbrk((a),(b))
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | extern char *_rl_strpbrk PARAMS((const char *, const char *)); | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #if !defined (emacs_mode)
 | 
					
						
							|  |  |  | #  define no_mode -1
 | 
					
						
							|  |  |  | #  define vi_mode 0
 | 
					
						
							|  |  |  | #  define emacs_mode 1
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-07-17 14:10:11 +00:00
										 |  |  | #if !defined (RL_IM_INSERT)
 | 
					
						
							|  |  |  | #  define RL_IM_INSERT		1
 | 
					
						
							|  |  |  | #  define RL_IM_OVERWRITE	0
 | 
					
						
							|  |  |  | #
 | 
					
						
							|  |  |  | #  define RL_IM_DEFAULT		RL_IM_INSERT
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | /* If you cast map[key].function to type (Keymap) on a Cray,
 | 
					
						
							|  |  |  |    the compiler takes the value of map[key].function and | 
					
						
							|  |  |  |    divides it by 4 to convert between pointer types (pointers | 
					
						
							|  |  |  |    to functions and pointers to structs are different sizes). | 
					
						
							|  |  |  |    This is not what is wanted. */ | 
					
						
							|  |  |  | #if defined (CRAY)
 | 
					
						
							|  |  |  | #  define FUNCTION_TO_KEYMAP(map, key)	(Keymap)((int)map[key].function)
 | 
					
						
							| 
									
										
										
										
											2001-04-06 19:14:31 +00:00
										 |  |  | #  define KEYMAP_TO_FUNCTION(data)	(rl_command_func_t *)((int)(data))
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | #else
 | 
					
						
							|  |  |  | #  define FUNCTION_TO_KEYMAP(map, key)	(Keymap)(map[key].function)
 | 
					
						
							| 
									
										
										
										
											2001-04-06 19:14:31 +00:00
										 |  |  | #  define KEYMAP_TO_FUNCTION(data)	(rl_command_func_t *)(data)
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef savestring
 | 
					
						
							| 
									
										
										
										
											2001-11-13 17:56:06 +00:00
										 |  |  | #define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x))
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Possible values for _rl_bell_preference. */ | 
					
						
							|  |  |  | #define NO_BELL 0
 | 
					
						
							|  |  |  | #define AUDIBLE_BELL 1
 | 
					
						
							|  |  |  | #define VISIBLE_BELL 2
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | /* Definitions used when searching the line for characters. */ | 
					
						
							|  |  |  | /* NOTE: it is necessary that opposite directions are inverses */ | 
					
						
							|  |  |  | #define	FTO	 1		/* forward to */
 | 
					
						
							|  |  |  | #define BTO	-1		/* backward to */
 | 
					
						
							|  |  |  | #define FFIND	 2		/* forward find */
 | 
					
						
							|  |  |  | #define BFIND	-2		/* backward find */
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Possible values for the found_quote flags word used by the completion
 | 
					
						
							|  |  |  |    functions.  It says what kind of (shell-like) quoting we found anywhere | 
					
						
							|  |  |  |    in the line. */ | 
					
						
							| 
									
										
										
										
											2002-07-17 14:10:11 +00:00
										 |  |  | #define RL_QF_SINGLE_QUOTE	0x01
 | 
					
						
							|  |  |  | #define RL_QF_DOUBLE_QUOTE	0x02
 | 
					
						
							|  |  |  | #define RL_QF_BACKSLASH		0x04
 | 
					
						
							|  |  |  | #define RL_QF_OTHER_QUOTE	0x08
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* Default readline line buffer length. */ | 
					
						
							|  |  |  | #define DEFAULT_BUFFER_SIZE 256
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if !defined (STREQ)
 | 
					
						
							|  |  |  | #define STREQ(a, b)	(((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
 | 
					
						
							| 
									
										
										
										
											2000-03-17 21:46:59 +00:00
										 |  |  | #define STREQN(a, b, n)	(((n) == 0) ? (1) \
 | 
					
						
							|  |  |  | 				    : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0)) | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if !defined (FREE)
 | 
					
						
							|  |  |  | #  define FREE(x)	if (x) free (x)
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-07-17 14:10:11 +00:00
										 |  |  | #if !defined (SWAP)
 | 
					
						
							|  |  |  | #  define SWAP(s, e)  do { int t; t = s; s = e; e = t; } while (0)
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-08-26 18:22:31 +00:00
										 |  |  | /* CONFIGURATION SECTION */ | 
					
						
							|  |  |  | #include "rlconf.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											1996-12-23 17:02:34 +00:00
										 |  |  | #endif /* !_RLDEFS_H_ */
 |