00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #if !defined (_RLDEFS_H_)
00027 #define _RLDEFS_H_
00028
00029 #if defined (HAVE_CONFIG_H)
00030 # include "config.h"
00031 #endif
00032
00033 #include "rlstdc.h"
00034
00035 #if defined (_POSIX_VERSION) && !defined (TERMIOS_MISSING)
00036 # define TERMIOS_TTY_DRIVER
00037 #else
00038 # if defined (HAVE_TERMIO_H)
00039 # define TERMIO_TTY_DRIVER
00040 # else
00041 # if !defined (__MINGW32__)
00042 # define NEW_TTY_DRIVER
00043 # else
00044 # define NO_TTY_DRIVER
00045 # endif
00046 # endif
00047 #endif
00048
00049
00050
00051 #if defined (S_IFDIR) && !defined (S_ISDIR)
00052 # define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
00053 #endif
00054
00055
00056
00057
00058 #if defined (HAVE_STRING_H)
00059 # include <string.h>
00060 #else
00061 # include <strings.h>
00062 #endif
00063
00064 #if !defined (strchr) && !defined (__STDC__)
00065 extern char *strchr (), *strrchr ();
00066 #endif
00067
00068 #if defined (PREFER_STDARG)
00069 # include <stdarg.h>
00070 #else
00071 # if defined (PREFER_VARARGS)
00072 # include <varargs.h>
00073 # endif
00074 #endif
00075
00076 #if defined (HAVE_STRCASECMP)
00077 #define _rl_stricmp strcasecmp
00078 #define _rl_strnicmp strncasecmp
00079 #else
00080 extern int _rl_stricmp PARAMS((char *, char *));
00081 extern int _rl_strnicmp PARAMS((char *, char *, int));
00082 #endif
00083
00084 #if defined (HAVE_STRPBRK) && !defined (HAVE_MULTIBYTE)
00085 # define _rl_strpbrk(a,b) strpbrk((a),(b))
00086 #else
00087 extern char *_rl_strpbrk PARAMS((const char *, const char *));
00088 #endif
00089
00090 #if !defined (emacs_mode)
00091 # define no_mode -1
00092 # define vi_mode 0
00093 # define emacs_mode 1
00094 #endif
00095
00096 #if !defined (RL_IM_INSERT)
00097 # define RL_IM_INSERT 1
00098 # define RL_IM_OVERWRITE 0
00099 #
00100 # define RL_IM_DEFAULT RL_IM_INSERT
00101 #endif
00102
00103
00104
00105
00106
00107
00108 #if defined (CRAY)
00109 # define FUNCTION_TO_KEYMAP(map, key) (Keymap)((int)map[key].function)
00110 # define KEYMAP_TO_FUNCTION(data) (rl_command_func_t *)((int)(data))
00111 #else
00112 # define FUNCTION_TO_KEYMAP(map, key) (Keymap)(map[key].function)
00113 # define KEYMAP_TO_FUNCTION(data) (rl_command_func_t *)(data)
00114 #endif
00115
00116 #ifndef savestring
00117 #define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x))
00118 #endif
00119
00120
00121 #define NO_BELL 0
00122 #define AUDIBLE_BELL 1
00123 #define VISIBLE_BELL 2
00124
00125
00126
00127 #define FTO 1
00128 #define BTO -1
00129 #define FFIND 2
00130 #define BFIND -2
00131
00132
00133
00134
00135 #define RL_QF_SINGLE_QUOTE 0x01
00136 #define RL_QF_DOUBLE_QUOTE 0x02
00137 #define RL_QF_BACKSLASH 0x04
00138 #define RL_QF_OTHER_QUOTE 0x08
00139
00140
00141 #define DEFAULT_BUFFER_SIZE 256
00142
00143 #if !defined (STREQ)
00144 #define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
00145 #define STREQN(a, b, n) (((n) == 0) ? (1) \
00146 : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0))
00147 #endif
00148
00149 #if !defined (FREE)
00150 # define FREE(x) if (x) free (x)
00151 #endif
00152
00153 #if !defined (SWAP)
00154 # define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0)
00155 #endif
00156
00157
00158 #include "rlconf.h"
00159
00160 #endif